eligius 1.0.8 → 1.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"eligius.cjs.production.min.js","sources":["../src/util/prepare-value-for-serialization.ts","../src/diagnostics/devtool-event-lister.ts","../src/diagnostics/diagnostics.ts","../src/operation/helper/deep-copy.ts","../src/action/action.ts","../src/action/is-promise.ts","../src/action/endable-action.ts","../src/action/timeline-action.ts","../src/build/generate-importer-source-code.ts","../src/operation/helper/get-nested-value.ts","../src/configuration/configuration-resolver.ts","../src/operation/helper/get-nested-property-value.ts","../src/timeline-event-names.ts","../src/controllers/event-listener-controller.ts","../src/controllers/label-controller.ts","../src/controllers/lottie-controller.ts","../src/controllers/navigation-controller.ts","../src/controllers/progressbar-controller.ts","../src/controllers/routing-controller.ts","../src/controllers/subtitles-controller.ts","../src/eligius-engine.ts","../src/eventbus/actionregistry-eventbus-listener.ts","../src/eventbus/eventbus.ts","../src/eventbus/request-video-uri-interceptor.ts","../src/language-manager.ts","../src/engine-factory.ts","../src/operation/add-class.ts","../src/operation/helper/get-element-data.ts","../src/operation/helper/merge-operation-data.ts","../src/operation/helper/internal-resolve.ts","../src/operation/add-controller-to-element.ts","../src/operation/helper/attach-controller-to-element.ts","../src/operation/animate.ts","../src/operation/animate-with-class.ts","../src/operation/helper/extract-operation-data-argument-values.ts","../src/operation/broadcast-event.ts","../src/operation/helper/resolve-event-arguments.ts","../src/operation/helper/remove-event-data-from-operation-data.ts","../src/operation/helper/resolve-property-values.ts","../src/operation/calc.ts","../src/operation/clear-element.ts","../src/operation/clear-operation-data.ts","../src/operation/create-element.ts","../src/operation/custom-function.ts","../src/operation/end-action.ts","../src/operation/end-loop.ts","../src/operation/extend-controller.ts","../src/operation/get-controller-from-element.ts","../src/operation/get-controller-instance.ts","../src/operation/get-element-dimensions.ts","../src/operation/helper/modify-dimensions.ts","../src/operation/get-import.ts","../src/operation/load-json.ts","../src/operation/log.ts","../src/operation/math.ts","../src/operation/remove-class.ts","../src/operation/remove-controller-from-element.ts","../src/operation/remove-element.ts","../src/operation/remove-properties-from-operation-data.ts","../src/operation/reparent-element.ts","../src/operation/request-action.ts","../src/operation/resize-action.ts","../src/operation/select-element.ts","../src/operation/set-element-attributes.ts","../src/operation/set-element-content.ts","../src/operation/set-operation-data.ts","../src/operation/set-style.ts","../src/operation/start-action.ts","../src/operation/start-loop.ts","../src/operation/toggle-class.ts","../src/operation/toggle-element.ts","../src/operation/wait.ts","../src/timelineproviders/jwplayer-timeline-provider.ts","../src/timelineproviders/request-animation-frame-timeline-provider.ts","../src/util/animation-interval.ts","../src/importer/eligius-resource-importer.ts","../src/operation/metadata/add-class.ts","../src/operation/metadata/add-controller-to-element.ts","../src/operation/metadata/animate.ts","../src/operation/metadata/animate-with-class.ts","../src/operation/metadata/broadcast-event.ts","../src/operation/metadata/calc.ts","../src/operation/metadata/clear-element.ts","../src/operation/metadata/clear-operation-data.ts","../src/operation/metadata/create-element.ts","../src/operation/metadata/custom-function.ts","../src/operation/metadata/end-action.ts","../src/operation/metadata/end-loop.ts","../src/operation/metadata/extend-controller.ts","../src/operation/metadata/get-controller-from-element.ts","../src/operation/metadata/get-controller-instance.ts","../src/operation/metadata/get-element-dimensions.ts","../src/operation/metadata/get-import.ts","../src/operation/metadata/load-json.ts","../src/operation/metadata/log.ts","../src/operation/metadata/math.ts","../src/operation/metadata/remove-class.ts","../src/operation/metadata/remove-controller-from-element.ts","../src/operation/metadata/remove-element.ts","../src/operation/metadata/remove-properties-from-operation-data.ts","../src/operation/metadata/reparent-element.ts","../src/operation/metadata/request-action.ts","../src/operation/metadata/resize-action.ts","../src/operation/metadata/select-element.ts","../src/operation/metadata/set-element-attributes.ts","../src/operation/metadata/set-element-content.ts","../src/operation/metadata/set-operation-data.ts","../src/operation/metadata/set-style.ts","../src/operation/metadata/start-action.ts","../src/operation/metadata/start-loop.ts","../src/operation/metadata/toggle-class.ts","../src/operation/metadata/toggle-element.ts","../src/operation/metadata/wait.ts","../src/diagnostics/types.ts","../src/util/dash-to-camel-case.ts"],"sourcesContent":["import jQuery from 'jquery';\r\n\r\nexport function prepareValueForSerialization(value: any): any {\r\n if (Array.isArray(value)) {\r\n return (value as Array<any>).map(prepareValueForSerialization);\r\n } else if (value instanceof jQuery) {\r\n return 'jQuery object';\r\n } else if (typeof value === 'object') {\r\n return Object.fromEntries(\r\n Object.entries(value).map(([propName, propValue]) => [\r\n propName,\r\n prepareValueForSerialization(propValue),\r\n ])\r\n );\r\n } else if (typeof value === 'function') {\r\n const funcString: string = value.toString();\r\n const paranIndex = funcString.indexOf('{');\r\n if (paranIndex > -1) {\r\n return funcString.substring(0, funcString.indexOf('{') + 1);\r\n }\r\n return funcString;\r\n }\r\n return value;\r\n}\r\n","import { IEventbusListener } from '../eventbus';\r\nimport { prepareValueForSerialization } from '../util/prepare-value-for-serialization';\r\nimport { IDiagnosticsAgent } from './types';\r\n\r\nexport class DevToolEventListener implements IEventbusListener {\r\n constructor(private agent: IDiagnosticsAgent) {}\r\n\r\n handleEvent(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any[]\r\n ): void {\r\n const message = {\r\n eventName,\r\n eventTopic,\r\n args: prepareValueForSerialization(args),\r\n };\r\n try {\r\n this.agent.postMessage('eligius-diagnostics-event', message);\r\n } catch (e) {\r\n console.error('postmessage failed');\r\n console.error(e);\r\n console.log('message', message);\r\n }\r\n }\r\n}\r\n","import { TDiagnosticType } from './types';\r\n\r\nexport class Diagnostics {\r\n static send(_name: TDiagnosticType, _data: any): void {\r\n console.log(_name, _data);\r\n }\r\n static active: boolean;\r\n}\r\n","import { isDefined } from 'ts-is-present';\r\n\r\nconst copyFunction =\r\n typeof structuredClone !== 'undefined'\r\n ? structuredClone\r\n : (original: any) => JSON.parse(JSON.stringify(original));\r\n\r\nexport function deepCopy<T>(original: T): T {\r\n if (isDefined(original)) {\r\n return copyFunction(original) as T;\r\n }\r\n return original;\r\n}\r\n","import { IResolvedOperation } from '../configuration/types';\r\nimport { Diagnostics } from '../diagnostics';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { deepCopy } from '../operation/helper/deep-copy';\r\nimport {\r\n IOperationContext,\r\n TOperationData,\r\n TOperationResult,\r\n} from '../operation/types';\r\nimport { isPromise } from './is-promise';\r\nimport { IAction } from './types';\r\n\r\nexport class Action implements IAction {\r\n public id = '';\r\n\r\n constructor(\r\n public name: string,\r\n public startOperations: IResolvedOperation[],\r\n protected eventbus: IEventbus\r\n ) {}\r\n\r\n start(initOperationData?: TOperationData): Promise<TOperationData> {\r\n Diagnostics.active &&\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} begins executing start operations`\r\n );\r\n\r\n const context: IOperationContext = {\r\n currentIndex: -1,\r\n eventbus: this.eventbus,\r\n };\r\n\r\n const result = new Promise<TOperationData>((resolve, reject) => {\r\n this.executeOperation(\r\n this.startOperations,\r\n 0,\r\n resolve,\r\n reject,\r\n initOperationData,\r\n context\r\n );\r\n }).catch((e) => {\r\n Diagnostics.active &&\r\n Diagnostics.send('eligius-diagnostics-action-error', {\r\n name,\r\n error: e,\r\n });\r\n console.error(`Error in action start '${this.name}'`);\r\n console.error(e);\r\n throw e;\r\n });\r\n return !Diagnostics.active\r\n ? result\r\n : result.then((operationsResult) => {\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} finished executing start operations`\r\n );\r\n return operationsResult;\r\n });\r\n }\r\n\r\n executeOperation(\r\n operations: IResolvedOperation[],\r\n idx: number,\r\n resolve: (value?: any | PromiseLike<any>) => void,\r\n reject: (reason?: any) => void,\r\n previousOperationData: TOperationData | undefined = {},\r\n context: IOperationContext\r\n ): void {\r\n if (context.newIndex !== undefined) {\r\n idx = context.newIndex;\r\n delete context.newIndex;\r\n }\r\n\r\n context.currentIndex = idx;\r\n\r\n if (context.skipNextOperation) {\r\n if (idx < operations.length) {\r\n this.executeOperation(\r\n operations,\r\n ++idx,\r\n resolve,\r\n reject,\r\n previousOperationData,\r\n context\r\n );\r\n } else {\r\n resolve(previousOperationData);\r\n }\r\n }\r\n\r\n if (idx < operations.length) {\r\n const operationInfo = operations[idx];\r\n\r\n const copy = operationInfo.operationData\r\n ? deepCopy(operationInfo.operationData)\r\n : {};\r\n const mergedOperationData = Object.assign(previousOperationData, copy);\r\n\r\n Diagnostics.active &&\r\n Diagnostics.send('eligius-diagnostics-operation', {\r\n systemName: operationInfo.systemName,\r\n operationData: mergedOperationData,\r\n context: {\r\n ...context,\r\n eventbus: undefined,\r\n },\r\n });\r\n\r\n const operationResult: TOperationResult = operationInfo.instance.call(\r\n context,\r\n mergedOperationData\r\n );\r\n\r\n if (isPromise(operationResult)) {\r\n operationResult\r\n .then((promisedOperationResult: TOperationData) => {\r\n this.executeOperation(\r\n operations,\r\n ++idx,\r\n resolve,\r\n reject,\r\n promisedOperationResult,\r\n context\r\n );\r\n })\r\n .catch((error: any) => {\r\n reject(error);\r\n });\r\n } else {\r\n this.executeOperation(\r\n operations,\r\n ++idx,\r\n resolve,\r\n reject,\r\n operationResult,\r\n context\r\n );\r\n }\r\n } else {\r\n resolve(previousOperationData);\r\n }\r\n }\r\n}\r\n","export function isPromise(obj: any): obj is Promise<unknown> {\r\n return typeof obj === 'object' && typeof obj.then === 'function';\r\n}\r\n","import { IResolvedOperation } from '../configuration/types';\r\nimport { Diagnostics } from '../diagnostics';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { IOperationContext, TOperationData } from '../operation/types';\r\nimport { Action } from './action';\r\n\r\nexport class EndableAction extends Action {\r\n constructor(\r\n name: string,\r\n startOperations: IResolvedOperation[],\r\n public endOperations: IResolvedOperation[],\r\n eventBus: IEventbus\r\n ) {\r\n super(name, startOperations, eventBus);\r\n }\r\n\r\n end(initOperationData?: TOperationData): Promise<TOperationData | undefined> {\r\n Diagnostics.active &&\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} begins executing end operations`\r\n );\r\n\r\n if (!this.endOperations.length) {\r\n return Promise.resolve(initOperationData);\r\n }\r\n\r\n const context: IOperationContext = {\r\n currentIndex: -1,\r\n eventbus: this.eventbus,\r\n };\r\n\r\n const result = new Promise<TOperationData>((resolve, reject) => {\r\n this.executeOperation(\r\n this.endOperations,\r\n 0,\r\n resolve,\r\n reject,\r\n initOperationData,\r\n context\r\n );\r\n }).catch((e) => {\r\n console.error(`Error in action end '${this.name}'`);\r\n throw e;\r\n });\r\n\r\n return !Diagnostics.active\r\n ? result\r\n : result.then((operationsResult) => {\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} finished executing start operations`\r\n );\r\n return operationsResult;\r\n });\r\n }\r\n}\r\n","import { IResolvedOperation } from '../configuration/types';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { IStrictDuration } from '../types';\r\nimport { EndableAction } from './endable-action';\r\n\r\nexport class TimelineAction extends EndableAction {\r\n public active = false;\r\n\r\n constructor(\r\n name: string,\r\n startOperations: IResolvedOperation[],\r\n endOperations: IResolvedOperation[],\r\n public duration: IStrictDuration,\r\n eventBus: IEventbus\r\n ) {\r\n super(name, startOperations, endOperations, eventBus);\r\n }\r\n\r\n start(initOperationData: TOperationData): Promise<TOperationData> {\r\n if (!this.active || this.duration.end < 0) {\r\n this.active = this.duration.end > -1;\r\n return super.start(initOperationData);\r\n }\r\n\r\n return new Promise<void>((resolve) => {\r\n resolve();\r\n });\r\n }\r\n\r\n end(initOperationData: TOperationData): Promise<TOperationData> {\r\n this.active = false;\r\n return super.end(initOperationData);\r\n }\r\n}\r\n","import fs from 'fs';\r\nimport path from 'path';\r\nimport {\r\n IActionConfiguration,\r\n IEndableActionConfiguration,\r\n IEngineConfiguration,\r\n IOperationConfiguration,\r\n} from '../configuration/types';\r\nimport dashToCamelCase from '../util/dash-to-camel-case';\r\n\r\ninterface ImportInfo {\r\n systemName: string;\r\n path?: string;\r\n defaultImport?: boolean;\r\n}\r\n\r\nexport interface IAssetInfo {\r\n path: string;\r\n extension: string;\r\n}\r\n\r\n/**\r\n * This function takes an Eligius engine configuration, a root path for the config and an arbitrary list of asset info.\r\n * The asset info determines a number of subdirectories in the root path that contain the different assets used by the presentation.\r\n * I.e. html, json, etc.\r\n *\r\n * @param config\r\n * @param configPath\r\n * @param assetInfo\r\n */\r\nexport function generateImporterSourceCode(\r\n config: IEngineConfiguration,\r\n configPath: string,\r\n assetInfo: IAssetInfo[]\r\n) {\r\n const importPaths = _gatherImportPaths(config, configPath, assetInfo);\r\n\r\n const importerSourceCode = _generateSourceCode(importPaths);\r\n\r\n return importerSourceCode;\r\n}\r\n\r\nfunction _generateSourceCode(importPaths: ImportInfo[]) {\r\n const result = importPaths\r\n .filter((x) => x.defaultImport)\r\n .map((imp) => `import ${imp.systemName} from '${imp.path}';`)\r\n .concat(\r\n importPaths\r\n .filter((x) => !x.defaultImport)\r\n .map(\r\n (imp) => `import {${imp.systemName}} from '${imp.path ?? 'eligius'}';`\r\n )\r\n );\r\n result.push(`import { ISimpleResourceImporter } from 'eligius';`);\r\n result.push('');\r\n\r\n result.push('const imports: Record<string, any> = {');\r\n result.push(\r\n ...importPaths.map(\r\n (imp) => `${imp.systemName}: { '${imp.systemName}': ${imp.systemName} },`\r\n )\r\n );\r\n result.push('};');\r\n result.push('');\r\n result.push(\r\n 'class EligiusResourceImporter implements ISimpleResourceImporter {'\r\n );\r\n result.push('import(name: string): Record<string, any> {');\r\n result.push('if (imports.hasOwnProperty(name)) { return imports[name]; }');\r\n result.push('throw Error(`Unknown systemName: ${name}`);');\r\n result.push('}}');\r\n result.push('');\r\n result.push('export default EligiusResourceImporter;');\r\n\r\n return result.join('\\n');\r\n}\r\n\r\nfunction _gatherImportPaths(\r\n config: IEngineConfiguration,\r\n configPath: string,\r\n assetInfo: IAssetInfo[]\r\n): ImportInfo[] {\r\n return [\r\n ..._gatherOperations(config),\r\n ...assetInfo.flatMap((info) =>\r\n _gatherAssets(configPath, info.path, info.extension)\r\n ),\r\n ..._gatherControllers(config),\r\n ..._gatherProviders(config),\r\n ..._gatherEngines(config),\r\n ];\r\n}\r\n\r\nfunction _gatherAssets(assetPath: string, subdir: string, extension: string) {\r\n const entries = fs.readdirSync(path.join(assetPath, subdir));\r\n return entries.map((file) => {\r\n const importName = `${dashToCamelCase(path.basename(file, extension))}`;\r\n return {\r\n systemName: importName,\r\n path: `./${subdir}/${file}`,\r\n defaultImport: true,\r\n };\r\n });\r\n}\r\n\r\nfunction _gatherControllers(config: IEngineConfiguration) {\r\n let importPaths = [] as [] as ImportInfo[];\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(config.initActions)\r\n );\r\n importPaths.push(..._gatherControllerImportPathsFromActions(config.actions));\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(\r\n config.timelines.flatMap((x) => x.timelineActions)\r\n )\r\n );\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(config.eventActions)\r\n );\r\n importPaths = dedupe(importPaths);\r\n return importPaths;\r\n}\r\n\r\nfunction _gatherProviders(config: any) {\r\n if (config.timelineProviderSettings) {\r\n return Object.values(config.timelineProviderSettings).map<ImportInfo>(\r\n (settings: any) => {\r\n return {\r\n systemName: settings.systemName,\r\n };\r\n }\r\n );\r\n }\r\n return [] as ImportInfo[];\r\n}\r\n\r\nfunction _gatherEngines(config: any) {\r\n if (config.engine) {\r\n const { systemName } = config.engine;\r\n return [\r\n {\r\n systemName,\r\n },\r\n ];\r\n }\r\n return [];\r\n}\r\n\r\nfunction _gatherOperations(config: IEngineConfiguration): ImportInfo[] {\r\n let importPaths = _gatherOperationImportPathsFromActions(\r\n config.initActions\r\n .concat(config.actions)\r\n .concat(config.eventActions ?? ([] as any[]))\r\n );\r\n\r\n if (config.timelines) {\r\n const timelineActions = config.timelines.flatMap((x) => x.timelineActions);\r\n\r\n importPaths = importPaths.concat(\r\n _gatherOperationImportPathsFromActions(timelineActions)\r\n );\r\n }\r\n\r\n return dedupe(importPaths);\r\n}\r\n\r\nfunction _gatherControllerImportPathsFromActions(\r\n actionsConfig?: IActionConfiguration[] | IEndableActionConfiguration[]\r\n): ImportInfo[] {\r\n if (!actionsConfig) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n const operations = actionsConfig.flatMap((x) => [\r\n ...x.startOperations,\r\n ...((x as any).endOperations ?? []),\r\n ]);\r\n\r\n return _gatherControllerImportPaths(operations);\r\n}\r\n\r\nfunction _gatherOperationImportPathsFromActions(\r\n actionsConfig?: IActionConfiguration[] | IEndableActionConfiguration[]\r\n): ImportInfo[] {\r\n if (!actionsConfig) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n const operations = actionsConfig.flatMap((x) => [\r\n ...x.startOperations,\r\n ...((x as any).endOperations ?? []),\r\n ]);\r\n\r\n return _gatherOperationImportPaths(operations);\r\n}\r\n\r\nfunction _gatherControllerImportPaths(\r\n operationConfigs: IOperationConfiguration[]\r\n): ImportInfo[] {\r\n if (!operationConfigs) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n return operationConfigs\r\n .filter((operationConfig) => {\r\n if (operationConfig.operationData?.hasOwnProperty('systemName')) {\r\n return operationConfig.operationData.systemName.endsWith('Controller');\r\n }\r\n return false;\r\n })\r\n .map((operationConfig) => {\r\n const { systemName } = operationConfig.operationData;\r\n return {\r\n systemName,\r\n };\r\n });\r\n}\r\n\r\nfunction _gatherOperationImportPaths(operationConfigs: any[]): ImportInfo[] {\r\n if (!operationConfigs) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n return operationConfigs.map((operationConfig) => {\r\n const { systemName } = operationConfig;\r\n return {\r\n systemName,\r\n };\r\n });\r\n}\r\n\r\nfunction dedupe(importPaths: ImportInfo[]): ImportInfo[] {\r\n const lookup: Record<string, true> = {};\r\n return importPaths.filter((imp) => {\r\n if (lookup[imp.systemName]) {\r\n return false;\r\n }\r\n lookup[imp.systemName] = true;\r\n return true;\r\n });\r\n}\r\n","export function getNestedValue(properties: any, sourceObject: any) {\r\n if (!properties) {\r\n throw Error('properties arg cannot be null');\r\n }\r\n\r\n if (!sourceObject) {\r\n throw Error('sourceObject arg cannot be null');\r\n }\r\n\r\n let currentInstance = sourceObject;\r\n let suffix = null;\r\n\r\n properties.forEach((prop: string, index: number) => {\r\n if (index === properties.length - 1) {\r\n const parts = prop.split('+');\r\n if (parts.length > 1) {\r\n prop = parts[0];\r\n suffix = parts[1];\r\n }\r\n }\r\n currentInstance = currentInstance[prop];\r\n });\r\n\r\n return suffix ? currentInstance + suffix : currentInstance;\r\n}\r\n","import { isDefined } from 'ts-is-present';\r\nimport { Action, EndableAction, TimelineAction } from '../action';\r\nimport { IAction } from '../action/types';\r\nimport { ActionRegistryEventbusListener } from '../eventbus';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { deepCopy } from '../operation/helper/deep-copy';\r\nimport { getNestedPropertyValue } from '../operation/helper/get-nested-property-value';\r\nimport { IConfigurationResolver, ISimpleResourceImporter } from '../types';\r\nimport {\r\n IActionConfiguration,\r\n IEndableActionConfiguration,\r\n IEngineConfiguration,\r\n IEventActionConfiguration,\r\n IOperationConfiguration,\r\n IResolvedEngineConfiguration,\r\n IResolvedOperation,\r\n IResolvedTimelineConfiguration,\r\n ITimelineActionConfiguration,\r\n ITimelineConfiguration,\r\n} from './types';\r\n\r\nexport class ConfigurationResolver implements IConfigurationResolver {\r\n constructor(\r\n private importer: ISimpleResourceImporter,\r\n private eventbus: IEventbus\r\n ) {}\r\n\r\n process(\r\n configuration: IEngineConfiguration,\r\n actionRegistryListener?: ActionRegistryEventbusListener\r\n ): [Record<string, IAction>, IResolvedEngineConfiguration] {\r\n resolvePlaceholders(configuration, configuration, this.importer);\r\n\r\n if (!isDefined(configuration.timelineProviderSettings)) {\r\n throw new Error(\r\n 'Configuration incomplete: it needs to have at least one timeline provider setting'\r\n );\r\n }\r\n\r\n const resolvedConfig: IResolvedEngineConfiguration = {\r\n id: configuration.id,\r\n engine: { ...configuration.engine },\r\n timelineProviderSettings: deepCopy(\r\n configuration.timelineProviderSettings\r\n ),\r\n containerSelector: configuration.containerSelector,\r\n language: configuration.language,\r\n layoutTemplate: configuration.layoutTemplate,\r\n availableLanguages: deepCopy(configuration.availableLanguages),\r\n actions: resolveActions(\r\n configuration.actions,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n initActions: resolveActions(\r\n configuration.initActions,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n labels: deepCopy(configuration.labels),\r\n timelineFlow: deepCopy(configuration.timelineFlow),\r\n timelines: resolveTimelines(\r\n configuration.timelines,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n };\r\n\r\n let eventActions: IAction[] = [];\r\n if (configuration.eventActions && actionRegistryListener) {\r\n eventActions = resolveEventActions(\r\n configuration.eventActions,\r\n actionRegistryListener,\r\n this.importer,\r\n this.eventbus\r\n );\r\n }\r\n\r\n const actionsLookup = (resolvedConfig.actions as IAction[])\r\n .concat(eventActions)\r\n .reduce<Record<string, IAction>>(\r\n (aggr, action) => ({\r\n ...aggr,\r\n [action.name]: action,\r\n }),\r\n {}\r\n );\r\n\r\n return [actionsLookup, resolvedConfig];\r\n }\r\n}\r\n\r\nfunction resolveEventActions(\r\n eventActionConfigurations: IEventActionConfiguration[],\r\n actionRegistryListener: ActionRegistryEventbusListener,\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolvedConfigs =\r\n eventActionConfigurations.map<IResolvedActionConfiguration>((config) => {\r\n return resolveActionConfiguration(config, importer);\r\n });\r\n\r\n return resolvedConfigs.map((config, index) => {\r\n const { eventName, eventTopic } = eventActionConfigurations[index];\r\n const eventAction = new Action(\r\n config.name,\r\n config.startOperations,\r\n eventbus\r\n );\r\n actionRegistryListener.registerAction(eventAction, eventName, eventTopic);\r\n return eventAction;\r\n });\r\n}\r\n\r\nfunction resolveTimelines(\r\n timelines: ITimelineConfiguration[],\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolve = resolveTimelineAction.bind(null, importer, eventbus);\r\n\r\n return timelines.map<IResolvedTimelineConfiguration>((config) => ({\r\n ...config,\r\n timelineActions: config.timelineActions.map(resolve),\r\n }));\r\n}\r\n\r\nfunction resolveOperation(\r\n importer: ISimpleResourceImporter,\r\n operationConfig: IOperationConfiguration\r\n): IResolvedOperation {\r\n return {\r\n id: operationConfig.id,\r\n systemName: operationConfig.systemName,\r\n operationData: deepCopy(operationConfig.operationData),\r\n instance: importer.import(operationConfig.systemName)[\r\n operationConfig.systemName\r\n ],\r\n };\r\n}\r\n\r\nfunction resolveActionConfiguration(\r\n config: IActionConfiguration,\r\n importer: ISimpleResourceImporter\r\n): IResolvedActionConfiguration {\r\n const resolve = resolveOperation.bind(null, importer);\r\n\r\n return {\r\n id: config.id,\r\n name: config.name,\r\n startOperations: config.startOperations.map(resolve),\r\n };\r\n}\r\n\r\nfunction resolveEndableActionConfiguration(\r\n config: IEndableActionConfiguration,\r\n importer: ISimpleResourceImporter\r\n): IResolvedEndableActionConfiguration {\r\n const resolve = resolveOperation.bind(null, importer);\r\n\r\n const action = resolveActionConfiguration(config, importer);\r\n\r\n return {\r\n ...action,\r\n endOperations: config.endOperations.map(resolve),\r\n };\r\n}\r\n\r\nfunction resolveTimelineAction(\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus,\r\n actionConfiguration: ITimelineActionConfiguration\r\n) {\r\n const resolvedConfig = resolveEndableActionConfiguration(\r\n actionConfiguration,\r\n importer\r\n );\r\n const duration = {\r\n end: actionConfiguration.duration.end ?? -1,\r\n start: actionConfiguration.duration.start,\r\n };\r\n\r\n const { id, name, endOperations, startOperations } = resolvedConfig;\r\n const action = new TimelineAction(\r\n name,\r\n startOperations,\r\n endOperations,\r\n duration,\r\n eventbus\r\n );\r\n action.id = id;\r\n return action;\r\n}\r\n\r\nfunction resolveActions(\r\n actionConfigurations: IEndableActionConfiguration[],\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolvedConfigs =\r\n actionConfigurations.map<IResolvedEndableActionConfiguration>((config) => {\r\n return resolveEndableActionConfiguration(config, importer);\r\n });\r\n\r\n return resolvedConfigs.map<EndableAction>((resolvedConfig) => {\r\n const { name, endOperations, startOperations } = resolvedConfig;\r\n const action = new EndableAction(\r\n name,\r\n startOperations,\r\n endOperations,\r\n eventbus\r\n );\r\n action.id = resolvedConfig.id;\r\n return action;\r\n });\r\n}\r\n\r\nfunction resolvePlaceholders(\r\n configFragment: Record<string, any> | any[],\r\n rootConfig: any,\r\n importer: ISimpleResourceImporter\r\n) {\r\n if (!isDefined(configFragment)) {\r\n return;\r\n }\r\n\r\n if (Array.isArray(configFragment)) {\r\n configFragment.forEach((item) => {\r\n resolvePlaceholders(item, rootConfig, importer);\r\n });\r\n } else {\r\n Object.keys(configFragment).forEach((key) => {\r\n resolvePlaceholder(key, configFragment, rootConfig, importer);\r\n });\r\n }\r\n}\r\n\r\nfunction resolvePlaceholder(\r\n key: string,\r\n configFragment: any,\r\n rootConfig: any,\r\n importer: ISimpleResourceImporter\r\n) {\r\n const configValue = configFragment[key];\r\n if (typeof configValue === 'string') {\r\n if (configValue.startsWith('config:')) {\r\n const configProperty = configValue.substring(7, configValue.length);\r\n configFragment[key] = getNestedPropertyValue(configProperty, rootConfig);\r\n } else if (configValue.startsWith('template:')) {\r\n const templateKey = configValue.substring(9, configValue.length);\r\n const template = importer.import(templateKey)[templateKey];\r\n configFragment[key] = template;\r\n } else if (configValue.startsWith('json:')) {\r\n const jsonKey = configValue.substring(5, configValue.length);\r\n const json = importer.import(jsonKey)[jsonKey];\r\n configFragment[key] = json;\r\n }\r\n } else if (typeof configValue === 'object') {\r\n resolvePlaceholders(configValue, rootConfig, importer);\r\n }\r\n}\r\n\r\ninterface IResolvedActionConfiguration {\r\n id: string;\r\n name: string;\r\n startOperations: IResolvedOperation[];\r\n}\r\n\r\ninterface IResolvedEndableActionConfiguration\r\n extends IResolvedActionConfiguration {\r\n endOperations: IResolvedOperation[];\r\n}\r\n\r\ninterface IResolvedEventActionConfiguration\r\n extends IResolvedActionConfiguration {\r\n eventName: string;\r\n eventTopic?: string;\r\n}\r\n","import { getNestedValue } from './get-nested-value';\r\n\r\nexport function getNestedPropertyValue(\r\n propertyChain: string,\r\n sourceObject: any\r\n) {\r\n const properties = propertyChain.split('.');\r\n return getNestedValue(properties, sourceObject);\r\n}\r\n","export class TimelineEventNames {\r\n // timeline requests\r\n static PLAY_TOGGLE_REQUEST = 'timeline-play-toggle-request';\r\n static PLAY_REQUEST = 'timeline-play-request';\r\n static STOP_REQUEST = 'timeline-stop-request';\r\n static PAUSE_REQUEST = 'timeline-pause-request';\r\n static SEEK_REQUEST = 'timeline-seek-request';\r\n static RESIZE_REQUEST = 'timeline-resize-request';\r\n static CONTAINER_REQUEST = 'timeline-container-request';\r\n static DURATION_REQUEST = 'timeline-duration-request';\r\n static REQUEST_CURRENT_TIMELINE = 'timeline-request-current-timeline';\r\n\r\n // timeline announcements\r\n static DURATION = 'timeline-duration';\r\n static TIME = 'timeline-time';\r\n static SEEKED = 'timeline-seeked';\r\n static COMPLETE = 'timeline-complete';\r\n static RESTART = 'timeline-restart';\r\n static PLAY = 'timeline-play';\r\n static STOP = 'timeline-stop';\r\n static PAUSE = 'timeline-pause';\r\n static SEEK = 'timeline-seek';\r\n static RESIZE = 'timeline-resize';\r\n static POSITION_UPDATE = 'timeline-position-update';\r\n static TIME_UPDATE = 'timeline-time-update';\r\n static CURRENT_TIMELINE_CHANGE = 'timeline-current-timeline-change';\r\n static FIRST_FRAME = 'timeline-firstframe';\r\n\r\n // factory and engine events\r\n static REQUEST_INSTANCE = 'request-instance';\r\n static REQUEST_ACTION = 'request-action';\r\n static REQUEST_FUNCTION = 'request-function';\r\n static REQUEST_TIMELINE_URI = 'request-timeline-uri';\r\n static BEFORE_REQUEST_TIMELINE_URI = 'before-request-timeline-uri';\r\n static REQUEST_ENGINE_ROOT = 'request-engine-root';\r\n static REQUEST_CURRENT_TIMELINE_POSITION =\r\n 'request-current-timeline-position';\r\n static REQUEST_TIMELINE_CLEANUP = 'request-timeline-cleanup';\r\n static EXECUTE_TIMELINEACTION = 'execute-timelineaction';\r\n static RESIZE_TIMELINEACTION = 'resize-timelineaction';\r\n\r\n //language manager events\r\n static REQUEST_LABEL_COLLECTION = 'request-label-collection';\r\n static REQUEST_LABEL_COLLECTIONS = 'request-label-collections';\r\n static REQUEST_CURRENT_LANGUAGE = 'request-current-language';\r\n static LANGUAGE_CHANGE = 'language-change';\r\n}\r\n","import { IEndableAction } from '../action/types';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { deepCopy } from '../operation/helper/deep-copy';\r\nimport { TOperationData } from '../operation/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { IController } from './types';\r\n\r\ninterface IActionInstanceInfo {\r\n start: boolean;\r\n action: IEndableAction;\r\n}\r\n\r\nexport interface IEventListenerControllerOperationData {\r\n selectedElement: JQuery;\r\n eventName: string;\r\n actions: string[];\r\n actionOperationData?: TOperationData;\r\n}\r\n\r\nexport class EventListenerController implements IController<IEventListenerControllerOperationData> {\r\n operationData?: IEventListenerControllerOperationData;\r\n actionInstanceInfos?: IActionInstanceInfo[];\r\n name = 'EventListenerController';\r\n\r\n constructor() {}\r\n\r\n init(operationData: IEventListenerControllerOperationData) {\r\n this.operationData = {\r\n selectedElement: operationData.selectedElement,\r\n eventName: operationData.eventName,\r\n actions: operationData.actions.slice(),\r\n actionOperationData: operationData.actionOperationData ? deepCopy(operationData.actionOperationData) : undefined,\r\n };\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n const { selectedElement, actions, eventName } = this.operationData;\r\n if (!this.actionInstanceInfos) {\r\n this.actionInstanceInfos = [];\r\n\r\n const resultCallback = (isStart: boolean) => (actionInstance: IEndableAction) => {\r\n this.actionInstanceInfos?.push({ start: isStart, action: actionInstance });\r\n };\r\n\r\n actions.forEach((actionName: string) => {\r\n const [isStart, name] = this._isStartAction(actionName);\r\n eventbus.broadcast(TimelineEventNames.REQUEST_ACTION, [name, resultCallback(isStart)]);\r\n });\r\n\r\n selectedElement.on(eventName, this._eventHandler.bind(this));\r\n }\r\n }\r\n\r\n _isStartAction(actionName: string): [boolean, string] {\r\n const prefix = actionName.substr(0, 'end:'.length);\r\n if (prefix === 'end:') {\r\n return [false, actionName.substr('end:'.length)];\r\n } else {\r\n return [true, actionName];\r\n }\r\n }\r\n\r\n _eventHandler(event: any) {\r\n if (!this.operationData || !this.actionInstanceInfos) {\r\n return;\r\n }\r\n\r\n const actionOperationData = this.operationData.actionOperationData\r\n ? deepCopy(this.operationData.actionOperationData)\r\n : {};\r\n\r\n if (event.target) {\r\n actionOperationData.targetValue = event.target.value;\r\n }\r\n\r\n this._executeAction(this.actionInstanceInfos, actionOperationData, 0);\r\n }\r\n\r\n async _executeAction(actions: IActionInstanceInfo[], operationData: TOperationData, idx: number) {\r\n if (idx < actions.length) {\r\n const actionInfo = actions[idx];\r\n const { action } = actionInfo;\r\n const method = actionInfo.start ? action.start.bind(action) : action.end.bind(action);\r\n const resultOperationData = await method(operationData);\r\n this._executeAction(actions, Object.assign(operationData, resultOperationData), ++idx);\r\n }\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.operationData?.selectedElement.off(this.operationData.eventName);\r\n }\r\n}\r\n","import { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { ILabel } from '../types';\r\nimport { IController } from './types';\r\n\r\nexport interface ILabelControllerMetadata {\r\n selectedElement: JQuery;\r\n labelId: string;\r\n}\r\n\r\nexport class LabelController implements IController<ILabelControllerMetadata> {\r\n listeners: TEventbusRemover[] = [];\r\n currentLanguage: string | null = null;\r\n operationData: ILabelControllerMetadata | null = null;\r\n labelData: Record<string, string> = {};\r\n name = 'LabelController';\r\n\r\n init(operationData: ILabelControllerMetadata) {\r\n this.operationData = Object.assign({}, operationData);\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n eventbus.broadcast(TimelineEventNames.REQUEST_CURRENT_LANGUAGE, [\r\n (language: string) => {\r\n this.currentLanguage = language;\r\n },\r\n ]);\r\n\r\n eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [\r\n this.operationData.labelId,\r\n (labelCollection: ILabel[]) => {\r\n this.createTextDataLookup(labelCollection);\r\n },\r\n ]);\r\n\r\n this.setLabel();\r\n this.listeners.push(\r\n eventbus.on(\r\n TimelineEventNames.LANGUAGE_CHANGE,\r\n this.handleLanguageChange.bind(this)\r\n )\r\n );\r\n }\r\n\r\n setLabel() {\r\n if (this.currentLanguage) {\r\n this.operationData?.selectedElement.html(\r\n this.labelData[this.currentLanguage]\r\n );\r\n }\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.listeners.forEach((func) => {\r\n func();\r\n });\r\n }\r\n\r\n handleLanguageChange(code: string) {\r\n this.currentLanguage = code;\r\n this.setLabel();\r\n }\r\n\r\n createTextDataLookup(data: ILabel[]) {\r\n data.forEach((d) => {\r\n this.labelData[d.languageCode] = d.label;\r\n });\r\n }\r\n}\r\n","import lottie, {\r\n AnimationConfigWithData,\r\n AnimationItem,\r\n CanvasRendererConfig,\r\n HTMLRendererConfig,\r\n SVGRendererConfig,\r\n} from 'lottie-web';\r\nimport { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { IController } from './types';\r\n\r\nexport interface IInnerMetadata {\r\n selectedElement: JQuery;\r\n renderer: SVGRendererConfig | CanvasRendererConfig | HTMLRendererConfig;\r\n loop: boolean;\r\n autoplay: boolean;\r\n animationData: any;\r\n json: any;\r\n labelIds: string[];\r\n viewBox: string;\r\n iefallback: any;\r\n}\r\n\r\nexport interface ILottieControllerMetadata extends IInnerMetadata {\r\n url: string;\r\n}\r\n\r\nexport class LottieController\r\n implements IController<ILottieControllerMetadata>\r\n{\r\n name = 'LottieController';\r\n currentLanguage: string | null = null;\r\n labelData: Record<string, Record<string, string>> = {};\r\n listeners: TEventbusRemover[] = [];\r\n animationItem: AnimationItem | null = null;\r\n operationData: IInnerMetadata | null = null;\r\n serializedData: string | null = null;\r\n serializedIEData: string | null = null;\r\n freezePosition = -1;\r\n endPosition = -1;\r\n\r\n constructor() {}\r\n\r\n init(operationData: ILottieControllerMetadata) {\r\n this.operationData = {\r\n selectedElement: operationData.selectedElement,\r\n renderer: operationData.renderer,\r\n loop: operationData.loop,\r\n autoplay: operationData.autoplay,\r\n animationData: operationData.animationData,\r\n json: operationData.json,\r\n labelIds: operationData.labelIds,\r\n viewBox: operationData.viewBox,\r\n iefallback: operationData.iefallback,\r\n };\r\n\r\n if (operationData.url.indexOf('[') > -1) {\r\n this.parseFilename(operationData.url);\r\n }\r\n\r\n this.serializedData = this.operationData.json\r\n ? JSON.stringify(this.operationData.json)\r\n : JSON.stringify(this.operationData.animationData);\r\n\r\n if (this.operationData.iefallback) {\r\n this.serializedIEData = JSON.stringify(this.operationData.iefallback);\r\n }\r\n }\r\n\r\n parseFilename(name: string) {\r\n const params = name.substr(\r\n name.indexOf('[') + 1,\r\n name.indexOf(']') - name.indexOf('[') - 1\r\n );\r\n\r\n const settings = params.split(',');\r\n\r\n settings.forEach((setting) => {\r\n const values = setting.split('=');\r\n if (values[0] === 'freeze') {\r\n this.freezePosition = +values[1];\r\n } else if (values[0] === 'end') {\r\n this.endPosition = +values[1];\r\n }\r\n });\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n const { labelIds } = this.operationData;\r\n if (labelIds && labelIds.length) {\r\n const resultHolder: {\r\n language: string;\r\n labelCollections: any[];\r\n } = {} as any;\r\n\r\n eventbus.broadcast(TimelineEventNames.REQUEST_CURRENT_LANGUAGE, [\r\n resultHolder,\r\n ]);\r\n this.currentLanguage = resultHolder.language;\r\n this.listeners.push(\r\n eventbus.on(\r\n TimelineEventNames.LANGUAGE_CHANGE,\r\n this.handleLanguageChange.bind(this)\r\n )\r\n );\r\n eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTIONS, [\r\n this.operationData.labelIds,\r\n resultHolder,\r\n ]);\r\n this.createTextDataLookup(resultHolder.labelCollections);\r\n }\r\n this.createAnimation();\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.listeners.forEach((func) => {\r\n func();\r\n });\r\n\r\n if (this.animationItem) {\r\n if (this.endPosition > -1) {\r\n this.animationItem.addEventListener(\r\n 'complete',\r\n this.destroy.bind(this)\r\n );\r\n this.animationItem.playSegments(\r\n [this.freezePosition, this.endPosition],\r\n true\r\n );\r\n } else {\r\n this.animationItem.destroy();\r\n }\r\n }\r\n }\r\n\r\n destroy() {\r\n if (this.animationItem) {\r\n this.animationItem.destroy();\r\n this.animationItem = null;\r\n }\r\n }\r\n\r\n createAnimation() {\r\n if (!this.operationData || !this.serializedData) {\r\n return;\r\n }\r\n\r\n this.animationItem?.destroy();\r\n let serialized =\r\n this.isIE() && this.serializedIEData\r\n ? this.serializedIEData\r\n : this.serializedData;\r\n\r\n const { labelIds } = this.operationData;\r\n if (labelIds && labelIds.length) {\r\n labelIds.forEach((id) => {\r\n serialized = serialized\r\n .split(`!!${id}!!`)\r\n .join(this.labelData[id][this.currentLanguage ?? '']);\r\n });\r\n }\r\n const animationData = JSON.parse(serialized);\r\n\r\n const animationSettings: AnimationConfigWithData<'svg'> = {\r\n autoplay: this.operationData.autoplay,\r\n container: this.operationData.selectedElement[0],\r\n loop: this.operationData.loop,\r\n rendererSettings: this.operationData.renderer,\r\n animationData,\r\n };\r\n\r\n this.animationItem = lottie.loadAnimation(animationSettings);\r\n if (this.endPosition < 0) {\r\n this.endPosition = this.animationItem.timeCompleted;\r\n }\r\n\r\n if (this.freezePosition > -1) {\r\n this.animationItem.playSegments([0, this.freezePosition], true);\r\n }\r\n if (this.operationData.viewBox) {\r\n this.operationData.selectedElement\r\n .find('svg')\r\n .attr('viewBox', this.operationData.viewBox);\r\n }\r\n }\r\n\r\n createTextDataLookup(data: any[]) {\r\n data.forEach((infos, index) => {\r\n infos.forEach((d: any) => {\r\n if (this.operationData) {\r\n this.labelData[this.operationData.labelIds[index]][d.code] = d.label;\r\n }\r\n });\r\n });\r\n }\r\n\r\n handleLanguageChange(code: string) {\r\n this.currentLanguage = code;\r\n this.createAnimation();\r\n }\r\n\r\n isIE() {\r\n const isIE = false || !!(window.document as any)['documentMode'];\r\n\r\n // Edge 20+\r\n const isEdge = !isIE && !!(window as any)['StyleMedia'];\r\n\r\n return isEdge || isIE;\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { TResultCallback } from '../types';\r\nimport { LabelController } from './label-controller';\r\nimport { IController } from './types';\r\n\r\nexport interface INavigationControllerOperationData {\r\n selectedElement: JQuery;\r\n json: any;\r\n}\r\n\r\nexport class NavigationController\r\n implements IController<INavigationControllerOperationData>\r\n{\r\n name: string = 'NavigationController';\r\n navigation: any[] = [];\r\n navLookup: Record<string, any> = {};\r\n navVidIdLookup: Record<string, any> = {};\r\n ctrlLookup: Record<string, LabelController> = {};\r\n activeNavigationPoint: any | null = null;\r\n labelControllers: LabelController[] = [];\r\n eventhandlers: TEventbusRemover[] = [];\r\n eventbus: IEventbus | null = null;\r\n container: JQuery | null = null;\r\n\r\n constructor() {}\r\n\r\n init(operationData: TOperationData) {\r\n this.container = operationData.selectedElement;\r\n this.navigation = this.buildNavigationData(operationData.json);\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.container) {\r\n return;\r\n }\r\n\r\n this.eventbus = eventbus;\r\n\r\n this.eventhandlers.push(\r\n eventbus.on(\r\n 'navigate-to-video-url',\r\n this.handleNavigateVideoUrl.bind(this)\r\n )\r\n );\r\n this.eventhandlers.push(\r\n eventbus.on('highlight-navigation', this.highlightMenu.bind(this))\r\n );\r\n this.eventhandlers.push(\r\n eventbus.on(\r\n 'request-current-navigation',\r\n this.handleRequestCurrentNavigation.bind(this)\r\n )\r\n );\r\n this.eventhandlers.push(\r\n eventbus.on('video-complete', this.handleVideoComplete.bind(this))\r\n );\r\n\r\n this.buildHtml(this.container, this.navigation);\r\n this.initHistory.bind(this);\r\n }\r\n\r\n initHistory() {\r\n this.activeNavigationPoint = this.navVidIdLookup[0];\r\n const navId = this.getQueryVariable(0);\r\n let videoIndex = 0;\r\n if (navId) {\r\n const nav = this.navLookup[navId];\r\n videoIndex = nav.videoUrlIndex;\r\n }\r\n this.highlightMenu(videoIndex);\r\n }\r\n\r\n getQueryVariable(variableIdx: number) {\r\n const href = window.location.href;\r\n const hashIndex = href.indexOf('#');\r\n if (hashIndex > -1) {\r\n const query = href.substring(hashIndex + 2);\r\n if (query) {\r\n const vars = query.split('/');\r\n return vars[variableIdx];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n handleRequestCurrentNavigation(resultCallback: TResultCallback) {\r\n if (this.activeNavigationPoint) {\r\n const labelCtrl = this.ctrlLookup[this.activeNavigationPoint.labelId];\r\n resultCallback({\r\n navigationData: this.activeNavigationPoint,\r\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\r\n });\r\n } else {\r\n resultCallback(null);\r\n }\r\n }\r\n\r\n detach(eventbus: IEventbus) {\r\n this.eventhandlers.forEach((handler) => {\r\n handler();\r\n });\r\n\r\n this.labelControllers.forEach((ctrl) => {\r\n ctrl.detach(eventbus);\r\n });\r\n\r\n this.labelControllers.length = 0;\r\n this.eventbus = null;\r\n this.container = null;\r\n window.onpopstate = null;\r\n }\r\n\r\n pushCurrentState(position = -1) {\r\n if (!this.activeNavigationPoint) {\r\n return;\r\n }\r\n const labelCtrl: LabelController =\r\n this.ctrlLookup[this.activeNavigationPoint.labelId];\r\n\r\n if (!labelCtrl) {\r\n return;\r\n }\r\n\r\n const state = {\r\n navigationData: this.activeNavigationPoint,\r\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\r\n position: -1,\r\n };\r\n if (position > -1) {\r\n state.position = position;\r\n }\r\n this.eventbus?.broadcast('push-history-state', [state]);\r\n }\r\n\r\n buildHtml(parentElm: JQuery, data: any) {\r\n const ul = $('<ul/>');\r\n data.forEach(this.addNavElement.bind(this, ul));\r\n parentElm.append(ul);\r\n }\r\n\r\n addNavElement(parentElm: JQuery, data: any) {\r\n if (data.visible) {\r\n const li = $('<li/>');\r\n const a = $(`<a href='javascript:;' id='nav_${data.videoUrlIndex}'/>`);\r\n li.append(a);\r\n this.addLabel(a, data.labelId);\r\n this.addClickHandler(a, data.videoUrlIndex);\r\n\r\n if (data.children) {\r\n const ul = $('<ul/>');\r\n data.children.forEach(this.addNavElement.bind(this, ul));\r\n li.append(ul);\r\n }\r\n\r\n parentElm.append(li);\r\n }\r\n }\r\n\r\n addClickHandler(parentElm: JQuery, videoIndex: number) {\r\n parentElm.mouseup(this.menuMouseupHandler.bind(this, videoIndex));\r\n }\r\n\r\n menuMouseupHandler(videoIndex: number) {\r\n const navdata = this.navVidIdLookup[videoIndex];\r\n if (navdata) {\r\n this.eventbus?.broadcast('request-video-url', [navdata.videoUrlIndex]);\r\n this.handleNavigateVideoUrl(navdata.videoUrlIndex);\r\n }\r\n }\r\n\r\n handleNavigateVideoUrl(index: number, requestedVideoPosition: number = 0) {\r\n this.highlightMenu(index);\r\n this.eventbus?.broadcast('request-video-url', [\r\n index,\r\n requestedVideoPosition,\r\n ]);\r\n this.activeNavigationPoint = this.navVidIdLookup[index];\r\n this.pushCurrentState(requestedVideoPosition);\r\n }\r\n\r\n highlightMenu(index: number) {\r\n const navElm = $(`#nav_${index}`);\r\n\r\n if (navElm.length) {\r\n $('.current-menu-item').removeClass('current-menu-item');\r\n navElm.addClass('current-menu-item');\r\n }\r\n }\r\n\r\n handleVideoComplete(index: number) {\r\n const navData = this.navVidIdLookup[index];\r\n if (navData.autoNext) {\r\n this.eventbus?.broadcast('request-video-url', [\r\n navData.next.videoUrlIndex,\r\n ]);\r\n } else {\r\n this.eventbus?.broadcast('request-video-cleanup');\r\n }\r\n }\r\n\r\n addLabel(parentElm: JQuery, labelId: string) {\r\n const data = {\r\n selectedElement: parentElm,\r\n labelId: labelId,\r\n };\r\n const resultCallback = (instance: LabelController) => {\r\n instance.init(data);\r\n instance.attach(this.eventbus as IEventbus);\r\n this.labelControllers.push(instance);\r\n this.ctrlLookup[labelId] = instance;\r\n };\r\n this.eventbus?.broadcast('request-instance', [\r\n 'LabelController',\r\n resultCallback,\r\n ]);\r\n }\r\n\r\n buildNavigationData(data: any) {\r\n const result: any[] = [];\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n this.navLookup[nav.id] = nav;\r\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\r\n nav.previous = data.navigationData[index - 1];\r\n });\r\n\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n if (nav.nextId) {\r\n nav.next = this.navLookup[nav.nextId];\r\n delete nav.nextId;\r\n } else {\r\n nav.next = data.navigationData[index + 1];\r\n }\r\n });\r\n\r\n data.roots.forEach((id: string) => {\r\n const nav = this.navLookup[id];\r\n if (nav.children) {\r\n nav.children = nav.children.map((childId: string) => {\r\n return this.navLookup[childId];\r\n });\r\n }\r\n result.push(nav);\r\n });\r\n return result;\r\n }\r\n}\r\n","import { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { IController } from './types';\r\n\r\nexport interface IProgressbarControllerOperationData {\r\n selectedElement: JQuery;\r\n textElement: JQuery;\r\n}\r\n\r\nexport class ProgressbarController\r\n implements IController<IProgressbarControllerOperationData>\r\n{\r\n name: string = 'ProgressbarController';\r\n selectedElement: JQuery | null = null;\r\n textElement: JQuery | null = null;\r\n detachers: TEventbusRemover[] = [];\r\n\r\n init(operationData: TOperationData) {\r\n this.selectedElement = operationData.selectedElement;\r\n this.textElement = operationData.textElement;\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n this.detachers.push(\r\n eventbus.on(\r\n TimelineEventNames.POSITION_UPDATE,\r\n this.positionUpdateHandler.bind(this)\r\n )\r\n );\r\n\r\n const clickHandler = this.clickHandler.bind(this);\r\n this.selectedElement?.on('click', clickHandler);\r\n this.detachers.push(() => this.selectedElement?.off('click'), clickHandler);\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.detachers.forEach((func: () => void) => {\r\n func();\r\n });\r\n }\r\n\r\n positionUpdateHandler({\r\n position,\r\n duration,\r\n }: {\r\n position: number;\r\n duration: number;\r\n }) {\r\n const percentage = (100 / duration) * position;\r\n this.selectedElement?.css('width', `${percentage}%`);\r\n this.textElement?.text(`${Math.floor(percentage)}%`);\r\n }\r\n\r\n clickHandler() {}\r\n}\r\n","import { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { IController } from './types';\r\n\r\nexport interface IRoutingControllerOperationData {\r\n json: any;\r\n}\r\n\r\nexport class RoutingController\r\n implements IController<IRoutingControllerOperationData>\r\n{\r\n name = 'RoutingController';\r\n navLookup: Record<string, any> = {};\r\n navVidIdLookup: Record<string, any> = {};\r\n navigation: any = null;\r\n eventhandlers: TEventbusRemover[] = [];\r\n eventbus: IEventbus | null = null;\r\n\r\n constructor() {}\r\n\r\n init(operationData: TOperationData) {\r\n this.navigation = this.buildNavigationData(operationData.json);\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n this.eventhandlers.push(\r\n eventbus.on(\r\n 'before-request-video-url',\r\n this.handleBeforeRequestVideoUrl.bind(this)\r\n )\r\n );\r\n this.eventhandlers.push(\r\n eventbus.on('push-history-state', this.handlePushHistoryState.bind(this))\r\n );\r\n this.eventbus = eventbus;\r\n window.onpopstate = this.handlePopstate.bind(this);\r\n\r\n const navId = this.getQueryVariable(0);\r\n if (navId) {\r\n const nav = this.navLookup[navId];\r\n const pos = +this.getQueryVariable(1);\r\n this.eventbus.broadcast('request-video-url', [\r\n nav.videoUrlIndex,\r\n pos,\r\n true,\r\n ]);\r\n } else {\r\n window.history.pushState(\r\n { navigationId: this.navigation[0].id },\r\n '',\r\n `#/${this.navigation[0].id}`\r\n );\r\n }\r\n }\r\n\r\n handlePopstate(event: any) {\r\n const navigationId = event.state\r\n ? event.state.navigationId\r\n : this.navigation[0].id;\r\n const position = event.state?.position ?? 0;\r\n const nav = this.navLookup[navigationId];\r\n this.eventbus?.broadcast('highlight-navigation', [nav.videoUrlIndex]);\r\n this.eventbus?.broadcast('request-video-url', [\r\n nav.videoUrlIndex,\r\n position,\r\n true,\r\n ]);\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n if (this.eventhandlers) {\r\n this.eventhandlers.forEach((handler) => {\r\n handler();\r\n });\r\n }\r\n this.eventbus = null;\r\n }\r\n\r\n handleBeforeRequestVideoUrl(\r\n _index: number,\r\n _requestedVideoPosition: number = 0,\r\n isHistoryRequest: boolean = false\r\n ) {\r\n isHistoryRequest =\r\n isHistoryRequest !== undefined ? isHistoryRequest : false;\r\n if (!isHistoryRequest) {\r\n const resultCallback = (item: any) => {\r\n this.pushState(item);\r\n };\r\n this.eventbus?.broadcast('request-current-navigation', [resultCallback]);\r\n }\r\n }\r\n\r\n getQueryVariable(variableIdx: number) {\r\n const href = window.location.href;\r\n const hashIndex = href.indexOf('#');\r\n if (hashIndex > -1) {\r\n const query = href.substring(hashIndex + 2);\r\n if (query) {\r\n const vars = query.split('/');\r\n return vars[variableIdx];\r\n }\r\n }\r\n return '';\r\n }\r\n\r\n handlePushHistoryState(state: any) {\r\n this.pushState(state);\r\n }\r\n\r\n pushState(state: any) {\r\n if (state && state.navigationData && state.navigationData.visible) {\r\n let currentPosition = state.position !== undefined ? state.position : -1;\r\n if (currentPosition < 0) {\r\n const resultCallback = (position: number) => {\r\n currentPosition = position > 3 ? position - 3 : 0;\r\n };\r\n this.eventbus?.broadcast('request-current-video-position', [\r\n resultCallback,\r\n ]);\r\n }\r\n\r\n const currentState = window.history.state;\r\n if (\r\n currentState &&\r\n currentState.navigationId !== state.navigationData.id\r\n ) {\r\n window.history.pushState(\r\n { navigationId: state.navigationData.id, position: currentPosition },\r\n state.title,\r\n `#/${state.navigationData.id}/${currentPosition}`\r\n );\r\n } else if (\r\n currentState &&\r\n currentState.navigationId === state.navigationData.id\r\n ) {\r\n window.history.replaceState(\r\n {\r\n navigationId: currentState.navigationId,\r\n position: currentPosition,\r\n },\r\n state.title,\r\n `#/${currentState.navigationId}/${currentPosition}`\r\n );\r\n } else {\r\n window.history.pushState(\r\n { navigationId: state.navigationData.id, position: currentPosition },\r\n state.title,\r\n `#/${state.navigationData.id}/${currentPosition}`\r\n );\r\n }\r\n window.document.title = state.title;\r\n }\r\n }\r\n\r\n buildNavigationData(data: any) {\r\n const result: any[] = [];\r\n data.navigationData.forEach((nav: any, index: any) => {\r\n this.navLookup[nav.id] = nav;\r\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\r\n nav.previous = data.navigationData[index - 1];\r\n });\r\n\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n if (nav.nextId) {\r\n nav.next = this.navLookup[nav.nextId];\r\n delete nav.nextId;\r\n } else {\r\n nav.next = data.navigationData[index + 1];\r\n }\r\n });\r\n\r\n data.roots.forEach((id: string) => {\r\n const nav = this.navLookup[id];\r\n if (nav.children) {\r\n nav.children = nav.children.map((childId: string) => {\r\n return this.navLookup[childId];\r\n });\r\n }\r\n result.push(nav);\r\n });\r\n return result;\r\n }\r\n}\r\n","import { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { IController } from './types';\r\n\r\nexport interface ISubtitlesControllerOperationData {\r\n selectedElement: JQuery;\r\n language: string;\r\n subtitleData: any;\r\n}\r\n\r\nexport class SubtitlesController\r\n implements IController<ISubtitlesControllerOperationData>\r\n{\r\n actionLookup: Record<string, any> = {};\r\n currentLanguage: string | null = null;\r\n lastFunc: Function | null = null;\r\n name = 'SubtitlesController';\r\n\r\n attach(eventbus: IEventbus) {\r\n const detachTime = eventbus.on(\r\n TimelineEventNames.TIME,\r\n this.onTimeHandler.bind(this)\r\n );\r\n const detachSeek = eventbus.on(\r\n TimelineEventNames.SEEKED,\r\n this.onSeekedHandler.bind(this)\r\n );\r\n const detachLangChange = eventbus.on(\r\n TimelineEventNames.LANGUAGE_CHANGE,\r\n this.languageChangeHandler.bind(this)\r\n );\r\n this.internalDetach = this.internalDetach.bind(this, [\r\n detachTime,\r\n detachLangChange,\r\n detachSeek,\r\n ]);\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.internalDetach();\r\n }\r\n\r\n internalDetach(detachMethods?: TEventbusRemover[]) {\r\n if (detachMethods) {\r\n detachMethods.forEach((f) => {\r\n f();\r\n });\r\n }\r\n }\r\n\r\n languageChangeHandler(newLanguage: string) {\r\n this.currentLanguage = newLanguage;\r\n if (this.lastFunc) {\r\n this.lastFunc();\r\n }\r\n }\r\n\r\n removeTitle(container?: JQuery) {\r\n container?.empty();\r\n this.lastFunc = null;\r\n }\r\n\r\n onTimeHandler(arg: any) {\r\n const position = arg.position;\r\n const func = this.actionLookup[position];\r\n if (func) {\r\n func();\r\n this.lastFunc = func;\r\n }\r\n }\r\n\r\n onSeekedHandler(arg: any) {\r\n let position = arg.position;\r\n let func = this.actionLookup[position];\r\n while (!func && --position >= 0) {\r\n func = this.actionLookup[position];\r\n }\r\n if (func) {\r\n func();\r\n this.lastFunc = func;\r\n } else {\r\n this.removeTitle();\r\n }\r\n }\r\n\r\n setTitle(container: JQuery, titleLanguageLookup: Record<string, string>) {\r\n if (this.currentLanguage) {\r\n container.html(titleLanguageLookup[this.currentLanguage]);\r\n }\r\n }\r\n\r\n createActionLookup(operationData: TOperationData, container: JQuery) {\r\n const subtitleData = operationData.subtitleData;\r\n const titles = subtitleData[0].titles;\r\n const subtitleTimeLookup: Record<number, () => void> = {};\r\n\r\n for (let i = 0, ii = titles.length; i < ii; i++) {\r\n const titleLanguageLookup: Record<string, string> = {};\r\n\r\n for (let j = 0, jj = subtitleData.length; j < jj; j++) {\r\n const subs = subtitleData[j];\r\n titleLanguageLookup[subs.lang] = subs.titles[i].text;\r\n }\r\n\r\n subtitleTimeLookup[titles[i].duration.start] = this.setTitle.bind(\r\n this,\r\n container,\r\n titleLanguageLookup\r\n );\r\n subtitleTimeLookup[titles[i].duration.end] = this.removeTitle;\r\n }\r\n\r\n return subtitleTimeLookup;\r\n }\r\n\r\n init(operationData: ISubtitlesControllerOperationData) {\r\n const container = operationData.selectedElement;\r\n this.removeTitle = this.removeTitle.bind(this, container);\r\n this.currentLanguage = operationData.language;\r\n this.actionLookup = this.createActionLookup(operationData, container);\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport { IEndableAction, ITimelineAction } from './action/types';\r\nimport { IResolvedEngineConfiguration } from './configuration/types';\r\nimport { IEventbus, TEventbusRemover, TEventHandler } from './eventbus/types';\r\nimport { LanguageManager } from './language-manager';\r\nimport { TOperation } from './operation/types';\r\nimport { TimelineEventNames } from './timeline-event-names';\r\nimport { ITimelineProvider } from './timelineproviders/types';\r\nimport {\r\n IEligiusEngine,\r\n ITimelineProviderInfo,\r\n TimelineTypes,\r\n TResultCallback,\r\n} from './types';\r\n\r\n/**\r\n * EligiusEngine, this is where the magic happens. The engine is responsible for starting and stopping\r\n * the given timeline provider and triggering the actions associated with it.\r\n * ...\r\n */\r\nexport class EligiusEngine implements IEligiusEngine {\r\n private _timeLineActionsLookup: Record<string, any> = {};\r\n private _eventbusRemovers: TEventbusRemover[] = [];\r\n private _currentTimelineUri: string = '';\r\n private _activeTimelineProvider: ITimelineProvider | undefined = undefined;\r\n private _lastPosition: number = -1;\r\n\r\n constructor(\r\n private configuration: IResolvedEngineConfiguration,\r\n private eventbus: IEventbus,\r\n private timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>,\r\n private languageManager: LanguageManager\r\n ) {}\r\n\r\n init(): Promise<ITimelineProvider> {\r\n this._createLayoutTemplate();\r\n\r\n this._addInitialisationListeners();\r\n\r\n const { timelines } = this.configuration;\r\n\r\n this._currentTimelineUri = timelines?.[0].uri ?? '';\r\n\r\n this._createTimelineLookup();\r\n\r\n return this._initializeTimelineProvider();\r\n }\r\n\r\n private _createLayoutTemplate() {\r\n const { containerSelector } = this.configuration;\r\n const container = $(containerSelector);\r\n\r\n if (!container || !container.length) {\r\n throw new Error(`Container selector not found: ${containerSelector}`);\r\n }\r\n\r\n const { layoutTemplate } = this.configuration;\r\n\r\n if (layoutTemplate && layoutTemplate.length) {\r\n container.html(layoutTemplate);\r\n } else {\r\n console.warn('layoutTemplate is empty, unable to create layout');\r\n }\r\n }\r\n\r\n private _initializeTimelineProvider(): Promise<ITimelineProvider> {\r\n if (!this.configuration.timelines?.length) {\r\n throw new Error('No timelines present');\r\n }\r\n\r\n const firstTimeline = this.configuration.timelines[0];\r\n const providerSettings = this.timelineProviders[firstTimeline.type];\r\n\r\n if (!providerSettings) {\r\n throw new Error(\r\n `No timeline provider configured for type ${firstTimeline.type}`\r\n );\r\n }\r\n\r\n this._activeTimelineProvider?.destroy();\r\n this._activeTimelineProvider = providerSettings.provider;\r\n\r\n return new Promise(async (resolve) => {\r\n if (this._activeTimelineProvider) {\r\n await this._activeTimelineProvider.init();\r\n await this._executeActions(this.configuration.initActions, 'start');\r\n resolve(this._activeTimelineProvider);\r\n } else {\r\n throw new Error('NO ACTIVE TIMELINE PROVIDER');\r\n }\r\n });\r\n }\r\n\r\n private async _cleanUp() {\r\n await this._cleanUpTimeline();\r\n await this._executeActions(this.configuration.initActions, 'end');\r\n }\r\n\r\n async destroy() {\r\n await this._cleanUp();\r\n\r\n this.languageManager.destroy();\r\n\r\n this._activeTimelineProvider = undefined;\r\n this._eventbusRemovers.forEach((remover) => remover());\r\n\r\n if (this.timelineProviders) {\r\n Object.values(this.timelineProviders).forEach((providerInfo) =>\r\n providerInfo.provider.destroy()\r\n );\r\n }\r\n\r\n const { containerSelector } = this.configuration;\r\n const container = $(containerSelector);\r\n container.empty();\r\n }\r\n\r\n private _addEventListener(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ) {\r\n this._eventbusRemovers.push(\r\n this.eventbus.on(eventName, eventHandler, eventTopic)\r\n );\r\n }\r\n\r\n private _addInitialisationListeners() {\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_ENGINE_ROOT,\r\n this._handleRequestEngineRoot.bind(\r\n this,\r\n this.configuration.containerSelector\r\n )\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_TIMELINE_URI,\r\n this._handleRequestTimelineUri.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_CURRENT_TIMELINE_POSITION,\r\n this._handleRequestTimelinePosition.bind(this, Math.floor)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_TIMELINE_CLEANUP,\r\n this._handleTimelineComplete.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.EXECUTE_TIMELINEACTION,\r\n this._handleExecuteTimelineAction.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.RESIZE_TIMELINEACTION,\r\n this._resizeTimelineAction.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_CURRENT_TIMELINE,\r\n this._requestCurrentTimeline.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.TIME,\r\n this._onTimeHandler.bind(this, Math.floor)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.SEEK,\r\n this._onSeekHandler.bind(this, Math.floor)\r\n );\r\n }\r\n\r\n private _createTimelineLookup() {\r\n if (!this.configuration.timelines) {\r\n return;\r\n }\r\n this.configuration.timelines.forEach((timelineInfo) => {\r\n timelineInfo.timelineActions.forEach(\r\n this._addTimelineAction.bind(this, timelineInfo.uri)\r\n );\r\n });\r\n }\r\n\r\n private _addTimelineAction(uri: string, timeLineAction: ITimelineAction) {\r\n const startPosition = timeLineAction.duration.start;\r\n const timelineStartPositions = this._initializeTimelinePosition(\r\n this._initializeUriLookup(this._timeLineActionsLookup, uri),\r\n startPosition\r\n );\r\n const startMethod = timeLineAction.start.bind(timeLineAction);\r\n\r\n if (timeLineAction.id?.length) {\r\n (startMethod as any).id = timeLineAction.id;\r\n (startMethod as any).isStart = true;\r\n }\r\n\r\n timelineStartPositions.push(startMethod);\r\n\r\n let end = timeLineAction.duration.end;\r\n if (end < 0) {\r\n end = timeLineAction.duration.end = Infinity;\r\n }\r\n\r\n if (isFinite(end)) {\r\n const timelineEndPositions = this._initializeTimelinePosition(\r\n this._timeLineActionsLookup[uri],\r\n end\r\n );\r\n const endMethod = timeLineAction.end.bind(timeLineAction);\r\n\r\n if (timeLineAction.id?.length) {\r\n (endMethod as any).id = timeLineAction.id;\r\n }\r\n\r\n timelineEndPositions.push(endMethod);\r\n }\r\n }\r\n\r\n private _initializeUriLookup(\r\n lookup: Record<string, any>,\r\n uri: string\r\n ): Record<number, any> {\r\n if (!lookup[uri]) {\r\n lookup[uri] = {};\r\n }\r\n\r\n return lookup[uri];\r\n }\r\n\r\n private _initializeTimelinePosition(\r\n lookup: Record<number, any>,\r\n position: number\r\n ): TOperation[] {\r\n if (!lookup[position]) {\r\n lookup[position] = [];\r\n }\r\n\r\n return lookup[position];\r\n }\r\n\r\n private async _executeActions(\r\n actions: IEndableAction[],\r\n methodName: 'start' | 'end',\r\n idx = 0\r\n ): Promise<any> {\r\n if (actions && idx < actions.length) {\r\n const action = actions[idx];\r\n\r\n await action[methodName]();\r\n return this._executeActions(actions, methodName, ++idx);\r\n }\r\n\r\n return new Promise<void>((resolve) => {\r\n resolve();\r\n });\r\n }\r\n\r\n private _handleRequestEngineRoot(\r\n engineRootSelector: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback($(engineRootSelector));\r\n }\r\n\r\n async _handleRequestTimelineUri(\r\n uri: string,\r\n position?: number,\r\n previousVideoPosition?: number\r\n ) {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n previousVideoPosition = previousVideoPosition ?? 0;\r\n this._activeTimelineProvider.stop();\r\n\r\n await this._cleanUpTimeline();\r\n\r\n const timelineConfig = this.configuration.timelines.find(\r\n (timeline) => timeline.uri === uri\r\n );\r\n if (\r\n !timelineConfig ||\r\n !this._activeTimelineProvider ||\r\n this._currentTimelineUri === timelineConfig.uri\r\n ) {\r\n return;\r\n }\r\n this._currentTimelineUri = timelineConfig.uri;\r\n\r\n this.eventbus.broadcast(TimelineEventNames.CURRENT_TIMELINE_CHANGE, [\r\n this._currentTimelineUri,\r\n ]);\r\n\r\n const newProviderSettings = this.timelineProviders[timelineConfig.type];\r\n\r\n if (this._activeTimelineProvider !== newProviderSettings.provider) {\r\n this._activeTimelineProvider.destroy();\r\n this._activeTimelineProvider = newProviderSettings.provider;\r\n }\r\n\r\n this._activeTimelineProvider.loop = timelineConfig.loop;\r\n\r\n position = position ?? 0;\r\n if (!this._activeTimelineProvider.loop && position > 0) {\r\n this.eventbus.once(TimelineEventNames.FIRST_FRAME, () => {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n this._activeTimelineProvider.pause();\r\n this.eventbus.broadcast(TimelineEventNames.DURATION, [\r\n this._activeTimelineProvider.getDuration(),\r\n ]);\r\n this._executeStartActions().then(() => {\r\n position = position ?? 0;\r\n this._activeTimelineProvider?.seek(position);\r\n this._onSeekHandler(Math.floor, {\r\n offset: position,\r\n });\r\n });\r\n });\r\n }\r\n\r\n this._activeTimelineProvider.playlistItem(uri);\r\n }\r\n\r\n private _cleanUpTimeline() {\r\n return this._executeRelevantActions(this._getActiveActions, 'end');\r\n }\r\n\r\n private _executeStartActions() {\r\n return this._executeRelevantActions(\r\n this._getActionsForPosition.bind(this, 0),\r\n 'start'\r\n );\r\n }\r\n\r\n private _getActionsForPosition(\r\n position: number,\r\n allActions: ITimelineAction[]\r\n ) {\r\n return allActions.filter((action) => {\r\n return (\r\n !action.active &&\r\n action.duration.start <= position &&\r\n action.duration.end >= position\r\n );\r\n });\r\n }\r\n\r\n private _getActiveActions(allActions: ITimelineAction[]) {\r\n const actions = allActions.filter((action) => action.active);\r\n return actions.sort((a, b) => {\r\n if (b.duration.start < a.duration.start) {\r\n return -1;\r\n } else if (b.duration.start > a.duration.start) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n }\r\n\r\n private _executeRelevantActions(\r\n filter: (actions: ITimelineAction[]) => ITimelineAction[],\r\n executionType: 'start' | 'end'\r\n ) {\r\n const timelineActions = this._getRelevantTimelineActions();\r\n const currentActions = filter.apply(this, [timelineActions]);\r\n return this._executeActions(currentActions, executionType, 0);\r\n }\r\n\r\n private _handleRequestTimelinePosition(\r\n floor: Function,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback(floor(this._activeTimelineProvider?.getPosition() || -1));\r\n }\r\n\r\n private _handleTimelineComplete() {\r\n this._cleanUpTimeline();\r\n }\r\n\r\n private _handleExecuteTimelineAction(\r\n uri: string,\r\n index: number,\r\n start: boolean\r\n ) {\r\n const actions = this._getTimelineActionsForUri(uri);\r\n const action = actions?.[index];\r\n if (action) {\r\n if (start) {\r\n action.start();\r\n } else {\r\n action.end();\r\n }\r\n }\r\n }\r\n\r\n private _resizeTimelineAction(/*uri: string, index: number*/) {\r\n console.error('no resizing implemented');\r\n }\r\n\r\n private _getRelevantTimelineActions() {\r\n return this._getTimelineActionsForUri(this._currentTimelineUri);\r\n }\r\n\r\n private _requestCurrentTimeline(resultCallback: TResultCallback) {\r\n resultCallback(this._currentTimelineUri);\r\n }\r\n\r\n private _getTimelineActionsForUri(uri: string): ITimelineAction[] {\r\n const info = this.configuration.timelines.find((timelineInfo) => {\r\n return timelineInfo.uri === uri;\r\n });\r\n return info?.timelineActions ?? [];\r\n }\r\n\r\n private _onTimeHandler(floor: Function, event: any) {\r\n if (!isNaN(event.position)) {\r\n const pos = floor(event.position);\r\n\r\n if (this._lastPosition !== pos) {\r\n this._executeActionsForPosition(pos);\r\n this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [\r\n pos,\r\n this._activeTimelineProvider?.getDuration(),\r\n ]);\r\n }\r\n\r\n this.eventbus.broadcast(TimelineEventNames.TIME_UPDATE, [\r\n event.position,\r\n this._activeTimelineProvider?.getDuration(),\r\n ]);\r\n }\r\n }\r\n\r\n private _onSeekHandler(floor: Function, event: { offset: number }) {\r\n if (isNaN(event.offset)) {\r\n return;\r\n }\r\n\r\n const pos = floor(event.offset);\r\n\r\n this._executeSeekActions(pos).then(() => {\r\n this._activeTimelineProvider?.start();\r\n });\r\n }\r\n\r\n private _executeActionsForPosition(position: number) {\r\n this._lastPosition = position;\r\n const actions = this._timeLineActionsLookup[this._currentTimelineUri];\r\n\r\n if (actions) {\r\n const executions = actions[position];\r\n executions?.forEach((exec: () => void) => {\r\n exec();\r\n });\r\n }\r\n }\r\n\r\n private _executeSeekActions(pos: number) {\r\n const timelineActions = this._getRelevantTimelineActions();\r\n\r\n if (!timelineActions) {\r\n return Promise.resolve();\r\n }\r\n\r\n const currentActions = this._getActiveActions(timelineActions);\r\n const newActions = this._getActionsForPosition(pos, timelineActions);\r\n const promise = this._executeActions(currentActions, 'end', 0);\r\n\r\n return new Promise<void>((resolve) => {\r\n promise.then(() => {\r\n this._executeActions(newActions, 'start', 0).then(() => {\r\n resolve();\r\n });\r\n });\r\n });\r\n }\r\n}\r\n","import { IAction } from '../action/types';\r\nimport { IEventbusListener } from './types';\r\n\r\nexport class ActionRegistryEventbusListener implements IEventbusListener {\r\n private _actionRegistry = new Map<string, IAction[]>();\r\n\r\n registerAction(\r\n action: IAction,\r\n eventName: string,\r\n eventTopic?: string\r\n ): void {\r\n if (eventTopic && eventTopic.length) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this._actionRegistry.has(eventName)) {\r\n this._actionRegistry.set(eventName, []);\r\n }\r\n this._actionRegistry.get(eventName)?.push(action);\r\n }\r\n\r\n handleEvent(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any[]\r\n ): void {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n const actions = this._actionRegistry.get(eventName);\r\n if (actions) {\r\n const operationData = {\r\n eventArgs: args,\r\n };\r\n actions.forEach((action) => {\r\n action.start(operationData);\r\n });\r\n }\r\n }\r\n}\r\n","import {\r\n IEventbus,\r\n IEventbusInterceptor,\r\n IEventbusListener,\r\n TEventbusRemover,\r\n TEventHandler,\r\n} from './types';\r\n\r\nexport class Eventbus implements IEventbus {\r\n private eventHandlers = new Map<string, TEventHandler[]>();\r\n private eventInterceptors = new Map<string, IEventbusInterceptor[]>();\r\n private eventListeners: IEventbusListener[] = [];\r\n\r\n constructor() {\r\n this.clear();\r\n }\r\n\r\n clear() {\r\n this.eventHandlers = new Map<string, TEventHandler[]>();\r\n this.eventListeners = [];\r\n this.eventInterceptors = new Map<string, IEventbusInterceptor[]>();\r\n }\r\n\r\n _getEventInterceptors(\r\n eventName: string,\r\n eventTopic?: string\r\n ): IEventbusInterceptor[] {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this.eventInterceptors.has(eventName)) {\r\n this.eventInterceptors.set(eventName, []);\r\n }\r\n return this.eventInterceptors.get(eventName) as IEventbusInterceptor[];\r\n }\r\n\r\n _getEventHandlers(eventName: string, eventTopic?: string): TEventHandler[] {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this.eventHandlers.has(eventName)) {\r\n this.eventHandlers.set(eventName, []);\r\n }\r\n return this.eventHandlers.get(eventName) as TEventHandler[];\r\n }\r\n\r\n on(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n this._getEventHandlers(eventName, eventTopic).push(eventHandler);\r\n return () => {\r\n this.off(eventName, eventHandler, eventTopic);\r\n };\r\n }\r\n\r\n once(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n const eventHandlerDecorator = (...args: any[]) => {\r\n eventHandler(...args);\r\n this.off(eventName, eventHandlerDecorator, eventTopic);\r\n };\r\n this.on(eventName, eventHandlerDecorator, eventTopic);\r\n return () => {\r\n this.off(eventName, eventHandlerDecorator, eventTopic);\r\n };\r\n }\r\n\r\n off(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): void {\r\n const handlers = this._getEventHandlers(eventName, eventTopic);\r\n if (handlers) {\r\n const idx = handlers.indexOf(eventHandler);\r\n if (idx > -1) {\r\n handlers.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n broadcast(eventName: string, args: any[]): void {\r\n this._callHandlers(eventName, undefined, args);\r\n }\r\n\r\n broadcastForTopic(eventName: string, eventTopic: string, args: any[]): void {\r\n this._callHandlers(eventName, eventTopic, args);\r\n }\r\n\r\n registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover {\r\n this.eventListeners.push(eventbusListener);\r\n return () => {\r\n const index = this.eventListeners.indexOf(eventbusListener);\r\n if (index > -1) {\r\n this.eventListeners.splice(index, 1);\r\n }\r\n };\r\n }\r\n\r\n registerInterceptor(\r\n eventName: string,\r\n interceptor: IEventbusInterceptor,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\r\n interceptors.push(interceptor);\r\n return () => {\r\n const index = interceptors.indexOf(interceptor);\r\n if (index > -1) {\r\n interceptors.splice(index, 1);\r\n }\r\n };\r\n }\r\n\r\n _callHandlers(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any = []\r\n ): void {\r\n const handlers = this._getEventHandlers(eventName, eventTopic);\r\n\r\n if (handlers) {\r\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\r\n\r\n interceptors.forEach((interceptor) => {\r\n args = interceptor.intercept(args);\r\n });\r\n\r\n this.eventListeners.forEach((listener: IEventbusListener) => {\r\n listener.handleEvent(eventName, eventTopic, args);\r\n });\r\n\r\n if (args?.length) {\r\n handlers.forEach((handler: TEventHandler) => handler(...args));\r\n } else {\r\n handlers.forEach((handler: TEventHandler) => handler());\r\n }\r\n }\r\n }\r\n}\r\n","import { TimelineEventNames } from '../timeline-event-names';\r\nimport { IEventbus, IEventbusInterceptor } from './types';\r\n\r\nexport class RequestVideoUriInterceptor implements IEventbusInterceptor {\r\n constructor(private eventbus: IEventbus) {}\r\n\r\n intercept(args: any[]): any[] {\r\n this.eventbus.broadcast(\r\n TimelineEventNames.BEFORE_REQUEST_TIMELINE_URI,\r\n args.slice()\r\n );\r\n return args;\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport { IEventbus, TEventbusRemover } from './eventbus/types';\r\nimport { TimelineEventNames } from './timeline-event-names';\r\nimport { ILabel, ILanguageLabel, TResultCallback } from './types';\r\n\r\nexport class LanguageManager {\r\n private _labelLookup: Record<string, ILabel[]>;\r\n private _eventbusRemovers: TEventbusRemover[] = [];\r\n\r\n constructor(\r\n private _currentLanguage: string,\r\n labels: ILanguageLabel[],\r\n private _eventbus: IEventbus\r\n ) {\r\n if (!_currentLanguage) {\r\n throw new Error('language ctor arg cannot have zero length');\r\n }\r\n this._setRootElementLang(_currentLanguage);\r\n this._labelLookup = this._createLabelLookup(labels);\r\n this._addEventbusListeners(_eventbus);\r\n }\r\n\r\n destroy() {\r\n this._eventbusRemovers.forEach((x) => x());\r\n }\r\n\r\n _addEventbusListeners(eventbus: IEventbus) {\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n TimelineEventNames.REQUEST_LABEL_COLLECTION,\r\n this._handleRequestLabelCollection.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n TimelineEventNames.REQUEST_LABEL_COLLECTIONS,\r\n this._handleRequestLabelCollections.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n TimelineEventNames.REQUEST_CURRENT_LANGUAGE,\r\n this._handleRequestCurrentLanguage.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n TimelineEventNames.LANGUAGE_CHANGE,\r\n this._handleLanguageChange.bind(this)\r\n )\r\n );\r\n }\r\n\r\n _handleRequestCurrentLanguage(resultCallback: TResultCallback) {\r\n resultCallback(this._currentLanguage);\r\n }\r\n\r\n _handleRequestLabelCollection(\r\n labelId: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback(this._labelLookup[labelId]);\r\n }\r\n\r\n _handleRequestLabelCollections(\r\n labelIds: string[],\r\n resultCallback: TResultCallback\r\n ) {\r\n const labelCollections = labelIds.map((labelId) => {\r\n return this._labelLookup[labelId];\r\n });\r\n resultCallback(labelCollections);\r\n }\r\n\r\n _handleLanguageChange(language: string) {\r\n if (language && language.length) {\r\n this._currentLanguage = language;\r\n this._setRootElementLang(this._currentLanguage);\r\n } else {\r\n console.error('Language cannot be changed to null or empty string');\r\n }\r\n }\r\n\r\n _setRootElementLang(language: string) {\r\n const callBack = (rootSelector: string) => {\r\n const lang = this._extractLanguageFromCulture(language);\r\n $(rootSelector).attr('lang', lang);\r\n };\r\n this._eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [\r\n callBack,\r\n ]);\r\n }\r\n\r\n _extractLanguageFromCulture(culture: string) {\r\n if (culture.indexOf('-') > -1) {\r\n return culture.split('-').shift() as string;\r\n }\r\n return culture;\r\n }\r\n\r\n _createLabelLookup(labels: ILanguageLabel[]) {\r\n return labels.reduce<Record<string, ILabel[]>>((acc, label) => {\r\n acc[label.id] = label.labels;\r\n return acc;\r\n }, {});\r\n }\r\n}\r\n","import hotkeys, { HotkeysEvent } from 'hotkeys-js';\r\nimport $ from 'jquery';\r\nimport { IAction } from './action/types';\r\nimport { ConfigurationResolver } from './configuration/configuration-resolver';\r\nimport {\r\n IEngineConfiguration,\r\n IResolvedEngineConfiguration,\r\n} from './configuration/types';\r\nimport { DevToolEventListener } from './diagnostics/devtool-event-lister';\r\nimport { Diagnostics } from './diagnostics/diagnostics';\r\nimport {\r\n DEV_TOOLS_KEY,\r\n TDiagnosticType,\r\n TWindowWithDevtools,\r\n} from './diagnostics/types';\r\nimport {\r\n ActionRegistryEventbusListener,\r\n Eventbus,\r\n IEventbus,\r\n RequestVideoUriInterceptor,\r\n TEventbusRemover,\r\n} from './eventbus';\r\nimport { LanguageManager } from './language-manager';\r\nimport { TimelineEventNames } from './timeline-event-names';\r\nimport {\r\n IConfigurationResolver,\r\n IEligiusEngine,\r\n IEngineFactory,\r\n IEngineFactoryOptions,\r\n ISimpleResourceImporter,\r\n ITimelineProviderInfo,\r\n TimelineTypes,\r\n TResultCallback,\r\n} from './types';\r\nimport { prepareValueForSerialization } from './util/prepare-value-for-serialization';\r\n\r\nexport class EngineFactory implements IEngineFactory {\r\n private _actionsLookup: Record<string, IAction> = {};\r\n private _eventbus: IEventbus;\r\n private _eventRemovers: TEventbusRemover[] = [];\r\n private _importer: ISimpleResourceImporter;\r\n private _resizeTimeout: any = -1;\r\n\r\n constructor(\r\n importer: ISimpleResourceImporter,\r\n windowRef: Window,\r\n options?: IEngineFactoryOptions\r\n ) {\r\n this._importer = importer;\r\n this._eventbus = options?.eventbus ?? new Eventbus();\r\n\r\n Diagnostics.active = options?.devtools ?? false;\r\n if (Diagnostics.active) {\r\n this._initializeDevtools(this._eventbus);\r\n }\r\n\r\n this._eventRemovers.push(\r\n this._eventbus.on(\r\n TimelineEventNames.REQUEST_INSTANCE,\r\n this._requestInstanceHandler.bind(this)\r\n )\r\n );\r\n this._eventRemovers.push(\r\n this._eventbus.on(\r\n TimelineEventNames.REQUEST_ACTION,\r\n this._requestActionHandler.bind(this)\r\n )\r\n );\r\n this._eventRemovers.push(\r\n this._eventbus.on(\r\n TimelineEventNames.REQUEST_FUNCTION,\r\n this._requestFunctionHandler.bind(this)\r\n )\r\n );\r\n\r\n const handleSpaceBound = this._handleSpacePress.bind(this);\r\n hotkeys('space', handleSpaceBound);\r\n this._eventRemovers.push(() => hotkeys.unbind('space', handleSpaceBound));\r\n\r\n const resizeBound = this._resizeHandler.bind(this);\r\n const jqWin = $(windowRef);\r\n jqWin.on('resize', resizeBound);\r\n this._eventRemovers.push(() => jqWin.off('resize', resizeBound));\r\n }\r\n\r\n private _handleSpacePress(\r\n keyboardEvent: KeyboardEvent,\r\n _hotkeysEvent: HotkeysEvent\r\n ): void | boolean {\r\n keyboardEvent.preventDefault();\r\n this._eventbus.broadcast(TimelineEventNames.PLAY_TOGGLE_REQUEST);\r\n return false;\r\n }\r\n\r\n private _initializeDevtools(eventbus: IEventbus) {\r\n const diagnosticInfo = (window as unknown as TWindowWithDevtools)[\r\n DEV_TOOLS_KEY\r\n ];\r\n\r\n if (diagnosticInfo) {\r\n const { agent } = diagnosticInfo;\r\n\r\n this._eventRemovers.push(\r\n eventbus.registerEventlistener(new DevToolEventListener(agent))\r\n );\r\n\r\n this._eventRemovers.push(\r\n agent.subscribe((message) => {\r\n if (message.type === 'playcontrol') {\r\n switch (message.data.kind) {\r\n case 'play':\r\n this._eventbus.broadcast(TimelineEventNames.PLAY_REQUEST);\r\n break;\r\n case 'stop':\r\n this._eventbus.broadcast(TimelineEventNames.STOP_REQUEST);\r\n break;\r\n case 'pause':\r\n this._eventbus.broadcast(TimelineEventNames.PAUSE_REQUEST);\r\n break;\r\n case 'seek':\r\n this._eventbus.broadcast(TimelineEventNames.SEEK_REQUEST, [\r\n message.data.args,\r\n ]);\r\n break;\r\n }\r\n }\r\n })\r\n );\r\n\r\n Diagnostics.send = (name: TDiagnosticType, messageData: any) => {\r\n const message = prepareValueForSerialization(messageData);\r\n try {\r\n agent.postMessage(name, message);\r\n } catch (e) {\r\n console.error('postmessage failed');\r\n console.error(e);\r\n console.log('message', message);\r\n }\r\n };\r\n\r\n Diagnostics.send(\r\n 'eligius-diagnostics-factory',\r\n 'Diagnostics initialized'\r\n );\r\n } else {\r\n console.warn(\r\n `${DEV_TOOLS_KEY} property not found on window, please install the Eligius Devtools extension.`\r\n );\r\n }\r\n }\r\n\r\n destroy() {\r\n this._eventRemovers.forEach((x) => x());\r\n }\r\n\r\n private _resizeHandler() {\r\n if (this._resizeTimeout) {\r\n clearTimeout(this._resizeTimeout);\r\n this._resizeTimeout = -1;\r\n }\r\n this._resizeTimeout = setTimeout(() => {\r\n this._eventbus.broadcast(TimelineEventNames.RESIZE);\r\n }, 200);\r\n }\r\n\r\n private _importSystemEntryWithEventbusDependency(systemName: string): any {\r\n const ctor = this._importSystemEntry(systemName);\r\n return new ctor(this._eventbus);\r\n }\r\n\r\n private _importSystemEntry(systemName: string): any {\r\n return this._importer.import(systemName)[systemName];\r\n }\r\n\r\n private _requestInstanceHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback(this._importSystemEntryWithEventbusDependency(systemName));\r\n }\r\n\r\n private _requestFunctionHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback(this._importSystemEntry(systemName));\r\n }\r\n\r\n private _requestActionHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n const action = this._actionsLookup[systemName];\r\n if (action) {\r\n resultCallback(action);\r\n } else {\r\n console.error(`Unknown action: ${systemName}`);\r\n resultCallback(null);\r\n }\r\n }\r\n\r\n createEngine(\r\n configuration: IEngineConfiguration,\r\n resolver?: IConfigurationResolver\r\n ): IEligiusEngine {\r\n const { systemName } = configuration.engine;\r\n const EngineClass = this._importSystemEntry(systemName);\r\n\r\n let actionRegistryListener: ActionRegistryEventbusListener | undefined =\r\n undefined;\r\n if (configuration.eventActions?.length) {\r\n actionRegistryListener = new ActionRegistryEventbusListener();\r\n this._eventRemovers.push(\r\n this._eventbus.registerEventlistener(actionRegistryListener)\r\n );\r\n }\r\n\r\n this._eventRemovers.push(\r\n this._eventbus.registerInterceptor(\r\n TimelineEventNames.REQUEST_TIMELINE_URI,\r\n new RequestVideoUriInterceptor(this._eventbus)\r\n )\r\n );\r\n\r\n resolver =\r\n resolver || new ConfigurationResolver(this._importer, this._eventbus);\r\n const [actionLookup, resolvedConfiguration] = resolver.process(\r\n configuration,\r\n actionRegistryListener\r\n );\r\n this._actionsLookup = actionLookup;\r\n\r\n const timelineProviders = this._createTimelineProviders(\r\n resolvedConfiguration,\r\n this._eventbus\r\n );\r\n\r\n const { language, labels } = configuration;\r\n const languageManager = new LanguageManager(\r\n language,\r\n labels,\r\n this._eventbus\r\n );\r\n\r\n const engineInstance = new EngineClass(\r\n resolvedConfiguration,\r\n this._eventbus,\r\n timelineProviders,\r\n languageManager\r\n );\r\n\r\n return engineInstance;\r\n }\r\n\r\n private _createTimelineProviders(\r\n configuration: IResolvedEngineConfiguration,\r\n eventbus: IEventbus\r\n ): Record<TimelineTypes, ITimelineProviderInfo> {\r\n const { timelineProviderSettings } = configuration;\r\n\r\n const result = Object.entries(timelineProviderSettings).reduce<\r\n Record<TimelineTypes, ITimelineProviderInfo>\r\n >((acc, [timelineType, settings]) => {\r\n if (!settings) {\r\n return acc;\r\n }\r\n\r\n const timelineProviderClass = this._importSystemEntry(\r\n settings.systemName\r\n );\r\n acc[timelineType as TimelineTypes] = {\r\n id: settings.id,\r\n vendor: settings.vendor,\r\n provider: new timelineProviderClass(eventbus, configuration),\r\n };\r\n return acc;\r\n }, {} as Record<TimelineTypes, ITimelineProviderInfo>);\r\n\r\n return result;\r\n }\r\n}\r\n","import { TOperation } from './types';\r\n\r\nexport interface IAddClassOperationData {\r\n selectedElement: JQuery;\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation adds the specified class name to the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const addClass: TOperation<IAddClassOperationData> = function (\r\n operationData: IAddClassOperationData\r\n) {\r\n const { selectedElement, className } = operationData;\r\n selectedElement.addClass(className);\r\n return operationData;\r\n};\r\n","import { IController } from '../../controllers/types';\r\n\r\nexport const controllersDataName = 'eligiusEngineControllers';\r\n\r\nfunction getElementData(name: string, element: JQuery): IController<any>[] {\r\n return element.data(name);\r\n}\r\n\r\nconst getElementControllers = getElementData.bind(null, controllersDataName);\r\n\r\nexport { getElementData, getElementControllers };\r\n\r\n","import { TOperationData } from '../types';\r\n\r\nexport function mergeOperationData<T extends TOperationData, K = T>(\r\n operationData: T,\r\n newOperationData: TOperationData\r\n): K {\r\n return { ...(operationData as any), ...newOperationData } as K;\r\n}\r\n","import { TOperationData } from '../types';\r\nimport { mergeOperationData } from './merge-operation-data';\r\n\r\nexport function internalResolve(\r\n resolve: Function,\r\n operationData: TOperationData,\r\n newOperationData?: TOperationData\r\n) {\r\n if (newOperationData) {\r\n resolve(mergeOperationData(operationData, newOperationData));\r\n } else {\r\n resolve(operationData);\r\n }\r\n}\r\n","import { IController } from '../controllers/types';\r\nimport { attachControllerToElement } from './helper/attach-controller-to-element';\r\nimport { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IAddControllerToElementOperationData {\r\n selectedElement: JQuery;\r\n controllerInstance: IController<any>;\r\n}\r\n\r\n/**\r\n * This operation adds the specified controller instance to the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const addControllerToElement: TOperation<IAddControllerToElementOperationData> =\r\n function (operationData: IAddControllerToElementOperationData) {\r\n const { selectedElement, controllerInstance } = operationData;\r\n\r\n attachControllerToElement(selectedElement, controllerInstance);\r\n\r\n controllerInstance.init(operationData);\r\n\r\n const promise = controllerInstance.attach(this.eventbus);\r\n\r\n if (promise) {\r\n return new Promise((resolve, reject) => {\r\n promise.then((newOperationData: any) => {\r\n internalResolve(resolve, operationData, newOperationData);\r\n }, reject);\r\n });\r\n } else {\r\n return operationData;\r\n }\r\n };\r\n","import { controllersDataName, getElementControllers } from './get-element-data';\r\n\r\nexport function attachControllerToElement(element: JQuery, controller: any) {\r\n if (!element.data(controllersDataName)) {\r\n element.data(controllersDataName, []);\r\n }\r\n const controllers = getElementControllers(element);\r\n if (controllers) {\r\n controllers.push(controller);\r\n }\r\n}\r\n","import { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IAnimateOperationData {\r\n animationEasing?: string;\r\n selectedElement: JQuery;\r\n animationProperties: any;\r\n animationDuration: number;\r\n}\r\n\r\n/**\r\n * This operation animates the specified selected element with the given jQuery animation settings.\r\n * It resolves after the animation completes.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const animate: TOperation<IAnimateOperationData> = function (\r\n operationData: IAnimateOperationData\r\n) {\r\n const {\r\n animationEasing,\r\n selectedElement,\r\n animationProperties,\r\n animationDuration,\r\n } = operationData;\r\n const promise = new Promise<IAnimateOperationData>((resolve, reject) => {\r\n try {\r\n if (animationEasing) {\r\n selectedElement.animate(\r\n animationProperties,\r\n animationDuration,\r\n animationEasing,\r\n () => {\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n );\r\n } else {\r\n selectedElement.animate(animationProperties, animationDuration, () => {\r\n internalResolve(resolve, {}, operationData);\r\n });\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n });\r\n return promise;\r\n};\r\n","import { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IAnimateWithClassOperationData {\r\n selectedElement: JQuery;\r\n className: string;\r\n removeClass?: boolean;\r\n}\r\n\r\n/**\r\n * This operation adds the specified class name to the specified selected element and assumes that this\r\n * class triggers and animation on the selected element. It then waits for this animation to complete\r\n * until it resolves.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const animateWithClass: TOperation<IAnimateWithClassOperationData> =\r\n function (operationData: IAnimateWithClassOperationData) {\r\n let { selectedElement, className, removeClass } = operationData;\r\n removeClass = removeClass !== undefined ? removeClass : true;\r\n\r\n const promise = new Promise<IAnimateWithClassOperationData>(\r\n (resolve, reject) => {\r\n try {\r\n selectedElement.one(\r\n 'webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd',\r\n () => {\r\n if (removeClass) {\r\n selectedElement.removeClass(className);\r\n }\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n );\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }\r\n );\r\n\r\n selectedElement.addClass(className);\r\n\r\n return promise;\r\n };\r\n","import { getNestedValue } from './get-nested-value';\r\n\r\nexport function extractOperationDataArgumentValues(\r\n sourceObject: any,\r\n argumentValue: string | any\r\n) {\r\n if (\r\n typeof argumentValue === 'string' &&\r\n argumentValue.toLowerCase().startsWith('operationdata.')\r\n ) {\r\n const propNames = argumentValue.split('.');\r\n propNames.shift();\r\n return getNestedValue(propNames, sourceObject);\r\n }\r\n return argumentValue;\r\n}\r\n","import { removeEventDataFromOperationData } from './helper/remove-event-data-from-operation-data';\r\nimport { resolveEventArguments } from './helper/resolve-event-arguments';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IBroadcastEventOperationData {\r\n eventArgs: any[];\r\n eventTopic?: string;\r\n eventName: string;\r\n}\r\n\r\n/**\r\n * This operation broadcasts the given event through the eventbus, along with the\r\n * event argumetns and optional event topic.\r\n *\r\n * @param operationData\r\n */\r\nexport const broadcastEvent: TOperation<IBroadcastEventOperationData> =\r\n function (operationData: IBroadcastEventOperationData) {\r\n const { eventArgs, eventTopic, eventName } = operationData;\r\n\r\n const eventArguments = resolveEventArguments(operationData, eventArgs);\r\n\r\n if (eventTopic) {\r\n this.eventbus.broadcastForTopic(eventName, eventTopic, eventArguments);\r\n } else {\r\n this.eventbus.broadcast(eventName, eventArguments);\r\n }\r\n\r\n removeEventDataFromOperationData(operationData);\r\n return operationData;\r\n };\r\n","import { TOperationData } from '../../operation/types';\r\nimport { extractOperationDataArgumentValues } from './extract-operation-data-argument-values';\r\n\r\nexport function resolveEventArguments(\r\n operationData: TOperationData,\r\n eventArgs?: any[]\r\n) {\r\n if (!eventArgs) {\r\n return;\r\n }\r\n const extract = extractOperationDataArgumentValues.bind(null, operationData);\r\n return eventArgs.map(extract);\r\n}\r\n","import { TOperationData } from '../../operation/types';\r\n\r\nexport function removeEventDataFromOperationData(\r\n operationData: TOperationData\r\n) {\r\n delete operationData.eventName;\r\n delete operationData.eventTopic;\r\n delete operationData.eventArgs;\r\n}\r\n","import $ from 'jquery';\r\nimport { TOperationData } from '../../operation/types';\r\nimport { deepCopy } from './deep-copy';\r\nimport { extractOperationDataArgumentValues } from './extract-operation-data-argument-values';\r\n\r\nconst cache: any[] = [];\r\n\r\nexport function resolvePropertyValues(\r\n operationData: TOperationData,\r\n properties: any\r\n) {\r\n const copy = properties !== operationData ? deepCopy(properties) : properties;\r\n const extract = extractOperationDataArgumentValues.bind(null, operationData);\r\n\r\n resolveProperties(properties, copy, extract);\r\n\r\n return copy;\r\n}\r\n\r\nfunction resolveProperties(\r\n properties: any,\r\n copy: any,\r\n extract: (input: string) => any\r\n) {\r\n if (cache.indexOf(properties) > -1) {\r\n return;\r\n }\r\n cache.push(properties);\r\n try {\r\n Object.entries(properties).forEach(([key, value]) => {\r\n if (value instanceof $) {\r\n return;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n copy[key] = extract(value);\r\n } else if (Array.isArray(value)) {\r\n value.forEach((item, index, arr) => {\r\n if (typeof item === 'string') {\r\n arr[index] = extract(item);\r\n } else {\r\n resolveProperties(item, item, extract);\r\n }\r\n });\r\n } else if (typeof value === 'object') {\r\n resolveProperties(value, value, extract);\r\n }\r\n });\r\n } finally {\r\n const index = cache.indexOf(properties);\r\n cache.splice(index, 1);\r\n }\r\n}\r\n","import { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport type TCalculationOperator = '+' | '-' | '*' | '/' | '%' | '**';\r\n\r\nexport interface ICalcOperationData {\r\n left: string | number;\r\n right: string | number;\r\n operator: TCalculationOperator;\r\n propertyName?: string;\r\n}\r\n\r\nconst calcFunctions: Record<\r\n TCalculationOperator,\r\n (left: number, right: number) => number\r\n> = {\r\n '+': (left: number, right: number) => left + right,\r\n '-': (left: number, right: number) => left - right,\r\n '*': (left: number, right: number) => left * right,\r\n '/': (left: number, right: number) => left / right,\r\n '%': (left: number, right: number) => left % right,\r\n '**': (left: number, right: number) => left ** right,\r\n};\r\n\r\n/**\r\n * This operation calculates the given left and right hand sides using the specified operator.\r\n *\r\n * @param operationData\r\n */\r\nexport const calc: TOperation<ICalcOperationData> = function (\r\n operationData: ICalcOperationData\r\n) {\r\n operationData = resolvePropertyValues(operationData, operationData);\r\n\r\n const {\r\n left,\r\n right,\r\n operator,\r\n propertyName = 'calculationResult',\r\n } = operationData;\r\n\r\n (operationData as any)[propertyName] = calcFunctions[operator](+left, +right);\r\n\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IClearElementOperationData {\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation removes all of the children from the specified selected element.\r\n */\r\nexport const clearElement: TOperation<IClearElementOperationData> = function(\r\n operationData: IClearElementOperationData\r\n) {\r\n const { selectedElement } = operationData;\r\n selectedElement.empty();\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IClearOperationDataOperationData {\r\n properties?: string[];\r\n}\r\n\r\n/**\r\n * This operation removes all of the properties on the current operation date.\r\n * Or, if the properties property is set only removes the properties defined by that list.\r\n */\r\nexport const clearOperationData: TOperation<IClearOperationDataOperationData> = function(\r\n operationData: IClearOperationDataOperationData\r\n) {\r\n const { properties } = operationData;\r\n\r\n if (properties) {\r\n properties.forEach(name => {\r\n delete (operationData as any)[name];\r\n });\r\n delete operationData.properties;\r\n return operationData;\r\n }\r\n\r\n return {};\r\n};\r\n","import $ from 'jquery';\r\nimport { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport type TTagNames = keyof HTMLElementTagNameMap;\r\n\r\nexport interface ICreateElementOperationData<T extends TTagNames> {\r\n elementName: T;\r\n text?: string;\r\n attributes?: Partial<HTMLElementTagNameMap[T]>;\r\n propertyName?: string;\r\n template?: JQuery;\r\n}\r\n\r\n/**\r\n * This operation creates the DOM element defined by the given properties and assigns\r\n * the instance to the give property name on the current operation data.\r\n * The property name defaults to 'template'.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const createElement: TOperation<ICreateElementOperationData<any>> =\r\n function <T extends TTagNames>(\r\n operationData: ICreateElementOperationData<T>\r\n ) {\r\n operationData = resolvePropertyValues(operationData, operationData);\r\n const {\r\n elementName,\r\n attributes,\r\n text,\r\n propertyName = 'template',\r\n } = operationData;\r\n\r\n const serializedAttrs = attributes\r\n ? ' ' +\r\n Object.entries(attributes)\r\n .map(([key, value]) => `${key}=\"${value}\"`)\r\n .join(' ')\r\n : '';\r\n\r\n const template = text\r\n ? $(`<${elementName}${serializedAttrs}>${text}</${elementName}>`)\r\n : $(`<${elementName}${serializedAttrs}/>`);\r\n\r\n (operationData as any)[propertyName] = template;\r\n\r\n delete operationData.propertyName;\r\n return operationData;\r\n };\r\n","import { TimelineEventNames } from '../timeline-event-names';\r\nimport { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\nexport interface ICustomFunctionOperationData {\r\n systemName: string;\r\n}\r\n\r\n/**\r\n * This operation retrieves a custom function defined by the specified system name\r\n * and invokes it with the current operation data and eventbus.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const customFunction: TOperation<ICustomFunctionOperationData> =\r\n function (operationData: ICustomFunctionOperationData) {\r\n const { systemName } = operationData;\r\n return new Promise<ICustomFunctionOperationData>((resolve, reject) => {\r\n const resultCallback = (func: Function) => {\r\n const promise = func(operationData, this.eventbus);\r\n if (promise) {\r\n promise.then(() => {\r\n internalResolve(resolve, {}, operationData);\r\n }, reject);\r\n } else {\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n };\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_FUNCTION, [\r\n systemName,\r\n resultCallback,\r\n ]);\r\n });\r\n };\r\n","import { IEndableAction } from '../action/types';\r\nimport { internalResolve } from './helper/internal-resolve';\r\nimport { mergeOperationData } from './helper/merge-operation-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IEndActionOperationData {\r\n actionInstance: IEndableAction;\r\n actionOperationData: any;\r\n}\r\n\r\n/**\r\n * This operation invokes the end() method on the specified action instance.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const endAction: TOperation<IEndActionOperationData> = function (\r\n operationData: IEndActionOperationData\r\n) {\r\n const { actionInstance, actionOperationData } = operationData;\r\n delete operationData.actionOperationData;\r\n\r\n return new Promise<IEndActionOperationData>((resolve, reject) => {\r\n operationData = mergeOperationData(operationData, actionOperationData);\r\n\r\n actionInstance.end(operationData).then(() => {\r\n Object.keys(actionOperationData).forEach((key) => {\r\n delete (operationData as any)[key];\r\n });\r\n internalResolve(resolve, operationData);\r\n }, reject);\r\n });\r\n};\r\n","import { TOperationData } from '.';\r\nimport { TOperation } from './types';\r\n\r\n/**\r\n * This operation checks if the current loop should end or start the next iteration.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const endLoop: TOperation<TOperationData> = function (\r\n operationData: TOperationData\r\n) {\r\n const context = this;\r\n\r\n if (!context.skipNextOperation) {\r\n if (\r\n context.loopIndex !== undefined &&\r\n context.loopLength !== undefined &&\r\n context.loopIndex < context.loopLength\r\n ) {\r\n context.loopIndex = context.loopIndex + 1;\r\n context.newIndex = context.startIndex;\r\n } else {\r\n delete context.loopIndex;\r\n delete context.loopLength;\r\n delete context.startIndex;\r\n delete context.newIndex;\r\n }\r\n } else {\r\n delete context.skipNextOperation;\r\n }\r\n\r\n return operationData;\r\n};\r\n","import { IController } from '../controllers/types';\r\nimport { TOperation } from './types';\r\n\r\n/**\r\n * This operation extends the specified controller instance with the specified extension.\r\n */\r\nexport interface IExtendControllerOperationData {\r\n controllerInstance: IController<any>;\r\n controllerExtension: any;\r\n}\r\n\r\nexport const extendController: TOperation<IExtendControllerOperationData> =\r\n function (operationData: IExtendControllerOperationData) {\r\n const { controllerInstance, controllerExtension } = operationData;\r\n\r\n operationData.controllerInstance = Object.assign(\r\n controllerInstance,\r\n controllerExtension\r\n );\r\n\r\n return operationData;\r\n };\r\n","import { IController } from '../controllers/types';\r\nimport { getElementControllers } from './helper/get-element-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IGetControllerFromElementOperationData {\r\n selectedElement: JQuery;\r\n controllerName: string;\r\n controllerInstance?: IController<any>;\r\n}\r\n\r\n/**\r\n * This operation retrieves the controller instance with the specified name from the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const getControllerFromElement: TOperation<IGetControllerFromElementOperationData> =\r\n function (operationData: IGetControllerFromElementOperationData) {\r\n const { selectedElement, controllerName } = operationData;\r\n const controllers = getElementControllers(selectedElement);\r\n const controller = controllers.find((ctrl) => {\r\n return ctrl.name === controllerName;\r\n });\r\n\r\n if (!controller) {\r\n console.warn(\r\n `controller for name '${controllerName}' was not found on the given element`\r\n );\r\n }\r\n\r\n operationData.controllerInstance = controller;\r\n return operationData;\r\n };\r\n","import * as controllers from '../controllers';\r\nimport { IController } from '../controllers/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { TOperation } from './types';\r\n\r\ntype TSystemName = keyof typeof controllers;\r\nexport interface IGetControllerInstanceOperationData {\r\n systemName: TSystemName;\r\n propertyName?: string;\r\n controllerInstance?: IController<unknown>;\r\n}\r\n\r\n/**\r\n * This operation retrieves an instance of the given controller name.\r\n * It assigns this instance to the property on the current operation data\r\n * defined by the propertyName property which defaults to 'controllerInstance'.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const getControllerInstance: TOperation<IGetControllerInstanceOperationData> =\r\n function (operationData: IGetControllerInstanceOperationData) {\r\n const { systemName, propertyName = 'controllerInstance' } = operationData;\r\n\r\n (operationData as any)[propertyName] = null;\r\n const resultCallback = (instance: any) => {\r\n (operationData as any)[propertyName as string] = instance;\r\n };\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_INSTANCE, [\r\n systemName,\r\n resultCallback,\r\n ]);\r\n delete operationData.propertyName;\r\n return operationData;\r\n };\r\n","import { modifyDimensions } from './helper/modify-dimensions';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IGetElementDimensionsOperationData {\r\n selectedElement: JQuery;\r\n modifier?: string;\r\n dimensions?: { width?: number; height?: number };\r\n}\r\n\r\n/**\r\n * This operation calculates the width and height of the specified selected element.\r\n * It assigns this struct to the dimensions property on the current operation data.\r\n * Optionally the width and height can be tweaked using the given modifier string.\r\n *\r\n * The modifier string is formatted in the following way:\r\n *\r\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\r\n *\r\n * Where the ratio modifier is formatted in the following way:\r\n * <side>[ar=<ratio-left>-<ratio-right>]\r\n *\r\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\r\n * it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const getElementDimensions: TOperation<IGetElementDimensionsOperationData> =\r\n function (operationData: IGetElementDimensionsOperationData) {\r\n const { selectedElement, modifier } = operationData;\r\n let dimensions = {\r\n width: selectedElement.innerWidth() ?? 0,\r\n height: selectedElement.innerHeight() ?? 0,\r\n };\r\n if (dimensions.height === 0) {\r\n dimensions.height = dimensions.width;\r\n }\r\n if (modifier) {\r\n dimensions = modifyDimensions(dimensions, modifier);\r\n }\r\n operationData.dimensions = dimensions;\r\n return operationData;\r\n };\r\n","import { IDimensions } from '../../types';\r\n\r\nfunction _modifyDimensionsByRatio(\r\n ratioModifier: string,\r\n dimensions: IDimensions\r\n) {\r\n const modifiedDimensions = { ...dimensions };\r\n //h[ar=8-1]\r\n let prefix = ratioModifier.substring(0, 1);\r\n\r\n let ratio = ratioModifier.substring(\r\n ratioModifier.indexOf('[') + 1,\r\n ratioModifier.indexOf(']') - (ratioModifier.indexOf('[') - 1)\r\n );\r\n\r\n let ratios = ratio.split('=')[1].split('-');\r\n\r\n if (ratios.filter(Boolean).length !== 2) {\r\n throw new Error(`Badly formatted modifier, expect two ratios: ${ratio}`);\r\n }\r\n\r\n if (prefix === 'h') {\r\n modifiedDimensions.height =\r\n (modifiedDimensions.width / +ratios[0]) * +ratios[1];\r\n } else if (prefix === 'w') {\r\n modifiedDimensions.width =\r\n (modifiedDimensions.height / +ratios[1]) * +ratios[0];\r\n }\r\n\r\n return modifiedDimensions;\r\n}\r\n\r\nfunction _getModifierSuffix(\r\n modifier: string //*100h%\r\n): [string | null, number, boolean] {\r\n let endIdx = 1;\r\n let suffix: string | null = modifier.substring(\r\n modifier.length - endIdx,\r\n modifier.length\r\n );\r\n\r\n if (suffix !== 'h' && suffix !== 'w' && suffix !== '%') {\r\n suffix = null;\r\n }\r\n\r\n const isPercent = suffix === '%';\r\n\r\n if (isPercent) {\r\n suffix = modifier.substring(\r\n modifier.length - endIdx,\r\n modifier.length - (endIdx + 1)\r\n );\r\n\r\n if (suffix !== 'h' && suffix !== 'w') {\r\n suffix = null;\r\n }\r\n }\r\n\r\n return [suffix, endIdx, isPercent];\r\n}\r\n\r\nfunction _modifyDimensions(\r\n dimensions: IDimensions,\r\n prefix: string,\r\n suffix: string | null,\r\n widthModifier: number,\r\n heightModifier: number\r\n) {\r\n const modifiedDimension = { ...dimensions };\r\n switch (prefix) {\r\n case '+':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height += heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width += widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height += heightModifier;\r\n modifiedDimension.width += widthModifier;\r\n }\r\n break;\r\n case '-':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height -= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width -= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height -= heightModifier;\r\n modifiedDimension.width -= widthModifier;\r\n }\r\n break;\r\n case '/':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height /= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width /= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height /= heightModifier;\r\n modifiedDimension.width /= widthModifier;\r\n }\r\n break;\r\n case '*':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height *= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width *= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height *= heightModifier;\r\n modifiedDimension.width *= widthModifier;\r\n }\r\n break;\r\n default:\r\n console.error(`Unknown operator found: ${prefix}`);\r\n }\r\n return modifiedDimension;\r\n}\r\n\r\n/**\r\n * Modifies the given dimensions using the given modifier string.\r\n * The modifier string is formatted in the following way:\r\n *\r\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\r\n *\r\n * Where the ratio modifier is formatted in the following way:\r\n * <side>[ar=<ratio-left>-<ratio-right>]\r\n *\r\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\r\n * it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.\r\n *\r\n * @param dimensions\r\n * @param modifier\r\n */\r\nexport function modifyDimensions(dimensions: IDimensions, modifier: string) {\r\n const clonedDimensions = { ...dimensions };\r\n let ratioModifier: string | null = null;\r\n if (modifier.indexOf('|') > -1) {\r\n [modifier, ratioModifier] = modifier.split('|');\r\n }\r\n\r\n const prefix = modifier.substring(0, 1);\r\n let [suffix, endIdx, isPercent] = _getModifierSuffix(modifier);\r\n\r\n const value = parseInt(\r\n suffix !== null\r\n ? modifier.substring(1, modifier.length - (endIdx - 1))\r\n : modifier.substring(1),\r\n 10\r\n );\r\n\r\n let widthModifier = value;\r\n let heightModifier = value;\r\n if (isPercent) {\r\n widthModifier = (clonedDimensions.width / 100) * value;\r\n heightModifier = (clonedDimensions.height / 100) * value;\r\n }\r\n\r\n const modifiedDimension = _modifyDimensions(\r\n clonedDimensions,\r\n prefix,\r\n suffix,\r\n widthModifier,\r\n heightModifier\r\n );\r\n\r\n if (ratioModifier) {\r\n return _modifyDimensionsByRatio(ratioModifier, modifiedDimension);\r\n }\r\n\r\n return modifiedDimension;\r\n}\r\n","import { TimelineEventNames } from '../timeline-event-names';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IGetImportOperationData {\r\n systemName: string;\r\n importedInstance?: any;\r\n}\r\n\r\n/**\r\n * This operation retrieves the import specified by the given system name and\r\n * assigns it to the importedInstance property on the current operaton date.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const getImport: TOperation<IGetImportOperationData> = function (\r\n operationData: IGetImportOperationData\r\n) {\r\n const { systemName } = operationData;\r\n const callBack = (instance: any) => {\r\n operationData.importedInstance = instance;\r\n };\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_FUNCTION, [\r\n systemName,\r\n callBack,\r\n ]);\r\n delete (operationData as any).systemName;\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nconst jsonCache: Record<string, any> = {};\r\n\r\nexport interface ILoadJSONOperationData {\r\n url: string;\r\n cache: boolean;\r\n propertyName?: string;\r\n json?: any;\r\n}\r\n\r\nexport const clearCache = () => {\r\n for (let p in jsonCache) {\r\n delete jsonCache[p];\r\n }\r\n};\r\n\r\nexport const addToCache = (key: string, value: any) => {\r\n jsonCache[key] = value;\r\n};\r\n\r\n/**\r\n * This operation loads a JSON file from the specified url and assigns it to the specified\r\n * property name on the current operation data. The property name defaults to 'json'.\r\n *\r\n * If the cache property is set to true and a cached value already exists, this is assigned\r\n * instead of re-retrieving it from the url.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const loadJSON: TOperation<ILoadJSONOperationData> = function (\r\n operationData: ILoadJSONOperationData\r\n) {\r\n const { url, cache, propertyName = 'json' } = operationData;\r\n\r\n if (cache && jsonCache[url]) {\r\n (operationData as any)[propertyName] = jsonCache[url];\r\n delete operationData.propertyName;\r\n return operationData;\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n fetch(url)\r\n .then(async (response) => {\r\n const json = await response.json();\r\n const cacheValue = ((operationData as any)[propertyName] = json);\r\n delete operationData.propertyName;\r\n addToCache(url, cacheValue);\r\n resolve(operationData);\r\n })\r\n .catch(reject);\r\n });\r\n};\r\n","import { TOperation } from './types';\r\n\r\n/**\r\n * This operation logs the current operation data and context.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const log: TOperation = function (operationData: unknown) {\r\n console.group('Operation info');\r\n console.dir({ context: this });\r\n console.dir({ operationData });\r\n console.groupEnd();\r\n return operationData;\r\n};\r\n","import { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IMathOperationData {\r\n args: (number | string | keyof Math)[];\r\n functionName: keyof Math;\r\n propertyName?: string;\r\n}\r\n\r\n/**\r\n * This operation performs the given math function of the specified arguments.\r\n *\r\n * @param operationData\r\n */\r\nexport const math: TOperation<IMathOperationData> = function (\r\n operationData: IMathOperationData\r\n) {\r\n operationData = resolvePropertyValues(operationData, operationData);\r\n operationData.args = resolveMathConstants(operationData.args);\r\n\r\n const { args, functionName, propertyName = 'mathResult' } = operationData;\r\n\r\n (operationData as any)[propertyName] = (Math[functionName] as Function).apply(\r\n null,\r\n args\r\n );\r\n\r\n return operationData;\r\n};\r\n\r\nfunction resolveMathConstants(args: any[]) {\r\n return args.map((arg: any) => {\r\n if (isMathProperty(arg)) {\r\n return Math[arg];\r\n }\r\n return arg;\r\n });\r\n}\r\n\r\nfunction isMathProperty(value: string | Symbol): value is keyof Math {\r\n return (\r\n typeof value === 'string' &&\r\n value in Math &&\r\n typeof Math[value as keyof Math] !== 'function'\r\n );\r\n}\r\n","import { TOperation } from './types';\r\n\r\nexport interface IRemoveClassOperationData {\r\n selectedElement: JQuery;\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation removes the spcified class name from the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const removeClass: TOperation<IRemoveClassOperationData> = function (\r\n operationData: IRemoveClassOperationData\r\n) {\r\n const { selectedElement, className } = operationData;\r\n selectedElement.removeClass(className);\r\n return operationData;\r\n};\r\n","import { IController } from '../controllers/types';\r\nimport { getElementControllers } from './helper/get-element-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IRemoveControllerFromElementOperationData {\r\n selectedElement: JQuery;\r\n controllerName: string;\r\n}\r\n\r\n/**\r\n * This operation removes the controller with the specified name from the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const removeControllerFromElement: TOperation<IRemoveControllerFromElementOperationData> =\r\n function (operationData: IRemoveControllerFromElementOperationData) {\r\n const { selectedElement, controllerName } = operationData;\r\n\r\n const controllers = getElementControllers(selectedElement);\r\n const controller = controllers?.find(\r\n (ctrl: IController<any>) => ctrl.name === controllerName\r\n );\r\n\r\n if (controller) {\r\n const idx = controllers.indexOf(controller);\r\n controllers.splice(idx, 1);\r\n controller.detach(this.eventbus);\r\n }\r\n\r\n return operationData;\r\n };\r\n","import { TOperation } from './types';\r\n\r\nexport interface IRemoveElementOperationData {\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation removes the specified selected element from the DOM.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const removeElement: TOperation<IRemoveElementOperationData> = function (\r\n operationData: IRemoveElementOperationData\r\n) {\r\n const { selectedElement } = operationData;\r\n selectedElement.remove();\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IRemovePropertiesFromOperationDataOperationData {\r\n propertyNames: string[];\r\n}\r\n\r\n/**\r\n * This operation removes the given list of properties from the current operation data.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const removePropertiesFromOperationData: TOperation<IRemovePropertiesFromOperationDataOperationData> =\r\n function (operationData: IRemovePropertiesFromOperationDataOperationData) {\r\n const { propertyNames } = operationData;\r\n\r\n propertyNames.forEach((name) => {\r\n delete (operationData as any)[name];\r\n });\r\n delete (operationData as any).propertyNames;\r\n return operationData;\r\n };\r\n","import { TOperation } from './types';\r\n\r\nexport interface IReparentElementOperationData {\r\n selectedElement: JQuery;\r\n newParentSelector: string;\r\n}\r\n\r\n/**\r\n * This operation moves the specified selected element to the new parent that is defined\r\n * by the specified selector.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const reparentElement: TOperation<IReparentElementOperationData> =\r\n function (operationData: IReparentElementOperationData) {\r\n const { selectedElement, newParentSelector } = operationData;\r\n selectedElement.remove().appendTo(newParentSelector);\r\n return operationData;\r\n };\r\n","import { IAction } from '../action/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IRequestActionOperationData {\r\n systemName: string;\r\n actionInstance?: IAction;\r\n}\r\n\r\n/**\r\n * This operation requests an action instance with the specified name and assigns it\r\n * to the actionInstance property on the current operation data.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const requestAction: TOperation<IRequestActionOperationData> = function (\r\n operationData: IRequestActionOperationData\r\n) {\r\n const { systemName } = operationData;\r\n\r\n const resultCallback = (action: IAction) => {\r\n operationData.actionInstance = action;\r\n };\r\n\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_ACTION, [\r\n systemName,\r\n resultCallback,\r\n ]);\r\n return operationData;\r\n};\r\n","import { mergeOperationData } from './helper/merge-operation-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IResizeActionOperationData {\r\n actionInstance: any;\r\n actionOperationData: any;\r\n}\r\n\r\n/**\r\n * @deprecated\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const resizeAction: TOperation<IResizeActionOperationData> = function (\r\n operationData: IResizeActionOperationData\r\n) {\r\n const { actionInstance, actionOperationData } = operationData;\r\n operationData = mergeOperationData(operationData, actionOperationData);\r\n\r\n if (actionInstance.resize) {\r\n return actionInstance.resize(operationData);\r\n }\r\n\r\n return operationData;\r\n};\r\n","import { TimelineEventNames } from '../timeline-event-names';\r\nimport { TOperation } from './types';\r\n\r\nfunction findElementBySelector(\r\n root: JQuery,\r\n selector: string,\r\n operationData: any,\r\n propertyName: string\r\n) {\r\n const element = root.find(selector);\r\n if (!element.length) {\r\n console.warn(`selector '${selector}' wasn't found!`);\r\n }\r\n operationData[propertyName] = element;\r\n if (operationData.hasOwnProperty('propertyName')) {\r\n delete operationData.propertyName;\r\n }\r\n}\r\n\r\nexport interface ISelectElementOperationData {\r\n selector: string;\r\n propertyName?: string;\r\n useSelectedElementAsRoot?: boolean;\r\n selectedElement?: JQuery;\r\n}\r\n\r\n/**\r\n * This operation selects one or more elements using the specified selector.\r\n *\r\n * If useSelectedElementAsRoot is set to true and a valid DOM element is assigned\r\n * to the current operation data defined by the given property name (defaults to 'selectedElement')\r\n * then the element will be looked for only in the child elements of this DOM element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const selectElement: TOperation<ISelectElementOperationData> = function (\r\n operationData: ISelectElementOperationData\r\n) {\r\n const {\r\n selector,\r\n propertyName = 'selectedElement',\r\n useSelectedElementAsRoot = false,\r\n } = operationData;\r\n\r\n if (!selector) {\r\n throw new Error('selector is undefined!');\r\n }\r\n\r\n if (useSelectedElementAsRoot && (operationData as any)[propertyName]) {\r\n const currentRoot = (operationData as any)[propertyName];\r\n findElementBySelector(currentRoot, selector, operationData, propertyName);\r\n return operationData;\r\n }\r\n\r\n const rootCallback = (root: JQuery) => {\r\n findElementBySelector(root, selector, operationData, propertyName);\r\n };\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [\r\n rootCallback,\r\n ]);\r\n\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface ISetElementAttributesOperationData {\r\n attributes: Record<string, any>;\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation sets the given set of attributes on the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const setElementAttributes: TOperation<ISetElementAttributesOperationData> =\r\n function (operationData: ISetElementAttributesOperationData) {\r\n const { attributes, selectedElement } = operationData;\r\n Object.entries(attributes).forEach(([attrName, attrValue]) => {\r\n selectedElement.attr(attrName, attrValue);\r\n });\r\n return operationData;\r\n };\r\n","import { TOperation } from './types';\r\n\r\nexport interface ISetElementContentOperationData {\r\n selectedElement: JQuery;\r\n template: string | JQuery.Node;\r\n insertionType: 'overwrite' | 'append' | 'prepend';\r\n}\r\n\r\n/**\r\n * This operation sets the specified content defined by the value assigned to the template property\r\n * to the specified selected element.\r\n *\r\n * When the insertionType is set to 'overwrite' the contents of the selected element are replaced\r\n * by the given template.\r\n * When set to 'append' the new content will be inserted after the current content.\r\n * When set to 'prepend' the new content will be inserted before the current content.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const setElementContent: TOperation<ISetElementContentOperationData> =\r\n function (operationData: ISetElementContentOperationData) {\r\n const {\r\n insertionType = 'overwrite',\r\n selectedElement,\r\n template,\r\n } = operationData;\r\n\r\n switch (true) {\r\n case insertionType === 'overwrite':\r\n selectedElement.html(template);\r\n break;\r\n case insertionType === 'append':\r\n selectedElement.append(template);\r\n break;\r\n case insertionType === 'prepend':\r\n selectedElement.prepend(template);\r\n break;\r\n }\r\n\r\n delete (operationData as any).insertionType;\r\n\r\n return operationData;\r\n };\r\n","import { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport interface ISetOperationData {\r\n override?: boolean;\r\n properties: any;\r\n}\r\n\r\n/**\r\n * This operation assigns the specified properties to the current operation data.\r\n * When override is set to true the properties replace the current operation data entirely.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const setOperationData: TOperation<ISetOperationData> = function (\r\n operationData: ISetOperationData\r\n) {\r\n const { override = false, properties } = operationData;\r\n delete operationData.properties;\r\n delete operationData.override;\r\n\r\n const resolvedProperties = resolvePropertyValues(operationData, properties);\r\n\r\n if (override) {\r\n operationData = resolvedProperties;\r\n } else {\r\n operationData = Object.assign(operationData, resolvedProperties);\r\n }\r\n\r\n return operationData;\r\n};\r\n","import { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport interface ISetStyleOperationData {\r\n properties: any;\r\n propertyName?: string;\r\n}\r\n\r\n/**\r\n * This operation assigns the specified CSS style properties to the\r\n * specified selected element. The selected element is assigned to\r\n * the property defined by the propertyName property which defaults\r\n * to 'selectedElement'.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const setStyle: TOperation<ISetStyleOperationData> = function (\r\n operationData: ISetStyleOperationData\r\n) {\r\n const { propertyName = 'selectedElement' } = operationData;\r\n\r\n const properties = resolvePropertyValues(\r\n operationData,\r\n operationData.properties\r\n );\r\n (operationData as any)[propertyName].css(properties);\r\n delete operationData.propertyName;\r\n\r\n return operationData;\r\n};\r\n","import { IAction } from '../action/types';\r\nimport { internalResolve } from './helper/internal-resolve';\r\nimport { mergeOperationData } from './helper/merge-operation-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IStartActionOperationData {\r\n actionInstance: IAction;\r\n actionOperationData: any;\r\n}\r\n\r\n/**\r\n * This operation starts the specified action instance using the specified action operation data.\r\n *\r\n * The action operation data is first merged with the current operation data before it is\r\n * passed on to the action. After the action has completed the action operation data properties\r\n * are removed from the current operation data.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const startAction: TOperation<IStartActionOperationData> = function (\r\n operationData: IStartActionOperationData\r\n) {\r\n const { actionInstance, actionOperationData } = operationData;\r\n delete operationData.actionOperationData;\r\n\r\n return new Promise((resolve, reject) => {\r\n operationData = mergeOperationData(operationData, actionOperationData);\r\n\r\n actionInstance.start(operationData).then(() => {\r\n Object.keys(actionOperationData).forEach((key) => {\r\n delete (operationData as any)[key];\r\n });\r\n internalResolve(resolve, operationData);\r\n }, reject);\r\n });\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport type TStartLoopOperationData = {\r\n collection: any[] | string;\r\n propertyName?: string;\r\n};\r\n\r\n/**\r\n * This operation starts a loop using the given collection.\r\n *\r\n * Each iteration the current item from the specified collection is\r\n * assigned to the property on the current operation data specified\r\n * by the propertyName property which defaults to 'currentItem'.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const startLoop: TOperation<TStartLoopOperationData> = function (\r\n operationData: TStartLoopOperationData\r\n) {\r\n const context = this;\r\n const { collection, propertyName = 'currentItem' } = operationData;\r\n\r\n if (typeof collection === 'string') {\r\n throw new Error(\r\n 'Expected collection to be array type, string value was probably not resolved correctly'\r\n );\r\n }\r\n\r\n if (context.loopIndex === undefined) {\r\n if (collection?.length) {\r\n context.loopIndex = 0;\r\n context.loopLength = collection.length - 1;\r\n context.startIndex = context.currentIndex;\r\n } else {\r\n context.skipNextOperation = true;\r\n }\r\n }\r\n\r\n if (collection?.length && context.loopIndex !== undefined) {\r\n (operationData as any)[propertyName] = collection[context.loopIndex];\r\n }\r\n\r\n delete operationData.propertyName;\r\n\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IToggleClassOperationData {\r\n selectedElement: JQuery;\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation toggles the specfied class name on the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const toggleClass: TOperation<IToggleClassOperationData> = function (\r\n operationData: IToggleClassOperationData\r\n) {\r\n const { selectedElement, className } = operationData;\r\n selectedElement.toggleClass(className);\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IToggleElementOperationData {\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation toggles the visibility of the specified selected element\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const toggleElement: TOperation<IToggleElementOperationData> =\r\n function toggleElement(operationData: IToggleElementOperationData) {\r\n operationData.selectedElement.toggle();\r\n return operationData;\r\n };\r\n","import { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\n/**\r\n * \r\n */\r\nexport interface IWaitOperationData {\r\n milliseconds: number;\r\n}\r\n\r\n/**\r\n * This operation waits for the specified amount of milliseconds.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const wait: TOperation<IWaitOperationData> = function (\r\n operationData: IWaitOperationData\r\n) {\r\n const { milliseconds } = operationData;\r\n\r\n return new Promise((resolve) => {\r\n setTimeout(() => {\r\n internalResolve(resolve, operationData);\r\n }, milliseconds);\r\n });\r\n};\r\n","import $ from 'jquery';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { IResolvedEngineConfiguration } from '../configuration/types';\r\nimport { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { TResultCallback } from '../types';\r\nimport { ITimelineProvider } from './types';\r\n\r\nexport class JwPlayerTimelineProvider implements ITimelineProvider {\r\n private _paused: boolean = false;\r\n private _player: any = null;\r\n private _currentLoopHandler: Function | null = null;\r\n private _eventbusListeners: TEventbusRemover[] = [];\r\n private _playlist: any[] = [];\r\n private _videoElementId: string = uuidv4();\r\n\r\n loop = false;\r\n\r\n constructor(\r\n private eventbus: IEventbus,\r\n private config: IResolvedEngineConfiguration\r\n ) {\r\n this._addEventListeners();\r\n }\r\n\r\n _extractUrls(configuration: IResolvedEngineConfiguration) {\r\n const urls = configuration.timelines\r\n .filter((timeline) => timeline.type === 'mediaplayer')\r\n .map((timeline) => {\r\n return timeline.uri;\r\n });\r\n return urls;\r\n }\r\n\r\n init(): Promise<any> {\r\n const settings = this.config.timelineProviderSettings['mediaplayer'];\r\n if (!settings) {\r\n throw new Error(`No settings found for 'mediaplayer' timeline provider`);\r\n }\r\n const { selector } = settings;\r\n const urls = this._extractUrls(this.config);\r\n const jwp = (window as any).jwplayer;\r\n const p = $(`#${selector}`);\r\n if (!p.length) {\r\n throw new Error(`videoplayer selector '${selector}' not found`);\r\n }\r\n let w = p.innerWidth();\r\n let h = p.innerHeight();\r\n if (w === 0) {\r\n w = 100;\r\n }\r\n if (h === 0) {\r\n h = 300;\r\n }\r\n\r\n this._player = jwp(selector);\r\n this._player.setup({\r\n file: urls[0],\r\n image: settings.poster,\r\n height: h,\r\n width: w,\r\n controls: true,\r\n autostart: false,\r\n displaytitle: false,\r\n displaydescription: false,\r\n nextUpDisplay: false,\r\n abouttext: 'Eligius',\r\n aboutlink: 'http://www.google.com',\r\n stretching: 'fill',\r\n repeat: false,\r\n });\r\n this._playlist.length = 0;\r\n urls.forEach((url) => {\r\n const item = {\r\n file: url,\r\n title: url,\r\n image: settings.poster,\r\n };\r\n this._playlist.push(item);\r\n });\r\n const promise = new Promise((resolve) => {\r\n this._player.once('ready', () => {\r\n this._handlePlayerReady(resolve);\r\n });\r\n this._player.load(this._playlist);\r\n });\r\n return promise;\r\n }\r\n\r\n _handlePlayerReady(resolve: (value: any | PromiseLike<any>) => void) {\r\n this._player.once('firstFrame', () => {\r\n this._player.pause();\r\n this.eventbus.broadcast(TimelineEventNames.DURATION, [\r\n this.getDuration(),\r\n ]);\r\n resolve(this);\r\n });\r\n this._player.on(\r\n TimelineEventNames.TIME,\r\n this._loopHandler.bind(this, Math.floor)\r\n );\r\n this._player.on(TimelineEventNames.SEEKED, this._seekedHandler.bind(this));\r\n this._player.on(\r\n TimelineEventNames.COMPLETE,\r\n this._handlePlayerComplete.bind(this)\r\n );\r\n setTimeout(() => {\r\n this._player.play();\r\n }, 10);\r\n }\r\n\r\n _handlePlayerComplete() {\r\n if (!this.loop) {\r\n this.stop();\r\n this.eventbus.broadcast(TimelineEventNames.COMPLETE, [\r\n this._player.getPlaylistIndex(),\r\n ]);\r\n }\r\n }\r\n\r\n _seekedHandler() {\r\n this.eventbus.broadcast(TimelineEventNames.SEEKED, [\r\n this.getPosition(),\r\n this.getDuration(),\r\n ]);\r\n }\r\n\r\n destroy() {\r\n this._player.remove();\r\n this._eventbusListeners.forEach((func) => func());\r\n }\r\n\r\n _loopHandler(floor: (x: number) => number, jwplayerEvent: any) {\r\n const pos = floor(jwplayerEvent.position);\r\n if (this.loop && pos === floor(this._player.getDuration() - 1)) {\r\n this.seek(0);\r\n }\r\n }\r\n\r\n _timeResetLoopHandler() {\r\n if (this.loop) {\r\n this.seek(0);\r\n }\r\n }\r\n\r\n _addEventListeners() {\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.PLAY_TOGGLE_REQUEST,\r\n this.toggleplay.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.PLAY_REQUEST, this.start.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.STOP_REQUEST, this.stop.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.PAUSE_REQUEST, this.pause.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.SEEK_REQUEST, this.seek.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.RESIZE_REQUEST,\r\n this.resize.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.CONTAINER_REQUEST,\r\n this._container.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.DURATION_REQUEST,\r\n this.duration.bind(this)\r\n )\r\n );\r\n }\r\n\r\n _container(resultCallback: TResultCallback) {\r\n let suffix = '';\r\n if (this._player.getProvider().name !== 'html5') {\r\n suffix = '_wrapper';\r\n }\r\n const container = $(`#${this._videoElementId}${suffix}`);\r\n resultCallback(container);\r\n }\r\n\r\n toggleplay() {\r\n if (this._paused) {\r\n this.start();\r\n } else {\r\n this.pause();\r\n }\r\n }\r\n\r\n start() {\r\n this._paused = false;\r\n this._player.play();\r\n this.eventbus.broadcast(TimelineEventNames.PLAY);\r\n }\r\n\r\n stop() {\r\n this._paused = false;\r\n this._player.stop();\r\n this.eventbus.broadcast(TimelineEventNames.STOP);\r\n }\r\n\r\n pause() {\r\n this._paused = true;\r\n this._player.pause();\r\n this.eventbus.broadcast(TimelineEventNames.PAUSE);\r\n }\r\n\r\n seek(position: number) {\r\n const currentPosition = this._player.getPosition();\r\n this._player.seek(position);\r\n this.eventbus.broadcast(TimelineEventNames.SEEK, [\r\n position,\r\n currentPosition,\r\n this._player.getDuration(),\r\n ]);\r\n }\r\n\r\n resize(width: number, height: number) {\r\n this._player.resize(width, height);\r\n this.eventbus.broadcast(TimelineEventNames.RESIZE, [width, height]);\r\n }\r\n\r\n duration(resultCallback: TResultCallback) {\r\n resultCallback(Math.floor(this.getDuration()));\r\n }\r\n\r\n playlistItem(uri: string) {\r\n const index = this._playlist.findIndex((item) => item.file === uri);\r\n if (index > -1) {\r\n this._player.playlistItem(index);\r\n }\r\n }\r\n\r\n getPosition() {\r\n return this._player.getPosition();\r\n }\r\n\r\n getPlaylistIndex() {\r\n return this._player.getPlaylistIndex();\r\n }\r\n\r\n getState() {\r\n return this._player.getState();\r\n }\r\n\r\n getDuration() {\r\n return this._player.getDuration();\r\n }\r\n\r\n getMute() {\r\n return this._player.getMute();\r\n }\r\n\r\n getVolume() {\r\n return this._player.getVolume();\r\n }\r\n\r\n setMute(state: boolean) {\r\n this._player.setMute(state);\r\n }\r\n\r\n setVolume(volume: number) {\r\n this._player.setVolume(volume);\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport {\r\n IResolvedEngineConfiguration,\r\n IResolvedTimelineConfiguration,\r\n} from '../configuration/types';\r\nimport { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { TResultCallback } from '../types';\r\nimport { animationInterval } from '../util/animation-interval';\r\nimport { ITimelineProvider } from './types';\r\n\r\ntype TUpdateMethod = (now: number) => void;\r\ntype TPlayState = 'stopped' | 'running' | 'paused';\r\n\r\nexport class RequestAnimationFrameTimelineProvider\r\n implements ITimelineProvider\r\n{\r\n private _currentPosition: number = 0;\r\n private _updateBound: TUpdateMethod = this._update.bind(this);\r\n private _eventbusListeners: TEventbusRemover[] = [];\r\n private _firstFrame = true;\r\n private _currentPlaylistItem: IResolvedTimelineConfiguration;\r\n private _tickInterval = 1000;\r\n private _playlist: IResolvedTimelineConfiguration[];\r\n private _containerElement: JQuery<HTMLElement> | undefined;\r\n private _abortController: AbortController | undefined;\r\n public playState: TPlayState = 'stopped';\r\n\r\n loop: boolean = false;\r\n\r\n constructor(\r\n private eventbus: IEventbus,\r\n private config: IResolvedEngineConfiguration\r\n ) {\r\n this.eventbus = eventbus;\r\n this.config = config;\r\n this._playlist = this._extractPlaylist(config);\r\n this._currentPlaylistItem = this._playlist[0];\r\n }\r\n\r\n private _extractPlaylist(\r\n configuration: IResolvedEngineConfiguration\r\n ): IResolvedTimelineConfiguration[] {\r\n const playlist = configuration.timelines.filter(\r\n (timeline) => timeline.type === 'animation'\r\n );\r\n return playlist;\r\n }\r\n\r\n playlistItem(uri: string): void {\r\n if (uri === null || !uri.length || this._playlist.length === 0) {\r\n return;\r\n }\r\n\r\n const item = this._playlist.find((item) => {\r\n return item.uri === uri;\r\n });\r\n\r\n if (!item) {\r\n throw new Error(`Unknown playlist uri: ${uri}`);\r\n }\r\n\r\n this._currentPlaylistItem = item;\r\n this._firstFrame = true;\r\n }\r\n\r\n private _addEventListeners() {\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.PLAY_TOGGLE_REQUEST,\r\n this.toggleplay.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.PLAY_REQUEST, this.start.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.STOP_REQUEST, this.stop.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.PAUSE_REQUEST, this.pause.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.SEEK_REQUEST, this.seek.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.RESIZE_REQUEST,\r\n this._resize.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.CONTAINER_REQUEST,\r\n this._container.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.DURATION_REQUEST,\r\n this.requestDurationHandler.bind(this)\r\n )\r\n );\r\n }\r\n\r\n private _update(_now: number): void {\r\n if (this.playState !== 'running') {\r\n return;\r\n }\r\n\r\n if (this._firstFrame) {\r\n this._firstFrame = false;\r\n this.eventbus.broadcast(TimelineEventNames.FIRST_FRAME);\r\n }\r\n\r\n this._currentPosition++;\r\n\r\n if (this._currentPosition > this._currentPlaylistItem.duration) {\r\n if (this.loop) {\r\n this._resetToStartPosition();\r\n this.eventbus.broadcast(TimelineEventNames.RESTART);\r\n } else {\r\n this.stop();\r\n this.eventbus.broadcast(TimelineEventNames.COMPLETE);\r\n return;\r\n }\r\n }\r\n\r\n this.eventbus.broadcast(TimelineEventNames.TIME, [\r\n { position: this._currentPosition },\r\n ]);\r\n this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [\r\n {\r\n position: this._currentPosition,\r\n duration: this._currentPlaylistItem.duration,\r\n },\r\n ]);\r\n }\r\n\r\n private _start() {\r\n if (this.playState === 'running') {\r\n return;\r\n }\r\n\r\n this.playState = 'running';\r\n this._abortController?.abort();\r\n this._abortController = new AbortController();\r\n\r\n animationInterval(\r\n this._tickInterval,\r\n this._abortController.signal,\r\n this._updateBound\r\n );\r\n }\r\n\r\n private _resetToStartPosition() {\r\n this._currentPosition = 0;\r\n }\r\n\r\n private _resize() {\r\n console.error('Not implemented yet');\r\n }\r\n\r\n private _container(callBack: TResultCallback) {\r\n callBack(this._containerElement);\r\n }\r\n\r\n private _stopAnimationInterval(resetPosition: boolean = true) {\r\n this._abortController?.abort();\r\n this._abortController = undefined;\r\n\r\n if (resetPosition) {\r\n this._resetToStartPosition();\r\n }\r\n }\r\n\r\n init(): Promise<any> {\r\n this._addEventListeners();\r\n this._currentPlaylistItem = this._playlist[0];\r\n this._containerElement = $(this._currentPlaylistItem.selector);\r\n\r\n if (!this._containerElement.length) {\r\n throw new Error(\r\n `timeline selector '${this._currentPlaylistItem.selector}' not found`\r\n );\r\n }\r\n\r\n const promise = new Promise<void>((resolve) => {\r\n resolve();\r\n });\r\n\r\n return promise;\r\n }\r\n\r\n destroy() {\r\n this.stop();\r\n this._eventbusListeners.forEach((func) => func());\r\n this._containerElement = undefined;\r\n }\r\n\r\n toggleplay() {\r\n if (this.playState !== 'running') {\r\n this.start();\r\n } else {\r\n this.pause();\r\n }\r\n }\r\n\r\n start() {\r\n this._start();\r\n this.eventbus.broadcast(TimelineEventNames.PLAY);\r\n }\r\n\r\n stop() {\r\n this._stopAnimationInterval();\r\n this.playState = 'stopped';\r\n this.eventbus.broadcast(TimelineEventNames.STOP);\r\n }\r\n\r\n pause() {\r\n this._stopAnimationInterval(false);\r\n this.playState = 'paused';\r\n this.eventbus.broadcast(TimelineEventNames.PAUSE);\r\n }\r\n\r\n seek(position: number) {\r\n if (position < 0 || position > this._currentPlaylistItem.duration) {\r\n return;\r\n }\r\n\r\n this.eventbus.broadcast(TimelineEventNames.SEEK, [\r\n position,\r\n this._currentPosition,\r\n this.getDuration(),\r\n ]);\r\n\r\n this._currentPosition = position;\r\n\r\n this.eventbus.broadcast(TimelineEventNames.SEEKED, [\r\n this._currentPosition,\r\n this.getDuration(),\r\n ]);\r\n this.eventbus.broadcast(TimelineEventNames.TIME, [\r\n { position: this.getPosition() },\r\n ]);\r\n this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [\r\n {\r\n position: this._currentPosition,\r\n duration: this._currentPlaylistItem.duration,\r\n },\r\n ]);\r\n }\r\n\r\n getPosition() {\r\n return this._currentPosition;\r\n }\r\n\r\n getDuration() {\r\n return this._currentPlaylistItem.duration;\r\n }\r\n\r\n requestDurationHandler(callBack: TResultCallback) {\r\n callBack(this._currentPlaylistItem.duration);\r\n }\r\n}\r\n","// https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95\r\nexport function animationInterval(\r\n ms: number,\r\n signal: AbortSignal,\r\n callback: (time: number) => void\r\n) {\r\n // Prefer currentTime, as it'll better sync animations queued in the\r\n // same frame, but if it isn't supported, performance.now() is fine.\r\n const start = document?.timeline?.currentTime ?? performance.now();\r\n\r\n function frame(time: number) {\r\n if (signal.aborted) return;\r\n callback(time);\r\n scheduleFrame(time);\r\n }\r\n\r\n function scheduleFrame(time: number) {\r\n const elapsed = time - start;\r\n const roundedElapsed = Math.round(elapsed / ms) * ms;\r\n const targetNext = start + roundedElapsed + ms;\r\n const delay = targetNext - performance.now();\r\n setTimeout(() => requestAnimationFrame(frame), delay);\r\n }\r\n\r\n scheduleFrame(start);\r\n}\r\n","import * as ctrls from '../controllers';\r\nimport { EligiusEngine } from '../eligius-engine';\r\nimport * as evtb from '../eventbus';\r\nimport * as ops from '../operation';\r\nimport { TOperation } from '../operation/types';\r\nimport * as prvdrs from '../timelineproviders';\r\nimport { IResourceImporter } from '../types';\r\n\r\nconst operations: Record<string, TOperation<any>> = ops as any;\r\nconst controllers: Record<string, any> = ctrls;\r\nconst providers: Record<string, any> = prvdrs;\r\nconst eventbus: Record<string, any> = evtb;\r\n\r\nexport class EligiusResourceImporter implements IResourceImporter {\r\n engines = new Map();\r\n constructor() {\r\n this.engines.set('EligiusEngine', EligiusEngine);\r\n }\r\n\r\n getOperationNames(): string[] {\r\n return Object.keys(operations);\r\n }\r\n\r\n getControllerNames(): string[] {\r\n return Object.keys(controllers);\r\n }\r\n\r\n getProviderNames(): string[] {\r\n return Object.keys(providers);\r\n }\r\n\r\n import(name: string): Record<string, any> {\r\n const value =\r\n operations[name] ??\r\n controllers[name] ??\r\n providers[name] ??\r\n eventbus[name] ??\r\n this.engines.get(name);\r\n\r\n return { [name]: value };\r\n }\r\n}\r\n","import { IAddClassOperationData } from '../../operation/add-class';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction addClass(): IOperationMetadata<IAddClassOperationData> {\r\n return {\r\n description: 'Add a class to the selected element.',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n className: {\r\n type: 'ParameterType:className',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default addClass;\r\n","import { IAddControllerToElementOperationData } from '../../operation/add-controller-to-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction addControllerToElement(): IOperationMetadata<\r\n IAddControllerToElementOperationData\r\n> {\r\n return {\r\n description: 'Adds the current controller to the selected element(s)',\r\n dependentProperties: ['selectedElement', 'controllerInstance'],\r\n };\r\n}\r\nexport default addControllerToElement;\r\n","import { IAnimateOperationData } from '../../operation/animate';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction animate(): IOperationMetadata<IAnimateOperationData> {\r\n return {\r\n description:\r\n 'Animates the selected element with the given animation settings.',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n animationEasing: 'ParameterType:boolean',\r\n animationProperties: {\r\n type: 'ParameterType:object',\r\n required: true,\r\n },\r\n animationDuration: {\r\n type: 'ParameterType:integer',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default animate;\r\n","import { IAnimateWithClassOperationData } from '../../operation/animate-with-class';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction animateWithClass(): IOperationMetadata<\r\n IAnimateWithClassOperationData\r\n> {\r\n return {\r\n description:\r\n 'Animates the selected element by adding the given animation class.',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n className: {\r\n type: 'ParameterType:className',\r\n required: true,\r\n },\r\n removeClass: 'ParameterType:boolean',\r\n },\r\n };\r\n}\r\nexport default animateWithClass;\r\n","import { IBroadcastEventOperationData } from '../../operation/broadcast-event';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData> {\r\n return {\r\n description:\r\n 'Broadcasts an eventbus event with the given type, topic and optional arguments',\r\n properties: {\r\n eventArgs: 'ParameterType:array',\r\n eventTopic: 'ParameterType:eventTopic',\r\n eventName: {\r\n type: 'ParameterType:eventName',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default broadcastEvent;\r\n","import { ICalcOperationData } from '../calc';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction calc(): IOperationMetadata<ICalcOperationData> {\r\n return {\r\n description: 'clears the given element',\r\n properties: {\r\n left: {\r\n type: 'ParameterType:integer',\r\n description: 'The left operand',\r\n required: true,\r\n },\r\n right: {\r\n type: 'ParameterType:integer',\r\n description: 'The right operand',\r\n required: true,\r\n },\r\n operator: [\r\n {\r\n value: '+',\r\n description: 'Adds the left and right operands',\r\n },\r\n {\r\n value: '-',\r\n description: 'Subtracts the left and right operands',\r\n },\r\n {\r\n value: '*',\r\n description: 'Multiplies the left and right operands',\r\n },\r\n {\r\n value: '/',\r\n description: 'Divides the left and right operands',\r\n },\r\n {\r\n value: '%',\r\n description:\r\n 'Returns the remainder left over after the left number is divided into a number of integer portions equal to the right number',\r\n },\r\n {\r\n value: '**',\r\n description:\r\n 'Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times.',\r\n },\r\n ],\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'calculationResult',\r\n },\r\n },\r\n /*outputProperties: {\r\n propertyName: {\r\n type: 'ParameterType:integer',\r\n },\r\n },*/\r\n };\r\n}\r\n\r\nexport default calc;\r\n","import { IClearElementOperationData } from '../../operation/clear-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction clearElement(): IOperationMetadata<IClearElementOperationData> {\r\n return {\r\n description: 'clears the given element',\r\n dependentProperties: ['selectedElement'],\r\n };\r\n}\r\n\r\nexport default clearElement;\r\n","import { IClearOperationDataOperationData } from '../../operation/clear-operation-data';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction clearOperationData(): IOperationMetadata<\r\n IClearOperationDataOperationData\r\n> {\r\n return {\r\n description: 'clears the current operation data',\r\n properties: {\r\n properties: 'ParameterType:array',\r\n },\r\n };\r\n}\r\nexport default clearOperationData;\r\n","import { ICreateElementOperationData } from '../../operation/create-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction createElement(): IOperationMetadata<ICreateElementOperationData<any>> {\r\n return {\r\n description:\r\n 'Creates an HTML element with the given name and optionally adds the given attributes',\r\n properties: {\r\n elementName: {\r\n type: 'ParameterType:htmlElementName',\r\n required: true,\r\n },\r\n attributes: 'ParameterType:object',\r\n text: 'ParameterType:string',\r\n },\r\n outputProperties: {\r\n template: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default createElement;\r\n","import { ICustomFunctionOperationData } from '../../operation/custom-function';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction customFunction(): IOperationMetadata<ICustomFunctionOperationData> {\r\n return {\r\n description: 'Executes the specified custom function',\r\n properties: {\r\n systemName: {\r\n type: 'ParameterType:systemName',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default customFunction;\r\n","import { IEndActionOperationData } from '../../operation/end-action';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction endAction(): IOperationMetadata<IEndActionOperationData> {\r\n return {\r\n description: 'Ends the current action',\r\n dependentProperties: ['actionInstance'],\r\n properties: {\r\n actionOperationData: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default endAction;\r\n","import { IOperationMetadata } from './types';\r\n\r\nfunction endLoop(): IOperationMetadata<never> {\r\n return {\r\n description: 'Ends the current loop',\r\n };\r\n}\r\n\r\nexport default endLoop;\r\n","import { IExtendControllerOperationData } from '../../operation/extend-controller';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction extendController(): IOperationMetadata<\r\n IExtendControllerOperationData\r\n> {\r\n return {\r\n description: 'Extends the current controller',\r\n dependentProperties: ['controllerInstance'],\r\n properties: {\r\n controllerExtension: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default extendController;\r\n","import { IGetControllerFromElementOperationData } from '../../operation/get-controller-from-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction getControllerFromElement(): IOperationMetadata<\r\n IGetControllerFromElementOperationData\r\n> {\r\n return {\r\n description: 'Retrieves the specified controller from the current element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n controllerName: {\r\n type: 'ParameterType:controllerName',\r\n required: true,\r\n },\r\n },\r\n outputProperties: {\r\n controllerInstance: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default getControllerFromElement;\r\n","import { IGetControllerInstanceOperationData } from '../../operation/get-controller-instance';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction getControllerInstance(): IOperationMetadata<\r\n IGetControllerInstanceOperationData\r\n> {\r\n return {\r\n description: 'Retrieves an instance of the specified controller',\r\n properties: {\r\n systemName: {\r\n type: 'ParameterType:controllerName',\r\n required: true,\r\n },\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'controllerInstance',\r\n },\r\n },\r\n outputProperties: {\r\n controllerInstance: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default getControllerInstance;\r\n","import { IGetElementDimensionsOperationData } from '../../operation/get-element-dimensions';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction getElementDimensions(): IOperationMetadata<\r\n IGetElementDimensionsOperationData\r\n> {\r\n return {\r\n description: 'Calculates the dimensions for the current element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n modifier: 'ParameterType:dimensionsModifier',\r\n },\r\n outputProperties: {\r\n dimensions: 'ParameterType:dimensions',\r\n },\r\n };\r\n}\r\nexport default getElementDimensions;\r\n","import { IGetImportOperationData } from '../../operation/get-import';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction getImport(): IOperationMetadata<IGetImportOperationData> {\r\n return {\r\n description:\r\n 'Retrieves a javascript import specified by the given system name',\r\n properties: {\r\n systemName: {\r\n type: 'ParameterType:systemName',\r\n required: true,\r\n },\r\n },\r\n outputProperties: {\r\n importedInstance: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default getImport;\r\n","import { ILoadJSONOperationData } from '../../operation/load-json';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction loadJSON(): IOperationMetadata<ILoadJSONOperationData> {\r\n return {\r\n description: 'Load JSON from the given url',\r\n properties: {\r\n url: {\r\n type: 'ParameterType:url',\r\n required: true,\r\n },\r\n cache: 'ParameterType:boolean',\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'json',\r\n },\r\n },\r\n outputProperties: {\r\n json: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default loadJSON;\r\n","import { IOperationMetadata } from './types';\r\n\r\nfunction log(): IOperationMetadata<never> {\r\n return {\r\n description: 'Logs the current context and operation data to the console',\r\n };\r\n}\r\n\r\nexport default log;\r\n","import { IMathOperationData } from '../math';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction math(): IOperationMetadata<IMathOperationData> {\r\n return {\r\n description:\r\n 'This operation performs the given math function of the specified arguments.',\r\n properties: {\r\n args: {\r\n type: 'ParameterType:array',\r\n required: true,\r\n },\r\n functionName: createMathFunctionNames(),\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'mathResult',\r\n },\r\n },\r\n };\r\n}\r\n\r\nfunction createMathFunctionNames() {\r\n return Object.getOwnPropertyNames(Math)\r\n .filter((x) => typeof Math[x as keyof Math] === 'function')\r\n .map((functionName) => ({\r\n value: functionName,\r\n }));\r\n}\r\n\r\nexport default math;\r\n","import { IRemoveClassOperationData } from '../../operation/remove-class';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction removeClass(): IOperationMetadata<IRemoveClassOperationData> {\r\n return {\r\n description: 'Removes the specified class from the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n className: {\r\n type: 'ParameterType:className',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport default removeClass;\r\n","import { IRemoveControllerFromElementOperationData } from '../../operation/remove-controller-from-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction removeControllerFromElement(): IOperationMetadata<\r\n IRemoveControllerFromElementOperationData\r\n> {\r\n return {\r\n description: 'Removes the specified controller from the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n controllerName: {\r\n type: 'ParameterType:controllerName',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport default removeControllerFromElement;\r\n","import { IRemoveElementOperationData } from '../../operation/remove-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction removeElement(): IOperationMetadata<IRemoveElementOperationData> {\r\n return {\r\n description: 'Removes the selected element from the DOM',\r\n dependentProperties: ['selectedElement'],\r\n };\r\n}\r\nexport default removeElement;\r\n","import { IRemovePropertiesFromOperationDataOperationData } from '../../operation/remove-properties-from-operation-data';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction removePropertiesFromOperationData(): IOperationMetadata<\r\n IRemovePropertiesFromOperationDataOperationData\r\n> {\r\n return {\r\n description:\r\n 'Removes the specified properties from the current operation data',\r\n properties: {\r\n propertyNames: 'ParameterType:array',\r\n },\r\n };\r\n}\r\nexport default removePropertiesFromOperationData;\r\n","import { IReparentElementOperationData } from '../../operation/reparent-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction reparentElement(): IOperationMetadata<IReparentElementOperationData> {\r\n return {\r\n description:\r\n 'Moves the selected element to the new location described by the given selector',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n newParentSelector: {\r\n type: 'ParameterType:selector',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default reparentElement;\r\n","import { IRequestActionOperationData } from '../../operation/request-action';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction requestAction(): IOperationMetadata<IRequestActionOperationData> {\r\n return {\r\n description: 'Retrieves an instance of the specified action',\r\n properties: {\r\n systemName: {\r\n type: 'ParameterType:actionName',\r\n required: true,\r\n },\r\n },\r\n outputProperties: {\r\n actionInstance: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default requestAction;\r\n","import { IResizeActionOperationData } from '../../operation/resize-action';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction resizeAction(): IOperationMetadata<IResizeActionOperationData> {\r\n return {\r\n description: 'Triggers a resize on the current action',\r\n dependentProperties: ['actionInstance'],\r\n properties: {\r\n actionOperationData: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default resizeAction;\r\n","import { ISelectElementOperationData } from '../../operation/select-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction selectElement(): IOperationMetadata<ISelectElementOperationData> {\r\n return {\r\n description: 'Selects an element using the given selector',\r\n properties: {\r\n selector: {\r\n type: 'ParameterType:selector',\r\n required: true,\r\n },\r\n propertyName: 'ParameterType:string',\r\n useSelectedElementAsRoot: 'ParameterType:boolean',\r\n },\r\n outputProperties: {\r\n selectedElement: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default selectElement;\r\n","import { ISetElementAttributesOperationData } from '../../operation/set-element-attributes';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction setElementAttributes(): IOperationMetadata<\r\n ISetElementAttributesOperationData\r\n> {\r\n return {\r\n description: 'Sets the given attributes on the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n attributes: {\r\n type: 'ParameterType:object',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default setElementAttributes;\r\n","import { ISetElementContentOperationData } from '../../operation/set-element-content';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction setElementContent(): IOperationMetadata<\r\n ISetElementContentOperationData\r\n> {\r\n return {\r\n description: 'Sets the given HTML content in the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n insertionType: [\r\n {\r\n value: 'overwrite',\r\n description:\r\n 'the contents of the selected element are replaced by the given template',\r\n default: true,\r\n },\r\n {\r\n value: 'append',\r\n description:\r\n 'the new content will be inserted after the current content',\r\n },\r\n {\r\n value: 'prepend',\r\n description:\r\n 'the new content will be inserted before the current content',\r\n },\r\n ],\r\n template: {\r\n type: 'ParameterType:htmlContent',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default setElementContent;\r\n","import { ISetOperationData } from '../../operation/set-operation-data';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction setOperationData(): IOperationMetadata<ISetOperationData> {\r\n return {\r\n description: 'Sets the given properties on the current operation data',\r\n properties: {\r\n properties: {\r\n type: 'ParameterType:object',\r\n required: true,\r\n },\r\n override: 'ParameterType:boolean',\r\n },\r\n };\r\n}\r\nexport default setOperationData;\r\n","import { ISetStyleOperationData } from '../../operation/set-style';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction setStyle(): IOperationMetadata<ISetStyleOperationData> {\r\n return {\r\n description: 'Sets the given style properties on the selected element',\r\n properties: {\r\n properties: {\r\n type: 'ParameterType:object',\r\n required: true,\r\n },\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n required: false,\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport default setStyle;\r\n","import { IStartActionOperationData } from '../../operation/start-action';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction startAction(): IOperationMetadata<IStartActionOperationData> {\r\n return {\r\n description: 'Starts the selected action',\r\n dependentProperties: ['actionInstance'],\r\n properties: {\r\n actionOperationData: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default startAction;\r\n","import { TStartLoopOperationData } from '../../operation/start-loop';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction startLoop(): IOperationMetadata<TStartLoopOperationData> {\r\n return {\r\n description: 'Starts a loop over the given collection',\r\n properties: {\r\n collection: {\r\n type: 'ParameterType:array',\r\n required: true,\r\n },\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'currentItem',\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport default startLoop;\r\n","import { IToggleClassOperationData } from '../../operation/toggle-class';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction toggleClass(): IOperationMetadata<IToggleClassOperationData> {\r\n return {\r\n description: 'Toggles the given class on the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n className: {\r\n type: 'ParameterType:className',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default toggleClass;\r\n","import { IToggleElementOperationData } from '../../operation/toggle-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction toggleElement(): IOperationMetadata<IToggleElementOperationData> {\r\n return {\r\n description: 'Toggles the selected element',\r\n dependentProperties: ['selectedElement'],\r\n };\r\n}\r\nexport default toggleElement;\r\n","import { IWaitOperationData } from '../../operation/wait';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction wait(): IOperationMetadata<IWaitOperationData> {\r\n return {\r\n description:\r\n 'Waits the given amount of milliseconds before the action continues',\r\n properties: {\r\n milliseconds: {\r\n type: 'ParameterType:integer',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default wait;\r\n","export type TDevToolsEventSubscriber = (event: TEventData) => void;\r\n\r\nexport type TPlayControlEventKind = 'play' | 'stop' | 'pause' | 'seek';\r\nexport const DEV_TOOLS_KEY = '__ELIGIUS_DEV_TOOLS__';\r\n\r\nexport type TWindowWithDevtools = Window & {\r\n [DEV_TOOLS_KEY]: IDiagnosticsInfo | undefined;\r\n};\r\n\r\nexport type TDevToolsMessage = {\r\n source: 'eligius-inspect-devtools';\r\n name: 'event';\r\n data: TEventData;\r\n};\r\n\r\nexport type TEventData = {\r\n type: 'playcontrol';\r\n data: IPlayControlEvent;\r\n};\r\n\r\nexport interface IPlayControlEvent {\r\n kind: TPlayControlEventKind;\r\n args?: any[];\r\n}\r\n\r\nexport interface IDiagnosticsAgent {\r\n postMessage(name: TDiagnosticType, messageData: any): void;\r\n subscribe(subscriber: TDevToolsEventSubscriber): () => void;\r\n}\r\n\r\nexport interface IDiagnosticsInfo {\r\n get agent(): IDiagnosticsAgent;\r\n}\r\n\r\nexport type TDiagnosticType =\r\n | 'eligius-diagnostics-factory'\r\n | 'eligius-diagnostics-engine'\r\n | 'eligius-diagnostics-event'\r\n | 'eligius-diagnostics-action'\r\n | 'eligius-diagnostics-action-error'\r\n | 'eligius-diagnostics-operation';\r\n\r\nexport type TDiagnosticsMessageSource =\r\n | 'eligius-inspect-agent'\r\n | 'eligius-inspect-devtools';\r\n","export default function dashToCamelCase(input: string) {\r\n return input.replace(/-([a-z])/g, g => g[1].toUpperCase());\r\n}\r\n"],"names":["prepareValueForSerialization","value","Array","isArray","map","jQuery","Object","fromEntries","entries","funcString","toString","indexOf","substring","DevToolEventListener","agent","this","handleEvent","eventName","eventTopic","args","message","postMessage","e","console","error","log","Diagnostics","send","_name","_data","active","copyFunction","structuredClone","original","JSON","parse","stringify","deepCopy","isDefined","Action","name","startOperations","eventbus","id","_proto","start","initOperationData","context","currentIndex","result","Promise","resolve","reject","_this","executeOperation","then","operationsResult","operations","idx","previousOperationData","obj","undefined","newIndex","skipNextOperation","length","operationInfo","copy","operationData","mergedOperationData","assign","systemName","operationResult","instance","call","promisedOperationResult","_this2","EndableAction","endOperations","eventBus","_inheritsLoose","end","TimelineAction","duration","_gatherControllerImportPathsFromActions","actionsConfig","operationConfigs","flatMap","x","filter","operationConfig","_operationConfig$oper","hasOwnProperty","endsWith","_gatherOperationImportPathsFromActions","dedupe","importPaths","lookup","imp","getNestedValue","properties","sourceObject","Error","currentInstance","suffix","forEach","prop","index","parts","split","ConfigurationResolver","importer","process","configuration","actionRegistryListener","resolvePlaceholders","timelineProviderSettings","resolvedConfig","engine","containerSelector","language","layoutTemplate","availableLanguages","actions","resolveActions","initActions","labels","timelineFlow","timelines","resolveTimelines","eventActions","eventActionConfigurations","config","resolveActionConfiguration","eventAction","registerAction","resolveEventActions","concat","reduce","aggr","action","resolveTimelineAction","bind","timelineActions","resolveOperation","resolveEndableActionConfiguration","actionConfiguration","actionConfigurations","configFragment","rootConfig","item","keys","key","configValue","startsWith","configProperty","templateKey","template","jsonKey","json","resolvePlaceholder","TimelineEventNames","PLAY_TOGGLE_REQUEST","PLAY_REQUEST","STOP_REQUEST","PAUSE_REQUEST","SEEK_REQUEST","RESIZE_REQUEST","CONTAINER_REQUEST","DURATION_REQUEST","REQUEST_CURRENT_TIMELINE","DURATION","TIME","SEEKED","COMPLETE","RESTART","PLAY","STOP","PAUSE","SEEK","RESIZE","POSITION_UPDATE","TIME_UPDATE","CURRENT_TIMELINE_CHANGE","FIRST_FRAME","REQUEST_INSTANCE","REQUEST_ACTION","REQUEST_FUNCTION","REQUEST_TIMELINE_URI","BEFORE_REQUEST_TIMELINE_URI","REQUEST_ENGINE_ROOT","REQUEST_CURRENT_TIMELINE_POSITION","REQUEST_TIMELINE_CLEANUP","EXECUTE_TIMELINEACTION","RESIZE_TIMELINEACTION","REQUEST_LABEL_COLLECTION","REQUEST_LABEL_COLLECTIONS","REQUEST_CURRENT_LANGUAGE","LANGUAGE_CHANGE","EventListenerController","actionInstanceInfos","init","selectedElement","slice","actionOperationData","attach","actionName","isStart","_isStartAction","broadcast","actionInstance","push","on","_eventHandler","substr","event","target","targetValue","_executeAction","_context","actionInfo","method","detach","_eventbus","off","LabelController","listeners","currentLanguage","labelData","labelId","labelCollection","createTextDataLookup","setLabel","handleLanguageChange","html","func","code","data","d","languageCode","label","LottieController","animationItem","serializedData","serializedIEData","freezePosition","endPosition","renderer","loop","autoplay","animationData","labelIds","viewBox","iefallback","url","parseFilename","setting","values","resultHolder","labelCollections","createAnimation","addEventListener","destroy","playSegments","serialized","isIE","join","lottie","loadAnimation","container","rendererSettings","timeCompleted","find","attr","infos","_this3","window","document","NavigationController","navigation","navLookup","navVidIdLookup","ctrlLookup","activeNavigationPoint","labelControllers","eventhandlers","buildNavigationData","handleNavigateVideoUrl","highlightMenu","handleRequestCurrentNavigation","handleVideoComplete","buildHtml","initHistory","navId","getQueryVariable","videoIndex","videoUrlIndex","variableIdx","href","location","hashIndex","query","resultCallback","labelCtrl","navigationData","title","handler","ctrl","onpopstate","pushCurrentState","position","state","parentElm","ul","$","addNavElement","append","visible","li","a","addLabel","addClickHandler","children","mouseup","menuMouseupHandler","navdata","requestedVideoPosition","navElm","removeClass","addClass","navData","autoNext","next","nav","previous","nextId","roots","childId","ProgressbarController","textElement","detachers","positionUpdateHandler","clickHandler","_this$selectedElement2","percentage","css","text","Math","floor","RoutingController","handleBeforeRequestVideoUrl","handlePushHistoryState","handlePopstate","pos","history","pushState","navigationId","_event$state","_index","_requestedVideoPosition","isHistoryRequest","currentPosition","currentState","replaceState","SubtitlesController","actionLookup","lastFunc","detachTime","onTimeHandler","detachSeek","onSeekedHandler","detachLangChange","languageChangeHandler","internalDetach","detachMethods","f","newLanguage","removeTitle","empty","arg","setTitle","titleLanguageLookup","createActionLookup","subtitleData","titles","subtitleTimeLookup","i","ii","j","jj","subs","lang","EligiusEngine","timelineProviders","languageManager","_timeLineActionsLookup","_eventbusRemovers","_currentTimelineUri","_activeTimelineProvider","_lastPosition","_createLayoutTemplate","_addInitialisationListeners","uri","_createTimelineLookup","_initializeTimelineProvider","warn","_this$configuration$t","firstTimeline","providerSettings","type","provider","_executeActions","_cleanUp","_context2","_cleanUpTimeline","_context3","remover","providerInfo","_addEventListener","eventHandler","_handleRequestEngineRoot","_handleRequestTimelineUri","_handleRequestTimelinePosition","_handleTimelineComplete","_handleExecuteTimelineAction","_resizeTimelineAction","_requestCurrentTimeline","_onTimeHandler","_onSeekHandler","timelineInfo","_addTimelineAction","timeLineAction","startPosition","timelineStartPositions","_initializeTimelinePosition","_initializeUriLookup","startMethod","_timeLineAction$id","Infinity","isFinite","timelineEndPositions","endMethod","_timeLineAction$id2","methodName","_context4","engineRootSelector","previousVideoPosition","_context5","stop","timelineConfig","timeline","newProviderSettings","once","pause","getDuration","_executeStartActions","seek","offset","playlistItem","_executeRelevantActions","_getActiveActions","_getActionsForPosition","allActions","sort","b","executionType","_getRelevantTimelineActions","currentActions","apply","getPosition","_getTimelineActionsForUri","info","isNaN","_executeActionsForPosition","_this$_activeTimeline3","_this$_activeTimeline4","_executeSeekActions","executions","exec","newActions","promise","_this5","ActionRegistryEventbusListener","_actionRegistry","Map","has","set","get","eventArgs","Eventbus","eventHandlers","eventInterceptors","eventListeners","clear","_getEventInterceptors","_getEventHandlers","eventHandlerDecorator","handlers","splice","_callHandlers","broadcastForTopic","registerEventlistener","eventbusListener","registerInterceptor","interceptor","interceptors","intercept","listener","_args","RequestVideoUriInterceptor","LanguageManager","_currentLanguage","_labelLookup","_setRootElementLang","_createLabelLookup","_addEventbusListeners","_handleRequestLabelCollection","_handleRequestLabelCollections","_handleRequestCurrentLanguage","_handleLanguageChange","rootSelector","_extractLanguageFromCulture","culture","shift","acc","EngineFactory","windowRef","options","_actionsLookup","_eventRemovers","_importer","_resizeTimeout","devtools","_initializeDevtools","_requestInstanceHandler","_requestActionHandler","_requestFunctionHandler","handleSpaceBound","_handleSpacePress","hotkeys","unbind","resizeBound","_resizeHandler","jqWin","keyboardEvent","_hotkeysEvent","preventDefault","diagnosticInfo","subscribe","kind","messageData","DEV_TOOLS_KEY","clearTimeout","setTimeout","_importSystemEntryWithEventbusDependency","_importSystemEntry","createEngine","resolver","EngineClass","_configuration$eventA","resolvedConfiguration","_createTimelineProviders","timelineType","settings","timelineProviderClass","vendor","className","getElementControllers","element","mergeOperationData","newOperationData","internalResolve","addControllerToElement","controllerInstance","controller","controllers","attachControllerToElement","animate","animationEasing","animationProperties","animationDuration","animateWithClass","one","extractOperationDataArgumentValues","argumentValue","toLowerCase","propNames","broadcastEvent","eventArguments","extract","resolveEventArguments","removeEventDataFromOperationData","cache","resolvePropertyValues","resolveProperties","arr","calcFunctions","left","right","calc","propertyName","operator","clearElement","clearOperationData","createElement","elementName","attributes","serializedAttrs","customFunction","endAction","endLoop","loopIndex","loopLength","startIndex","extendController","controllerExtension","getControllerFromElement","controllerName","getControllerInstance","getElementDimensions","modifier","dimensions","width","innerWidth","height","innerHeight","clonedDimensions","ratioModifier","prefix","isPercent","_getModifierSuffix","parseInt","widthModifier","heightModifier","modifiedDimension","_modifyDimensions","modifiedDimensions","ratio","ratios","Boolean","_modifyDimensionsByRatio","modifyDimensions","getImport","importedInstance","jsonCache","loadJSON","fetch","response","cacheValue","group","dir","groupEnd","math","functionName","removeControllerFromElement","removeElement","remove","removePropertiesFromOperationData","propertyNames","reparentElement","newParentSelector","appendTo","requestAction","resizeAction","resize","findElementBySelector","root","selector","selectElement","useSelectedElementAsRoot","setElementAttributes","setElementContent","insertionType","prepend","setOperationData","override","resolvedProperties","setStyle","startAction","startLoop","collection","toggleClass","toggleElement","toggle","wait","milliseconds","JwPlayerTimelineProvider","_paused","_player","_currentLoopHandler","_eventbusListeners","_playlist","_videoElementId","uuidv4","_addEventListeners","_extractUrls","urls","jwp","jwplayer","p","w","h","setup","file","image","poster","controls","autostart","displaytitle","displaydescription","nextUpDisplay","abouttext","aboutlink","stretching","repeat","_handlePlayerReady","load","_loopHandler","_seekedHandler","_handlePlayerComplete","play","getPlaylistIndex","jwplayerEvent","_timeResetLoopHandler","toggleplay","_container","getProvider","findIndex","getState","getMute","getVolume","setMute","setVolume","volume","RequestAnimationFrameTimelineProvider","_currentPosition","_updateBound","_update","_firstFrame","_currentPlaylistItem","_tickInterval","_containerElement","_abortController","playState","_extractPlaylist","_resize","requestDurationHandler","_now","_resetToStartPosition","_start","abort","AbortController","ms","signal","callback","_document","_document$timeline","currentTime","performance","now","frame","time","aborted","scheduleFrame","roundedElapsed","round","delay","requestAnimationFrame","animationInterval","callBack","_stopAnimationInterval","resetPosition","ops","ctrls","providers","evtb","EligiusResourceImporter","engines","getOperationNames","getControllerNames","getProviderNames","description","dependentProperties","required","defaultValue","outputProperties","getOwnPropertyNames","default","configPath","assetInfo","_gatherOperations","extension","fs","readdirSync","path","subdir","basename","replace","g","toUpperCase","defaultImport","_gatherControllers","_gatherProviders","_gatherEngines","_gatherImportPaths","importerSourceCode","_generateSourceCode"],"mappings":"63OAEgBA,EAA6BC,GAC3C,GAAIC,MAAMC,QAAQF,GAChB,OAAQA,EAAqBG,IAAIJ,GAC5B,GAAIC,aAAiBI,UAC1B,MAAO,gBACF,GAAqB,iBAAVJ,EAChB,OAAOK,OAAOC,YACZD,OAAOE,QAAQP,GAAOG,KAAI,YAAA,MAA2B,MAEnDJ,aAGC,GAAqB,mBAAVC,EAAsB,CACtC,IAAMQ,EAAqBR,EAAMS,WAEjC,OADm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D,MAAA,iBAAoBA,EAAI3B,gCAAqB2B,EAAIwrB,QAAQ,oBAwBjE,OArBAxuB,EAAOiK,2DACPjK,EAAOiK,KAAK,IAEZjK,EAAOiK,KAAK,0CACZjK,EAAOiK,WAAPjK,EACK8C,EAAY3F,KACb,SAAC6F,GAAD,OAAYA,EAAI3B,mBAAkB2B,EAAI3B,iBAAgB2B,EAAI3B,qBAG9DrB,EAAOiK,KAAK,MACZjK,EAAOiK,KAAK,IACZjK,EAAOiK,KACL,sEAEFjK,EAAOiK,KAAK,+CACZjK,EAAOiK,KAAK,+DACZjK,EAAOiK,KAAK,+CACZjK,EAAOiK,KAAK,MACZjK,EAAOiK,KAAK,IACZjK,EAAOiK,KAAK,2CAELjK,EAAOwN,KAAK,MArCQ4hB,CAAoBtsB,GAE/C,OAAOqsB"}
1
+ {"version":3,"file":"eligius.cjs.production.min.js","sources":["../src/util/prepare-value-for-serialization.ts","../src/diagnostics/devtool-event-lister.ts","../src/diagnostics/diagnostics.ts","../src/operation/helper/deep-copy.ts","../src/action/action.ts","../src/action/is-promise.ts","../src/action/endable-action.ts","../src/action/timeline-action.ts","../src/build/generate-importer-source-code.ts","../src/operation/helper/get-nested-value.ts","../src/configuration/configuration-resolver.ts","../src/operation/helper/get-nested-property-value.ts","../src/timeline-event-names.ts","../src/controllers/event-listener-controller.ts","../src/controllers/label-controller.ts","../src/controllers/lottie-controller.ts","../src/controllers/navigation-controller.ts","../src/controllers/progressbar-controller.ts","../src/controllers/routing-controller.ts","../src/controllers/subtitles-controller.ts","../src/eligius-engine.ts","../src/eventbus/actionregistry-eventbus-listener.ts","../src/eventbus/eventbus.ts","../src/eventbus/request-video-uri-interceptor.ts","../src/language-manager.ts","../src/engine-factory.ts","../src/operation/add-class.ts","../src/operation/helper/get-element-data.ts","../src/operation/helper/merge-operation-data.ts","../src/operation/helper/internal-resolve.ts","../src/operation/add-controller-to-element.ts","../src/operation/helper/attach-controller-to-element.ts","../src/operation/animate.ts","../src/operation/animate-with-class.ts","../src/operation/helper/extract-operation-data-argument-values.ts","../src/operation/broadcast-event.ts","../src/operation/helper/resolve-event-arguments.ts","../src/operation/helper/remove-event-data-from-operation-data.ts","../src/operation/helper/resolve-property-values.ts","../src/operation/calc.ts","../src/operation/clear-element.ts","../src/operation/clear-operation-data.ts","../src/operation/create-element.ts","../src/operation/custom-function.ts","../src/operation/end-action.ts","../src/operation/end-loop.ts","../src/operation/extend-controller.ts","../src/operation/get-controller-from-element.ts","../src/operation/get-controller-instance.ts","../src/operation/get-element-dimensions.ts","../src/operation/helper/modify-dimensions.ts","../src/operation/get-import.ts","../src/operation/load-json.ts","../src/operation/log.ts","../src/operation/math.ts","../src/operation/remove-class.ts","../src/operation/remove-controller-from-element.ts","../src/operation/remove-element.ts","../src/operation/remove-properties-from-operation-data.ts","../src/operation/reparent-element.ts","../src/operation/request-action.ts","../src/operation/resize-action.ts","../src/operation/select-element.ts","../src/operation/set-element-attributes.ts","../src/operation/set-element-content.ts","../src/operation/set-operation-data.ts","../src/operation/set-style.ts","../src/operation/start-action.ts","../src/operation/start-loop.ts","../src/operation/toggle-class.ts","../src/operation/toggle-element.ts","../src/operation/wait.ts","../src/timelineproviders/jwplayer-timeline-provider.ts","../src/timelineproviders/request-animation-frame-timeline-provider.ts","../src/util/animation-interval.ts","../src/importer/eligius-resource-importer.ts","../src/operation/metadata/add-class.ts","../src/operation/metadata/add-controller-to-element.ts","../src/operation/metadata/animate.ts","../src/operation/metadata/animate-with-class.ts","../src/operation/metadata/broadcast-event.ts","../src/operation/metadata/calc.ts","../src/operation/metadata/clear-element.ts","../src/operation/metadata/clear-operation-data.ts","../src/operation/metadata/create-element.ts","../src/operation/metadata/custom-function.ts","../src/operation/metadata/end-action.ts","../src/operation/metadata/end-loop.ts","../src/operation/metadata/extend-controller.ts","../src/operation/metadata/get-controller-from-element.ts","../src/operation/metadata/get-controller-instance.ts","../src/operation/metadata/get-element-dimensions.ts","../src/operation/metadata/get-import.ts","../src/operation/metadata/load-json.ts","../src/operation/metadata/log.ts","../src/operation/metadata/math.ts","../src/operation/metadata/remove-class.ts","../src/operation/metadata/remove-controller-from-element.ts","../src/operation/metadata/remove-element.ts","../src/operation/metadata/remove-properties-from-operation-data.ts","../src/operation/metadata/reparent-element.ts","../src/operation/metadata/request-action.ts","../src/operation/metadata/resize-action.ts","../src/operation/metadata/select-element.ts","../src/operation/metadata/set-element-attributes.ts","../src/operation/metadata/set-element-content.ts","../src/operation/metadata/set-operation-data.ts","../src/operation/metadata/set-style.ts","../src/operation/metadata/start-action.ts","../src/operation/metadata/start-loop.ts","../src/operation/metadata/toggle-class.ts","../src/operation/metadata/toggle-element.ts","../src/operation/metadata/wait.ts","../src/diagnostics/types.ts","../src/util/dash-to-camel-case.ts"],"sourcesContent":["import jQuery from 'jquery';\r\n\r\nexport function prepareValueForSerialization(value: any): any {\r\n if (Array.isArray(value)) {\r\n return (value as Array<any>).map(prepareValueForSerialization);\r\n } else if (value instanceof jQuery) {\r\n return 'jQuery object';\r\n } else if (value !== null && typeof value === 'object') {\r\n return Object.fromEntries(\r\n Object.entries(value).map(([propName, propValue]) => [\r\n propName,\r\n prepareValueForSerialization(propValue),\r\n ])\r\n );\r\n } else if (typeof value === 'function') {\r\n const funcString: string = value.toString();\r\n const paranIndex = funcString.indexOf('{');\r\n if (paranIndex > -1) {\r\n return funcString.substring(0, funcString.indexOf('{') + 1);\r\n }\r\n return funcString;\r\n }\r\n return value;\r\n}\r\n","import { IEventbusListener } from '../eventbus';\r\nimport { prepareValueForSerialization } from '../util/prepare-value-for-serialization';\r\nimport { IDiagnosticsAgent } from './types';\r\n\r\nexport class DevToolEventListener implements IEventbusListener {\r\n constructor(private agent: IDiagnosticsAgent) {}\r\n\r\n handleEvent(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any[]\r\n ): void {\r\n const message = {\r\n eventName,\r\n eventTopic,\r\n args: prepareValueForSerialization(args),\r\n };\r\n try {\r\n this.agent.postMessage('eligius-diagnostics-event', message);\r\n } catch (e) {\r\n console.error('postmessage failed');\r\n console.error(e);\r\n console.log('message', message);\r\n }\r\n }\r\n}\r\n","import { TDiagnosticType } from './types';\r\n\r\nexport class Diagnostics {\r\n static send(_name: TDiagnosticType, _data: any): void {\r\n console.log(_name, _data);\r\n }\r\n static active: boolean;\r\n}\r\n","import { isDefined } from 'ts-is-present';\r\n\r\nconst copyFunction =\r\n typeof structuredClone !== 'undefined'\r\n ? structuredClone\r\n : (original: any) => JSON.parse(JSON.stringify(original));\r\n\r\nexport function deepCopy<T>(original: T): T {\r\n if (isDefined(original)) {\r\n return copyFunction(original) as T;\r\n }\r\n return original;\r\n}\r\n","import { IResolvedOperation } from '../configuration/types';\r\nimport { Diagnostics } from '../diagnostics';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { deepCopy } from '../operation/helper/deep-copy';\r\nimport {\r\n IOperationContext,\r\n TOperationData,\r\n TOperationResult,\r\n} from '../operation/types';\r\nimport { isPromise } from './is-promise';\r\nimport { IAction } from './types';\r\n\r\nexport class Action implements IAction {\r\n public id = '';\r\n\r\n constructor(\r\n public name: string,\r\n public startOperations: IResolvedOperation[],\r\n protected eventbus: IEventbus\r\n ) {}\r\n\r\n start(initOperationData?: TOperationData): Promise<TOperationData> {\r\n Diagnostics.active &&\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} begins executing start operations`\r\n );\r\n\r\n const context: IOperationContext = {\r\n currentIndex: -1,\r\n eventbus: this.eventbus,\r\n };\r\n\r\n const result = new Promise<TOperationData>((resolve, reject) => {\r\n this.executeOperation(\r\n this.startOperations,\r\n 0,\r\n resolve,\r\n reject,\r\n initOperationData,\r\n context\r\n );\r\n }).catch((e) => {\r\n Diagnostics.active &&\r\n Diagnostics.send('eligius-diagnostics-action-error', {\r\n name,\r\n error: e,\r\n });\r\n console.error(`Error in action start '${this.name}'`);\r\n console.error(e);\r\n throw e;\r\n });\r\n return !Diagnostics.active\r\n ? result\r\n : result.then((operationsResult) => {\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} finished executing start operations`\r\n );\r\n return operationsResult;\r\n });\r\n }\r\n\r\n executeOperation(\r\n operations: IResolvedOperation[],\r\n idx: number,\r\n resolve: (value?: any | PromiseLike<any>) => void,\r\n reject: (reason?: any) => void,\r\n previousOperationData: TOperationData | undefined = {},\r\n context: IOperationContext\r\n ): void {\r\n if (context.newIndex !== undefined) {\r\n idx = context.newIndex;\r\n delete context.newIndex;\r\n }\r\n\r\n context.currentIndex = idx;\r\n\r\n if (context.skipNextOperation) {\r\n if (idx < operations.length) {\r\n this.executeOperation(\r\n operations,\r\n ++idx,\r\n resolve,\r\n reject,\r\n previousOperationData,\r\n context\r\n );\r\n } else {\r\n resolve(previousOperationData);\r\n }\r\n }\r\n\r\n if (idx < operations.length) {\r\n const operationInfo = operations[idx];\r\n\r\n const copy = operationInfo.operationData\r\n ? deepCopy(operationInfo.operationData)\r\n : {};\r\n const mergedOperationData = Object.assign(previousOperationData, copy);\r\n\r\n Diagnostics.active &&\r\n Diagnostics.send('eligius-diagnostics-operation', {\r\n systemName: operationInfo.systemName,\r\n operationData: mergedOperationData,\r\n context: {\r\n ...context,\r\n eventbus: undefined,\r\n },\r\n });\r\n\r\n const operationResult: TOperationResult = operationInfo.instance.call(\r\n context,\r\n mergedOperationData\r\n );\r\n\r\n if (isPromise(operationResult)) {\r\n operationResult\r\n .then((promisedOperationResult: TOperationData) => {\r\n this.executeOperation(\r\n operations,\r\n ++idx,\r\n resolve,\r\n reject,\r\n promisedOperationResult,\r\n context\r\n );\r\n })\r\n .catch((error: any) => {\r\n reject(error);\r\n });\r\n } else {\r\n this.executeOperation(\r\n operations,\r\n ++idx,\r\n resolve,\r\n reject,\r\n operationResult,\r\n context\r\n );\r\n }\r\n } else {\r\n resolve(previousOperationData);\r\n }\r\n }\r\n}\r\n","export function isPromise(obj: any): obj is Promise<unknown> {\r\n return typeof obj === 'object' && typeof obj.then === 'function';\r\n}\r\n","import { IResolvedOperation } from '../configuration/types';\r\nimport { Diagnostics } from '../diagnostics';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { IOperationContext, TOperationData } from '../operation/types';\r\nimport { Action } from './action';\r\n\r\nexport class EndableAction extends Action {\r\n constructor(\r\n name: string,\r\n startOperations: IResolvedOperation[],\r\n public endOperations: IResolvedOperation[],\r\n eventBus: IEventbus\r\n ) {\r\n super(name, startOperations, eventBus);\r\n }\r\n\r\n end(initOperationData?: TOperationData): Promise<TOperationData | undefined> {\r\n Diagnostics.active &&\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} begins executing end operations`\r\n );\r\n\r\n if (!this.endOperations.length) {\r\n return Promise.resolve(initOperationData);\r\n }\r\n\r\n const context: IOperationContext = {\r\n currentIndex: -1,\r\n eventbus: this.eventbus,\r\n };\r\n\r\n const result = new Promise<TOperationData>((resolve, reject) => {\r\n this.executeOperation(\r\n this.endOperations,\r\n 0,\r\n resolve,\r\n reject,\r\n initOperationData,\r\n context\r\n );\r\n }).catch((e) => {\r\n console.error(`Error in action end '${this.name}'`);\r\n throw e;\r\n });\r\n\r\n return !Diagnostics.active\r\n ? result\r\n : result.then((operationsResult) => {\r\n Diagnostics.send(\r\n 'eligius-diagnostics-action',\r\n `${this.name ?? 'Action'} finished executing start operations`\r\n );\r\n return operationsResult;\r\n });\r\n }\r\n}\r\n","import { IResolvedOperation } from '../configuration/types';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { IStrictDuration } from '../types';\r\nimport { EndableAction } from './endable-action';\r\n\r\nexport class TimelineAction extends EndableAction {\r\n public active = false;\r\n\r\n constructor(\r\n name: string,\r\n startOperations: IResolvedOperation[],\r\n endOperations: IResolvedOperation[],\r\n public duration: IStrictDuration,\r\n eventBus: IEventbus\r\n ) {\r\n super(name, startOperations, endOperations, eventBus);\r\n }\r\n\r\n start(initOperationData: TOperationData): Promise<TOperationData> {\r\n if (!this.active || this.duration.end < 0) {\r\n this.active = this.duration.end > -1;\r\n return super.start(initOperationData);\r\n }\r\n\r\n return new Promise<void>((resolve) => {\r\n resolve();\r\n });\r\n }\r\n\r\n end(initOperationData: TOperationData): Promise<TOperationData> {\r\n this.active = false;\r\n return super.end(initOperationData);\r\n }\r\n}\r\n","import fs from 'fs';\r\nimport path from 'path';\r\nimport {\r\n IActionConfiguration,\r\n IEndableActionConfiguration,\r\n IEngineConfiguration,\r\n IOperationConfiguration,\r\n} from '../configuration/types';\r\nimport dashToCamelCase from '../util/dash-to-camel-case';\r\n\r\ninterface ImportInfo {\r\n systemName: string;\r\n path?: string;\r\n defaultImport?: boolean;\r\n}\r\n\r\nexport interface IAssetInfo {\r\n path: string;\r\n extension: string;\r\n}\r\n\r\n/**\r\n * This function takes an Eligius engine configuration, a root path for the config and an arbitrary list of asset info.\r\n * The asset info determines a number of subdirectories in the root path that contain the different assets used by the presentation.\r\n * I.e. html, json, etc.\r\n *\r\n * @param config\r\n * @param configPath\r\n * @param assetInfo\r\n */\r\nexport function generateImporterSourceCode(\r\n config: IEngineConfiguration,\r\n configPath: string,\r\n assetInfo: IAssetInfo[]\r\n) {\r\n const importPaths = _gatherImportPaths(config, configPath, assetInfo);\r\n\r\n const importerSourceCode = _generateSourceCode(importPaths);\r\n\r\n return importerSourceCode;\r\n}\r\n\r\nfunction _generateSourceCode(importPaths: ImportInfo[]) {\r\n const result = importPaths\r\n .filter((x) => x.defaultImport)\r\n .map((imp) => `import ${imp.systemName} from '${imp.path}';`)\r\n .concat(\r\n importPaths\r\n .filter((x) => !x.defaultImport)\r\n .map(\r\n (imp) => `import {${imp.systemName}} from '${imp.path ?? 'eligius'}';`\r\n )\r\n );\r\n result.push(`import { ISimpleResourceImporter } from 'eligius';`);\r\n result.push('');\r\n\r\n result.push('const imports: Record<string, any> = {');\r\n result.push(\r\n ...importPaths.map(\r\n (imp) => `${imp.systemName}: { '${imp.systemName}': ${imp.systemName} },`\r\n )\r\n );\r\n result.push('};');\r\n result.push('');\r\n result.push(\r\n 'class EligiusResourceImporter implements ISimpleResourceImporter {'\r\n );\r\n result.push('import(name: string): Record<string, any> {');\r\n result.push('if (imports.hasOwnProperty(name)) { return imports[name]; }');\r\n result.push('throw Error(`Unknown systemName: ${name}`);');\r\n result.push('}}');\r\n result.push('');\r\n result.push('export default EligiusResourceImporter;');\r\n\r\n return result.join('\\n');\r\n}\r\n\r\nfunction _gatherImportPaths(\r\n config: IEngineConfiguration,\r\n configPath: string,\r\n assetInfo: IAssetInfo[]\r\n): ImportInfo[] {\r\n return [\r\n ..._gatherOperations(config),\r\n ...assetInfo.flatMap((info) =>\r\n _gatherAssets(configPath, info.path, info.extension)\r\n ),\r\n ..._gatherControllers(config),\r\n ..._gatherProviders(config),\r\n ..._gatherEngines(config),\r\n ];\r\n}\r\n\r\nfunction _gatherAssets(assetPath: string, subdir: string, extension: string) {\r\n const entries = fs.readdirSync(path.join(assetPath, subdir));\r\n return entries.map((file) => {\r\n const importName = `${dashToCamelCase(path.basename(file, extension))}`;\r\n return {\r\n systemName: importName,\r\n path: `./${subdir}/${file}`,\r\n defaultImport: true,\r\n };\r\n });\r\n}\r\n\r\nfunction _gatherControllers(config: IEngineConfiguration) {\r\n let importPaths = [] as [] as ImportInfo[];\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(config.initActions)\r\n );\r\n importPaths.push(..._gatherControllerImportPathsFromActions(config.actions));\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(\r\n config.timelines.flatMap((x) => x.timelineActions)\r\n )\r\n );\r\n importPaths.push(\r\n ..._gatherControllerImportPathsFromActions(config.eventActions)\r\n );\r\n importPaths = dedupe(importPaths);\r\n return importPaths;\r\n}\r\n\r\nfunction _gatherProviders(config: any) {\r\n if (config.timelineProviderSettings) {\r\n return Object.values(config.timelineProviderSettings).map<ImportInfo>(\r\n (settings: any) => {\r\n return {\r\n systemName: settings.systemName,\r\n };\r\n }\r\n );\r\n }\r\n return [] as ImportInfo[];\r\n}\r\n\r\nfunction _gatherEngines(config: any) {\r\n if (config.engine) {\r\n const { systemName } = config.engine;\r\n return [\r\n {\r\n systemName,\r\n },\r\n ];\r\n }\r\n return [];\r\n}\r\n\r\nfunction _gatherOperations(config: IEngineConfiguration): ImportInfo[] {\r\n let importPaths = _gatherOperationImportPathsFromActions(\r\n config.initActions\r\n .concat(config.actions)\r\n .concat(config.eventActions ?? ([] as any[]))\r\n );\r\n\r\n if (config.timelines) {\r\n const timelineActions = config.timelines.flatMap((x) => x.timelineActions);\r\n\r\n importPaths = importPaths.concat(\r\n _gatherOperationImportPathsFromActions(timelineActions)\r\n );\r\n }\r\n\r\n return dedupe(importPaths);\r\n}\r\n\r\nfunction _gatherControllerImportPathsFromActions(\r\n actionsConfig?: IActionConfiguration[] | IEndableActionConfiguration[]\r\n): ImportInfo[] {\r\n if (!actionsConfig) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n const operations = actionsConfig.flatMap((x) => [\r\n ...x.startOperations,\r\n ...((x as any).endOperations ?? []),\r\n ]);\r\n\r\n return _gatherControllerImportPaths(operations);\r\n}\r\n\r\nfunction _gatherOperationImportPathsFromActions(\r\n actionsConfig?: IActionConfiguration[] | IEndableActionConfiguration[]\r\n): ImportInfo[] {\r\n if (!actionsConfig) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n const operations = actionsConfig.flatMap((x) => [\r\n ...x.startOperations,\r\n ...((x as any).endOperations ?? []),\r\n ]);\r\n\r\n return _gatherOperationImportPaths(operations);\r\n}\r\n\r\nfunction _gatherControllerImportPaths(\r\n operationConfigs: IOperationConfiguration[]\r\n): ImportInfo[] {\r\n if (!operationConfigs) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n return operationConfigs\r\n .filter((operationConfig) => {\r\n if (operationConfig.operationData?.hasOwnProperty('systemName')) {\r\n return operationConfig.operationData.systemName.endsWith('Controller');\r\n }\r\n return false;\r\n })\r\n .map((operationConfig) => {\r\n const { systemName } = operationConfig.operationData;\r\n return {\r\n systemName,\r\n };\r\n });\r\n}\r\n\r\nfunction _gatherOperationImportPaths(operationConfigs: any[]): ImportInfo[] {\r\n if (!operationConfigs) {\r\n return [] as ImportInfo[];\r\n }\r\n\r\n return operationConfigs.map((operationConfig) => {\r\n const { systemName } = operationConfig;\r\n return {\r\n systemName,\r\n };\r\n });\r\n}\r\n\r\nfunction dedupe(importPaths: ImportInfo[]): ImportInfo[] {\r\n const lookup: Record<string, true> = {};\r\n return importPaths.filter((imp) => {\r\n if (lookup[imp.systemName]) {\r\n return false;\r\n }\r\n lookup[imp.systemName] = true;\r\n return true;\r\n });\r\n}\r\n","export function getNestedValue(properties: any, sourceObject: any) {\r\n if (!properties) {\r\n throw Error('properties arg cannot be null');\r\n }\r\n\r\n if (!sourceObject) {\r\n throw Error('sourceObject arg cannot be null');\r\n }\r\n\r\n let currentInstance = sourceObject;\r\n let suffix = null;\r\n\r\n properties.forEach((prop: string, index: number) => {\r\n if (index === properties.length - 1) {\r\n const parts = prop.split('+');\r\n if (parts.length > 1) {\r\n prop = parts[0];\r\n suffix = parts[1];\r\n }\r\n }\r\n currentInstance = currentInstance[prop];\r\n });\r\n\r\n return suffix ? currentInstance + suffix : currentInstance;\r\n}\r\n","import { isDefined } from 'ts-is-present';\r\nimport { Action, EndableAction, TimelineAction } from '../action';\r\nimport { IAction } from '../action/types';\r\nimport { ActionRegistryEventbusListener } from '../eventbus';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { deepCopy } from '../operation/helper/deep-copy';\r\nimport { getNestedPropertyValue } from '../operation/helper/get-nested-property-value';\r\nimport { IConfigurationResolver, ISimpleResourceImporter } from '../types';\r\nimport {\r\n IActionConfiguration,\r\n IEndableActionConfiguration,\r\n IEngineConfiguration,\r\n IEventActionConfiguration,\r\n IOperationConfiguration,\r\n IResolvedEngineConfiguration,\r\n IResolvedOperation,\r\n IResolvedTimelineConfiguration,\r\n ITimelineActionConfiguration,\r\n ITimelineConfiguration,\r\n} from './types';\r\n\r\nexport class ConfigurationResolver implements IConfigurationResolver {\r\n constructor(\r\n private importer: ISimpleResourceImporter,\r\n private eventbus: IEventbus\r\n ) {}\r\n\r\n process(\r\n configuration: IEngineConfiguration,\r\n actionRegistryListener?: ActionRegistryEventbusListener\r\n ): [Record<string, IAction>, IResolvedEngineConfiguration] {\r\n resolvePlaceholders(configuration, configuration, this.importer);\r\n\r\n if (!isDefined(configuration.timelineProviderSettings)) {\r\n throw new Error(\r\n 'Configuration incomplete: it needs to have at least one timeline provider setting'\r\n );\r\n }\r\n\r\n const resolvedConfig: IResolvedEngineConfiguration = {\r\n id: configuration.id,\r\n engine: { ...configuration.engine },\r\n timelineProviderSettings: deepCopy(\r\n configuration.timelineProviderSettings\r\n ),\r\n containerSelector: configuration.containerSelector,\r\n language: configuration.language,\r\n layoutTemplate: configuration.layoutTemplate,\r\n availableLanguages: deepCopy(configuration.availableLanguages),\r\n actions: resolveActions(\r\n configuration.actions,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n initActions: resolveActions(\r\n configuration.initActions,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n labels: deepCopy(configuration.labels),\r\n timelineFlow: deepCopy(configuration.timelineFlow),\r\n timelines: resolveTimelines(\r\n configuration.timelines,\r\n this.importer,\r\n this.eventbus\r\n ),\r\n };\r\n\r\n let eventActions: IAction[] = [];\r\n if (configuration.eventActions && actionRegistryListener) {\r\n eventActions = resolveEventActions(\r\n configuration.eventActions,\r\n actionRegistryListener,\r\n this.importer,\r\n this.eventbus\r\n );\r\n }\r\n\r\n const actionsLookup = (resolvedConfig.actions as IAction[])\r\n .concat(eventActions)\r\n .reduce<Record<string, IAction>>(\r\n (aggr, action) => ({\r\n ...aggr,\r\n [action.name]: action,\r\n }),\r\n {}\r\n );\r\n\r\n return [actionsLookup, resolvedConfig];\r\n }\r\n}\r\n\r\nfunction resolveEventActions(\r\n eventActionConfigurations: IEventActionConfiguration[],\r\n actionRegistryListener: ActionRegistryEventbusListener,\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolvedConfigs =\r\n eventActionConfigurations.map<IResolvedActionConfiguration>((config) => {\r\n return resolveActionConfiguration(config, importer);\r\n });\r\n\r\n return resolvedConfigs.map((config, index) => {\r\n const { eventName, eventTopic } = eventActionConfigurations[index];\r\n const eventAction = new Action(\r\n config.name,\r\n config.startOperations,\r\n eventbus\r\n );\r\n actionRegistryListener.registerAction(eventAction, eventName, eventTopic);\r\n return eventAction;\r\n });\r\n}\r\n\r\nfunction resolveTimelines(\r\n timelines: ITimelineConfiguration[],\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolve = resolveTimelineAction.bind(null, importer, eventbus);\r\n\r\n return timelines.map<IResolvedTimelineConfiguration>((config) => ({\r\n ...config,\r\n timelineActions: config.timelineActions.map(resolve),\r\n }));\r\n}\r\n\r\nfunction resolveOperation(\r\n importer: ISimpleResourceImporter,\r\n operationConfig: IOperationConfiguration\r\n): IResolvedOperation {\r\n return {\r\n id: operationConfig.id,\r\n systemName: operationConfig.systemName,\r\n operationData: deepCopy(operationConfig.operationData),\r\n instance: importer.import(operationConfig.systemName)[\r\n operationConfig.systemName\r\n ],\r\n };\r\n}\r\n\r\nfunction resolveActionConfiguration(\r\n config: IActionConfiguration,\r\n importer: ISimpleResourceImporter\r\n): IResolvedActionConfiguration {\r\n const resolve = resolveOperation.bind(null, importer);\r\n\r\n return {\r\n id: config.id,\r\n name: config.name,\r\n startOperations: config.startOperations.map(resolve),\r\n };\r\n}\r\n\r\nfunction resolveEndableActionConfiguration(\r\n config: IEndableActionConfiguration,\r\n importer: ISimpleResourceImporter\r\n): IResolvedEndableActionConfiguration {\r\n const resolve = resolveOperation.bind(null, importer);\r\n\r\n const action = resolveActionConfiguration(config, importer);\r\n\r\n return {\r\n ...action,\r\n endOperations: config.endOperations.map(resolve),\r\n };\r\n}\r\n\r\nfunction resolveTimelineAction(\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus,\r\n actionConfiguration: ITimelineActionConfiguration\r\n) {\r\n const resolvedConfig = resolveEndableActionConfiguration(\r\n actionConfiguration,\r\n importer\r\n );\r\n const duration = {\r\n end: actionConfiguration.duration.end ?? -1,\r\n start: actionConfiguration.duration.start,\r\n };\r\n\r\n const { id, name, endOperations, startOperations } = resolvedConfig;\r\n const action = new TimelineAction(\r\n name,\r\n startOperations,\r\n endOperations,\r\n duration,\r\n eventbus\r\n );\r\n action.id = id;\r\n return action;\r\n}\r\n\r\nfunction resolveActions(\r\n actionConfigurations: IEndableActionConfiguration[],\r\n importer: ISimpleResourceImporter,\r\n eventbus: IEventbus\r\n) {\r\n const resolvedConfigs =\r\n actionConfigurations.map<IResolvedEndableActionConfiguration>((config) => {\r\n return resolveEndableActionConfiguration(config, importer);\r\n });\r\n\r\n return resolvedConfigs.map<EndableAction>((resolvedConfig) => {\r\n const { name, endOperations, startOperations } = resolvedConfig;\r\n const action = new EndableAction(\r\n name,\r\n startOperations,\r\n endOperations,\r\n eventbus\r\n );\r\n action.id = resolvedConfig.id;\r\n return action;\r\n });\r\n}\r\n\r\nfunction resolvePlaceholders(\r\n configFragment: Record<string, any> | any[],\r\n rootConfig: any,\r\n importer: ISimpleResourceImporter\r\n) {\r\n if (!isDefined(configFragment)) {\r\n return;\r\n }\r\n\r\n if (Array.isArray(configFragment)) {\r\n configFragment.forEach((item) => {\r\n resolvePlaceholders(item, rootConfig, importer);\r\n });\r\n } else {\r\n Object.keys(configFragment).forEach((key) => {\r\n resolvePlaceholder(key, configFragment, rootConfig, importer);\r\n });\r\n }\r\n}\r\n\r\nfunction resolvePlaceholder(\r\n key: string,\r\n configFragment: any,\r\n rootConfig: any,\r\n importer: ISimpleResourceImporter\r\n) {\r\n const configValue = configFragment[key];\r\n if (typeof configValue === 'string') {\r\n if (configValue.startsWith('config:')) {\r\n const configProperty = configValue.substring(7, configValue.length);\r\n configFragment[key] = getNestedPropertyValue(configProperty, rootConfig);\r\n } else if (configValue.startsWith('template:')) {\r\n const templateKey = configValue.substring(9, configValue.length);\r\n const template = importer.import(templateKey)[templateKey];\r\n configFragment[key] = template;\r\n } else if (configValue.startsWith('json:')) {\r\n const jsonKey = configValue.substring(5, configValue.length);\r\n const json = importer.import(jsonKey)[jsonKey];\r\n configFragment[key] = json;\r\n }\r\n } else if (typeof configValue === 'object') {\r\n resolvePlaceholders(configValue, rootConfig, importer);\r\n }\r\n}\r\n\r\ninterface IResolvedActionConfiguration {\r\n id: string;\r\n name: string;\r\n startOperations: IResolvedOperation[];\r\n}\r\n\r\ninterface IResolvedEndableActionConfiguration\r\n extends IResolvedActionConfiguration {\r\n endOperations: IResolvedOperation[];\r\n}\r\n\r\ninterface IResolvedEventActionConfiguration\r\n extends IResolvedActionConfiguration {\r\n eventName: string;\r\n eventTopic?: string;\r\n}\r\n","import { getNestedValue } from './get-nested-value';\r\n\r\nexport function getNestedPropertyValue(\r\n propertyChain: string,\r\n sourceObject: any\r\n) {\r\n const properties = propertyChain.split('.');\r\n return getNestedValue(properties, sourceObject);\r\n}\r\n","export class TimelineEventNames {\r\n // timeline requests\r\n static PLAY_TOGGLE_REQUEST = 'timeline-play-toggle-request';\r\n static PLAY_REQUEST = 'timeline-play-request';\r\n static STOP_REQUEST = 'timeline-stop-request';\r\n static PAUSE_REQUEST = 'timeline-pause-request';\r\n static SEEK_REQUEST = 'timeline-seek-request';\r\n static RESIZE_REQUEST = 'timeline-resize-request';\r\n static CONTAINER_REQUEST = 'timeline-container-request';\r\n static DURATION_REQUEST = 'timeline-duration-request';\r\n static REQUEST_CURRENT_TIMELINE = 'timeline-request-current-timeline';\r\n\r\n // timeline announcements\r\n static DURATION = 'timeline-duration';\r\n static TIME = 'timeline-time';\r\n static SEEKED = 'timeline-seeked';\r\n static COMPLETE = 'timeline-complete';\r\n static RESTART = 'timeline-restart';\r\n static PLAY = 'timeline-play';\r\n static STOP = 'timeline-stop';\r\n static PAUSE = 'timeline-pause';\r\n static SEEK = 'timeline-seek';\r\n static RESIZE = 'timeline-resize';\r\n static POSITION_UPDATE = 'timeline-position-update';\r\n static TIME_UPDATE = 'timeline-time-update';\r\n static CURRENT_TIMELINE_CHANGE = 'timeline-current-timeline-change';\r\n static FIRST_FRAME = 'timeline-firstframe';\r\n\r\n // factory and engine events\r\n static REQUEST_INSTANCE = 'request-instance';\r\n static REQUEST_ACTION = 'request-action';\r\n static REQUEST_FUNCTION = 'request-function';\r\n static REQUEST_TIMELINE_URI = 'request-timeline-uri';\r\n static BEFORE_REQUEST_TIMELINE_URI = 'before-request-timeline-uri';\r\n static REQUEST_ENGINE_ROOT = 'request-engine-root';\r\n static REQUEST_CURRENT_TIMELINE_POSITION =\r\n 'request-current-timeline-position';\r\n static REQUEST_TIMELINE_CLEANUP = 'request-timeline-cleanup';\r\n static EXECUTE_TIMELINEACTION = 'execute-timelineaction';\r\n static RESIZE_TIMELINEACTION = 'resize-timelineaction';\r\n\r\n //language manager events\r\n static REQUEST_LABEL_COLLECTION = 'request-label-collection';\r\n static REQUEST_LABEL_COLLECTIONS = 'request-label-collections';\r\n static REQUEST_CURRENT_LANGUAGE = 'request-current-language';\r\n static LANGUAGE_CHANGE = 'language-change';\r\n}\r\n","import { IEndableAction } from '../action/types';\r\nimport { IEventbus } from '../eventbus/types';\r\nimport { deepCopy } from '../operation/helper/deep-copy';\r\nimport { TOperationData } from '../operation/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { IController } from './types';\r\n\r\ninterface IActionInstanceInfo {\r\n start: boolean;\r\n action: IEndableAction;\r\n}\r\n\r\nexport interface IEventListenerControllerOperationData {\r\n selectedElement: JQuery;\r\n eventName: string;\r\n actions: string[];\r\n actionOperationData?: TOperationData;\r\n}\r\n\r\nexport class EventListenerController implements IController<IEventListenerControllerOperationData> {\r\n operationData?: IEventListenerControllerOperationData;\r\n actionInstanceInfos?: IActionInstanceInfo[];\r\n name = 'EventListenerController';\r\n\r\n constructor() {}\r\n\r\n init(operationData: IEventListenerControllerOperationData) {\r\n this.operationData = {\r\n selectedElement: operationData.selectedElement,\r\n eventName: operationData.eventName,\r\n actions: operationData.actions.slice(),\r\n actionOperationData: operationData.actionOperationData ? deepCopy(operationData.actionOperationData) : undefined,\r\n };\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n const { selectedElement, actions, eventName } = this.operationData;\r\n if (!this.actionInstanceInfos) {\r\n this.actionInstanceInfos = [];\r\n\r\n const resultCallback = (isStart: boolean) => (actionInstance: IEndableAction) => {\r\n this.actionInstanceInfos?.push({ start: isStart, action: actionInstance });\r\n };\r\n\r\n actions.forEach((actionName: string) => {\r\n const [isStart, name] = this._isStartAction(actionName);\r\n eventbus.broadcast(TimelineEventNames.REQUEST_ACTION, [name, resultCallback(isStart)]);\r\n });\r\n\r\n selectedElement.on(eventName, this._eventHandler.bind(this));\r\n }\r\n }\r\n\r\n _isStartAction(actionName: string): [boolean, string] {\r\n const prefix = actionName.substr(0, 'end:'.length);\r\n if (prefix === 'end:') {\r\n return [false, actionName.substr('end:'.length)];\r\n } else {\r\n return [true, actionName];\r\n }\r\n }\r\n\r\n _eventHandler(event: any) {\r\n if (!this.operationData || !this.actionInstanceInfos) {\r\n return;\r\n }\r\n\r\n const actionOperationData = this.operationData.actionOperationData\r\n ? deepCopy(this.operationData.actionOperationData)\r\n : {};\r\n\r\n if (event.target) {\r\n actionOperationData.targetValue = event.target.value;\r\n }\r\n\r\n this._executeAction(this.actionInstanceInfos, actionOperationData, 0);\r\n }\r\n\r\n async _executeAction(actions: IActionInstanceInfo[], operationData: TOperationData, idx: number) {\r\n if (idx < actions.length) {\r\n const actionInfo = actions[idx];\r\n const { action } = actionInfo;\r\n const method = actionInfo.start ? action.start.bind(action) : action.end.bind(action);\r\n const resultOperationData = await method(operationData);\r\n this._executeAction(actions, Object.assign(operationData, resultOperationData), ++idx);\r\n }\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.operationData?.selectedElement.off(this.operationData.eventName);\r\n }\r\n}\r\n","import { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { ILabel } from '../types';\r\nimport { IController } from './types';\r\n\r\nexport interface ILabelControllerMetadata {\r\n selectedElement: JQuery;\r\n labelId: string;\r\n}\r\n\r\nexport class LabelController implements IController<ILabelControllerMetadata> {\r\n listeners: TEventbusRemover[] = [];\r\n currentLanguage: string | null = null;\r\n operationData: ILabelControllerMetadata | null = null;\r\n labelData: Record<string, string> = {};\r\n name = 'LabelController';\r\n\r\n init(operationData: ILabelControllerMetadata) {\r\n this.operationData = Object.assign({}, operationData);\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n eventbus.broadcast(TimelineEventNames.REQUEST_CURRENT_LANGUAGE, [\r\n (language: string) => {\r\n this.currentLanguage = language;\r\n },\r\n ]);\r\n\r\n eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [\r\n this.operationData.labelId,\r\n (labelCollection: ILabel[]) => {\r\n this.createTextDataLookup(labelCollection);\r\n },\r\n ]);\r\n\r\n this.setLabel();\r\n this.listeners.push(\r\n eventbus.on(\r\n TimelineEventNames.LANGUAGE_CHANGE,\r\n this.handleLanguageChange.bind(this)\r\n )\r\n );\r\n }\r\n\r\n setLabel() {\r\n if (this.currentLanguage) {\r\n this.operationData?.selectedElement.html(\r\n this.labelData[this.currentLanguage]\r\n );\r\n }\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.listeners.forEach((func) => {\r\n func();\r\n });\r\n }\r\n\r\n handleLanguageChange(code: string) {\r\n this.currentLanguage = code;\r\n this.setLabel();\r\n }\r\n\r\n createTextDataLookup(data: ILabel[]) {\r\n data.forEach((d) => {\r\n this.labelData[d.languageCode] = d.label;\r\n });\r\n }\r\n}\r\n","import lottie, {\r\n AnimationConfigWithData,\r\n AnimationItem,\r\n CanvasRendererConfig,\r\n HTMLRendererConfig,\r\n SVGRendererConfig,\r\n} from 'lottie-web';\r\nimport { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { IController } from './types';\r\n\r\nexport interface IInnerMetadata {\r\n selectedElement: JQuery;\r\n renderer: SVGRendererConfig | CanvasRendererConfig | HTMLRendererConfig;\r\n loop: boolean;\r\n autoplay: boolean;\r\n animationData: any;\r\n json: any;\r\n labelIds: string[];\r\n viewBox: string;\r\n iefallback: any;\r\n}\r\n\r\nexport interface ILottieControllerMetadata extends IInnerMetadata {\r\n url: string;\r\n}\r\n\r\nexport class LottieController\r\n implements IController<ILottieControllerMetadata>\r\n{\r\n name = 'LottieController';\r\n currentLanguage: string | null = null;\r\n labelData: Record<string, Record<string, string>> = {};\r\n listeners: TEventbusRemover[] = [];\r\n animationItem: AnimationItem | null = null;\r\n operationData: IInnerMetadata | null = null;\r\n serializedData: string | null = null;\r\n serializedIEData: string | null = null;\r\n freezePosition = -1;\r\n endPosition = -1;\r\n\r\n constructor() {}\r\n\r\n init(operationData: ILottieControllerMetadata) {\r\n this.operationData = {\r\n selectedElement: operationData.selectedElement,\r\n renderer: operationData.renderer,\r\n loop: operationData.loop,\r\n autoplay: operationData.autoplay,\r\n animationData: operationData.animationData,\r\n json: operationData.json,\r\n labelIds: operationData.labelIds,\r\n viewBox: operationData.viewBox,\r\n iefallback: operationData.iefallback,\r\n };\r\n\r\n if (operationData.url.indexOf('[') > -1) {\r\n this.parseFilename(operationData.url);\r\n }\r\n\r\n this.serializedData = this.operationData.json\r\n ? JSON.stringify(this.operationData.json)\r\n : JSON.stringify(this.operationData.animationData);\r\n\r\n if (this.operationData.iefallback) {\r\n this.serializedIEData = JSON.stringify(this.operationData.iefallback);\r\n }\r\n }\r\n\r\n parseFilename(name: string) {\r\n const params = name.substr(\r\n name.indexOf('[') + 1,\r\n name.indexOf(']') - name.indexOf('[') - 1\r\n );\r\n\r\n const settings = params.split(',');\r\n\r\n settings.forEach((setting) => {\r\n const values = setting.split('=');\r\n if (values[0] === 'freeze') {\r\n this.freezePosition = +values[1];\r\n } else if (values[0] === 'end') {\r\n this.endPosition = +values[1];\r\n }\r\n });\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.operationData) {\r\n return;\r\n }\r\n\r\n const { labelIds } = this.operationData;\r\n if (labelIds && labelIds.length) {\r\n const resultHolder: {\r\n language: string;\r\n labelCollections: any[];\r\n } = {} as any;\r\n\r\n eventbus.broadcast(TimelineEventNames.REQUEST_CURRENT_LANGUAGE, [\r\n resultHolder,\r\n ]);\r\n this.currentLanguage = resultHolder.language;\r\n this.listeners.push(\r\n eventbus.on(\r\n TimelineEventNames.LANGUAGE_CHANGE,\r\n this.handleLanguageChange.bind(this)\r\n )\r\n );\r\n eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTIONS, [\r\n this.operationData.labelIds,\r\n resultHolder,\r\n ]);\r\n this.createTextDataLookup(resultHolder.labelCollections);\r\n }\r\n this.createAnimation();\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.listeners.forEach((func) => {\r\n func();\r\n });\r\n\r\n if (this.animationItem) {\r\n if (this.endPosition > -1) {\r\n this.animationItem.addEventListener(\r\n 'complete',\r\n this.destroy.bind(this)\r\n );\r\n this.animationItem.playSegments(\r\n [this.freezePosition, this.endPosition],\r\n true\r\n );\r\n } else {\r\n this.animationItem.destroy();\r\n }\r\n }\r\n }\r\n\r\n destroy() {\r\n if (this.animationItem) {\r\n this.animationItem.destroy();\r\n this.animationItem = null;\r\n }\r\n }\r\n\r\n createAnimation() {\r\n if (!this.operationData || !this.serializedData) {\r\n return;\r\n }\r\n\r\n this.animationItem?.destroy();\r\n let serialized =\r\n this.isIE() && this.serializedIEData\r\n ? this.serializedIEData\r\n : this.serializedData;\r\n\r\n const { labelIds } = this.operationData;\r\n if (labelIds && labelIds.length) {\r\n labelIds.forEach((id) => {\r\n serialized = serialized\r\n .split(`!!${id}!!`)\r\n .join(this.labelData[id][this.currentLanguage ?? '']);\r\n });\r\n }\r\n const animationData = JSON.parse(serialized);\r\n\r\n const animationSettings: AnimationConfigWithData<'svg'> = {\r\n autoplay: this.operationData.autoplay,\r\n container: this.operationData.selectedElement[0],\r\n loop: this.operationData.loop,\r\n rendererSettings: this.operationData.renderer,\r\n animationData,\r\n };\r\n\r\n this.animationItem = lottie.loadAnimation(animationSettings);\r\n if (this.endPosition < 0) {\r\n this.endPosition = this.animationItem.timeCompleted;\r\n }\r\n\r\n if (this.freezePosition > -1) {\r\n this.animationItem.playSegments([0, this.freezePosition], true);\r\n }\r\n if (this.operationData.viewBox) {\r\n this.operationData.selectedElement\r\n .find('svg')\r\n .attr('viewBox', this.operationData.viewBox);\r\n }\r\n }\r\n\r\n createTextDataLookup(data: any[]) {\r\n data.forEach((infos, index) => {\r\n infos.forEach((d: any) => {\r\n if (this.operationData) {\r\n this.labelData[this.operationData.labelIds[index]][d.code] = d.label;\r\n }\r\n });\r\n });\r\n }\r\n\r\n handleLanguageChange(code: string) {\r\n this.currentLanguage = code;\r\n this.createAnimation();\r\n }\r\n\r\n isIE() {\r\n const isIE = false || !!(window.document as any)['documentMode'];\r\n\r\n // Edge 20+\r\n const isEdge = !isIE && !!(window as any)['StyleMedia'];\r\n\r\n return isEdge || isIE;\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { TResultCallback } from '../types';\r\nimport { LabelController } from './label-controller';\r\nimport { IController } from './types';\r\n\r\nexport interface INavigationControllerOperationData {\r\n selectedElement: JQuery;\r\n json: any;\r\n}\r\n\r\nexport class NavigationController\r\n implements IController<INavigationControllerOperationData>\r\n{\r\n name: string = 'NavigationController';\r\n navigation: any[] = [];\r\n navLookup: Record<string, any> = {};\r\n navVidIdLookup: Record<string, any> = {};\r\n ctrlLookup: Record<string, LabelController> = {};\r\n activeNavigationPoint: any | null = null;\r\n labelControllers: LabelController[] = [];\r\n eventhandlers: TEventbusRemover[] = [];\r\n eventbus: IEventbus | null = null;\r\n container: JQuery | null = null;\r\n\r\n constructor() {}\r\n\r\n init(operationData: TOperationData) {\r\n this.container = operationData.selectedElement;\r\n this.navigation = this.buildNavigationData(operationData.json);\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n if (!this.container) {\r\n return;\r\n }\r\n\r\n this.eventbus = eventbus;\r\n\r\n this.eventhandlers.push(\r\n eventbus.on(\r\n 'navigate-to-video-url',\r\n this.handleNavigateVideoUrl.bind(this)\r\n )\r\n );\r\n this.eventhandlers.push(\r\n eventbus.on('highlight-navigation', this.highlightMenu.bind(this))\r\n );\r\n this.eventhandlers.push(\r\n eventbus.on(\r\n 'request-current-navigation',\r\n this.handleRequestCurrentNavigation.bind(this)\r\n )\r\n );\r\n this.eventhandlers.push(\r\n eventbus.on('video-complete', this.handleVideoComplete.bind(this))\r\n );\r\n\r\n this.buildHtml(this.container, this.navigation);\r\n this.initHistory.bind(this);\r\n }\r\n\r\n initHistory() {\r\n this.activeNavigationPoint = this.navVidIdLookup[0];\r\n const navId = this.getQueryVariable(0);\r\n let videoIndex = 0;\r\n if (navId) {\r\n const nav = this.navLookup[navId];\r\n videoIndex = nav.videoUrlIndex;\r\n }\r\n this.highlightMenu(videoIndex);\r\n }\r\n\r\n getQueryVariable(variableIdx: number) {\r\n const href = window.location.href;\r\n const hashIndex = href.indexOf('#');\r\n if (hashIndex > -1) {\r\n const query = href.substring(hashIndex + 2);\r\n if (query) {\r\n const vars = query.split('/');\r\n return vars[variableIdx];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n handleRequestCurrentNavigation(resultCallback: TResultCallback) {\r\n if (this.activeNavigationPoint) {\r\n const labelCtrl = this.ctrlLookup[this.activeNavigationPoint.labelId];\r\n resultCallback({\r\n navigationData: this.activeNavigationPoint,\r\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\r\n });\r\n } else {\r\n resultCallback(null);\r\n }\r\n }\r\n\r\n detach(eventbus: IEventbus) {\r\n this.eventhandlers.forEach((handler) => {\r\n handler();\r\n });\r\n\r\n this.labelControllers.forEach((ctrl) => {\r\n ctrl.detach(eventbus);\r\n });\r\n\r\n this.labelControllers.length = 0;\r\n this.eventbus = null;\r\n this.container = null;\r\n window.onpopstate = null;\r\n }\r\n\r\n pushCurrentState(position = -1) {\r\n if (!this.activeNavigationPoint) {\r\n return;\r\n }\r\n const labelCtrl: LabelController =\r\n this.ctrlLookup[this.activeNavigationPoint.labelId];\r\n\r\n if (!labelCtrl) {\r\n return;\r\n }\r\n\r\n const state = {\r\n navigationData: this.activeNavigationPoint,\r\n title: labelCtrl.labelData[labelCtrl.currentLanguage || ''],\r\n position: -1,\r\n };\r\n if (position > -1) {\r\n state.position = position;\r\n }\r\n this.eventbus?.broadcast('push-history-state', [state]);\r\n }\r\n\r\n buildHtml(parentElm: JQuery, data: any) {\r\n const ul = $('<ul/>');\r\n data.forEach(this.addNavElement.bind(this, ul));\r\n parentElm.append(ul);\r\n }\r\n\r\n addNavElement(parentElm: JQuery, data: any) {\r\n if (data.visible) {\r\n const li = $('<li/>');\r\n const a = $(`<a href='javascript:;' id='nav_${data.videoUrlIndex}'/>`);\r\n li.append(a);\r\n this.addLabel(a, data.labelId);\r\n this.addClickHandler(a, data.videoUrlIndex);\r\n\r\n if (data.children) {\r\n const ul = $('<ul/>');\r\n data.children.forEach(this.addNavElement.bind(this, ul));\r\n li.append(ul);\r\n }\r\n\r\n parentElm.append(li);\r\n }\r\n }\r\n\r\n addClickHandler(parentElm: JQuery, videoIndex: number) {\r\n parentElm.mouseup(this.menuMouseupHandler.bind(this, videoIndex));\r\n }\r\n\r\n menuMouseupHandler(videoIndex: number) {\r\n const navdata = this.navVidIdLookup[videoIndex];\r\n if (navdata) {\r\n this.eventbus?.broadcast('request-video-url', [navdata.videoUrlIndex]);\r\n this.handleNavigateVideoUrl(navdata.videoUrlIndex);\r\n }\r\n }\r\n\r\n handleNavigateVideoUrl(index: number, requestedVideoPosition: number = 0) {\r\n this.highlightMenu(index);\r\n this.eventbus?.broadcast('request-video-url', [\r\n index,\r\n requestedVideoPosition,\r\n ]);\r\n this.activeNavigationPoint = this.navVidIdLookup[index];\r\n this.pushCurrentState(requestedVideoPosition);\r\n }\r\n\r\n highlightMenu(index: number) {\r\n const navElm = $(`#nav_${index}`);\r\n\r\n if (navElm.length) {\r\n $('.current-menu-item').removeClass('current-menu-item');\r\n navElm.addClass('current-menu-item');\r\n }\r\n }\r\n\r\n handleVideoComplete(index: number) {\r\n const navData = this.navVidIdLookup[index];\r\n if (navData.autoNext) {\r\n this.eventbus?.broadcast('request-video-url', [\r\n navData.next.videoUrlIndex,\r\n ]);\r\n } else {\r\n this.eventbus?.broadcast('request-video-cleanup');\r\n }\r\n }\r\n\r\n addLabel(parentElm: JQuery, labelId: string) {\r\n const data = {\r\n selectedElement: parentElm,\r\n labelId: labelId,\r\n };\r\n const resultCallback = (instance: LabelController) => {\r\n instance.init(data);\r\n instance.attach(this.eventbus as IEventbus);\r\n this.labelControllers.push(instance);\r\n this.ctrlLookup[labelId] = instance;\r\n };\r\n this.eventbus?.broadcast('request-instance', [\r\n 'LabelController',\r\n resultCallback,\r\n ]);\r\n }\r\n\r\n buildNavigationData(data: any) {\r\n const result: any[] = [];\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n this.navLookup[nav.id] = nav;\r\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\r\n nav.previous = data.navigationData[index - 1];\r\n });\r\n\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n if (nav.nextId) {\r\n nav.next = this.navLookup[nav.nextId];\r\n delete nav.nextId;\r\n } else {\r\n nav.next = data.navigationData[index + 1];\r\n }\r\n });\r\n\r\n data.roots.forEach((id: string) => {\r\n const nav = this.navLookup[id];\r\n if (nav.children) {\r\n nav.children = nav.children.map((childId: string) => {\r\n return this.navLookup[childId];\r\n });\r\n }\r\n result.push(nav);\r\n });\r\n return result;\r\n }\r\n}\r\n","import { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { IController } from './types';\r\n\r\nexport interface IProgressbarControllerOperationData {\r\n selectedElement: JQuery;\r\n textElement: JQuery;\r\n}\r\n\r\nexport class ProgressbarController\r\n implements IController<IProgressbarControllerOperationData>\r\n{\r\n name: string = 'ProgressbarController';\r\n selectedElement: JQuery | null = null;\r\n textElement: JQuery | null = null;\r\n detachers: TEventbusRemover[] = [];\r\n\r\n init(operationData: TOperationData) {\r\n this.selectedElement = operationData.selectedElement;\r\n this.textElement = operationData.textElement;\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n this.detachers.push(\r\n eventbus.on(\r\n TimelineEventNames.POSITION_UPDATE,\r\n this.positionUpdateHandler.bind(this)\r\n )\r\n );\r\n\r\n const clickHandler = this.clickHandler.bind(this);\r\n this.selectedElement?.on('click', clickHandler);\r\n this.detachers.push(() => this.selectedElement?.off('click'), clickHandler);\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.detachers.forEach((func: () => void) => {\r\n func();\r\n });\r\n }\r\n\r\n positionUpdateHandler({\r\n position,\r\n duration,\r\n }: {\r\n position: number;\r\n duration: number;\r\n }) {\r\n const percentage = (100 / duration) * position;\r\n this.selectedElement?.css('width', `${percentage}%`);\r\n this.textElement?.text(`${Math.floor(percentage)}%`);\r\n }\r\n\r\n clickHandler() {}\r\n}\r\n","import { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { IController } from './types';\r\n\r\nexport interface IRoutingControllerOperationData {\r\n json: any;\r\n}\r\n\r\nexport class RoutingController\r\n implements IController<IRoutingControllerOperationData>\r\n{\r\n name = 'RoutingController';\r\n navLookup: Record<string, any> = {};\r\n navVidIdLookup: Record<string, any> = {};\r\n navigation: any = null;\r\n eventhandlers: TEventbusRemover[] = [];\r\n eventbus: IEventbus | null = null;\r\n\r\n constructor() {}\r\n\r\n init(operationData: TOperationData) {\r\n this.navigation = this.buildNavigationData(operationData.json);\r\n }\r\n\r\n attach(eventbus: IEventbus) {\r\n this.eventhandlers.push(\r\n eventbus.on(\r\n 'before-request-video-url',\r\n this.handleBeforeRequestVideoUrl.bind(this)\r\n )\r\n );\r\n this.eventhandlers.push(\r\n eventbus.on('push-history-state', this.handlePushHistoryState.bind(this))\r\n );\r\n this.eventbus = eventbus;\r\n window.onpopstate = this.handlePopstate.bind(this);\r\n\r\n const navId = this.getQueryVariable(0);\r\n if (navId) {\r\n const nav = this.navLookup[navId];\r\n const pos = +this.getQueryVariable(1);\r\n this.eventbus.broadcast('request-video-url', [\r\n nav.videoUrlIndex,\r\n pos,\r\n true,\r\n ]);\r\n } else {\r\n window.history.pushState(\r\n { navigationId: this.navigation[0].id },\r\n '',\r\n `#/${this.navigation[0].id}`\r\n );\r\n }\r\n }\r\n\r\n handlePopstate(event: any) {\r\n const navigationId = event.state\r\n ? event.state.navigationId\r\n : this.navigation[0].id;\r\n const position = event.state?.position ?? 0;\r\n const nav = this.navLookup[navigationId];\r\n this.eventbus?.broadcast('highlight-navigation', [nav.videoUrlIndex]);\r\n this.eventbus?.broadcast('request-video-url', [\r\n nav.videoUrlIndex,\r\n position,\r\n true,\r\n ]);\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n if (this.eventhandlers) {\r\n this.eventhandlers.forEach((handler) => {\r\n handler();\r\n });\r\n }\r\n this.eventbus = null;\r\n }\r\n\r\n handleBeforeRequestVideoUrl(\r\n _index: number,\r\n _requestedVideoPosition: number = 0,\r\n isHistoryRequest: boolean = false\r\n ) {\r\n isHistoryRequest =\r\n isHistoryRequest !== undefined ? isHistoryRequest : false;\r\n if (!isHistoryRequest) {\r\n const resultCallback = (item: any) => {\r\n this.pushState(item);\r\n };\r\n this.eventbus?.broadcast('request-current-navigation', [resultCallback]);\r\n }\r\n }\r\n\r\n getQueryVariable(variableIdx: number) {\r\n const href = window.location.href;\r\n const hashIndex = href.indexOf('#');\r\n if (hashIndex > -1) {\r\n const query = href.substring(hashIndex + 2);\r\n if (query) {\r\n const vars = query.split('/');\r\n return vars[variableIdx];\r\n }\r\n }\r\n return '';\r\n }\r\n\r\n handlePushHistoryState(state: any) {\r\n this.pushState(state);\r\n }\r\n\r\n pushState(state: any) {\r\n if (state && state.navigationData && state.navigationData.visible) {\r\n let currentPosition = state.position !== undefined ? state.position : -1;\r\n if (currentPosition < 0) {\r\n const resultCallback = (position: number) => {\r\n currentPosition = position > 3 ? position - 3 : 0;\r\n };\r\n this.eventbus?.broadcast('request-current-video-position', [\r\n resultCallback,\r\n ]);\r\n }\r\n\r\n const currentState = window.history.state;\r\n if (\r\n currentState &&\r\n currentState.navigationId !== state.navigationData.id\r\n ) {\r\n window.history.pushState(\r\n { navigationId: state.navigationData.id, position: currentPosition },\r\n state.title,\r\n `#/${state.navigationData.id}/${currentPosition}`\r\n );\r\n } else if (\r\n currentState &&\r\n currentState.navigationId === state.navigationData.id\r\n ) {\r\n window.history.replaceState(\r\n {\r\n navigationId: currentState.navigationId,\r\n position: currentPosition,\r\n },\r\n state.title,\r\n `#/${currentState.navigationId}/${currentPosition}`\r\n );\r\n } else {\r\n window.history.pushState(\r\n { navigationId: state.navigationData.id, position: currentPosition },\r\n state.title,\r\n `#/${state.navigationData.id}/${currentPosition}`\r\n );\r\n }\r\n window.document.title = state.title;\r\n }\r\n }\r\n\r\n buildNavigationData(data: any) {\r\n const result: any[] = [];\r\n data.navigationData.forEach((nav: any, index: any) => {\r\n this.navLookup[nav.id] = nav;\r\n this.navVidIdLookup[nav.videoUrlIndex] = nav;\r\n nav.previous = data.navigationData[index - 1];\r\n });\r\n\r\n data.navigationData.forEach((nav: any, index: number) => {\r\n if (nav.nextId) {\r\n nav.next = this.navLookup[nav.nextId];\r\n delete nav.nextId;\r\n } else {\r\n nav.next = data.navigationData[index + 1];\r\n }\r\n });\r\n\r\n data.roots.forEach((id: string) => {\r\n const nav = this.navLookup[id];\r\n if (nav.children) {\r\n nav.children = nav.children.map((childId: string) => {\r\n return this.navLookup[childId];\r\n });\r\n }\r\n result.push(nav);\r\n });\r\n return result;\r\n }\r\n}\r\n","import { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TOperationData } from '../operation/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { IController } from './types';\r\n\r\nexport interface ISubtitlesControllerOperationData {\r\n selectedElement: JQuery;\r\n language: string;\r\n subtitleData: any;\r\n}\r\n\r\nexport class SubtitlesController\r\n implements IController<ISubtitlesControllerOperationData>\r\n{\r\n actionLookup: Record<string, any> = {};\r\n currentLanguage: string | null = null;\r\n lastFunc: Function | null = null;\r\n name = 'SubtitlesController';\r\n\r\n attach(eventbus: IEventbus) {\r\n const detachTime = eventbus.on(\r\n TimelineEventNames.TIME,\r\n this.onTimeHandler.bind(this)\r\n );\r\n const detachSeek = eventbus.on(\r\n TimelineEventNames.SEEKED,\r\n this.onSeekedHandler.bind(this)\r\n );\r\n const detachLangChange = eventbus.on(\r\n TimelineEventNames.LANGUAGE_CHANGE,\r\n this.languageChangeHandler.bind(this)\r\n );\r\n this.internalDetach = this.internalDetach.bind(this, [\r\n detachTime,\r\n detachLangChange,\r\n detachSeek,\r\n ]);\r\n }\r\n\r\n detach(_eventbus: IEventbus) {\r\n this.internalDetach();\r\n }\r\n\r\n internalDetach(detachMethods?: TEventbusRemover[]) {\r\n if (detachMethods) {\r\n detachMethods.forEach((f) => {\r\n f();\r\n });\r\n }\r\n }\r\n\r\n languageChangeHandler(newLanguage: string) {\r\n this.currentLanguage = newLanguage;\r\n if (this.lastFunc) {\r\n this.lastFunc();\r\n }\r\n }\r\n\r\n removeTitle(container?: JQuery) {\r\n container?.empty();\r\n this.lastFunc = null;\r\n }\r\n\r\n onTimeHandler(arg: any) {\r\n const position = arg.position;\r\n const func = this.actionLookup[position];\r\n if (func) {\r\n func();\r\n this.lastFunc = func;\r\n }\r\n }\r\n\r\n onSeekedHandler(arg: any) {\r\n let position = arg.position;\r\n let func = this.actionLookup[position];\r\n while (!func && --position >= 0) {\r\n func = this.actionLookup[position];\r\n }\r\n if (func) {\r\n func();\r\n this.lastFunc = func;\r\n } else {\r\n this.removeTitle();\r\n }\r\n }\r\n\r\n setTitle(container: JQuery, titleLanguageLookup: Record<string, string>) {\r\n if (this.currentLanguage) {\r\n container.html(titleLanguageLookup[this.currentLanguage]);\r\n }\r\n }\r\n\r\n createActionLookup(operationData: TOperationData, container: JQuery) {\r\n const subtitleData = operationData.subtitleData;\r\n const titles = subtitleData[0].titles;\r\n const subtitleTimeLookup: Record<number, () => void> = {};\r\n\r\n for (let i = 0, ii = titles.length; i < ii; i++) {\r\n const titleLanguageLookup: Record<string, string> = {};\r\n\r\n for (let j = 0, jj = subtitleData.length; j < jj; j++) {\r\n const subs = subtitleData[j];\r\n titleLanguageLookup[subs.lang] = subs.titles[i].text;\r\n }\r\n\r\n subtitleTimeLookup[titles[i].duration.start] = this.setTitle.bind(\r\n this,\r\n container,\r\n titleLanguageLookup\r\n );\r\n subtitleTimeLookup[titles[i].duration.end] = this.removeTitle;\r\n }\r\n\r\n return subtitleTimeLookup;\r\n }\r\n\r\n init(operationData: ISubtitlesControllerOperationData) {\r\n const container = operationData.selectedElement;\r\n this.removeTitle = this.removeTitle.bind(this, container);\r\n this.currentLanguage = operationData.language;\r\n this.actionLookup = this.createActionLookup(operationData, container);\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport { IEndableAction, ITimelineAction } from './action/types';\r\nimport { IResolvedEngineConfiguration } from './configuration/types';\r\nimport { IEventbus, TEventbusRemover, TEventHandler } from './eventbus/types';\r\nimport { LanguageManager } from './language-manager';\r\nimport { TOperation } from './operation/types';\r\nimport { TimelineEventNames } from './timeline-event-names';\r\nimport { ITimelineProvider } from './timelineproviders/types';\r\nimport {\r\n IEligiusEngine,\r\n ITimelineProviderInfo,\r\n TimelineTypes,\r\n TResultCallback,\r\n} from './types';\r\n\r\n/**\r\n * EligiusEngine, this is where the magic happens. The engine is responsible for starting and stopping\r\n * the given timeline provider and triggering the actions associated with it.\r\n * ...\r\n */\r\nexport class EligiusEngine implements IEligiusEngine {\r\n private _timeLineActionsLookup: Record<string, any> = {};\r\n private _eventbusRemovers: TEventbusRemover[] = [];\r\n private _currentTimelineUri: string = '';\r\n private _activeTimelineProvider: ITimelineProvider | undefined = undefined;\r\n private _lastPosition: number = -1;\r\n\r\n constructor(\r\n private configuration: IResolvedEngineConfiguration,\r\n private eventbus: IEventbus,\r\n private timelineProviders: Record<TimelineTypes, ITimelineProviderInfo>,\r\n private languageManager: LanguageManager\r\n ) {}\r\n\r\n init(): Promise<ITimelineProvider> {\r\n this._createLayoutTemplate();\r\n\r\n this._addInitialisationListeners();\r\n\r\n const { timelines } = this.configuration;\r\n\r\n this._currentTimelineUri = timelines?.[0].uri ?? '';\r\n\r\n this._createTimelineLookup();\r\n\r\n return this._initializeTimelineProvider();\r\n }\r\n\r\n private _createLayoutTemplate() {\r\n const { containerSelector } = this.configuration;\r\n const container = $(containerSelector);\r\n\r\n if (!container || !container.length) {\r\n throw new Error(`Container selector not found: ${containerSelector}`);\r\n }\r\n\r\n const { layoutTemplate } = this.configuration;\r\n\r\n if (layoutTemplate && layoutTemplate.length) {\r\n container.html(layoutTemplate);\r\n } else {\r\n console.warn('layoutTemplate is empty, unable to create layout');\r\n }\r\n }\r\n\r\n private _initializeTimelineProvider(): Promise<ITimelineProvider> {\r\n if (!this.configuration.timelines?.length) {\r\n throw new Error('No timelines present');\r\n }\r\n\r\n const firstTimeline = this.configuration.timelines[0];\r\n const providerSettings = this.timelineProviders[firstTimeline.type];\r\n\r\n if (!providerSettings) {\r\n throw new Error(\r\n `No timeline provider configured for type ${firstTimeline.type}`\r\n );\r\n }\r\n\r\n this._activeTimelineProvider?.destroy();\r\n this._activeTimelineProvider = providerSettings.provider;\r\n\r\n return new Promise(async (resolve) => {\r\n if (this._activeTimelineProvider) {\r\n await this._activeTimelineProvider.init();\r\n await this._executeActions(this.configuration.initActions, 'start');\r\n resolve(this._activeTimelineProvider);\r\n } else {\r\n throw new Error('NO ACTIVE TIMELINE PROVIDER');\r\n }\r\n });\r\n }\r\n\r\n private async _cleanUp() {\r\n await this._cleanUpTimeline();\r\n await this._executeActions(this.configuration.initActions, 'end');\r\n }\r\n\r\n async destroy() {\r\n await this._cleanUp();\r\n\r\n this.languageManager.destroy();\r\n\r\n this._activeTimelineProvider = undefined;\r\n this._eventbusRemovers.forEach((remover) => remover());\r\n\r\n if (this.timelineProviders) {\r\n Object.values(this.timelineProviders).forEach((providerInfo) =>\r\n providerInfo.provider.destroy()\r\n );\r\n }\r\n\r\n const { containerSelector } = this.configuration;\r\n const container = $(containerSelector);\r\n container.empty();\r\n }\r\n\r\n private _addEventListener(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ) {\r\n this._eventbusRemovers.push(\r\n this.eventbus.on(eventName, eventHandler, eventTopic)\r\n );\r\n }\r\n\r\n private _addInitialisationListeners() {\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_ENGINE_ROOT,\r\n this._handleRequestEngineRoot.bind(\r\n this,\r\n this.configuration.containerSelector\r\n )\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_TIMELINE_URI,\r\n this._handleRequestTimelineUri.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_CURRENT_TIMELINE_POSITION,\r\n this._handleRequestTimelinePosition.bind(this, Math.floor)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_TIMELINE_CLEANUP,\r\n this._handleTimelineComplete.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.EXECUTE_TIMELINEACTION,\r\n this._handleExecuteTimelineAction.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.RESIZE_TIMELINEACTION,\r\n this._resizeTimelineAction.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.REQUEST_CURRENT_TIMELINE,\r\n this._requestCurrentTimeline.bind(this)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.TIME,\r\n this._onTimeHandler.bind(this, Math.floor)\r\n );\r\n this._addEventListener(\r\n TimelineEventNames.SEEK,\r\n this._onSeekHandler.bind(this, Math.floor)\r\n );\r\n }\r\n\r\n private _createTimelineLookup() {\r\n if (!this.configuration.timelines) {\r\n return;\r\n }\r\n this.configuration.timelines.forEach((timelineInfo) => {\r\n timelineInfo.timelineActions.forEach(\r\n this._addTimelineAction.bind(this, timelineInfo.uri)\r\n );\r\n });\r\n }\r\n\r\n private _addTimelineAction(uri: string, timeLineAction: ITimelineAction) {\r\n const startPosition = timeLineAction.duration.start;\r\n const timelineStartPositions = this._initializeTimelinePosition(\r\n this._initializeUriLookup(this._timeLineActionsLookup, uri),\r\n startPosition\r\n );\r\n const startMethod = timeLineAction.start.bind(timeLineAction);\r\n\r\n if (timeLineAction.id?.length) {\r\n (startMethod as any).id = timeLineAction.id;\r\n (startMethod as any).isStart = true;\r\n }\r\n\r\n timelineStartPositions.push(startMethod);\r\n\r\n let end = timeLineAction.duration.end;\r\n if (end < 0) {\r\n end = timeLineAction.duration.end = Infinity;\r\n }\r\n\r\n if (isFinite(end)) {\r\n const timelineEndPositions = this._initializeTimelinePosition(\r\n this._timeLineActionsLookup[uri],\r\n end\r\n );\r\n const endMethod = timeLineAction.end.bind(timeLineAction);\r\n\r\n if (timeLineAction.id?.length) {\r\n (endMethod as any).id = timeLineAction.id;\r\n }\r\n\r\n timelineEndPositions.push(endMethod);\r\n }\r\n }\r\n\r\n private _initializeUriLookup(\r\n lookup: Record<string, any>,\r\n uri: string\r\n ): Record<number, any> {\r\n if (!lookup[uri]) {\r\n lookup[uri] = {};\r\n }\r\n\r\n return lookup[uri];\r\n }\r\n\r\n private _initializeTimelinePosition(\r\n lookup: Record<number, any>,\r\n position: number\r\n ): TOperation[] {\r\n if (!lookup[position]) {\r\n lookup[position] = [];\r\n }\r\n\r\n return lookup[position];\r\n }\r\n\r\n private async _executeActions(\r\n actions: IEndableAction[],\r\n methodName: 'start' | 'end',\r\n idx = 0\r\n ): Promise<any> {\r\n if (actions && idx < actions.length) {\r\n const action = actions[idx];\r\n\r\n await action[methodName]();\r\n return this._executeActions(actions, methodName, ++idx);\r\n }\r\n\r\n return new Promise<void>((resolve) => {\r\n resolve();\r\n });\r\n }\r\n\r\n private _handleRequestEngineRoot(\r\n engineRootSelector: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback($(engineRootSelector));\r\n }\r\n\r\n async _handleRequestTimelineUri(\r\n uri: string,\r\n position?: number,\r\n previousVideoPosition?: number\r\n ) {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n previousVideoPosition = previousVideoPosition ?? 0;\r\n this._activeTimelineProvider.stop();\r\n\r\n await this._cleanUpTimeline();\r\n\r\n const timelineConfig = this.configuration.timelines.find(\r\n (timeline) => timeline.uri === uri\r\n );\r\n if (\r\n !timelineConfig ||\r\n !this._activeTimelineProvider ||\r\n this._currentTimelineUri === timelineConfig.uri\r\n ) {\r\n return;\r\n }\r\n this._currentTimelineUri = timelineConfig.uri;\r\n\r\n this.eventbus.broadcast(TimelineEventNames.CURRENT_TIMELINE_CHANGE, [\r\n this._currentTimelineUri,\r\n ]);\r\n\r\n const newProviderSettings = this.timelineProviders[timelineConfig.type];\r\n\r\n if (this._activeTimelineProvider !== newProviderSettings.provider) {\r\n this._activeTimelineProvider.destroy();\r\n this._activeTimelineProvider = newProviderSettings.provider;\r\n }\r\n\r\n this._activeTimelineProvider.loop = timelineConfig.loop;\r\n\r\n position = position ?? 0;\r\n if (!this._activeTimelineProvider.loop && position > 0) {\r\n this.eventbus.once(TimelineEventNames.FIRST_FRAME, () => {\r\n if (!this._activeTimelineProvider) {\r\n return;\r\n }\r\n\r\n this._activeTimelineProvider.pause();\r\n this.eventbus.broadcast(TimelineEventNames.DURATION, [\r\n this._activeTimelineProvider.getDuration(),\r\n ]);\r\n this._executeStartActions().then(() => {\r\n position = position ?? 0;\r\n this._activeTimelineProvider?.seek(position);\r\n this._onSeekHandler(Math.floor, {\r\n offset: position,\r\n });\r\n });\r\n });\r\n }\r\n\r\n this._activeTimelineProvider.playlistItem(uri);\r\n }\r\n\r\n private _cleanUpTimeline() {\r\n return this._executeRelevantActions(this._getActiveActions, 'end');\r\n }\r\n\r\n private _executeStartActions() {\r\n return this._executeRelevantActions(\r\n this._getActionsForPosition.bind(this, 0),\r\n 'start'\r\n );\r\n }\r\n\r\n private _getActionsForPosition(\r\n position: number,\r\n allActions: ITimelineAction[]\r\n ) {\r\n return allActions.filter((action) => {\r\n return (\r\n !action.active &&\r\n action.duration.start <= position &&\r\n action.duration.end >= position\r\n );\r\n });\r\n }\r\n\r\n private _getActiveActions(allActions: ITimelineAction[]) {\r\n const actions = allActions.filter((action) => action.active);\r\n return actions.sort((a, b) => {\r\n if (b.duration.start < a.duration.start) {\r\n return -1;\r\n } else if (b.duration.start > a.duration.start) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n }\r\n\r\n private _executeRelevantActions(\r\n filter: (actions: ITimelineAction[]) => ITimelineAction[],\r\n executionType: 'start' | 'end'\r\n ) {\r\n const timelineActions = this._getRelevantTimelineActions();\r\n const currentActions = filter.apply(this, [timelineActions]);\r\n return this._executeActions(currentActions, executionType, 0);\r\n }\r\n\r\n private _handleRequestTimelinePosition(\r\n floor: Function,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback(floor(this._activeTimelineProvider?.getPosition() || -1));\r\n }\r\n\r\n private _handleTimelineComplete() {\r\n this._cleanUpTimeline();\r\n }\r\n\r\n private _handleExecuteTimelineAction(\r\n uri: string,\r\n index: number,\r\n start: boolean\r\n ) {\r\n const actions = this._getTimelineActionsForUri(uri);\r\n const action = actions?.[index];\r\n if (action) {\r\n if (start) {\r\n action.start();\r\n } else {\r\n action.end();\r\n }\r\n }\r\n }\r\n\r\n private _resizeTimelineAction(/*uri: string, index: number*/) {\r\n console.error('no resizing implemented');\r\n }\r\n\r\n private _getRelevantTimelineActions() {\r\n return this._getTimelineActionsForUri(this._currentTimelineUri);\r\n }\r\n\r\n private _requestCurrentTimeline(resultCallback: TResultCallback) {\r\n resultCallback(this._currentTimelineUri);\r\n }\r\n\r\n private _getTimelineActionsForUri(uri: string): ITimelineAction[] {\r\n const info = this.configuration.timelines.find((timelineInfo) => {\r\n return timelineInfo.uri === uri;\r\n });\r\n return info?.timelineActions ?? [];\r\n }\r\n\r\n private _onTimeHandler(floor: Function, event: any) {\r\n if (!isNaN(event.position)) {\r\n const pos = floor(event.position);\r\n\r\n if (this._lastPosition !== pos) {\r\n this._executeActionsForPosition(pos);\r\n this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [\r\n pos,\r\n this._activeTimelineProvider?.getDuration(),\r\n ]);\r\n }\r\n\r\n this.eventbus.broadcast(TimelineEventNames.TIME_UPDATE, [\r\n event.position,\r\n this._activeTimelineProvider?.getDuration(),\r\n ]);\r\n }\r\n }\r\n\r\n private _onSeekHandler(floor: Function, event: { offset: number }) {\r\n if (isNaN(event.offset)) {\r\n return;\r\n }\r\n\r\n const pos = floor(event.offset);\r\n\r\n this._executeSeekActions(pos).then(() => {\r\n this._activeTimelineProvider?.start();\r\n });\r\n }\r\n\r\n private _executeActionsForPosition(position: number) {\r\n this._lastPosition = position;\r\n const actions = this._timeLineActionsLookup[this._currentTimelineUri];\r\n\r\n if (actions) {\r\n const executions = actions[position];\r\n executions?.forEach((exec: () => void) => {\r\n exec();\r\n });\r\n }\r\n }\r\n\r\n private _executeSeekActions(pos: number) {\r\n const timelineActions = this._getRelevantTimelineActions();\r\n\r\n if (!timelineActions) {\r\n return Promise.resolve();\r\n }\r\n\r\n const currentActions = this._getActiveActions(timelineActions);\r\n const newActions = this._getActionsForPosition(pos, timelineActions);\r\n const promise = this._executeActions(currentActions, 'end', 0);\r\n\r\n return new Promise<void>((resolve) => {\r\n promise.then(() => {\r\n this._executeActions(newActions, 'start', 0).then(() => {\r\n resolve();\r\n });\r\n });\r\n });\r\n }\r\n}\r\n","import { IAction } from '../action/types';\r\nimport { IEventbusListener } from './types';\r\n\r\nexport class ActionRegistryEventbusListener implements IEventbusListener {\r\n private _actionRegistry = new Map<string, IAction[]>();\r\n\r\n registerAction(\r\n action: IAction,\r\n eventName: string,\r\n eventTopic?: string\r\n ): void {\r\n if (eventTopic && eventTopic.length) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this._actionRegistry.has(eventName)) {\r\n this._actionRegistry.set(eventName, []);\r\n }\r\n this._actionRegistry.get(eventName)?.push(action);\r\n }\r\n\r\n handleEvent(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any[]\r\n ): void {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n const actions = this._actionRegistry.get(eventName);\r\n if (actions) {\r\n const operationData = {\r\n eventArgs: args,\r\n };\r\n actions.forEach((action) => {\r\n action.start(operationData);\r\n });\r\n }\r\n }\r\n}\r\n","import {\r\n IEventbus,\r\n IEventbusInterceptor,\r\n IEventbusListener,\r\n TEventbusRemover,\r\n TEventHandler,\r\n} from './types';\r\n\r\nexport class Eventbus implements IEventbus {\r\n private eventHandlers = new Map<string, TEventHandler[]>();\r\n private eventInterceptors = new Map<string, IEventbusInterceptor[]>();\r\n private eventListeners: IEventbusListener[] = [];\r\n\r\n constructor() {\r\n this.clear();\r\n }\r\n\r\n clear() {\r\n this.eventHandlers = new Map<string, TEventHandler[]>();\r\n this.eventListeners = [];\r\n this.eventInterceptors = new Map<string, IEventbusInterceptor[]>();\r\n }\r\n\r\n _getEventInterceptors(\r\n eventName: string,\r\n eventTopic?: string\r\n ): IEventbusInterceptor[] {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this.eventInterceptors.has(eventName)) {\r\n this.eventInterceptors.set(eventName, []);\r\n }\r\n return this.eventInterceptors.get(eventName) as IEventbusInterceptor[];\r\n }\r\n\r\n _getEventHandlers(eventName: string, eventTopic?: string): TEventHandler[] {\r\n if (eventTopic) {\r\n eventName = `${eventName}:${eventTopic}`;\r\n }\r\n if (!this.eventHandlers.has(eventName)) {\r\n this.eventHandlers.set(eventName, []);\r\n }\r\n return this.eventHandlers.get(eventName) as TEventHandler[];\r\n }\r\n\r\n on(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n this._getEventHandlers(eventName, eventTopic).push(eventHandler);\r\n return () => {\r\n this.off(eventName, eventHandler, eventTopic);\r\n };\r\n }\r\n\r\n once(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n const eventHandlerDecorator = (...args: any[]) => {\r\n eventHandler(...args);\r\n this.off(eventName, eventHandlerDecorator, eventTopic);\r\n };\r\n this.on(eventName, eventHandlerDecorator, eventTopic);\r\n return () => {\r\n this.off(eventName, eventHandlerDecorator, eventTopic);\r\n };\r\n }\r\n\r\n off(\r\n eventName: string,\r\n eventHandler: TEventHandler,\r\n eventTopic?: string\r\n ): void {\r\n const handlers = this._getEventHandlers(eventName, eventTopic);\r\n if (handlers) {\r\n const idx = handlers.indexOf(eventHandler);\r\n if (idx > -1) {\r\n handlers.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n broadcast(eventName: string, args: any[]): void {\r\n this._callHandlers(eventName, undefined, args);\r\n }\r\n\r\n broadcastForTopic(eventName: string, eventTopic: string, args: any[]): void {\r\n this._callHandlers(eventName, eventTopic, args);\r\n }\r\n\r\n registerEventlistener(eventbusListener: IEventbusListener): TEventbusRemover {\r\n this.eventListeners.push(eventbusListener);\r\n return () => {\r\n const index = this.eventListeners.indexOf(eventbusListener);\r\n if (index > -1) {\r\n this.eventListeners.splice(index, 1);\r\n }\r\n };\r\n }\r\n\r\n registerInterceptor(\r\n eventName: string,\r\n interceptor: IEventbusInterceptor,\r\n eventTopic?: string\r\n ): TEventbusRemover {\r\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\r\n interceptors.push(interceptor);\r\n return () => {\r\n const index = interceptors.indexOf(interceptor);\r\n if (index > -1) {\r\n interceptors.splice(index, 1);\r\n }\r\n };\r\n }\r\n\r\n _callHandlers(\r\n eventName: string,\r\n eventTopic: string | undefined,\r\n args: any = []\r\n ): void {\r\n const handlers = this._getEventHandlers(eventName, eventTopic);\r\n\r\n if (handlers) {\r\n const interceptors = this._getEventInterceptors(eventName, eventTopic);\r\n\r\n interceptors.forEach((interceptor) => {\r\n args = interceptor.intercept(args);\r\n });\r\n\r\n this.eventListeners.forEach((listener: IEventbusListener) => {\r\n listener.handleEvent(eventName, eventTopic, args);\r\n });\r\n\r\n if (args?.length) {\r\n handlers.forEach((handler: TEventHandler) => handler(...args));\r\n } else {\r\n handlers.forEach((handler: TEventHandler) => handler());\r\n }\r\n }\r\n }\r\n}\r\n","import { TimelineEventNames } from '../timeline-event-names';\r\nimport { IEventbus, IEventbusInterceptor } from './types';\r\n\r\nexport class RequestVideoUriInterceptor implements IEventbusInterceptor {\r\n constructor(private eventbus: IEventbus) {}\r\n\r\n intercept(args: any[]): any[] {\r\n this.eventbus.broadcast(\r\n TimelineEventNames.BEFORE_REQUEST_TIMELINE_URI,\r\n args.slice()\r\n );\r\n return args;\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport { IEventbus, TEventbusRemover } from './eventbus/types';\r\nimport { TimelineEventNames } from './timeline-event-names';\r\nimport { ILabel, ILanguageLabel, TResultCallback } from './types';\r\n\r\nexport class LanguageManager {\r\n private _labelLookup: Record<string, ILabel[]>;\r\n private _eventbusRemovers: TEventbusRemover[] = [];\r\n\r\n constructor(\r\n private _currentLanguage: string,\r\n labels: ILanguageLabel[],\r\n private _eventbus: IEventbus\r\n ) {\r\n if (!_currentLanguage) {\r\n throw new Error('language ctor arg cannot have zero length');\r\n }\r\n this._setRootElementLang(_currentLanguage);\r\n this._labelLookup = this._createLabelLookup(labels);\r\n this._addEventbusListeners(_eventbus);\r\n }\r\n\r\n destroy() {\r\n this._eventbusRemovers.forEach((x) => x());\r\n }\r\n\r\n _addEventbusListeners(eventbus: IEventbus) {\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n TimelineEventNames.REQUEST_LABEL_COLLECTION,\r\n this._handleRequestLabelCollection.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n TimelineEventNames.REQUEST_LABEL_COLLECTIONS,\r\n this._handleRequestLabelCollections.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n TimelineEventNames.REQUEST_CURRENT_LANGUAGE,\r\n this._handleRequestCurrentLanguage.bind(this)\r\n )\r\n );\r\n this._eventbusRemovers.push(\r\n eventbus.on(\r\n TimelineEventNames.LANGUAGE_CHANGE,\r\n this._handleLanguageChange.bind(this)\r\n )\r\n );\r\n }\r\n\r\n _handleRequestCurrentLanguage(resultCallback: TResultCallback) {\r\n resultCallback(this._currentLanguage);\r\n }\r\n\r\n _handleRequestLabelCollection(\r\n labelId: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback(this._labelLookup[labelId]);\r\n }\r\n\r\n _handleRequestLabelCollections(\r\n labelIds: string[],\r\n resultCallback: TResultCallback\r\n ) {\r\n const labelCollections = labelIds.map((labelId) => {\r\n return this._labelLookup[labelId];\r\n });\r\n resultCallback(labelCollections);\r\n }\r\n\r\n _handleLanguageChange(language: string) {\r\n if (language && language.length) {\r\n this._currentLanguage = language;\r\n this._setRootElementLang(this._currentLanguage);\r\n } else {\r\n console.error('Language cannot be changed to null or empty string');\r\n }\r\n }\r\n\r\n _setRootElementLang(language: string) {\r\n const callBack = (rootSelector: string) => {\r\n const lang = this._extractLanguageFromCulture(language);\r\n $(rootSelector).attr('lang', lang);\r\n };\r\n this._eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [\r\n callBack,\r\n ]);\r\n }\r\n\r\n _extractLanguageFromCulture(culture: string) {\r\n if (culture.indexOf('-') > -1) {\r\n return culture.split('-').shift() as string;\r\n }\r\n return culture;\r\n }\r\n\r\n _createLabelLookup(labels: ILanguageLabel[]) {\r\n return labels.reduce<Record<string, ILabel[]>>((acc, label) => {\r\n acc[label.id] = label.labels;\r\n return acc;\r\n }, {});\r\n }\r\n}\r\n","import hotkeys, { HotkeysEvent } from 'hotkeys-js';\r\nimport $ from 'jquery';\r\nimport { IAction } from './action/types';\r\nimport { ConfigurationResolver } from './configuration/configuration-resolver';\r\nimport {\r\n IEngineConfiguration,\r\n IResolvedEngineConfiguration,\r\n} from './configuration/types';\r\nimport { DevToolEventListener } from './diagnostics/devtool-event-lister';\r\nimport { Diagnostics } from './diagnostics/diagnostics';\r\nimport {\r\n DEV_TOOLS_KEY,\r\n TDiagnosticType,\r\n TWindowWithDevtools,\r\n} from './diagnostics/types';\r\nimport {\r\n ActionRegistryEventbusListener,\r\n Eventbus,\r\n IEventbus,\r\n RequestVideoUriInterceptor,\r\n TEventbusRemover,\r\n} from './eventbus';\r\nimport { LanguageManager } from './language-manager';\r\nimport { TimelineEventNames } from './timeline-event-names';\r\nimport {\r\n IConfigurationResolver,\r\n IEligiusEngine,\r\n IEngineFactory,\r\n IEngineFactoryOptions,\r\n ISimpleResourceImporter,\r\n ITimelineProviderInfo,\r\n TimelineTypes,\r\n TResultCallback,\r\n} from './types';\r\nimport { prepareValueForSerialization } from './util/prepare-value-for-serialization';\r\n\r\nexport class EngineFactory implements IEngineFactory {\r\n private _actionsLookup: Record<string, IAction> = {};\r\n private _eventbus: IEventbus;\r\n private _eventRemovers: TEventbusRemover[] = [];\r\n private _importer: ISimpleResourceImporter;\r\n private _resizeTimeout: any = -1;\r\n\r\n constructor(\r\n importer: ISimpleResourceImporter,\r\n windowRef: Window,\r\n options?: IEngineFactoryOptions\r\n ) {\r\n this._importer = importer;\r\n this._eventbus = options?.eventbus ?? new Eventbus();\r\n\r\n Diagnostics.active = options?.devtools ?? false;\r\n if (Diagnostics.active) {\r\n this._initializeDevtools(this._eventbus);\r\n }\r\n\r\n this._eventRemovers.push(\r\n this._eventbus.on(\r\n TimelineEventNames.REQUEST_INSTANCE,\r\n this._requestInstanceHandler.bind(this)\r\n )\r\n );\r\n this._eventRemovers.push(\r\n this._eventbus.on(\r\n TimelineEventNames.REQUEST_ACTION,\r\n this._requestActionHandler.bind(this)\r\n )\r\n );\r\n this._eventRemovers.push(\r\n this._eventbus.on(\r\n TimelineEventNames.REQUEST_FUNCTION,\r\n this._requestFunctionHandler.bind(this)\r\n )\r\n );\r\n\r\n const handleSpaceBound = this._handleSpacePress.bind(this);\r\n hotkeys('space', handleSpaceBound);\r\n this._eventRemovers.push(() => hotkeys.unbind('space', handleSpaceBound));\r\n\r\n const resizeBound = this._resizeHandler.bind(this);\r\n const jqWin = $(windowRef);\r\n jqWin.on('resize', resizeBound);\r\n this._eventRemovers.push(() => jqWin.off('resize', resizeBound));\r\n }\r\n\r\n private _handleSpacePress(\r\n keyboardEvent: KeyboardEvent,\r\n _hotkeysEvent: HotkeysEvent\r\n ): void | boolean {\r\n keyboardEvent.preventDefault();\r\n this._eventbus.broadcast(TimelineEventNames.PLAY_TOGGLE_REQUEST);\r\n return false;\r\n }\r\n\r\n private _initializeDevtools(eventbus: IEventbus) {\r\n const diagnosticInfo = (window as unknown as TWindowWithDevtools)[\r\n DEV_TOOLS_KEY\r\n ];\r\n\r\n if (diagnosticInfo) {\r\n const { agent } = diagnosticInfo;\r\n\r\n this._eventRemovers.push(\r\n eventbus.registerEventlistener(new DevToolEventListener(agent))\r\n );\r\n\r\n this._eventRemovers.push(\r\n agent.subscribe((message) => {\r\n if (message.type === 'playcontrol') {\r\n switch (message.data.kind) {\r\n case 'play':\r\n this._eventbus.broadcast(TimelineEventNames.PLAY_REQUEST);\r\n break;\r\n case 'stop':\r\n this._eventbus.broadcast(TimelineEventNames.STOP_REQUEST);\r\n break;\r\n case 'pause':\r\n this._eventbus.broadcast(TimelineEventNames.PAUSE_REQUEST);\r\n break;\r\n case 'seek':\r\n this._eventbus.broadcast(TimelineEventNames.SEEK_REQUEST, [\r\n message.data.args,\r\n ]);\r\n break;\r\n }\r\n }\r\n })\r\n );\r\n\r\n Diagnostics.send = (name: TDiagnosticType, messageData: any) => {\r\n const message = prepareValueForSerialization(messageData);\r\n try {\r\n agent.postMessage(name, message);\r\n } catch (e) {\r\n console.error('postmessage failed');\r\n console.error(e);\r\n console.log('message', message);\r\n }\r\n };\r\n\r\n Diagnostics.send(\r\n 'eligius-diagnostics-factory',\r\n 'Diagnostics initialized'\r\n );\r\n } else {\r\n console.warn(\r\n `${DEV_TOOLS_KEY} property not found on window, please install the Eligius Devtools extension.`\r\n );\r\n }\r\n }\r\n\r\n destroy() {\r\n this._eventRemovers.forEach((x) => x());\r\n }\r\n\r\n private _resizeHandler() {\r\n if (this._resizeTimeout) {\r\n clearTimeout(this._resizeTimeout);\r\n this._resizeTimeout = -1;\r\n }\r\n this._resizeTimeout = setTimeout(() => {\r\n this._eventbus.broadcast(TimelineEventNames.RESIZE);\r\n }, 200);\r\n }\r\n\r\n private _importSystemEntryWithEventbusDependency(systemName: string): any {\r\n const ctor = this._importSystemEntry(systemName);\r\n return new ctor(this._eventbus);\r\n }\r\n\r\n private _importSystemEntry(systemName: string): any {\r\n return this._importer.import(systemName)[systemName];\r\n }\r\n\r\n private _requestInstanceHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback(this._importSystemEntryWithEventbusDependency(systemName));\r\n }\r\n\r\n private _requestFunctionHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n resultCallback(this._importSystemEntry(systemName));\r\n }\r\n\r\n private _requestActionHandler(\r\n systemName: string,\r\n resultCallback: TResultCallback\r\n ) {\r\n const action = this._actionsLookup[systemName];\r\n if (action) {\r\n resultCallback(action);\r\n } else {\r\n console.error(`Unknown action: ${systemName}`);\r\n resultCallback(null);\r\n }\r\n }\r\n\r\n createEngine(\r\n configuration: IEngineConfiguration,\r\n resolver?: IConfigurationResolver\r\n ): IEligiusEngine {\r\n const { systemName } = configuration.engine;\r\n const EngineClass = this._importSystemEntry(systemName);\r\n\r\n let actionRegistryListener: ActionRegistryEventbusListener | undefined =\r\n undefined;\r\n if (configuration.eventActions?.length) {\r\n actionRegistryListener = new ActionRegistryEventbusListener();\r\n this._eventRemovers.push(\r\n this._eventbus.registerEventlistener(actionRegistryListener)\r\n );\r\n }\r\n\r\n this._eventRemovers.push(\r\n this._eventbus.registerInterceptor(\r\n TimelineEventNames.REQUEST_TIMELINE_URI,\r\n new RequestVideoUriInterceptor(this._eventbus)\r\n )\r\n );\r\n\r\n resolver =\r\n resolver || new ConfigurationResolver(this._importer, this._eventbus);\r\n const [actionLookup, resolvedConfiguration] = resolver.process(\r\n configuration,\r\n actionRegistryListener\r\n );\r\n this._actionsLookup = actionLookup;\r\n\r\n const timelineProviders = this._createTimelineProviders(\r\n resolvedConfiguration,\r\n this._eventbus\r\n );\r\n\r\n const { language, labels } = configuration;\r\n const languageManager = new LanguageManager(\r\n language,\r\n labels,\r\n this._eventbus\r\n );\r\n\r\n const engineInstance = new EngineClass(\r\n resolvedConfiguration,\r\n this._eventbus,\r\n timelineProviders,\r\n languageManager\r\n );\r\n\r\n return engineInstance;\r\n }\r\n\r\n private _createTimelineProviders(\r\n configuration: IResolvedEngineConfiguration,\r\n eventbus: IEventbus\r\n ): Record<TimelineTypes, ITimelineProviderInfo> {\r\n const { timelineProviderSettings } = configuration;\r\n\r\n const result = Object.entries(timelineProviderSettings).reduce<\r\n Record<TimelineTypes, ITimelineProviderInfo>\r\n >((acc, [timelineType, settings]) => {\r\n if (!settings) {\r\n return acc;\r\n }\r\n\r\n const timelineProviderClass = this._importSystemEntry(\r\n settings.systemName\r\n );\r\n acc[timelineType as TimelineTypes] = {\r\n id: settings.id,\r\n vendor: settings.vendor,\r\n provider: new timelineProviderClass(eventbus, configuration),\r\n };\r\n return acc;\r\n }, {} as Record<TimelineTypes, ITimelineProviderInfo>);\r\n\r\n return result;\r\n }\r\n}\r\n","import { TOperation } from './types';\r\n\r\nexport interface IAddClassOperationData {\r\n selectedElement: JQuery;\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation adds the specified class name to the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const addClass: TOperation<IAddClassOperationData> = function (\r\n operationData: IAddClassOperationData\r\n) {\r\n const { selectedElement, className } = operationData;\r\n selectedElement.addClass(className);\r\n return operationData;\r\n};\r\n","import { IController } from '../../controllers/types';\r\n\r\nexport const controllersDataName = 'eligiusEngineControllers';\r\n\r\nfunction getElementData(name: string, element: JQuery): IController<any>[] {\r\n return element.data(name);\r\n}\r\n\r\nconst getElementControllers = getElementData.bind(null, controllersDataName);\r\n\r\nexport { getElementData, getElementControllers };\r\n\r\n","import { TOperationData } from '../types';\r\n\r\nexport function mergeOperationData<T extends TOperationData, K = T>(\r\n operationData: T,\r\n newOperationData: TOperationData\r\n): K {\r\n return { ...(operationData as any), ...newOperationData } as K;\r\n}\r\n","import { TOperationData } from '../types';\r\nimport { mergeOperationData } from './merge-operation-data';\r\n\r\nexport function internalResolve(\r\n resolve: Function,\r\n operationData: TOperationData,\r\n newOperationData?: TOperationData\r\n) {\r\n if (newOperationData) {\r\n resolve(mergeOperationData(operationData, newOperationData));\r\n } else {\r\n resolve(operationData);\r\n }\r\n}\r\n","import { IController } from '../controllers/types';\r\nimport { attachControllerToElement } from './helper/attach-controller-to-element';\r\nimport { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IAddControllerToElementOperationData {\r\n selectedElement: JQuery;\r\n controllerInstance: IController<any>;\r\n}\r\n\r\n/**\r\n * This operation adds the specified controller instance to the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const addControllerToElement: TOperation<IAddControllerToElementOperationData> =\r\n function (operationData: IAddControllerToElementOperationData) {\r\n const { selectedElement, controllerInstance } = operationData;\r\n\r\n attachControllerToElement(selectedElement, controllerInstance);\r\n\r\n controllerInstance.init(operationData);\r\n\r\n const promise = controllerInstance.attach(this.eventbus);\r\n\r\n if (promise) {\r\n return new Promise((resolve, reject) => {\r\n promise.then((newOperationData: any) => {\r\n internalResolve(resolve, operationData, newOperationData);\r\n }, reject);\r\n });\r\n } else {\r\n return operationData;\r\n }\r\n };\r\n","import { controllersDataName, getElementControllers } from './get-element-data';\r\n\r\nexport function attachControllerToElement(element: JQuery, controller: any) {\r\n if (!element.data(controllersDataName)) {\r\n element.data(controllersDataName, []);\r\n }\r\n const controllers = getElementControllers(element);\r\n if (controllers) {\r\n controllers.push(controller);\r\n }\r\n}\r\n","import { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IAnimateOperationData {\r\n animationEasing?: string;\r\n selectedElement: JQuery;\r\n animationProperties: any;\r\n animationDuration: number;\r\n}\r\n\r\n/**\r\n * This operation animates the specified selected element with the given jQuery animation settings.\r\n * It resolves after the animation completes.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const animate: TOperation<IAnimateOperationData> = function (\r\n operationData: IAnimateOperationData\r\n) {\r\n const {\r\n animationEasing,\r\n selectedElement,\r\n animationProperties,\r\n animationDuration,\r\n } = operationData;\r\n const promise = new Promise<IAnimateOperationData>((resolve, reject) => {\r\n try {\r\n if (animationEasing) {\r\n selectedElement.animate(\r\n animationProperties,\r\n animationDuration,\r\n animationEasing,\r\n () => {\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n );\r\n } else {\r\n selectedElement.animate(animationProperties, animationDuration, () => {\r\n internalResolve(resolve, {}, operationData);\r\n });\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n });\r\n return promise;\r\n};\r\n","import { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IAnimateWithClassOperationData {\r\n selectedElement: JQuery;\r\n className: string;\r\n removeClass?: boolean;\r\n}\r\n\r\n/**\r\n * This operation adds the specified class name to the specified selected element and assumes that this\r\n * class triggers and animation on the selected element. It then waits for this animation to complete\r\n * until it resolves.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const animateWithClass: TOperation<IAnimateWithClassOperationData> =\r\n function (operationData: IAnimateWithClassOperationData) {\r\n let { selectedElement, className, removeClass } = operationData;\r\n removeClass = removeClass !== undefined ? removeClass : true;\r\n\r\n const promise = new Promise<IAnimateWithClassOperationData>(\r\n (resolve, reject) => {\r\n try {\r\n selectedElement.one(\r\n 'webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd',\r\n () => {\r\n if (removeClass) {\r\n selectedElement.removeClass(className);\r\n }\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n );\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }\r\n );\r\n\r\n selectedElement.addClass(className);\r\n\r\n return promise;\r\n };\r\n","import { getNestedValue } from './get-nested-value';\r\n\r\nexport function extractOperationDataArgumentValues(\r\n sourceObject: any,\r\n argumentValue: string | any\r\n) {\r\n if (\r\n typeof argumentValue === 'string' &&\r\n argumentValue.toLowerCase().startsWith('operationdata.')\r\n ) {\r\n const propNames = argumentValue.split('.');\r\n propNames.shift();\r\n return getNestedValue(propNames, sourceObject);\r\n }\r\n return argumentValue;\r\n}\r\n","import { removeEventDataFromOperationData } from './helper/remove-event-data-from-operation-data';\r\nimport { resolveEventArguments } from './helper/resolve-event-arguments';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IBroadcastEventOperationData {\r\n eventArgs: any[];\r\n eventTopic?: string;\r\n eventName: string;\r\n}\r\n\r\n/**\r\n * This operation broadcasts the given event through the eventbus, along with the\r\n * event argumetns and optional event topic.\r\n *\r\n * @param operationData\r\n */\r\nexport const broadcastEvent: TOperation<IBroadcastEventOperationData> =\r\n function (operationData: IBroadcastEventOperationData) {\r\n const { eventArgs, eventTopic, eventName } = operationData;\r\n\r\n const eventArguments = resolveEventArguments(operationData, eventArgs);\r\n\r\n if (eventTopic) {\r\n this.eventbus.broadcastForTopic(eventName, eventTopic, eventArguments);\r\n } else {\r\n this.eventbus.broadcast(eventName, eventArguments);\r\n }\r\n\r\n removeEventDataFromOperationData(operationData);\r\n return operationData;\r\n };\r\n","import { TOperationData } from '../../operation/types';\r\nimport { extractOperationDataArgumentValues } from './extract-operation-data-argument-values';\r\n\r\nexport function resolveEventArguments(\r\n operationData: TOperationData,\r\n eventArgs?: any[]\r\n) {\r\n if (!eventArgs) {\r\n return;\r\n }\r\n const extract = extractOperationDataArgumentValues.bind(null, operationData);\r\n return eventArgs.map(extract);\r\n}\r\n","import { TOperationData } from '../../operation/types';\r\n\r\nexport function removeEventDataFromOperationData(\r\n operationData: TOperationData\r\n) {\r\n delete operationData.eventName;\r\n delete operationData.eventTopic;\r\n delete operationData.eventArgs;\r\n}\r\n","import $ from 'jquery';\r\nimport { TOperationData } from '../../operation/types';\r\nimport { deepCopy } from './deep-copy';\r\nimport { extractOperationDataArgumentValues } from './extract-operation-data-argument-values';\r\n\r\nconst cache: any[] = [];\r\n\r\nexport function resolvePropertyValues(\r\n operationData: TOperationData,\r\n properties: any\r\n) {\r\n const copy = properties !== operationData ? deepCopy(properties) : properties;\r\n const extract = extractOperationDataArgumentValues.bind(null, operationData);\r\n\r\n resolveProperties(properties, copy, extract);\r\n\r\n return copy;\r\n}\r\n\r\nfunction resolveProperties(\r\n properties: any,\r\n copy: any,\r\n extract: (input: string) => any\r\n) {\r\n if (cache.indexOf(properties) > -1) {\r\n return;\r\n }\r\n cache.push(properties);\r\n try {\r\n Object.entries(properties).forEach(([key, value]) => {\r\n if (value instanceof $) {\r\n return;\r\n }\r\n\r\n if (typeof value === 'string') {\r\n copy[key] = extract(value);\r\n } else if (Array.isArray(value)) {\r\n value.forEach((item, index, arr) => {\r\n if (typeof item === 'string') {\r\n arr[index] = extract(item);\r\n } else {\r\n resolveProperties(item, item, extract);\r\n }\r\n });\r\n } else if (typeof value === 'object') {\r\n resolveProperties(value, value, extract);\r\n }\r\n });\r\n } finally {\r\n const index = cache.indexOf(properties);\r\n cache.splice(index, 1);\r\n }\r\n}\r\n","import { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport type TCalculationOperator = '+' | '-' | '*' | '/' | '%' | '**';\r\n\r\nexport interface ICalcOperationData {\r\n left: string | number;\r\n right: string | number;\r\n operator: TCalculationOperator;\r\n propertyName?: string;\r\n}\r\n\r\nconst calcFunctions: Record<\r\n TCalculationOperator,\r\n (left: number, right: number) => number\r\n> = {\r\n '+': (left: number, right: number) => left + right,\r\n '-': (left: number, right: number) => left - right,\r\n '*': (left: number, right: number) => left * right,\r\n '/': (left: number, right: number) => left / right,\r\n '%': (left: number, right: number) => left % right,\r\n '**': (left: number, right: number) => left ** right,\r\n};\r\n\r\n/**\r\n * This operation calculates the given left and right hand sides using the specified operator.\r\n *\r\n * @param operationData\r\n */\r\nexport const calc: TOperation<ICalcOperationData> = function (\r\n operationData: ICalcOperationData\r\n) {\r\n operationData = resolvePropertyValues(operationData, operationData);\r\n\r\n const {\r\n left,\r\n right,\r\n operator,\r\n propertyName = 'calculationResult',\r\n } = operationData;\r\n\r\n (operationData as any)[propertyName] = calcFunctions[operator](+left, +right);\r\n\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IClearElementOperationData {\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation removes all of the children from the specified selected element.\r\n */\r\nexport const clearElement: TOperation<IClearElementOperationData> = function(\r\n operationData: IClearElementOperationData\r\n) {\r\n const { selectedElement } = operationData;\r\n selectedElement.empty();\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IClearOperationDataOperationData {\r\n properties?: string[];\r\n}\r\n\r\n/**\r\n * This operation removes all of the properties on the current operation date.\r\n * Or, if the properties property is set only removes the properties defined by that list.\r\n */\r\nexport const clearOperationData: TOperation<IClearOperationDataOperationData> = function(\r\n operationData: IClearOperationDataOperationData\r\n) {\r\n const { properties } = operationData;\r\n\r\n if (properties) {\r\n properties.forEach(name => {\r\n delete (operationData as any)[name];\r\n });\r\n delete operationData.properties;\r\n return operationData;\r\n }\r\n\r\n return {};\r\n};\r\n","import $ from 'jquery';\r\nimport { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport type TTagNames = keyof HTMLElementTagNameMap;\r\n\r\nexport interface ICreateElementOperationData<T extends TTagNames> {\r\n elementName: T;\r\n text?: string;\r\n attributes?: Partial<HTMLElementTagNameMap[T]>;\r\n propertyName?: string;\r\n template?: JQuery;\r\n}\r\n\r\n/**\r\n * This operation creates the DOM element defined by the given properties and assigns\r\n * the instance to the give property name on the current operation data.\r\n * The property name defaults to 'template'.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const createElement: TOperation<ICreateElementOperationData<any>> =\r\n function <T extends TTagNames>(\r\n operationData: ICreateElementOperationData<T>\r\n ) {\r\n operationData = resolvePropertyValues(operationData, operationData);\r\n const {\r\n elementName,\r\n attributes,\r\n text,\r\n propertyName = 'template',\r\n } = operationData;\r\n\r\n const serializedAttrs = attributes\r\n ? ' ' +\r\n Object.entries(attributes)\r\n .map(([key, value]) => `${key}=\"${value}\"`)\r\n .join(' ')\r\n : '';\r\n\r\n const template = text\r\n ? $(`<${elementName}${serializedAttrs}>${text}</${elementName}>`)\r\n : $(`<${elementName}${serializedAttrs}/>`);\r\n\r\n (operationData as any)[propertyName] = template;\r\n\r\n delete operationData.propertyName;\r\n return operationData;\r\n };\r\n","import { TimelineEventNames } from '../timeline-event-names';\r\nimport { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\nexport interface ICustomFunctionOperationData {\r\n systemName: string;\r\n}\r\n\r\n/**\r\n * This operation retrieves a custom function defined by the specified system name\r\n * and invokes it with the current operation data and eventbus.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const customFunction: TOperation<ICustomFunctionOperationData> =\r\n function (operationData: ICustomFunctionOperationData) {\r\n const { systemName } = operationData;\r\n return new Promise<ICustomFunctionOperationData>((resolve, reject) => {\r\n const resultCallback = (func: Function) => {\r\n const promise = func(operationData, this.eventbus);\r\n if (promise) {\r\n promise.then(() => {\r\n internalResolve(resolve, {}, operationData);\r\n }, reject);\r\n } else {\r\n internalResolve(resolve, {}, operationData);\r\n }\r\n };\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_FUNCTION, [\r\n systemName,\r\n resultCallback,\r\n ]);\r\n });\r\n };\r\n","import { IEndableAction } from '../action/types';\r\nimport { internalResolve } from './helper/internal-resolve';\r\nimport { mergeOperationData } from './helper/merge-operation-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IEndActionOperationData {\r\n actionInstance: IEndableAction;\r\n actionOperationData: any;\r\n}\r\n\r\n/**\r\n * This operation invokes the end() method on the specified action instance.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const endAction: TOperation<IEndActionOperationData> = function (\r\n operationData: IEndActionOperationData\r\n) {\r\n const { actionInstance, actionOperationData } = operationData;\r\n delete operationData.actionOperationData;\r\n\r\n return new Promise<IEndActionOperationData>((resolve, reject) => {\r\n operationData = mergeOperationData(operationData, actionOperationData);\r\n\r\n actionInstance.end(operationData).then(() => {\r\n Object.keys(actionOperationData).forEach((key) => {\r\n delete (operationData as any)[key];\r\n });\r\n internalResolve(resolve, operationData);\r\n }, reject);\r\n });\r\n};\r\n","import { TOperationData } from '.';\r\nimport { TOperation } from './types';\r\n\r\n/**\r\n * This operation checks if the current loop should end or start the next iteration.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const endLoop: TOperation<TOperationData> = function (\r\n operationData: TOperationData\r\n) {\r\n const context = this;\r\n\r\n if (!context.skipNextOperation) {\r\n if (\r\n context.loopIndex !== undefined &&\r\n context.loopLength !== undefined &&\r\n context.loopIndex < context.loopLength\r\n ) {\r\n context.loopIndex = context.loopIndex + 1;\r\n context.newIndex = context.startIndex;\r\n } else {\r\n delete context.loopIndex;\r\n delete context.loopLength;\r\n delete context.startIndex;\r\n delete context.newIndex;\r\n }\r\n } else {\r\n delete context.skipNextOperation;\r\n }\r\n\r\n return operationData;\r\n};\r\n","import { IController } from '../controllers/types';\r\nimport { TOperation } from './types';\r\n\r\n/**\r\n * This operation extends the specified controller instance with the specified extension.\r\n */\r\nexport interface IExtendControllerOperationData {\r\n controllerInstance: IController<any>;\r\n controllerExtension: any;\r\n}\r\n\r\nexport const extendController: TOperation<IExtendControllerOperationData> =\r\n function (operationData: IExtendControllerOperationData) {\r\n const { controllerInstance, controllerExtension } = operationData;\r\n\r\n operationData.controllerInstance = Object.assign(\r\n controllerInstance,\r\n controllerExtension\r\n );\r\n\r\n return operationData;\r\n };\r\n","import { IController } from '../controllers/types';\r\nimport { getElementControllers } from './helper/get-element-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IGetControllerFromElementOperationData {\r\n selectedElement: JQuery;\r\n controllerName: string;\r\n controllerInstance?: IController<any>;\r\n}\r\n\r\n/**\r\n * This operation retrieves the controller instance with the specified name from the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const getControllerFromElement: TOperation<IGetControllerFromElementOperationData> =\r\n function (operationData: IGetControllerFromElementOperationData) {\r\n const { selectedElement, controllerName } = operationData;\r\n const controllers = getElementControllers(selectedElement);\r\n const controller = controllers.find((ctrl) => {\r\n return ctrl.name === controllerName;\r\n });\r\n\r\n if (!controller) {\r\n console.warn(\r\n `controller for name '${controllerName}' was not found on the given element`\r\n );\r\n }\r\n\r\n operationData.controllerInstance = controller;\r\n return operationData;\r\n };\r\n","import * as controllers from '../controllers';\r\nimport { IController } from '../controllers/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { TOperation } from './types';\r\n\r\ntype TSystemName = keyof typeof controllers;\r\nexport interface IGetControllerInstanceOperationData {\r\n systemName: TSystemName;\r\n propertyName?: string;\r\n controllerInstance?: IController<unknown>;\r\n}\r\n\r\n/**\r\n * This operation retrieves an instance of the given controller name.\r\n * It assigns this instance to the property on the current operation data\r\n * defined by the propertyName property which defaults to 'controllerInstance'.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const getControllerInstance: TOperation<IGetControllerInstanceOperationData> =\r\n function (operationData: IGetControllerInstanceOperationData) {\r\n const { systemName, propertyName = 'controllerInstance' } = operationData;\r\n\r\n (operationData as any)[propertyName] = null;\r\n const resultCallback = (instance: any) => {\r\n (operationData as any)[propertyName as string] = instance;\r\n };\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_INSTANCE, [\r\n systemName,\r\n resultCallback,\r\n ]);\r\n delete operationData.propertyName;\r\n return operationData;\r\n };\r\n","import { modifyDimensions } from './helper/modify-dimensions';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IGetElementDimensionsOperationData {\r\n selectedElement: JQuery;\r\n modifier?: string;\r\n dimensions?: { width?: number; height?: number };\r\n}\r\n\r\n/**\r\n * This operation calculates the width and height of the specified selected element.\r\n * It assigns this struct to the dimensions property on the current operation data.\r\n * Optionally the width and height can be tweaked using the given modifier string.\r\n *\r\n * The modifier string is formatted in the following way:\r\n *\r\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\r\n *\r\n * Where the ratio modifier is formatted in the following way:\r\n * <side>[ar=<ratio-left>-<ratio-right>]\r\n *\r\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\r\n * it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const getElementDimensions: TOperation<IGetElementDimensionsOperationData> =\r\n function (operationData: IGetElementDimensionsOperationData) {\r\n const { selectedElement, modifier } = operationData;\r\n let dimensions = {\r\n width: selectedElement.innerWidth() ?? 0,\r\n height: selectedElement.innerHeight() ?? 0,\r\n };\r\n if (dimensions.height === 0) {\r\n dimensions.height = dimensions.width;\r\n }\r\n if (modifier) {\r\n dimensions = modifyDimensions(dimensions, modifier);\r\n }\r\n operationData.dimensions = dimensions;\r\n return operationData;\r\n };\r\n","import { IDimensions } from '../../types';\r\n\r\nfunction _modifyDimensionsByRatio(\r\n ratioModifier: string,\r\n dimensions: IDimensions\r\n) {\r\n const modifiedDimensions = { ...dimensions };\r\n //h[ar=8-1]\r\n let prefix = ratioModifier.substring(0, 1);\r\n\r\n let ratio = ratioModifier.substring(\r\n ratioModifier.indexOf('[') + 1,\r\n ratioModifier.indexOf(']') - (ratioModifier.indexOf('[') - 1)\r\n );\r\n\r\n let ratios = ratio.split('=')[1].split('-');\r\n\r\n if (ratios.filter(Boolean).length !== 2) {\r\n throw new Error(`Badly formatted modifier, expect two ratios: ${ratio}`);\r\n }\r\n\r\n if (prefix === 'h') {\r\n modifiedDimensions.height =\r\n (modifiedDimensions.width / +ratios[0]) * +ratios[1];\r\n } else if (prefix === 'w') {\r\n modifiedDimensions.width =\r\n (modifiedDimensions.height / +ratios[1]) * +ratios[0];\r\n }\r\n\r\n return modifiedDimensions;\r\n}\r\n\r\nfunction _getModifierSuffix(\r\n modifier: string //*100h%\r\n): [string | null, number, boolean] {\r\n let endIdx = 1;\r\n let suffix: string | null = modifier.substring(\r\n modifier.length - endIdx,\r\n modifier.length\r\n );\r\n\r\n if (suffix !== 'h' && suffix !== 'w' && suffix !== '%') {\r\n suffix = null;\r\n }\r\n\r\n const isPercent = suffix === '%';\r\n\r\n if (isPercent) {\r\n suffix = modifier.substring(\r\n modifier.length - endIdx,\r\n modifier.length - (endIdx + 1)\r\n );\r\n\r\n if (suffix !== 'h' && suffix !== 'w') {\r\n suffix = null;\r\n }\r\n }\r\n\r\n return [suffix, endIdx, isPercent];\r\n}\r\n\r\nfunction _modifyDimensions(\r\n dimensions: IDimensions,\r\n prefix: string,\r\n suffix: string | null,\r\n widthModifier: number,\r\n heightModifier: number\r\n) {\r\n const modifiedDimension = { ...dimensions };\r\n switch (prefix) {\r\n case '+':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height += heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width += widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height += heightModifier;\r\n modifiedDimension.width += widthModifier;\r\n }\r\n break;\r\n case '-':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height -= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width -= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height -= heightModifier;\r\n modifiedDimension.width -= widthModifier;\r\n }\r\n break;\r\n case '/':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height /= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width /= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height /= heightModifier;\r\n modifiedDimension.width /= widthModifier;\r\n }\r\n break;\r\n case '*':\r\n switch (suffix) {\r\n case 'h':\r\n modifiedDimension.height *= heightModifier;\r\n break;\r\n case 'w':\r\n modifiedDimension.width *= widthModifier;\r\n break;\r\n default:\r\n modifiedDimension.height *= heightModifier;\r\n modifiedDimension.width *= widthModifier;\r\n }\r\n break;\r\n default:\r\n console.error(`Unknown operator found: ${prefix}`);\r\n }\r\n return modifiedDimension;\r\n}\r\n\r\n/**\r\n * Modifies the given dimensions using the given modifier string.\r\n * The modifier string is formatted in the following way:\r\n *\r\n * <operator><amount><optional-side><optional-precentage>|<ratio-definition>\r\n *\r\n * Where the ratio modifier is formatted in the following way:\r\n * <side>[ar=<ratio-left>-<ratio-right>]\r\n *\r\n * For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\r\n * it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.\r\n *\r\n * @param dimensions\r\n * @param modifier\r\n */\r\nexport function modifyDimensions(dimensions: IDimensions, modifier: string) {\r\n const clonedDimensions = { ...dimensions };\r\n let ratioModifier: string | null = null;\r\n if (modifier.indexOf('|') > -1) {\r\n [modifier, ratioModifier] = modifier.split('|');\r\n }\r\n\r\n const prefix = modifier.substring(0, 1);\r\n let [suffix, endIdx, isPercent] = _getModifierSuffix(modifier);\r\n\r\n const value = parseInt(\r\n suffix !== null\r\n ? modifier.substring(1, modifier.length - (endIdx - 1))\r\n : modifier.substring(1),\r\n 10\r\n );\r\n\r\n let widthModifier = value;\r\n let heightModifier = value;\r\n if (isPercent) {\r\n widthModifier = (clonedDimensions.width / 100) * value;\r\n heightModifier = (clonedDimensions.height / 100) * value;\r\n }\r\n\r\n const modifiedDimension = _modifyDimensions(\r\n clonedDimensions,\r\n prefix,\r\n suffix,\r\n widthModifier,\r\n heightModifier\r\n );\r\n\r\n if (ratioModifier) {\r\n return _modifyDimensionsByRatio(ratioModifier, modifiedDimension);\r\n }\r\n\r\n return modifiedDimension;\r\n}\r\n","import { TimelineEventNames } from '../timeline-event-names';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IGetImportOperationData {\r\n systemName: string;\r\n importedInstance?: any;\r\n}\r\n\r\n/**\r\n * This operation retrieves the import specified by the given system name and\r\n * assigns it to the importedInstance property on the current operaton date.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const getImport: TOperation<IGetImportOperationData> = function (\r\n operationData: IGetImportOperationData\r\n) {\r\n const { systemName } = operationData;\r\n const callBack = (instance: any) => {\r\n operationData.importedInstance = instance;\r\n };\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_FUNCTION, [\r\n systemName,\r\n callBack,\r\n ]);\r\n delete (operationData as any).systemName;\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nconst jsonCache: Record<string, any> = {};\r\n\r\nexport interface ILoadJSONOperationData {\r\n url: string;\r\n cache: boolean;\r\n propertyName?: string;\r\n json?: any;\r\n}\r\n\r\nexport const clearCache = () => {\r\n for (let p in jsonCache) {\r\n delete jsonCache[p];\r\n }\r\n};\r\n\r\nexport const addToCache = (key: string, value: any) => {\r\n jsonCache[key] = value;\r\n};\r\n\r\n/**\r\n * This operation loads a JSON file from the specified url and assigns it to the specified\r\n * property name on the current operation data. The property name defaults to 'json'.\r\n *\r\n * If the cache property is set to true and a cached value already exists, this is assigned\r\n * instead of re-retrieving it from the url.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const loadJSON: TOperation<ILoadJSONOperationData> = function (\r\n operationData: ILoadJSONOperationData\r\n) {\r\n const { url, cache, propertyName = 'json' } = operationData;\r\n\r\n if (cache && jsonCache[url]) {\r\n (operationData as any)[propertyName] = jsonCache[url];\r\n delete operationData.propertyName;\r\n return operationData;\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n fetch(url)\r\n .then(async (response) => {\r\n const json = await response.json();\r\n const cacheValue = ((operationData as any)[propertyName] = json);\r\n delete operationData.propertyName;\r\n addToCache(url, cacheValue);\r\n resolve(operationData);\r\n })\r\n .catch(reject);\r\n });\r\n};\r\n","import { TOperation } from './types';\r\n\r\n/**\r\n * This operation logs the current operation data and context.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const log: TOperation = function (operationData: unknown) {\r\n console.group('Operation info');\r\n console.dir({ context: this });\r\n console.dir({ operationData });\r\n console.groupEnd();\r\n return operationData;\r\n};\r\n","import { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IMathOperationData {\r\n args: (number | string | keyof Math)[];\r\n functionName: keyof Math;\r\n propertyName?: string;\r\n}\r\n\r\n/**\r\n * This operation performs the given math function of the specified arguments.\r\n *\r\n * @param operationData\r\n */\r\nexport const math: TOperation<IMathOperationData> = function (\r\n operationData: IMathOperationData\r\n) {\r\n operationData = resolvePropertyValues(operationData, operationData);\r\n operationData.args = resolveMathConstants(operationData.args);\r\n\r\n const { args, functionName, propertyName = 'mathResult' } = operationData;\r\n\r\n (operationData as any)[propertyName] = (Math[functionName] as Function).apply(\r\n null,\r\n args\r\n );\r\n\r\n return operationData;\r\n};\r\n\r\nfunction resolveMathConstants(args: any[]) {\r\n return args.map((arg: any) => {\r\n if (isMathProperty(arg)) {\r\n return Math[arg];\r\n }\r\n return arg;\r\n });\r\n}\r\n\r\nfunction isMathProperty(value: string | Symbol): value is keyof Math {\r\n return (\r\n typeof value === 'string' &&\r\n value in Math &&\r\n typeof Math[value as keyof Math] !== 'function'\r\n );\r\n}\r\n","import { TOperation } from './types';\r\n\r\nexport interface IRemoveClassOperationData {\r\n selectedElement: JQuery;\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation removes the spcified class name from the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const removeClass: TOperation<IRemoveClassOperationData> = function (\r\n operationData: IRemoveClassOperationData\r\n) {\r\n const { selectedElement, className } = operationData;\r\n selectedElement.removeClass(className);\r\n return operationData;\r\n};\r\n","import { IController } from '../controllers/types';\r\nimport { getElementControllers } from './helper/get-element-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IRemoveControllerFromElementOperationData {\r\n selectedElement: JQuery;\r\n controllerName: string;\r\n}\r\n\r\n/**\r\n * This operation removes the controller with the specified name from the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const removeControllerFromElement: TOperation<IRemoveControllerFromElementOperationData> =\r\n function (operationData: IRemoveControllerFromElementOperationData) {\r\n const { selectedElement, controllerName } = operationData;\r\n\r\n const controllers = getElementControllers(selectedElement);\r\n const controller = controllers?.find(\r\n (ctrl: IController<any>) => ctrl.name === controllerName\r\n );\r\n\r\n if (controller) {\r\n const idx = controllers.indexOf(controller);\r\n controllers.splice(idx, 1);\r\n controller.detach(this.eventbus);\r\n }\r\n\r\n return operationData;\r\n };\r\n","import { TOperation } from './types';\r\n\r\nexport interface IRemoveElementOperationData {\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation removes the specified selected element from the DOM.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const removeElement: TOperation<IRemoveElementOperationData> = function (\r\n operationData: IRemoveElementOperationData\r\n) {\r\n const { selectedElement } = operationData;\r\n selectedElement.remove();\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IRemovePropertiesFromOperationDataOperationData {\r\n propertyNames: string[];\r\n}\r\n\r\n/**\r\n * This operation removes the given list of properties from the current operation data.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const removePropertiesFromOperationData: TOperation<IRemovePropertiesFromOperationDataOperationData> =\r\n function (operationData: IRemovePropertiesFromOperationDataOperationData) {\r\n const { propertyNames } = operationData;\r\n\r\n propertyNames.forEach((name) => {\r\n delete (operationData as any)[name];\r\n });\r\n delete (operationData as any).propertyNames;\r\n return operationData;\r\n };\r\n","import { TOperation } from './types';\r\n\r\nexport interface IReparentElementOperationData {\r\n selectedElement: JQuery;\r\n newParentSelector: string;\r\n}\r\n\r\n/**\r\n * This operation moves the specified selected element to the new parent that is defined\r\n * by the specified selector.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const reparentElement: TOperation<IReparentElementOperationData> =\r\n function (operationData: IReparentElementOperationData) {\r\n const { selectedElement, newParentSelector } = operationData;\r\n selectedElement.remove().appendTo(newParentSelector);\r\n return operationData;\r\n };\r\n","import { IAction } from '../action/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IRequestActionOperationData {\r\n systemName: string;\r\n actionInstance?: IAction;\r\n}\r\n\r\n/**\r\n * This operation requests an action instance with the specified name and assigns it\r\n * to the actionInstance property on the current operation data.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const requestAction: TOperation<IRequestActionOperationData> = function (\r\n operationData: IRequestActionOperationData\r\n) {\r\n const { systemName } = operationData;\r\n\r\n const resultCallback = (action: IAction) => {\r\n operationData.actionInstance = action;\r\n };\r\n\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_ACTION, [\r\n systemName,\r\n resultCallback,\r\n ]);\r\n return operationData;\r\n};\r\n","import { mergeOperationData } from './helper/merge-operation-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IResizeActionOperationData {\r\n actionInstance: any;\r\n actionOperationData: any;\r\n}\r\n\r\n/**\r\n * @deprecated\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const resizeAction: TOperation<IResizeActionOperationData> = function (\r\n operationData: IResizeActionOperationData\r\n) {\r\n const { actionInstance, actionOperationData } = operationData;\r\n operationData = mergeOperationData(operationData, actionOperationData);\r\n\r\n if (actionInstance.resize) {\r\n return actionInstance.resize(operationData);\r\n }\r\n\r\n return operationData;\r\n};\r\n","import { TimelineEventNames } from '../timeline-event-names';\r\nimport { TOperation } from './types';\r\n\r\nfunction findElementBySelector(\r\n root: JQuery,\r\n selector: string,\r\n operationData: any,\r\n propertyName: string\r\n) {\r\n const element = root.find(selector);\r\n if (!element.length) {\r\n console.warn(`selector '${selector}' wasn't found!`);\r\n }\r\n operationData[propertyName] = element;\r\n if (operationData.hasOwnProperty('propertyName')) {\r\n delete operationData.propertyName;\r\n }\r\n}\r\n\r\nexport interface ISelectElementOperationData {\r\n selector: string;\r\n propertyName?: string;\r\n useSelectedElementAsRoot?: boolean;\r\n selectedElement?: JQuery;\r\n}\r\n\r\n/**\r\n * This operation selects one or more elements using the specified selector.\r\n *\r\n * If useSelectedElementAsRoot is set to true and a valid DOM element is assigned\r\n * to the current operation data defined by the given property name (defaults to 'selectedElement')\r\n * then the element will be looked for only in the child elements of this DOM element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const selectElement: TOperation<ISelectElementOperationData> = function (\r\n operationData: ISelectElementOperationData\r\n) {\r\n const {\r\n selector,\r\n propertyName = 'selectedElement',\r\n useSelectedElementAsRoot = false,\r\n } = operationData;\r\n\r\n if (!selector) {\r\n throw new Error('selector is undefined!');\r\n }\r\n\r\n if (useSelectedElementAsRoot && (operationData as any)[propertyName]) {\r\n const currentRoot = (operationData as any)[propertyName];\r\n findElementBySelector(currentRoot, selector, operationData, propertyName);\r\n return operationData;\r\n }\r\n\r\n const rootCallback = (root: JQuery) => {\r\n findElementBySelector(root, selector, operationData, propertyName);\r\n };\r\n this.eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [\r\n rootCallback,\r\n ]);\r\n\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface ISetElementAttributesOperationData {\r\n attributes: Record<string, any>;\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation sets the given set of attributes on the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const setElementAttributes: TOperation<ISetElementAttributesOperationData> =\r\n function (operationData: ISetElementAttributesOperationData) {\r\n const { attributes, selectedElement } = operationData;\r\n Object.entries(attributes).forEach(([attrName, attrValue]) => {\r\n selectedElement.attr(attrName, attrValue);\r\n });\r\n return operationData;\r\n };\r\n","import { TOperation } from './types';\r\n\r\nexport interface ISetElementContentOperationData {\r\n selectedElement: JQuery;\r\n template: string | JQuery.Node;\r\n insertionType: 'overwrite' | 'append' | 'prepend';\r\n}\r\n\r\n/**\r\n * This operation sets the specified content defined by the value assigned to the template property\r\n * to the specified selected element.\r\n *\r\n * When the insertionType is set to 'overwrite' the contents of the selected element are replaced\r\n * by the given template.\r\n * When set to 'append' the new content will be inserted after the current content.\r\n * When set to 'prepend' the new content will be inserted before the current content.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const setElementContent: TOperation<ISetElementContentOperationData> =\r\n function (operationData: ISetElementContentOperationData) {\r\n const {\r\n insertionType = 'overwrite',\r\n selectedElement,\r\n template,\r\n } = operationData;\r\n\r\n switch (true) {\r\n case insertionType === 'overwrite':\r\n selectedElement.html(template);\r\n break;\r\n case insertionType === 'append':\r\n selectedElement.append(template);\r\n break;\r\n case insertionType === 'prepend':\r\n selectedElement.prepend(template);\r\n break;\r\n }\r\n\r\n delete (operationData as any).insertionType;\r\n\r\n return operationData;\r\n };\r\n","import { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport interface ISetOperationData {\r\n override?: boolean;\r\n properties: any;\r\n}\r\n\r\n/**\r\n * This operation assigns the specified properties to the current operation data.\r\n * When override is set to true the properties replace the current operation data entirely.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const setOperationData: TOperation<ISetOperationData> = function (\r\n operationData: ISetOperationData\r\n) {\r\n const { override = false, properties } = operationData;\r\n delete operationData.properties;\r\n delete operationData.override;\r\n\r\n const resolvedProperties = resolvePropertyValues(operationData, properties);\r\n\r\n if (override) {\r\n operationData = resolvedProperties;\r\n } else {\r\n operationData = Object.assign(operationData, resolvedProperties);\r\n }\r\n\r\n return operationData;\r\n};\r\n","import { resolvePropertyValues } from './helper/resolve-property-values';\r\nimport { TOperation } from './types';\r\n\r\nexport interface ISetStyleOperationData {\r\n properties: any;\r\n propertyName?: string;\r\n}\r\n\r\n/**\r\n * This operation assigns the specified CSS style properties to the\r\n * specified selected element. The selected element is assigned to\r\n * the property defined by the propertyName property which defaults\r\n * to 'selectedElement'.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const setStyle: TOperation<ISetStyleOperationData> = function (\r\n operationData: ISetStyleOperationData\r\n) {\r\n const { propertyName = 'selectedElement' } = operationData;\r\n\r\n const properties = resolvePropertyValues(\r\n operationData,\r\n operationData.properties\r\n );\r\n (operationData as any)[propertyName].css(properties);\r\n delete operationData.propertyName;\r\n\r\n return operationData;\r\n};\r\n","import { IAction } from '../action/types';\r\nimport { internalResolve } from './helper/internal-resolve';\r\nimport { mergeOperationData } from './helper/merge-operation-data';\r\nimport { TOperation } from './types';\r\n\r\nexport interface IStartActionOperationData {\r\n actionInstance: IAction;\r\n actionOperationData: any;\r\n}\r\n\r\n/**\r\n * This operation starts the specified action instance using the specified action operation data.\r\n *\r\n * The action operation data is first merged with the current operation data before it is\r\n * passed on to the action. After the action has completed the action operation data properties\r\n * are removed from the current operation data.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const startAction: TOperation<IStartActionOperationData> = function (\r\n operationData: IStartActionOperationData\r\n) {\r\n const { actionInstance, actionOperationData } = operationData;\r\n delete operationData.actionOperationData;\r\n\r\n return new Promise((resolve, reject) => {\r\n operationData = mergeOperationData(operationData, actionOperationData);\r\n\r\n actionInstance.start(operationData).then(() => {\r\n Object.keys(actionOperationData).forEach((key) => {\r\n delete (operationData as any)[key];\r\n });\r\n internalResolve(resolve, operationData);\r\n }, reject);\r\n });\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport type TStartLoopOperationData = {\r\n collection: any[] | string;\r\n propertyName?: string;\r\n};\r\n\r\n/**\r\n * This operation starts a loop using the given collection.\r\n *\r\n * Each iteration the current item from the specified collection is\r\n * assigned to the property on the current operation data specified\r\n * by the propertyName property which defaults to 'currentItem'.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const startLoop: TOperation<TStartLoopOperationData> = function (\r\n operationData: TStartLoopOperationData\r\n) {\r\n const context = this;\r\n const { collection, propertyName = 'currentItem' } = operationData;\r\n\r\n if (typeof collection === 'string') {\r\n throw new Error(\r\n 'Expected collection to be array type, string value was probably not resolved correctly'\r\n );\r\n }\r\n\r\n if (context.loopIndex === undefined) {\r\n if (collection?.length) {\r\n context.loopIndex = 0;\r\n context.loopLength = collection.length - 1;\r\n context.startIndex = context.currentIndex;\r\n } else {\r\n context.skipNextOperation = true;\r\n }\r\n }\r\n\r\n if (collection?.length && context.loopIndex !== undefined) {\r\n (operationData as any)[propertyName] = collection[context.loopIndex];\r\n }\r\n\r\n delete operationData.propertyName;\r\n\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IToggleClassOperationData {\r\n selectedElement: JQuery;\r\n className: string;\r\n}\r\n\r\n/**\r\n * This operation toggles the specfied class name on the specified selected element.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const toggleClass: TOperation<IToggleClassOperationData> = function (\r\n operationData: IToggleClassOperationData\r\n) {\r\n const { selectedElement, className } = operationData;\r\n selectedElement.toggleClass(className);\r\n return operationData;\r\n};\r\n","import { TOperation } from './types';\r\n\r\nexport interface IToggleElementOperationData {\r\n selectedElement: JQuery;\r\n}\r\n\r\n/**\r\n * This operation toggles the visibility of the specified selected element\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const toggleElement: TOperation<IToggleElementOperationData> =\r\n function toggleElement(operationData: IToggleElementOperationData) {\r\n operationData.selectedElement.toggle();\r\n return operationData;\r\n };\r\n","import { internalResolve } from './helper/internal-resolve';\r\nimport { TOperation } from './types';\r\n\r\n/**\r\n * \r\n */\r\nexport interface IWaitOperationData {\r\n milliseconds: number;\r\n}\r\n\r\n/**\r\n * This operation waits for the specified amount of milliseconds.\r\n *\r\n * @param operationData\r\n * @returns\r\n */\r\nexport const wait: TOperation<IWaitOperationData> = function (\r\n operationData: IWaitOperationData\r\n) {\r\n const { milliseconds } = operationData;\r\n\r\n return new Promise((resolve) => {\r\n setTimeout(() => {\r\n internalResolve(resolve, operationData);\r\n }, milliseconds);\r\n });\r\n};\r\n","import $ from 'jquery';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { IResolvedEngineConfiguration } from '../configuration/types';\r\nimport { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { TResultCallback } from '../types';\r\nimport { ITimelineProvider } from './types';\r\n\r\nexport class JwPlayerTimelineProvider implements ITimelineProvider {\r\n private _paused: boolean = false;\r\n private _player: any = null;\r\n private _currentLoopHandler: Function | null = null;\r\n private _eventbusListeners: TEventbusRemover[] = [];\r\n private _playlist: any[] = [];\r\n private _videoElementId: string = uuidv4();\r\n\r\n loop = false;\r\n\r\n constructor(\r\n private eventbus: IEventbus,\r\n private config: IResolvedEngineConfiguration\r\n ) {\r\n this._addEventListeners();\r\n }\r\n\r\n _extractUrls(configuration: IResolvedEngineConfiguration) {\r\n const urls = configuration.timelines\r\n .filter((timeline) => timeline.type === 'mediaplayer')\r\n .map((timeline) => {\r\n return timeline.uri;\r\n });\r\n return urls;\r\n }\r\n\r\n init(): Promise<any> {\r\n const settings = this.config.timelineProviderSettings['mediaplayer'];\r\n if (!settings) {\r\n throw new Error(`No settings found for 'mediaplayer' timeline provider`);\r\n }\r\n const { selector } = settings;\r\n const urls = this._extractUrls(this.config);\r\n const jwp = (window as any).jwplayer;\r\n const p = $(`#${selector}`);\r\n if (!p.length) {\r\n throw new Error(`videoplayer selector '${selector}' not found`);\r\n }\r\n let w = p.innerWidth();\r\n let h = p.innerHeight();\r\n if (w === 0) {\r\n w = 100;\r\n }\r\n if (h === 0) {\r\n h = 300;\r\n }\r\n\r\n this._player = jwp(selector);\r\n this._player.setup({\r\n file: urls[0],\r\n image: settings.poster,\r\n height: h,\r\n width: w,\r\n controls: true,\r\n autostart: false,\r\n displaytitle: false,\r\n displaydescription: false,\r\n nextUpDisplay: false,\r\n abouttext: 'Eligius',\r\n aboutlink: 'http://www.google.com',\r\n stretching: 'fill',\r\n repeat: false,\r\n });\r\n this._playlist.length = 0;\r\n urls.forEach((url) => {\r\n const item = {\r\n file: url,\r\n title: url,\r\n image: settings.poster,\r\n };\r\n this._playlist.push(item);\r\n });\r\n const promise = new Promise((resolve) => {\r\n this._player.once('ready', () => {\r\n this._handlePlayerReady(resolve);\r\n });\r\n this._player.load(this._playlist);\r\n });\r\n return promise;\r\n }\r\n\r\n _handlePlayerReady(resolve: (value: any | PromiseLike<any>) => void) {\r\n this._player.once('firstFrame', () => {\r\n this._player.pause();\r\n this.eventbus.broadcast(TimelineEventNames.DURATION, [\r\n this.getDuration(),\r\n ]);\r\n resolve(this);\r\n });\r\n this._player.on(\r\n TimelineEventNames.TIME,\r\n this._loopHandler.bind(this, Math.floor)\r\n );\r\n this._player.on(TimelineEventNames.SEEKED, this._seekedHandler.bind(this));\r\n this._player.on(\r\n TimelineEventNames.COMPLETE,\r\n this._handlePlayerComplete.bind(this)\r\n );\r\n setTimeout(() => {\r\n this._player.play();\r\n }, 10);\r\n }\r\n\r\n _handlePlayerComplete() {\r\n if (!this.loop) {\r\n this.stop();\r\n this.eventbus.broadcast(TimelineEventNames.COMPLETE, [\r\n this._player.getPlaylistIndex(),\r\n ]);\r\n }\r\n }\r\n\r\n _seekedHandler() {\r\n this.eventbus.broadcast(TimelineEventNames.SEEKED, [\r\n this.getPosition(),\r\n this.getDuration(),\r\n ]);\r\n }\r\n\r\n destroy() {\r\n this._player.remove();\r\n this._eventbusListeners.forEach((func) => func());\r\n }\r\n\r\n _loopHandler(floor: (x: number) => number, jwplayerEvent: any) {\r\n const pos = floor(jwplayerEvent.position);\r\n if (this.loop && pos === floor(this._player.getDuration() - 1)) {\r\n this.seek(0);\r\n }\r\n }\r\n\r\n _timeResetLoopHandler() {\r\n if (this.loop) {\r\n this.seek(0);\r\n }\r\n }\r\n\r\n _addEventListeners() {\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.PLAY_TOGGLE_REQUEST,\r\n this.toggleplay.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.PLAY_REQUEST, this.start.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.STOP_REQUEST, this.stop.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.PAUSE_REQUEST, this.pause.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.SEEK_REQUEST, this.seek.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.RESIZE_REQUEST,\r\n this.resize.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.CONTAINER_REQUEST,\r\n this._container.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.DURATION_REQUEST,\r\n this.duration.bind(this)\r\n )\r\n );\r\n }\r\n\r\n _container(resultCallback: TResultCallback) {\r\n let suffix = '';\r\n if (this._player.getProvider().name !== 'html5') {\r\n suffix = '_wrapper';\r\n }\r\n const container = $(`#${this._videoElementId}${suffix}`);\r\n resultCallback(container);\r\n }\r\n\r\n toggleplay() {\r\n if (this._paused) {\r\n this.start();\r\n } else {\r\n this.pause();\r\n }\r\n }\r\n\r\n start() {\r\n this._paused = false;\r\n this._player.play();\r\n this.eventbus.broadcast(TimelineEventNames.PLAY);\r\n }\r\n\r\n stop() {\r\n this._paused = false;\r\n this._player.stop();\r\n this.eventbus.broadcast(TimelineEventNames.STOP);\r\n }\r\n\r\n pause() {\r\n this._paused = true;\r\n this._player.pause();\r\n this.eventbus.broadcast(TimelineEventNames.PAUSE);\r\n }\r\n\r\n seek(position: number) {\r\n const currentPosition = this._player.getPosition();\r\n this._player.seek(position);\r\n this.eventbus.broadcast(TimelineEventNames.SEEK, [\r\n position,\r\n currentPosition,\r\n this._player.getDuration(),\r\n ]);\r\n }\r\n\r\n resize(width: number, height: number) {\r\n this._player.resize(width, height);\r\n this.eventbus.broadcast(TimelineEventNames.RESIZE, [width, height]);\r\n }\r\n\r\n duration(resultCallback: TResultCallback) {\r\n resultCallback(Math.floor(this.getDuration()));\r\n }\r\n\r\n playlistItem(uri: string) {\r\n const index = this._playlist.findIndex((item) => item.file === uri);\r\n if (index > -1) {\r\n this._player.playlistItem(index);\r\n }\r\n }\r\n\r\n getPosition() {\r\n return this._player.getPosition();\r\n }\r\n\r\n getPlaylistIndex() {\r\n return this._player.getPlaylistIndex();\r\n }\r\n\r\n getState() {\r\n return this._player.getState();\r\n }\r\n\r\n getDuration() {\r\n return this._player.getDuration();\r\n }\r\n\r\n getMute() {\r\n return this._player.getMute();\r\n }\r\n\r\n getVolume() {\r\n return this._player.getVolume();\r\n }\r\n\r\n setMute(state: boolean) {\r\n this._player.setMute(state);\r\n }\r\n\r\n setVolume(volume: number) {\r\n this._player.setVolume(volume);\r\n }\r\n}\r\n","import $ from 'jquery';\r\nimport {\r\n IResolvedEngineConfiguration,\r\n IResolvedTimelineConfiguration,\r\n} from '../configuration/types';\r\nimport { IEventbus, TEventbusRemover } from '../eventbus/types';\r\nimport { TimelineEventNames } from '../timeline-event-names';\r\nimport { TResultCallback } from '../types';\r\nimport { animationInterval } from '../util/animation-interval';\r\nimport { ITimelineProvider } from './types';\r\n\r\ntype TUpdateMethod = (now: number) => void;\r\ntype TPlayState = 'stopped' | 'running' | 'paused';\r\n\r\nexport class RequestAnimationFrameTimelineProvider\r\n implements ITimelineProvider\r\n{\r\n private _currentPosition: number = 0;\r\n private _updateBound: TUpdateMethod = this._update.bind(this);\r\n private _eventbusListeners: TEventbusRemover[] = [];\r\n private _firstFrame = true;\r\n private _currentPlaylistItem: IResolvedTimelineConfiguration;\r\n private _tickInterval = 1000;\r\n private _playlist: IResolvedTimelineConfiguration[];\r\n private _containerElement: JQuery<HTMLElement> | undefined;\r\n private _abortController: AbortController | undefined;\r\n public playState: TPlayState = 'stopped';\r\n\r\n loop: boolean = false;\r\n\r\n constructor(\r\n private eventbus: IEventbus,\r\n private config: IResolvedEngineConfiguration\r\n ) {\r\n this.eventbus = eventbus;\r\n this.config = config;\r\n this._playlist = this._extractPlaylist(config);\r\n this._currentPlaylistItem = this._playlist[0];\r\n }\r\n\r\n private _extractPlaylist(\r\n configuration: IResolvedEngineConfiguration\r\n ): IResolvedTimelineConfiguration[] {\r\n const playlist = configuration.timelines.filter(\r\n (timeline) => timeline.type === 'animation'\r\n );\r\n return playlist;\r\n }\r\n\r\n playlistItem(uri: string): void {\r\n if (uri === null || !uri.length || this._playlist.length === 0) {\r\n return;\r\n }\r\n\r\n const item = this._playlist.find((item) => {\r\n return item.uri === uri;\r\n });\r\n\r\n if (!item) {\r\n throw new Error(`Unknown playlist uri: ${uri}`);\r\n }\r\n\r\n this._currentPlaylistItem = item;\r\n this._firstFrame = true;\r\n }\r\n\r\n private _addEventListeners() {\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.PLAY_TOGGLE_REQUEST,\r\n this.toggleplay.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.PLAY_REQUEST, this.start.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.STOP_REQUEST, this.stop.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.PAUSE_REQUEST, this.pause.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(TimelineEventNames.SEEK_REQUEST, this.seek.bind(this))\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.RESIZE_REQUEST,\r\n this._resize.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.CONTAINER_REQUEST,\r\n this._container.bind(this)\r\n )\r\n );\r\n this._eventbusListeners.push(\r\n this.eventbus.on(\r\n TimelineEventNames.DURATION_REQUEST,\r\n this.requestDurationHandler.bind(this)\r\n )\r\n );\r\n }\r\n\r\n private _update(_now: number): void {\r\n if (this.playState !== 'running') {\r\n return;\r\n }\r\n\r\n if (this._firstFrame) {\r\n this._firstFrame = false;\r\n this.eventbus.broadcast(TimelineEventNames.FIRST_FRAME);\r\n }\r\n\r\n this._currentPosition++;\r\n\r\n if (this._currentPosition > this._currentPlaylistItem.duration) {\r\n if (this.loop) {\r\n this._resetToStartPosition();\r\n this.eventbus.broadcast(TimelineEventNames.RESTART);\r\n } else {\r\n this.stop();\r\n this.eventbus.broadcast(TimelineEventNames.COMPLETE);\r\n return;\r\n }\r\n }\r\n\r\n this.eventbus.broadcast(TimelineEventNames.TIME, [\r\n { position: this._currentPosition },\r\n ]);\r\n this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [\r\n {\r\n position: this._currentPosition,\r\n duration: this._currentPlaylistItem.duration,\r\n },\r\n ]);\r\n }\r\n\r\n private _start() {\r\n if (this.playState === 'running') {\r\n return;\r\n }\r\n\r\n this.playState = 'running';\r\n this._abortController?.abort();\r\n this._abortController = new AbortController();\r\n\r\n animationInterval(\r\n this._tickInterval,\r\n this._abortController.signal,\r\n this._updateBound\r\n );\r\n }\r\n\r\n private _resetToStartPosition() {\r\n this._currentPosition = 0;\r\n }\r\n\r\n private _resize() {\r\n console.error('Not implemented yet');\r\n }\r\n\r\n private _container(callBack: TResultCallback) {\r\n callBack(this._containerElement);\r\n }\r\n\r\n private _stopAnimationInterval(resetPosition: boolean = true) {\r\n this._abortController?.abort();\r\n this._abortController = undefined;\r\n\r\n if (resetPosition) {\r\n this._resetToStartPosition();\r\n }\r\n }\r\n\r\n init(): Promise<any> {\r\n this._addEventListeners();\r\n this._currentPlaylistItem = this._playlist[0];\r\n this._containerElement = $(this._currentPlaylistItem.selector);\r\n\r\n if (!this._containerElement.length) {\r\n throw new Error(\r\n `timeline selector '${this._currentPlaylistItem.selector}' not found`\r\n );\r\n }\r\n\r\n const promise = new Promise<void>((resolve) => {\r\n resolve();\r\n });\r\n\r\n return promise;\r\n }\r\n\r\n destroy() {\r\n this.stop();\r\n this._eventbusListeners.forEach((func) => func());\r\n this._containerElement = undefined;\r\n }\r\n\r\n toggleplay() {\r\n if (this.playState !== 'running') {\r\n this.start();\r\n } else {\r\n this.pause();\r\n }\r\n }\r\n\r\n start() {\r\n this._start();\r\n this.eventbus.broadcast(TimelineEventNames.PLAY);\r\n }\r\n\r\n stop() {\r\n this._stopAnimationInterval();\r\n this.playState = 'stopped';\r\n this.eventbus.broadcast(TimelineEventNames.STOP);\r\n }\r\n\r\n pause() {\r\n this._stopAnimationInterval(false);\r\n this.playState = 'paused';\r\n this.eventbus.broadcast(TimelineEventNames.PAUSE);\r\n }\r\n\r\n seek(position: number) {\r\n if (position < 0 || position > this._currentPlaylistItem.duration) {\r\n return;\r\n }\r\n\r\n this.eventbus.broadcast(TimelineEventNames.SEEK, [\r\n position,\r\n this._currentPosition,\r\n this.getDuration(),\r\n ]);\r\n\r\n this._currentPosition = position;\r\n\r\n this.eventbus.broadcast(TimelineEventNames.SEEKED, [\r\n this._currentPosition,\r\n this.getDuration(),\r\n ]);\r\n this.eventbus.broadcast(TimelineEventNames.TIME, [\r\n { position: this.getPosition() },\r\n ]);\r\n this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [\r\n {\r\n position: this._currentPosition,\r\n duration: this._currentPlaylistItem.duration,\r\n },\r\n ]);\r\n }\r\n\r\n getPosition() {\r\n return this._currentPosition;\r\n }\r\n\r\n getDuration() {\r\n return this._currentPlaylistItem.duration;\r\n }\r\n\r\n requestDurationHandler(callBack: TResultCallback) {\r\n callBack(this._currentPlaylistItem.duration);\r\n }\r\n}\r\n","// https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95\r\nexport function animationInterval(\r\n ms: number,\r\n signal: AbortSignal,\r\n callback: (time: number) => void\r\n) {\r\n // Prefer currentTime, as it'll better sync animations queued in the\r\n // same frame, but if it isn't supported, performance.now() is fine.\r\n const start = document?.timeline?.currentTime ?? performance.now();\r\n\r\n function frame(time: number) {\r\n if (signal.aborted) return;\r\n callback(time);\r\n scheduleFrame(time);\r\n }\r\n\r\n function scheduleFrame(time: number) {\r\n const elapsed = time - start;\r\n const roundedElapsed = Math.round(elapsed / ms) * ms;\r\n const targetNext = start + roundedElapsed + ms;\r\n const delay = targetNext - performance.now();\r\n setTimeout(() => requestAnimationFrame(frame), delay);\r\n }\r\n\r\n scheduleFrame(start);\r\n}\r\n","import * as ctrls from '../controllers';\r\nimport { EligiusEngine } from '../eligius-engine';\r\nimport * as evtb from '../eventbus';\r\nimport * as ops from '../operation';\r\nimport { TOperation } from '../operation/types';\r\nimport * as prvdrs from '../timelineproviders';\r\nimport { IResourceImporter } from '../types';\r\n\r\nconst operations: Record<string, TOperation<any>> = ops as any;\r\nconst controllers: Record<string, any> = ctrls;\r\nconst providers: Record<string, any> = prvdrs;\r\nconst eventbus: Record<string, any> = evtb;\r\n\r\nexport class EligiusResourceImporter implements IResourceImporter {\r\n engines = new Map();\r\n constructor() {\r\n this.engines.set('EligiusEngine', EligiusEngine);\r\n }\r\n\r\n getOperationNames(): string[] {\r\n return Object.keys(operations);\r\n }\r\n\r\n getControllerNames(): string[] {\r\n return Object.keys(controllers);\r\n }\r\n\r\n getProviderNames(): string[] {\r\n return Object.keys(providers);\r\n }\r\n\r\n import(name: string): Record<string, any> {\r\n const value =\r\n operations[name] ??\r\n controllers[name] ??\r\n providers[name] ??\r\n eventbus[name] ??\r\n this.engines.get(name);\r\n\r\n return { [name]: value };\r\n }\r\n}\r\n","import { IAddClassOperationData } from '../../operation/add-class';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction addClass(): IOperationMetadata<IAddClassOperationData> {\r\n return {\r\n description: 'Add a class to the selected element.',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n className: {\r\n type: 'ParameterType:className',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default addClass;\r\n","import { IAddControllerToElementOperationData } from '../../operation/add-controller-to-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction addControllerToElement(): IOperationMetadata<\r\n IAddControllerToElementOperationData\r\n> {\r\n return {\r\n description: 'Adds the current controller to the selected element(s)',\r\n dependentProperties: ['selectedElement', 'controllerInstance'],\r\n };\r\n}\r\nexport default addControllerToElement;\r\n","import { IAnimateOperationData } from '../../operation/animate';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction animate(): IOperationMetadata<IAnimateOperationData> {\r\n return {\r\n description:\r\n 'Animates the selected element with the given animation settings.',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n animationEasing: 'ParameterType:boolean',\r\n animationProperties: {\r\n type: 'ParameterType:object',\r\n required: true,\r\n },\r\n animationDuration: {\r\n type: 'ParameterType:integer',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default animate;\r\n","import { IAnimateWithClassOperationData } from '../../operation/animate-with-class';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction animateWithClass(): IOperationMetadata<\r\n IAnimateWithClassOperationData\r\n> {\r\n return {\r\n description:\r\n 'Animates the selected element by adding the given animation class.',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n className: {\r\n type: 'ParameterType:className',\r\n required: true,\r\n },\r\n removeClass: 'ParameterType:boolean',\r\n },\r\n };\r\n}\r\nexport default animateWithClass;\r\n","import { IBroadcastEventOperationData } from '../../operation/broadcast-event';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData> {\r\n return {\r\n description:\r\n 'Broadcasts an eventbus event with the given type, topic and optional arguments',\r\n properties: {\r\n eventArgs: 'ParameterType:array',\r\n eventTopic: 'ParameterType:eventTopic',\r\n eventName: {\r\n type: 'ParameterType:eventName',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default broadcastEvent;\r\n","import { ICalcOperationData } from '../calc';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction calc(): IOperationMetadata<ICalcOperationData> {\r\n return {\r\n description: 'clears the given element',\r\n properties: {\r\n left: {\r\n type: 'ParameterType:integer',\r\n description: 'The left operand',\r\n required: true,\r\n },\r\n right: {\r\n type: 'ParameterType:integer',\r\n description: 'The right operand',\r\n required: true,\r\n },\r\n operator: [\r\n {\r\n value: '+',\r\n description: 'Adds the left and right operands',\r\n },\r\n {\r\n value: '-',\r\n description: 'Subtracts the left and right operands',\r\n },\r\n {\r\n value: '*',\r\n description: 'Multiplies the left and right operands',\r\n },\r\n {\r\n value: '/',\r\n description: 'Divides the left and right operands',\r\n },\r\n {\r\n value: '%',\r\n description:\r\n 'Returns the remainder left over after the left number is divided into a number of integer portions equal to the right number',\r\n },\r\n {\r\n value: '**',\r\n description:\r\n 'Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times.',\r\n },\r\n ],\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'calculationResult',\r\n },\r\n },\r\n /*outputProperties: {\r\n propertyName: {\r\n type: 'ParameterType:integer',\r\n },\r\n },*/\r\n };\r\n}\r\n\r\nexport default calc;\r\n","import { IClearElementOperationData } from '../../operation/clear-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction clearElement(): IOperationMetadata<IClearElementOperationData> {\r\n return {\r\n description: 'clears the given element',\r\n dependentProperties: ['selectedElement'],\r\n };\r\n}\r\n\r\nexport default clearElement;\r\n","import { IClearOperationDataOperationData } from '../../operation/clear-operation-data';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction clearOperationData(): IOperationMetadata<\r\n IClearOperationDataOperationData\r\n> {\r\n return {\r\n description: 'clears the current operation data',\r\n properties: {\r\n properties: 'ParameterType:array',\r\n },\r\n };\r\n}\r\nexport default clearOperationData;\r\n","import { ICreateElementOperationData } from '../../operation/create-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction createElement(): IOperationMetadata<ICreateElementOperationData<any>> {\r\n return {\r\n description:\r\n 'Creates an HTML element with the given name and optionally adds the given attributes',\r\n properties: {\r\n elementName: {\r\n type: 'ParameterType:htmlElementName',\r\n required: true,\r\n },\r\n attributes: 'ParameterType:object',\r\n text: 'ParameterType:string',\r\n },\r\n outputProperties: {\r\n template: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default createElement;\r\n","import { ICustomFunctionOperationData } from '../../operation/custom-function';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction customFunction(): IOperationMetadata<ICustomFunctionOperationData> {\r\n return {\r\n description: 'Executes the specified custom function',\r\n properties: {\r\n systemName: {\r\n type: 'ParameterType:systemName',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default customFunction;\r\n","import { IEndActionOperationData } from '../../operation/end-action';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction endAction(): IOperationMetadata<IEndActionOperationData> {\r\n return {\r\n description: 'Ends the current action',\r\n dependentProperties: ['actionInstance'],\r\n properties: {\r\n actionOperationData: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default endAction;\r\n","import { IOperationMetadata } from './types';\r\n\r\nfunction endLoop(): IOperationMetadata<never> {\r\n return {\r\n description: 'Ends the current loop',\r\n };\r\n}\r\n\r\nexport default endLoop;\r\n","import { IExtendControllerOperationData } from '../../operation/extend-controller';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction extendController(): IOperationMetadata<\r\n IExtendControllerOperationData\r\n> {\r\n return {\r\n description: 'Extends the current controller',\r\n dependentProperties: ['controllerInstance'],\r\n properties: {\r\n controllerExtension: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default extendController;\r\n","import { IGetControllerFromElementOperationData } from '../../operation/get-controller-from-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction getControllerFromElement(): IOperationMetadata<\r\n IGetControllerFromElementOperationData\r\n> {\r\n return {\r\n description: 'Retrieves the specified controller from the current element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n controllerName: {\r\n type: 'ParameterType:controllerName',\r\n required: true,\r\n },\r\n },\r\n outputProperties: {\r\n controllerInstance: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default getControllerFromElement;\r\n","import { IGetControllerInstanceOperationData } from '../../operation/get-controller-instance';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction getControllerInstance(): IOperationMetadata<\r\n IGetControllerInstanceOperationData\r\n> {\r\n return {\r\n description: 'Retrieves an instance of the specified controller',\r\n properties: {\r\n systemName: {\r\n type: 'ParameterType:controllerName',\r\n required: true,\r\n },\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'controllerInstance',\r\n },\r\n },\r\n outputProperties: {\r\n controllerInstance: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default getControllerInstance;\r\n","import { IGetElementDimensionsOperationData } from '../../operation/get-element-dimensions';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction getElementDimensions(): IOperationMetadata<\r\n IGetElementDimensionsOperationData\r\n> {\r\n return {\r\n description: 'Calculates the dimensions for the current element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n modifier: 'ParameterType:dimensionsModifier',\r\n },\r\n outputProperties: {\r\n dimensions: 'ParameterType:dimensions',\r\n },\r\n };\r\n}\r\nexport default getElementDimensions;\r\n","import { IGetImportOperationData } from '../../operation/get-import';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction getImport(): IOperationMetadata<IGetImportOperationData> {\r\n return {\r\n description:\r\n 'Retrieves a javascript import specified by the given system name',\r\n properties: {\r\n systemName: {\r\n type: 'ParameterType:systemName',\r\n required: true,\r\n },\r\n },\r\n outputProperties: {\r\n importedInstance: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default getImport;\r\n","import { ILoadJSONOperationData } from '../../operation/load-json';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction loadJSON(): IOperationMetadata<ILoadJSONOperationData> {\r\n return {\r\n description: 'Load JSON from the given url',\r\n properties: {\r\n url: {\r\n type: 'ParameterType:url',\r\n required: true,\r\n },\r\n cache: 'ParameterType:boolean',\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'json',\r\n },\r\n },\r\n outputProperties: {\r\n json: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default loadJSON;\r\n","import { IOperationMetadata } from './types';\r\n\r\nfunction log(): IOperationMetadata<never> {\r\n return {\r\n description: 'Logs the current context and operation data to the console',\r\n };\r\n}\r\n\r\nexport default log;\r\n","import { IMathOperationData } from '../math';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction math(): IOperationMetadata<IMathOperationData> {\r\n return {\r\n description:\r\n 'This operation performs the given math function of the specified arguments.',\r\n properties: {\r\n args: {\r\n type: 'ParameterType:array',\r\n required: true,\r\n },\r\n functionName: createMathFunctionNames(),\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'mathResult',\r\n },\r\n },\r\n };\r\n}\r\n\r\nfunction createMathFunctionNames() {\r\n return Object.getOwnPropertyNames(Math)\r\n .filter((x) => typeof Math[x as keyof Math] === 'function')\r\n .map((functionName) => ({\r\n value: functionName,\r\n }));\r\n}\r\n\r\nexport default math;\r\n","import { IRemoveClassOperationData } from '../../operation/remove-class';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction removeClass(): IOperationMetadata<IRemoveClassOperationData> {\r\n return {\r\n description: 'Removes the specified class from the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n className: {\r\n type: 'ParameterType:className',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport default removeClass;\r\n","import { IRemoveControllerFromElementOperationData } from '../../operation/remove-controller-from-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction removeControllerFromElement(): IOperationMetadata<\r\n IRemoveControllerFromElementOperationData\r\n> {\r\n return {\r\n description: 'Removes the specified controller from the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n controllerName: {\r\n type: 'ParameterType:controllerName',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport default removeControllerFromElement;\r\n","import { IRemoveElementOperationData } from '../../operation/remove-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction removeElement(): IOperationMetadata<IRemoveElementOperationData> {\r\n return {\r\n description: 'Removes the selected element from the DOM',\r\n dependentProperties: ['selectedElement'],\r\n };\r\n}\r\nexport default removeElement;\r\n","import { IRemovePropertiesFromOperationDataOperationData } from '../../operation/remove-properties-from-operation-data';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction removePropertiesFromOperationData(): IOperationMetadata<\r\n IRemovePropertiesFromOperationDataOperationData\r\n> {\r\n return {\r\n description:\r\n 'Removes the specified properties from the current operation data',\r\n properties: {\r\n propertyNames: 'ParameterType:array',\r\n },\r\n };\r\n}\r\nexport default removePropertiesFromOperationData;\r\n","import { IReparentElementOperationData } from '../../operation/reparent-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction reparentElement(): IOperationMetadata<IReparentElementOperationData> {\r\n return {\r\n description:\r\n 'Moves the selected element to the new location described by the given selector',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n newParentSelector: {\r\n type: 'ParameterType:selector',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default reparentElement;\r\n","import { IRequestActionOperationData } from '../../operation/request-action';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction requestAction(): IOperationMetadata<IRequestActionOperationData> {\r\n return {\r\n description: 'Retrieves an instance of the specified action',\r\n properties: {\r\n systemName: {\r\n type: 'ParameterType:actionName',\r\n required: true,\r\n },\r\n },\r\n outputProperties: {\r\n actionInstance: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default requestAction;\r\n","import { IResizeActionOperationData } from '../../operation/resize-action';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction resizeAction(): IOperationMetadata<IResizeActionOperationData> {\r\n return {\r\n description: 'Triggers a resize on the current action',\r\n dependentProperties: ['actionInstance'],\r\n properties: {\r\n actionOperationData: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default resizeAction;\r\n","import { ISelectElementOperationData } from '../../operation/select-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction selectElement(): IOperationMetadata<ISelectElementOperationData> {\r\n return {\r\n description: 'Selects an element using the given selector',\r\n properties: {\r\n selector: {\r\n type: 'ParameterType:selector',\r\n required: true,\r\n },\r\n propertyName: 'ParameterType:string',\r\n useSelectedElementAsRoot: 'ParameterType:boolean',\r\n },\r\n outputProperties: {\r\n selectedElement: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default selectElement;\r\n","import { ISetElementAttributesOperationData } from '../../operation/set-element-attributes';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction setElementAttributes(): IOperationMetadata<\r\n ISetElementAttributesOperationData\r\n> {\r\n return {\r\n description: 'Sets the given attributes on the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n attributes: {\r\n type: 'ParameterType:object',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default setElementAttributes;\r\n","import { ISetElementContentOperationData } from '../../operation/set-element-content';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction setElementContent(): IOperationMetadata<\r\n ISetElementContentOperationData\r\n> {\r\n return {\r\n description: 'Sets the given HTML content in the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n insertionType: [\r\n {\r\n value: 'overwrite',\r\n description:\r\n 'the contents of the selected element are replaced by the given template',\r\n default: true,\r\n },\r\n {\r\n value: 'append',\r\n description:\r\n 'the new content will be inserted after the current content',\r\n },\r\n {\r\n value: 'prepend',\r\n description:\r\n 'the new content will be inserted before the current content',\r\n },\r\n ],\r\n template: {\r\n type: 'ParameterType:htmlContent',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default setElementContent;\r\n","import { ISetOperationData } from '../../operation/set-operation-data';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction setOperationData(): IOperationMetadata<ISetOperationData> {\r\n return {\r\n description: 'Sets the given properties on the current operation data',\r\n properties: {\r\n properties: {\r\n type: 'ParameterType:object',\r\n required: true,\r\n },\r\n override: 'ParameterType:boolean',\r\n },\r\n };\r\n}\r\nexport default setOperationData;\r\n","import { ISetStyleOperationData } from '../../operation/set-style';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction setStyle(): IOperationMetadata<ISetStyleOperationData> {\r\n return {\r\n description: 'Sets the given style properties on the selected element',\r\n properties: {\r\n properties: {\r\n type: 'ParameterType:object',\r\n required: true,\r\n },\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n required: false,\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport default setStyle;\r\n","import { IStartActionOperationData } from '../../operation/start-action';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction startAction(): IOperationMetadata<IStartActionOperationData> {\r\n return {\r\n description: 'Starts the selected action',\r\n dependentProperties: ['actionInstance'],\r\n properties: {\r\n actionOperationData: 'ParameterType:object',\r\n },\r\n };\r\n}\r\nexport default startAction;\r\n","import { TStartLoopOperationData } from '../../operation/start-loop';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction startLoop(): IOperationMetadata<TStartLoopOperationData> {\r\n return {\r\n description: 'Starts a loop over the given collection',\r\n properties: {\r\n collection: {\r\n type: 'ParameterType:array',\r\n required: true,\r\n },\r\n propertyName: {\r\n type: 'ParameterType:string',\r\n defaultValue: 'currentItem',\r\n },\r\n },\r\n };\r\n}\r\n\r\nexport default startLoop;\r\n","import { IToggleClassOperationData } from '../../operation/toggle-class';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction toggleClass(): IOperationMetadata<IToggleClassOperationData> {\r\n return {\r\n description: 'Toggles the given class on the selected element',\r\n dependentProperties: ['selectedElement'],\r\n properties: {\r\n className: {\r\n type: 'ParameterType:className',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default toggleClass;\r\n","import { IToggleElementOperationData } from '../../operation/toggle-element';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction toggleElement(): IOperationMetadata<IToggleElementOperationData> {\r\n return {\r\n description: 'Toggles the selected element',\r\n dependentProperties: ['selectedElement'],\r\n };\r\n}\r\nexport default toggleElement;\r\n","import { IWaitOperationData } from '../../operation/wait';\r\nimport { IOperationMetadata } from './types';\r\n\r\nfunction wait(): IOperationMetadata<IWaitOperationData> {\r\n return {\r\n description:\r\n 'Waits the given amount of milliseconds before the action continues',\r\n properties: {\r\n milliseconds: {\r\n type: 'ParameterType:integer',\r\n required: true,\r\n },\r\n },\r\n };\r\n}\r\nexport default wait;\r\n","export type TDevToolsEventSubscriber = (event: TEventData) => void;\r\n\r\nexport type TPlayControlEventKind = 'play' | 'stop' | 'pause' | 'seek';\r\nexport const DEV_TOOLS_KEY = '__ELIGIUS_DEV_TOOLS__';\r\n\r\nexport type TWindowWithDevtools = Window & {\r\n [DEV_TOOLS_KEY]: IDiagnosticsInfo | undefined;\r\n};\r\n\r\nexport type TDevToolsMessage = {\r\n source: 'eligius-inspect-devtools';\r\n name: 'event';\r\n data: TEventData;\r\n};\r\n\r\nexport type TEventData = {\r\n type: 'playcontrol';\r\n data: IPlayControlEvent;\r\n};\r\n\r\nexport interface IPlayControlEvent {\r\n kind: TPlayControlEventKind;\r\n args?: any[];\r\n}\r\n\r\nexport interface IDiagnosticsAgent {\r\n postMessage(name: TDiagnosticType, messageData: any): void;\r\n subscribe(subscriber: TDevToolsEventSubscriber): () => void;\r\n}\r\n\r\nexport interface IDiagnosticsInfo {\r\n get agent(): IDiagnosticsAgent;\r\n}\r\n\r\nexport type TDiagnosticType =\r\n | 'eligius-diagnostics-factory'\r\n | 'eligius-diagnostics-engine'\r\n | 'eligius-diagnostics-event'\r\n | 'eligius-diagnostics-action'\r\n | 'eligius-diagnostics-action-error'\r\n | 'eligius-diagnostics-operation';\r\n\r\nexport type TDiagnosticsMessageSource =\r\n | 'eligius-inspect-agent'\r\n | 'eligius-inspect-devtools';\r\n","export default function dashToCamelCase(input: string) {\r\n return input.replace(/-([a-z])/g, g => g[1].toUpperCase());\r\n}\r\n"],"names":["prepareValueForSerialization","value","Array","isArray","map","jQuery","Object","fromEntries","entries","funcString","toString","indexOf","substring","DevToolEventListener","agent","this","handleEvent","eventName","eventTopic","args","message","postMessage","e","console","error","log","Diagnostics","send","_name","_data","active","copyFunction","structuredClone","original","JSON","parse","stringify","deepCopy","isDefined","Action","name","startOperations","eventbus","id","_proto","start","initOperationData","context","currentIndex","result","Promise","resolve","reject","_this","executeOperation","then","operationsResult","operations","idx","previousOperationData","obj","undefined","newIndex","skipNextOperation","length","operationInfo","copy","operationData","mergedOperationData","assign","systemName","operationResult","instance","call","promisedOperationResult","_this2","EndableAction","endOperations","eventBus","_inheritsLoose","end","TimelineAction","duration","_gatherControllerImportPathsFromActions","actionsConfig","operationConfigs","flatMap","x","filter","operationConfig","_operationConfig$oper","hasOwnProperty","endsWith","_gatherOperationImportPathsFromActions","dedupe","importPaths","lookup","imp","getNestedValue","properties","sourceObject","Error","currentInstance","suffix","forEach","prop","index","parts","split","ConfigurationResolver","importer","process","configuration","actionRegistryListener","resolvePlaceholders","timelineProviderSettings","resolvedConfig","engine","containerSelector","language","layoutTemplate","availableLanguages","actions","resolveActions","initActions","labels","timelineFlow","timelines","resolveTimelines","eventActions","eventActionConfigurations","config","resolveActionConfiguration","eventAction","registerAction","resolveEventActions","concat","reduce","aggr","action","resolveTimelineAction","bind","timelineActions","resolveOperation","resolveEndableActionConfiguration","actionConfiguration","actionConfigurations","configFragment","rootConfig","item","keys","key","configValue","startsWith","configProperty","templateKey","template","jsonKey","json","resolvePlaceholder","TimelineEventNames","PLAY_TOGGLE_REQUEST","PLAY_REQUEST","STOP_REQUEST","PAUSE_REQUEST","SEEK_REQUEST","RESIZE_REQUEST","CONTAINER_REQUEST","DURATION_REQUEST","REQUEST_CURRENT_TIMELINE","DURATION","TIME","SEEKED","COMPLETE","RESTART","PLAY","STOP","PAUSE","SEEK","RESIZE","POSITION_UPDATE","TIME_UPDATE","CURRENT_TIMELINE_CHANGE","FIRST_FRAME","REQUEST_INSTANCE","REQUEST_ACTION","REQUEST_FUNCTION","REQUEST_TIMELINE_URI","BEFORE_REQUEST_TIMELINE_URI","REQUEST_ENGINE_ROOT","REQUEST_CURRENT_TIMELINE_POSITION","REQUEST_TIMELINE_CLEANUP","EXECUTE_TIMELINEACTION","RESIZE_TIMELINEACTION","REQUEST_LABEL_COLLECTION","REQUEST_LABEL_COLLECTIONS","REQUEST_CURRENT_LANGUAGE","LANGUAGE_CHANGE","EventListenerController","actionInstanceInfos","init","selectedElement","slice","actionOperationData","attach","actionName","isStart","_isStartAction","broadcast","actionInstance","push","on","_eventHandler","substr","event","target","targetValue","_executeAction","_context","actionInfo","method","detach","_eventbus","off","LabelController","listeners","currentLanguage","labelData","labelId","labelCollection","createTextDataLookup","setLabel","handleLanguageChange","html","func","code","data","d","languageCode","label","LottieController","animationItem","serializedData","serializedIEData","freezePosition","endPosition","renderer","loop","autoplay","animationData","labelIds","viewBox","iefallback","url","parseFilename","setting","values","resultHolder","labelCollections","createAnimation","addEventListener","destroy","playSegments","serialized","isIE","join","lottie","loadAnimation","container","rendererSettings","timeCompleted","find","attr","infos","_this3","window","document","NavigationController","navigation","navLookup","navVidIdLookup","ctrlLookup","activeNavigationPoint","labelControllers","eventhandlers","buildNavigationData","handleNavigateVideoUrl","highlightMenu","handleRequestCurrentNavigation","handleVideoComplete","buildHtml","initHistory","navId","getQueryVariable","videoIndex","videoUrlIndex","variableIdx","href","location","hashIndex","query","resultCallback","labelCtrl","navigationData","title","handler","ctrl","onpopstate","pushCurrentState","position","state","parentElm","ul","$","addNavElement","append","visible","li","a","addLabel","addClickHandler","children","mouseup","menuMouseupHandler","navdata","requestedVideoPosition","navElm","removeClass","addClass","navData","autoNext","next","nav","previous","nextId","roots","childId","ProgressbarController","textElement","detachers","positionUpdateHandler","clickHandler","_this$selectedElement2","percentage","css","text","Math","floor","RoutingController","handleBeforeRequestVideoUrl","handlePushHistoryState","handlePopstate","pos","history","pushState","navigationId","_event$state","_index","_requestedVideoPosition","isHistoryRequest","currentPosition","currentState","replaceState","SubtitlesController","actionLookup","lastFunc","detachTime","onTimeHandler","detachSeek","onSeekedHandler","detachLangChange","languageChangeHandler","internalDetach","detachMethods","f","newLanguage","removeTitle","empty","arg","setTitle","titleLanguageLookup","createActionLookup","subtitleData","titles","subtitleTimeLookup","i","ii","j","jj","subs","lang","EligiusEngine","timelineProviders","languageManager","_timeLineActionsLookup","_eventbusRemovers","_currentTimelineUri","_activeTimelineProvider","_lastPosition","_createLayoutTemplate","_addInitialisationListeners","uri","_createTimelineLookup","_initializeTimelineProvider","warn","_this$configuration$t","firstTimeline","providerSettings","type","provider","_executeActions","_cleanUp","_context2","_cleanUpTimeline","_context3","remover","providerInfo","_addEventListener","eventHandler","_handleRequestEngineRoot","_handleRequestTimelineUri","_handleRequestTimelinePosition","_handleTimelineComplete","_handleExecuteTimelineAction","_resizeTimelineAction","_requestCurrentTimeline","_onTimeHandler","_onSeekHandler","timelineInfo","_addTimelineAction","timeLineAction","startPosition","timelineStartPositions","_initializeTimelinePosition","_initializeUriLookup","startMethod","_timeLineAction$id","Infinity","isFinite","timelineEndPositions","endMethod","_timeLineAction$id2","methodName","_context4","engineRootSelector","previousVideoPosition","_context5","stop","timelineConfig","timeline","newProviderSettings","once","pause","getDuration","_executeStartActions","seek","offset","playlistItem","_executeRelevantActions","_getActiveActions","_getActionsForPosition","allActions","sort","b","executionType","_getRelevantTimelineActions","currentActions","apply","getPosition","_getTimelineActionsForUri","info","isNaN","_executeActionsForPosition","_this$_activeTimeline3","_this$_activeTimeline4","_executeSeekActions","executions","exec","newActions","promise","_this5","ActionRegistryEventbusListener","_actionRegistry","Map","has","set","get","eventArgs","Eventbus","eventHandlers","eventInterceptors","eventListeners","clear","_getEventInterceptors","_getEventHandlers","eventHandlerDecorator","handlers","splice","_callHandlers","broadcastForTopic","registerEventlistener","eventbusListener","registerInterceptor","interceptor","interceptors","intercept","listener","_args","RequestVideoUriInterceptor","LanguageManager","_currentLanguage","_labelLookup","_setRootElementLang","_createLabelLookup","_addEventbusListeners","_handleRequestLabelCollection","_handleRequestLabelCollections","_handleRequestCurrentLanguage","_handleLanguageChange","rootSelector","_extractLanguageFromCulture","culture","shift","acc","EngineFactory","windowRef","options","_actionsLookup","_eventRemovers","_importer","_resizeTimeout","devtools","_initializeDevtools","_requestInstanceHandler","_requestActionHandler","_requestFunctionHandler","handleSpaceBound","_handleSpacePress","hotkeys","unbind","resizeBound","_resizeHandler","jqWin","keyboardEvent","_hotkeysEvent","preventDefault","diagnosticInfo","subscribe","kind","messageData","DEV_TOOLS_KEY","clearTimeout","setTimeout","_importSystemEntryWithEventbusDependency","_importSystemEntry","createEngine","resolver","EngineClass","_configuration$eventA","resolvedConfiguration","_createTimelineProviders","timelineType","settings","timelineProviderClass","vendor","className","getElementControllers","element","mergeOperationData","newOperationData","internalResolve","addControllerToElement","controllerInstance","controller","controllers","attachControllerToElement","animate","animationEasing","animationProperties","animationDuration","animateWithClass","one","extractOperationDataArgumentValues","argumentValue","toLowerCase","propNames","broadcastEvent","eventArguments","extract","resolveEventArguments","removeEventDataFromOperationData","cache","resolvePropertyValues","resolveProperties","arr","calcFunctions","left","right","calc","propertyName","operator","clearElement","clearOperationData","createElement","elementName","attributes","serializedAttrs","customFunction","endAction","endLoop","loopIndex","loopLength","startIndex","extendController","controllerExtension","getControllerFromElement","controllerName","getControllerInstance","getElementDimensions","modifier","dimensions","width","innerWidth","height","innerHeight","clonedDimensions","ratioModifier","prefix","isPercent","_getModifierSuffix","parseInt","widthModifier","heightModifier","modifiedDimension","_modifyDimensions","modifiedDimensions","ratio","ratios","Boolean","_modifyDimensionsByRatio","modifyDimensions","getImport","importedInstance","jsonCache","loadJSON","fetch","response","cacheValue","group","dir","groupEnd","math","functionName","removeControllerFromElement","removeElement","remove","removePropertiesFromOperationData","propertyNames","reparentElement","newParentSelector","appendTo","requestAction","resizeAction","resize","findElementBySelector","root","selector","selectElement","useSelectedElementAsRoot","setElementAttributes","setElementContent","insertionType","prepend","setOperationData","override","resolvedProperties","setStyle","startAction","startLoop","collection","toggleClass","toggleElement","toggle","wait","milliseconds","JwPlayerTimelineProvider","_paused","_player","_currentLoopHandler","_eventbusListeners","_playlist","_videoElementId","uuidv4","_addEventListeners","_extractUrls","urls","jwp","jwplayer","p","w","h","setup","file","image","poster","controls","autostart","displaytitle","displaydescription","nextUpDisplay","abouttext","aboutlink","stretching","repeat","_handlePlayerReady","load","_loopHandler","_seekedHandler","_handlePlayerComplete","play","getPlaylistIndex","jwplayerEvent","_timeResetLoopHandler","toggleplay","_container","getProvider","findIndex","getState","getMute","getVolume","setMute","setVolume","volume","RequestAnimationFrameTimelineProvider","_currentPosition","_updateBound","_update","_firstFrame","_currentPlaylistItem","_tickInterval","_containerElement","_abortController","playState","_extractPlaylist","_resize","requestDurationHandler","_now","_resetToStartPosition","_start","abort","AbortController","ms","signal","callback","_document","_document$timeline","currentTime","performance","now","frame","time","aborted","scheduleFrame","roundedElapsed","round","delay","requestAnimationFrame","animationInterval","callBack","_stopAnimationInterval","resetPosition","ops","ctrls","providers","evtb","EligiusResourceImporter","engines","getOperationNames","getControllerNames","getProviderNames","description","dependentProperties","required","defaultValue","outputProperties","getOwnPropertyNames","default","configPath","assetInfo","_gatherOperations","extension","fs","readdirSync","path","subdir","basename","replace","g","toUpperCase","defaultImport","_gatherControllers","_gatherProviders","_gatherEngines","_gatherImportPaths","importerSourceCode","_generateSourceCode"],"mappings":"63OAEgBA,EAA6BC,GAC3C,GAAIC,MAAMC,QAAQF,GAChB,OAAQA,EAAqBG,IAAIJ,GAC5B,GAAIC,aAAiBI,UAC1B,MAAO,gBACF,GAAc,OAAVJ,GAAmC,iBAAVA,EAClC,OAAOK,OAAOC,YACZD,OAAOE,QAAQP,GAAOG,KAAI,YAAA,MAA2B,MAEnDJ,aAGC,GAAqB,mBAAVC,EAAsB,CACtC,IAAMQ,EAAqBR,EAAMS,WAEjC,OADmBD,EAAWE,QAAQ,MACpB,EACTF,EAAWG,UAAU,EAAGH,EAAWE,QAAQ,KAAO,GAEpDF,EAET,OAAOR,MClBIY,aACX,WAAoBC,QAAAA,aAAAC,WAAAD,EADtB,mBAGEE,YAAA,SACEC,EACAC,EACAC,GAEA,IAAMC,EAAU,CACdH,UAAAA,EACAC,WAAAA,EACAC,KAAMnB,EAA6BmB,IAErC,IACEJ,KAAKD,MAAMO,YAAY,4BAA6BD,GACpD,MAAOE,GACPC,QAAQC,MAAM,sBACdD,QAAQC,MAAMF,GACdC,QAAQE,IAAI,UAAWL,UCpBhBM,aAAb,cAAA,OAAAA,EACSC,KAAP,SAAYC,EAAwBC,GAClCN,QAAQE,IAAIG,EAAOC,SAFVH,EAIJI,kBCJHC,EACuB,oBAApBC,gBACHA,gBACA,SAACC,GAAD,OAAmBC,KAAKC,MAAMD,KAAKE,UAAUH,cAEnCI,EAAYJ,GAC1B,OAAIK,YAAUL,GACLF,EAAaE,GAEfA,MCCIM,aAGX,WACSC,EACAC,EACGC,QAFHF,iBACAC,4BACGC,qBALLC,GAAK,GAGH5B,UAAAyB,EACAzB,qBAAA0B,EACG1B,cAAA2B,EANd,kBAAA,OAAAE,EASEC,MAAA,SAAMC,gBACJpB,EAAYI,QACVJ,EAAYC,KACV,uCACGZ,KAAKyB,QAAQ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