eligius 4.0.0 → 4.1.0

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":"configuration-api.mjs","names":["isPlainObject","isPlainObject","operationMetadata","uuidv4","uuidv4","uuidv4","operationMetadata","controllerMetadata","uuidv4","uuidv4"],"sources":["../src/util/guards/is-plain-object.ts","../src/operation/helper/deep-copy.ts","../src/operation/metadata/add-class.ts","../src/operation/metadata/add-controller-to-element.ts","../src/operation/metadata/add-globals-to-operation.ts","../src/operation/metadata/animate-with-class.ts","../src/operation/metadata/animate.ts","../src/operation/metadata/announce-to-screen-reader.ts","../src/operation/metadata/break-for-each.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/clear-storage.ts","../src/operation/metadata/compare-date.ts","../src/operation/metadata/concatenate-strings.ts","../src/operation/metadata/continue-for-each.ts","../src/operation/metadata/create-element.ts","../src/operation/metadata/custom-function.ts","../src/operation/metadata/end-action.ts","../src/operation/metadata/end-for-each.ts","../src/operation/metadata/end-when.ts","../src/operation/metadata/extend-controller.ts","../src/operation/metadata/filter-array.ts","../src/operation/metadata/find-in-array.ts","../src/operation/metadata/for-each.ts","../src/operation/metadata/format-date.ts","../src/operation/metadata/format-text.ts","../src/operation/metadata/get-attributes-from-element.ts","../src/operation/metadata/get-controller-from-element.ts","../src/operation/metadata/get-controller-instance.ts","../src/operation/metadata/get-current-time.ts","../src/operation/metadata/get-element-dimensions.ts","../src/operation/metadata/get-focused-element.ts","../src/operation/metadata/get-form-data.ts","../src/operation/metadata/get-import.ts","../src/operation/metadata/get-query-params.ts","../src/operation/metadata/get-scroll-position.ts","../src/operation/metadata/get-text-content.ts","../src/operation/metadata/http-delete.ts","../src/operation/metadata/http-post.ts","../src/operation/metadata/http-put.ts","../src/operation/metadata/invoke-object-method.ts","../src/operation/metadata/is-element-in-viewport.ts","../src/operation/metadata/load-from-storage.ts","../src/operation/metadata/load-json.ts","../src/operation/metadata/log.ts","../src/operation/metadata/map-array.ts","../src/operation/metadata/math.ts","../src/operation/metadata/otherwise.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/replace-string.ts","../src/operation/metadata/replace-text.ts","../src/operation/metadata/request-action.ts","../src/operation/metadata/save-to-storage.ts","../src/operation/metadata/scroll-to-element.ts","../src/operation/metadata/scroll-to-position.ts","../src/operation/metadata/select-element.ts","../src/operation/metadata/set-data.ts","../src/operation/metadata/set-element-attributes.ts","../src/operation/metadata/set-element-content.ts","../src/operation/metadata/set-focus.ts","../src/operation/metadata/set-form-value.ts","../src/operation/metadata/set-global-data.ts","../src/operation/metadata/set-operation-data.ts","../src/operation/metadata/set-style.ts","../src/operation/metadata/set-variable.ts","../src/operation/metadata/sort-array.ts","../src/operation/metadata/split-string.ts","../src/operation/metadata/start-action.ts","../src/operation/metadata/substring-text.ts","../src/operation/metadata/toggle-class.ts","../src/operation/metadata/toggle-element.ts","../src/operation/metadata/toggle-form-element.ts","../src/operation/metadata/validate-form.ts","../src/operation/metadata/wait.ts","../src/operation/metadata/when.ts","../src/operation/metadata/index.ts","../src/util/find-closest-names.ts","../src/configuration/api/operation-lookup.ts","../src/configuration/api/sync-in-place.ts","../src/configuration/api/action-creator-factory.ts","../src/configuration/api/action-editor.ts","../src/configuration/api/timeline-provider-settings-editor.ts","../src/util/merge-if-missing.ts","../src/configuration/api/configuration-factory.ts","../src/controllers/metadata/dom-event-listener-controller.ts","../src/controllers/metadata/keyboard-controller.ts","../src/controllers/metadata/label-controller.ts","../src/controllers/metadata/lottie-controller.ts","../src/controllers/metadata/mutation-observer-controller.ts","../src/controllers/metadata/navigation-controller.ts","../src/controllers/metadata/progressbar-controller.ts","../src/controllers/metadata/routing-controller.ts","../src/controllers/metadata/subtitles-controller.ts","../src/controllers/metadata/index.ts","../src/configuration/api/name-providers.ts","../src/configuration/api/subtitle-converter.ts","../src/configuration/api/subtitle-editor.ts"],"sourcesContent":["const functionToString = Function.prototype.toString;\n/** Source text of `Object`, the same in every realm */\nconst objectConstructorSource = functionToString.call(Object);\n\n/**\n * Returns true for plain data objects: object literals, parsed JSON objects\n * and `Object.create(null)` objects, also when they were created in another\n * realm (an iframe, a worker, the realm `fetch` parses JSON in). Returns false\n * for arrays, class instances, `Date`, `Map`, DOM nodes, jQuery objects and\n * objects that inherit from another object.\n *\n * @param value - Any value\n * @returns Whether `value` is a plain data object\n */\nexport function isPlainObject(\n value: unknown\n): value is Record<PropertyKey, unknown> {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null || prototype === Object.prototype) {\n return true;\n }\n // Another realm's Object.prototype: no prototype of its own, and its own\n // constructor is that realm's Object.\n if (Object.getPrototypeOf(prototype) !== null) {\n return false;\n }\n const objectConstructor = Object.hasOwn(prototype, 'constructor')\n ? prototype.constructor\n : undefined;\n return (\n typeof objectConstructor === 'function' &&\n functionToString.call(objectConstructor) === objectConstructorSource\n );\n}\n","import {isPlainObject} from '@util/guards/is-plain-object.ts';\nimport {isDefined} from 'ts-is-present';\n\n/**\n * Re-exported for existing imports; the implementation lives in\n * `@util/guards/is-plain-object.ts`. Objects from another realm (an iframe,\n * or the realm `fetch` parses JSON in) count as plain too.\n */\nexport {isPlainObject};\n\nconst copyFunction =\n typeof structuredClone !== 'undefined'\n ? structuredClone\n : <T>(original: any) => JSON.parse(JSON.stringify(original)) as T;\n\n/**\n * Deep copies the given value.\n *\n * Arrays and plain objects are copied recursively (cycles are preserved). Date, RegExp,\n * Map, Set, Error, ArrayBuffer and typed array values are copied with `structuredClone`.\n *\n * Everything else is kept by reference:\n * - functions, so function-valued operation data (such as `mapArray`'s `mapFunction` or\n * `sortArray`'s `sortComparator`, supplied through the TypeScript fluent API) survives\n * the copy;\n * - jQuery instances and DOM nodes;\n * - class instances (controllers, actions, the eventbus and other objects whose prototype\n * is not `Object.prototype` or `null`). `structuredClone` would either throw on them or\n * return a plain object without their methods.\n *\n * @param original The value to copy.\n * @returns The copy.\n */\nexport function deepCopy<T>(original: T): T {\n if (isDefined(original)) {\n return copyValue(original, new WeakMap()) as T;\n }\n return original;\n}\n\nfunction copyValue(value: unknown, seen: WeakMap<object, unknown>): unknown {\n // Primitives and functions are returned as-is.\n if (value === null || typeof value !== 'object') {\n return value;\n }\n if (isReferenceOnly(value)) {\n return value;\n }\n if (seen.has(value)) {\n return seen.get(value);\n }\n\n if (Array.isArray(value)) {\n const copy: unknown[] = new Array(value.length);\n seen.set(value, copy);\n value.forEach((item, index) => {\n copy[index] = copyValue(item, seen);\n });\n return copy;\n }\n\n if (isPlainObject(value)) {\n const copy: Record<string, unknown> = {};\n seen.set(value, copy);\n for (const key of Object.keys(value)) {\n // defineProperty, so an own '__proto__' key (e.g. from JSON.parse) stays a\n // data property instead of replacing the copy's prototype.\n Object.defineProperty(copy, key, {\n value: copyValue((value as Record<string, unknown>)[key], seen),\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n return copy;\n }\n\n if (!isStructuredCloneable(value)) {\n return value;\n }\n\n const copy = copyFunction(value);\n seen.set(value, copy);\n return copy;\n}\n\nfunction isReferenceOnly(value: object) {\n return (\n typeof (value as {jquery?: unknown}).jquery === 'string' ||\n (typeof Node !== 'undefined' && value instanceof Node)\n );\n}\n\n/**\n * Built-in value types that `structuredClone` copies faithfully.\n */\nfunction isStructuredCloneable(value: object) {\n // Tags instead of instanceof, so values from another realm are recognised.\n return (\n cloneableTags.has(Object.prototype.toString.call(value)) ||\n ArrayBuffer.isView(value)\n );\n}\n\nconst cloneableTags = new Set([\n '[object Date]',\n '[object RegExp]',\n '[object Map]',\n '[object Set]',\n '[object Error]',\n '[object ArrayBuffer]',\n]);\n","import type { IAddClassOperationData } from \"@operation/add-class.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addClass(): IOperationMetadata<IAddClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IAddControllerToElementOperationData } from \"@operation/add-controller-to-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function addControllerToElement(): IOperationMetadata<IAddControllerToElementOperationData<TOperationData>> {\n return {\n description: `This operation adds the specified controller instance to the given selected element.\n\nThe controller is registered on the element only once \\`init\\` and a synchronous \\`attach\\`\nhave succeeded. When \\`attach\\` returns a promise, the controller is registered before\nthat promise settles (so detaching the element can still reach it) and is removed from\nthe element again when the promise rejects.`,\n category: `Controller`,\n dependentProperties: ['selectedElement', 'controllerInstance'],\n };\n}\n","import type { IAddGlobalsToOperationData } from \"@operation/add-globals-to-operation.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addGlobalsToOperation(): IOperationMetadata<IAddGlobalsToOperationData> {\n return {\n description: `This operation adds the specified global property names to the current operation data.\nIt finally removes the \\`globalProperties\\` property from the current operation data.\n\nPlain data is copied, so changing it does not change the global store. jQuery objects, DOM\nnodes, functions and class instances (such as controllers) are added by reference.`,\n category: `Data`,\n properties: {\n globalProperties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IAnimateWithClassOperationData } from \"@operation/animate-with-class.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animateWithClass(): IOperationMetadata<IAnimateWithClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element and assumes that this\nclass triggers an animation on the selected element. It then waits for this animation to complete\nbefore it resolves.\n\nThe class must put the animation on the selected element itself: \\`animationend\\` events that bubble up\nfrom descendants are ignored, and with several selected elements the operation waits for all of them.\nSet \\`includeDescendants\\` to true for a class that only animates descendants; the operation then resolves\non the first \\`animationend\\` from the element or its subtree.\n\nThe operation resolves immediately when the selection is empty, or when the class gives none of the\nselected elements a CSS animation (for example under \\`prefers-reduced-motion: reduce\\`). When an\n\\`animationend\\` event never arrives, for example because the element was hidden or removed while\nanimating, it resolves shortly after the longest computed animation should have ended. An infinite\nanimation is waited for until it is ended by an \\`animationend\\` event.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n },\n removeClass: {\n type: 'ParameterType:boolean',\n erased: true\n },\n includeDescendants: {\n type: 'ParameterType:boolean',\n erased: true\n }\n },\n };\n}\n","import type { IAnimateOperationData } from \"@operation/animate.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animate(): IOperationMetadata<IAnimateOperationData> {\n return {\n description: `This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\nIt resolves after the animation completes, or immediately when the selected element set is empty.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n animationEasing: {\n type: 'ParameterType:string',\n erased: true\n },\n animationProperties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n animationDuration: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IAnnounceToScreenReaderOperationData } from \"@operation/announce-to-screen-reader.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function announceToScreenReader(): IOperationMetadata<IAnnounceToScreenReaderOperationData> {\n return {\n description: `Announces a message to screen readers using an ARIA live region.\n\nThe live region (\\`#aria-live-region\\`) is created empty on first use. The region is emptied\nand the message is written 100 milliseconds later, so that a new region\nand a message repeated verbatim are both announced. The message is removed again after 5 seconds.\nA newer announcement replaces a pending one.\n\nThe operation returns at once and does not wait for the message to be written.`,\n category: `Accessibility`,\n properties: {\n message: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n priority: {\n type: [\n { value: 'polite' },\n { value: 'assertive' }\n ],\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function breakForEach(): IOperationMetadata<TOperationData> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the loop end index, effectively stopping the loop.\n\nIt can be placed inside a \\`when\\`/\\`otherwise\\`/\\`endWhen\\` block within the loop, to break conditionally.`,\n category: `Control Flow`,\n };\n}\n","import type { IBroadcastEventOperationData } from \"@operation/broadcast-event.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData> {\n return {\n description: `This operation broadcasts the given event through the eventbus, along with the\nevent arguments and optional event topic.`,\n category: `Utility`,\n properties: {\n eventArgs: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n eventTopic: {\n type: 'ParameterType:eventTopic',\n erased: true\n },\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { ICalcOperationData } from \"@operation/calc.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function calc(): IOperationMetadata<ICalcOperationData> {\n return {\n description: `This operation calculates the given left and right hand operands using the specified operator.\n\n\\`left\\`, \\`right\\` and \\`operator\\` may be property chains (\\`$operationdata.\\`, \\`$globaldata.\\`,\n\\`$scope.\\`). Only these three inputs are resolved; the rest of the operation data is left as\nit is.`,\n category: `Utility`,\n properties: {\n left: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n right: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n operator: {\n type: [\n { value: '+' },\n { value: '-' },\n { value: '*' },\n { value: '/' },\n { value: '%' },\n { value: '**' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n calculationResult: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IClearElementOperationData } from \"@operation/clear-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearElement(): IOperationMetadata<IClearElementOperationData> {\n return {\n description: `This operation removes all of the children from the given selected element.\n\nControllers attached to the removed children or their descendants (by \\`addControllerToElement\\`)\nare detached first. Controllers on the selected element itself stay attached.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import type { IClearOperationDataOperationData } from \"@operation/clear-operation-data.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearOperationData(): IOperationMetadata<IClearOperationDataOperationData> {\n return {\n description: `This operation removes all of the properties on the current operation date.\nOr, if the \\`properties\\` property is set only removes the properties defined by that list.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n erased: true\n }\n },\n };\n}\n","import type { IClearStorageOperationData } from \"@operation/clear-storage.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearStorage(): IOperationMetadata<IClearStorageOperationData> {\n return {\n description: `Clears data from browser storage (localStorage or sessionStorage).\n\nIf \\`key\\` is provided, removes only that key. If \\`key\\` is omitted, clears all storage.\nA \\`key\\` that is present but empty, blank or not a string is rejected, so a value resolved\nfrom missing data never wipes the whole storage.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { ICompareDateOperationData } from \"@operation/compare-date.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function compareDate(): IOperationMetadata<ICompareDateOperationData> {\n return {\n description: `Compares two dates.\ncomparison: -1 (before), 0 (equal), 1 (after)`,\n category: `Date`,\n properties: {\n date1: {\n type: 'ParameterType:string|ParameterType:number|ParameterType:Date',\n required: true,\n erased: true\n },\n date2: {\n type: 'ParameterType:string|ParameterType:number|ParameterType:Date',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n comparison: {\n type: 'ParameterType:number'\n },\n isEqual: {\n type: 'ParameterType:boolean'\n },\n isBefore: {\n type: 'ParameterType:boolean'\n },\n isAfter: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import type { IConcatenateStringsOperationData } from \"@operation/concatenate-strings.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function concatenateStrings(): IOperationMetadata<IConcatenateStringsOperationData> {\n return {\n description: `Concatenates multiple strings with an optional separator.`,\n category: `String`,\n properties: {\n strings: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n },\n separator: {\n type: 'ParameterType:string',\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function continueForEach(): IOperationMetadata<TOperationData> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the next loop index, effectively canceling the rest\nof the operations in the current iteration.\n\nIt can be placed inside a \\`when\\`/\\`otherwise\\`/\\`endWhen\\` block within the loop, to continue conditionally.`,\n category: `Control Flow`,\n };\n}\n","import type { ICreateElementOperationData, TTagNames } from \"@operation/create-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function createElement(): IOperationMetadata<ICreateElementOperationData<TTagNames>> {\n return {\n description: `This operation creates the DOM element described by the given elementName and attributes and assigns\nthe instance to the \\`template\\` property on the current operation data.\n\nThe element is built with DOM APIs: attribute values are set with \\`.attr()\\` and \\`text\\` is set as\ntext content, so neither is parsed as HTML.\n\nValues may be resolved from user data, so nothing that runs script is created: \\`script\\`\nelements, event handler (\\`on*\\`) and \\`srcdoc\\` attributes, and \\`javascript:\\` or \\`vbscript:\\`\nURLs in URL attributes such as \\`href\\`, \\`src\\` and \\`formaction\\` are refused.`,\n category: `DOM`,\n properties: {\n elementName: {\n type: 'ParameterType:htmlElementName',\n required: true,\n erased: true\n },\n text: {\n type: 'ParameterType:string',\n erased: true\n },\n attributes: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n template: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { ICustomFunctionOperationData } from \"@operation/custom-function.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function customFunction(): IOperationMetadata<ICustomFunctionOperationData> {\n return {\n description: `This operation retrieves a custom function defined by the given system name\nand invokes it with the current operation data and eventbus.\n\nThe function is looked up with the \\`request-function\\` event, which the\n\\`EngineFactory\\` answers from its resource importer. Register the function\nwith the \\`EligiusResourceImporter\\` constructor:\n\\`new EligiusResourceImporter({functions: {myFunction}})\\`.\n\nThe function is called with the current operation data as its argument, and with \\`this\\`\nset to a view of the operation scope. Reading a property from \\`this\\` returns it from the\ninnermost scope that has it, so inside a \\`when\\` block in a loop \\`this.currentItem\\`,\n\\`this.loopIndex\\` and \\`this.variables\\` return the loop's and the action's values, the same\nas \\`$scope.\\` chains. Assigning to \\`this\\` (for example \\`this.newIndex\\`) writes to the scope the\noperation runs in.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IEndActionOperationData } from \"@operation/end-action.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endAction(): IOperationMetadata<IEndActionOperationData> {\n return {\n description: `This operation invokes the {@link EndableAction}.end method on the specified action instance.\n\nThe action receives its own copy of the current operation data merged with the action\noperation data. Whatever the action's end operations add, change or remove in that copy stays\nwith the action: once it has completed, this operation continues with the operation data it\nhad before, without the \\`actionOperationData\\` property.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function endForEach(): IOperationMetadata<TOperationData> {\n return {\n description: `This operation checks if the current loop should end or start the next iteration.`,\n category: `Control Flow`,\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function endWhen(): IOperationMetadata<TOperationData> {\n return {\n description: `This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.`,\n category: `Control Flow`,\n };\n}\n","import type { IExtendControllerOperationData } from \"@operation/extend-controller.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function extendController(): IOperationMetadata<IExtendControllerOperationData> {\n return {\n description: `Extends the current controller with given extension.\n\nThe extension's own properties are copied onto the controller instance.`,\n category: `Controller`,\n dependentProperties: ['controllerInstance'],\n properties: {\n controllerExtension: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IFilterArrayOperationData } from \"@operation/filter-array.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function filterArray(): IOperationMetadata<IFilterArrayOperationData> {\n return {\n description: `Filters an array based on property equality or custom predicate function.\n\nOperates on arrayData passed from previous operations.\nSupports two filtering modes:\n1. Property equality: \\`filterProperty\\` and \\`filterValue\\` to filter by property match\n2. Custom predicate: \\`filterPredicate\\` function for complex filtering logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n filterProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n filterValue: {\n type: 'ParameterType:object',\n erased: true\n },\n filterPredicate: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n filteredArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import type { IFindInArrayOperationData } from \"@operation/find-in-array.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function findInArray(): IOperationMetadata<IFindInArrayOperationData> {\n return {\n description: `Finds the first element in an array matching criteria.\n\nOperates on arrayData passed from previous operations.\nSupports two search modes:\n1. Property equality: \\`findProperty\\` and \\`findValue\\` to find by property match\n2. Custom predicate: \\`findPredicate\\` function for complex search logic\n\nReturns \\`undefined\\` for \\`foundItem\\` and \\`-1\\` for \\`foundIndex\\` if no match found.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n findProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n findValue: {\n type: 'ParameterType:object',\n erased: true\n },\n findPredicate: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n foundItem: {\n type: 'ParameterType:object'\n },\n foundIndex: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IForEachOperationData } from \"@operation/for-each.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function forEach(): IOperationMetadata<IForEachOperationData> {\n return {\n description: `This operation iterates over the given collection.\n\nEach iteration the current item from the specified collection is\nassigned to the {@link IOperationScope.currentItem |currentItem} property on the {@link IOperationScope |operation scope}.\n\nAt the start of the loop, the associated {@link endForEach} operation is determined and when\nthe last iteration is completed the flow control is set to the index of that operation.\n\nThe {@link continueForEach |continue} and {@link breakForEach |break} operations can be used to control the\nloop iterations.\n\nThe collection is resolved once, when the loop starts, and the loop iterates over a snapshot\nof it. Changing, replacing or removing the source collection inside the loop body does not\nchange the items or the number of iterations of the running loop.`,\n category: `Control Flow`,\n properties: {\n collection: {\n type: 'ParameterType:array|ParameterType:string',\n required: true\n }\n },\n };\n}\n","import type { IFormatDateOperationData } from \"@operation/format-date.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatDate(): IOperationMetadata<IFormatDateOperationData> {\n return {\n description: `Formats a date with a simple token pattern, in the local time zone.\n\nSupported tokens (every occurrence is replaced, other characters are kept as is):\n- \\`YYYY\\`: four digit year\n- \\`MM\\`: month, 01-12\n- \\`DD\\`: day of the month, 01-31\n- \\`HH\\`: hours, 00-23\n- \\`mm\\`: minutes, 00-59\n- \\`ss\\`: seconds, 00-59`,\n category: `Date`,\n dependentProperties: ['date'],\n properties: {\n format: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedDate: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IFormatTextOperationData } from \"@operation/format-text.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatText(): IOperationMetadata<IFormatTextOperationData> {\n return {\n description: `Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\n\nTransformations:\n- \\`uppercase\\`: Convert all characters to uppercase\n- \\`lowercase\\`: Convert all characters to lowercase\n- \\`capitalize\\`: Capitalize only the first letter\n- \\`titlecase\\`: Capitalize first letter of each word\n- \\`trim\\`: Remove leading and trailing whitespace`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n transformation: {\n type: [\n { value: 'uppercase' },\n { value: 'lowercase' },\n { value: 'capitalize' },\n { value: 'titlecase' },\n { value: 'trim' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedText: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IGetAttributesFromElementOperationData } from \"@operation/get-attributes-from-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getAttributesFromElement(): IOperationMetadata<IGetAttributesFromElementOperationData> {\n return {\n description: `This operation retrieves the values for the specified attribute names from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributeNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n attributeValues: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetControllerFromElementOperationData } from \"@operation/get-controller-from-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerFromElement(): IOperationMetadata<IGetControllerFromElementOperationData> {\n return {\n description: `This operation retrieves the controller instance with the specified name that is assigned to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetControllerInstanceOperationData } from \"@operation/get-controller-instance.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerInstance(): IOperationMetadata<IGetControllerInstanceOperationData> {\n return {\n description: `This operation retrieves an instance of the given controller name.\nIt assigns this instance to the \\`controllerInstance\\` property on the current operation data`,\n category: `Controller`,\n properties: {\n systemName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetCurrentTimeOperationData } from \"@operation/get-current-time.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getCurrentTime(): IOperationMetadata<IGetCurrentTimeOperationData> {\n return {\n description: `Gets the current time as timestamp and Date object.`,\n category: `Date`,\n outputProperties: {\n timestamp: {\n type: 'ParameterType:number'\n },\n date: {\n type: 'ParameterType:Date'\n }\n }\n };\n}\n","import type { IGetElementDimensionsOperationData } from \"@operation/get-element-dimensions.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getElementDimensions(): IOperationMetadata<IGetElementDimensionsOperationData> {\n return {\n description: `This operation calculates the width and height of the given selected element.\nIt assigns this struct to the dimensions property on the current operation data.\nOptionally the width and height can be modified using the given modifier string.\n\nThe modifier string is formatted in the following way:\n\n<operator><amount><optional-side><optional-precentage>|<ratio-definition>\n\nWhere the ratio modifier is formatted in the following way:\n<side>[ar=<ratio-left>-<ratio-right>]\n\nFor example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\nit will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n modifier: {\n type: 'ParameterType:dimensionsModifier',\n erased: true\n }\n },\n outputProperties: {\n dimensions: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetFocusedElementOperationData } from \"@operation/get-focused-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFocusedElement(): IOperationMetadata<IGetFocusedElementOperationData> {\n return {\n description: `Gets the currently focused element.`,\n category: `Focus`,\n outputProperties: {\n focusedElement: {\n type: 'ParameterType:jQuery'\n }\n }\n };\n}\n","import type { IGetFormDataOperationData } from \"@operation/get-form-data.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFormData(): IOperationMetadata<IGetFormDataOperationData> {\n return {\n description: `Extracts all input, select, and textarea values from form element into operation data.\n\nThis operation reads form field values and returns them as an object with field names as keys.\nOnly processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\nselect elements, textareas, and text inputs.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n formData: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetImportOperationData } from \"@operation/get-import.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getImport(): IOperationMetadata<IGetImportOperationData> {\n return {\n description: `This operation retrieves the import specified by the given \\`systemName\\` and\nassigns it to the \\`importedInstance\\` property on the current operaton date.\n\nThe import is looked up with the \\`request-function\\` event, which the\n\\`EngineFactory\\` answers from its resource importer. Functions, templates\nand JSON registered with the \\`EligiusResourceImporter\\` constructor\n(\\`new EligiusResourceImporter({json: {settings}})\\`) can be imported this\nway, as can every built-in operation, controller and provider export.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n importedInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetQueryParamsOperationData } from \"@operation/get-query-params.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getQueryParams(): IOperationMetadata<IGetQueryParamsOperationData> {\n return {\n description: `This operation retrieves the current query parameters from the browser's address bar and places\nthem on the returned operation data.`,\n category: `Utility`,\n properties: {\n defaultValues: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n queryParams: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetScrollPositionOperationData } from \"@operation/get-scroll-position.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getScrollPosition(): IOperationMetadata<IGetScrollPositionOperationData> {\n return {\n description: `Gets the current scroll position of the viewport.\n\nReturns x (horizontal) and y (vertical) scroll positions in pixels.\nUses cross-browser compatible methods to retrieve scroll position.`,\n category: `Scroll`,\n outputProperties: {\n scrollX: {\n type: 'ParameterType:number'\n },\n scrollY: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IGetTextContentOperationData } from \"@operation/get-text-content.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getTextContent(): IOperationMetadata<IGetTextContentOperationData> {\n return {\n description: `Extracts text content from element, stripping all HTML markup.\n\nUses jQuery's \\`.text()\\` method which is XSS-safe and returns only the text content\nwithout any HTML tags. Preserves whitespace and text from nested elements.`,\n category: `Text`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n textContent: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IHttpDeleteOperationData } from \"@operation/http-delete.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpDelete(): IOperationMetadata<IHttpDeleteOperationData> {\n return {\n description: `Performs an HTTP DELETE request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IHttpPostOperationData } from \"@operation/http-post.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPost(): IOperationMetadata<IHttpPostOperationData> {\n return {\n description: `Performs an HTTP POST request to the specified URL.\n\nThe body is sent as JSON with \\`Content-Type: application/json\\`, unless the caller's headers set\nanother content type (header names are case-insensitive). With a non-JSON content type, a string\nbody is sent as is; other bodies are still JSON encoded.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IHttpPutOperationData } from \"@operation/http-put.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPut(): IOperationMetadata<IHttpPutOperationData> {\n return {\n description: `Performs an HTTP PUT request to the specified URL.\n\nThe body is sent as JSON with \\`Content-Type: application/json\\`, unless the caller's headers set\nanother content type (header names are case-insensitive). With a non-JSON content type, a string\nbody is sent as is; other bodies are still JSON encoded.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IInvokeObjectMethodOperationData } from \"@operation/invoke-object-method.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function invokeObjectMethod(): IOperationMetadata<IInvokeObjectMethodOperationData> {\n return {\n description: `This operation invokes the specified method on the given object with the given optional arguments\nand assigns the result to the \\`methodResult\\` operationdata property. When the method returns a\npromise, the operation waits for it and assigns the resolved value.\n\nThe operation only calls application code: methods of controllers, of other instances of\napplication classes, and of plain objects. It refuses, and throws for:\n- an \\`instance\\` that is a function, the global object (\\`window\\`), a document, a DOM node,\n a jQuery object, or any other built-in or host object (arrays, maps, promises, \\`location\\`,\n storage, ...);\n- a method that is a built-in (native) function, such as \\`eval\\`, \\`Function\\`, \\`setTimeout\\`,\n \\`setInterval\\`, \\`document.write\\`, \\`Reflect.apply\\` or a bound function, or a jQuery function;\n- the method names \\`constructor\\`, \\`__proto__\\` and \\`prototype\\`;\n- arguments that are such functions.\n\nThese checks stop configuration from reaching the platform's code-executing functions through\nthis operation. They cannot vouch for what an application method does with its arguments, so\nonly expose methods that are safe to call with configured data.`,\n category: `Utility`,\n dependentProperties: ['instance'],\n properties: {\n methodName: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n methodArguments: {\n type: 'ParameterType:array',\n erased: true\n }\n },\n outputProperties: {\n methodResult: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IIsElementInViewportOperationData } from \"@operation/is-element-in-viewport.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function isElementInViewport(): IOperationMetadata<IIsElementInViewportOperationData> {\n return {\n description: `Checks if an element is currently visible within the viewport.\n\nUses \\`getBoundingClientRect()\\` to determine if the element is within the viewport boundaries.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n isInViewport: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import type { ILoadFromStorageOperationData } from \"@operation/load-from-storage.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadFromStorage(): IOperationMetadata<ILoadFromStorageOperationData> {\n return {\n description: `Loads data from browser storage (localStorage or sessionStorage).\n\nDeserializes the stored JSON value. Returns \\`null\\` if key doesn't exist.\nWhen \\`storageType\\` is omitted, localStorage is used.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n loadedValue: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { ILoadJSONOperationData } from \"@operation/load-json.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadJson(): IOperationMetadata<ILoadJSONOperationData> {\n return {\n description: `This operation loads a JSON file from the specified url and assigns it to the json\nproperty on the current operation data.\n\nIf the cache property is set to true and a cached value already exists, a copy of it is assigned\ninstead of re-retrieving it from the url. Mutating the returned json never changes the cache.\n\nThe cache is shared by every engine. It is emptied when the last live engine created by\n\\`EngineFactory\\` is destroyed; call {@link clearJsonCache} to empty it earlier.`,\n category: `Utility`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n cache: {\n type: 'ParameterType:boolean',\n erased: true\n }\n },\n outputProperties: {\n json: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { ILogOperationData } from \"@operation/log.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function log(): IOperationMetadata<ILogOperationData> {\n return {\n description: `This operation logs the specified value, or, when no logValue property has been assigned\nit will log the current operation data, global data and scope to the console`,\n category: `Utility`,\n properties: {\n logValue: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n erased: true\n },\n logName: {\n type: 'ParameterType:string',\n erased: true\n }\n },\n };\n}\n","import type { IMapArrayOperationData } from \"@operation/map-array.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function mapArray(): IOperationMetadata<IMapArrayOperationData> {\n return {\n description: `Transforms each element of an array using a mapping function.\n\nOperates on arrayData passed from previous operations.\nThe mapFunction receives each item and optionally its index.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n mapFunction: {\n type: 'ParameterType:function',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mappedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import type { IMathOperationData } from \"@operation/math.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function math(): IOperationMetadata<IMathOperationData> {\n return {\n description: `This operation performs the given math function with the specified arguments.\n\n\\`args\\` and \\`functionName\\` may contain property chains (\\`$operationdata.\\`, \\`$globaldata.\\`,\n\\`$scope.\\`). Only these two inputs are resolved; the rest of the operation data is left as it\nis. Arguments that name a Math constant (such as \\`'PI'\\`) are replaced by its value.`,\n category: `Utility`,\n properties: {\n args: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n functionName: {\n type: 'ParameterType:mathfunction',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mathResult: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function otherwise(): IOperationMetadata<TOperationData> {\n return {\n description: `If the preceeding {@link when} operation evaluates to \\`true\\` subsequent operations will\nbe skipped until an {@link endWhen} operation is encountered.`,\n category: `Control Flow`,\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRemoveClassOperationData } from \"@operation/remove-class.ts\";\n\nexport function removeClass(): IOperationMetadata<IRemoveClassOperationData> {\n return {\n description: `This operation removes the spcified class name from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRemoveControllerFromElementOperationData } from \"@operation/remove-controller-from-element.ts\";\n\nexport function removeControllerFromElement(): IOperationMetadata<IRemoveControllerFromElementOperationData> {\n return {\n description: `This operation removes the controller with the specified name from the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRemoveElementOperationData } from \"@operation/remove-element.ts\";\n\nexport function removeElement(): IOperationMetadata<IRemoveElementOperationData> {\n return {\n description: `This operation removes the given selected element from the DOM.\n\nControllers attached to the element or its descendants (by \\`addControllerToElement\\`) are\ndetached first, so their eventbus and window listeners do not outlive the element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRemovePropertiesFromOperationDataOperationData } from \"@operation/remove-properties-from-operation-data.ts\";\n\nexport function removePropertiesFromOperationData(): IOperationMetadata<IRemovePropertiesFromOperationDataOperationData> {\n return {\n description: `This operation removes the given list of properties from the current operation data.\nIt will also remove the property \\`propertyNames\\` from the result.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IReparentElementOperationData } from \"@operation/reparent-element.ts\";\n\nexport function reparentElement(): IOperationMetadata<IReparentElementOperationData> {\n return {\n description: `This operation moves the given selected element to the new parent that is defined\nby the specified \\`newParentSelector\\`. jQuery data, event handlers and attached controllers\nare preserved.\n\nThe selector is resolved inside the engine root (the root itself included), the same way\n\\`selectElement\\` resolves its selector, and must match exactly one element. HTML strings are\nnot accepted.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n newParentSelector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IReplaceStringOperationData } from \"@operation/replace-string.ts\";\n\nexport function replaceString(): IOperationMetadata<IReplaceStringOperationData> {\n return {\n description: `Replaces occurrences of a pattern in a string (alias for replaceText for string context).\n\nLike replaceText, a string pattern replaces every occurrence and inserts the replacement\nliterally (\\`$&\\`, \\`$1\\` and similar are not expanded). A RegExp pattern follows\n\\`String.prototype.replace\\`: only a global RegExp replaces every match, and \\`$\\` patterns\nin the replacement are expanded. Unlike replaceText, the result is written to \\`result\\`\nand \\`textContent\\` is left unchanged.`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n pattern: {\n type: 'ParameterType:string|ParameterType:RegExp',\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IReplaceTextOperationData } from \"@operation/replace-text.ts\";\n\nexport function replaceText(): IOperationMetadata<IReplaceTextOperationData> {\n return {\n description: `Finds and replaces text using literal string or regex pattern.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\nSupports regex patterns with global flag for multiple replacements.\nUpdates textContent with replaced text and sets replacementCount.\n\nA string pattern replaces every occurrence and inserts the replacement literally.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n searchPattern: {\n type: 'ParameterType:string|ParameterType:RegExp',\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n replacementCount: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRequestActionOperationData } from \"@operation/request-action.ts\";\n\nexport function requestAction(): IOperationMetadata<IRequestActionOperationData> {\n return {\n description: `This operation requests an action instance with the specified name and assigns it\nto the \\`actionInstance\\` property on the current operation data.`,\n category: `Action`,\n properties: {\n systemName: {\n type: 'ParameterType:actionName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n actionInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISaveToStorageOperationData } from \"@operation/save-to-storage.ts\";\n\nexport function saveToStorage(): IOperationMetadata<ISaveToStorageOperationData> {\n return {\n description: `Saves data to browser storage (localStorage or sessionStorage).\n\nSerializes the value as JSON before storing. Supports any JSON-serializable data type.\nUse \\`null\\` to store an empty value; \\`undefined\\` cannot be stored as JSON and is rejected.\nWhen \\`storageType\\` is omitted, localStorage is used.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IScrollToElementOperationData } from \"@operation/scroll-to-element.ts\";\n\nexport function scrollToElement(): IOperationMetadata<IScrollToElementOperationData> {\n return {\n description: `Scrolls the viewport to bring the selected element into view.\n\nUses the browser's \\`scrollIntoView\\` API with configurable behavior.`,\n category: `Scroll`,\n dependentProperties: ['selectedElement'],\n properties: {\n behavior: {\n type: [\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n },\n block: {\n type: [\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n },\n inline: {\n type: [\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IScrollToPositionOperationData } from \"@operation/scroll-to-position.ts\";\n\nexport function scrollToPosition(): IOperationMetadata<IScrollToPositionOperationData> {\n return {\n description: `Scrolls the viewport to a specific x,y coordinate position.\n\nUses the browser's \\`window.scrollTo\\` API with configurable behavior.`,\n category: `Scroll`,\n properties: {\n x: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n y: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n behavior: {\n type: [\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISelectElementOperationData } from \"@operation/select-element.ts\";\n\nexport function selectElement(): IOperationMetadata<ISelectElementOperationData> {\n return {\n description: `This operation selects one or more elements using the specified selector.\n\nIf \\`useSelectedElementAsRoot\\` is set to true and a valid DOM element is assigned\nto the current operation data's \\`selectedElement\\` property\nthen the element will be looked for only in the descendant elements of this DOM element.`,\n category: `DOM`,\n properties: {\n selector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n },\n useSelectedElementAsRoot: {\n type: 'ParameterType:boolean',\n erased: true\n }\n },\n outputProperties: {\n selectedElement: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetDataOperationData } from \"@operation/set-data.ts\";\n\nexport function setData(): IOperationMetadata<ISetDataOperationData> {\n return {\n description: `This operation assigns the specified properties to the specified data targets.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetElementAttributesOperationData } from \"@operation/set-element-attributes.ts\";\n\nexport function setElementAttributes(): IOperationMetadata<ISetElementAttributesOperationData> {\n return {\n description: `This operation sets the specified set of attributes on the given selected element.\n\nEvent handler (\\`on*\\`) and \\`srcdoc\\` attributes, and \\`javascript:\\` or \\`vbscript:\\` URLs in URL\nattributes such as \\`href\\`, \\`src\\` and \\`formaction\\`, are refused, the same as in \\`createElement\\`.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributes: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetElementContentOperationData } from \"@operation/set-element-content.ts\";\n\nexport function setElementContent(): IOperationMetadata<ISetElementContentOperationData> {\n return {\n description: `This operation sets the specified content defined by the value assigned to the template property\nto the given selected element.\n\nWhen the \\`insertionType\\` is set to \\`overwrite\\` the contents of the selected element are replaced\nby the given template.\nWhen set to \\`append\\` the new content will be inserted after the current content.\nWhen set to \\`prepend\\` the new content will be inserted before the current content.\n\nWith \\`overwrite\\`, controllers attached to the replaced content (by \\`addControllerToElement\\`) are\ndetached first. Controllers on the selected element itself stay attached.\n\nThe template is inserted as HTML: a string template is parsed by jQuery, which also runs the\nscripts and inline event handlers it contains. Only use string templates from the configuration\nor the resource importer; build content from user data with \\`createElement\\`, whose \\`text\\` is\nnever parsed as HTML.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n template: {\n type: 'ParameterType:string|ParameterType:Element|ParameterType:Text|ParameterType:Comment|ParameterType:Document|ParameterType:DocumentFragment',\n erased: true\n },\n insertionType: {\n type: [\n { value: 'overwrite' },\n { value: 'append' },\n { value: 'prepend' }\n ],\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetFocusOperationData } from \"@operation/set-focus.ts\";\n\nexport function setFocus(): IOperationMetadata<ISetFocusOperationData> {\n return {\n description: `Sets focus to the selected element.`,\n category: `Focus`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetFormValueOperationData } from \"@operation/set-form-value.ts\";\n\nexport function setFormValue(): IOperationMetadata<ISetFormValueOperationData> {\n return {\n description: `Sets the value of an input, select, or textarea element.\n\nHandles different input types appropriately:\n- Text inputs, textareas, selects: sets value directly\n- Checkboxes: sets checked property for boolean values\n- Radio buttons: sets checked property for boolean values\n- Number inputs: converts to string`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n value: {\n type: 'ParameterType:string|ParameterType:number|ParameterType:boolean',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetGlobalDataOperationData } from \"@operation/set-global-data.ts\";\n\nexport function setGlobalData(): IOperationMetadata<ISetGlobalDataOperationData> {\n return {\n description: `This operation copies the specified properties from the operationData to the global data.\n\nPlain data is stored as a deep copy, so changing the operation data afterwards does not change\nthe global data. jQuery objects, DOM nodes, functions and class instances (such as controllers)\nare stored by reference.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetOperationData } from \"@operation/set-operation-data.ts\";\n\nexport function setOperationData(): IOperationMetadata<ISetOperationData> {\n return {\n description: `This operation assigns the specified properties to the current operation data.\nWhen override is set to true the properties replace the current operation data entirely.`,\n category: `Data`,\n properties: {\n override: {\n type: 'ParameterType:boolean',\n erased: true\n },\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetStyleOperationData } from \"@operation/set-style.ts\";\n\nexport function setStyle(): IOperationMetadata<ISetStyleOperationData> {\n return {\n description: `This operation assigns the specified CSS style properties to the\ngiven selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n properties: {\n type: 'ParameterType:cssProperties',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetVariableOperationData } from \"@operation/set-variable.ts\";\n\nexport function setVariable(): IOperationMetadata<ISetVariableOperationData> {\n return {\n description: `This operation sets a variable with the specified name on the scope with the specified value.\n\nVariables belong to the action: a variable set inside a \\`when\\` or \\`forEach\\` block is the\nsame variable outside it, so it keeps its value after \\`endWhen\\` or \\`endForEach\\`, and\nvariables set before the block can be read and changed inside it. Read variables with\n\\`$scope.variables.<name>\\`.`,\n category: `Data`,\n properties: {\n name: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISortArrayOperationData } from \"@operation/sort-array.ts\";\n\nexport function sortArray(): IOperationMetadata<ISortArrayOperationData> {\n return {\n description: `Sorts an array by property, natural order, or custom comparator function.\n\nOperates on arrayData passed from previous operations.\nSupports three sorting modes:\n1. Property sort: \\`sortProperty\\` and \\`sortOrder\\` to sort objects by property\n2. Natural sort: \\`sortOrder\\` alone for primitive arrays\n3. Custom comparator: \\`sortComparator\\` function for complex sorting logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n sortProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n sortOrder: {\n type: [\n { value: 'asc' },\n { value: 'desc' }\n ],\n erased: true\n },\n sortComparator: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n sortedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISplitStringOperationData } from \"@operation/split-string.ts\";\n\nexport function splitString(): IOperationMetadata<ISplitStringOperationData> {\n return {\n description: `Splits a string into an array by delimiter (string or regex).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n delimiter: {\n type: 'ParameterType:string|ParameterType:RegExp',\n required: true,\n erased: true\n },\n limit: {\n type: 'ParameterType:number',\n erased: true\n }\n },\n outputProperties: {\n resultArray: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IStartActionOperationData } from \"@operation/start-action.ts\";\n\nexport function startAction(): IOperationMetadata<IStartActionOperationData> {\n return {\n description: `This operation starts the specified action instance using the given action operation data.\n\nThe action receives its own copy of the current operation data merged with the action\noperation data. Whatever the action's operations add, change or remove in that copy stays\nwith the action: once it has completed, this operation continues with the operation data it\nhad before, plus \\`actionInstance\\`, without the \\`actionOperationData\\` property.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISubstringTextOperationData } from \"@operation/substring-text.ts\";\n\nexport function substringText(): IOperationMetadata<ISubstringTextOperationData> {\n return {\n description: `Extracts a substring from text between start and end indices.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n start: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n end: {\n type: 'ParameterType:number',\n erased: true\n }\n },\n outputProperties: {\n substring: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IToggleClassOperationData } from \"@operation/toggle-class.ts\";\n\nexport function toggleClass(): IOperationMetadata<IToggleClassOperationData> {\n return {\n description: `This operation toggles the specfied class name on the given selected element.\n\nMeaning, if the specified class name exists on the given element it will be removed,\notherwise it will be added.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IToggleElementOperationData } from \"@operation/toggle-element.ts\";\n\nexport function toggleElement(): IOperationMetadata<IToggleElementOperationData> {\n return {\n description: `This operation toggles the visibility of the given selected element.\n\nMeaning, if the element is hidden, it will be made visible, otherwise\nit will be hidden.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IToggleFormElementOperationData } from \"@operation/toggle-form-element.ts\";\n\nexport function toggleFormElement(): IOperationMetadata<IToggleFormElementOperationData> {\n return {\n description: `Enables or disables form input elements (inputs, selects, textareas, buttons).\n\nSets the \\`disabled\\` property on the element. When \\`enabled\\` is true, removes the disabled\nattribute; when false, adds the disabled attribute.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n enabled: {\n type: 'ParameterType:boolean',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IValidateFormOperationData } from \"@operation/validate-form.ts\";\n\nexport function validateForm(): IOperationMetadata<IValidateFormOperationData> {\n return {\n description: `Validates form fields against HTML5 validation and custom rules.\n\nUses HTML5 validation API (checkValidity()) for native validation, and supports\ncustom validation rules for: required, minLength, maxLength, pattern (regex), and email format.\n\nCheckboxes and radio buttons are validated once per name: \\`required\\` passes when at least one\nof them is checked, and the string rules do not apply to them. For a \\`<select multiple>\\`,\n\\`required\\`, \\`minLength\\` and \\`maxLength\\` count the selected options, and \\`pattern\\` and \\`email\\`\napply to each selected value.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n validationRules: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n validationErrors: {\n type: 'ParameterType:object'\n },\n isValid: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IWaitOperationData } from \"@operation/wait.ts\";\n\nexport function wait(): IOperationMetadata<IWaitOperationData> {\n return {\n description: `This operation waits for the specified amount of milliseconds.`,\n category: `Utility`,\n properties: {\n milliseconds: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IWhenOperationData } from \"@operation/when.ts\";\n\nexport function when(): IOperationMetadata<IWhenOperationData> {\n return {\n description: `When the given expression evaluates to false, subsequent operations will be skipped\nuntil an {@link endWhen} or {@link otherwise} operation is encountered.\n\nPractically, this means an \\`if\\` or \\`if\\`/\\`else\\` statement control flow implementation in a list of operations.\n\nThe expression is passed in as a formatted string. An operand can be one of:\n\n'constant': for a constant string (operators and parentheses inside the quotes are text)\n100: for a constant number (the whole operand must be numeric, \\`10px\\` is invalid)\ntrue, false, null: for a boolean or null constant\n$operationData.foo: for an operation data value\n$globaldata.foo: for a global data value\n$scope.loopIndex: for a scope value\n$scope.variables.foo: for a variable set with \\`setVariable\\`\n\nAny other operand is an error, so a misspelled chain prefix fails instead of being compared\nas a string.\n\nOperands are combined with these operators, from highest to lowest precedence:\n\n\\`!\\`: negation\n\\`==\\`, \\`!=\\`, \\`>\\`, \\`<\\`, \\`>=\\`, \\`<=\\`: comparison (\\`==\\` and \\`!=\\` compare strictly, without type\nconversion; comparisons do not chain, so write \\`0<$scope.loopIndex && $scope.loopIndex<5\\`)\n\\`&&\\`: and\n\\`||\\`: or\n\nParentheses group. A bare operand is true when its value is truthy, so \\`'false'\\` and \\`'0'\\`\nare true and \\`0\\`, \\`''\\`, \\`null\\` and a missing value are false. \\`!\\`, \\`&&\\` and \\`||\\` always\nproduce \\`true\\` or \\`false\\`. \\`!\\` binds tighter than a comparison: \\`!$operationdata.a==1\\`\ncompares \\`!$operationdata.a\\` with 1, write \\`!($operationdata.a==1)\\` to negate the comparison.\n\\`&&\\` and \\`||\\` short-circuit: when the left side decides the result, the right side is not\nresolved, so \\`$operationdata.user && $operationdata.user.name=='John'\\` does not fail when\n\\`user\\` is missing.\n\nArithmetic (\\`+\\`, \\`-\\`, \\`*\\`, \\`/\\`) is not supported: \\`-\\` is a valid character in a property\nchain, so \\`$operationdata.a-1\\` would be ambiguous. Nothing in the expression is executed as\ncode, and property chains are resolved with the usual prototype-pollution and global-object\nguards.`,\n category: `Control Flow`,\n properties: {\n expression: {\n type: 'ParameterType:expression',\n required: true,\n erased: true\n }\n },\n };\n}\n","export { addClass } from \"@operation/metadata/add-class.ts\";\nexport { addControllerToElement } from \"@operation/metadata/add-controller-to-element.ts\";\nexport { addGlobalsToOperation } from \"@operation/metadata/add-globals-to-operation.ts\";\nexport { animateWithClass } from \"@operation/metadata/animate-with-class.ts\";\nexport { animate } from \"@operation/metadata/animate.ts\";\nexport { announceToScreenReader } from \"@operation/metadata/announce-to-screen-reader.ts\";\nexport { breakForEach } from \"@operation/metadata/break-for-each.ts\";\nexport { broadcastEvent } from \"@operation/metadata/broadcast-event.ts\";\nexport { calc } from \"@operation/metadata/calc.ts\";\nexport { clearElement } from \"@operation/metadata/clear-element.ts\";\nexport { clearOperationData } from \"@operation/metadata/clear-operation-data.ts\";\nexport { clearStorage } from \"@operation/metadata/clear-storage.ts\";\nexport { compareDate } from \"@operation/metadata/compare-date.ts\";\nexport { concatenateStrings } from \"@operation/metadata/concatenate-strings.ts\";\nexport { continueForEach } from \"@operation/metadata/continue-for-each.ts\";\nexport { createElement } from \"@operation/metadata/create-element.ts\";\nexport { customFunction } from \"@operation/metadata/custom-function.ts\";\nexport { endAction } from \"@operation/metadata/end-action.ts\";\nexport { endForEach } from \"@operation/metadata/end-for-each.ts\";\nexport { endWhen } from \"@operation/metadata/end-when.ts\";\nexport { extendController } from \"@operation/metadata/extend-controller.ts\";\nexport { filterArray } from \"@operation/metadata/filter-array.ts\";\nexport { findInArray } from \"@operation/metadata/find-in-array.ts\";\nexport { forEach } from \"@operation/metadata/for-each.ts\";\nexport { formatDate } from \"@operation/metadata/format-date.ts\";\nexport { formatText } from \"@operation/metadata/format-text.ts\";\nexport { getAttributesFromElement } from \"@operation/metadata/get-attributes-from-element.ts\";\nexport { getControllerFromElement } from \"@operation/metadata/get-controller-from-element.ts\";\nexport { getControllerInstance } from \"@operation/metadata/get-controller-instance.ts\";\nexport { getCurrentTime } from \"@operation/metadata/get-current-time.ts\";\nexport { getElementDimensions } from \"@operation/metadata/get-element-dimensions.ts\";\nexport { getFocusedElement } from \"@operation/metadata/get-focused-element.ts\";\nexport { getFormData } from \"@operation/metadata/get-form-data.ts\";\nexport { getImport } from \"@operation/metadata/get-import.ts\";\nexport { getQueryParams } from \"@operation/metadata/get-query-params.ts\";\nexport { getScrollPosition } from \"@operation/metadata/get-scroll-position.ts\";\nexport { getTextContent } from \"@operation/metadata/get-text-content.ts\";\nexport { httpDelete } from \"@operation/metadata/http-delete.ts\";\nexport { httpPost } from \"@operation/metadata/http-post.ts\";\nexport { httpPut } from \"@operation/metadata/http-put.ts\";\nexport { invokeObjectMethod } from \"@operation/metadata/invoke-object-method.ts\";\nexport { isElementInViewport } from \"@operation/metadata/is-element-in-viewport.ts\";\nexport { loadFromStorage } from \"@operation/metadata/load-from-storage.ts\";\nexport { loadJson } from \"@operation/metadata/load-json.ts\";\nexport { log } from \"@operation/metadata/log.ts\";\nexport { mapArray } from \"@operation/metadata/map-array.ts\";\nexport { math } from \"@operation/metadata/math.ts\";\nexport { otherwise } from \"@operation/metadata/otherwise.ts\";\nexport { removeClass } from \"@operation/metadata/remove-class.ts\";\nexport { removeControllerFromElement } from \"@operation/metadata/remove-controller-from-element.ts\";\nexport { removeElement } from \"@operation/metadata/remove-element.ts\";\nexport { removePropertiesFromOperationData } from \"@operation/metadata/remove-properties-from-operation-data.ts\";\nexport { reparentElement } from \"@operation/metadata/reparent-element.ts\";\nexport { replaceString } from \"@operation/metadata/replace-string.ts\";\nexport { replaceText } from \"@operation/metadata/replace-text.ts\";\nexport { requestAction } from \"@operation/metadata/request-action.ts\";\nexport { saveToStorage } from \"@operation/metadata/save-to-storage.ts\";\nexport { scrollToElement } from \"@operation/metadata/scroll-to-element.ts\";\nexport { scrollToPosition } from \"@operation/metadata/scroll-to-position.ts\";\nexport { selectElement } from \"@operation/metadata/select-element.ts\";\nexport { setData } from \"@operation/metadata/set-data.ts\";\nexport { setElementAttributes } from \"@operation/metadata/set-element-attributes.ts\";\nexport { setElementContent } from \"@operation/metadata/set-element-content.ts\";\nexport { setFocus } from \"@operation/metadata/set-focus.ts\";\nexport { setFormValue } from \"@operation/metadata/set-form-value.ts\";\nexport { setGlobalData } from \"@operation/metadata/set-global-data.ts\";\nexport { setOperationData } from \"@operation/metadata/set-operation-data.ts\";\nexport { setStyle } from \"@operation/metadata/set-style.ts\";\nexport { setVariable } from \"@operation/metadata/set-variable.ts\";\nexport { sortArray } from \"@operation/metadata/sort-array.ts\";\nexport { splitString } from \"@operation/metadata/split-string.ts\";\nexport { startAction } from \"@operation/metadata/start-action.ts\";\nexport { substringText } from \"@operation/metadata/substring-text.ts\";\nexport { toggleClass } from \"@operation/metadata/toggle-class.ts\";\nexport { toggleElement } from \"@operation/metadata/toggle-element.ts\";\nexport { toggleFormElement } from \"@operation/metadata/toggle-form-element.ts\";\nexport { validateForm } from \"@operation/metadata/validate-form.ts\";\nexport { wait } from \"@operation/metadata/wait.ts\";\nexport { when } from \"@operation/metadata/when.ts\";\nexport * from \"@operation/metadata/types.ts\";\n","/**\n * Returns the known names closest to `name`, for \"did you mean\" hints in error\n * messages. Matching ignores case and uses the Levenshtein edit distance; only\n * names within `max(2, floor(name.length / 3))` edits are returned, closest\n * first.\n *\n * @param name - The unknown name, as written in the configuration\n * @param knownNames - The names that are registered\n * @param max - The maximum number of suggestions to return\n * @returns Up to `max` known names, closest first; empty when none is close\n */\nexport function findClosestNames(\n name: string,\n knownNames: readonly string[],\n max = 3\n): string[] {\n const lowerName = name.toLowerCase();\n const maxDistance = Math.max(2, Math.floor(name.length / 3));\n\n return knownNames\n .map(knownName => ({\n knownName,\n distance: levenshtein(lowerName, knownName.toLowerCase()),\n }))\n .filter(({distance}) => distance <= maxDistance)\n .sort((a, b) => a.distance - b.distance)\n .slice(0, max)\n .map(({knownName}) => knownName);\n}\n\n/**\n * Formats suggestions from {@link findClosestNames} as a sentence.\n *\n * @param suggestions - The suggested names\n * @returns `Did you mean 'a', 'b'?`, or an empty string when there are no suggestions\n */\nexport function formatDidYouMean(suggestions: readonly string[]): string {\n if (!suggestions.length) {\n return '';\n }\n return `Did you mean ${suggestions.map(name => `'${name}'`).join(', ')}?`;\n}\n\nfunction levenshtein(a: string, b: string) {\n let previous = Array.from({length: b.length + 1}, (_, i) => i);\n for (let i = 1; i <= a.length; i++) {\n const current = [i];\n for (let j = 1; j <= b.length; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n current[j] = Math.min(\n previous[j] + 1,\n current[j - 1] + 1,\n previous[j - 1] + cost\n );\n }\n previous = current;\n }\n return previous[b.length];\n}\n","import type {\n ExtractOperationDataType,\n GetOperationByName,\n TOperationName,\n} from '@configuration/types.ts';\nimport * as operationMetadata from '@operation/metadata/index.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport {findClosestNames, formatDidYouMean} from '@util/find-closest-names.ts';\n\n/**\n * An operation system name the fluent API accepts: a built-in operation name\n * (offered by autocompletion), or the name of a custom operation that was\n * passed to the `ConfigurationFactory` in its `customOperations` option.\n * Custom names are checked when the operation is added, not by the compiler.\n */\nexport type TFluentOperationName = TOperationName | (string & {});\n\n/**\n * The operation data the fluent API accepts for the operation `N`: the typed,\n * partial operation data of a built-in operation, or any operation data for a\n * custom operation.\n */\nexport type TFluentOperationData<N extends string> = N extends TOperationName\n ? Partial<ExtractOperationDataType<GetOperationByName<N>>>\n : TOperationData;\n\n/**\n * Operation names are validated against the generated operation metadata, not\n * against the operation implementations. The metadata is plain data, so the\n * fluent configuration API can be loaded in a DOM-less context (Node build\n * tools such as the Eligian compiler), where importing the implementations\n * would evaluate jQuery and throw.\n *\n * @param name the operation system name to check\n * @returns `true` when `name` is a built-in operation\n */\nexport function isKnownOperationName(name: string): name is TOperationName {\n return Object.hasOwn(operationMetadata, name);\n}\n\n/**\n * Throws when the given name is neither the system name of a built-in\n * operation nor one of the given custom operation names.\n *\n * @param name the operation system name to check\n * @param customOperationNames the custom operation names that are accepted as\n * well (the `ConfigurationFactory`'s `customOperations` option)\n * @throws Error when no operation with the given name exists. The message\n * suggests the closest built-in and custom names, and explains how to declare\n * a custom operation.\n */\nexport function assertKnownOperationName(\n name: string,\n customOperationNames?: ReadonlySet<string>\n): void {\n if (isKnownOperationName(name) || customOperationNames?.has(name)) {\n return;\n }\n\n const knownNames = [\n ...Object.keys(operationMetadata),\n ...(customOperationNames ?? []),\n ];\n const didYouMean = formatDidYouMean(\n findClosestNames(String(name), knownNames)\n );\n const hint =\n \"To add a custom operation, declare its name in the ConfigurationFactory options: new ConfigurationFactory(undefined, {customOperations: ['myOperation']}).\";\n throw Error(\n `Unknown operation: ${name}. ${didYouMean ? `${didYouMean} ` : ''}${hint}`\n );\n}\n\n/**\n * Maps operation functions to their system names, for the `...ByType` methods\n * of the fluent API. The map is filled by `register-operation-types.ts`, which\n * the browser entry point (`eligius`) loads. The DOM-free entry point\n * (`eligius/configuration-api`) does not load the operation implementations,\n * so the map stays empty there.\n *\n * The lookup is by function identity, not by `Function.name`, so it keeps\n * working when a minifier renames the operation functions.\n */\nconst operationNamesByType = new Map<unknown, TOperationName>();\n\n/**\n * Registers operation implementations by their system names, so that the\n * `...ByType` methods of the fluent API can map a function back to its name.\n *\n * @param operations a record of operation system names to operation functions\n */\nexport function registerOperationTypes(\n operations: Readonly<Record<string, unknown>>\n): void {\n for (const [name, operation] of Object.entries(operations)) {\n if (typeof operation === 'function' && isKnownOperationName(name)) {\n operationNamesByType.set(operation, name);\n }\n }\n}\n\n/**\n * Returns the system name of the given operation function.\n *\n * @param operationType the operation function\n * @param methodName the fluent API method that asks, used in the error message\n * @param nameBasedMethodName the method that takes a system name instead\n * @returns the system name of the operation\n * @throws Error when the operation function is not known\n */\nexport function getOperationNameByType(\n operationType: unknown,\n methodName: string,\n nameBasedMethodName: string\n): TOperationName {\n const name = operationNamesByType.get(operationType);\n if (name) {\n return name;\n }\n\n if (operationNamesByType.size === 0) {\n throw new Error(\n `${methodName}: the operation implementations are not loaded, so an operation function cannot be mapped to its name. ` +\n `Import the fluent API from the main 'eligius' entry, or call ${nameBasedMethodName}('<operationName>', ...) with the operation's system name.`\n );\n }\n\n throw new Error(`Operation class not found: ${String(operationType)}`);\n}\n","/**\n * Keys that are never copied into the target. Assigning `__proto__` through the\n * inherited accessor would replace a prototype (or, when the existing value is\n * read through it, write onto `Object.prototype`), and `constructor` and\n * `prototype` are the other two entry points of prototype pollution.\n */\nconst UNSAFE_KEYS: ReadonlySet<string> = new Set([\n '__proto__',\n 'constructor',\n 'prototype',\n]);\n\n/**\n * Makes `target` structurally equal to `source` while keeping the identity of\n * the objects and arrays inside `target` wherever possible.\n *\n * The fluent configuration API hands out editors that hold references to\n * objects inside the factory's configuration (an action, an operation, the\n * timeline provider settings). Replacing those objects with copies would\n * detach the editors, so updates are applied in place instead:\n *\n * - Plain objects are updated key by key; keys missing from `source` are removed.\n * - Array entries are matched by their string `id` when both sides have one,\n * otherwise by position. Matched entries are synced recursively and reused.\n * - Everything else is assigned from `source`.\n * - The keys `__proto__`, `constructor` and `prototype` are skipped at every\n * nesting level, also inside values that are inserted as they are, so data\n * from `JSON.parse` cannot pollute `Object.prototype`.\n *\n * `source` should be a value the caller owns (for example a deep copy), because\n * unmatched values from it are inserted into `target` as they are (after their\n * unsafe keys have been removed).\n *\n * @param target - The object to update in place\n * @param source - The desired state\n */\nexport function syncInPlace<T extends object>(target: T, source: T): void {\n if (target === source) {\n return;\n }\n removeUnsafeKeys(source, new WeakSet());\n if (Array.isArray(target) && Array.isArray(source)) {\n syncArray(target, source);\n return;\n }\n syncObject(\n target as Record<string, unknown>,\n source as Record<string, unknown>\n );\n}\n\n/**\n * Deletes the unsafe own keys from every plain object and array reachable from\n * `value`. Deleting an own `__proto__` data property is safe, it does not go\n * through the inherited accessor.\n */\nfunction removeUnsafeKeys(value: unknown, seen: WeakSet<object>): void {\n if (value === null || typeof value !== 'object' || seen.has(value)) {\n return;\n }\n seen.add(value);\n if (Array.isArray(value)) {\n for (const item of value) {\n removeUnsafeKeys(item, seen);\n }\n return;\n }\n if (!isPlainObject(value)) {\n return;\n }\n for (const key of Object.keys(value)) {\n if (UNSAFE_KEYS.has(key)) {\n delete value[key];\n } else {\n removeUnsafeKeys(value[key], seen);\n }\n }\n}\n\nfunction syncObject(\n target: Record<string, unknown>,\n source: Record<string, unknown>\n): void {\n for (const key of Object.keys(target)) {\n if (!Object.hasOwn(source, key)) {\n delete target[key];\n }\n }\n for (const key of Object.keys(source)) {\n if (UNSAFE_KEYS.has(key)) {\n continue;\n }\n // Only own values are synced into, never an inherited one\n const existing = Object.hasOwn(target, key) ? target[key] : undefined;\n target[key] = syncValue(existing, source[key]);\n }\n}\n\nfunction syncArray(target: unknown[], source: unknown[]): void {\n const byId = new Map<string, unknown>();\n for (const item of target) {\n const id = idOf(item);\n if (id !== undefined) {\n byId.set(id, item);\n }\n }\n\n const next = source.map((item, index) => {\n const id = idOf(item);\n const match = id !== undefined ? byId.get(id) : target[index];\n if (id !== undefined && match !== undefined) {\n byId.delete(id);\n }\n return syncValue(match, item);\n });\n\n target.length = 0;\n target.push(...next);\n}\n\nfunction syncValue(existing: unknown, incoming: unknown): unknown {\n if (Array.isArray(existing) && Array.isArray(incoming)) {\n syncArray(existing, incoming);\n return existing;\n }\n if (isPlainObject(existing) && isPlainObject(incoming)) {\n // Do not merge two different identified entities into one object\n const existingId = idOf(existing);\n const incomingId = idOf(incoming);\n if (existingId !== incomingId) {\n return incoming;\n }\n syncObject(existing, incoming);\n return existing;\n }\n return incoming;\n}\n\nfunction idOf(value: unknown): string | undefined {\n if (isPlainObject(value) && typeof value.id === 'string') {\n return value.id;\n }\n return undefined;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n // Object.prototype itself has a null prototype, but must never be written to\n if (value === Object.prototype) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n IActionConfiguration,\n IEndableActionConfiguration,\n IEventActionConfiguration,\n ITimelineActionConfiguration,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {v4 as uuidv4} from 'uuid';\nimport {\n assertKnownOperationName,\n getOperationNameByType,\n type TFluentOperationData,\n type TFluentOperationName,\n} from './operation-lookup.ts';\nimport {syncInPlace} from './sync-in-place.ts';\n\n/**\n *\n * Container factory capable of creating the different kinds of actions.\n * For each type of action a dedicated factory will be returned.\n *\n */\nexport class ActionCreatorFactory {\n constructor(private readonly configurationfactory: ConfigurationFactory) {}\n\n /**\n *\n * Starts the creation of an action in the `actions` list with the specified name\n *\n * @param name\n * @returns\n */\n createAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `initActions` list with the specified name\n *\n * @param name\n * @returns\n */\n createInitAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addInitAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `eventActions` list with the specified name\n *\n * @param name\n * @param eventName the event that starts the action. Without it the action can\n * only be started by name (for example by a `DOMEventListenerController` or\n * `KeyboardController`).\n * @param eventTopic optional topic of the event\n * @returns\n */\n createEventAction(\n name: string,\n eventName?: string,\n eventTopic?: string\n ): ActionCreator {\n const creator = new ActionCreator(name, this);\n const config: Partial<IEventActionConfiguration> = creator.actionConfig;\n if (eventName !== undefined) {\n config.eventName = eventName;\n }\n if (eventTopic !== undefined) {\n config.eventTopic = eventTopic;\n }\n this.configurationfactory.addEventAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `timelineActions` list with the specified name and uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string): TimelineActionCreator {\n const creator = new TimelineActionCreator(name, this);\n this.configurationfactory.addTimelineAction(uri, creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Returns the fluent scope back to the `Configurationfactory`\n *\n * @returns\n */\n end() {\n return this.configurationfactory;\n }\n}\n\n/**\n *\n * A factory that assists in creating an action\n *\n */\nexport class ActionCreator<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n actionConfig: T;\n\n /**\n *\n * Initializes an action configuration with the given name\n *\n * @param name\n * @param factory\n */\n constructor(\n name: string | undefined,\n private readonly factory: ActionCreatorFactory\n ) {\n this.actionConfig = {\n name: name ?? '',\n id: uuidv4(),\n startOperations: [],\n } as unknown as T;\n }\n\n /**\n *\n * The unique id of the action\n *\n * @returns\n */\n getId() {\n return this.actionConfig.id;\n }\n\n /**\n *\n * Sets the name of the action\n *\n * @param name\n * @returns\n * @throws Error when the action is in `actions` or `eventActions` and another\n * action in those lists already has the name\n */\n setName(name: string) {\n // Optional calls: a creator may be constructed with a stand-in factory\n this.factory.end?.()?.assertUniqueActionName?.(name, this.actionConfig);\n this.actionConfig.name = name;\n return this;\n }\n\n /**\n *\n * Passes a copy of the internal state of the `ActionCreator` to the given callback.\n * When the callback returns a configuration, it replaces the action configuration\n * in the `ConfigurationFactory`.\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n syncInPlace(this.actionConfig, deepCopy(newConfig));\n }\n return this;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n * @throws Error when the function is not an operation, or when the operation\n * implementations are not loaded (the DOM-free `eligius/configuration-api` entry)\n */\n addStartOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n return this.addStartOperation(\n getOperationNameByType(\n operationClass,\n 'addStartOperationByType',\n 'addStartOperation'\n ),\n operationData\n );\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name.\n * The operation data is copied, so later changes to the given object do not\n * affect the configuration.\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @param operationData\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n addStartOperation<\n T extends TFluentOperationName,\n O extends TFluentOperationData<T>,\n >(systemName: T, operationData: O) {\n assertKnownOperationName(systemName, this._customOperationNames());\n\n const {startOperations} = this.actionConfig;\n startOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: deepCopy(operationData),\n });\n return this;\n }\n\n /**\n *\n * Returns the fluent scope back to the `ActionCreatorFactory`\n *\n * @returns\n */\n next() {\n return this.factory;\n }\n\n /**\n * The custom operation names of the `ConfigurationFactory`. Optional calls:\n * a creator may be constructed with a stand-in factory.\n */\n protected _customOperationNames(): ReadonlySet<string> | undefined {\n return this.factory.end?.()?.customOperationNames;\n }\n}\n\n/**\n *\n * A factory that assists in creating an endable action\n *\n */\nexport class EndableActionCreator<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionCreator<T> {\n constructor(name: string | undefined, factory: ActionCreatorFactory) {\n super(name, factory);\n this.actionConfig.endOperations = [];\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n * @throws Error when the function is not an operation, or when the operation\n * implementations are not loaded (the DOM-free `eligius/configuration-api` entry)\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n return this.addEndOperation(\n getOperationNameByType(\n operationClass,\n 'addEndOperationByType',\n 'addEndOperation'\n ),\n operationData\n );\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given system name.\n * The operation data is copied, so later changes to the given object do not\n * affect the configuration.\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @param operationData\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n addEndOperation<\n T extends TFluentOperationName,\n O extends TFluentOperationData<T>,\n >(systemName: T, operationData: O) {\n assertKnownOperationName(systemName, this._customOperationNames());\n\n let {endOperations} = this.actionConfig;\n if (!endOperations) {\n endOperations = this.actionConfig.endOperations = [];\n }\n endOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: deepCopy(operationData),\n });\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in creating a timeline action\n *\n */\nexport class TimelineActionCreator extends EndableActionCreator<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n * @throws Error when `end` is given and lower than `start`\n */\n addDuration(start: number, end?: number) {\n if (end !== undefined && start > end) {\n throw new Error(\n `addDuration: start (${start}) cannot be higher than end (${end})`\n );\n }\n this.actionConfig.duration = {\n start: start,\n };\n if (end !== undefined) {\n this.actionConfig.duration.end = end;\n }\n return this;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n IActionConfiguration,\n IEndableActionConfiguration,\n IOperationConfiguration,\n ITimelineActionConfiguration,\n TOperationName,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type * as operations from '@operation/index.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\nimport {isDefined} from 'ts-is-present';\nimport {v4 as uuidv4} from 'uuid';\nimport type {IDuration} from '../../types.ts';\nimport {\n assertKnownOperationName,\n getOperationNameByType,\n type TFluentOperationData,\n type TFluentOperationName,\n} from './operation-lookup.ts';\nimport {syncInPlace} from './sync-in-place.ts';\n\nfunction array_move(arr: any[], old_index: number, new_index: number) {\n if (new_index >= arr.length) {\n new_index = 0;\n } else if (new_index < 0) {\n new_index = arr.length - 1;\n }\n arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\n}\n\n/**\n *\n * A factory that assists in editing an action.\n *\n * The editor works directly on the action configuration that the `ConfigurationFactory` holds,\n * so every edit is reflected in the factory's configuration.\n *\n */\nexport class ActionEditor<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n constructor(\n protected actionConfig: T,\n protected readonly configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Called by the `OperationEditor` after it has changed an operation.\n * Operations are edited in place, so there is nothing left to synchronize.\n */\n updateConfiguration() {}\n\n /**\n *\n * Passes a copy of the current action configuration to the given callback.\n * When the callback returns a configuration, it replaces the action configuration\n * in the factory.\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T | undefined) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n syncInPlace(this.actionConfig, deepCopy(newConfig));\n }\n return this;\n }\n\n /**\n *\n * Sets the action name\n *\n * @param name\n * @returns\n * @throws Error when the action is in `actions` or `eventActions` and another\n * action in those lists already has the name\n */\n setName(name: string) {\n // Optional call: an editor may be constructed with a stand-in factory\n this.configurationFactory.assertUniqueActionName?.(name, this.actionConfig);\n this.actionConfig.name = name;\n return this;\n }\n\n /**\n *\n * Gets the action name\n *\n * @returns\n */\n getName() {\n return this.actionConfig.name;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n * @throws Error when the function is not an operation, or when the operation\n * implementations are not loaded (the DOM-free `eligius/configuration-api` entry)\n */\n addStartOperationByType<T extends TOperation<TOperationData>>(\n operationClass: T,\n operationData: Partial<ExtractOperationDataType<T>>\n ): OperationEditor<this, T> {\n return this.addStartOperation(\n getOperationNameByType(\n operationClass,\n 'addStartOperationByType',\n 'addStartOperation'\n ),\n operationData\n ) as OperationEditor<this, T>;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name.\n * The operation data is copied, so later changes to the given object do not\n * affect the configuration.\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @param operationData\n * @param id\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n addStartOperation<\n N extends TFluentOperationName,\n D extends TFluentOperationData<N>,\n >(\n systemName: N,\n operationData: D,\n id: string = uuidv4()\n ): OperationEditor<this, TOperation<TOperationData>> {\n assertKnownOperationName(systemName, this.getCustomOperationNames());\n\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n\n const newConfig = {\n id,\n systemName: systemName,\n operationData: deepCopy(operationData) as TOperationData,\n } as IOperationConfiguration<TOperationData>;\n\n startOperations.push(newConfig);\n\n this.actionConfig.startOperations = startOperations;\n\n return new OperationEditor<this, TOperation<TOperationData>>(\n newConfig,\n this\n );\n }\n\n /**\n *\n * Starts an editor for the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n editStartOperation(id: string) {\n const {startOperations} = this.actionConfig;\n const operation = startOperations.find(o => o.id === id);\n\n if (isDefined(operation)) {\n return new OperationEditor<ActionEditor<T>, TOperation<TOperationData>>(\n operation,\n this\n );\n }\n\n throw new Error(`start operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeStartOperation(id: string) {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n startOperations.splice(idx, 1);\n this.actionConfig.startOperations = startOperations;\n }\n\n return this;\n }\n\n /**\n *\n * Moves the start operation associated with the given id in the given direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveStartOperation(id: string, direction: 'up' | 'down') {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(startOperations, idx, newIdx);\n this.actionConfig.startOperations = startOperations;\n }\n\n return this;\n }\n\n /**\n *\n * Return the fluent scopt to the `ConfigurationFactory`\n *\n * @returns\n */\n next() {\n return this.configurationFactory;\n }\n\n /**\n * Returns the custom operation names that the `ConfigurationFactory` accepts\n * besides the built-in operations (its `customOperations` option).\n *\n * @returns the custom operation names, or `undefined` when the editor has no factory\n */\n getCustomOperationNames(): ReadonlySet<string> | undefined {\n // Optional chaining: an editor may be constructed with a stand-in factory\n return this.configurationFactory?.customOperationNames;\n }\n}\n\n/**\n *\n * A factory that assists in editing an endable action\n *\n */\nexport class EndableActionEditor<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionEditor<T> {\n /**\n *\n * Adds the operation data for a end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n * @throws Error when the function is not an operation, or when the operation\n * implementations are not loaded (the DOM-free `eligius/configuration-api` entry)\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(\n operationClass: T,\n operationData: Dt\n ): OperationEditor<this, TOperationType> {\n return this.addEndOperation(\n getOperationNameByType(\n operationClass,\n 'addEndOperationByType',\n 'addEndOperation'\n ),\n operationData\n );\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given system name.\n * The operation data is copied, so later changes to the given object do not\n * affect the configuration.\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @param operationData\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n addEndOperation<\n T extends TFluentOperationName,\n O extends TFluentOperationData<T>,\n >(systemName: T, operationData: O) {\n assertKnownOperationName(systemName, this.getCustomOperationNames());\n\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n\n const newConfig = {\n id: uuidv4(),\n systemName: systemName,\n operationData: deepCopy(operationData),\n };\n\n endOperations.push(newConfig);\n\n this.actionConfig.endOperations = endOperations;\n\n return new OperationEditor<this, (typeof operations)[TOperationName]>(\n newConfig,\n this\n );\n }\n\n /**\n *\n * Starts an editor for the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n editEndOperation(id: string) {\n const {endOperations} = this.actionConfig;\n const operationConfig = endOperations.find(o => o.id === id);\n\n if (isDefined(operationConfig)) {\n return new OperationEditor<this>(operationConfig, this);\n }\n\n throw new Error(`operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeEndOperation(id: string) {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n endOperations.splice(idx, 1);\n this.actionConfig.endOperations = endOperations;\n }\n\n return this;\n }\n\n /**\n *\n * Moves the end operation associated with the given id in the specified direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveEndOperation(id: string, direction: 'up' | 'down') {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(endOperations, idx, newIdx);\n this.actionConfig.endOperations = endOperations;\n }\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing a timeline action\n *\n */\nexport class TimelineActionEditor extends EndableActionEditor<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n */\n setDuration(start: number, end?: number) {\n if (end !== undefined && start > end) {\n throw Error('start position cannot be higher than end position');\n }\n\n const duration: IDuration = {\n start,\n };\n\n if (end !== undefined) {\n duration.end = end;\n }\n\n this.actionConfig.duration = duration;\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing an operation\n *\n */\nexport class OperationEditor<\n T extends ActionEditor,\n O extends TOperationType = TOperation<TOperationData>,\n> {\n constructor(\n private operationConfig: IOperationConfiguration<\n ExtractOperationDataType<O>\n >,\n private actionEditor: T\n ) {}\n\n /**\n *\n * Invokes the given callback with a copy of the internal state of the factory\n *\n * @param callBack\n * @returns\n */\n getConfiguration(\n callBack: (\n config: IOperationConfiguration<ExtractOperationDataType<O>>\n ) => IOperationConfiguration<ExtractOperationDataType<O>>\n ) {\n const copy = deepCopy(this.operationConfig);\n const newConfig = callBack.call(this, copy);\n\n if (newConfig) {\n syncInPlace(this.operationConfig, deepCopy(newConfig));\n }\n\n return this;\n }\n\n /**\n *\n * Gets the system name\n *\n * @returns\n */\n getSystemName() {\n return this.operationConfig.systemName;\n }\n\n /**\n *\n * Sets the system name\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n setSystemName(systemName: TFluentOperationName) {\n assertKnownOperationName(\n systemName,\n this.actionEditor.getCustomOperationNames?.()\n );\n\n this.operationConfig.systemName = systemName;\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the operation data. The operation data is copied, so later changes to\n * the given object do not affect the configuration.\n *\n * @param operationData\n * @returns\n */\n setOperationData(operationData: ExtractOperationDataType<O>) {\n this.operationConfig.operationData = deepCopy(operationData);\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the value on the current `operationData` with the given key\n *\n * @param key\n * @param value\n * @returns\n */\n setOperationDataItem(\n key: keyof ExtractOperationDataType<O>,\n value: ExtractOperationDataType<O>[keyof ExtractOperationDataType<O>]\n ) {\n // Copy on write, the current object may still be referenced elsewhere\n return this.setOperationData({\n ...(this.operationConfig.operationData ?? {}),\n [key]: value,\n } as ExtractOperationDataType<O>);\n }\n\n /**\n *\n * returns all of the defined property names on the current `operationData`\n *\n * @returns\n */\n getOperationDataKeys(): Array<keyof ExtractOperationDataType<O>> {\n const {operationData} = this.operationConfig;\n return (operationData ? Object.keys(operationData) : []) as Array<\n keyof ExtractOperationDataType<O>\n >;\n }\n\n /**\n *\n * Gets the value of the given key on the current `operationData`\n *\n * @param key\n * @returns\n */\n getOperationDataValue(key: keyof ExtractOperationDataType<O>) {\n const {operationData} = this.operationConfig;\n return operationData?.[key];\n }\n\n /**\n *\n * Returns the fluent scope back to the action editor\n *\n * @returns\n */\n next() {\n return this.actionEditor;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n IContainerProviderConfig,\n IPlaylistConfig,\n IPositionSourceConfig,\n ITimelineProviderSettings,\n TTimelineProviderSettings,\n} from '@configuration/types.ts';\nimport type {TimelineTypes} from '../../types.ts';\n\n/**\n * Default position source system names for convenience methods.\n */\nconst DEFAULT_POSITION_SOURCES: Record<string, string> = {\n raf: 'RafPositionSource',\n scroll: 'ScrollPositionSource',\n video: 'VideoPositionSource',\n};\n\n/**\n * Default container provider system name.\n */\nconst DEFAULT_CONTAINER_PROVIDER = 'DomContainerProvider';\n\n/**\n * Default playlist system name.\n */\nconst DEFAULT_PLAYLIST = 'SimplePlaylist';\n\nexport class TimelineProvidersSettingsEditor {\n constructor(\n private providersSettings: TTimelineProviderSettings,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Adds a new provider for the specified timeline type.\n *\n * @param timelineType - The timeline type (e.g., 'animation', 'mediaplayer')\n * @param positionSourceSystemName - System name of the position source class (default: 'RafPositionSource')\n * @returns A TimelineProviderSettingsEditor for further configuration\n */\n addProvider(\n timelineType: TimelineTypes,\n positionSourceSystemName = 'RafPositionSource'\n ) {\n if (this.providersSettings[timelineType]) {\n throw new Error(\n `Settings for a '${timelineType}' provider already exist`\n );\n }\n\n const settings: ITimelineProviderSettings = {\n positionSource: {systemName: positionSourceSystemName},\n };\n this.providersSettings[timelineType] = settings;\n return new TimelineProviderSettingsEditor(\n settings,\n this,\n this.configurationFactory\n );\n }\n\n editProvider(timelineType: TimelineTypes) {\n if (!this.providersSettings[timelineType]) {\n throw new Error(`No settings for a '${timelineType}' provider exist yet`);\n }\n\n return new TimelineProviderSettingsEditor(\n this.providersSettings[timelineType] as ITimelineProviderSettings,\n this,\n this.configurationFactory\n );\n }\n\n next() {\n return this.configurationFactory;\n }\n}\n\nexport class TimelineProviderSettingsEditor {\n constructor(\n private providerSettings: ITimelineProviderSettings,\n private providersSettingsEditor: TimelineProvidersSettingsEditor,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Sets the position source configuration with full config object.\n * @param config - Position source configuration with systemName and options\n */\n setPositionSource(config: IPositionSourceConfig) {\n this.providerSettings.positionSource = config;\n return this;\n }\n\n /**\n * Sets the position source by system name with optional configuration.\n * @param systemName - The position source class name (e.g., 'RafPositionSource')\n * @param options - Additional options passed to the position source constructor\n */\n setPositionSourceByName(\n systemName: string,\n options?: Record<string, unknown>\n ) {\n this.providerSettings.positionSource = {\n systemName,\n ...options,\n };\n return this;\n }\n\n /**\n * Convenience method to set position source using shorthand type names.\n * @param type - Shorthand type ('raf', 'scroll', 'video')\n * @param options - Type-specific options (`sources` and `poster` for video)\n * @deprecated Use setPositionSourceByName for explicit control\n */\n setPositionSourceType(\n type: 'raf' | 'scroll' | 'video',\n options?: {\n selector?: string;\n tickInterval?: number;\n poster?: string;\n sources?: Array<{src: string; type: string}>;\n }\n ) {\n const systemName = DEFAULT_POSITION_SOURCES[type];\n if (!systemName) {\n throw new Error(`Unknown position source type: ${type}`);\n }\n\n this.providerSettings.positionSource = {\n systemName,\n ...options,\n };\n return this;\n }\n\n /**\n * Sets the container provider configuration by selector.\n * Uses DomContainerProvider by default.\n * @param selector - CSS selector for the container element\n */\n setContainer(selector: string) {\n this.providerSettings.container = {\n systemName: DEFAULT_CONTAINER_PROVIDER,\n selector,\n };\n return this;\n }\n\n /**\n * Sets the container provider configuration with full config object.\n * @param config - Container provider configuration with systemName\n */\n setContainerConfig(config: IContainerProviderConfig) {\n this.providerSettings.container = config;\n return this;\n }\n\n /**\n * Sets the container provider by system name with options.\n * @param systemName - The container provider class name\n * @param options - Additional options passed to the container provider constructor\n */\n setContainerByName(systemName: string, options: Record<string, unknown>) {\n this.providerSettings.container = {\n systemName,\n ...options,\n } as IContainerProviderConfig;\n return this;\n }\n\n /**\n * Sets the playlist configuration.\n * Uses SimplePlaylist by default.\n * @param items - Array of playlist items\n * @param identifierKey - Key used to identify items (default: 'uri')\n */\n setPlaylist<T>(items: readonly T[], identifierKey = 'uri') {\n this.providerSettings.playlist = {\n systemName: DEFAULT_PLAYLIST,\n items,\n identifierKey,\n } as IPlaylistConfig;\n return this;\n }\n\n /**\n * Sets the playlist configuration with full config object.\n * @param config - Playlist configuration with systemName\n */\n setPlaylistConfig(config: IPlaylistConfig) {\n this.providerSettings.playlist = config;\n return this;\n }\n\n /**\n * Sets the playlist by system name with options.\n * @param systemName - The playlist class name\n * @param options - Additional options including items and identifierKey\n */\n setPlaylistByName(\n systemName: string,\n options: {items: unknown[]; identifierKey: string; [key: string]: unknown}\n ) {\n this.providerSettings.playlist = {\n systemName,\n ...options,\n } as IPlaylistConfig;\n return this;\n }\n\n next() {\n return this.providersSettingsEditor;\n }\n\n end() {\n return this.configurationFactory;\n }\n}\n","/**\n *\n * Merges the properties of the target object into the source object, only the properties that do not exist yet on the source.\n *\n * This function is pure, so it returns a new instance that reflects the merging of the two objects.\n *\n * The merge is shallow.\n *\n * @param target\n * @param source\n * @returns\n */\nexport const mergeIfMissing = <\n Src extends Record<PropertyKey, any>,\n Trg extends Partial<Src> & Record<PropertyKey, any>,\n>(\n target: Src,\n source: Trg\n): Src & Trg =>\n Object.entries(source).reduce(\n (acc, [key, value]) => (key in acc ? acc : {...acc, [key]: value}),\n target\n );\n","import {ActionCreatorFactory} from '@configuration/api/action-creator-factory.ts';\nimport {\n ActionEditor,\n EndableActionEditor,\n TimelineActionEditor,\n} from '@configuration/api/action-editor.ts';\nimport {TimelineProvidersSettingsEditor} from '@configuration/api/timeline-provider-settings-editor.ts';\nimport type {\n IActionConfiguration,\n IContainerProviderConfig,\n IEngineConfiguration,\n IPositionSourceConfig,\n ITimelineActionConfiguration,\n ITimelineConfiguration,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {mergeIfMissing} from '@util/merge-if-missing.ts';\nimport {v4 as uuidv4} from 'uuid';\nimport type {KeysOfType, TimelineTypes, TLanguageCode} from '../../types.ts';\nimport {syncInPlace} from './sync-in-place.ts';\n\n/** */\nexport type TEngineConfigurationLists = KeysOfType<IEngineConfiguration, any[]>;\n\n/**\n * Action names must be unique across these lists.\n */\nconst UNIQUE_NAME_LISTS: TEngineConfigurationLists[] = [\n 'actions',\n 'eventActions',\n];\n\n/**\n * Options for the {@link ConfigurationFactory} constructor.\n */\nexport interface IConfigurationFactoryOptions {\n /**\n * The system names of custom operations that the name based methods\n * (`addStartOperation`, `addEndOperation`, `setSystemName`) accept besides\n * the built-in operations. Only names are needed, so this works in the\n * DOM-free `eligius/configuration-api` entry as well.\n *\n * The implementations are registered with the engine separately, for\n * example `new EligiusResourceImporter({operations: {trackEvent}})`. Custom\n * operations have no generated metadata, so their operation data is not\n * typed or schema-validated.\n */\n customOperations?: readonly string[];\n}\n\nfunction toCustomOperationNames(\n customOperations: readonly string[] | undefined\n): ReadonlySet<string> {\n if (customOperations === undefined) {\n return new Set();\n }\n if (!Array.isArray(customOperations)) {\n throw new Error(\n 'ConfigurationFactory: options.customOperations must be an array of operation names.'\n );\n }\n for (const [index, name] of customOperations.entries()) {\n if (typeof name !== 'string' || !name.length) {\n throw new Error(\n `ConfigurationFactory: options.customOperations[${index}] must be a non-empty string.`\n );\n }\n }\n return new Set(customOperations);\n}\n\ntype ConfigurationFactoryExtension<NewFactory extends ConfigurationFactory> = (\n this: NewFactory,\n ...rest: any[]\n) => void;\n\n/**\n * This class offers a fluent, extensible and strongly typed DSL for creating Eligius configurations.\n *\n * @example Building a configuration using the factory\n * To initialize a basic configuration to start off of:\n * ```ts\n * const factory = new ConfigurationFactory()\n * .init(\"en-US\") // Define the default language\n * .addLanguage(\"en-US\", \"English\") // Add English as a supported language\n * .addLanguage(\"nl-NL\", \"Nederlands\") // Add Dutch as a supported language\n * .setLayoutTemplate(\"<div class=\\\"main.container\\\"></div>\") // Add the main container for the presentation\n * .setContainerSelector(\"#ct-container\") // Selector for the element in the body that will contain the presentation\n * .addTimeline( // Add a first timeline\n * 'timeline-1', // Give it a name\n * \"animation\", // This is RAF based timeline\n * 200, // The duration of the timeline in seconds\n * false, // The presentation does NOT play in a loop\n * \".timeline-container\" // The element within the main layout (defined by the layoutTemplate) in which the timeline will be rendered\n * )\n * .editTimelineProviderSettings() // Add a timeline provider\n * .addProvider(\"animation\", \"RafPositionSource\") // Timelines of type 'animation' get their time from requestAnimationFrame\n * .setContainer(\".timeline-container\") // The element the timeline renders into\n * .end(); // This finally returns the ConfigurationFactory instance\n * ```\n *\n * Then to add an init action:\n * ```ts\n * factory\n * .createInitAction(\"GetUserName\")\n * .addStartOperationByType(getQueryParams, {\n * defaultValues: { username: \"guest\" },\n * })\n * .addStartOperationByType(setGlobalData, { properties: [\"queryParams\"] });\n * ```\n *\n * After that, add a timeline action:\n * ```ts\n * factory.createTimelineAction(\"timeline-1\", \"AddIntroContainer\")\n * .addDuration(0, 10)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(setElementContent, {\n * template: '<div class=\"intro-text\"></div>',\n * })\n * .addEndOperationByType(selectElement, { selector: \".intro-text\" })\n * .addEndOperationByType(removeElement, {});\n * ```\n *\n * It also possible to extend the factory with specialized creation methods for the particular\n * configuration you are building:\n * ```ts\n * function addImage(this: ConfigurationFactory, actionName: string, imageSrc: string, imageId: string) {\n * this.createInitAction(actionName)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(createElement, { elementName: 'img', attributes: {src: imageSrc, id: imageId} })\n * .addStartOperationByType(setElementContent, { insertionType: \"append\" })\n * .addEndOperationByType(selectElement, { selector: `#${imageId}` })\n * .addEndOperationByType(removeElement, {});\n * }\n *\n * const customFactory = ConfigurationFactory.extend(factory, \"addImage\", addImage);\n *\n * customFactory.addImage(\"MyImageActionName\", \"my-image.png\", \"my-image-id\");\n * ```\n *\n * Finally, retrieve the configuration and save it:\n * ```ts\n * import fs from \"node:fs\";\n *\n * const configuration = customFactory.getConfiguration();\n *\n * fs.writeFileSync(\"/my/path/configuration.json\", JSON.stringify(configuration), {encoding:'utf-8'})\n * ```\n *\n * In plain Node (build tools, code generators) import the factory from `eligius/configuration-api`.\n * That entry does not load jQuery or the other DOM dependencies. It supports every method except the\n * `...ByType` ones, which need the operation implementations; use the name based methods there:\n * ```ts\n * import {ConfigurationFactory} from 'eligius/configuration-api';\n *\n * factory.createAction('MyAction').addStartOperation('selectElement', {selector: '#app'});\n * ```\n *\n * The `ConfigurationFactory` can also be used to edit an existing configuration. In this case, simply\n * pass the JSON configuration to the `ConfigurationFactory`'s constructor:\n * ```ts\n * import myConfiguration from './my-configuration.json';\n *\n * const factory = new ConfigurationFactory(myConfiguration);\n *\n * factory.editInitAction(\"existingActionName\")\n * .removeEndOperation(\"475fd0ab-5755-4e60-8f7c-e1988a109678\");\n * ```\n */\nexport class ConfigurationFactory {\n actionCreatorFactory: ActionCreatorFactory;\n\n /**\n * The custom operation names this factory accepts besides the built-in\n * operations, from the `customOperations` option.\n */\n readonly customOperationNames: ReadonlySet<string>;\n\n /**\n * Constructs a new `ConfigurationFactory`\n * @param configuration an optional existing configuration that will be used as a starting point\n * @param options optional settings, see {@link IConfigurationFactoryOptions}\n * @throws Error when `options.customOperations` is not an array of non-empty strings\n *\n * @example Accepting a custom operation\n * ```ts\n * const factory = new ConfigurationFactory(undefined, {customOperations: ['trackEvent']});\n * factory.createAction('Track').addStartOperation('trackEvent', {category: 'intro'});\n * ```\n */\n constructor(\n public configuration: IEngineConfiguration = {} as any,\n options: IConfigurationFactoryOptions = {}\n ) {\n this.customOperationNames = toCustomOperationNames(\n options?.customOperations\n );\n this.actionCreatorFactory = new ActionCreatorFactory(this);\n }\n\n /**\n * Add specialized method to a factory\n *\n * @param factory\n * @param extensionMethodName\n * @param extensionMethod\n * @returns\n */\n static extend<\n T extends ConfigurationFactory,\n K extends PropertyKey,\n C extends (this: T & {[P in K]: C}, ...args: any[]) => any,\n >(factory: T, extensionMethodName: K, extensionMethod: C): T & {[P in K]: C} {\n return Object.defineProperty<T & {[P in K]: C}>(\n factory as any,\n extensionMethodName,\n {\n value: function (this: T & {[P in K]: C}, ...args: Parameters<C>) {\n return extensionMethod.apply(this, args);\n },\n writable: true,\n configurable: true,\n }\n );\n }\n\n /**\n * Add specialized methods to a factory\n *\n * @param factory\n * @param extensions\n * @returns\n */\n static extendMultiple<\n T extends ConfigurationFactory,\n C extends ConfigurationFactoryExtension<T>,\n D extends {[name: string]: C},\n >(factory: T, extensions: D) {\n return Object.entries(extensions).reduce<T & typeof extensions>(\n (acc, [name, method]) =>\n ConfigurationFactory.extend(acc, name, method) as T & typeof extensions,\n factory as T & typeof extensions\n );\n }\n\n /**\n * Initialize the configuration with a minimal shape.\n *\n * It assigns an ID, sets the engine to `EligiusEngine`, default the containerSelector `[data-ct-container=true]`\n * and initializes all of the list properties with empty arrays.\n * @param defaultLanguage\n * @returns\n */\n init(defaultLanguage: TLanguageCode) {\n const newConfiguration: IEngineConfiguration = {\n id: uuidv4(),\n engine: {\n systemName: 'EligiusEngine',\n },\n containerSelector: '[data-ct-container=true]',\n cssFiles: [],\n timelineProviderSettings: {},\n language: defaultLanguage,\n availableLanguages: [],\n layoutTemplate: '',\n initActions: [],\n actions: [],\n timelines: [],\n };\n\n this.configuration = mergeIfMissing(this.configuration, newConfiguration);\n\n return this;\n }\n\n /**\n * Assigns the engine system name\n * @param systemName\n * @returns\n */\n setEngine(systemName: string) {\n this.configuration.engine.systemName = systemName;\n return this;\n }\n\n /**\n * Assigns a string representation of the HTML layout template for the engine.\n *\n * @param layoutTemplate\n * @returns\n */\n setLayoutTemplate(layoutTemplate: string) {\n this.configuration.layoutTemplate = layoutTemplate;\n return this;\n }\n\n /**\n *\n * Assigns the default language\n *\n * @param defaultLanguage\n * @returns\n */\n setDefaultLanguage(defaultLanguage: TLanguageCode) {\n this.configuration.language = defaultLanguage;\n return this;\n }\n\n /**\n *\n * Assign the css selector that specifies the DOM location where the engine renders its output\n *\n * @param selector\n * @returns\n */\n setContainerSelector(selector: string) {\n this.configuration.containerSelector = selector;\n return this;\n }\n\n /**\n *\n * Starts an editing process for the timeline provider settings.\n *\n * @returns\n */\n editTimelineProviderSettings() {\n this.configuration.timelineProviderSettings ??= {};\n return new TimelineProvidersSettingsEditor(\n this.configuration.timelineProviderSettings,\n this\n );\n }\n\n /**\n *\n * Return a copy of the current state of the configuration\n *\n * @param callBack the callback receives a copy of the configuration and can return a changed version. The changes are applied to the factory's configuration in place, so editors that are still open keep working.\n * @returns\n */\n getConfiguration(\n callBack?: (copy: IEngineConfiguration) => IEngineConfiguration\n ) {\n const copy = deepCopy<IEngineConfiguration>(this.configuration);\n if (callBack) {\n const newConfig = callBack.call(this, copy);\n // Update the existing configuration in place, so editors that hold\n // objects inside it stay attached to the factory.\n syncInPlace(\n this.configuration,\n deepCopy<IEngineConfiguration>(newConfig)\n );\n }\n return copy;\n }\n\n /**\n *\n * Adds a language to the `availableLanguages` list.\n * The label represents the name of the language.\n *\n * An error is thrown if a language with the given language code already exists\n *\n * @example\n * factory.addLanguage('en-GB', 'English');\n *\n * @param languageCode The given alnguage code\n * @param languageLabel The human readable name of the language\n * @returns\n */\n addLanguage(languageCode: TLanguageCode, languageLabel: string) {\n const languages = this._initializeCollection(\n this.configuration,\n 'availableLanguages'\n );\n const existing = languages.find(lang => lang.languageCode === languageCode);\n\n if (existing) {\n throw new Error(`Language code '${languageCode}' already exists`);\n }\n\n languages.push({\n id: uuidv4(),\n languageCode: languageCode,\n label: languageLabel,\n });\n return this;\n }\n\n private _internalAddAction(\n collectionName: TEngineConfigurationLists,\n action: IActionConfiguration\n ) {\n if (UNIQUE_NAME_LISTS.includes(collectionName)) {\n this._assertActionNameFree(action.name, action);\n }\n const actions = this._initializeCollection(\n this.configuration,\n collectionName\n );\n actions?.push(action as any);\n }\n\n /**\n * Throws when the given action is in `actions` or `eventActions` and another\n * action in those lists already has the given name. Action names must be\n * unique across those two lists, the rule the `ConfigurationResolver`\n * enforces, so the fluent API reports a duplicate where it is made instead of\n * when the engine is created. Init actions and timeline actions are not\n * checked.\n *\n * Called by the action creators and editors before they rename an action.\n *\n * @param name the new action name\n * @param action the action that gets the name\n * @throws Error when the name is already taken\n */\n assertUniqueActionName(name: string, action: IActionConfiguration): void {\n const isChecked = UNIQUE_NAME_LISTS.some(listName =>\n (\n this.configuration[listName] as IActionConfiguration[] | undefined\n )?.includes(action)\n );\n if (isChecked) {\n this._assertActionNameFree(name, action);\n }\n }\n\n private _assertActionNameFree(name: string, action: IActionConfiguration) {\n // Empty names are not checked, so an action can be created first and named later\n if (!name) {\n return;\n }\n const taken = UNIQUE_NAME_LISTS.some(listName =>\n (\n this.configuration[listName] as IActionConfiguration[] | undefined\n )?.some(other => other !== action && other.name === name)\n );\n if (taken) {\n throw new Error(\n `Action name '${name}' already exists in actions or eventActions. Action names must be unique across actions and eventActions.`\n );\n }\n }\n\n private _initializeCollection<T, K extends keyof T>(\n parent: T,\n name: K\n ): T[K] {\n if (!parent[name]) {\n (parent[name] as any) = [];\n }\n return parent[name] as T[K];\n }\n\n /**\n *\n * Adds the specified action to the `actions` list.\n *\n * @param action\n */\n addAction(action: IActionConfiguration) {\n this._internalAddAction('actions', action);\n }\n\n /**\n *\n * Adds the specified action to the `initActions` list\n *\n * @param action\n */\n addInitAction(action: IActionConfiguration) {\n this._internalAddAction('initActions', action);\n }\n\n /**\n *\n * Adds the specified action to the `eventActions` list\n *\n * @param action\n */\n addEventAction(action: IActionConfiguration) {\n this._internalAddAction('eventActions', action);\n }\n\n /**\n *\n * Adds the given actions to `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param action\n */\n addTimelineAction(uri: string, action: ITimelineActionConfiguration) {\n const timeline = this.getTimeline(uri);\n if (timeline) {\n const timelineActions = this._initializeCollection(\n timeline,\n 'timelineActions'\n );\n timelineActions.push(action);\n } else {\n throw Error(`No timeline found for uri '${uri}'`);\n }\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `actions` list\n *\n * @param name\n * @returns\n */\n createAction(name: string) {\n return this.actionCreatorFactory.createAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `initActions` list\n *\n * @param name\n * @returns\n */\n createInitAction(name: string) {\n return this.actionCreatorFactory.createInitAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `eventActions` list\n *\n * @param name\n * @param eventName the event that starts the action. Without it the action can\n * only be started by name (for example by a `DOMEventListenerController` or\n * `KeyboardController`).\n * @param eventTopic optional topic of the event\n * @returns\n *\n * @example\n * ```ts\n * factory\n * .createEventAction('OnLanguageChange', 'language-change')\n * .addStartOperation('log', {});\n * ```\n */\n createEventAction(name: string, eventName?: string, eventTopic?: string) {\n return this.actionCreatorFactory.createEventAction(\n name,\n eventName,\n eventTopic\n );\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string) {\n return this.actionCreatorFactory.createTimelineAction(uri, name);\n }\n\n /**\n * Add a timeline with the given data\n *\n * @param uri identifier for the timeline\n * @param type animation or mediaplayer\n * @param duration the duration of the timeline in seconds\n * @param isLooped True if the timeline should automatically restart at the end\n * @param selector css selector for the container where the timeline will be rendered\n * @returns\n */\n addTimeline(\n uri: string,\n type: TimelineTypes,\n duration: number,\n isLooped: boolean,\n selector: string\n ) {\n const timelines = this._initializeCollection(\n this.configuration,\n 'timelines'\n );\n const timeline = this.getTimeline(uri);\n if (timeline) {\n throw Error(`timeline for uri ${uri} already exists`);\n }\n const timelineConfig: ITimelineConfiguration = {\n id: uuidv4(),\n type: type,\n uri: uri,\n duration: duration,\n loop: isLooped,\n selector: selector,\n timelineActions: [],\n };\n timelines.push(timelineConfig);\n return this;\n }\n\n /**\n * Gives the timeline its own position source settings, merged over the\n * settings of its type in `timelineProviderSettings` (see\n * `ITimelineConfiguration.positionSource`).\n *\n * @param uri - URI of the timeline\n * @param positionSource - The override. Leave out `systemName` to change\n * single settings of the type's position source, or name another class to\n * replace it for this timeline. `undefined` removes the override.\n * @returns The factory\n * @throws Error when no timeline has the URI\n *\n * @example\n * ```ts\n * factory\n * .addTimeline('intro', 'animation', 10, false, '#intro')\n * .addTimeline('chapter-1', 'animation', 60, false, '#chapter-1')\n * .setTimelinePositionSource('chapter-1', {\n * systemName: 'ScrollPositionSource',\n * selector: '#chapter-1',\n * });\n * ```\n */\n setTimelinePositionSource(\n uri: string,\n positionSource: Partial<IPositionSourceConfig> | undefined\n ) {\n const timeline = this._requireTimeline(uri, 'setTimelinePositionSource');\n if (positionSource === undefined) {\n delete timeline.positionSource;\n } else {\n timeline.positionSource = deepCopy(positionSource);\n }\n return this;\n }\n\n /**\n * Gives the timeline its own container provider settings, merged over the\n * `container` settings of its type in `timelineProviderSettings` (see\n * `ITimelineConfiguration.containerProvider`).\n *\n * @param uri - URI of the timeline\n * @param containerProvider - The override, for example\n * `{selector: '#chapter-1'}`. `undefined` removes the override.\n * @returns The factory\n * @throws Error when no timeline has the URI\n */\n setTimelineContainerProvider(\n uri: string,\n containerProvider: Partial<IContainerProviderConfig> | undefined\n ) {\n const timeline = this._requireTimeline(uri, 'setTimelineContainerProvider');\n if (containerProvider === undefined) {\n delete timeline.containerProvider;\n } else {\n timeline.containerProvider = deepCopy(containerProvider);\n }\n return this;\n }\n\n private _requireTimeline(uri: string, methodName: string) {\n const timeline = this.configuration.timelines\n ? this.getTimeline(uri)\n : undefined;\n if (!timeline) {\n throw new Error(\n `ConfigurationFactory.${methodName}: no timeline found for uri '${uri}'`\n );\n }\n return timeline;\n }\n\n /**\n *\n * Gets the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n getTimeline(uri: string) {\n return this.configuration.timelines.find(t => t.uri === uri);\n }\n\n /**\n *\n * Removes the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n removeTimeline(uri: string) {\n const timelineConfig = this.getTimeline(uri);\n if (timelineConfig) {\n const idx = this.configuration.timelines.indexOf(timelineConfig);\n if (idx > -1) {\n this.configuration.timelines.splice(idx, 1);\n }\n }\n return this;\n }\n\n /**\n *\n * Starts an editor for the action from the `actions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editAction(id: string) {\n const actionConfig = this.configuration.actions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `eventActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editEventAction(id: string) {\n const actionConfig = this.configuration.eventActions?.find(\n a => a.id === id\n );\n if (actionConfig) {\n return new ActionEditor(actionConfig, this);\n }\n throw new Error(`Event action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `initActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editInitAction(id: string) {\n const actionConfig = this.configuration.initActions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Init action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `timelineActions` list associated with the given uri and id\n *\n * @param uri\n * @param id\n * @returns\n */\n editTimelineAction(uri: string, id: string) {\n const timeline = this.getTimeline(uri);\n if (!timeline) {\n throw new Error(`No timeline found for uri '${uri}'`);\n }\n const actionConfig = timeline.timelineActions.find(a => a.id === id);\n if (actionConfig) {\n return new TimelineActionEditor(actionConfig, this);\n }\n throw new Error(\n `Timeline action not found for id '${id}' in timeline '${uri}'`\n );\n }\n}\n","import type { IDOMEventListenerControllerOperationData } from \"@controllers/dom-event-listener-controller.ts\";\nimport type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function DOMEventListenerController(): IControllerMetadata<IDOMEventListenerControllerOperationData> {\n return {\n description: `This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\nexecutes the given actions with the given operation data.\n\nBy default the \\`start\\` operations of the specified actions are executed. To execute the \\`end\\` operations instead,\nprefix the action name with \\`end:\\`.\n\nThe actions receive a copy of \\`actionOperationData\\` plus \\`eventTarget\\` (the event's target) and, for key events,\n\\`eventKey\\` (the \\`KeyboardEvent.key\\`). They run in order, each receiving the operation data the previous one\nreturned. When an action fails, the\nremaining actions are skipped and the failure is reported through the eventbus's \\`reportError\\` (an error naming\nthis controller, the action and the DOM event, with the original error as \\`cause\\`), or logged with\n\\`console.error\\` when the eventbus has no \\`reportError\\`.`,\n dependentProperties: ['selectedElement'],\n properties: {\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n },\n actions: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n },\n actionOperationData: {\n type: 'ParameterType:object',\n }\n },\n };\n}\n","import type { IKeyboardControllerOperationData } from \"@controllers/keyboard-controller.ts\";\nimport type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function KeyboardController(): IControllerMetadata<IKeyboardControllerOperationData> {\n return {\n description: `This controller runs the given actions when one of the given keys is pressed.\n\nBy default the \\`start\\` operations of the specified actions are executed. To execute the \\`end\\` operations instead,\nprefix the action name with \\`end:\\`.\n\nThe actions receive a copy of \\`actionOperationData\\` plus \\`eventTarget\\` (the focused element, or the body when\nnothing has focus) and \\`eventKey\\` (the \\`KeyboardEvent.key\\`). They run in order, each receiving the operation data\nthe previous one returned. When an action fails, the remaining actions are skipped and the failure is reported\nthrough the eventbus's \\`reportError\\`, or logged with \\`console.error\\` when the eventbus has no \\`reportError\\`.\n\nWith \\`scope: 'document'\\` (the default) the keys work while the focus is inside the engine root, or while nothing\nhas focus. With \\`scope: 'element'\\` they only work while the focus is inside the selected element. Presses in\n\\`input\\`, \\`select\\`, \\`textarea\\` and contenteditable elements are ignored, so typing keeps working. A handled press\nhas its default action prevented (no scrolling for arrow keys and space); a held key runs the actions once, not\nagain for every key repeat.\n\nWhen the keys include the play toggle hotkey of the engine (space by default), or a key that the engine's\nKeyboardStepSource binds (the arrow keys, \\`shift+left\\`/\\`shift+right\\`, \\`home\\` and \\`end\\`), the controller wins: a\npress it handles runs its actions and does not toggle playback or step the timeline. A press it ignores (for\nexample outside the selected element with \\`scope: 'element'\\`) still does.\n\nThe keys are bound in the hotkeys-js \\`'all'\\` scope, so they work whatever scope a KeyboardStepSource sets. The\nhotkeys-js global \\`filter\\` still applies. Detaching removes only this controller's handler.`,\n dependentProperties: ['selectedElement'],\n properties: {\n keys: {\n type: 'ParameterType:string',\n required: true,\n },\n actions: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n },\n actionOperationData: {\n type: 'ParameterType:object',\n },\n scope: {\n type: [\n { value: 'document' },\n { value: 'element' }\n ],\n }\n },\n };\n}\n","import type { ILabelControllerMetadata } from \"@controllers/label-controller.ts\";\nimport type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LabelController(): IControllerMetadata<ILabelControllerMetadata> {\n return {\n description: `This controller attaches to the given selected element and renders the text\nassociated with the given translation key.\n\nTranslations may contain simple inline markup. They are passed through\n\\`sanitizeHtml\\` before insertion, so \\`<br>\\`, \\`<strong>\\`, \\`<em>\\`,\n\\`<span>\\` and http(s)/mailto/relative links render, while scripts, event\nhandlers, \\`javascript:\\` URLs, images, iframes and SVG are removed.\n\nThe controller listens for the \\`language-change\\` event and re-renders the text\nwith the new language after such an event.\n\nUses the rosetta-based locale system via \\`request-translation\\` event.`,\n dependentProperties: ['selectedElement'],\n properties: {\n translationKey: {\n type: 'ParameterType:string',\n required: true,\n },\n attributeName: {\n type: 'ParameterType:string',\n }\n },\n };\n}\n","import type { ILottieControllerMetadata } from \"@controllers/lottie-controller.ts\";\nimport type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LottieController(): IControllerMetadata<ILottieControllerMetadata> {\n return {\n description: `This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n\nThe url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json\n\nlottie-web is an optional peer dependency. It is loaded with a dynamic\n\\`import()\\` the first time a LottieController attaches, so applications that\nnever use this controller do not need it installed.`,\n properties: {\n url: {\n type: 'ParameterType:url',\n }\n },\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { IMutationObserverControllerMetadata } from \"@controllers/mutation-observer-controller.ts\";\n\nexport function MutationObserverController(): IControllerMetadata<IMutationObserverControllerMetadata> {\n return {\n description: `Controller that observes DOM mutations on a selected element and broadcasts events.\n\nThis controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\ntext content) on a specified element. All detected mutations are broadcasted through the\nEligius eventbus, enabling reactive behavior in response to DOM changes.\n\nThe controller follows the standard Eligius lifecycle:\n- init(): Store configuration metadata\n- attach(): Create and start the MutationObserver\n- detach(): Disconnect the observer and clean up resources`,\n dependentProperties: ['selectedElement'],\n properties: {\n observeAttributes: {\n type: 'ParameterType:boolean',\n },\n observeChildList: {\n type: 'ParameterType:boolean',\n },\n observeCharacterData: {\n type: 'ParameterType:boolean',\n },\n observeSubtree: {\n type: 'ParameterType:boolean',\n },\n attributeOldValue: {\n type: 'ParameterType:boolean',\n },\n characterDataOldValue: {\n type: 'ParameterType:boolean',\n },\n attributeFilter: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n }\n },\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { INavigationControllerOperationData } from \"@controllers/navigation-controller.ts\";\n\nexport function NavigationController(): IControllerMetadata<INavigationControllerOperationData> {\n return {\n description: `Renders a navigation menu in the selected element and keeps it in sync with\nthe active navigation entry.\n\nActivating a menu item (click, Enter or Space) navigates to its entry:\n- an entry with a \\`timelineUri\\` broadcasts \\`request-timeline-uri\\`\n [timelineUri, position], which the engine handles by switching timelines;\n- an entry without one broadcasts the legacy \\`request-video-url\\`\n [videoUrlIndex, position], which the engine does not handle.\n\nWith \\`autoNext\\`, the next entry is started when the active entry's timeline\ncompletes (\\`timeline-complete\\`) or, for legacy entries, on \\`video-complete\\`.\nWhen the engine switches to a timeline that an entry names\n(\\`timeline-current-timeline-change\\`), that entry becomes the active one.`,\n dependentProperties: ['selectedElement'],\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { IProgressbarControllerOperationData } from \"@controllers/progressbar-controller.ts\";\n\nexport function ProgressbarController(): IControllerMetadata<IProgressbarControllerOperationData> {\n return {\n description: `This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n\nThe current progress as a percentage is rendered in the given text element.`,\n dependentProperties: ['selectedElement', 'textElement'],\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { IRoutingControllerOperationData } from \"@controllers/routing-controller.ts\";\n\nexport function RoutingController(): IControllerMetadata<IRoutingControllerOperationData> {\n return {\n description: `Keeps the browser history in sync with the navigation entries: each entry\ngets a \\`#/<id>/<position>\\` URL, and back/forward navigation requests the\nentry in the URL.\n\nRequests go to the engine as \\`request-timeline-uri\\` for entries with a\n\\`timelineUri\\`, and as the legacy \\`request-video-url\\` otherwise. Before the\nengine switches timelines (\\`before-request-timeline-uri\\`, or the legacy\n\\`before-request-video-url\\`), the current entry is saved with its position.\n\nThis is a work in progress, do not use this yet please....`,\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { ISubtitlesControllerOperationData } from \"@controllers/subtitles-controller.ts\";\n\nexport function SubtitlesController(): IControllerMetadata<ISubtitlesControllerOperationData> {\n return {\n description: `This controller shows the subtitle whose duration contains the current\ntimeline position in the selected element, in the current language, and\nre-renders it after a \\`language-change\\` event.\n\nThe starting language is the locale's current language\n(\\`request-current-language\\`); the configured \\`language\\` is only used when\nnothing answers that request.\n\nSubtitle texts may contain simple inline markup. They are passed through\n\\`sanitizeHtml\\` before insertion, so \\`<br>\\`, \\`<i>\\`, \\`<em>\\`,\n\\`<strong>\\` and \\`<span>\\` render, while scripts, event handlers,\n\\`javascript:\\` URLs, images, iframes and SVG are removed.`,\n dependentProperties: ['selectedElement'],\n properties: {\n language: {\n type: 'ParameterType:languagecode',\n },\n subtitleData: {\n type: 'ParameterType:array',\n }\n },\n };\n}\n","export { DOMEventListenerController } from \"@controllers/metadata/dom-event-listener-controller.ts\";\nexport { KeyboardController } from \"@controllers/metadata/keyboard-controller.ts\";\nexport { LabelController } from \"@controllers/metadata/label-controller.ts\";\nexport { LottieController } from \"@controllers/metadata/lottie-controller.ts\";\nexport { MutationObserverController } from \"@controllers/metadata/mutation-observer-controller.ts\";\nexport { NavigationController } from \"@controllers/metadata/navigation-controller.ts\";\nexport { ProgressbarController } from \"@controllers/metadata/progressbar-controller.ts\";\nexport { RoutingController } from \"@controllers/metadata/routing-controller.ts\";\nexport { SubtitlesController } from \"@controllers/metadata/subtitles-controller.ts\";\nexport * from \"@controllers/metadata/types.ts\";\n","import type {TControllerName, TOperationName} from '@configuration/types.ts';\nimport * as controllerMetadata from '@controllers/metadata/index.ts';\nimport * as operationMetadata from '@operation/metadata/index.ts';\nimport type {IOperationMetadata} from '@operation/metadata/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\n// The providers read the generated metadata instead of the operation and\n// controller implementations, so they work in a DOM-less context. The metadata\n// has one entry per operation and per controller.\n\n/**\n *\n * Provider for all the available operation names\n *\n */\nexport class OperationNamesProvider {\n getOperationNames(): TOperationName[] {\n return Object.keys(operationMetadata) as TOperationName[];\n }\n}\n\n/**\n *\n * Provider for all the available controller names\n *\n */\nexport class ControllerNamesProvider {\n getControllerNames(): TControllerName[] {\n return Object.keys(controllerMetadata) as TControllerName[];\n }\n}\n\n/**\n *\n * Provider that can retrieve the metadata associated with a given operation name\n *\n */\nexport class OperationMetadataProvider {\n getOperationMetadata(operationName: TOperationName) {\n const getMetadata = (\n operationMetadata as Record<\n TOperationName,\n () => IOperationMetadata<TOperationData>\n >\n )[operationName];\n if (!getMetadata) {\n throw new Error(\n `Could not find metadata for operation called ${operationName}`\n );\n }\n return getMetadata();\n }\n}\n","import {v4 as uuidv4} from 'uuid';\nimport type {IStrictDuration, ISubtitle} from '../../types.ts';\n\n/**\n * This class converts an AVID subtitle file to an `ISubtitle` array.\n *\n * Every subtitle gets a unique `id`. The lines of a multi-line caption are\n * joined with a newline (`\\n`), never with HTML.\n */\nexport class SubtitleImporter {\n importSubtitles(rawLines: string[]): ISubtitle[] {\n const result: ISubtitle[] = [];\n const lines: string[] = [];\n for (let i: number = 0, l: number = rawLines.length; i < l; i++) {\n const rawLine: string = this.stripNewlineChars(rawLines[i].toString());\n if (this.isValidLine(rawLine)) {\n lines.push(rawLine);\n }\n }\n\n // A caption is a duration line followed by its text lines, blank lines\n // separate the captions.\n let duration: IStrictDuration | undefined;\n let textLines: string[] = [];\n const flush = () => {\n if (duration) {\n result.push({id: uuidv4(), duration, text: textLines.join('\\n')});\n }\n duration = undefined;\n textLines = [];\n };\n lines.forEach((line: string) => {\n if (line.length === 0) {\n flush();\n } else if (!duration) {\n duration = this.convertDuration(line);\n } else {\n textLines.push(line);\n }\n });\n flush();\n\n return result;\n }\n\n stripNewlineChars(str: string): string {\n let res: string = '';\n for (let i: number = 0, l: number = str.length; i < l; i++) {\n if (str.charCodeAt(i) !== 13 && str.charCodeAt(i) !== 0) {\n res += str.charAt(i);\n }\n }\n return res;\n }\n\n isValidLine(line: string): boolean {\n return (\n !line.startsWith('@') &&\n !line.startsWith('<begin subtitles>') &&\n !line.startsWith('<end subtitles>')\n );\n }\n\n convertDuration(time: string): IStrictDuration {\n const times: string[] = time.split(' ');\n return {\n start: this.convertTimeToSeconds(times[0]),\n end: this.convertTimeToSeconds(times[1]),\n };\n }\n\n convertTimeToSeconds(time: string): number {\n const parts: string[] = time.split(':');\n return (\n parseInt(parts[0], 10) * 3600 +\n parseInt(parts[1], 10) * 60 +\n parseInt(parts[2], 10)\n );\n }\n}\n","import {v4 as uuidv4} from 'uuid';\nimport type {\n IStrictDuration,\n ISubtitle,\n ISubtitleCollection,\n TLanguageCode,\n} from '../../types.ts';\n\n/**\n * Used to edit and add to an {@link ISubtitleCollection}.\n */\nexport class SubtitleEditor {\n constructor(private collection: ISubtitleCollection[] = []) {}\n\n private _getLanguage(languageCode: string) {\n return this.collection.find(x => x.languageCode === languageCode);\n }\n\n /**\n * Adds a new {@link ISubtitleCollection} for the given `languageCode`.\n *\n * If collections already exist for existing language codes then a duplicate\n * of these collections is created with the same duration info but all of the\n * text is left empty.\n *\n * @param languageCode\n * @returns\n */\n addLanguage(languageCode: TLanguageCode) {\n const language = this._getLanguage(languageCode);\n if (language) {\n throw new Error(`Language ${languageCode} already exists.`);\n }\n const newLanguage: ISubtitleCollection = this.collection.length\n ? {\n ...this.collection[0],\n languageCode,\n titles: this.collection[0].titles.map(x => ({\n id: uuidv4(),\n duration: {...x.duration},\n text: '',\n })),\n }\n : {\n languageCode,\n titles: [],\n };\n this.collection.push(newLanguage);\n return this;\n }\n\n /**\n *\n * Add a single subtitle line that is associated with the given `languageCode`\n *\n * @param languageCode\n * @param subtitle\n * @returns\n */\n addSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n language.titles.push(subtitle);\n return this;\n }\n\n addSubtitles(\n duration: IStrictDuration,\n subtitles: Record<TLanguageCode, string>\n ) {\n Object.entries(subtitles).forEach(([languageCode, subtitle]) =>\n this.addSubtitle(languageCode as TLanguageCode, {\n id: uuidv4(),\n duration: {...duration},\n text: subtitle,\n })\n );\n return this;\n }\n\n setSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n\n const titleIdx = language.titles.findIndex(x => x.id === subtitle.id);\n if (titleIdx < 0) {\n throw new Error(\n `Subtitle with id '${subtitle.id}' was not found in language with code ${languageCode}.`\n );\n }\n\n language.titles[titleIdx] = {\n ...subtitle,\n duration: {...subtitle.duration},\n };\n return this;\n }\n\n export() {\n return this.collection;\n }\n}\n"],"mappings":";;;;;;AAAA,MAAM,mBAAmB,SAAS,UAAU;;AAE5C,MAAM,0BAA0B,iBAAiB,KAAK,MAAM;;;;;;;;;;;AAY5D,SAAgBA,gBACd,OACuC;CACvC,IAAI,UAAU,QAAQ,OAAO,UAAU,UACrC,OAAO;CAET,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,IAAI,cAAc,QAAQ,cAAc,OAAO,WAC7C,OAAO;CAIT,IAAI,OAAO,eAAe,SAAS,MAAM,MACvC,OAAO;CAET,MA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,cAChD,KAAK,YAAY,cAA+B;GAC9C,IAAIA,GAAO;GACX,UAAU,EAAC,GAAG,SAAQ;GACtB,MAAM;EACR,CAAC,CACH;EACA,OAAO;CACT;CAEA,YAAY,cAA6B,UAAqB;EAC5D,MAAM,WAAW,KAAK,aAAa,YAAY;EAC/C,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,YAAY,aAAa,iBAAiB;EAG5D,MAAM,WAAW,SAAS,OAAO,WAAU,MAAK,EAAE,OAAO,SAAS,EAAE;EACpE,IAAI,WAAW,GACb,MAAM,IAAI,MACR,qBAAqB,SAAS,GAAG,wCAAwC,aAAa,EACxF;EAGF,SAAS,OAAO,YAAY;GAC1B,GAAG;GACH,UAAU,EAAC,GAAG,SAAS,SAAQ;EACjC;EACA,OAAO;CACT;CAEA,SAAS;EACP,OAAO,KAAK;CACd;AACF"}
1
+ {"version":3,"file":"configuration-api.mjs","names":["isPlainObject","isPlainObject","operationMetadata","uuidv4","uuidv4","uuidv4","operationMetadata","controllerMetadata","uuidv4","uuidv4"],"sources":["../src/util/guards/is-plain-object.ts","../src/operation/helper/deep-copy.ts","../src/operation/metadata/add-class.ts","../src/operation/metadata/add-controller-to-element.ts","../src/operation/metadata/add-globals-to-operation.ts","../src/operation/metadata/animate-with-class.ts","../src/operation/metadata/animate.ts","../src/operation/metadata/announce-to-screen-reader.ts","../src/operation/metadata/break-for-each.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/clear-storage.ts","../src/operation/metadata/compare-date.ts","../src/operation/metadata/concatenate-strings.ts","../src/operation/metadata/continue-for-each.ts","../src/operation/metadata/create-element.ts","../src/operation/metadata/custom-function.ts","../src/operation/metadata/end-action.ts","../src/operation/metadata/end-for-each.ts","../src/operation/metadata/end-when.ts","../src/operation/metadata/extend-controller.ts","../src/operation/metadata/filter-array.ts","../src/operation/metadata/find-in-array.ts","../src/operation/metadata/for-each.ts","../src/operation/metadata/format-date.ts","../src/operation/metadata/format-text.ts","../src/operation/metadata/get-attributes-from-element.ts","../src/operation/metadata/get-controller-from-element.ts","../src/operation/metadata/get-controller-instance.ts","../src/operation/metadata/get-current-time.ts","../src/operation/metadata/get-element-dimensions.ts","../src/operation/metadata/get-focused-element.ts","../src/operation/metadata/get-form-data.ts","../src/operation/metadata/get-import.ts","../src/operation/metadata/get-query-params.ts","../src/operation/metadata/get-scroll-position.ts","../src/operation/metadata/get-text-content.ts","../src/operation/metadata/http-delete.ts","../src/operation/metadata/http-post.ts","../src/operation/metadata/http-put.ts","../src/operation/metadata/invoke-object-method.ts","../src/operation/metadata/is-element-in-viewport.ts","../src/operation/metadata/load-from-storage.ts","../src/operation/metadata/load-json.ts","../src/operation/metadata/log.ts","../src/operation/metadata/map-array.ts","../src/operation/metadata/math.ts","../src/operation/metadata/otherwise.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/replace-string.ts","../src/operation/metadata/replace-text.ts","../src/operation/metadata/request-action.ts","../src/operation/metadata/save-to-storage.ts","../src/operation/metadata/scroll-to-element.ts","../src/operation/metadata/scroll-to-position.ts","../src/operation/metadata/select-element.ts","../src/operation/metadata/set-data.ts","../src/operation/metadata/set-element-attributes.ts","../src/operation/metadata/set-element-content.ts","../src/operation/metadata/set-focus.ts","../src/operation/metadata/set-form-value.ts","../src/operation/metadata/set-global-data.ts","../src/operation/metadata/set-operation-data.ts","../src/operation/metadata/set-style.ts","../src/operation/metadata/set-variable.ts","../src/operation/metadata/sort-array.ts","../src/operation/metadata/split-string.ts","../src/operation/metadata/start-action.ts","../src/operation/metadata/substring-text.ts","../src/operation/metadata/toggle-class.ts","../src/operation/metadata/toggle-element.ts","../src/operation/metadata/toggle-form-element.ts","../src/operation/metadata/validate-form.ts","../src/operation/metadata/wait.ts","../src/operation/metadata/when.ts","../src/operation/metadata/index.ts","../src/util/find-closest-names.ts","../src/configuration/api/operation-lookup.ts","../src/configuration/api/sync-in-place.ts","../src/configuration/api/action-creator-factory.ts","../src/configuration/api/action-editor.ts","../src/configuration/api/timeline-provider-settings-editor.ts","../src/util/merge-if-missing.ts","../src/configuration/api/configuration-factory.ts","../src/controllers/metadata/dom-event-listener-controller.ts","../src/controllers/metadata/keyboard-controller.ts","../src/controllers/metadata/label-controller.ts","../src/controllers/metadata/lottie-controller.ts","../src/controllers/metadata/mutation-observer-controller.ts","../src/controllers/metadata/navigation-controller.ts","../src/controllers/metadata/progressbar-controller.ts","../src/controllers/metadata/routing-controller.ts","../src/controllers/metadata/subtitles-controller.ts","../src/controllers/metadata/index.ts","../src/configuration/api/name-providers.ts","../src/configuration/api/subtitle-converter.ts","../src/configuration/api/subtitle-editor.ts"],"sourcesContent":["const functionToString = Function.prototype.toString;\n/** Source text of `Object`, the same in every realm */\nconst objectConstructorSource = functionToString.call(Object);\n\n/**\n * Returns true for plain data objects: object literals, parsed JSON objects\n * and `Object.create(null)` objects, also when they were created in another\n * realm (an iframe, a worker, the realm `fetch` parses JSON in). Returns false\n * for arrays, class instances, `Date`, `Map`, DOM nodes, jQuery objects and\n * objects that inherit from another object.\n *\n * @param value - Any value\n * @returns Whether `value` is a plain data object\n */\nexport function isPlainObject(\n value: unknown\n): value is Record<PropertyKey, unknown> {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null || prototype === Object.prototype) {\n return true;\n }\n // Another realm's Object.prototype: no prototype of its own, and its own\n // constructor is that realm's Object.\n if (Object.getPrototypeOf(prototype) !== null) {\n return false;\n }\n const objectConstructor = Object.hasOwn(prototype, 'constructor')\n ? prototype.constructor\n : undefined;\n return (\n typeof objectConstructor === 'function' &&\n functionToString.call(objectConstructor) === objectConstructorSource\n );\n}\n","import {isPlainObject} from '@util/guards/is-plain-object.ts';\n\nexport {isPlainObject};\n\nconst copyFunction =\n typeof structuredClone !== 'undefined'\n ? structuredClone\n : <T>(original: any) => JSON.parse(JSON.stringify(original)) as T;\n\n/**\n * Deep-copies plain data: arrays and plain objects are copied recursively (cycles are preserved),\n * Date, RegExp, Map, Set, Error, ArrayBuffer and typed arrays are cloned, and everything else\n * (functions, jQuery objects, DOM nodes, class instances) is kept by reference.\n *\n * An own `__proto__` key (as `JSON.parse` creates) stays an own data property of the copy.\n *\n * This runs for every execution of every operation with nested configured data, so it avoids\n * work on the common shapes: the cycle map is only created once a nested object or array\n * appears, and plain keys are assigned instead of defined.\n *\n * @param original The value to copy\n * @returns The copy, or the value itself when it is not copied\n */\nexport function deepCopy<T>(original: T): T {\n if (\n original === null ||\n typeof original !== 'object' ||\n isReferenceOnly(original)\n ) {\n return original;\n }\n return copyObject(original, {seen: null}) as T;\n}\n\ninterface ICopyContext {\n /**\n * Copies made so far, so that a cycle or a shared reference maps to one\n * copy. Created on the first nested object, because most configured data\n * is flat and never needs it.\n */\n seen: WeakMap<object, unknown> | null;\n}\n\n/**\n * Copies a child value of `parentValue`, whose copy is `parentCopy`.\n */\nfunction copyChild(\n child: unknown,\n parentValue: object,\n parentCopy: unknown,\n context: ICopyContext\n): unknown {\n // Primitives, functions, jQuery objects, DOM nodes: as-is.\n if (child === null || typeof child !== 'object' || isReferenceOnly(child)) {\n return child;\n }\n if (context.seen === null) {\n context.seen = new WeakMap();\n context.seen.set(parentValue, parentCopy);\n }\n return copyObject(child, context);\n}\n\n/**\n * Copies an object that is not reference-only.\n */\nfunction copyObject(value: object, context: ICopyContext): unknown {\n const {seen} = context;\n // Copies are always objects, so undefined means \"not seen\".\n const prior = seen?.get(value);\n if (prior !== undefined) {\n return prior;\n }\n\n if (Array.isArray(value)) {\n const copy: unknown[] = new Array(value.length);\n if (seen !== null) {\n seen.set(value, copy);\n }\n // forEach skips holes, so a sparse array stays sparse.\n value.forEach((item, index) => {\n copy[index] = copyChild(item, value, copy, context);\n });\n return copy;\n }\n\n if (isPlainObject(value)) {\n const copy: Record<string, unknown> = {};\n if (seen !== null) {\n seen.set(value, copy);\n }\n for (const key of Object.keys(value)) {\n const copied = copyChild(\n (value as Record<string, unknown>)[key],\n value,\n copy,\n context\n );\n if (key === '__proto__') {\n // defineProperty, so an own '__proto__' key (e.g. from JSON.parse) stays\n // a data property instead of replacing the copy's prototype.\n Object.defineProperty(copy, key, {\n value: copied,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n } else {\n copy[key] = copied;\n }\n }\n return copy;\n }\n\n if (!isStructuredCloneable(value)) {\n return value;\n }\n\n const copy = copyFunction(value);\n if (seen !== null) {\n seen.set(value, copy);\n }\n return copy;\n}\n\nfunction isReferenceOnly(value: object) {\n return (\n typeof (value as {jquery?: unknown}).jquery === 'string' ||\n (typeof Node !== 'undefined' && value instanceof Node)\n );\n}\n\nfunction isStructuredCloneable(value: object) {\n // Tags instead of instanceof, so values from another realm are recognised.\n return (\n cloneableTags.has(Object.prototype.toString.call(value)) ||\n ArrayBuffer.isView(value)\n );\n}\n\nconst cloneableTags = new Set([\n '[object Date]',\n '[object RegExp]',\n '[object Map]',\n '[object Set]',\n '[object Error]',\n '[object ArrayBuffer]',\n]);\n","import type { IAddClassOperationData } from \"@operation/add-class.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addClass(): IOperationMetadata<IAddClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IAddControllerToElementOperationData } from \"@operation/add-controller-to-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function addControllerToElement(): IOperationMetadata<IAddControllerToElementOperationData<TOperationData>> {\n return {\n description: `This operation adds the specified controller instance to the given selected element.\n\nThe controller is registered on the element only once \\`init\\` and a synchronous \\`attach\\`\nhave succeeded. When \\`attach\\` returns a promise, the controller is registered before\nthat promise settles (so detaching the element can still reach it) and is removed from\nthe element again when the promise rejects.`,\n category: `Controller`,\n dependentProperties: ['selectedElement', 'controllerInstance'],\n };\n}\n","import type { IAddGlobalsToOperationData } from \"@operation/add-globals-to-operation.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function addGlobalsToOperation(): IOperationMetadata<IAddGlobalsToOperationData> {\n return {\n description: `This operation adds the specified global property names to the current operation data.\nIt finally removes the \\`globalProperties\\` property from the current operation data.\n\nPlain data is copied, so changing it does not change the global store. jQuery objects, DOM\nnodes, functions and class instances (such as controllers) are added by reference.`,\n category: `Data`,\n properties: {\n globalProperties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IAnimateWithClassOperationData } from \"@operation/animate-with-class.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animateWithClass(): IOperationMetadata<IAnimateWithClassOperationData> {\n return {\n description: `This operation adds the specified class name to the specified selected element and assumes that this\nclass triggers an animation on the selected element. It then waits for this animation to complete\nbefore it resolves.\n\nThe class must put the animation on the selected element itself: \\`animationend\\` events that bubble up\nfrom descendants are ignored, and with several selected elements the operation waits for all of them.\nSet \\`includeDescendants\\` to true for a class that only animates descendants; the operation then resolves\non the first \\`animationend\\` from the element or its subtree.\n\nThe operation resolves immediately when the selection is empty, or when the class gives none of the\nselected elements a CSS animation (for example under \\`prefers-reduced-motion: reduce\\`). When an\n\\`animationend\\` event never arrives, for example because the element was hidden or removed while\nanimating, it resolves shortly after the longest computed animation should have ended. An infinite\nanimation is waited for until it is ended by an \\`animationend\\` event.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n },\n removeClass: {\n type: 'ParameterType:boolean',\n erased: true\n },\n includeDescendants: {\n type: 'ParameterType:boolean',\n erased: true\n }\n },\n };\n}\n","import type { IAnimateOperationData } from \"@operation/animate.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function animate(): IOperationMetadata<IAnimateOperationData> {\n return {\n description: `This operation animates the specified selected element with the given [jQuery animation](https://api.jquery.com/animate/) properties, duration and easing.\nIt resolves after the animation completes, or immediately when the selected element set is empty.`,\n category: `Animation`,\n dependentProperties: ['selectedElement'],\n properties: {\n animationEasing: {\n type: 'ParameterType:string',\n erased: true\n },\n animationProperties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n animationDuration: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IAnnounceToScreenReaderOperationData } from \"@operation/announce-to-screen-reader.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function announceToScreenReader(): IOperationMetadata<IAnnounceToScreenReaderOperationData> {\n return {\n description: `Announces a message to screen readers using an ARIA live region.\n\nThe live region (\\`#aria-live-region\\`) is created empty on first use. The region is emptied\nand the message is written 100 milliseconds later, so that a new region\nand a message repeated verbatim are both announced. The message is removed again after 5 seconds.\nA newer announcement replaces a pending one.\n\nThe operation returns at once and does not wait for the message to be written.`,\n category: `Accessibility`,\n properties: {\n message: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n priority: {\n type: [\n { value: 'polite' },\n { value: 'assertive' }\n ],\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function breakForEach(): IOperationMetadata<TOperationData> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the loop end index, effectively stopping the loop.\n\nIt can be placed inside a \\`when\\`/\\`otherwise\\`/\\`endWhen\\` block within the loop, to break conditionally.`,\n category: `Control Flow`,\n };\n}\n","import type { IBroadcastEventOperationData } from \"@operation/broadcast-event.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function broadcastEvent(): IOperationMetadata<IBroadcastEventOperationData> {\n return {\n description: `This operation broadcasts the given event through the eventbus, along with the\nevent arguments and optional event topic.`,\n category: `Utility`,\n properties: {\n eventArgs: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n eventTopic: {\n type: 'ParameterType:eventTopic',\n erased: true\n },\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { ICalcOperationData } from \"@operation/calc.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function calc(): IOperationMetadata<ICalcOperationData> {\n return {\n description: `This operation calculates the given left and right hand operands using the specified operator.\n\n\\`left\\`, \\`right\\` and \\`operator\\` may be property chains (\\`$operationdata.\\`, \\`$globaldata.\\`,\n\\`$scope.\\`). Only these three inputs are resolved; the rest of the operation data is left as\nit is.`,\n category: `Utility`,\n properties: {\n left: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n right: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n operator: {\n type: [\n { value: '+' },\n { value: '-' },\n { value: '*' },\n { value: '/' },\n { value: '%' },\n { value: '**' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n calculationResult: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IClearElementOperationData } from \"@operation/clear-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearElement(): IOperationMetadata<IClearElementOperationData> {\n return {\n description: `This operation removes all of the children from the given selected element.\n\nControllers attached to the removed children or their descendants (by \\`addControllerToElement\\`)\nare detached first. Controllers on the selected element itself stay attached.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import type { IClearOperationDataOperationData } from \"@operation/clear-operation-data.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearOperationData(): IOperationMetadata<IClearOperationDataOperationData> {\n return {\n description: `This operation removes all of the properties on the current operation date.\nOr, if the \\`properties\\` property is set only removes the properties defined by that list.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n erased: true\n }\n },\n };\n}\n","import type { IClearStorageOperationData } from \"@operation/clear-storage.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function clearStorage(): IOperationMetadata<IClearStorageOperationData> {\n return {\n description: `Clears data from browser storage (localStorage or sessionStorage).\n\nIf \\`key\\` is provided, removes only that key. If \\`key\\` is omitted, clears all storage.\nA \\`key\\` that is present but empty, blank or not a string is rejected, so a value resolved\nfrom missing data never wipes the whole storage.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { ICompareDateOperationData } from \"@operation/compare-date.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function compareDate(): IOperationMetadata<ICompareDateOperationData> {\n return {\n description: `Compares two dates.\ncomparison: -1 (before), 0 (equal), 1 (after)`,\n category: `Date`,\n properties: {\n date1: {\n type: 'ParameterType:string|ParameterType:number|ParameterType:Date',\n required: true,\n erased: true\n },\n date2: {\n type: 'ParameterType:string|ParameterType:number|ParameterType:Date',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n comparison: {\n type: 'ParameterType:number'\n },\n isEqual: {\n type: 'ParameterType:boolean'\n },\n isBefore: {\n type: 'ParameterType:boolean'\n },\n isAfter: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import type { IConcatenateStringsOperationData } from \"@operation/concatenate-strings.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function concatenateStrings(): IOperationMetadata<IConcatenateStringsOperationData> {\n return {\n description: `Concatenates multiple strings with an optional separator.`,\n category: `String`,\n properties: {\n strings: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n },\n separator: {\n type: 'ParameterType:string',\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function continueForEach(): IOperationMetadata<TOperationData> {\n return {\n description: `This operation should only be used within a loop, so between a {@link forEach} and {@link endForEach}\noperation. This operation immediately moves to the next loop index, effectively canceling the rest\nof the operations in the current iteration.\n\nIt can be placed inside a \\`when\\`/\\`otherwise\\`/\\`endWhen\\` block within the loop, to continue conditionally.`,\n category: `Control Flow`,\n };\n}\n","import type { ICreateElementOperationData, TTagNames } from \"@operation/create-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function createElement(): IOperationMetadata<ICreateElementOperationData<TTagNames>> {\n return {\n description: `This operation creates the DOM element described by the given elementName and attributes and assigns\nthe instance to the \\`template\\` property on the current operation data.\n\nThe element is built with DOM APIs: attribute values are set with \\`.attr()\\` and \\`text\\` is set as\ntext content, so neither is parsed as HTML.\n\nValues may be resolved from user data, so nothing that runs script is created: \\`script\\`\nelements, event handler (\\`on*\\`) and \\`srcdoc\\` attributes, and \\`javascript:\\` or \\`vbscript:\\`\nURLs in URL attributes such as \\`href\\`, \\`src\\` and \\`formaction\\` are refused.`,\n category: `DOM`,\n properties: {\n elementName: {\n type: 'ParameterType:htmlElementName',\n required: true,\n erased: true\n },\n text: {\n type: 'ParameterType:string',\n erased: true\n },\n attributes: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n template: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { ICustomFunctionOperationData } from \"@operation/custom-function.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function customFunction(): IOperationMetadata<ICustomFunctionOperationData> {\n return {\n description: `This operation retrieves a custom function defined by the given system name\nand invokes it with the current operation data and eventbus.\n\nThe function is looked up with the \\`request-function\\` event, which the\n\\`EngineFactory\\` answers from its resource importer. Register the function\nwith the \\`EligiusResourceImporter\\` constructor:\n\\`new EligiusResourceImporter({functions: {myFunction}})\\`.\n\nThe function is called with the current operation data as its argument, and with \\`this\\`\nset to a view of the operation scope. Reading a property from \\`this\\` returns it from the\ninnermost scope that has it, so inside a \\`when\\` block in a loop \\`this.currentItem\\`,\n\\`this.loopIndex\\` and \\`this.variables\\` return the loop's and the action's values, the same\nas \\`$scope.\\` chains. Assigning to \\`this\\` (for example \\`this.newIndex\\`) writes to the scope the\noperation runs in.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IEndActionOperationData } from \"@operation/end-action.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function endAction(): IOperationMetadata<IEndActionOperationData> {\n return {\n description: `This operation invokes the {@link EndableAction}.end method on the specified action instance.\n\nThe action receives its own copy of the current operation data merged with the action\noperation data. Whatever the action's end operations add, change or remove in that copy stays\nwith the action: once it has completed, this operation continues with the operation data it\nhad before, without the \\`actionOperationData\\` property.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function endForEach(): IOperationMetadata<TOperationData> {\n return {\n description: `This operation checks if the current loop should end or start the next iteration.`,\n category: `Control Flow`,\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function endWhen(): IOperationMetadata<TOperationData> {\n return {\n description: `This operation cleans up after the {@link when}/{@link otherwise}/{@link endWhen} control flow ends.`,\n category: `Control Flow`,\n };\n}\n","import type { IExtendControllerOperationData } from \"@operation/extend-controller.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function extendController(): IOperationMetadata<IExtendControllerOperationData> {\n return {\n description: `Extends the current controller with given extension.\n\nThe extension's own properties are copied onto the controller instance.`,\n category: `Controller`,\n dependentProperties: ['controllerInstance'],\n properties: {\n controllerExtension: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IFilterArrayOperationData } from \"@operation/filter-array.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function filterArray(): IOperationMetadata<IFilterArrayOperationData> {\n return {\n description: `Filters an array based on property equality or custom predicate function.\n\nOperates on arrayData passed from previous operations.\nSupports two filtering modes:\n1. Property equality: \\`filterProperty\\` and \\`filterValue\\` to filter by property match\n2. Custom predicate: \\`filterPredicate\\` function for complex filtering logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n filterProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n filterValue: {\n type: 'ParameterType:object',\n erased: true\n },\n filterPredicate: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n filteredArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import type { IFindInArrayOperationData } from \"@operation/find-in-array.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function findInArray(): IOperationMetadata<IFindInArrayOperationData> {\n return {\n description: `Finds the first element in an array matching criteria.\n\nOperates on arrayData passed from previous operations.\nSupports two search modes:\n1. Property equality: \\`findProperty\\` and \\`findValue\\` to find by property match\n2. Custom predicate: \\`findPredicate\\` function for complex search logic\n\nReturns \\`undefined\\` for \\`foundItem\\` and \\`-1\\` for \\`foundIndex\\` if no match found.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n findProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n findValue: {\n type: 'ParameterType:object',\n erased: true\n },\n findPredicate: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n foundItem: {\n type: 'ParameterType:object'\n },\n foundIndex: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IForEachOperationData } from \"@operation/for-each.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function forEach(): IOperationMetadata<IForEachOperationData> {\n return {\n description: `This operation iterates over the given collection.\n\nEach iteration the current item from the specified collection is\nassigned to the {@link IOperationScope.currentItem |currentItem} property on the {@link IOperationScope |operation scope}.\n\nAt the start of the loop, the associated {@link endForEach} operation is determined and when\nthe last iteration is completed the flow control is set to the index of that operation.\n\nThe {@link continueForEach |continue} and {@link breakForEach |break} operations can be used to control the\nloop iterations.\n\nThe collection is resolved once, when the loop starts, and the loop iterates over a snapshot\nof it. Changing, replacing or removing the source collection inside the loop body does not\nchange the items or the number of iterations of the running loop.`,\n category: `Control Flow`,\n properties: {\n collection: {\n type: 'ParameterType:array|ParameterType:string',\n required: true\n }\n },\n };\n}\n","import type { IFormatDateOperationData } from \"@operation/format-date.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatDate(): IOperationMetadata<IFormatDateOperationData> {\n return {\n description: `Formats a date with a simple token pattern, in the local time zone.\n\nSupported tokens (every occurrence is replaced, other characters are kept as is):\n- \\`YYYY\\`: four digit year\n- \\`MM\\`: month, 01-12\n- \\`DD\\`: day of the month, 01-31\n- \\`HH\\`: hours, 00-23\n- \\`mm\\`: minutes, 00-59\n- \\`ss\\`: seconds, 00-59`,\n category: `Date`,\n dependentProperties: ['date'],\n properties: {\n format: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedDate: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IFormatTextOperationData } from \"@operation/format-text.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function formatText(): IOperationMetadata<IFormatTextOperationData> {\n return {\n description: `Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\n\nTransformations:\n- \\`uppercase\\`: Convert all characters to uppercase\n- \\`lowercase\\`: Convert all characters to lowercase\n- \\`capitalize\\`: Capitalize only the first letter\n- \\`titlecase\\`: Capitalize first letter of each word\n- \\`trim\\`: Remove leading and trailing whitespace`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n transformation: {\n type: [\n { value: 'uppercase' },\n { value: 'lowercase' },\n { value: 'capitalize' },\n { value: 'titlecase' },\n { value: 'trim' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n formattedText: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IGetAttributesFromElementOperationData } from \"@operation/get-attributes-from-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getAttributesFromElement(): IOperationMetadata<IGetAttributesFromElementOperationData> {\n return {\n description: `This operation retrieves the values for the specified attribute names from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributeNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n attributeValues: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetControllerFromElementOperationData } from \"@operation/get-controller-from-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerFromElement(): IOperationMetadata<IGetControllerFromElementOperationData> {\n return {\n description: `This operation retrieves the controller instance with the specified name that is assigned to the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetControllerInstanceOperationData } from \"@operation/get-controller-instance.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getControllerInstance(): IOperationMetadata<IGetControllerInstanceOperationData> {\n return {\n description: `This operation retrieves an instance of the given controller name.\nIt assigns this instance to the \\`controllerInstance\\` property on the current operation data`,\n category: `Controller`,\n properties: {\n systemName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n controllerInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetCurrentTimeOperationData } from \"@operation/get-current-time.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getCurrentTime(): IOperationMetadata<IGetCurrentTimeOperationData> {\n return {\n description: `Gets the current time as timestamp and Date object.`,\n category: `Date`,\n outputProperties: {\n timestamp: {\n type: 'ParameterType:number'\n },\n date: {\n type: 'ParameterType:Date'\n }\n }\n };\n}\n","import type { IGetElementDimensionsOperationData } from \"@operation/get-element-dimensions.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getElementDimensions(): IOperationMetadata<IGetElementDimensionsOperationData> {\n return {\n description: `This operation calculates the width and height of the given selected element.\nIt assigns this struct to the dimensions property on the current operation data.\nOptionally the width and height can be modified using the given modifier string.\n\nThe modifier string is formatted in the following way:\n\n<operator><amount><optional-side><optional-precentage>|<ratio-definition>\n\nWhere the ratio modifier is formatted in the following way:\n<side>[ar=<ratio-left>-<ratio-right>]\n\nFor example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:\nit will add a value of 100 to the height and modify the width by a ratio of 8 to 1 relative to the height.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n modifier: {\n type: 'ParameterType:dimensionsModifier',\n erased: true\n }\n },\n outputProperties: {\n dimensions: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetFocusedElementOperationData } from \"@operation/get-focused-element.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFocusedElement(): IOperationMetadata<IGetFocusedElementOperationData> {\n return {\n description: `Gets the currently focused element.`,\n category: `Focus`,\n outputProperties: {\n focusedElement: {\n type: 'ParameterType:jQuery'\n }\n }\n };\n}\n","import type { IGetFormDataOperationData } from \"@operation/get-form-data.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getFormData(): IOperationMetadata<IGetFormDataOperationData> {\n return {\n description: `Extracts all input, select, and textarea values from form element into operation data.\n\nThis operation reads form field values and returns them as an object with field names as keys.\nOnly processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,\nselect elements, textareas, and text inputs.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n formData: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetImportOperationData } from \"@operation/get-import.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getImport(): IOperationMetadata<IGetImportOperationData> {\n return {\n description: `This operation retrieves the import specified by the given \\`systemName\\` and\nassigns it to the \\`importedInstance\\` property on the current operaton date.\n\nThe import is looked up with the \\`request-function\\` event, which the\n\\`EngineFactory\\` answers from its resource importer. Functions, templates\nand JSON registered with the \\`EligiusResourceImporter\\` constructor\n(\\`new EligiusResourceImporter({json: {settings}})\\`) can be imported this\nway, as can every built-in operation, controller and provider export.`,\n category: `Utility`,\n properties: {\n systemName: {\n type: 'ParameterType:systemName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n importedInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetQueryParamsOperationData } from \"@operation/get-query-params.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getQueryParams(): IOperationMetadata<IGetQueryParamsOperationData> {\n return {\n description: `This operation retrieves the current query parameters from the browser's address bar and places\nthem on the returned operation data.`,\n category: `Utility`,\n properties: {\n defaultValues: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n queryParams: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IGetScrollPositionOperationData } from \"@operation/get-scroll-position.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getScrollPosition(): IOperationMetadata<IGetScrollPositionOperationData> {\n return {\n description: `Gets the current scroll position of the viewport.\n\nReturns x (horizontal) and y (vertical) scroll positions in pixels.\nUses cross-browser compatible methods to retrieve scroll position.`,\n category: `Scroll`,\n outputProperties: {\n scrollX: {\n type: 'ParameterType:number'\n },\n scrollY: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IGetTextContentOperationData } from \"@operation/get-text-content.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function getTextContent(): IOperationMetadata<IGetTextContentOperationData> {\n return {\n description: `Extracts text content from element, stripping all HTML markup.\n\nUses jQuery's \\`.text()\\` method which is XSS-safe and returns only the text content\nwithout any HTML tags. Preserves whitespace and text from nested elements.`,\n category: `Text`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n textContent: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IHttpDeleteOperationData } from \"@operation/http-delete.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpDelete(): IOperationMetadata<IHttpDeleteOperationData> {\n return {\n description: `Performs an HTTP DELETE request to the specified URL.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IHttpPostOperationData } from \"@operation/http-post.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPost(): IOperationMetadata<IHttpPostOperationData> {\n return {\n description: `Performs an HTTP POST request to the specified URL.\n\nThe body is sent as JSON with \\`Content-Type: application/json\\`, unless the caller's headers set\nanother content type (header names are case-insensitive). With a non-JSON content type, a string\nbody is sent as is; other bodies are still JSON encoded.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IHttpPutOperationData } from \"@operation/http-put.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function httpPut(): IOperationMetadata<IHttpPutOperationData> {\n return {\n description: `Performs an HTTP PUT request to the specified URL.\n\nThe body is sent as JSON with \\`Content-Type: application/json\\`, unless the caller's headers set\nanother content type (header names are case-insensitive). With a non-JSON content type, a string\nbody is sent as is; other bodies are still JSON encoded.`,\n category: `HTTP`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n body: {\n type: 'ParameterType:object',\n erased: true\n },\n headers: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n response: {\n type: 'ParameterType:object'\n },\n status: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IInvokeObjectMethodOperationData } from \"@operation/invoke-object-method.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function invokeObjectMethod(): IOperationMetadata<IInvokeObjectMethodOperationData> {\n return {\n description: `This operation invokes the specified method on the given object with the given optional arguments\nand assigns the result to the \\`methodResult\\` operationdata property. When the method returns a\npromise, the operation waits for it and assigns the resolved value.\n\nThe operation only calls application code: methods of controllers, of other instances of\napplication classes, and of plain objects. It refuses, and throws for:\n- an \\`instance\\` that is a function, the global object (\\`window\\`), a document, a DOM node,\n a jQuery object, or any other built-in or host object (arrays, maps, promises, \\`location\\`,\n storage, ...);\n- a method that is a built-in (native) function, such as \\`eval\\`, \\`Function\\`, \\`setTimeout\\`,\n \\`setInterval\\`, \\`document.write\\`, \\`Reflect.apply\\` or a bound function, or a jQuery function;\n- the method names \\`constructor\\`, \\`__proto__\\` and \\`prototype\\`;\n- arguments that are such functions.\n\nThese checks stop configuration from reaching the platform's code-executing functions through\nthis operation. They cannot vouch for what an application method does with its arguments, so\nonly expose methods that are safe to call with configured data.`,\n category: `Utility`,\n dependentProperties: ['instance'],\n properties: {\n methodName: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n methodArguments: {\n type: 'ParameterType:array',\n erased: true\n }\n },\n outputProperties: {\n methodResult: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IIsElementInViewportOperationData } from \"@operation/is-element-in-viewport.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function isElementInViewport(): IOperationMetadata<IIsElementInViewportOperationData> {\n return {\n description: `Checks if an element is currently visible within the viewport.\n\nUses \\`getBoundingClientRect()\\` to determine if the element is within the viewport boundaries.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n outputProperties: {\n isInViewport: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import type { ILoadFromStorageOperationData } from \"@operation/load-from-storage.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadFromStorage(): IOperationMetadata<ILoadFromStorageOperationData> {\n return {\n description: `Loads data from browser storage (localStorage or sessionStorage).\n\nDeserializes the stored JSON value. Returns \\`null\\` if key doesn't exist.\nWhen \\`storageType\\` is omitted, localStorage is used.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n outputProperties: {\n loadedValue: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { ILoadJSONOperationData } from \"@operation/load-json.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function loadJson(): IOperationMetadata<ILoadJSONOperationData> {\n return {\n description: `This operation loads a JSON file from the specified url and assigns it to the json\nproperty on the current operation data.\n\nIf the cache property is set to true and a cached value already exists, a copy of it is assigned\ninstead of re-retrieving it from the url. Mutating the returned json never changes the cache.\n\nThe cache is shared by every engine. It is emptied when the last live engine created by\n\\`EngineFactory\\` is destroyed; call {@link clearJsonCache} to empty it earlier.`,\n category: `Utility`,\n properties: {\n url: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n cache: {\n type: 'ParameterType:boolean',\n erased: true\n }\n },\n outputProperties: {\n json: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { ILogOperationData } from \"@operation/log.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function log(): IOperationMetadata<ILogOperationData> {\n return {\n description: `This operation logs the specified value, or, when no logValue property has been assigned\nit will log the current operation data, global data and scope to the console`,\n category: `Utility`,\n properties: {\n logValue: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n erased: true\n },\n logName: {\n type: 'ParameterType:string',\n erased: true\n }\n },\n };\n}\n","import type { IMapArrayOperationData } from \"@operation/map-array.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function mapArray(): IOperationMetadata<IMapArrayOperationData> {\n return {\n description: `Transforms each element of an array using a mapping function.\n\nOperates on arrayData passed from previous operations.\nThe mapFunction receives each item and optionally its index.`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n mapFunction: {\n type: 'ParameterType:function',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mappedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import type { IMathOperationData } from \"@operation/math.ts\";\nimport type { IOperationMetadata } from \"@operation/metadata/types.ts\";\n\nexport function math(): IOperationMetadata<IMathOperationData> {\n return {\n description: `This operation performs the given math function with the specified arguments.\n\n\\`args\\` and \\`functionName\\` may contain property chains (\\`$operationdata.\\`, \\`$globaldata.\\`,\n\\`$scope.\\`). Only these two inputs are resolved; the rest of the operation data is left as it\nis. Arguments that name a Math constant (such as \\`'PI'\\`) are replaced by its value.`,\n category: `Utility`,\n properties: {\n args: {\n type: 'ParameterType:array',\n required: true,\n erased: true\n },\n functionName: {\n type: 'ParameterType:mathfunction',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n mathResult: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { TOperationData } from \"@operation/types.ts\";\n\nexport function otherwise(): IOperationMetadata<TOperationData> {\n return {\n description: `If the preceeding {@link when} operation evaluates to \\`true\\` subsequent operations will\nbe skipped until an {@link endWhen} operation is encountered.`,\n category: `Control Flow`,\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRemoveClassOperationData } from \"@operation/remove-class.ts\";\n\nexport function removeClass(): IOperationMetadata<IRemoveClassOperationData> {\n return {\n description: `This operation removes the spcified class name from the given selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRemoveControllerFromElementOperationData } from \"@operation/remove-controller-from-element.ts\";\n\nexport function removeControllerFromElement(): IOperationMetadata<IRemoveControllerFromElementOperationData> {\n return {\n description: `This operation removes the controller with the specified name from the given selected element.`,\n category: `Controller`,\n dependentProperties: ['selectedElement'],\n properties: {\n controllerName: {\n type: 'ParameterType:controllerName',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRemoveElementOperationData } from \"@operation/remove-element.ts\";\n\nexport function removeElement(): IOperationMetadata<IRemoveElementOperationData> {\n return {\n description: `This operation removes the given selected element from the DOM.\n\nControllers attached to the element or its descendants (by \\`addControllerToElement\\`) are\ndetached first, so their eventbus and window listeners do not outlive the element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRemovePropertiesFromOperationDataOperationData } from \"@operation/remove-properties-from-operation-data.ts\";\n\nexport function removePropertiesFromOperationData(): IOperationMetadata<IRemovePropertiesFromOperationDataOperationData> {\n return {\n description: `This operation removes the given list of properties from the current operation data.\nIt will also remove the property \\`propertyNames\\` from the result.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IReparentElementOperationData } from \"@operation/reparent-element.ts\";\n\nexport function reparentElement(): IOperationMetadata<IReparentElementOperationData> {\n return {\n description: `This operation moves the given selected element to the new parent that is defined\nby the specified \\`newParentSelector\\`. jQuery data, event handlers and attached controllers\nare preserved.\n\nThe selector is resolved inside the engine root (the root itself included), the same way\n\\`selectElement\\` resolves its selector, and must match exactly one element. HTML strings are\nnot accepted.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n newParentSelector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IReplaceStringOperationData } from \"@operation/replace-string.ts\";\n\nexport function replaceString(): IOperationMetadata<IReplaceStringOperationData> {\n return {\n description: `Replaces occurrences of a pattern in a string (alias for replaceText for string context).\n\nLike replaceText, a string pattern replaces every occurrence and inserts the replacement\nliterally (\\`$&\\`, \\`$1\\` and similar are not expanded). A RegExp pattern follows\n\\`String.prototype.replace\\`: only a global RegExp replaces every match, and \\`$\\` patterns\nin the replacement are expanded. Unlike replaceText, the result is written to \\`result\\`\nand \\`textContent\\` is left unchanged.`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n pattern: {\n type: 'ParameterType:string|ParameterType:RegExp',\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n result: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IReplaceTextOperationData } from \"@operation/replace-text.ts\";\n\nexport function replaceText(): IOperationMetadata<IReplaceTextOperationData> {\n return {\n description: `Finds and replaces text using literal string or regex pattern.\n\nOperates on textContent passed from previous operations (e.g., getTextContent).\nSupports regex patterns with global flag for multiple replacements.\nUpdates textContent with replaced text and sets replacementCount.\n\nA string pattern replaces every occurrence and inserts the replacement literally.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n searchPattern: {\n type: 'ParameterType:string|ParameterType:RegExp',\n required: true,\n erased: true\n },\n replacement: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n replacementCount: {\n type: 'ParameterType:number'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IRequestActionOperationData } from \"@operation/request-action.ts\";\n\nexport function requestAction(): IOperationMetadata<IRequestActionOperationData> {\n return {\n description: `This operation requests an action instance with the specified name and assigns it\nto the \\`actionInstance\\` property on the current operation data.`,\n category: `Action`,\n properties: {\n systemName: {\n type: 'ParameterType:actionName',\n required: true,\n erased: true\n }\n },\n outputProperties: {\n actionInstance: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISaveToStorageOperationData } from \"@operation/save-to-storage.ts\";\n\nexport function saveToStorage(): IOperationMetadata<ISaveToStorageOperationData> {\n return {\n description: `Saves data to browser storage (localStorage or sessionStorage).\n\nSerializes the value as JSON before storing. Supports any JSON-serializable data type.\nUse \\`null\\` to store an empty value; \\`undefined\\` cannot be stored as JSON and is rejected.\nWhen \\`storageType\\` is omitted, localStorage is used.`,\n category: `Data`,\n properties: {\n key: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n },\n storageType: {\n type: [\n { value: 'local' },\n { value: 'session' }\n ],\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IScrollToElementOperationData } from \"@operation/scroll-to-element.ts\";\n\nexport function scrollToElement(): IOperationMetadata<IScrollToElementOperationData> {\n return {\n description: `Scrolls the viewport to bring the selected element into view.\n\nUses the browser's \\`scrollIntoView\\` API with configurable behavior.`,\n category: `Scroll`,\n dependentProperties: ['selectedElement'],\n properties: {\n behavior: {\n type: [\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n },\n block: {\n type: [\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n },\n inline: {\n type: [\n { value: 'start' },\n { value: 'center' },\n { value: 'end' },\n { value: 'nearest' }\n ],\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IScrollToPositionOperationData } from \"@operation/scroll-to-position.ts\";\n\nexport function scrollToPosition(): IOperationMetadata<IScrollToPositionOperationData> {\n return {\n description: `Scrolls the viewport to a specific x,y coordinate position.\n\nUses the browser's \\`window.scrollTo\\` API with configurable behavior.`,\n category: `Scroll`,\n properties: {\n x: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n y: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n behavior: {\n type: [\n { value: 'auto' },\n { value: 'smooth' }\n ],\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISelectElementOperationData } from \"@operation/select-element.ts\";\n\nexport function selectElement(): IOperationMetadata<ISelectElementOperationData> {\n return {\n description: `This operation selects one or more elements using the specified selector.\n\nIf \\`useSelectedElementAsRoot\\` is set to true and a valid DOM element is assigned\nto the current operation data's \\`selectedElement\\` property\nthen the element will be looked for only in the descendant elements of this DOM element.`,\n category: `DOM`,\n properties: {\n selector: {\n type: 'ParameterType:selector',\n required: true,\n erased: true\n },\n useSelectedElementAsRoot: {\n type: 'ParameterType:boolean',\n erased: true\n }\n },\n outputProperties: {\n selectedElement: {\n type: 'ParameterType:object'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetDataOperationData } from \"@operation/set-data.ts\";\n\nexport function setData(): IOperationMetadata<ISetDataOperationData> {\n return {\n description: `This operation assigns the specified properties to the specified data targets.`,\n category: `Data`,\n properties: {\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetElementAttributesOperationData } from \"@operation/set-element-attributes.ts\";\n\nexport function setElementAttributes(): IOperationMetadata<ISetElementAttributesOperationData> {\n return {\n description: `This operation sets the specified set of attributes on the given selected element.\n\nEvent handler (\\`on*\\`) and \\`srcdoc\\` attributes, and \\`javascript:\\` or \\`vbscript:\\` URLs in URL\nattributes such as \\`href\\`, \\`src\\` and \\`formaction\\`, are refused, the same as in \\`createElement\\`.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n attributes: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetElementContentOperationData } from \"@operation/set-element-content.ts\";\n\nexport function setElementContent(): IOperationMetadata<ISetElementContentOperationData> {\n return {\n description: `This operation sets the specified content defined by the value assigned to the template property\nto the given selected element.\n\nWhen the \\`insertionType\\` is set to \\`overwrite\\` the contents of the selected element are replaced\nby the given template.\nWhen set to \\`append\\` the new content will be inserted after the current content.\nWhen set to \\`prepend\\` the new content will be inserted before the current content.\n\nWith \\`overwrite\\`, controllers attached to the replaced content (by \\`addControllerToElement\\`) are\ndetached first. Controllers on the selected element itself stay attached.\n\nThe template is inserted as HTML: a string template is parsed by jQuery, which also runs the\nscripts and inline event handlers it contains. Only use string templates from the configuration\nor the resource importer; build content from user data with \\`createElement\\`, whose \\`text\\` is\nnever parsed as HTML.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n template: {\n type: 'ParameterType:string|ParameterType:Element|ParameterType:Text|ParameterType:Comment|ParameterType:Document|ParameterType:DocumentFragment',\n erased: true\n },\n insertionType: {\n type: [\n { value: 'overwrite' },\n { value: 'append' },\n { value: 'prepend' }\n ],\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetFocusOperationData } from \"@operation/set-focus.ts\";\n\nexport function setFocus(): IOperationMetadata<ISetFocusOperationData> {\n return {\n description: `Sets focus to the selected element.`,\n category: `Focus`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetFormValueOperationData } from \"@operation/set-form-value.ts\";\n\nexport function setFormValue(): IOperationMetadata<ISetFormValueOperationData> {\n return {\n description: `Sets the value of an input, select, or textarea element.\n\nHandles different input types appropriately:\n- Text inputs, textareas, selects: sets value directly\n- Checkboxes: sets checked property for boolean values\n- Radio buttons: sets checked property for boolean values\n- Number inputs: converts to string`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n value: {\n type: 'ParameterType:string|ParameterType:number|ParameterType:boolean',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetGlobalDataOperationData } from \"@operation/set-global-data.ts\";\n\nexport function setGlobalData(): IOperationMetadata<ISetGlobalDataOperationData> {\n return {\n description: `This operation copies the specified properties from the operationData to the global data.\n\nPlain data is stored as a deep copy, so changing the operation data afterwards does not change\nthe global data. jQuery objects, DOM nodes, functions and class instances (such as controllers)\nare stored by reference.`,\n category: `Data`,\n properties: {\n propertyNames: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetOperationData } from \"@operation/set-operation-data.ts\";\n\nexport function setOperationData(): IOperationMetadata<ISetOperationData> {\n return {\n description: `This operation assigns the specified properties to the current operation data.\nWhen override is set to true the properties replace the current operation data entirely.`,\n category: `Data`,\n properties: {\n override: {\n type: 'ParameterType:boolean',\n erased: true\n },\n properties: {\n type: 'ParameterType:object',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetStyleOperationData } from \"@operation/set-style.ts\";\n\nexport function setStyle(): IOperationMetadata<ISetStyleOperationData> {\n return {\n description: `This operation assigns the specified CSS style properties to the\ngiven selected element.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n properties: {\n type: 'ParameterType:cssProperties',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISetVariableOperationData } from \"@operation/set-variable.ts\";\n\nexport function setVariable(): IOperationMetadata<ISetVariableOperationData> {\n return {\n description: `This operation sets a variable with the specified name on the scope with the specified value.\n\nVariables belong to the action: a variable set inside a \\`when\\` or \\`forEach\\` block is the\nsame variable outside it, so it keeps its value after \\`endWhen\\` or \\`endForEach\\`, and\nvariables set before the block can be read and changed inside it. Read variables with\n\\`$scope.variables.<name>\\`.`,\n category: `Data`,\n properties: {\n name: {\n type: 'ParameterType:string',\n required: true,\n erased: true\n },\n value: {\n type: 'ParameterType:object|ParameterType:string|ParameterType:number|ParameterType:boolean|ParameterType:array',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISortArrayOperationData } from \"@operation/sort-array.ts\";\n\nexport function sortArray(): IOperationMetadata<ISortArrayOperationData> {\n return {\n description: `Sorts an array by property, natural order, or custom comparator function.\n\nOperates on arrayData passed from previous operations.\nSupports three sorting modes:\n1. Property sort: \\`sortProperty\\` and \\`sortOrder\\` to sort objects by property\n2. Natural sort: \\`sortOrder\\` alone for primitive arrays\n3. Custom comparator: \\`sortComparator\\` function for complex sorting logic`,\n category: `Array`,\n dependentProperties: ['arrayData'],\n properties: {\n sortProperty: {\n type: 'ParameterType:string',\n erased: true\n },\n sortOrder: {\n type: [\n { value: 'asc' },\n { value: 'desc' }\n ],\n erased: true\n },\n sortComparator: {\n type: 'ParameterType:function',\n erased: true\n }\n },\n outputProperties: {\n sortedArray: {\n type: 'ParameterType:array'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISplitStringOperationData } from \"@operation/split-string.ts\";\n\nexport function splitString(): IOperationMetadata<ISplitStringOperationData> {\n return {\n description: `Splits a string into an array by delimiter (string or regex).`,\n category: `String`,\n dependentProperties: ['textContent'],\n properties: {\n delimiter: {\n type: 'ParameterType:string|ParameterType:RegExp',\n required: true,\n erased: true\n },\n limit: {\n type: 'ParameterType:number',\n erased: true\n }\n },\n outputProperties: {\n resultArray: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IStartActionOperationData } from \"@operation/start-action.ts\";\n\nexport function startAction(): IOperationMetadata<IStartActionOperationData> {\n return {\n description: `This operation starts the specified action instance using the given action operation data.\n\nThe action receives its own copy of the current operation data merged with the action\noperation data. Whatever the action's operations add, change or remove in that copy stays\nwith the action: once it has completed, this operation continues with the operation data it\nhad before, plus \\`actionInstance\\`, without the \\`actionOperationData\\` property.`,\n category: `Action`,\n dependentProperties: ['actionInstance'],\n properties: {\n actionOperationData: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { ISubstringTextOperationData } from \"@operation/substring-text.ts\";\n\nexport function substringText(): IOperationMetadata<ISubstringTextOperationData> {\n return {\n description: `Extracts a substring from text between start and end indices.`,\n category: `Text`,\n dependentProperties: ['textContent'],\n properties: {\n start: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n },\n end: {\n type: 'ParameterType:number',\n erased: true\n }\n },\n outputProperties: {\n substring: {\n type: 'ParameterType:string'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IToggleClassOperationData } from \"@operation/toggle-class.ts\";\n\nexport function toggleClass(): IOperationMetadata<IToggleClassOperationData> {\n return {\n description: `This operation toggles the specfied class name on the given selected element.\n\nMeaning, if the specified class name exists on the given element it will be removed,\notherwise it will be added.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n properties: {\n className: {\n type: 'ParameterType:className',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IToggleElementOperationData } from \"@operation/toggle-element.ts\";\n\nexport function toggleElement(): IOperationMetadata<IToggleElementOperationData> {\n return {\n description: `This operation toggles the visibility of the given selected element.\n\nMeaning, if the element is hidden, it will be made visible, otherwise\nit will be hidden.`,\n category: `DOM`,\n dependentProperties: ['selectedElement'],\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IToggleFormElementOperationData } from \"@operation/toggle-form-element.ts\";\n\nexport function toggleFormElement(): IOperationMetadata<IToggleFormElementOperationData> {\n return {\n description: `Enables or disables form input elements (inputs, selects, textareas, buttons).\n\nSets the \\`disabled\\` property on the element. When \\`enabled\\` is true, removes the disabled\nattribute; when false, adds the disabled attribute.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n enabled: {\n type: 'ParameterType:boolean',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IValidateFormOperationData } from \"@operation/validate-form.ts\";\n\nexport function validateForm(): IOperationMetadata<IValidateFormOperationData> {\n return {\n description: `Validates form fields against HTML5 validation and custom rules.\n\nUses HTML5 validation API (checkValidity()) for native validation, and supports\ncustom validation rules for: required, minLength, maxLength, pattern (regex), and email format.\n\nCheckboxes and radio buttons are validated once per name: \\`required\\` passes when at least one\nof them is checked, and the string rules do not apply to them. For a \\`<select multiple>\\`,\n\\`required\\`, \\`minLength\\` and \\`maxLength\\` count the selected options, and \\`pattern\\` and \\`email\\`\napply to each selected value.`,\n category: `Form`,\n dependentProperties: ['selectedElement'],\n properties: {\n validationRules: {\n type: 'ParameterType:object',\n erased: true\n }\n },\n outputProperties: {\n validationErrors: {\n type: 'ParameterType:object'\n },\n isValid: {\n type: 'ParameterType:boolean'\n }\n }\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IWaitOperationData } from \"@operation/wait.ts\";\n\nexport function wait(): IOperationMetadata<IWaitOperationData> {\n return {\n description: `This operation waits for the specified amount of milliseconds.`,\n category: `Utility`,\n properties: {\n milliseconds: {\n type: 'ParameterType:number',\n required: true,\n erased: true\n }\n },\n };\n}\n","import type { IOperationMetadata } from \"@operation/metadata/types.ts\";\nimport type { IWhenOperationData } from \"@operation/when.ts\";\n\nexport function when(): IOperationMetadata<IWhenOperationData> {\n return {\n description: `When the given expression evaluates to false, subsequent operations will be skipped\nuntil an {@link endWhen} or {@link otherwise} operation is encountered.\n\nPractically, this means an \\`if\\` or \\`if\\`/\\`else\\` statement control flow implementation in a list of operations.\n\nThe expression is passed in as a formatted string. An operand can be one of:\n\n'constant': for a constant string (operators and parentheses inside the quotes are text)\n100: for a constant number (the whole operand must be numeric, \\`10px\\` is invalid)\ntrue, false, null: for a boolean or null constant\n$operationData.foo: for an operation data value\n$globaldata.foo: for a global data value\n$scope.loopIndex: for a scope value\n$scope.variables.foo: for a variable set with \\`setVariable\\`\n\nAny other operand is an error, so a misspelled chain prefix fails instead of being compared\nas a string.\n\nOperands are combined with these operators, from highest to lowest precedence:\n\n\\`!\\`: negation\n\\`==\\`, \\`!=\\`, \\`>\\`, \\`<\\`, \\`>=\\`, \\`<=\\`: comparison (\\`==\\` and \\`!=\\` compare strictly, without type\nconversion; comparisons do not chain, so write \\`0<$scope.loopIndex && $scope.loopIndex<5\\`)\n\\`&&\\`: and\n\\`||\\`: or\n\nParentheses group. A bare operand is true when its value is truthy, so \\`'false'\\` and \\`'0'\\`\nare true and \\`0\\`, \\`''\\`, \\`null\\` and a missing value are false. \\`!\\`, \\`&&\\` and \\`||\\` always\nproduce \\`true\\` or \\`false\\`. \\`!\\` binds tighter than a comparison: \\`!$operationdata.a==1\\`\ncompares \\`!$operationdata.a\\` with 1, write \\`!($operationdata.a==1)\\` to negate the comparison.\n\\`&&\\` and \\`||\\` short-circuit: when the left side decides the result, the right side is not\nresolved, so \\`$operationdata.user && $operationdata.user.name=='John'\\` does not fail when\n\\`user\\` is missing.\n\nArithmetic (\\`+\\`, \\`-\\`, \\`*\\`, \\`/\\`) is not supported: \\`-\\` is a valid character in a property\nchain, so \\`$operationdata.a-1\\` would be ambiguous. Nothing in the expression is executed as\ncode, and property chains are resolved with the usual prototype-pollution and global-object\nguards.`,\n category: `Control Flow`,\n properties: {\n expression: {\n type: 'ParameterType:expression',\n required: true,\n erased: true\n }\n },\n };\n}\n","export { addClass } from \"@operation/metadata/add-class.ts\";\nexport { addControllerToElement } from \"@operation/metadata/add-controller-to-element.ts\";\nexport { addGlobalsToOperation } from \"@operation/metadata/add-globals-to-operation.ts\";\nexport { animateWithClass } from \"@operation/metadata/animate-with-class.ts\";\nexport { animate } from \"@operation/metadata/animate.ts\";\nexport { announceToScreenReader } from \"@operation/metadata/announce-to-screen-reader.ts\";\nexport { breakForEach } from \"@operation/metadata/break-for-each.ts\";\nexport { broadcastEvent } from \"@operation/metadata/broadcast-event.ts\";\nexport { calc } from \"@operation/metadata/calc.ts\";\nexport { clearElement } from \"@operation/metadata/clear-element.ts\";\nexport { clearOperationData } from \"@operation/metadata/clear-operation-data.ts\";\nexport { clearStorage } from \"@operation/metadata/clear-storage.ts\";\nexport { compareDate } from \"@operation/metadata/compare-date.ts\";\nexport { concatenateStrings } from \"@operation/metadata/concatenate-strings.ts\";\nexport { continueForEach } from \"@operation/metadata/continue-for-each.ts\";\nexport { createElement } from \"@operation/metadata/create-element.ts\";\nexport { customFunction } from \"@operation/metadata/custom-function.ts\";\nexport { endAction } from \"@operation/metadata/end-action.ts\";\nexport { endForEach } from \"@operation/metadata/end-for-each.ts\";\nexport { endWhen } from \"@operation/metadata/end-when.ts\";\nexport { extendController } from \"@operation/metadata/extend-controller.ts\";\nexport { filterArray } from \"@operation/metadata/filter-array.ts\";\nexport { findInArray } from \"@operation/metadata/find-in-array.ts\";\nexport { forEach } from \"@operation/metadata/for-each.ts\";\nexport { formatDate } from \"@operation/metadata/format-date.ts\";\nexport { formatText } from \"@operation/metadata/format-text.ts\";\nexport { getAttributesFromElement } from \"@operation/metadata/get-attributes-from-element.ts\";\nexport { getControllerFromElement } from \"@operation/metadata/get-controller-from-element.ts\";\nexport { getControllerInstance } from \"@operation/metadata/get-controller-instance.ts\";\nexport { getCurrentTime } from \"@operation/metadata/get-current-time.ts\";\nexport { getElementDimensions } from \"@operation/metadata/get-element-dimensions.ts\";\nexport { getFocusedElement } from \"@operation/metadata/get-focused-element.ts\";\nexport { getFormData } from \"@operation/metadata/get-form-data.ts\";\nexport { getImport } from \"@operation/metadata/get-import.ts\";\nexport { getQueryParams } from \"@operation/metadata/get-query-params.ts\";\nexport { getScrollPosition } from \"@operation/metadata/get-scroll-position.ts\";\nexport { getTextContent } from \"@operation/metadata/get-text-content.ts\";\nexport { httpDelete } from \"@operation/metadata/http-delete.ts\";\nexport { httpPost } from \"@operation/metadata/http-post.ts\";\nexport { httpPut } from \"@operation/metadata/http-put.ts\";\nexport { invokeObjectMethod } from \"@operation/metadata/invoke-object-method.ts\";\nexport { isElementInViewport } from \"@operation/metadata/is-element-in-viewport.ts\";\nexport { loadFromStorage } from \"@operation/metadata/load-from-storage.ts\";\nexport { loadJson } from \"@operation/metadata/load-json.ts\";\nexport { log } from \"@operation/metadata/log.ts\";\nexport { mapArray } from \"@operation/metadata/map-array.ts\";\nexport { math } from \"@operation/metadata/math.ts\";\nexport { otherwise } from \"@operation/metadata/otherwise.ts\";\nexport { removeClass } from \"@operation/metadata/remove-class.ts\";\nexport { removeControllerFromElement } from \"@operation/metadata/remove-controller-from-element.ts\";\nexport { removeElement } from \"@operation/metadata/remove-element.ts\";\nexport { removePropertiesFromOperationData } from \"@operation/metadata/remove-properties-from-operation-data.ts\";\nexport { reparentElement } from \"@operation/metadata/reparent-element.ts\";\nexport { replaceString } from \"@operation/metadata/replace-string.ts\";\nexport { replaceText } from \"@operation/metadata/replace-text.ts\";\nexport { requestAction } from \"@operation/metadata/request-action.ts\";\nexport { saveToStorage } from \"@operation/metadata/save-to-storage.ts\";\nexport { scrollToElement } from \"@operation/metadata/scroll-to-element.ts\";\nexport { scrollToPosition } from \"@operation/metadata/scroll-to-position.ts\";\nexport { selectElement } from \"@operation/metadata/select-element.ts\";\nexport { setData } from \"@operation/metadata/set-data.ts\";\nexport { setElementAttributes } from \"@operation/metadata/set-element-attributes.ts\";\nexport { setElementContent } from \"@operation/metadata/set-element-content.ts\";\nexport { setFocus } from \"@operation/metadata/set-focus.ts\";\nexport { setFormValue } from \"@operation/metadata/set-form-value.ts\";\nexport { setGlobalData } from \"@operation/metadata/set-global-data.ts\";\nexport { setOperationData } from \"@operation/metadata/set-operation-data.ts\";\nexport { setStyle } from \"@operation/metadata/set-style.ts\";\nexport { setVariable } from \"@operation/metadata/set-variable.ts\";\nexport { sortArray } from \"@operation/metadata/sort-array.ts\";\nexport { splitString } from \"@operation/metadata/split-string.ts\";\nexport { startAction } from \"@operation/metadata/start-action.ts\";\nexport { substringText } from \"@operation/metadata/substring-text.ts\";\nexport { toggleClass } from \"@operation/metadata/toggle-class.ts\";\nexport { toggleElement } from \"@operation/metadata/toggle-element.ts\";\nexport { toggleFormElement } from \"@operation/metadata/toggle-form-element.ts\";\nexport { validateForm } from \"@operation/metadata/validate-form.ts\";\nexport { wait } from \"@operation/metadata/wait.ts\";\nexport { when } from \"@operation/metadata/when.ts\";\nexport * from \"@operation/metadata/types.ts\";\n","/**\n * Returns the known names closest to `name`, for \"did you mean\" hints in error\n * messages. Matching ignores case and uses the Levenshtein edit distance; only\n * names within `max(2, floor(name.length / 3))` edits are returned, closest\n * first.\n *\n * @param name - The unknown name, as written in the configuration\n * @param knownNames - The names that are registered\n * @param max - The maximum number of suggestions to return\n * @returns Up to `max` known names, closest first; empty when none is close\n */\nexport function findClosestNames(\n name: string,\n knownNames: readonly string[],\n max = 3\n): string[] {\n const lowerName = name.toLowerCase();\n const maxDistance = Math.max(2, Math.floor(name.length / 3));\n\n return knownNames\n .map(knownName => ({\n knownName,\n distance: levenshtein(lowerName, knownName.toLowerCase()),\n }))\n .filter(({distance}) => distance <= maxDistance)\n .sort((a, b) => a.distance - b.distance)\n .slice(0, max)\n .map(({knownName}) => knownName);\n}\n\n/**\n * Formats suggestions from {@link findClosestNames} as a sentence.\n *\n * @param suggestions - The suggested names\n * @returns `Did you mean 'a', 'b'?`, or an empty string when there are no suggestions\n */\nexport function formatDidYouMean(suggestions: readonly string[]): string {\n if (!suggestions.length) {\n return '';\n }\n return `Did you mean ${suggestions.map(name => `'${name}'`).join(', ')}?`;\n}\n\nfunction levenshtein(a: string, b: string) {\n let previous = Array.from({length: b.length + 1}, (_, i) => i);\n for (let i = 1; i <= a.length; i++) {\n const current = [i];\n for (let j = 1; j <= b.length; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n current[j] = Math.min(\n previous[j] + 1,\n current[j - 1] + 1,\n previous[j - 1] + cost\n );\n }\n previous = current;\n }\n return previous[b.length];\n}\n","import type {\n ExtractOperationDataType,\n GetOperationByName,\n TOperationName,\n} from '@configuration/types.ts';\nimport * as operationMetadata from '@operation/metadata/index.ts';\nimport type {TOperationData} from '@operation/types.ts';\nimport {findClosestNames, formatDidYouMean} from '@util/find-closest-names.ts';\n\n/**\n * An operation system name the fluent API accepts: a built-in operation name\n * (offered by autocompletion), or the name of a custom operation that was\n * passed to the `ConfigurationFactory` in its `customOperations` option.\n * Custom names are checked when the operation is added, not by the compiler.\n */\nexport type TFluentOperationName = TOperationName | (string & {});\n\n/**\n * The operation data the fluent API accepts for the operation `N`: the typed,\n * partial operation data of a built-in operation, or any operation data for a\n * custom operation.\n */\nexport type TFluentOperationData<N extends string> = N extends TOperationName\n ? Partial<ExtractOperationDataType<GetOperationByName<N>>>\n : TOperationData;\n\n/**\n * Operation names are validated against the generated operation metadata, not\n * against the operation implementations. The metadata is plain data, so the\n * fluent configuration API can be loaded in a DOM-less context (Node build\n * tools such as the Eligian compiler), where importing the implementations\n * would evaluate jQuery and throw.\n *\n * @param name the operation system name to check\n * @returns `true` when `name` is a built-in operation\n */\nexport function isKnownOperationName(name: string): name is TOperationName {\n return Object.hasOwn(operationMetadata, name);\n}\n\n/**\n * Throws when the given name is neither the system name of a built-in\n * operation nor one of the given custom operation names.\n *\n * @param name the operation system name to check\n * @param customOperationNames the custom operation names that are accepted as\n * well (the `ConfigurationFactory`'s `customOperations` option)\n * @throws Error when no operation with the given name exists. The message\n * suggests the closest built-in and custom names, and explains how to declare\n * a custom operation.\n */\nexport function assertKnownOperationName(\n name: string,\n customOperationNames?: ReadonlySet<string>\n): void {\n if (isKnownOperationName(name) || customOperationNames?.has(name)) {\n return;\n }\n\n const knownNames = [\n ...Object.keys(operationMetadata),\n ...(customOperationNames ?? []),\n ];\n const didYouMean = formatDidYouMean(\n findClosestNames(String(name), knownNames)\n );\n const hint =\n \"To add a custom operation, declare its name in the ConfigurationFactory options: new ConfigurationFactory(undefined, {customOperations: ['myOperation']}).\";\n throw Error(\n `Unknown operation: ${name}. ${didYouMean ? `${didYouMean} ` : ''}${hint}`\n );\n}\n\n/**\n * Maps operation functions to their system names, for the `...ByType` methods\n * of the fluent API. The map is filled by `register-operation-types.ts`, which\n * the browser entry point (`eligius`) loads. The DOM-free entry point\n * (`eligius/configuration-api`) does not load the operation implementations,\n * so the map stays empty there.\n *\n * The lookup is by function identity, not by `Function.name`, so it keeps\n * working when a minifier renames the operation functions.\n */\nconst operationNamesByType = new Map<unknown, TOperationName>();\n\n/**\n * Registers operation implementations by their system names, so that the\n * `...ByType` methods of the fluent API can map a function back to its name.\n *\n * @param operations a record of operation system names to operation functions\n */\nexport function registerOperationTypes(\n operations: Readonly<Record<string, unknown>>\n): void {\n for (const [name, operation] of Object.entries(operations)) {\n if (typeof operation === 'function' && isKnownOperationName(name)) {\n operationNamesByType.set(operation, name);\n }\n }\n}\n\n/**\n * Returns the system name of the given operation function.\n *\n * @param operationType the operation function\n * @param methodName the fluent API method that asks, used in the error message\n * @param nameBasedMethodName the method that takes a system name instead\n * @returns the system name of the operation\n * @throws Error when the operation function is not known\n */\nexport function getOperationNameByType(\n operationType: unknown,\n methodName: string,\n nameBasedMethodName: string\n): TOperationName {\n const name = operationNamesByType.get(operationType);\n if (name) {\n return name;\n }\n\n if (operationNamesByType.size === 0) {\n throw new Error(\n `${methodName}: the operation implementations are not loaded, so an operation function cannot be mapped to its name. ` +\n `Import the fluent API from the main 'eligius' entry, or call ${nameBasedMethodName}('<operationName>', ...) with the operation's system name.`\n );\n }\n\n throw new Error(`Operation class not found: ${String(operationType)}`);\n}\n","/**\n * Keys that are never copied into the target. Assigning `__proto__` through the\n * inherited accessor would replace a prototype (or, when the existing value is\n * read through it, write onto `Object.prototype`), and `constructor` and\n * `prototype` are the other two entry points of prototype pollution.\n */\nconst UNSAFE_KEYS: ReadonlySet<string> = new Set([\n '__proto__',\n 'constructor',\n 'prototype',\n]);\n\n/**\n * Makes `target` structurally equal to `source` while keeping the identity of\n * the objects and arrays inside `target` wherever possible.\n *\n * The fluent configuration API hands out editors that hold references to\n * objects inside the factory's configuration (an action, an operation, the\n * timeline provider settings). Replacing those objects with copies would\n * detach the editors, so updates are applied in place instead:\n *\n * - Plain objects are updated key by key; keys missing from `source` are removed.\n * - Array entries are matched by their string `id` when both sides have one,\n * otherwise by position. Matched entries are synced recursively and reused.\n * - Everything else is assigned from `source`.\n * - The keys `__proto__`, `constructor` and `prototype` are skipped at every\n * nesting level, also inside values that are inserted as they are, so data\n * from `JSON.parse` cannot pollute `Object.prototype`.\n *\n * `source` should be a value the caller owns (for example a deep copy), because\n * unmatched values from it are inserted into `target` as they are (after their\n * unsafe keys have been removed).\n *\n * @param target - The object to update in place\n * @param source - The desired state\n */\nexport function syncInPlace<T extends object>(target: T, source: T): void {\n if (target === source) {\n return;\n }\n removeUnsafeKeys(source, new WeakSet());\n if (Array.isArray(target) && Array.isArray(source)) {\n syncArray(target, source);\n return;\n }\n syncObject(\n target as Record<string, unknown>,\n source as Record<string, unknown>\n );\n}\n\n/**\n * Deletes the unsafe own keys from every plain object and array reachable from\n * `value`. Deleting an own `__proto__` data property is safe, it does not go\n * through the inherited accessor.\n */\nfunction removeUnsafeKeys(value: unknown, seen: WeakSet<object>): void {\n if (value === null || typeof value !== 'object' || seen.has(value)) {\n return;\n }\n seen.add(value);\n if (Array.isArray(value)) {\n for (const item of value) {\n removeUnsafeKeys(item, seen);\n }\n return;\n }\n if (!isPlainObject(value)) {\n return;\n }\n for (const key of Object.keys(value)) {\n if (UNSAFE_KEYS.has(key)) {\n delete value[key];\n } else {\n removeUnsafeKeys(value[key], seen);\n }\n }\n}\n\nfunction syncObject(\n target: Record<string, unknown>,\n source: Record<string, unknown>\n): void {\n for (const key of Object.keys(target)) {\n if (!Object.hasOwn(source, key)) {\n delete target[key];\n }\n }\n for (const key of Object.keys(source)) {\n if (UNSAFE_KEYS.has(key)) {\n continue;\n }\n // Only own values are synced into, never an inherited one\n const existing = Object.hasOwn(target, key) ? target[key] : undefined;\n target[key] = syncValue(existing, source[key]);\n }\n}\n\nfunction syncArray(target: unknown[], source: unknown[]): void {\n const byId = new Map<string, unknown>();\n for (const item of target) {\n const id = idOf(item);\n if (id !== undefined) {\n byId.set(id, item);\n }\n }\n\n const next = source.map((item, index) => {\n const id = idOf(item);\n const match = id !== undefined ? byId.get(id) : target[index];\n if (id !== undefined && match !== undefined) {\n byId.delete(id);\n }\n return syncValue(match, item);\n });\n\n target.length = 0;\n target.push(...next);\n}\n\nfunction syncValue(existing: unknown, incoming: unknown): unknown {\n if (Array.isArray(existing) && Array.isArray(incoming)) {\n syncArray(existing, incoming);\n return existing;\n }\n if (isPlainObject(existing) && isPlainObject(incoming)) {\n // Do not merge two different identified entities into one object\n const existingId = idOf(existing);\n const incomingId = idOf(incoming);\n if (existingId !== incomingId) {\n return incoming;\n }\n syncObject(existing, incoming);\n return existing;\n }\n return incoming;\n}\n\nfunction idOf(value: unknown): string | undefined {\n if (isPlainObject(value) && typeof value.id === 'string') {\n return value.id;\n }\n return undefined;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n // Object.prototype itself has a null prototype, but must never be written to\n if (value === Object.prototype) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n IActionConfiguration,\n IEndableActionConfiguration,\n IEventActionConfiguration,\n ITimelineActionConfiguration,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {v4 as uuidv4} from 'uuid';\nimport {\n assertKnownOperationName,\n getOperationNameByType,\n type TFluentOperationData,\n type TFluentOperationName,\n} from './operation-lookup.ts';\nimport {syncInPlace} from './sync-in-place.ts';\n\n/**\n *\n * Container factory capable of creating the different kinds of actions.\n * For each type of action a dedicated factory will be returned.\n *\n */\nexport class ActionCreatorFactory {\n constructor(private readonly configurationfactory: ConfigurationFactory) {}\n\n /**\n *\n * Starts the creation of an action in the `actions` list with the specified name\n *\n * @param name\n * @returns\n */\n createAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `initActions` list with the specified name\n *\n * @param name\n * @returns\n */\n createInitAction(name: string): EndableActionCreator {\n const creator = new EndableActionCreator(name, this);\n this.configurationfactory.addInitAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `eventActions` list with the specified name\n *\n * @param name\n * @param eventName the event that starts the action. Without it the action can\n * only be started by name (for example by a `DOMEventListenerController` or\n * `KeyboardController`).\n * @param eventTopic optional topic of the event\n * @returns\n */\n createEventAction(\n name: string,\n eventName?: string,\n eventTopic?: string\n ): ActionCreator {\n const creator = new ActionCreator(name, this);\n const config: Partial<IEventActionConfiguration> = creator.actionConfig;\n if (eventName !== undefined) {\n config.eventName = eventName;\n }\n if (eventTopic !== undefined) {\n config.eventTopic = eventTopic;\n }\n this.configurationfactory.addEventAction(creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Starts the creation of an action in the `timelineActions` list with the specified name and uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string): TimelineActionCreator {\n const creator = new TimelineActionCreator(name, this);\n this.configurationfactory.addTimelineAction(uri, creator.actionConfig);\n return creator;\n }\n\n /**\n *\n * Returns the fluent scope back to the `Configurationfactory`\n *\n * @returns\n */\n end() {\n return this.configurationfactory;\n }\n}\n\n/**\n *\n * A factory that assists in creating an action\n *\n */\nexport class ActionCreator<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n actionConfig: T;\n\n /**\n *\n * Initializes an action configuration with the given name\n *\n * @param name\n * @param factory\n */\n constructor(\n name: string | undefined,\n private readonly factory: ActionCreatorFactory\n ) {\n this.actionConfig = {\n name: name ?? '',\n id: uuidv4(),\n startOperations: [],\n } as unknown as T;\n }\n\n /**\n *\n * The unique id of the action\n *\n * @returns\n */\n getId() {\n return this.actionConfig.id;\n }\n\n /**\n *\n * Sets the name of the action\n *\n * @param name\n * @returns\n * @throws Error when the action is in `actions` or `eventActions` and another\n * action in those lists already has the name\n */\n setName(name: string) {\n // Optional calls: a creator may be constructed with a stand-in factory\n this.factory.end?.()?.assertUniqueActionName?.(name, this.actionConfig);\n this.actionConfig.name = name;\n return this;\n }\n\n /**\n *\n * Passes a copy of the internal state of the `ActionCreator` to the given callback.\n * When the callback returns a configuration, it replaces the action configuration\n * in the `ConfigurationFactory`.\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n syncInPlace(this.actionConfig, deepCopy(newConfig));\n }\n return this;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n * @throws Error when the function is not an operation, or when the operation\n * implementations are not loaded (the DOM-free `eligius/configuration-api` entry)\n */\n addStartOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n return this.addStartOperation(\n getOperationNameByType(\n operationClass,\n 'addStartOperationByType',\n 'addStartOperation'\n ),\n operationData\n );\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name.\n * The operation data is copied, so later changes to the given object do not\n * affect the configuration.\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @param operationData\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n addStartOperation<\n T extends TFluentOperationName,\n O extends TFluentOperationData<T>,\n >(systemName: T, operationData: O) {\n assertKnownOperationName(systemName, this._customOperationNames());\n\n const {startOperations} = this.actionConfig;\n startOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: deepCopy(operationData),\n });\n return this;\n }\n\n /**\n *\n * Returns the fluent scope back to the `ActionCreatorFactory`\n *\n * @returns\n */\n next() {\n return this.factory;\n }\n\n /**\n * The custom operation names of the `ConfigurationFactory`. Optional calls:\n * a creator may be constructed with a stand-in factory.\n */\n protected _customOperationNames(): ReadonlySet<string> | undefined {\n return this.factory.end?.()?.customOperationNames;\n }\n}\n\n/**\n *\n * A factory that assists in creating an endable action\n *\n */\nexport class EndableActionCreator<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionCreator<T> {\n constructor(name: string | undefined, factory: ActionCreatorFactory) {\n super(name, factory);\n this.actionConfig.endOperations = [];\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n * @throws Error when the function is not an operation, or when the operation\n * implementations are not loaded (the DOM-free `eligius/configuration-api` entry)\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(operationClass: T, operationData: Dt) {\n return this.addEndOperation(\n getOperationNameByType(\n operationClass,\n 'addEndOperationByType',\n 'addEndOperation'\n ),\n operationData\n );\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given system name.\n * The operation data is copied, so later changes to the given object do not\n * affect the configuration.\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @param operationData\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n addEndOperation<\n T extends TFluentOperationName,\n O extends TFluentOperationData<T>,\n >(systemName: T, operationData: O) {\n assertKnownOperationName(systemName, this._customOperationNames());\n\n let {endOperations} = this.actionConfig;\n if (!endOperations) {\n endOperations = this.actionConfig.endOperations = [];\n }\n endOperations.push({\n id: uuidv4(),\n systemName: systemName,\n operationData: deepCopy(operationData),\n });\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in creating a timeline action\n *\n */\nexport class TimelineActionCreator extends EndableActionCreator<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n * @throws Error when `end` is given and lower than `start`\n */\n addDuration(start: number, end?: number) {\n if (end !== undefined && start > end) {\n throw new Error(\n `addDuration: start (${start}) cannot be higher than end (${end})`\n );\n }\n this.actionConfig.duration = {\n start: start,\n };\n if (end !== undefined) {\n this.actionConfig.duration.end = end;\n }\n return this;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n ExtractOperationDataType,\n IActionConfiguration,\n IEndableActionConfiguration,\n IOperationConfiguration,\n ITimelineActionConfiguration,\n TOperationName,\n TOperationType,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport type * as operations from '@operation/index.ts';\nimport type {TOperation, TOperationData} from '@operation/types.ts';\nimport {isDefined} from 'ts-is-present';\nimport {v4 as uuidv4} from 'uuid';\nimport type {IDuration} from '../../types.ts';\nimport {\n assertKnownOperationName,\n getOperationNameByType,\n type TFluentOperationData,\n type TFluentOperationName,\n} from './operation-lookup.ts';\nimport {syncInPlace} from './sync-in-place.ts';\n\nfunction array_move(arr: any[], old_index: number, new_index: number) {\n if (new_index >= arr.length) {\n new_index = 0;\n } else if (new_index < 0) {\n new_index = arr.length - 1;\n }\n arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);\n}\n\n/**\n *\n * A factory that assists in editing an action.\n *\n * The editor works directly on the action configuration that the `ConfigurationFactory` holds,\n * so every edit is reflected in the factory's configuration.\n *\n */\nexport class ActionEditor<\n T extends IActionConfiguration = IActionConfiguration,\n> {\n constructor(\n protected actionConfig: T,\n protected readonly configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Called by the `OperationEditor` after it has changed an operation.\n * Operations are edited in place, so there is nothing left to synchronize.\n */\n updateConfiguration() {}\n\n /**\n *\n * Passes a copy of the current action configuration to the given callback.\n * When the callback returns a configuration, it replaces the action configuration\n * in the factory.\n *\n * @param callBack\n * @returns\n */\n getConfiguration(callBack: (config: T) => T | undefined) {\n const copy = deepCopy(this.actionConfig);\n const newConfig = callBack.call(this, copy);\n if (newConfig) {\n syncInPlace(this.actionConfig, deepCopy(newConfig));\n }\n return this;\n }\n\n /**\n *\n * Sets the action name\n *\n * @param name\n * @returns\n * @throws Error when the action is in `actions` or `eventActions` and another\n * action in those lists already has the name\n */\n setName(name: string) {\n // Optional call: an editor may be constructed with a stand-in factory\n this.configurationFactory.assertUniqueActionName?.(name, this.actionConfig);\n this.actionConfig.name = name;\n return this;\n }\n\n /**\n *\n * Gets the action name\n *\n * @returns\n */\n getName() {\n return this.actionConfig.name;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n * @throws Error when the function is not an operation, or when the operation\n * implementations are not loaded (the DOM-free `eligius/configuration-api` entry)\n */\n addStartOperationByType<T extends TOperation<TOperationData>>(\n operationClass: T,\n operationData: Partial<ExtractOperationDataType<T>>\n ): OperationEditor<this, T> {\n return this.addStartOperation(\n getOperationNameByType(\n operationClass,\n 'addStartOperationByType',\n 'addStartOperation'\n ),\n operationData\n ) as OperationEditor<this, T>;\n }\n\n /**\n *\n * Adds the operation data for a start operation specified by the given system name.\n * The operation data is copied, so later changes to the given object do not\n * affect the configuration.\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @param operationData\n * @param id\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n addStartOperation<\n N extends TFluentOperationName,\n D extends TFluentOperationData<N>,\n >(\n systemName: N,\n operationData: D,\n id: string = uuidv4()\n ): OperationEditor<this, TOperation<TOperationData>> {\n assertKnownOperationName(systemName, this.getCustomOperationNames());\n\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n\n const newConfig = {\n id,\n systemName: systemName,\n operationData: deepCopy(operationData) as TOperationData,\n } as IOperationConfiguration<TOperationData>;\n\n startOperations.push(newConfig);\n\n this.actionConfig.startOperations = startOperations;\n\n return new OperationEditor<this, TOperation<TOperationData>>(\n newConfig,\n this\n );\n }\n\n /**\n *\n * Starts an editor for the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n editStartOperation(id: string) {\n const {startOperations} = this.actionConfig;\n const operation = startOperations.find(o => o.id === id);\n\n if (isDefined(operation)) {\n return new OperationEditor<ActionEditor<T>, TOperation<TOperationData>>(\n operation,\n this\n );\n }\n\n throw new Error(`start operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the start operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeStartOperation(id: string) {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n startOperations.splice(idx, 1);\n this.actionConfig.startOperations = startOperations;\n }\n\n return this;\n }\n\n /**\n *\n * Moves the start operation associated with the given id in the given direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveStartOperation(id: string, direction: 'up' | 'down') {\n const startOperations = this.actionConfig.startOperations\n ? this.actionConfig.startOperations.slice()\n : [];\n const operation = startOperations.find(o => o.id === id);\n\n if (!operation) {\n throw new Error(`start operation not found for id ${id}`);\n }\n\n const idx = startOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(startOperations, idx, newIdx);\n this.actionConfig.startOperations = startOperations;\n }\n\n return this;\n }\n\n /**\n *\n * Return the fluent scopt to the `ConfigurationFactory`\n *\n * @returns\n */\n next() {\n return this.configurationFactory;\n }\n\n /**\n * Returns the custom operation names that the `ConfigurationFactory` accepts\n * besides the built-in operations (its `customOperations` option).\n *\n * @returns the custom operation names, or `undefined` when the editor has no factory\n */\n getCustomOperationNames(): ReadonlySet<string> | undefined {\n // Optional chaining: an editor may be constructed with a stand-in factory\n return this.configurationFactory?.customOperationNames;\n }\n}\n\n/**\n *\n * A factory that assists in editing an endable action\n *\n */\nexport class EndableActionEditor<\n T extends IEndableActionConfiguration = IEndableActionConfiguration,\n> extends ActionEditor<T> {\n /**\n *\n * Adds the operation data for a end operation specified by the given type\n *\n * @param operationClass\n * @param operationData\n * @returns\n * @throws Error when the function is not an operation, or when the operation\n * implementations are not loaded (the DOM-free `eligius/configuration-api` entry)\n */\n addEndOperationByType<\n T extends TOperationType,\n Dt extends Partial<ExtractOperationDataType<T>>,\n >(\n operationClass: T,\n operationData: Dt\n ): OperationEditor<this, TOperationType> {\n return this.addEndOperation(\n getOperationNameByType(\n operationClass,\n 'addEndOperationByType',\n 'addEndOperation'\n ),\n operationData\n );\n }\n\n /**\n *\n * Adds the operation data for an end operation specified by the given system name.\n * The operation data is copied, so later changes to the given object do not\n * affect the configuration.\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @param operationData\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n addEndOperation<\n T extends TFluentOperationName,\n O extends TFluentOperationData<T>,\n >(systemName: T, operationData: O) {\n assertKnownOperationName(systemName, this.getCustomOperationNames());\n\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n\n const newConfig = {\n id: uuidv4(),\n systemName: systemName,\n operationData: deepCopy(operationData),\n };\n\n endOperations.push(newConfig);\n\n this.actionConfig.endOperations = endOperations;\n\n return new OperationEditor<this, (typeof operations)[TOperationName]>(\n newConfig,\n this\n );\n }\n\n /**\n *\n * Starts an editor for the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n editEndOperation(id: string) {\n const {endOperations} = this.actionConfig;\n const operationConfig = endOperations.find(o => o.id === id);\n\n if (isDefined(operationConfig)) {\n return new OperationEditor<this>(operationConfig, this);\n }\n\n throw new Error(`operation not found for id ${id}`);\n }\n\n /**\n *\n * Removes the end operation associated with the given id\n *\n * @param id\n * @returns\n */\n removeEndOperation(id: string) {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n endOperations.splice(idx, 1);\n this.actionConfig.endOperations = endOperations;\n }\n\n return this;\n }\n\n /**\n *\n * Moves the end operation associated with the given id in the specified direction\n *\n * @param id\n * @param direction\n * @returns\n */\n moveEndOperation(id: string, direction: 'up' | 'down') {\n const endOperations = this.actionConfig.endOperations\n ? this.actionConfig.endOperations.slice()\n : [];\n const operation = endOperations.find(o => o.id === id);\n\n if (!isDefined(operation)) {\n throw new Error(`operation not found for id ${id}`);\n }\n\n const idx = endOperations.indexOf(operation);\n\n if (idx > -1) {\n const newIdx = direction === 'up' ? idx + 1 : idx - 1;\n array_move(endOperations, idx, newIdx);\n this.actionConfig.endOperations = endOperations;\n }\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing a timeline action\n *\n */\nexport class TimelineActionEditor extends EndableActionEditor<ITimelineActionConfiguration> {\n /**\n *\n * Sets the duration specified by the given start and optional end positions\n *\n * @param start\n * @param end\n * @returns\n */\n setDuration(start: number, end?: number) {\n if (end !== undefined && start > end) {\n throw Error('start position cannot be higher than end position');\n }\n\n const duration: IDuration = {\n start,\n };\n\n if (end !== undefined) {\n duration.end = end;\n }\n\n this.actionConfig.duration = duration;\n return this;\n }\n}\n\n/**\n *\n * A factory that assists in editing an operation\n *\n */\nexport class OperationEditor<\n T extends ActionEditor,\n O extends TOperationType = TOperation<TOperationData>,\n> {\n constructor(\n private operationConfig: IOperationConfiguration<\n ExtractOperationDataType<O>\n >,\n private actionEditor: T\n ) {}\n\n /**\n *\n * Invokes the given callback with a copy of the internal state of the factory\n *\n * @param callBack\n * @returns\n */\n getConfiguration(\n callBack: (\n config: IOperationConfiguration<ExtractOperationDataType<O>>\n ) => IOperationConfiguration<ExtractOperationDataType<O>>\n ) {\n const copy = deepCopy(this.operationConfig);\n const newConfig = callBack.call(this, copy);\n\n if (newConfig) {\n syncInPlace(this.operationConfig, deepCopy(newConfig));\n }\n\n return this;\n }\n\n /**\n *\n * Gets the system name\n *\n * @returns\n */\n getSystemName() {\n return this.operationConfig.systemName;\n }\n\n /**\n *\n * Sets the system name\n *\n * @param systemName a built-in operation name, or a name from the factory's\n * `customOperations` option\n * @returns\n * @throws Error when `systemName` is neither a built-in nor a declared custom operation\n */\n setSystemName(systemName: TFluentOperationName) {\n assertKnownOperationName(\n systemName,\n this.actionEditor.getCustomOperationNames?.()\n );\n\n this.operationConfig.systemName = systemName;\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the operation data. The operation data is copied, so later changes to\n * the given object do not affect the configuration.\n *\n * @param operationData\n * @returns\n */\n setOperationData(operationData: ExtractOperationDataType<O>) {\n this.operationConfig.operationData = deepCopy(operationData);\n this.actionEditor.updateConfiguration();\n return this;\n }\n\n /**\n *\n * Sets the value on the current `operationData` with the given key\n *\n * @param key\n * @param value\n * @returns\n */\n setOperationDataItem(\n key: keyof ExtractOperationDataType<O>,\n value: ExtractOperationDataType<O>[keyof ExtractOperationDataType<O>]\n ) {\n // Copy on write, the current object may still be referenced elsewhere\n return this.setOperationData({\n ...(this.operationConfig.operationData ?? {}),\n [key]: value,\n } as ExtractOperationDataType<O>);\n }\n\n /**\n *\n * returns all of the defined property names on the current `operationData`\n *\n * @returns\n */\n getOperationDataKeys(): Array<keyof ExtractOperationDataType<O>> {\n const {operationData} = this.operationConfig;\n return (operationData ? Object.keys(operationData) : []) as Array<\n keyof ExtractOperationDataType<O>\n >;\n }\n\n /**\n *\n * Gets the value of the given key on the current `operationData`\n *\n * @param key\n * @returns\n */\n getOperationDataValue(key: keyof ExtractOperationDataType<O>) {\n const {operationData} = this.operationConfig;\n return operationData?.[key];\n }\n\n /**\n *\n * Returns the fluent scope back to the action editor\n *\n * @returns\n */\n next() {\n return this.actionEditor;\n }\n}\n","import type {ConfigurationFactory} from '@configuration/api/configuration-factory.ts';\nimport type {\n IContainerProviderConfig,\n IPlaylistConfig,\n IPositionSourceConfig,\n ITimelineProviderSettings,\n TTimelineProviderSettings,\n} from '@configuration/types.ts';\nimport type {TimelineTypes} from '../../types.ts';\n\n/**\n * Default position source system names for convenience methods.\n */\nconst DEFAULT_POSITION_SOURCES: Record<string, string> = {\n raf: 'RafPositionSource',\n scroll: 'ScrollPositionSource',\n video: 'VideoPositionSource',\n};\n\n/**\n * Default container provider system name.\n */\nconst DEFAULT_CONTAINER_PROVIDER = 'DomContainerProvider';\n\n/**\n * Default playlist system name.\n */\nconst DEFAULT_PLAYLIST = 'SimplePlaylist';\n\nexport class TimelineProvidersSettingsEditor {\n constructor(\n private providersSettings: TTimelineProviderSettings,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Adds a new provider for the specified timeline type.\n *\n * @param timelineType - The timeline type (e.g., 'animation', 'mediaplayer')\n * @param positionSourceSystemName - System name of the position source class (default: 'RafPositionSource')\n * @returns A TimelineProviderSettingsEditor for further configuration\n */\n addProvider(\n timelineType: TimelineTypes,\n positionSourceSystemName = 'RafPositionSource'\n ) {\n if (this.providersSettings[timelineType]) {\n throw new Error(\n `Settings for a '${timelineType}' provider already exist`\n );\n }\n\n const settings: ITimelineProviderSettings = {\n positionSource: {systemName: positionSourceSystemName},\n };\n this.providersSettings[timelineType] = settings;\n return new TimelineProviderSettingsEditor(\n settings,\n this,\n this.configurationFactory\n );\n }\n\n editProvider(timelineType: TimelineTypes) {\n if (!this.providersSettings[timelineType]) {\n throw new Error(`No settings for a '${timelineType}' provider exist yet`);\n }\n\n return new TimelineProviderSettingsEditor(\n this.providersSettings[timelineType] as ITimelineProviderSettings,\n this,\n this.configurationFactory\n );\n }\n\n next() {\n return this.configurationFactory;\n }\n}\n\nexport class TimelineProviderSettingsEditor {\n constructor(\n private providerSettings: ITimelineProviderSettings,\n private providersSettingsEditor: TimelineProvidersSettingsEditor,\n private configurationFactory: ConfigurationFactory\n ) {}\n\n /**\n * Sets the position source configuration with full config object.\n * @param config - Position source configuration with systemName and options\n */\n setPositionSource(config: IPositionSourceConfig) {\n this.providerSettings.positionSource = config;\n return this;\n }\n\n /**\n * Sets the position source by system name with optional configuration.\n * @param systemName - The position source class name (e.g., 'RafPositionSource')\n * @param options - Additional options passed to the position source constructor\n */\n setPositionSourceByName(\n systemName: string,\n options?: Record<string, unknown>\n ) {\n this.providerSettings.positionSource = {\n systemName,\n ...options,\n };\n return this;\n }\n\n /**\n * Convenience method to set position source using shorthand type names.\n * @param type - Shorthand type ('raf', 'scroll', 'video')\n * @param options - Type-specific options (`sources` and `poster` for video)\n * @deprecated Use setPositionSourceByName for explicit control\n */\n setPositionSourceType(\n type: 'raf' | 'scroll' | 'video',\n options?: {\n selector?: string;\n tickInterval?: number;\n poster?: string;\n sources?: Array<{src: string; type: string}>;\n }\n ) {\n const systemName = DEFAULT_POSITION_SOURCES[type];\n if (!systemName) {\n throw new Error(`Unknown position source type: ${type}`);\n }\n\n this.providerSettings.positionSource = {\n systemName,\n ...options,\n };\n return this;\n }\n\n /**\n * Sets the container provider configuration by selector.\n * Uses DomContainerProvider by default.\n * @param selector - CSS selector for the container element\n */\n setContainer(selector: string) {\n this.providerSettings.container = {\n systemName: DEFAULT_CONTAINER_PROVIDER,\n selector,\n };\n return this;\n }\n\n /**\n * Sets the container provider configuration with full config object.\n * @param config - Container provider configuration with systemName\n */\n setContainerConfig(config: IContainerProviderConfig) {\n this.providerSettings.container = config;\n return this;\n }\n\n /**\n * Sets the container provider by system name with options.\n * @param systemName - The container provider class name\n * @param options - Additional options passed to the container provider constructor\n */\n setContainerByName(systemName: string, options: Record<string, unknown>) {\n this.providerSettings.container = {\n systemName,\n ...options,\n } as IContainerProviderConfig;\n return this;\n }\n\n /**\n * Sets the playlist configuration.\n * Uses SimplePlaylist by default.\n * @param items - Array of playlist items\n * @param identifierKey - Key used to identify items (default: 'uri')\n */\n setPlaylist<T>(items: readonly T[], identifierKey = 'uri') {\n this.providerSettings.playlist = {\n systemName: DEFAULT_PLAYLIST,\n items,\n identifierKey,\n } as IPlaylistConfig;\n return this;\n }\n\n /**\n * Sets the playlist configuration with full config object.\n * @param config - Playlist configuration with systemName\n */\n setPlaylistConfig(config: IPlaylistConfig) {\n this.providerSettings.playlist = config;\n return this;\n }\n\n /**\n * Sets the playlist by system name with options.\n * @param systemName - The playlist class name\n * @param options - Additional options including items and identifierKey\n */\n setPlaylistByName(\n systemName: string,\n options: {items: unknown[]; identifierKey: string; [key: string]: unknown}\n ) {\n this.providerSettings.playlist = {\n systemName,\n ...options,\n } as IPlaylistConfig;\n return this;\n }\n\n next() {\n return this.providersSettingsEditor;\n }\n\n end() {\n return this.configurationFactory;\n }\n}\n","/**\n *\n * Merges the properties of the target object into the source object, only the properties that do not exist yet on the source.\n *\n * This function is pure, so it returns a new instance that reflects the merging of the two objects.\n *\n * The merge is shallow.\n *\n * @param target\n * @param source\n * @returns\n */\nexport const mergeIfMissing = <\n Src extends Record<PropertyKey, any>,\n Trg extends Partial<Src> & Record<PropertyKey, any>,\n>(\n target: Src,\n source: Trg\n): Src & Trg =>\n Object.entries(source).reduce(\n (acc, [key, value]) => (key in acc ? acc : {...acc, [key]: value}),\n target\n );\n","import {ActionCreatorFactory} from '@configuration/api/action-creator-factory.ts';\nimport {\n ActionEditor,\n EndableActionEditor,\n TimelineActionEditor,\n} from '@configuration/api/action-editor.ts';\nimport {TimelineProvidersSettingsEditor} from '@configuration/api/timeline-provider-settings-editor.ts';\nimport type {\n IActionConfiguration,\n IContainerProviderConfig,\n IEngineConfiguration,\n IPositionSourceConfig,\n ITimelineActionConfiguration,\n ITimelineConfiguration,\n} from '@configuration/types.ts';\nimport {deepCopy} from '@operation/helper/deep-copy.ts';\nimport {mergeIfMissing} from '@util/merge-if-missing.ts';\nimport {v4 as uuidv4} from 'uuid';\nimport type {KeysOfType, TimelineTypes, TLanguageCode} from '../../types.ts';\nimport {syncInPlace} from './sync-in-place.ts';\n\n/** */\nexport type TEngineConfigurationLists = KeysOfType<IEngineConfiguration, any[]>;\n\n/**\n * Action names must be unique across these lists.\n */\nconst UNIQUE_NAME_LISTS: TEngineConfigurationLists[] = [\n 'actions',\n 'eventActions',\n];\n\n/**\n * Options for the {@link ConfigurationFactory} constructor.\n */\nexport interface IConfigurationFactoryOptions {\n /**\n * The system names of custom operations that the name based methods\n * (`addStartOperation`, `addEndOperation`, `setSystemName`) accept besides\n * the built-in operations. Only names are needed, so this works in the\n * DOM-free `eligius/configuration-api` entry as well.\n *\n * The implementations are registered with the engine separately, for\n * example `new EligiusResourceImporter({operations: {trackEvent}})`. Custom\n * operations have no generated metadata, so their operation data is not\n * typed or schema-validated.\n */\n customOperations?: readonly string[];\n}\n\nfunction toCustomOperationNames(\n customOperations: readonly string[] | undefined\n): ReadonlySet<string> {\n if (customOperations === undefined) {\n return new Set();\n }\n if (!Array.isArray(customOperations)) {\n throw new Error(\n 'ConfigurationFactory: options.customOperations must be an array of operation names.'\n );\n }\n for (const [index, name] of customOperations.entries()) {\n if (typeof name !== 'string' || !name.length) {\n throw new Error(\n `ConfigurationFactory: options.customOperations[${index}] must be a non-empty string.`\n );\n }\n }\n return new Set(customOperations);\n}\n\ntype ConfigurationFactoryExtension<NewFactory extends ConfigurationFactory> = (\n this: NewFactory,\n ...rest: any[]\n) => void;\n\n/**\n * This class offers a fluent, extensible and strongly typed DSL for creating Eligius configurations.\n *\n * @example Building a configuration using the factory\n * To initialize a basic configuration to start off of:\n * ```ts\n * const factory = new ConfigurationFactory()\n * .init(\"en-US\") // Define the default language\n * .addLanguage(\"en-US\", \"English\") // Add English as a supported language\n * .addLanguage(\"nl-NL\", \"Nederlands\") // Add Dutch as a supported language\n * .setLayoutTemplate(\"<div class=\\\"main.container\\\"></div>\") // Add the main container for the presentation\n * .setContainerSelector(\"#ct-container\") // Selector for the element in the body that will contain the presentation\n * .addTimeline( // Add a first timeline\n * 'timeline-1', // Give it a name\n * \"animation\", // This is RAF based timeline\n * 200, // The duration of the timeline in seconds\n * false, // The presentation does NOT play in a loop\n * \".timeline-container\" // The element within the main layout (defined by the layoutTemplate) in which the timeline will be rendered\n * )\n * .editTimelineProviderSettings() // Add a timeline provider\n * .addProvider(\"animation\", \"RafPositionSource\") // Timelines of type 'animation' get their time from requestAnimationFrame\n * .setContainer(\".timeline-container\") // The element the timeline renders into\n * .end(); // This finally returns the ConfigurationFactory instance\n * ```\n *\n * Then to add an init action:\n * ```ts\n * factory\n * .createInitAction(\"GetUserName\")\n * .addStartOperationByType(getQueryParams, {\n * defaultValues: { username: \"guest\" },\n * })\n * .addStartOperationByType(setGlobalData, { properties: [\"queryParams\"] });\n * ```\n *\n * After that, add a timeline action:\n * ```ts\n * factory.createTimelineAction(\"timeline-1\", \"AddIntroContainer\")\n * .addDuration(0, 10)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(setElementContent, {\n * template: '<div class=\"intro-text\"></div>',\n * })\n * .addEndOperationByType(selectElement, { selector: \".intro-text\" })\n * .addEndOperationByType(removeElement, {});\n * ```\n *\n * It also possible to extend the factory with specialized creation methods for the particular\n * configuration you are building:\n * ```ts\n * function addImage(this: ConfigurationFactory, actionName: string, imageSrc: string, imageId: string) {\n * this.createInitAction(actionName)\n * .addStartOperationByType(selectElement, { selector: \".timeline-container\" })\n * .addStartOperationByType(createElement, { elementName: 'img', attributes: {src: imageSrc, id: imageId} })\n * .addStartOperationByType(setElementContent, { insertionType: \"append\" })\n * .addEndOperationByType(selectElement, { selector: `#${imageId}` })\n * .addEndOperationByType(removeElement, {});\n * }\n *\n * const customFactory = ConfigurationFactory.extend(factory, \"addImage\", addImage);\n *\n * customFactory.addImage(\"MyImageActionName\", \"my-image.png\", \"my-image-id\");\n * ```\n *\n * Finally, retrieve the configuration and save it:\n * ```ts\n * import fs from \"node:fs\";\n *\n * const configuration = customFactory.getConfiguration();\n *\n * fs.writeFileSync(\"/my/path/configuration.json\", JSON.stringify(configuration), {encoding:'utf-8'})\n * ```\n *\n * In plain Node (build tools, code generators) import the factory from `eligius/configuration-api`.\n * That entry does not load jQuery or the other DOM dependencies. It supports every method except the\n * `...ByType` ones, which need the operation implementations; use the name based methods there:\n * ```ts\n * import {ConfigurationFactory} from 'eligius/configuration-api';\n *\n * factory.createAction('MyAction').addStartOperation('selectElement', {selector: '#app'});\n * ```\n *\n * The `ConfigurationFactory` can also be used to edit an existing configuration. In this case, simply\n * pass the JSON configuration to the `ConfigurationFactory`'s constructor:\n * ```ts\n * import myConfiguration from './my-configuration.json';\n *\n * const factory = new ConfigurationFactory(myConfiguration);\n *\n * factory.editInitAction(\"existingActionName\")\n * .removeEndOperation(\"475fd0ab-5755-4e60-8f7c-e1988a109678\");\n * ```\n */\nexport class ConfigurationFactory {\n actionCreatorFactory: ActionCreatorFactory;\n\n /**\n * The custom operation names this factory accepts besides the built-in\n * operations, from the `customOperations` option.\n */\n readonly customOperationNames: ReadonlySet<string>;\n\n /**\n * Constructs a new `ConfigurationFactory`\n * @param configuration an optional existing configuration that will be used as a starting point\n * @param options optional settings, see {@link IConfigurationFactoryOptions}\n * @throws Error when `options.customOperations` is not an array of non-empty strings\n *\n * @example Accepting a custom operation\n * ```ts\n * const factory = new ConfigurationFactory(undefined, {customOperations: ['trackEvent']});\n * factory.createAction('Track').addStartOperation('trackEvent', {category: 'intro'});\n * ```\n */\n constructor(\n public configuration: IEngineConfiguration = {} as any,\n options: IConfigurationFactoryOptions = {}\n ) {\n this.customOperationNames = toCustomOperationNames(\n options?.customOperations\n );\n this.actionCreatorFactory = new ActionCreatorFactory(this);\n }\n\n /**\n * Add specialized method to a factory\n *\n * @param factory\n * @param extensionMethodName\n * @param extensionMethod\n * @returns\n */\n static extend<\n T extends ConfigurationFactory,\n K extends PropertyKey,\n C extends (this: T & {[P in K]: C}, ...args: any[]) => any,\n >(factory: T, extensionMethodName: K, extensionMethod: C): T & {[P in K]: C} {\n return Object.defineProperty<T & {[P in K]: C}>(\n factory as any,\n extensionMethodName,\n {\n value: function (this: T & {[P in K]: C}, ...args: Parameters<C>) {\n return extensionMethod.apply(this, args);\n },\n writable: true,\n configurable: true,\n }\n );\n }\n\n /**\n * Add specialized methods to a factory\n *\n * @param factory\n * @param extensions\n * @returns\n */\n static extendMultiple<\n T extends ConfigurationFactory,\n C extends ConfigurationFactoryExtension<T>,\n D extends {[name: string]: C},\n >(factory: T, extensions: D) {\n return Object.entries(extensions).reduce<T & typeof extensions>(\n (acc, [name, method]) =>\n ConfigurationFactory.extend(acc, name, method) as T & typeof extensions,\n factory as T & typeof extensions\n );\n }\n\n /**\n * Initialize the configuration with a minimal shape.\n *\n * It assigns an ID, sets the engine to `EligiusEngine`, default the containerSelector `[data-ct-container=true]`\n * and initializes all of the list properties with empty arrays.\n * @param defaultLanguage\n * @returns\n */\n init(defaultLanguage: TLanguageCode) {\n const newConfiguration: IEngineConfiguration = {\n id: uuidv4(),\n engine: {\n systemName: 'EligiusEngine',\n },\n containerSelector: '[data-ct-container=true]',\n cssFiles: [],\n timelineProviderSettings: {},\n language: defaultLanguage,\n availableLanguages: [],\n layoutTemplate: '',\n initActions: [],\n actions: [],\n timelines: [],\n };\n\n this.configuration = mergeIfMissing(this.configuration, newConfiguration);\n\n return this;\n }\n\n /**\n * Assigns the engine system name\n * @param systemName\n * @returns\n */\n setEngine(systemName: string) {\n this.configuration.engine.systemName = systemName;\n return this;\n }\n\n /**\n * Assigns a string representation of the HTML layout template for the engine.\n *\n * @param layoutTemplate\n * @returns\n */\n setLayoutTemplate(layoutTemplate: string) {\n this.configuration.layoutTemplate = layoutTemplate;\n return this;\n }\n\n /**\n *\n * Assigns the default language\n *\n * @param defaultLanguage\n * @returns\n */\n setDefaultLanguage(defaultLanguage: TLanguageCode) {\n this.configuration.language = defaultLanguage;\n return this;\n }\n\n /**\n *\n * Assign the css selector that specifies the DOM location where the engine renders its output\n *\n * @param selector\n * @returns\n */\n setContainerSelector(selector: string) {\n this.configuration.containerSelector = selector;\n return this;\n }\n\n /**\n *\n * Starts an editing process for the timeline provider settings.\n *\n * @returns\n */\n editTimelineProviderSettings() {\n this.configuration.timelineProviderSettings ??= {};\n return new TimelineProvidersSettingsEditor(\n this.configuration.timelineProviderSettings,\n this\n );\n }\n\n /**\n *\n * Return a copy of the current state of the configuration\n *\n * @param callBack the callback receives a copy of the configuration and can return a changed version. The changes are applied to the factory's configuration in place, so editors that are still open keep working.\n * @returns\n */\n getConfiguration(\n callBack?: (copy: IEngineConfiguration) => IEngineConfiguration\n ) {\n const copy = deepCopy<IEngineConfiguration>(this.configuration);\n if (callBack) {\n const newConfig = callBack.call(this, copy);\n // Update the existing configuration in place, so editors that hold\n // objects inside it stay attached to the factory.\n syncInPlace(\n this.configuration,\n deepCopy<IEngineConfiguration>(newConfig)\n );\n }\n return copy;\n }\n\n /**\n *\n * Adds a language to the `availableLanguages` list.\n * The label represents the name of the language.\n *\n * An error is thrown if a language with the given language code already exists\n *\n * @example\n * factory.addLanguage('en-GB', 'English');\n *\n * @param languageCode The given alnguage code\n * @param languageLabel The human readable name of the language\n * @returns\n */\n addLanguage(languageCode: TLanguageCode, languageLabel: string) {\n const languages = this._initializeCollection(\n this.configuration,\n 'availableLanguages'\n );\n const existing = languages.find(lang => lang.languageCode === languageCode);\n\n if (existing) {\n throw new Error(`Language code '${languageCode}' already exists`);\n }\n\n languages.push({\n id: uuidv4(),\n languageCode: languageCode,\n label: languageLabel,\n });\n return this;\n }\n\n private _internalAddAction(\n collectionName: TEngineConfigurationLists,\n action: IActionConfiguration\n ) {\n if (UNIQUE_NAME_LISTS.includes(collectionName)) {\n this._assertActionNameFree(action.name, action);\n }\n const actions = this._initializeCollection(\n this.configuration,\n collectionName\n );\n actions?.push(action as any);\n }\n\n /**\n * Throws when the given action is in `actions` or `eventActions` and another\n * action in those lists already has the given name. Action names must be\n * unique across those two lists, the rule the `ConfigurationResolver`\n * enforces, so the fluent API reports a duplicate where it is made instead of\n * when the engine is created. Init actions and timeline actions are not\n * checked.\n *\n * Called by the action creators and editors before they rename an action.\n *\n * @param name the new action name\n * @param action the action that gets the name\n * @throws Error when the name is already taken\n */\n assertUniqueActionName(name: string, action: IActionConfiguration): void {\n const isChecked = UNIQUE_NAME_LISTS.some(listName =>\n (\n this.configuration[listName] as IActionConfiguration[] | undefined\n )?.includes(action)\n );\n if (isChecked) {\n this._assertActionNameFree(name, action);\n }\n }\n\n private _assertActionNameFree(name: string, action: IActionConfiguration) {\n // Empty names are not checked, so an action can be created first and named later\n if (!name) {\n return;\n }\n const taken = UNIQUE_NAME_LISTS.some(listName =>\n (\n this.configuration[listName] as IActionConfiguration[] | undefined\n )?.some(other => other !== action && other.name === name)\n );\n if (taken) {\n throw new Error(\n `Action name '${name}' already exists in actions or eventActions. Action names must be unique across actions and eventActions.`\n );\n }\n }\n\n private _initializeCollection<T, K extends keyof T>(\n parent: T,\n name: K\n ): T[K] {\n if (!parent[name]) {\n (parent[name] as any) = [];\n }\n return parent[name] as T[K];\n }\n\n /**\n *\n * Adds the specified action to the `actions` list.\n *\n * @param action\n */\n addAction(action: IActionConfiguration) {\n this._internalAddAction('actions', action);\n }\n\n /**\n *\n * Adds the specified action to the `initActions` list\n *\n * @param action\n */\n addInitAction(action: IActionConfiguration) {\n this._internalAddAction('initActions', action);\n }\n\n /**\n *\n * Adds the specified action to the `eventActions` list\n *\n * @param action\n */\n addEventAction(action: IActionConfiguration) {\n this._internalAddAction('eventActions', action);\n }\n\n /**\n *\n * Adds the given actions to `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param action\n */\n addTimelineAction(uri: string, action: ITimelineActionConfiguration) {\n const timeline = this.getTimeline(uri);\n if (timeline) {\n const timelineActions = this._initializeCollection(\n timeline,\n 'timelineActions'\n );\n timelineActions.push(action);\n } else {\n throw Error(`No timeline found for uri '${uri}'`);\n }\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `actions` list\n *\n * @param name\n * @returns\n */\n createAction(name: string) {\n return this.actionCreatorFactory.createAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `initActions` list\n *\n * @param name\n * @returns\n */\n createInitAction(name: string) {\n return this.actionCreatorFactory.createInitAction(name);\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `eventActions` list\n *\n * @param name\n * @param eventName the event that starts the action. Without it the action can\n * only be started by name (for example by a `DOMEventListenerController` or\n * `KeyboardController`).\n * @param eventTopic optional topic of the event\n * @returns\n *\n * @example\n * ```ts\n * factory\n * .createEventAction('OnLanguageChange', 'language-change')\n * .addStartOperation('log', {});\n * ```\n */\n createEventAction(name: string, eventName?: string, eventTopic?: string) {\n return this.actionCreatorFactory.createEventAction(\n name,\n eventName,\n eventTopic\n );\n }\n\n /**\n *\n * Starts the creation of a new action with the specified name that gets added to the `timelineActions` list that is associated with the specified uri\n *\n * @param uri\n * @param name\n * @returns\n */\n createTimelineAction(uri: string, name: string) {\n return this.actionCreatorFactory.createTimelineAction(uri, name);\n }\n\n /**\n * Add a timeline with the given data\n *\n * @param uri identifier for the timeline\n * @param type animation or mediaplayer\n * @param duration the duration of the timeline in seconds\n * @param isLooped True if the timeline should automatically restart at the end\n * @param selector css selector for the container where the timeline will be rendered\n * @returns\n */\n addTimeline(\n uri: string,\n type: TimelineTypes,\n duration: number,\n isLooped: boolean,\n selector: string\n ) {\n const timelines = this._initializeCollection(\n this.configuration,\n 'timelines'\n );\n const timeline = this.getTimeline(uri);\n if (timeline) {\n throw Error(`timeline for uri ${uri} already exists`);\n }\n const timelineConfig: ITimelineConfiguration = {\n id: uuidv4(),\n type: type,\n uri: uri,\n duration: duration,\n loop: isLooped,\n selector: selector,\n timelineActions: [],\n };\n timelines.push(timelineConfig);\n return this;\n }\n\n /**\n * Gives the timeline its own position source settings, merged over the\n * settings of its type in `timelineProviderSettings` (see\n * `ITimelineConfiguration.positionSource`).\n *\n * @param uri - URI of the timeline\n * @param positionSource - The override. Leave out `systemName` to change\n * single settings of the type's position source, or name another class to\n * replace it for this timeline. `undefined` removes the override.\n * @returns The factory\n * @throws Error when no timeline has the URI\n *\n * @example\n * ```ts\n * factory\n * .addTimeline('intro', 'animation', 10, false, '#intro')\n * .addTimeline('chapter-1', 'animation', 60, false, '#chapter-1')\n * .setTimelinePositionSource('chapter-1', {\n * systemName: 'ScrollPositionSource',\n * selector: '#chapter-1',\n * });\n * ```\n */\n setTimelinePositionSource(\n uri: string,\n positionSource: Partial<IPositionSourceConfig> | undefined\n ) {\n const timeline = this._requireTimeline(uri, 'setTimelinePositionSource');\n if (positionSource === undefined) {\n delete timeline.positionSource;\n } else {\n timeline.positionSource = deepCopy(positionSource);\n }\n return this;\n }\n\n /**\n * Gives the timeline its own container provider settings, merged over the\n * `container` settings of its type in `timelineProviderSettings` (see\n * `ITimelineConfiguration.containerProvider`).\n *\n * @param uri - URI of the timeline\n * @param containerProvider - The override, for example\n * `{selector: '#chapter-1'}`. `undefined` removes the override.\n * @returns The factory\n * @throws Error when no timeline has the URI\n */\n setTimelineContainerProvider(\n uri: string,\n containerProvider: Partial<IContainerProviderConfig> | undefined\n ) {\n const timeline = this._requireTimeline(uri, 'setTimelineContainerProvider');\n if (containerProvider === undefined) {\n delete timeline.containerProvider;\n } else {\n timeline.containerProvider = deepCopy(containerProvider);\n }\n return this;\n }\n\n private _requireTimeline(uri: string, methodName: string) {\n const timeline = this.configuration.timelines\n ? this.getTimeline(uri)\n : undefined;\n if (!timeline) {\n throw new Error(\n `ConfigurationFactory.${methodName}: no timeline found for uri '${uri}'`\n );\n }\n return timeline;\n }\n\n /**\n *\n * Gets the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n getTimeline(uri: string) {\n return this.configuration.timelines.find(t => t.uri === uri);\n }\n\n /**\n *\n * Removes the timeline associated with the specified uri\n *\n * @param uri\n * @returns\n */\n removeTimeline(uri: string) {\n const timelineConfig = this.getTimeline(uri);\n if (timelineConfig) {\n const idx = this.configuration.timelines.indexOf(timelineConfig);\n if (idx > -1) {\n this.configuration.timelines.splice(idx, 1);\n }\n }\n return this;\n }\n\n /**\n *\n * Starts an editor for the action from the `actions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editAction(id: string) {\n const actionConfig = this.configuration.actions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `eventActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editEventAction(id: string) {\n const actionConfig = this.configuration.eventActions?.find(\n a => a.id === id\n );\n if (actionConfig) {\n return new ActionEditor(actionConfig, this);\n }\n throw new Error(`Event action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `initActions` list associated with the given id\n *\n * @param id\n * @returns\n */\n editInitAction(id: string) {\n const actionConfig = this.configuration.initActions.find(a => a.id === id);\n if (actionConfig) {\n return new EndableActionEditor(actionConfig, this);\n }\n throw new Error(`Init action not found for id ${id}`);\n }\n\n /**\n *\n * Starts an editor for the action from the `timelineActions` list associated with the given uri and id\n *\n * @param uri\n * @param id\n * @returns\n */\n editTimelineAction(uri: string, id: string) {\n const timeline = this.getTimeline(uri);\n if (!timeline) {\n throw new Error(`No timeline found for uri '${uri}'`);\n }\n const actionConfig = timeline.timelineActions.find(a => a.id === id);\n if (actionConfig) {\n return new TimelineActionEditor(actionConfig, this);\n }\n throw new Error(\n `Timeline action not found for id '${id}' in timeline '${uri}'`\n );\n }\n}\n","import type { IDOMEventListenerControllerOperationData } from \"@controllers/dom-event-listener-controller.ts\";\nimport type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function DOMEventListenerController(): IControllerMetadata<IDOMEventListenerControllerOperationData> {\n return {\n description: `This controller attaches to the given selected element and adds a DOM event listener for the specified event name that\nexecutes the given actions with the given operation data.\n\nBy default the \\`start\\` operations of the specified actions are executed. To execute the \\`end\\` operations instead,\nprefix the action name with \\`end:\\`.\n\nThe actions receive a copy of \\`actionOperationData\\` plus \\`eventTarget\\` (the event's target) and, for key events,\n\\`eventKey\\` (the \\`KeyboardEvent.key\\`). They run in order, each receiving the operation data the previous one\nreturned. When an action fails, the\nremaining actions are skipped and the failure is reported through the eventbus's \\`reportError\\` (an error naming\nthis controller, the action and the DOM event, with the original error as \\`cause\\`), or logged with\n\\`console.error\\` when the eventbus has no \\`reportError\\`.`,\n dependentProperties: ['selectedElement'],\n properties: {\n eventName: {\n type: 'ParameterType:eventName',\n required: true,\n },\n actions: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n },\n actionOperationData: {\n type: 'ParameterType:object',\n }\n },\n };\n}\n","import type { IKeyboardControllerOperationData } from \"@controllers/keyboard-controller.ts\";\nimport type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function KeyboardController(): IControllerMetadata<IKeyboardControllerOperationData> {\n return {\n description: `This controller runs the given actions when one of the given keys is pressed.\n\nBy default the \\`start\\` operations of the specified actions are executed. To execute the \\`end\\` operations instead,\nprefix the action name with \\`end:\\`.\n\nThe actions receive a copy of \\`actionOperationData\\` plus \\`eventTarget\\` (the focused element, or the body when\nnothing has focus) and \\`eventKey\\` (the \\`KeyboardEvent.key\\`). They run in order, each receiving the operation data\nthe previous one returned. When an action fails, the remaining actions are skipped and the failure is reported\nthrough the eventbus's \\`reportError\\`, or logged with \\`console.error\\` when the eventbus has no \\`reportError\\`.\n\nWith \\`scope: 'document'\\` (the default) the keys work while the focus is inside the engine root, or while nothing\nhas focus. With \\`scope: 'element'\\` they only work while the focus is inside the selected element. Presses in\n\\`input\\`, \\`select\\`, \\`textarea\\` and contenteditable elements are ignored, so typing keeps working. A handled press\nhas its default action prevented (no scrolling for arrow keys and space); a held key runs the actions once, not\nagain for every key repeat.\n\nWhen the keys include the play toggle hotkey of the engine (space by default), or a key that the engine's\nKeyboardStepSource binds (the arrow keys, \\`shift+left\\`/\\`shift+right\\`, \\`home\\` and \\`end\\`), the controller wins: a\npress it handles runs its actions and does not toggle playback or step the timeline. A press it ignores (for\nexample outside the selected element with \\`scope: 'element'\\`) still does.\n\nThe keys are bound in the hotkeys-js \\`'all'\\` scope, so they work whatever scope a KeyboardStepSource sets. The\nhotkeys-js global \\`filter\\` still applies. Detaching removes only this controller's handler.`,\n dependentProperties: ['selectedElement'],\n properties: {\n keys: {\n type: 'ParameterType:string',\n required: true,\n },\n actions: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n },\n actionOperationData: {\n type: 'ParameterType:object',\n },\n scope: {\n type: [\n { value: 'document' },\n { value: 'element' }\n ],\n }\n },\n };\n}\n","import type { ILabelControllerMetadata } from \"@controllers/label-controller.ts\";\nimport type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LabelController(): IControllerMetadata<ILabelControllerMetadata> {\n return {\n description: `This controller attaches to the given selected element and renders the text\nassociated with the given translation key.\n\nTranslations may contain simple inline markup. They are passed through\n\\`sanitizeHtml\\` before insertion, so \\`<br>\\`, \\`<strong>\\`, \\`<em>\\`,\n\\`<span>\\` and http(s)/mailto/relative links render, while scripts, event\nhandlers, \\`javascript:\\` URLs, images, iframes and SVG are removed.\n\nThe controller listens for the \\`language-change\\` event and re-renders the text\nwith the new language after such an event.\n\nUses the rosetta-based locale system via \\`request-translation\\` event.`,\n dependentProperties: ['selectedElement'],\n properties: {\n translationKey: {\n type: 'ParameterType:string',\n required: true,\n },\n attributeName: {\n type: 'ParameterType:string',\n }\n },\n };\n}\n","import type { ILottieControllerMetadata } from \"@controllers/lottie-controller.ts\";\nimport type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\n\nexport function LottieController(): IControllerMetadata<ILottieControllerMetadata> {\n return {\n description: `This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.\n\nThe url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json\n\nlottie-web is an optional peer dependency. It is loaded with a dynamic\n\\`import()\\` the first time a LottieController attaches, so applications that\nnever use this controller do not need it installed.`,\n properties: {\n url: {\n type: 'ParameterType:url',\n }\n },\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { IMutationObserverControllerMetadata } from \"@controllers/mutation-observer-controller.ts\";\n\nexport function MutationObserverController(): IControllerMetadata<IMutationObserverControllerMetadata> {\n return {\n description: `Controller that observes DOM mutations on a selected element and broadcasts events.\n\nThis controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,\ntext content) on a specified element. All detected mutations are broadcasted through the\nEligius eventbus, enabling reactive behavior in response to DOM changes.\n\nThe controller follows the standard Eligius lifecycle:\n- init(): Store configuration metadata\n- attach(): Create and start the MutationObserver\n- detach(): Disconnect the observer and clean up resources`,\n dependentProperties: ['selectedElement'],\n properties: {\n observeAttributes: {\n type: 'ParameterType:boolean',\n },\n observeChildList: {\n type: 'ParameterType:boolean',\n },\n observeCharacterData: {\n type: 'ParameterType:boolean',\n },\n observeSubtree: {\n type: 'ParameterType:boolean',\n },\n attributeOldValue: {\n type: 'ParameterType:boolean',\n },\n characterDataOldValue: {\n type: 'ParameterType:boolean',\n },\n attributeFilter: {\n type: 'ParameterType:array',\n itemType: 'ParameterType:string',\n }\n },\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { INavigationControllerOperationData } from \"@controllers/navigation-controller.ts\";\n\nexport function NavigationController(): IControllerMetadata<INavigationControllerOperationData> {\n return {\n description: `Renders a navigation menu in the selected element and keeps it in sync with\nthe active navigation entry.\n\nActivating a menu item (click, Enter or Space) navigates to its entry:\n- an entry with a \\`timelineUri\\` broadcasts \\`request-timeline-uri\\`\n [timelineUri, position], which the engine handles by switching timelines;\n- an entry without one broadcasts the legacy \\`request-video-url\\`\n [videoUrlIndex, position], which the engine does not handle.\n\nWith \\`autoNext\\`, the next entry is started when the active entry's timeline\ncompletes (\\`timeline-complete\\`) or, for legacy entries, on \\`video-complete\\`.\nWhen the engine switches to a timeline that an entry names\n(\\`timeline-current-timeline-change\\`), that entry becomes the active one.`,\n dependentProperties: ['selectedElement'],\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { IProgressbarControllerOperationData } from \"@controllers/progressbar-controller.ts\";\n\nexport function ProgressbarController(): IControllerMetadata<IProgressbarControllerOperationData> {\n return {\n description: `This controller renders a progressbar that displays the progress of the current timeline in the given selected element.\n\nThe current progress as a percentage is rendered in the given text element.`,\n dependentProperties: ['selectedElement', 'textElement'],\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { IRoutingControllerOperationData } from \"@controllers/routing-controller.ts\";\n\nexport function RoutingController(): IControllerMetadata<IRoutingControllerOperationData> {\n return {\n description: `Keeps the browser history in sync with the navigation entries: each entry\ngets a \\`#/<id>/<position>\\` URL, and back/forward navigation requests the\nentry in the URL.\n\nRequests go to the engine as \\`request-timeline-uri\\` for entries with a\n\\`timelineUri\\`, and as the legacy \\`request-video-url\\` otherwise. Before the\nengine switches timelines (\\`before-request-timeline-uri\\`, or the legacy\n\\`before-request-video-url\\`), the current entry is saved with its position.\n\nThis is a work in progress, do not use this yet please....`,\n properties: {\n json: {\n type: 'ParameterType:object',\n required: true,\n }\n },\n };\n}\n","import type { IControllerMetadata } from \"@controllers/metadata/types.ts\";\nimport type { ISubtitlesControllerOperationData } from \"@controllers/subtitles-controller.ts\";\n\nexport function SubtitlesController(): IControllerMetadata<ISubtitlesControllerOperationData> {\n return {\n description: `This controller shows the subtitle whose duration contains the current\ntimeline position in the selected element, in the current language, and\nre-renders it after a \\`language-change\\` event.\n\nThe starting language is the locale's current language\n(\\`request-current-language\\`); the configured \\`language\\` is only used when\nnothing answers that request.\n\nSubtitle texts may contain simple inline markup. They are passed through\n\\`sanitizeHtml\\` before insertion, so \\`<br>\\`, \\`<i>\\`, \\`<em>\\`,\n\\`<strong>\\` and \\`<span>\\` render, while scripts, event handlers,\n\\`javascript:\\` URLs, images, iframes and SVG are removed.`,\n dependentProperties: ['selectedElement'],\n properties: {\n language: {\n type: 'ParameterType:languagecode',\n },\n subtitleData: {\n type: 'ParameterType:array',\n }\n },\n };\n}\n","export { DOMEventListenerController } from \"@controllers/metadata/dom-event-listener-controller.ts\";\nexport { KeyboardController } from \"@controllers/metadata/keyboard-controller.ts\";\nexport { LabelController } from \"@controllers/metadata/label-controller.ts\";\nexport { LottieController } from \"@controllers/metadata/lottie-controller.ts\";\nexport { MutationObserverController } from \"@controllers/metadata/mutation-observer-controller.ts\";\nexport { NavigationController } from \"@controllers/metadata/navigation-controller.ts\";\nexport { ProgressbarController } from \"@controllers/metadata/progressbar-controller.ts\";\nexport { RoutingController } from \"@controllers/metadata/routing-controller.ts\";\nexport { SubtitlesController } from \"@controllers/metadata/subtitles-controller.ts\";\nexport * from \"@controllers/metadata/types.ts\";\n","import type {TControllerName, TOperationName} from '@configuration/types.ts';\nimport * as controllerMetadata from '@controllers/metadata/index.ts';\nimport * as operationMetadata from '@operation/metadata/index.ts';\nimport type {IOperationMetadata} from '@operation/metadata/types.ts';\nimport type {TOperationData} from '@operation/types.ts';\n\n// The providers read the generated metadata instead of the operation and\n// controller implementations, so they work in a DOM-less context. The metadata\n// has one entry per operation and per controller.\n\n/**\n *\n * Provider for all the available operation names\n *\n */\nexport class OperationNamesProvider {\n getOperationNames(): TOperationName[] {\n return Object.keys(operationMetadata) as TOperationName[];\n }\n}\n\n/**\n *\n * Provider for all the available controller names\n *\n */\nexport class ControllerNamesProvider {\n getControllerNames(): TControllerName[] {\n return Object.keys(controllerMetadata) as TControllerName[];\n }\n}\n\n/**\n *\n * Provider that can retrieve the metadata associated with a given operation name\n *\n */\nexport class OperationMetadataProvider {\n getOperationMetadata(operationName: TOperationName) {\n const getMetadata = (\n operationMetadata as Record<\n TOperationName,\n () => IOperationMetadata<TOperationData>\n >\n )[operationName];\n if (!getMetadata) {\n throw new Error(\n `Could not find metadata for operation called ${operationName}`\n );\n }\n return getMetadata();\n }\n}\n","import {v4 as uuidv4} from 'uuid';\nimport type {IStrictDuration, ISubtitle} from '../../types.ts';\n\n/**\n * This class converts an AVID subtitle file to an `ISubtitle` array.\n *\n * Every subtitle gets a unique `id`. The lines of a multi-line caption are\n * joined with a newline (`\\n`), never with HTML.\n */\nexport class SubtitleImporter {\n importSubtitles(rawLines: string[]): ISubtitle[] {\n const result: ISubtitle[] = [];\n const lines: string[] = [];\n for (let i: number = 0, l: number = rawLines.length; i < l; i++) {\n const rawLine: string = this.stripNewlineChars(rawLines[i].toString());\n if (this.isValidLine(rawLine)) {\n lines.push(rawLine);\n }\n }\n\n // A caption is a duration line followed by its text lines, blank lines\n // separate the captions.\n let duration: IStrictDuration | undefined;\n let textLines: string[] = [];\n const flush = () => {\n if (duration) {\n result.push({id: uuidv4(), duration, text: textLines.join('\\n')});\n }\n duration = undefined;\n textLines = [];\n };\n lines.forEach((line: string) => {\n if (line.length === 0) {\n flush();\n } else if (!duration) {\n duration = this.convertDuration(line);\n } else {\n textLines.push(line);\n }\n });\n flush();\n\n return result;\n }\n\n stripNewlineChars(str: string): string {\n let res: string = '';\n for (let i: number = 0, l: number = str.length; i < l; i++) {\n if (str.charCodeAt(i) !== 13 && str.charCodeAt(i) !== 0) {\n res += str.charAt(i);\n }\n }\n return res;\n }\n\n isValidLine(line: string): boolean {\n return (\n !line.startsWith('@') &&\n !line.startsWith('<begin subtitles>') &&\n !line.startsWith('<end subtitles>')\n );\n }\n\n convertDuration(time: string): IStrictDuration {\n const times: string[] = time.split(' ');\n return {\n start: this.convertTimeToSeconds(times[0]),\n end: this.convertTimeToSeconds(times[1]),\n };\n }\n\n convertTimeToSeconds(time: string): number {\n const parts: string[] = time.split(':');\n return (\n parseInt(parts[0], 10) * 3600 +\n parseInt(parts[1], 10) * 60 +\n parseInt(parts[2], 10)\n );\n }\n}\n","import {v4 as uuidv4} from 'uuid';\nimport type {\n IStrictDuration,\n ISubtitle,\n ISubtitleCollection,\n TLanguageCode,\n} from '../../types.ts';\n\n/**\n * Used to edit and add to an {@link ISubtitleCollection}.\n */\nexport class SubtitleEditor {\n constructor(private collection: ISubtitleCollection[] = []) {}\n\n private _getLanguage(languageCode: string) {\n return this.collection.find(x => x.languageCode === languageCode);\n }\n\n /**\n * Adds a new {@link ISubtitleCollection} for the given `languageCode`.\n *\n * If collections already exist for existing language codes then a duplicate\n * of these collections is created with the same duration info but all of the\n * text is left empty.\n *\n * @param languageCode\n * @returns\n */\n addLanguage(languageCode: TLanguageCode) {\n const language = this._getLanguage(languageCode);\n if (language) {\n throw new Error(`Language ${languageCode} already exists.`);\n }\n const newLanguage: ISubtitleCollection = this.collection.length\n ? {\n ...this.collection[0],\n languageCode,\n titles: this.collection[0].titles.map(x => ({\n id: uuidv4(),\n duration: {...x.duration},\n text: '',\n })),\n }\n : {\n languageCode,\n titles: [],\n };\n this.collection.push(newLanguage);\n return this;\n }\n\n /**\n *\n * Add a single subtitle line that is associated with the given `languageCode`\n *\n * @param languageCode\n * @param subtitle\n * @returns\n */\n addSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n language.titles.push(subtitle);\n return this;\n }\n\n addSubtitles(\n duration: IStrictDuration,\n subtitles: Record<TLanguageCode, string>\n ) {\n Object.entries(subtitles).forEach(([languageCode, subtitle]) =>\n this.addSubtitle(languageCode as TLanguageCode, {\n id: uuidv4(),\n duration: {...duration},\n text: subtitle,\n })\n );\n return this;\n }\n\n setSubtitle(languageCode: TLanguageCode, subtitle: ISubtitle) {\n const language = this._getLanguage(languageCode);\n if (!language) {\n throw new Error(`Language ${languageCode} does not exist.`);\n }\n\n const titleIdx = language.titles.findIndex(x => x.id === subtitle.id);\n if (titleIdx < 0) {\n throw new Error(\n `Subtitle with id '${subtitle.id}' was not found in language with code ${languageCode}.`\n );\n }\n\n language.titles[titleIdx] = {\n ...subtitle,\n duration: {...subtitle.duration},\n };\n return this;\n }\n\n export() {\n return this.collection;\n }\n}\n"],"mappings":";;;;;;AAAA,MAAM,mBAAmB,SAAS,UAAU;;AAE5C,MAAM,0BAA0B,iBAAiB,KAAK,MAAM;;;;;;;;;;;AAY5D,SAAgBA,gBACd,OACuC;CACvC,IAAI,UAAU,QAAQ,OAAO,UAAU,UACrC,OAAO;CAET,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,IAAI,cAAc,QAAQ,cAAc,OAAO,WAC7C,OAAO;CAIT,IAAI,OAAO,eAAe,SAAS,MAAM,MACvC,OAAO;CAET,MAAM,oBAAoB,OAAO,OAAO,WAAW,aAAa,IAC5D,UAAU,cACV;CACJ,OACE,OAAO,sBAAsB,cAC7B,iBAAiB,KAAK,iBAAiB,MAAM;AAEjD;;;AChCA,MAAM,eACJ,OAAO,oBAAoB,cACvB,mBACI,aAAkB,KAAK,MAAM,KAAK,UAAU,QAAQ,CAAC;;;;;;;;;;;;;;;AAgB/D,SAAgB,SAAY,UAAgB;CAC1C,IACE,aAAa,QACb,OAAO,aAAa,YACpB,gBAAgB,QAAQ,GAExB,OAAO;CAET,OAAO,WAAW,UAAU,EAAC,MAAM,KAAI,CAAC;AAC1C;;;;AAcA,SAAS,UACP,OACA,aACA,YACA,SACS;CAET,IAAI,UAAU,QAAQ,OAAO,UAAU,YAA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