{"version":3,"sources":["jsdelivr-header.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/enums.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/createDestructor.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/parent/getOriginFromSrc.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/errorSerialization.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/generateId.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/methodSerialization.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/connectCallSender.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/parent/handleAckMessageFactory.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/connectCallReceiver.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/parent/connectToChild.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/createLogger.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/parent/validateIframeHasSrcOrSrcDoc.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/parent/handleSynMessageFactory.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/startConnectionTimeout.js","/npm/@chili-publish/studio-sdk@1.38.0/node_modules/penpal/lib/parent/monitorIframeRemoval.js","/npm/@chili-publish/studio-sdk@1.38.0/src/interactions/Connector.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/ConfigurationTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/DocumentTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/EditorResponseData.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ActionController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/AnimationController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/BarcodeTypes.ts","/npm/@chili-publish/connector-types/src/Common.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/LayoutTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/BarcodeController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/ColorStyleTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/BrandKitHelper.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/BrandKitController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/CanvasController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/CharacterStyleController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ClipboardController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ColorConversionController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ColorStyleController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/ConnectorTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/ConnectorCompatibilityTools.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ConnectorController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/DataConnectorController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/DataSourceController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/DebugController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/DocumentController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/FrameTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ExperimentController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/FontConnectorController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/FontController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ShapeController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/FrameController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/InfoController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/LayoutController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/MediaConnectorTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/MediaConnectorController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/PageController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ParagraphStyleController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/CommonTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/VariableTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/SubscriberController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/TextStyleController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/Enums.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ToolController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/UndoManagerController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/MathUtils.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/UtilsController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/VariableController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/next/controllers/SubscriberController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/next/controllers/VariableController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/next/controllers/ConnectorController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/next/controllers/PageController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/next/NextInitiator.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/EngineEventTrigger.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/EngineCallbackHandler.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/EngineEvent.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/ConfigHelper.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/DataItemMappingTools.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ConfigurationController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/utils/LocalConfigurationDecorator.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/GradientStyleController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ComponentConnectorController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/controllers/ComponentController.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/sdk.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/AnimationTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/ViewModeTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/GradientStyleTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/FontConnectorTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/ComponentConnectorTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/TextStyleTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/ParagraphStyleTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/ActionTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/ShapeTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/types/EngineEditModeTypes.ts","/npm/@chili-publish/studio-sdk@1.38.0/src/next/types/ConnectorTypes.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,6tBCNO,IAAI,GACA,GAOA,GAKA,GAMA,GAIA,IAtBA,GAMR,KAAgB,GAAc,KALjB,KAAU,OACtB,GAAY,MAAW,QACvB,GAAY,IAAS,MACrB,GAAY,OAAY,SACxB,GAAY,IAAS,MAEd,SACA,GACP,EAAW,UAAe,YAC1B,EAAW,SAAc,UAC7B,CAJW,CAIR,KAAe,GAAa,KACpB,SACA,GACP,EAAU,oBAAyB,sBACnC,EAAU,kBAAuB,oBACjC,EAAU,YAAiB,aAC/B,CALW,CAKR,KAAc,GAAY,KAClB,SACA,GACP,EAAgB,eAAoB,gBACxC,CAHW,CAGR,KAAoB,GAAkB,KAC9B,SACA,GACP,EAAgB,QAAa,SACjC,CAHW,CAGR,KAAoB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Q,KAAK,aAC7D,KAAK,KAAO,IAAI,GAAe,KAAK,WACpC,KAAK,KAAO,IAAI,GAAe,KAAK,WACpC,KAAK,MAAQ,IAAI,GAAgB,KAAK,WAEtC,KAAK,cAAgB,IAAI,GAAoB,KAAK,WAClD,KAAK,WAAa,IAAI,GAAqB,KAAK,WAChD,KAAK,cAAgB,IAAI,GAAwB,KAAK,WACtD,KAAK,eAAiB,IAAI,GAAyB,KAAK,WACxD,KAAK,eAAiB,IAAI,GAAyB,KAAK,WACxD,KAAK,KAAO,IAAI,GAAe,KAAK,WACpC,KAAK,WAAa,IAAI,GAAqB,KAAK,WAChD,KAAK,OAAS,IAAI,GAAiB,KAAK,WACxC,KAAK,gBAAkB,IAAI,GAA0B,KAAK,WACrD,KAAA,KAAO,IAAI,GAChB,KAAK,UAAY,IAAI,GAAoB,KAAK,WACzC,KAAA,KAAO,IAAI,GAAc,KAAK,OAAQ,KAAK,WAAY,KAAK,WAC5D,KAAA,uBAAyB,KAAK,OAAO,sBAC1C,KAAK,SAAW,IAAI,GAAmB,KAAK,UAAW,KAAI,GWtIvD,EAAA,gCvDqP+D,CACvE,IAAK,mBACL,OAAQ,SuDvPA,OAAA,iBAAA,EAAA,CAAA,WAAA,CAAA,OAAA,IAAA,OAAA,aAAA,CAAA,MAAA","file":"/npm/@chili-publish/studio-sdk@1.38.0/_bundles/main.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@chili-publish/studio-sdk@1.38.0/_bundles/main.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export var MessageType;\n(function (MessageType) {\n    MessageType[\"Call\"] = \"call\";\n    MessageType[\"Reply\"] = \"reply\";\n    MessageType[\"Syn\"] = \"syn\";\n    MessageType[\"SynAck\"] = \"synAck\";\n    MessageType[\"Ack\"] = \"ack\";\n})(MessageType || (MessageType = {}));\nexport var Resolution;\n(function (Resolution) {\n    Resolution[\"Fulfilled\"] = \"fulfilled\";\n    Resolution[\"Rejected\"] = \"rejected\";\n})(Resolution || (Resolution = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n    ErrorCode[\"ConnectionDestroyed\"] = \"ConnectionDestroyed\";\n    ErrorCode[\"ConnectionTimeout\"] = \"ConnectionTimeout\";\n    ErrorCode[\"NoIframeSrc\"] = \"NoIframeSrc\";\n})(ErrorCode || (ErrorCode = {}));\nexport var NativeErrorName;\n(function (NativeErrorName) {\n    NativeErrorName[\"DataCloneError\"] = \"DataCloneError\";\n})(NativeErrorName || (NativeErrorName = {}));\nexport var NativeEventType;\n(function (NativeEventType) {\n    NativeEventType[\"Message\"] = \"message\";\n})(NativeEventType || (NativeEventType = {}));\n","export default (localName, log) => {\n    const callbacks = [];\n    let destroyed = false;\n    return {\n        destroy(error) {\n            if (!destroyed) {\n                destroyed = true;\n                log(`${localName}: Destroying connection`);\n                callbacks.forEach((callback) => {\n                    callback(error);\n                });\n            }\n        },\n        onDestroy(callback) {\n            destroyed ? callback() : callbacks.push(callback);\n        },\n    };\n};\n","const DEFAULT_PORT_BY_PROTOCOL = {\n    'http:': '80',\n    'https:': '443',\n};\nconst URL_REGEX = /^(https?:)?\\/\\/([^/:]+)?(:(\\d+))?/;\nconst opaqueOriginSchemes = ['file:', 'data:'];\n/**\n * Converts a src value into an origin.\n */\nexport default (src) => {\n    if (src && opaqueOriginSchemes.find((scheme) => src.startsWith(scheme))) {\n        // The origin of the child document is an opaque origin and its\n        // serialization is \"null\"\n        // https://html.spec.whatwg.org/multipage/origin.html#origin\n        return 'null';\n    }\n    // Note that if src is undefined, then srcdoc is being used instead of src\n    // and we can follow this same logic below to get the origin of the parent,\n    // which is the origin that we will need to use.\n    const location = document.location;\n    const regexResult = URL_REGEX.exec(src);\n    let protocol;\n    let hostname;\n    let port;\n    if (regexResult) {\n        // It's an absolute URL. Use the parsed info.\n        // regexResult[1] will be undefined if the URL starts with //\n        protocol = regexResult[1] ? regexResult[1] : location.protocol;\n        hostname = regexResult[2];\n        port = regexResult[4];\n    }\n    else {\n        // It's a relative path. Use the current location's info.\n        protocol = location.protocol;\n        hostname = location.hostname;\n        port = location.port;\n    }\n    // If the port is the default for the protocol, we don't want to add it to the origin string\n    // or it won't match the message's event.origin.\n    const portSuffix = port && port !== DEFAULT_PORT_BY_PROTOCOL[protocol] ? `:${port}` : '';\n    return `${protocol}//${hostname}${portSuffix}`;\n};\n","/**\n * Converts an error object into a plain object.\n */\nexport const serializeError = ({ name, message, stack, }) => ({\n    name,\n    message,\n    stack,\n});\n/**\n * Converts a plain object into an error object.\n */\nexport const deserializeError = (obj) => {\n    const deserializedError = new Error();\n    // @ts-ignore\n    Object.keys(obj).forEach((key) => (deserializedError[key] = obj[key]));\n    return deserializedError;\n};\n","let id = 0;\n/**\n * @return {number} A unique ID (not universally unique)\n */\nexport default () => ++id;\n","const KEY_PATH_DELIMITER = '.';\nconst keyPathToSegments = (keyPath) => keyPath ? keyPath.split(KEY_PATH_DELIMITER) : [];\nconst segmentsToKeyPath = (segments) => segments.join(KEY_PATH_DELIMITER);\nconst createKeyPath = (key, prefix) => {\n    const segments = keyPathToSegments(prefix || '');\n    segments.push(key);\n    return segmentsToKeyPath(segments);\n};\n/**\n * Given a `keyPath`, set it to be `value` on `subject`, creating any intermediate\n * objects along the way.\n *\n * @param {Object} subject The object on which to set value.\n * @param {string} keyPath The key path at which to set value.\n * @param {Object} value The value to store at the given key path.\n * @returns {Object} Updated subject.\n */\nexport const setAtKeyPath = (subject, keyPath, value) => {\n    const segments = keyPathToSegments(keyPath);\n    segments.reduce((prevSubject, key, idx) => {\n        if (typeof prevSubject[key] === 'undefined') {\n            prevSubject[key] = {};\n        }\n        if (idx === segments.length - 1) {\n            prevSubject[key] = value;\n        }\n        return prevSubject[key];\n    }, subject);\n    return subject;\n};\n/**\n * Given a dictionary of (nested) keys to function, flatten them to a map\n * from key path to function.\n *\n * @param {Object} methods The (potentially nested) object to serialize.\n * @param {string} prefix A string with which to prefix entries. Typically not intended to be used by consumers.\n * @returns {Object} An map from key path in `methods` to functions.\n */\nexport const serializeMethods = (methods, prefix) => {\n    const flattenedMethods = {};\n    Object.keys(methods).forEach((key) => {\n        const value = methods[key];\n        const keyPath = createKeyPath(key, prefix);\n        if (typeof value === 'object') {\n            // Recurse into any nested children.\n            Object.assign(flattenedMethods, serializeMethods(value, keyPath));\n        }\n        if (typeof value === 'function') {\n            // If we've found a method, expose it.\n            flattenedMethods[keyPath] = value;\n        }\n    });\n    return flattenedMethods;\n};\n/**\n * Given a map of key paths to functions, unpack the key paths to an object.\n *\n * @param {Object} flattenedMethods A map of key paths to functions to unpack.\n * @returns {Object} A (potentially nested) map of functions.\n */\nexport const deserializeMethods = (flattenedMethods) => {\n    const methods = {};\n    for (const keyPath in flattenedMethods) {\n        setAtKeyPath(methods, keyPath, flattenedMethods[keyPath]);\n    }\n    return methods;\n};\n","import generateId from './generateId';\nimport { deserializeError } from './errorSerialization';\nimport { deserializeMethods } from './methodSerialization';\nimport { ErrorCode, MessageType, NativeEventType, Resolution } from './enums';\n/**\n * Augments an object with methods that match those defined by the remote. When these methods are\n * called, a \"call\" message will be sent to the remote, the remote's corresponding method will be\n * executed, and the method's return value will be returned via a message.\n * @param {Object} callSender Sender object that should be augmented with methods.\n * @param {Object} info Information about the local and remote windows.\n * @param {Array} methodKeyPaths Key paths of methods available to be called on the remote.\n * @param {Promise} destructionPromise A promise resolved when destroy() is called on the penpal\n * connection.\n * @returns {Object} The call sender object with methods that may be called.\n */\nexport default (callSender, info, methodKeyPaths, destroyConnection, log) => {\n    const { localName, local, remote, originForSending, originForReceiving, } = info;\n    let destroyed = false;\n    log(`${localName}: Connecting call sender`);\n    const createMethodProxy = (methodName) => {\n        return (...args) => {\n            log(`${localName}: Sending ${methodName}() call`);\n            // This handles the case where the iframe has been removed from the DOM\n            // (and therefore its window closed), the consumer has not yet\n            // called destroy(), and the user calls a method exposed by\n            // the remote. We detect the iframe has been removed and force\n            // a destroy() immediately so that the consumer sees the error saying\n            // the connection has been destroyed. We wrap this check in a try catch\n            // because Edge throws an \"Object expected\" error when accessing\n            // contentWindow.closed on a contentWindow from an iframe that's been\n            // removed from the DOM.\n            let iframeRemoved;\n            try {\n                if (remote.closed) {\n                    iframeRemoved = true;\n                }\n            }\n            catch (e) {\n                iframeRemoved = true;\n            }\n            if (iframeRemoved) {\n                destroyConnection();\n            }\n            if (destroyed) {\n                const error = new Error(`Unable to send ${methodName}() call due ` + `to destroyed connection`);\n                error.code = ErrorCode.ConnectionDestroyed;\n                throw error;\n            }\n            return new Promise((resolve, reject) => {\n                const id = generateId();\n                const handleMessageEvent = (event) => {\n                    if (event.source !== remote ||\n                        event.data.penpal !== MessageType.Reply ||\n                        event.data.id !== id) {\n                        return;\n                    }\n                    if (event.origin !== originForReceiving) {\n                        log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);\n                        return;\n                    }\n                    const replyMessage = event.data;\n                    log(`${localName}: Received ${methodName}() reply`);\n                    local.removeEventListener(NativeEventType.Message, handleMessageEvent);\n                    let returnValue = replyMessage.returnValue;\n                    if (replyMessage.returnValueIsError) {\n                        returnValue = deserializeError(returnValue);\n                    }\n                    (replyMessage.resolution === Resolution.Fulfilled ? resolve : reject)(returnValue);\n                };\n                local.addEventListener(NativeEventType.Message, handleMessageEvent);\n                const callMessage = {\n                    penpal: MessageType.Call,\n                    id,\n                    methodName,\n                    args,\n                };\n                remote.postMessage(callMessage, originForSending);\n            });\n        };\n    };\n    // Wrap each method in a proxy which sends it to the corresponding receiver.\n    const flattenedMethods = methodKeyPaths.reduce((api, name) => {\n        api[name] = createMethodProxy(name);\n        return api;\n    }, {});\n    // Unpack the structure of the provided methods object onto the CallSender, exposing\n    // the methods in the same shape they were provided.\n    Object.assign(callSender, deserializeMethods(flattenedMethods));\n    return () => {\n        destroyed = true;\n    };\n};\n","import connectCallReceiver from '../connectCallReceiver';\nimport connectCallSender from '../connectCallSender';\n/**\n * Handles an ACK handshake message.\n */\nexport default (serializedMethods, childOrigin, originForSending, destructor, log) => {\n    const { destroy, onDestroy } = destructor;\n    let destroyCallReceiver;\n    let receiverMethodNames;\n    // We resolve the promise with the call sender. If the child reconnects\n    // (for example, after refreshing or navigating to another page that\n    // uses Penpal, we'll update the call sender with methods that match the\n    // latest provided by the child.\n    const callSender = {};\n    return (event) => {\n        if (event.origin !== childOrigin) {\n            log(`Parent: Handshake - Received ACK message from origin ${event.origin} which did not match expected origin ${childOrigin}`);\n            return;\n        }\n        log('Parent: Handshake - Received ACK');\n        const info = {\n            localName: 'Parent',\n            local: window,\n            remote: event.source,\n            originForSending: originForSending,\n            originForReceiving: childOrigin,\n        };\n        // If the child reconnected, we need to destroy the prior call receiver\n        // before setting up a new one.\n        if (destroyCallReceiver) {\n            destroyCallReceiver();\n        }\n        destroyCallReceiver = connectCallReceiver(info, serializedMethods, log);\n        onDestroy(destroyCallReceiver);\n        // If the child reconnected, we need to remove the methods from the\n        // previous call receiver off the sender.\n        if (receiverMethodNames) {\n            receiverMethodNames.forEach((receiverMethodName) => {\n                delete callSender[receiverMethodName];\n            });\n        }\n        receiverMethodNames = event.data.methodNames;\n        const destroyCallSender = connectCallSender(callSender, info, receiverMethodNames, destroy, log);\n        onDestroy(destroyCallSender);\n        return callSender;\n    };\n};\n","import { serializeError } from './errorSerialization';\nimport { MessageType, NativeEventType, NativeErrorName, Resolution, } from './enums';\n/**\n * Listens for \"call\" messages coming from the remote, executes the corresponding method, and\n * responds with the return value.\n */\nexport default (info, serializedMethods, log) => {\n    const { localName, local, remote, originForSending, originForReceiving, } = info;\n    let destroyed = false;\n    const handleMessageEvent = (event) => {\n        if (event.source !== remote || event.data.penpal !== MessageType.Call) {\n            return;\n        }\n        if (event.origin !== originForReceiving) {\n            log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);\n            return;\n        }\n        const callMessage = event.data;\n        const { methodName, args, id } = callMessage;\n        log(`${localName}: Received ${methodName}() call`);\n        const createPromiseHandler = (resolution) => {\n            return (returnValue) => {\n                log(`${localName}: Sending ${methodName}() reply`);\n                if (destroyed) {\n                    // It's possible to throw an error here, but it would need to be thrown asynchronously\n                    // and would only be catchable using window.onerror. This is because the consumer\n                    // is merely returning a value from their method and not calling any function\n                    // that they could wrap in a try-catch. Even if the consumer were to catch the error,\n                    // the value of doing so is questionable. Instead, we'll just log a message.\n                    log(`${localName}: Unable to send ${methodName}() reply due to destroyed connection`);\n                    return;\n                }\n                const message = {\n                    penpal: MessageType.Reply,\n                    id,\n                    resolution,\n                    returnValue,\n                };\n                if (resolution === Resolution.Rejected &&\n                    returnValue instanceof Error) {\n                    message.returnValue = serializeError(returnValue);\n                    message.returnValueIsError = true;\n                }\n                try {\n                    remote.postMessage(message, originForSending);\n                }\n                catch (err) {\n                    // If a consumer attempts to send an object that's not cloneable (e.g., window),\n                    // we want to ensure the receiver's promise gets rejected.\n                    if (err.name === NativeErrorName.DataCloneError) {\n                        const errorReplyMessage = {\n                            penpal: MessageType.Reply,\n                            id,\n                            resolution: Resolution.Rejected,\n                            returnValue: serializeError(err),\n                            returnValueIsError: true,\n                        };\n                        remote.postMessage(errorReplyMessage, originForSending);\n                    }\n                    throw err;\n                }\n            };\n        };\n        new Promise((resolve) => resolve(serializedMethods[methodName].apply(serializedMethods, args))).then(createPromiseHandler(Resolution.Fulfilled), createPromiseHandler(Resolution.Rejected));\n    };\n    local.addEventListener(NativeEventType.Message, handleMessageEvent);\n    return () => {\n        destroyed = true;\n        local.removeEventListener(NativeEventType.Message, handleMessageEvent);\n    };\n};\n","import { MessageType, NativeEventType } from '../enums';\nimport createDestructor from '../createDestructor';\nimport createLogger from '../createLogger';\nimport getOriginFromSrc from './getOriginFromSrc';\nimport handleAckMessageFactory from './handleAckMessageFactory';\nimport handleSynMessageFactory from './handleSynMessageFactory';\nimport { serializeMethods } from '../methodSerialization';\nimport monitorIframeRemoval from './monitorIframeRemoval';\nimport startConnectionTimeout from '../startConnectionTimeout';\nimport validateIframeHasSrcOrSrcDoc from './validateIframeHasSrcOrSrcDoc';\n/**\n * Attempts to establish communication with an iframe.\n */\nexport default (options) => {\n    let { iframe, methods = {}, childOrigin, timeout, debug = false } = options;\n    const log = createLogger(debug);\n    const destructor = createDestructor('Parent', log);\n    const { onDestroy, destroy } = destructor;\n    if (!childOrigin) {\n        validateIframeHasSrcOrSrcDoc(iframe);\n        childOrigin = getOriginFromSrc(iframe.src);\n    }\n    // If event.origin is \"null\", the remote protocol is file: or data: and we\n    // must post messages with \"*\" as targetOrigin when sending messages.\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#Using_window.postMessage_in_extensions\n    const originForSending = childOrigin === 'null' ? '*' : childOrigin;\n    const serializedMethods = serializeMethods(methods);\n    const handleSynMessage = handleSynMessageFactory(log, serializedMethods, childOrigin, originForSending);\n    const handleAckMessage = handleAckMessageFactory(serializedMethods, childOrigin, originForSending, destructor, log);\n    const promise = new Promise((resolve, reject) => {\n        const stopConnectionTimeout = startConnectionTimeout(timeout, destroy);\n        const handleMessage = (event) => {\n            if (event.source !== iframe.contentWindow || !event.data) {\n                return;\n            }\n            if (event.data.penpal === MessageType.Syn) {\n                handleSynMessage(event);\n                return;\n            }\n            if (event.data.penpal === MessageType.Ack) {\n                const callSender = handleAckMessage(event);\n                if (callSender) {\n                    stopConnectionTimeout();\n                    resolve(callSender);\n                }\n                return;\n            }\n        };\n        window.addEventListener(NativeEventType.Message, handleMessage);\n        log('Parent: Awaiting handshake');\n        monitorIframeRemoval(iframe, destructor);\n        onDestroy((error) => {\n            window.removeEventListener(NativeEventType.Message, handleMessage);\n            if (error) {\n                reject(error);\n            }\n        });\n    });\n    return {\n        promise,\n        destroy() {\n            // Don't allow consumer to pass an error into destroy.\n            destroy();\n        },\n    };\n};\n","export default (debug) => {\n    /**\n     * Logs a message if debug is enabled.\n     */\n    return (...args) => {\n        if (debug) {\n            console.log('[Penpal]', ...args); // eslint-disable-line no-console\n        }\n    };\n};\n","import { ErrorCode } from '../enums';\nexport default (iframe) => {\n    if (!iframe.src && !iframe.srcdoc) {\n        const error = new Error('Iframe must have src or srcdoc property defined.');\n        error.code = ErrorCode.NoIframeSrc;\n        throw error;\n    }\n};\n","import { MessageType } from '../enums';\n/**\n * Handles a SYN handshake message.\n */\nexport default (log, serializedMethods, childOrigin, originForSending) => {\n    return (event) => {\n        if (event.origin !== childOrigin) {\n            log(`Parent: Handshake - Received SYN message from origin ${event.origin} which did not match expected origin ${childOrigin}`);\n            return;\n        }\n        log('Parent: Handshake - Received SYN, responding with SYN-ACK');\n        const synAckMessage = {\n            penpal: MessageType.SynAck,\n            methodNames: Object.keys(serializedMethods),\n        };\n        event.source.postMessage(synAckMessage, originForSending);\n    };\n};\n","import { ErrorCode } from './enums';\n/**\n * Starts a timeout and calls the callback with an error\n * if the timeout completes before the stop function is called.\n */\nexport default (timeout, callback) => {\n    let timeoutId;\n    if (timeout !== undefined) {\n        timeoutId = window.setTimeout(() => {\n            const error = new Error(`Connection timed out after ${timeout}ms`);\n            error.code = ErrorCode.ConnectionTimeout;\n            callback(error);\n        }, timeout);\n    }\n    return () => {\n        clearTimeout(timeoutId);\n    };\n};\n","const CHECK_IFRAME_IN_DOC_INTERVAL = 60000;\n/**\n * Monitors for iframe removal and destroys connection if iframe\n * is found to have been removed from DOM. This is to prevent memory\n * leaks when the iframe is removed from the document and the consumer\n * hasn't called destroy(). Without this, event listeners attached to\n * the window would stick around and since the event handlers have a\n * reference to the iframe in their closures, the iframe would stick\n * around too.\n */\nexport default (iframe, destructor) => {\n    const { destroy, onDestroy } = destructor;\n    const checkIframeInDocIntervalId = setInterval(() => {\n        if (!iframe.isConnected) {\n            clearInterval(checkIframeInDocIntervalId);\n            destroy();\n        }\n    }, CHECK_IFRAME_IN_DOC_INTERVAL);\n    onDestroy(() => {\n        clearInterval(checkIframeInDocIntervalId);\n    });\n};\n","import { Connection, connectToChild } from 'penpal';\nimport { Id } from '../types/CommonTypes';\nimport { StudioStyling } from '../types/ConfigurationTypes';\n\nexport const validateEditorLink = (editorLink: string) => {\n    const linkValidator = new RegExp(/^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w]+\\/$/);\n    let link = '';\n    if (linkValidator.test(editorLink)) {\n        link = editorLink;\n    } else if (editorLink.indexOf('/index.html') > -1) {\n        link = editorLink.replace('/index.html', '/');\n    } else if (editorLink.charAt(-1) !== '/') {\n        link = `${editorLink}/`;\n    }\n    return link;\n};\n\nexport const setupFrame = (iframe: HTMLIFrameElement, editorLink: string, styling?: StudioStyling) => {\n    const link = validateEditorLink(editorLink);\n    const stylingJson = JSON.stringify(styling || {});\n    const html = `<html>\n    <head>\n        <base href=\"/\" />\n            <meta charset=\"UTF-8\"/>\n        <!--  use this property to pass the StudioStyling to the engine -->\n            <meta name=\"studio-styling\" content='${stylingJson}'>\n    </head>\n    <body>\n        <script>\n            const handleIframeError = (event) => {\n                if (window.parent && window.parent !== window) {\n                    window.parent.postMessage(\n                        {\n                            type: 'iframe-error',\n                            error: {\n                                message: event.message,\n                                filename: event.filename,\n                                lineno: event.lineno,\n                                colno: event.colno,\n                                error: event.error?.toString(),\n                            },\n                        },\n                        window.location.ancestorOrigins[0] || window.location.origin,\n                    );\n                }\n            };\n            const handleUnhandledRejection = (event) => {\n                if (window.parent && window.parent !== window) {\n                    window.parent.postMessage(\n                        {\n                            type: 'iframe-error',\n                            error: { message: event.reason?.toString() || 'Unhandled promise rejection' },\n                        },\n                        window.location.ancestorOrigins[0] || window.location.origin,\n                    );\n                }\n            };\n            window.addEventListener('error', handleIframeError);\n            window.addEventListener('unhandledrejection', handleUnhandledRejection);\n        </script>\n        <script src=\"${link}init.js\" async></script>\n        <script src=\"${link}flutter_bootstrap.js\"></script>\n        <script>\n             try {\n                    if(!window?.initializeStudioEngine){\n                        throw new Error('Failed to initialize studio engine: initializeStudioEngine not found');\n                    }\n                    initializeStudioEngine({\n                        assetBase: '${link}',\n                    });\n                } catch(error) {\n                    if (window.parent && window.parent !== window) {\n                        window.parent.postMessage({\n                            type: 'iframe-error',\n                            error: {\n                                message: error?.message || 'Error initializing studio engine',\n                                error: error?.toString()\n                            }\n                        }, window.location.ancestorOrigins[0] || window.location.origin);\n                    }\n                    throw error;\n                } finally {\n                    window.removeEventListener('error', handleIframeError);\n                    window.removeEventListener('unhandledrejection', handleUnhandledRejection);\n                }\n        </script>\n    </body>\n</html>`;\n\n    // Set the iframe's content using DOM manipulation\n    // eslint-disable-next-line no-param-reassign\n    iframe.srcdoc = html;\n};\n\ninterface ConfigParameterTypes {\n    onActionsChanged: (state: string) => void;\n    onStateChanged: (state: string) => void;\n    onAuthExpired: (authRefreshRequest: string) => Promise<string | null>;\n    onViewportRequested: () => string | null;\n    onDocumentLoaded: () => void;\n    onSelectedFramesContentChanged: (state: string) => void;\n    onSelectedFramesLayoutChanged: (state: string) => void;\n    onFramesLayoutChanged: (state: string) => void;\n    onSelectedLayoutPropertiesChanged: (state: string) => void;\n    onSelectedLayoutUnitChanged: (state: string) => void;\n    /**\n     * @deprecated use `onSelectedPageIdChanged` instead\n     */\n    onPageSelectionChanged: (id: Id) => void;\n    onScrubberPositionChanged: (state: string) => void;\n    onFrameAnimationsChanged: (state: string) => void;\n    onVariableListChanged: (state: string) => void;\n    onSelectedToolChanged: (state: string) => void;\n    onUndoStateChanged: (state: string) => void;\n    onSelectedLayoutFramesChanged: (state: string) => void;\n    onSelectedTextStyleChanged: (styles: string) => void;\n    onColorsChanged: (colors: string) => void;\n    onParagraphStylesChanged: (paragraphStyles: string) => void;\n    onCharacterStylesChanged: (characterStyles: string) => void;\n    onFontFamiliesChanged: (fonts: string) => void;\n    onSelectedLayoutIdChanged: (id: string) => void;\n    onLayoutsChanged: (layouts: string) => void;\n    onConnectorEvent: (state: string) => void;\n    onConnectorsChanged: (state: string) => void;\n    onZoomChanged: (scaleFactor: string) => void;\n    onSelectedPageIdChanged: (pageId: string) => void;\n    onPagesChanged: (pages: string) => void;\n    onPageSnapshotInvalidated: (pageId: Id) => void;\n    onPageSizeChanged: (scaleFactor: string) => void;\n    onShapeCornerRadiusChanged: (cornerRadius: string) => void;\n    onCropActiveFrameIdChanged: (id?: Id) => void;\n    onAsyncError: (asyncError: string) => void;\n    onViewModeChanged: (viewMode: string) => void;\n    onBarcodeValidationChanged: (validationResults: string) => void;\n    onDataSourceIdChanged: (connectorId?: Id) => void;\n    onDocumentIssueListChanged: (documentIssues: string) => void;\n    onCustomUndoDataChanged: (customData: string) => void;\n    onEngineEditModeChanged: (engineEditMode: string) => void;\n    onBrandKitMediaChanged: (brandKitMedia: string) => void;\n}\n\nlet messageHandler: ((event: MessageEvent) => void) | null = null;\n\nconst Connect = (\n    editorLink: string,\n    params: ConfigParameterTypes,\n    setConnection: (connection: Connection) => void,\n    editorId = 'chili-editor',\n    styling?: StudioStyling,\n    onSetupFrameError?: (error: Error) => void,\n) => {\n    if (messageHandler) {\n        window.removeEventListener('message', messageHandler);\n    }\n    const editorSelectorId = `#${editorId}`;\n    const iframe = document.createElement('iframe');\n    iframe.setAttribute('srcdoc', ' ');\n    iframe.setAttribute('title', 'Chili-Editor');\n    iframe.setAttribute('style', 'width: 100%; height: 100%;');\n    iframe.setAttribute('frameBorder', '0');\n    iframe.setAttribute('referrerpolicy', 'origin');\n    const setupNewFrame = () => {\n        const iframeContainer = document.querySelector(editorSelectorId);\n        if (iframeContainer) {\n            iframeContainer?.appendChild(iframe);\n\n            iframe.addEventListener(\n                'error',\n                () => {\n                    const error = new Error('Failed to setup frame: iframe failed to load');\n                    onSetupFrameError?.(error);\n                },\n                { capture: true, once: true },\n            );\n\n            try {\n                setupFrame(iframe, editorLink, styling);\n            } catch (error: unknown) {\n                if (error instanceof Error) {\n                    onSetupFrameError?.(error);\n                } else {\n                    onSetupFrameError?.(new Error(`Failed to setup frame: ${error}`));\n                }\n            }\n        }\n    };\n\n    if (document.readyState === 'complete' || document.readyState === 'interactive') {\n        setupNewFrame();\n    } else {\n        document.addEventListener('DOMContentLoaded', () => {\n            setupNewFrame();\n        });\n    }\n\n    messageHandler = (event: MessageEvent) => {\n        if (event.source !== iframe.contentWindow) {\n            return;\n        }\n        if (event.data?.type === 'iframe-error') {\n            const errorData = event.data.error;\n            const error = new Error(errorData.message || 'Failed to setup frame: error in iframe');\n            onSetupFrameError?.(error);\n        }\n    };\n\n    window.addEventListener('message', messageHandler);\n\n    setConnection(\n        connectToChild({\n            // The iframe to which a connection should be made\n            iframe,\n            // All the methods that we want to expose to the child should be inside the methods object\n            // f.e. stateChange(documentJson)\n            methods: {\n                actionsChanged: params.onActionsChanged,\n                stateChanged: params.onStateChanged,\n                documentLoaded: params.onDocumentLoaded,\n                authExpired: params.onAuthExpired,\n                viewportRequested: params.onViewportRequested,\n                selectedFramesContent: params.onSelectedFramesContentChanged,\n                selectedFramesLayout: params.onSelectedFramesLayoutChanged,\n                allFramesLayout: params.onFramesLayoutChanged,\n                selectedLayoutProperties: params.onSelectedLayoutPropertiesChanged,\n                openLayoutPropertiesPanel: params.onPageSelectionChanged,\n                selectedLayoutUnit: params.onSelectedLayoutUnitChanged,\n                scrubberPositionChanged: params.onScrubberPositionChanged,\n                frameAnimationsChanged: params.onFrameAnimationsChanged,\n                selectedToolChanged: params.onSelectedToolChanged,\n                variableListChanged: params.onVariableListChanged,\n                undoStackStateChanged: params.onUndoStateChanged,\n                selectedLayoutFramesChanged: params.onSelectedLayoutFramesChanged,\n                selectedTextStyleChanged: params.onSelectedTextStyleChanged,\n                colorsChanged: params.onColorsChanged,\n                paragraphStylesChanged: params.onParagraphStylesChanged,\n                characterStylesChanged: params.onCharacterStylesChanged,\n                fontFamiliesChanged: params.onFontFamiliesChanged,\n                selectedLayoutId: params.onSelectedLayoutIdChanged,\n                layoutListChanged: params.onLayoutsChanged,\n                connectorEvent: params.onConnectorEvent,\n                connectorsChanged: params.onConnectorsChanged,\n                zoomChanged: params.onZoomChanged,\n                pageSnapshotInvalidated: params.onPageSnapshotInvalidated,\n                pagesChanged: params.onPagesChanged,\n                pageSizeChanged: params.onPageSizeChanged,\n                shapeCornerRadiusChanged: params.onShapeCornerRadiusChanged,\n                cropActiveFrameIdChanged: params.onCropActiveFrameIdChanged,\n                asyncError: params.onAsyncError,\n                viewModeChanged: params.onViewModeChanged,\n                barcodeValidationChanged: params.onBarcodeValidationChanged,\n                selectedPageIdChanged: params.onSelectedPageIdChanged,\n                dataSourceIdChanged: params.onDataSourceIdChanged,\n                documentIssueListChanged: params.onDocumentIssueListChanged,\n                customUndoDataChanged: params.onCustomUndoDataChanged,\n                engineEditingModeChanged: params.onEngineEditModeChanged,\n                brandKitMediaChanged: params.onBrandKitMediaChanged,\n            },\n        }),\n    );\n};\nexport default Connect;\n","export enum WellKnownConfigurationKeys {\n    GraFxStudioEnvironmentApiUrl = 'ENVIRONMENT_API',\n    GraFxStudioSdkVersion = 'SDK_VERSION',\n    GraFxStudioDocumentType = 'DOCUMENT_TYPE',\n    GraFxStudioTemplateId = 'TEMPLATE_ID',\n    GraFxStudioAuthToken = 'GRAFX_AUTH_TOKEN',\n    QueryCallCacheEnabled = 'ENABLE_QUERY_CALL_CACHE',\n}\n\nexport enum FrameEditingMode {\n    /**\n     * Default (Designer) mode\n     * No constraints\n     */\n    full = 'full',\n\n    /**\n     * End user mode\n     * Limits the existing tools to the given constraints\n     */\n    followConstraints = 'followConstraints',\n}\n\nexport type StudioStyling = {\n    uiBackgroundColorHex?: string;\n};\n\n/**\n * Studio Options that can be updated.\n */\nexport type StudioOptionsDeltaUpdate = {\n    /** Options for the different studio engine shortcuts */\n    shortcutOptions?: ShortcutOptionsDeltaUpdate;\n    /**\n     * Determines which editing mode should be allowed\n     * @defaultValue `FrameEditingMode.full`\n     */\n    frameEditingMode?: FrameEditingMode;\n};\n\n/**\n * Shortcut Options that can be updated.\n */\nexport type ShortcutOptionsDeltaUpdate = {\n    /** The debug panel shortcut. */\n    debugPanel?: ShortcutOption;\n\n    /** The ellipse shape shortcut. */\n    ellipse?: ShortcutOption;\n\n    /** The hand shortcut. */\n    hand?: ShortcutOption;\n\n    /** The temporary hand shortcut. */\n    temporaryHand?: ShortcutOption;\n\n    /** The image frame shortcut. */\n    image?: ShortcutOption;\n\n    /** The polygon shape shortcut. */\n    polygon?: ShortcutOption;\n\n    /** The rectangle shape shortcut. */\n    rectangle?: ShortcutOption;\n\n    /** The select shortcut. */\n    select?: ShortcutOption;\n\n    /** The text frame shortcut. */\n    text?: ShortcutOption;\n\n    /** The zoom shortcut. */\n    zoom?: ShortcutOption;\n\n    /** The copy/cut/paste/duplicate shortcut. */\n    copyPaste?: ShortcutOption;\n\n    /** The view mode shortcut. */\n    viewMode?: ShortcutOption;\n};\n\n/**\n * Specific shortcut options\n */\nexport type ShortcutOption = {\n    /** Whether the shortcut is enabled. */\n    enabled: boolean;\n};\n\n/**\n * Default studio options with all shortcuts disabled.\n */\nexport const defaultStudioOptions: StudioOptionsDeltaUpdate = {\n    shortcutOptions: {\n        debugPanel: { enabled: false },\n        ellipse: { enabled: false },\n        hand: { enabled: false },\n        temporaryHand: { enabled: false },\n        image: { enabled: false },\n        polygon: { enabled: false },\n        rectangle: { enabled: false },\n        select: { enabled: false },\n        text: { enabled: false },\n        zoom: { enabled: false },\n        copyPaste: { enabled: false },\n        viewMode: { enabled: false },\n    },\n    frameEditingMode: FrameEditingMode.full,\n};\n","import { DocumentAction } from './ActionTypes';\nimport { BasicAnimationsEmphasisType, BasicAnimationsIntroType, BasicAnimationsOutroType } from './AnimationTypes';\nimport { CharacterStyle } from './CharacterStyleTypes';\nimport { DocumentColor } from './ColorStyleTypes';\nimport { ActionEventErrorData, Id } from './CommonTypes';\nimport { BlendMode, FrameTypeEnum } from './FrameTypes';\nimport { LayoutIntent, LayoutType } from './LayoutTypes';\nimport { ParagraphStyle } from './ParagraphStyleTypes';\nimport { ShapeProperties } from './ShapeTypes';\nimport { Variable } from './VariableTypes';\n\nexport type DocumentError = { error: Record<string, unknown>; code: number };\n\nexport enum DocumentIssueTypeEnum {\n    overflow = 'overflow',\n    fontLoading = 'fontLoading',\n    actionRegister = 'actionRegister',\n    actionExecution = 'actionExecution',\n    actionCircular = 'actionCircular',\n}\n\nexport type OverflowDocumentIssue = {\n    frameId: Id;\n    type: DocumentIssueTypeEnum.overflow;\n};\n\nexport type FontLoadingDocumentIssue = {\n    fontId: string;\n    name: string;\n    type: DocumentIssueTypeEnum.fontLoading;\n};\n\nexport type ActionExecutionDocumentIssue = {\n    actionId: string;\n    type: DocumentIssueTypeEnum.actionExecution;\n};\n\nexport type ActionRegisterDocumentIssue = {\n    actionId: string;\n    type: DocumentIssueTypeEnum.actionRegister;\n};\n\nexport type ActionCircularDocumentIssue = {\n    eventChain: ActionEventErrorData[];\n    type: DocumentIssueTypeEnum.actionCircular;\n};\n\nexport type DocumentIssue =\n    | OverflowDocumentIssue\n    | FontLoadingDocumentIssue\n    | ActionExecutionDocumentIssue\n    | ActionRegisterDocumentIssue\n    | ActionCircularDocumentIssue;\n\nexport type UndoState = {\n    canUndo: boolean;\n    canRedo: boolean;\n    undoItemName: OperationName;\n    redoItemName: OperationName;\n};\n\nexport type OperationName = { translationKey: number; name: string };\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n *\n * This type should give a clear indication of how the JSON document is structured. This could help you with building a test document yourself.\n */\nexport interface ChiliDocument {\n    selectedLayoutId: string;\n    properties?: TemplateDocumentProperties | ProjectDocumentProperties;\n    pages: DocumentPage[];\n    layouts: (ChildLayout | TopLayout)[];\n    stylekit: DocumentStylekit;\n    variables: Variable[];\n    actions: DocumentAction[];\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface DocumentPage {\n    id: string;\n    number: number;\n    frames: (ImageFrame | TextFrame | ShapeFrame)[];\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface DocumentFrame {\n    id: string;\n    name: string;\n    type: FrameTypeEnum;\n    blendMode: BlendMode;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface ImageFrame extends DocumentFrame {\n    src: ImageFrameUrlSource | ImageFrameConnectorSource | ImageFrameVariableSource;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface ShapeFrame extends DocumentFrame {\n    shapeProperties: ShapeProperties;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface TextFrame extends DocumentFrame {\n    textContent: string;\n    paddingLeft: number;\n    paddingTop: number;\n    paddingRight: number;\n    paddingBottom: number;\n    numberOfColumns: number;\n    columnGap: number;\n    textDirection: string;\n    flowDirection: string;\n    verticalAlign: string;\n    textStroke: boolean;\n    textStrokeWeight: number;\n    textStrokeColor: number;\n    hasClippingPath: boolean;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport enum ImageFrameSourceType {\n    url = 'url',\n    assetProvider = 'assetProvider',\n    variable = 'variable',\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface ImageFrameSource {\n    type: ImageFrameSourceType;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface ImageFrameUrlSource extends ImageFrameSource {\n    url: string;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface ImageFrameConnectorSource extends ImageFrameSource {\n    id: string;\n    assetId: string;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */ export interface ImageFrameVariableSource extends ImageFrameSource {\n    id: string;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface Layout {\n    id: string;\n    name: string;\n    frameProperties: (ChildFrameProperty | TopFrameProperty)[];\n    width?: number;\n    height?: number;\n    childLayouts: string[];\n    type: LayoutType;\n    frameAnimations?: FrameAnimation[];\n    timelineLengthMs?: number;\n    animated?: boolean;\n    intent?: LayoutIntent;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface TopLayout extends Layout {\n    frameAnimations: FrameAnimation[];\n    timelineLengthMs: number;\n    animated: boolean;\n    intent: LayoutIntent;\n    width: number;\n    height: number;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface ChildLayout extends Layout {\n    parentId: Id;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport enum FramePropertiesType {\n    top = 'top',\n    child = 'child',\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface FrameProperty {\n    id: Id;\n    x?: number;\n    y?: number;\n    width?: number;\n    height?: number;\n    rotationDegrees?: number;\n    rotationOriginY?: number;\n    scaleX?: number;\n    scaleY?: number;\n    isVisible?: boolean;\n    type: FramePropertiesType;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport type ChildFrameProperty = FrameProperty;\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface TopFrameProperty extends FrameProperty {\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n    rotationDegrees: number;\n    rotationOriginY: number;\n    scaleX: number;\n    scaleY: number;\n    isVisible: boolean;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface FrameAnimation {\n    id: Id;\n    from: number;\n    to: number;\n    basicAnimations: BasicAnimations;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface BasicAnimations {\n    intro?: BasicAnimationsIntroType;\n    emphasis?: BasicAnimationsEmphasisType;\n    outro?: BasicAnimationsOutroType;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface DocumentStylekit {\n    colors: DocumentColor[];\n    characterStyles: DocumentCharacterStyle[];\n    paragraphStyles: DocumentParagraphStyle[];\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport type DocumentCharacterStyle = CharacterStyle;\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport type DocumentParagraphStyle = ParagraphStyle;\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface DocumentVariable extends Variable {\n    parentId: Id;\n    name: string;\n    label: string;\n    isReadonly: boolean;\n    isRequired: boolean;\n    value: string;\n    defaultValue: string;\n}\n\nexport enum DocumentType {\n    project = 'project',\n    template = 'template',\n    /**\n     * @experimental This document type is experimental and may change or be removed in future releases.\n     */\n    component = 'component',\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface DocumentProperties {\n    type: DocumentType;\n}\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport type TemplateDocumentProperties = DocumentProperties;\n\n/**\n * @deprecated This is no longer kept up to date and will be removed in the future.\n */\nexport interface ProjectDocumentProperties extends DocumentProperties {\n    templateId: string;\n}\n\nexport type DocumentLoadOptions = {\n    keepConnectors: boolean;\n};\n","import type { EditorResponse } from '../types/CommonTypes';\n\n// This is an error code from the engine exception table, do not change\nconst connectorHttpErrorErrorCode = 404075;\n\nexport function throwEditorResponseError(response: EditorResponse<unknown>) {\n    const parsedError = response.error ?? 'Yikes, something went wrong';\n    const parsedCause = {\n        cause: {\n            name: String(response.status),\n            message: response.error ?? 'Yikes, something went wrong',\n        },\n    };\n\n    if (response.status === connectorHttpErrorErrorCode) {\n        const parsedErrorData = JSON.parse(response.data as string);\n        const httpStatusCode = parsedErrorData['statusCode'] as number;\n\n        throw new ConnectorHttpError(httpStatusCode, parsedError, parsedCause);\n    } else {\n        throw new Error(parsedError, parsedCause);\n    }\n}\n\nexport function getEditorResponseData<T>(response: EditorResponse<unknown>, parse = true): EditorResponse<T> {\n    try {\n        if (!response.success) {\n            throwEditorResponseError(response);\n        }\n        const dataShouldBeParsed = response.data && parse;\n        return {\n            ...response,\n            parsedData: dataShouldBeParsed\n                ? (JSON.parse(response.data as string) as T)\n                : (response.data as unknown as T),\n        };\n    } catch (error) {\n        console.error(error);\n        throw error;\n    }\n}\n\n// For testing purposes only\nexport function castToEditorResponse(toCast: unknown): EditorResponse<unknown> {\n    return {\n        status: 200,\n        success: true,\n        parsedData: null,\n        data: JSON.stringify(toCast),\n    };\n}\n\nexport class ConnectorHttpError extends Error {\n    statusCode: number;\n\n    constructor(statusCode: number, message?: string, options?: ErrorOptions) {\n        super(message, options);\n\n        this.statusCode = statusCode;\n    }\n}\n","import { ActionDeltaUpdate, ActionTrigger, DocumentAction } from '../types/ActionTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ActionController is responsible for all Actions-related functionality.\n * Methods inside this controller can be called by `window.SDK.action.{method-name}`\n */\nexport class ActionController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method returns the list of all actions.\n     * @returns list of all actions\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getActions().then((result) => getEditorResponseData<DocumentAction[]>(result));\n    };\n\n    /**\n     * This method returns an action by the id\n     * @param id the id of a specific action\n     * @returns action details\n     */\n    getById = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getActionById(id).then((result) => getEditorResponseData<DocumentAction>(result));\n    };\n\n    /**\n     * This method creates a new action.\n     * @returns the id of the newly created action.\n     */\n    create = async () => {\n        const res = await this.#editorAPI;\n        return res.createAction().then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method duplicates an existing action by the id\n     * @param id the id of a specific action\n     * @returns the id of the duplicated action.\n     */\n    duplicate = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.duplicateAction(id).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method removes the action by the id\n     * @param id the id of a specific action\n     * @returns\n     */\n    remove = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.removeAction(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method updates an existing Action\n     * @param id the id of a specific Action\n     * @param update the delta update to apply to the Action\n     * @returns\n     */\n    update = async (id: Id, update: ActionDeltaUpdate) => {\n        const res = await this.#editorAPI;\n        return res.updateAction(id, JSON.stringify(update)).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated use the update method instead\n     *\n     * This method renames an action by the id and provided name\n     * @param id the id of a specific action\n     * @param name the new unique name for the action\n     * @returns\n     */\n    rename = async (id: Id, name: string) => {\n        return this.update(id, { name: name });\n    };\n\n    /**\n     * @deprecated use the update method instead\n     *\n     * This method updates the script the action uses by the id and provided script\n     * @param id the id of a specific action\n     * @param actionScript the JavaScript based action script\n     * @returns\n     */\n    updateScript = async (id: Id, actionScript: string) => {\n        return this.update(id, { script: actionScript });\n    };\n\n    /**\n     * @deprecated use the update method instead\n     *\n     * This method updates the triggers on which the action will react.\n     * @param id the id of a specific action\n     * @param triggers the triggers this action should react on.\n     * @returns\n     */\n    updateTriggers = async (id: Id, triggers: ActionTrigger[]) => {\n        return this.update(id, { triggers: triggers });\n    };\n\n    /**\n     * This method changes positions of actions\n     * @param order the position of actions\n     * @param ids the list of action IDs\n     * @returns\n     */\n    move = async (order: number, ids: string[]) => {\n        const res = await this.#editorAPI;\n        return res.moveActions(order, ids).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated use the update method instead\n     *\n     * This method stores the state of action type errors to the document\n     *\n     * Those errors states can be read back from the usual getters or the\n     * `onActionsChanged` stream\n     * @param id the id of a specific action\n     * @param hasTypeErrors whether there is an action type error\n     * @returns\n     */\n    setTypeError = async (id: string, hasTypeErrors: boolean) => {\n        return this.update(id, { hasTypeError: hasTypeErrors });\n    };\n\n    /**\n     * This method disables the execution of Actions.\n     * Note that any Action will be ignored and forgotten.\n     * @returns\n     */\n    disable = async () => {\n        const res = await this.#editorAPI;\n        return res.disableActions().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method enables the execution of Actions.\n     * Note this is enabled by default.\n     * @returns\n     */\n    enable = async () => {\n        const res = await this.#editorAPI;\n        return res.enableActions().then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { FrameAnimationPropertiesType } from '../types/AnimationTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The AnimationController is responsible for all communication regarding Animations.\n * Methods inside this controller can be called by `window.SDK.animation.{method-name}`\n */\nexport class AnimationController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(children: EditorAPI) {\n        this.#editorAPI = children;\n    }\n\n    /**\n     * This method returns all animations on current layout\n     * @returns list of all animation on current layout\n     */\n    getAllOnSelectedLayout = async () => {\n        const res = await this.#editorAPI;\n        return res\n            .getAnimationsOnSelectedLayout()\n            .then((result) => getEditorResponseData<FrameAnimationPropertiesType[]>(result));\n    };\n\n    /**\n     * This method returns an animation for a given frame and layout IDs\n     * @param id the id of a specific frame\n     * @param layoutId the id of a specific layout\n     * @returns animation properties for a given frame and layout\n     */\n    getByFrameId = async (id: Id, layoutId?: Id) => {\n        const res = await this.#editorAPI;\n        return res\n            .getAnimationByFrameId<string>(id, layoutId)\n            .then((result) => getEditorResponseData<FrameAnimationPropertiesType>(result));\n    };\n\n    /**\n     * This method returns the animations for a given layout id\n     * @param id the id of a specific layout\n     * @returns animation properties for a given layout\n     */\n    getByLayoutId = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res\n            .getAnimationsByLayoutId(id)\n            .then((result) => getEditorResponseData<FrameAnimationPropertiesType>(result));\n    };\n\n    /**\n     * This method sets the animation state for a certain Frame\n     * @param animation animation properties\n     * @returns updated animation properties\n     */\n    setFrameAnimation = async (animation: FrameAnimationPropertiesType) => {\n        const res = await this.#editorAPI;\n        return res\n            .setFrameAnimation(JSON.stringify(animation))\n            .then((result) =>\n                getEditorResponseData<FrameAnimationPropertiesType>({ ...result, data: JSON.stringify(animation) }),\n            );\n    };\n\n    /**\n     * This method triggers the animation to play\n     * @returns\n     */\n    play = async () => {\n        const res = await this.#editorAPI;\n        return res.playAnimation().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method triggers the animation to pause\n     * @returns\n     */\n    pause = async () => {\n        const res = await this.#editorAPI;\n        return res.pauseAnimation().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the animation time to a certain time, expressed in milliseconds\n     * @param timeInMS the time expressed in milliseconds\n     * @returns\n     */\n    setScrubberPosition = async (timeInMS: number) => {\n        const res = await this.#editorAPI;\n        return res.setScrubberPosition(timeInMS).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the total and maximum duration of the animation, expressed in milliseconds\n     * @param timeInMS the time expressed in milliseconds\n     * @returns\n     */\n    setDuration = async (timeInMS: number) => {\n        const res = await this.#editorAPI;\n        return res.setAnimationDuration(timeInMS).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method resets the animation to its initial state\n     * @param id the id of a certain frame\n     * @returns\n     */\n    resetFrameAnimation = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameAnimation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method resets the layout's animations and animation duration to its initial state\n     * @returns\n     */\n    reset = async () => {\n        const res = await this.#editorAPI;\n        return res.resetAnimation().then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { ColorUsage } from './ColorStyleTypes';\n\nexport enum BarcodeType {\n    code39 = 'code39',\n    code93 = 'code93',\n    code128 = 'code128',\n    dataMatrix = 'dataMatrix',\n    ean13 = 'ean13',\n    ean8 = 'ean8',\n    qr = 'qr',\n    upca = 'upca',\n    upce = 'upce',\n    gs1128 = 'gs1128',\n}\n\nexport interface BarcodeProperties {\n    enableBackground?: boolean;\n    backgroundColor?: ColorUsage;\n    enableBars?: boolean;\n    barColor?: ColorUsage;\n    enableText?: boolean;\n    barHeight?: string;\n    magnification?: number;\n    quietZone?: QuietZoneDeltaUpdate;\n    errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n    characterSet?: BarcodeCharacterSet;\n    drawStartStopChars?: boolean;\n}\n\nexport enum BarcodeErrorCorrectionLevel {\n    low = 'low',\n    medium = 'medium',\n    quartile = 'quartile',\n    high = 'high',\n}\n\nexport enum BarcodeCharacterSet {\n    utf8 = 'utf8',\n    iso8859_1 = 'iso8859_1',\n    code128a = 'code128a',\n    code128b = 'code128b',\n    code128c = 'code128c',\n}\n\nexport interface BarcodeConfigurationOptions {\n    allowedErrorCorrectionLevels?: BarcodeErrorCorrectionLevel[];\n    allowedCharacterSets?: BarcodeCharacterSet[];\n    allowQuietZone: boolean;\n    allowBarHeight: boolean;\n    allowEnableMagnification: boolean;\n    allowToggleText: boolean;\n    quietZoneAlwaysCombined: boolean;\n    allowToggleLightMarginIndicator: boolean;\n    allowToggleDrawStartAndEndChar: boolean;\n}\n\nexport type QuietZone = {\n    left: number;\n    top: number;\n    right: number;\n    bottom: number;\n    areQuietZoneValuesCombined: boolean;\n};\n\nexport type QuietZoneDeltaUpdate = {\n    left?: string;\n    top?: string;\n    right?: string;\n    bottom?: string;\n    areQuietZoneValuesCombined?: boolean;\n};\n\nexport type BarcodeFrameValidationResult = {\n    id: string;\n    validationResult: BarcodeValidationResult;\n};\n\nexport enum BarcodeValidationResult {\n    success = 'success',\n    empty = 'empty',\n    invalidLength = 'invalidLength',\n    invalidCharacters = 'invalidCharacters',\n    invalidChecksum = 'invalidChecksum',\n    invalidUPCE = 'invalidUPCE',\n    otherError = 'otherError',\n}\n","export enum MeasurementUnit {\n    px = 'px',\n    mm = 'mm',\n    cm = 'cm',\n    inch = 'inch',\n    pt = 'pt',\n}","import { MeasurementUnit } from '@chili-studio/connector-types';\nimport { ColorUsage } from './ColorStyleTypes';\nimport { Id, PrivateData, PropertyState } from './CommonTypes';\n\nexport { MeasurementUnit } from '@chili-studio/connector-types';\nexport type LayoutPropertiesType = {\n    id: Id;\n    name: string;\n    displayName: string | null;\n    width: PropertyState<number>;\n    height: PropertyState<number>;\n    animated: PropertyState<boolean>;\n    intent: PropertyState<LayoutIntent>;\n    unit: PropertyState<MeasurementUnit>;\n    fillColor: PropertyState<ColorUsage>;\n    fillColorEnabled: PropertyState<boolean>;\n    bleed: PropertyState<LayoutBleed | undefined>;\n    availableForUser: boolean;\n    selectedByUser: boolean;\n    timelineLengthMs: PropertyState<number | undefined>;\n    resizableByUser: ResizableLayoutProperties;\n} | null;\n\nexport type FrameProperties = {\n    id: Id;\n    type: string;\n    height: number | null;\n    isVisible: boolean | null;\n    rotationDegrees: number | null;\n    scaleX: number | null;\n    scaleY: number | null;\n    width: number | null;\n    x: number | null;\n    y: number | null;\n};\n\nexport type LayoutWithFrameProperties = {\n    id: Id;\n    name: string;\n    parentId?: Id;\n    frameProperties: FrameProperties[];\n    width: number | null;\n    height: number | null;\n    childLayouts: Id[];\n    type: LayoutType;\n    timelineLengthMs?: number;\n    children?: LayoutWithFrameProperties[];\n    intent: LayoutIntent | null;\n};\n\n// used by new getter methods\nexport type Layout = {\n    id: Id;\n    name: string;\n    displayName?: string | null;\n    privateData: PrivateData;\n    parentId?: Id;\n    width: PropertyState<number>;\n    height: PropertyState<number>;\n    layoutWidth: PropertyState<number>;\n    layoutHeight: PropertyState<number>;\n    childLayouts: Id[];\n    timelineLengthMs: PropertyState<number>;\n    unit: PropertyState<MeasurementUnit>;\n    intent: PropertyState<LayoutIntent>;\n    bleed: PropertyState<LayoutBleed>;\n    fillColor: PropertyState<ColorUsage>;\n    fillColorEnabled: PropertyState<boolean>;\n    availableForUser: boolean;\n    selectedByUser: boolean;\n    resizableByUser: ResizableLayoutProperties;\n};\n\n// used by onLayoutsChanged\nexport type LayoutListItemType = {\n    id: string;\n    name: string;\n    displayName?: string | null;\n    type: LayoutType;\n    availableForUser: boolean;\n    selectedByUser: boolean;\n    parentId?: Id | null;\n    childLayouts: Id[];\n};\n\nexport type LayoutBleed = {\n    left: number;\n    top: number;\n    right: number;\n    bottom: number;\n    areBleedValuesCombined: boolean;\n};\n\nexport type BleedDeltaUpdate = {\n    left?: string;\n    top?: string;\n    right?: string;\n    bottom?: string;\n    areBleedValuesCombined?: boolean;\n};\n\nexport type LayoutPreset = {\n    name: string;\n    intent: LayoutIntent;\n    unit: MeasurementUnit;\n    width: string;\n    height: string;\n    duration?: number;\n    bleed?: BleedDeltaUpdate;\n};\n\nexport enum PositionEnum {\n    top = 'top',\n    right = 'right',\n    bottom = 'bottom',\n    left = 'left',\n}\n\nexport enum LayoutType {\n    top = 'top',\n    child = 'child',\n}\n\nexport enum LayoutIntent {\n    print = 'print',\n    digitalStatic = 'digitalStatic',\n    digitalAnimated = 'digitalAnimated',\n}\n\nexport type ResizableLayoutProperties = {\n    enabled: boolean;\n    minWidth?: number | null;\n    maxWidth?: number | null;\n    minHeight?: number | null;\n    maxHeight?: number | null;\n    constraintMode?: ConstraintMode | null;\n    aspectRange?: LayoutAspectRange | null;\n};\n\nexport type LayoutAspect = {\n    horizontal: number;\n    vertical: number;\n};\n\nexport type LayoutAspectRange = {\n    min: LayoutAspect;\n    max: LayoutAspect;\n};\n\nexport enum ConstraintMode {\n    locked = 'locked',\n    range = 'range',\n    none = 'none',\n}\n\nexport type ResizableLayoutPropertiesUpdate = {\n    enabled?: {\n        value: boolean;\n    } | null;\n    minWidth?: {\n        value: string | null;\n    } | null;\n    maxWidth?: {\n        value: string | null;\n    } | null;\n    minHeight?: {\n        value: string | null;\n    } | null;\n    maxHeight?: {\n        value: string | null;\n    } | null;\n    constraintMode?: {\n        value: ConstraintMode | null;\n    } | null;\n    aspectRange?: {\n        value: LayoutAspectRange | null;\n    } | null;\n};\n\nexport type SelectLayoutOptions = {\n    pageSize?: LayoutOptionPageSize;\n};\n\nexport type LayoutOptionPageSize = {\n    width: number;\n    height: number;\n    unit: MeasurementUnit;\n};\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport {\n    BarcodeConfigurationOptions,\n    BarcodeProperties,\n    BarcodeType,\n    QuietZoneDeltaUpdate,\n    BarcodeCharacterSet,\n    BarcodeErrorCorrectionLevel,\n} from '../types/BarcodeTypes';\nimport { BarcodeSource } from '../types/FrameTypes';\nimport { PositionEnum } from '../types/LayoutTypes';\n\n/**\n * The BarcodeController is responsible for all communication regarding Barcodes.\n * Methods inside this controller can be called by `window.SDK.barcode.{method-name}`\n */\nexport class BarcodeController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method updates properties of the barcode\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param properties A property to update\n     * @returns\n     */\n    private setBarcodeProperties = async (id: Id, properties: BarcodeProperties) => {\n        const res = await this.#editorAPI;\n        return res\n            .setBarcodeProperties(id, JSON.stringify(properties))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the background of a barcode enabled or disabled\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param enableBackground Whether the barcode's background is visible.\n     * @returns\n     */\n    setEnableBackground = async (id: Id, enableBackground: boolean) => {\n        const properties: BarcodeProperties = { enableBackground: enableBackground };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the barcode background color of a specified barcode frame.\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param backgroundColor the new barcode background color that you want to set to the barcodeFrame.\n     * @returns\n     */\n    setBackgroundColor = async (id: Id, backgroundColor: ColorUsage) => {\n        const properties: BarcodeProperties = { backgroundColor: backgroundColor };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the visibility of the barcode's bars.\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param enableBars Whether the barcode bars are visible.\n     * @returns\n     */\n    setEnableBars = async (id: Id, enableBars: boolean) => {\n        const properties: BarcodeProperties = { enableBars: enableBars };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the bar color of a specified barcode frame.\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param barColor the new bar color that you want to set to the barcodeFrame.\n     * @returns\n     */\n    setBarColor = async (id: Id, barColor: ColorUsage) => {\n        const properties: BarcodeProperties = { barColor: barColor };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the source of the barcode to the given source.\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param source the new source that you want to set to the barcodeFrame.\n     * @returns\n     */\n    setBarcodeSource = async (id: Id, source: BarcodeSource) => {\n        const res = await this.#editorAPI;\n        return res.setBarcodeSource(id, JSON.stringify(source)).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will remove the source from the barcode frame provided.\n     * @param id the id of the barcodeFrame that needs to have the source removed.\n     * @returns\n     */\n    removeBarcodeSource = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.setBarcodeSource(id, null).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method enables/disables displaying the text of the barcode.\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param enableText true if the text should be displayed, false otherwise.\n     * @returns\n     */\n    setEnableText = async (id: Id, enableText: boolean) => {\n        const properties: BarcodeProperties = { enableText: enableText };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method sets the bar height for 1-dimensional barcodes.\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param barHeight the height of the bars in the barcode. The string value will be calculated (f.e. 1+1 will result in 2)\n     * @returns\n     */\n    setBarHeight = async (id: Id, barHeight: string) => {\n        const properties: BarcodeProperties = { barHeight: barHeight };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method sets the magnification for 1-dimensional barcodes.\n     * @param id the id of the barcodeFrame that needs to be updated.\n     * @param magnification the magnification of the barcode. This is a decimal value where 1 denotes 100%. (f.e. 1.5 will result in 150%)\n     * @returns\n     */\n    setMagnification = async (id: Id, magnification: number) => {\n        const properties: BarcodeProperties = { magnification: magnification };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method sets the quiet zone value of a specific barcode.\n     * @param id The id of the specific barcode frame\n     * @param value The quiet zone value\n     * @param position When defined will update the quiet value of a single position,\n     * otherwise will set all positions to the same value. Depending on this parameter\n     * being defined, the `areQuietZoneValuesCombined` will also be updated.\n     */\n    setQuietZoneValue = async (id: Id, value: string, position?: PositionEnum) => {\n        const update: QuietZoneDeltaUpdate = position\n            ? {\n                  left: position === PositionEnum.left ? value : undefined,\n                  top: position === PositionEnum.top ? value : undefined,\n                  right: position === PositionEnum.right ? value : undefined,\n                  bottom: position === PositionEnum.bottom ? value : undefined,\n              }\n            : { left: value, top: value, right: value, bottom: value };\n\n        const res = await this.#editorAPI;\n        return res\n            .setBarcodeProperties(id, JSON.stringify({ quietZone: update }))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the combined state of the quiet zone values.\n     * @param id The id of the specific barcode frame\n     * @param value Whether the quiet zone values are combined\n     */\n    setAreQuietZoneValuesCombined = async (id: Id, value: boolean) => {\n        const update: QuietZoneDeltaUpdate = { areQuietZoneValuesCombined: value };\n\n        const res = await this.#editorAPI;\n        return res\n            .setBarcodeProperties(id, JSON.stringify({ quietZone: update }))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the character set for the barcode.\n     * @param id The id of the specific barcode frame.\n     * @param errorCorrectionLevel The error correction level to set.\n     * @returns\n     */\n    setErrorCorrectionLevel = async (id: Id, errorCorrectionLevel: BarcodeErrorCorrectionLevel) => {\n        const res = await this.#editorAPI;\n        return res\n            .setBarcodeProperties(id, JSON.stringify({ errorCorrectionLevel: errorCorrectionLevel }))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the character set for the barcode.\n     * @param id The id of the specific barcode frame.\n     * @param characterSet The character set to set.\n     * @returns\n     */\n    setCharacterSet = async (id: Id, characterSet: BarcodeCharacterSet) => {\n        const res = await this.#editorAPI;\n        return res\n            .setBarcodeProperties(id, JSON.stringify({ characterSet: characterSet }))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the flag to render the end characters of the barcode. This is not\n     * supported for all barcode types.\n     * @param id The id of the specific barcode frame.\n     * @param drawLightMarginIndicator The flag indicating if the end characters should be drawn or not\n     * @returns\n     */\n    setDrawLightMarginIndicator = async (id: Id, drawLightMarginIndicator: boolean) => {\n        const properties: BarcodeProperties = { drawStartStopChars: drawLightMarginIndicator };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method sets the flag to render the start and end characters of the barcode. This is not\n     * supported for all barcode types.\n     * @param id The id of the specific barcode frame.\n     * @param drawStartStopChars The flag indicating if the start and stop characters should be drawn or not\n     * @returns\n     */\n    setDrawStartStopChars = async (id: Id, drawStartStopChars: boolean) => {\n        const properties: BarcodeProperties = { drawStartStopChars: drawStartStopChars };\n        return this.setBarcodeProperties(id, properties);\n    };\n\n    /**\n     * This method returns the possible configuration options which are valid for the given barcode type.\n     * @param type the barcode type for which the configuration options are requested.\n     * @returns a BarcodeConfigurationOptions object\n     */\n    getBarcodeConfigationOptions = (type: BarcodeType): BarcodeConfigurationOptions => {\n        let allowToggleText = true;\n        let allowBarHeight = true;\n        let allowEnableMagnification = true;\n        let allowedCharacterSets = undefined;\n        let allowedErrorCorrectionLevels = undefined;\n        let quietZoneAlwaysCombined = false;\n        let allowToggleLightMarginIndicator = false;\n        let allowToggleDrawStartAndEndChar = false;\n        switch (type) {\n            case BarcodeType.qr:\n                allowedCharacterSets = [BarcodeCharacterSet.iso8859_1, BarcodeCharacterSet.utf8];\n                allowedErrorCorrectionLevels = [\n                    BarcodeErrorCorrectionLevel.low,\n                    BarcodeErrorCorrectionLevel.medium,\n                    BarcodeErrorCorrectionLevel.quartile,\n                    BarcodeErrorCorrectionLevel.high,\n                ];\n            // Intentional fall-through\n            case BarcodeType.dataMatrix:\n                allowToggleText = false;\n                allowBarHeight = false;\n                allowEnableMagnification = false;\n                quietZoneAlwaysCombined = true;\n                break;\n            case BarcodeType.ean13:\n                allowToggleText = false;\n                allowToggleLightMarginIndicator = true;\n                break;\n            case BarcodeType.ean8:\n                allowToggleLightMarginIndicator = true;\n            // Intentional fall-through\n            case BarcodeType.upca:\n            case BarcodeType.upce:\n                allowToggleText = false;\n                break;\n            case BarcodeType.code128:\n            case BarcodeType.gs1128:\n                allowedCharacterSets = [\n                    BarcodeCharacterSet.code128a,\n                    BarcodeCharacterSet.code128b,\n                    BarcodeCharacterSet.code128c,\n                ];\n                break;\n            case BarcodeType.code39:\n                allowToggleDrawStartAndEndChar = true;\n                break;\n        }\n        return {\n            allowEnableMagnification: allowEnableMagnification,\n            allowBarHeight: allowBarHeight,\n            allowQuietZone: true,\n            allowedCharacterSets: allowedCharacterSets,\n            allowedErrorCorrectionLevels: allowedErrorCorrectionLevels,\n            allowToggleText: allowToggleText,\n            quietZoneAlwaysCombined: quietZoneAlwaysCombined,\n            allowToggleLightMarginIndicator: allowToggleLightMarginIndicator,\n            allowToggleDrawStartAndEndChar: allowToggleDrawStartAndEndChar,\n        };\n    };\n}\n","import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n    rgb = 'rgb',\n    hex = 'hex',\n    cmyk = 'cmyk',\n    spotCmyk = 'spotCmyk',\n    spotRgb = 'spotRgb',\n    spotHex = 'spotHex',\n}\nexport enum ColorType {\n    rgb = 'rgb',\n    hex = 'hex',\n    cmyk = 'cmyk',\n    gray = 'gray',\n    hsl = 'hsl',\n    /**\n     * @deprecated Use spotCMYK or spotRGB instead\n     */\n    spot = 'spot',\n    spotCMYK = 'spotCMYK',\n    spotRGB = 'spotRGB',\n    spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n    r: number;\n    g: number;\n    b: number;\n    type: ColorType;\n};\n\nexport type CMYKColor = {\n    c: number;\n    m: number;\n    y: number;\n    k: number;\n    type: ColorType;\n};\n\nexport type HSLColor = {\n    h: number;\n    s: number;\n    l: number;\n    type: ColorType;\n};\n\nexport type GrayColor = {\n    g: number;\n    type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n    spotName: string;\n    c: number;\n    m: number;\n    y: number;\n    k: number;\n    type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n    spotName: string;\n    c: number;\n    m: number;\n    y: number;\n    k: number;\n    type: ColorType;\n};\n\nexport type SpotColorRGB = {\n    spotName: string;\n    r: number;\n    g: number;\n    b: number;\n    type: ColorType;\n};\n\nexport type SpotColorHEX = {\n    spotName: string;\n    value: string;\n    type: ColorType;\n};\n\nexport type HexColor = {\n    value: string;\n    type: ColorType;\n};\n\nexport type Color =\n    | RGBColor\n    | CMYKColor\n    | HSLColor\n    | GrayColor\n    | SpotColor\n    | HexColor\n    | SpotColorCMYK\n    | SpotColorRGB\n    | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n    id: string;\n    name: string;\n    color: Color;\n};\n\nexport type ColorUsageUpdate = {\n    /**\n     * Reference to the brand kit color, can only be used if it is a brand kit color.\n     */\n    id?: Id;\n    /**\n     * The local color object, can only be used if it is a local color.\n     */\n    color?: ColorUpdate;\n    type: ColorUsageType;\n    /**\n     * Opacity of the color (0-100) where 0 = fully transparent.\n     */\n    opacity?: number;\n    /**\n     * Indicates if the color will be applied or not.\n     */\n    isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n    /**\n     * Reference to the brand kit color, can only be used if it is a brand kit color.\n     */\n    id?: Id;\n    /**\n     * The local color object, can only be used if it is a local color.\n     */\n    color?: Color;\n    type: ColorUsageType;\n    /**\n     * Opacity of the color (0-100) where 0 = fully transparent.\n     */\n    opacity?: number;\n};\n\nexport enum ColorUsageType {\n    /**\n     * The color is defined locally on the object\n     */\n    local = 'local',\n    /**\n     * The color is referencing a document color\n     */\n    brandKit = 'brandKit',\n    /**\n     * @deprecated use brandKit instead\n     *\n     * The color is referencing a brand kit color\n     */\n    stylekit = 'brandKit',\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport {\n    BrandKitCharacterStyle,\n    BrandKitColor,\n    BrandKitParagraphStyle,\n    HEXColorValue,\n    SpotCMYKColorValue,\n    SpotHEXColorValue,\n    SpotRGBColorValue,\n} from '../types/BrandKitTypes';\nimport { CharacterStyleUpdate } from '../types/CharacterStyleTypes';\nimport { APIColorType, ColorType, ColorUpdate, ColorUsageType, DocumentColor } from '../types/ColorStyleTypes';\nimport { DocumentFontFamily } from '../types/FontTypes';\nimport { ParagraphStyleUpdate } from '../types/ParagraphStyleTypes';\n\nconst isBrandKitHexColor = (color: BrandKitColor): color is HEXColorValue => color.type === APIColorType.hex;\n\nconst isBrandKitSpotHexColor = (color: BrandKitColor): color is SpotHEXColorValue =>\n    color.type === APIColorType.spotHex;\nconst isBrandKitSpotRgbColor = (color: BrandKitColor): color is SpotRGBColorValue =>\n    color.type === APIColorType.spotRgb;\nconst isBrandKitSpotCmykColor = (color: BrandKitColor): color is SpotRGBColorValue =>\n    color.type === APIColorType.spotCmyk;\n\nconst isBrandKitSpotColor = (\n    color: BrandKitColor,\n): color is SpotRGBColorValue | SpotCMYKColorValue | SpotHEXColorValue =>\n    isBrandKitSpotRgbColor(color) || isBrandKitSpotCmykColor(color) || isBrandKitSpotHexColor(color);\n\nexport const mapBrandKitColorToLocal = (color: BrandKitColor): ColorUpdate => {\n    const internalColorType: ColorType = mapToLocalColorType(color.type);\n\n    if (isBrandKitSpotColor(color)) {\n        return {\n            ...(isBrandKitSpotHexColor(color) && { value: color.displayValue }),\n            ...(!isBrandKitSpotHexColor(color) && { ...color.displayValue }),\n            spotName: color.value,\n            type: internalColorType,\n        } as ColorUpdate;\n    }\n    return {\n        ...(isBrandKitHexColor(color) && { value: color.value }),\n        ...(!isBrandKitHexColor(color) && { ...color.value }),\n        type: internalColorType,\n    } as ColorUpdate;\n};\n\nexport const mapBrandKitStyleToLocal = <\n    T extends BrandKitParagraphStyle | BrandKitCharacterStyle,\n    R extends ParagraphStyleUpdate | CharacterStyleUpdate,\n>(\n    style: T,\n    localColor?: DocumentColor,\n    localStrokeColor?: DocumentColor,\n    fontKey?: string,\n): R => {\n    const {\n        brandKitColorGuid,\n        brandKitFontFamilyGuid,\n        fontStyleId,\n        textStrokeColorGuid,\n        textStrokeColorApplied,\n        textStrokeWidth,\n        ...styleUpdateObject\n    } = style;\n    const styleUpdate = Object.keys(styleUpdateObject).reduce((acc, key) => {\n        return { ...acc, [key]: { value: style[key as keyof T] } };\n    }, {});\n\n    return {\n        ...styleUpdate,\n        ...(localColor && {\n            color: {\n                value: {\n                    id: localColor.id,\n                    color: localColor.color,\n                    type: ColorUsageType.brandKit,\n                    isApplied: styleUpdateObject.fillColorApplied,\n                },\n            },\n        }),\n        ...(localStrokeColor && {\n            strokeColor: {\n                value: {\n                    id: localStrokeColor.id,\n                    color: localStrokeColor.color,\n                    type: ColorUsageType.brandKit,\n                    isApplied: textStrokeColorApplied || false,\n                },\n            },\n            strokeColorApplied: {\n                value: textStrokeColorApplied || false,\n            },\n            strokeWidth: {\n                value:\n                    textStrokeWidth !== undefined && textStrokeWidth !== null\n                        ? textStrokeWidth.toString()\n                        : textStrokeWidth,\n            },\n        }),\n        fontKey: {\n            value: fontKey ?? null,\n        },\n    } as unknown as R;\n};\n\nconst mapToLocalColorType = (type: APIColorType): ColorType => {\n    switch (type) {\n        case APIColorType.rgb:\n            return ColorType.rgb;\n        case APIColorType.cmyk:\n            return ColorType.cmyk;\n        case APIColorType.hex:\n            return ColorType.hex;\n        case APIColorType.spotRgb:\n            return ColorType.spotRGB;\n        case APIColorType.spotCmyk:\n            return ColorType.spotCMYK;\n        case APIColorType.spotHex:\n            return ColorType.spotHEX;\n    }\n};\n\nexport const getColorById = (colors: DocumentColor[] | null, id: string | undefined) => {\n    if (colors === null || id === undefined) return;\n    return (colors || []).find((color) => color.id === id);\n};\n\nexport const getFontKey = (\n    fonts: DocumentFontFamily[] | null,\n    familyId: string | undefined,\n    styleId: string | undefined,\n) => {\n    if (fonts === null || familyId === undefined || styleId === undefined) return;\n    return (fonts || [])\n        .find((font) => font.id === familyId)\n        ?.fontStyles.find((fontStyle) => fontStyle.fontStyleId === styleId)?.id;\n};\n","import SDK, { CharacterStyleUpdate, DocumentColor, DocumentFontFamily, ParagraphStyleUpdate } from '..';\nimport {\n    BrandKitCharacterStyle,\n    BrandKitInternal,\n    BrandKitMedia,\n    BrandKitParagraphStyle,\n    StudioBrandKit,\n} from '../types/BrandKitTypes';\nimport { EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\nimport { getColorById, getFontKey, mapBrandKitColorToLocal, mapBrandKitStyleToLocal } from '../utils/BrandKitHelper';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { CharacterStyleController } from './CharacterStyleController';\nimport { ColorStyleController } from './ColorStyleController';\nimport { FontController } from './FontController';\nimport { GradientStyleController } from './GradientStyleController';\nimport { MediaConnectorController } from './MediaConnectorController';\nimport { ParagraphStyleController } from './ParagraphStyleController';\nimport { UndoManagerController } from './UndoManagerController';\n\n/**\n * The BrandKitController is responsible for all communication regarding Brand Kits.\n * Methods inside this controller can be called by `window.SDK.brandKit.{method-name}`\n */\n\nexport class BrandKitController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI, sdk: SDK) {\n        this.#editorAPI = editorAPI;\n        this.colorStyleController = sdk.colorStyle;\n        this.gradientStyleController = sdk.gradientStyle;\n        this.fontController = sdk.font;\n        this.mediaController = sdk.mediaConnector;\n        this.paragraphStyleController = sdk.paragraphStyle;\n        this.characterStyleController = sdk.characterStyle;\n\n        this.undoManagerController = sdk.undoManager;\n    }\n\n    private colorStyleController: ColorStyleController;\n\n    private gradientStyleController: GradientStyleController;\n\n    private fontController: FontController;\n\n    private mediaController: MediaConnectorController;\n\n    private paragraphStyleController: ParagraphStyleController;\n\n    private characterStyleController: CharacterStyleController;\n\n    private undoManagerController: UndoManagerController;\n\n    /**\n     * This method returns the current brand kit id.\n     * @returns current brand kit id\n     */\n    getId = async () => {\n        const res = await this.#editorAPI;\n        return res.getBrandKitId().then((result) => getEditorResponseData<string>(result));\n    };\n\n    /**\n     * This method returns the current brand kit version.\n     * @returns current brand kit version\n     */\n    getVersion = async () => {\n        const res = await this.#editorAPI;\n        return res.getBrandKitVersion().then((result) => getEditorResponseData<string>(result));\n    };\n\n    /**\n     * This method returns the current brand kit name.\n     * @returns current brand kit name\n     */\n    getName = async () => {\n        const res = await this.#editorAPI;\n        return res.getBrandKitName().then((result) => getEditorResponseData<string>(result));\n    };\n\n    /**\n     * This method renames the brand kit.\n     * @param newName - The new name for the brand kit\n     * @returns\n     */\n    rename = async (newName: string) => {\n        const res = await this.#editorAPI;\n        return res.renameBrandKit(newName).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method updates both the brand kit id and version.\n     * @param id - The new brand kit id\n     * @param version - The new brand kit version\n     * @returns\n     */\n    updateIdAndVersion = async (id: string, version: string) => {\n        const res = await this.#editorAPI;\n        return res.updateBrandKitIdAndVersion(id, version).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @experimental This method returns the local brandkit\n     * @returns brandkit with all assigned resources\n     */\n    get = async () => {\n        const brandKitId = await this.getId();\n        const brandKitVersion = await this.getVersion();\n        const brandKitName = await this.getName();\n\n        const colorsPromise = this.colorStyleController.getAll();\n        const gradientPromise = this.gradientStyleController.getAll();\n        const fontsPromise = this.fontController.getFontFamilies();\n        const characterStylesPromise = this.characterStyleController.getAll();\n        const paragraphStylesPromise = this.paragraphStyleController.getAll();\n        const mediaPromise = this.getAllMedia();\n\n        const [colors, gradients, fonts, paragraphStyles, characterStyles, media] = await Promise.all([\n            colorsPromise,\n            gradientPromise,\n            fontsPromise,\n            paragraphStylesPromise,\n            characterStylesPromise,\n            mediaPromise,\n        ]);\n\n        const studioBrandKit = {\n            id: brandKitId.parsedData,\n            brandKit: {\n                id: brandKitId.parsedData,\n                name: brandKitName.parsedData,\n                lastModifiedDate: brandKitVersion.parsedData,\n                colors: colors.parsedData,\n                gradients: gradients.parsedData,\n                fonts: fonts.parsedData,\n                paragraphStyles: paragraphStyles.parsedData,\n                characterStyles: characterStyles.parsedData,\n                media: media.parsedData,\n            },\n        };\n        const editorResponse = {\n            success: true,\n            data: JSON.stringify(studioBrandKit),\n            parsedData: studioBrandKit,\n            status: 200,\n        };\n\n        return getEditorResponseData<StudioBrandKit>(editorResponse);\n    };\n\n    /**\n     * This method returns all media items in the brand kit\n     * @returns list of media items in the brand kit\n     */\n    getAllMedia = async () => {\n        const res = await this.#editorAPI;\n        return res.getAllBrandKitMedia().then((result) => getEditorResponseData<BrandKitMedia[]>(result));\n    };\n\n    /**\n     * This method adds a media item to the brand kit\n     * @param name - The name of the media item\n     * @param remoteConnectorId - The remote connector ID\n     * @param assetId - The asset ID of the media item\n     * @returns\n     */\n    addMedia = async (name: string, remoteConnectorId: Id, assetId: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .addBrandKitMedia(name, remoteConnectorId, assetId)\n            .then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method updates an existing media item in the brand kit\n     * @param name - The name of the media item to update\n     * @param remoteConnectorId - The new remote connector ID\n     * @param assetId - The new asset ID\n     * @returns\n     */\n    updateMedia = async (name: string, remoteConnectorId: Id, assetId: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .updateBrandKitMedia(name, remoteConnectorId, assetId)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method renames an existing media item in the brand kit\n     * @param name - The name of the media item to rename\n     * @param newName - The new name for the media item\n     * @returns\n     */\n    renameMedia = async (name: string, newName: string) => {\n        const res = await this.#editorAPI;\n        return res.renameBrandKitMedia(name, newName).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method removes a media item from the brand kit\n     * @param name - The name of the media item to remove\n     * @returns\n     */\n    removeMedia = async (name: string) => {\n        const res = await this.#editorAPI;\n        return res.removeBrandKitMedia(name).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @experimental This method removes a brand kit and all related resources assigned to it\n     * @returns\n     */\n    remove = async () => {\n        const colors = await this.colorStyleController.getAll();\n        const colorsList = colors.parsedData || [];\n\n        const gradients = await this.gradientStyleController.getAll();\n        const gradientsList = gradients.parsedData || [];\n\n        const paragraphStyles = await this.paragraphStyleController.getAll();\n        const paragraphStylesList = paragraphStyles.parsedData || [];\n\n        const characterStyles = await this.characterStyleController.getAll();\n        const characterStylesList = characterStyles.parsedData || [];\n\n        const fonts = await this.fontController.getFontFamilies();\n        const fontsList = fonts.parsedData || [];\n\n        const media = await this.getAllMedia();\n        const mediaList = media.parsedData || [];\n\n        await this.undoManagerController.record('brandKit.remove', async (sdk) => {\n            for (const color of colorsList) {\n                await sdk.colorStyle.remove(color.id);\n            }\n            for (const gradient of gradientsList) {\n                await sdk.gradientStyle.remove(gradient.id);\n            }\n            for (const style of paragraphStylesList) {\n                await sdk.paragraphStyle.remove(style.id);\n            }\n            for (const style of characterStylesList) {\n                await sdk.characterStyle.remove(style.id);\n            }\n            for (const font of fontsList) {\n                await sdk.font.removeFontFamily(font.id);\n            }\n            for (const media of mediaList) {\n                await this.removeMedia(media.name);\n            }\n        });\n    };\n\n    /**\n     * @experimental This method updates a brand kit and all related resources assigned to it\n     * @param studioBrandKit the content of the brand kit\n     * @returns\n     */\n    set = async (studioBrandKit: StudioBrandKit) => {\n        let result: EditorResponse<BrandKitInternal> = {\n            success: true,\n            status: 200,\n            parsedData: {\n                id: studioBrandKit.id,\n                version: studioBrandKit.brandKit.lastModifiedDate,\n                name: studioBrandKit.brandKit.name,\n                colors: [],\n                gradients: [],\n                fonts: [],\n                paragraphStyles: [],\n                characterStyles: [],\n                media: [],\n            },\n        };\n\n        await this.undoManagerController.record('brandKit.set', async (sdk) => {\n            const localColorGuidMap = await this.setColors(studioBrandKit, sdk);\n            await this.setGradients(studioBrandKit, sdk);\n            const localFontGuidMap = await this.setFonts(studioBrandKit, sdk);\n\n            const { parsedData: localColors = [] } = await sdk.colorStyle.getAll();\n            const { parsedData: localGradients = [] } = await sdk.gradientStyle.getAll();\n            const { parsedData: localFonts } = await sdk.font.getFontFamilies();\n\n            await this.setParagraphStyles(studioBrandKit, sdk, {\n                localColors,\n                localFonts,\n                localColorGuidMap,\n                localFontGuidMap,\n            });\n\n            await this.setCharacterStyles(studioBrandKit, sdk, {\n                localColors,\n                localFonts,\n                localColorGuidMap,\n                localFontGuidMap,\n            });\n            await this.setMedia(studioBrandKit);\n\n            const { parsedData: allParagraphStyles } = await sdk.paragraphStyle.getAll();\n            const { parsedData: allCharacterStyles } = await sdk.characterStyle.getAll();\n            const { parsedData: allMedia } = await this.getAllMedia();\n            await sdk.brandKit.updateIdAndVersion(studioBrandKit.id, studioBrandKit.brandKit.lastModifiedDate);\n            await sdk.brandKit.rename(studioBrandKit.brandKit.name);\n\n            result = {\n                success: true,\n                status: 200,\n                parsedData: {\n                    id: studioBrandKit.id,\n                    version: studioBrandKit.brandKit.lastModifiedDate,\n                    name: studioBrandKit.brandKit.name,\n                    colors: localColors || [],\n                    gradients: localGradients || [],\n                    fonts: localFonts || [],\n                    paragraphStyles: allParagraphStyles || [],\n                    characterStyles: allCharacterStyles || [],\n                    media: allMedia || [],\n                },\n            };\n        });\n\n        return result;\n    };\n\n    private async setColors(studioBrandKit: StudioBrandKit, sdk: SDK) {\n        const localColorGuidsMap = new Map<string, string>();\n\n        for (const color of studioBrandKit.brandKit.colors || []) {\n            const { parsedData: localColorId } = await sdk.colorStyle.create();\n\n            if (!localColorId) continue;\n            localColorGuidsMap.set(color.guid, localColorId);\n            const localColor = mapBrandKitColorToLocal(color);\n\n            await sdk.colorStyle.rename(localColorId, color.name);\n            await sdk.colorStyle.update(localColorId, localColor);\n        }\n        return localColorGuidsMap;\n    }\n\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    private async setGradients(_studioBrandKit: StudioBrandKit, _sdk: SDK) {\n        const localGradientsGuidsMap = new Map<string, string>();\n\n        // TODO FE team :)\n\n        return localGradientsGuidsMap;\n    }\n\n    private async setFonts(studioBrandKit: StudioBrandKit, sdk: SDK) {\n        const fontConnectorId = studioBrandKit.fontConnectorId;\n        const guidFontFamilyIdMap = new Map<string, string>();\n\n        for (const font of studioBrandKit.brandKit.fonts || []) {\n            const { parsedData: fontStyles = [] } = await sdk.fontConnector.detail(fontConnectorId, font.fontFamilyId);\n\n            if (!fontStyles?.[0]) throw new Error(`No font styles for family ID: ${font.fontFamilyId}`);\n            const { parsedData: localFontId } = await sdk.font.addFontFamily(fontConnectorId, {\n                name: fontStyles[0].familyName,\n                fontFamilyId: font.fontFamilyId,\n            });\n\n            if (localFontId) guidFontFamilyIdMap.set(font.fontFamilyBrandKitGuid, localFontId);\n        }\n\n        return guidFontFamilyIdMap;\n    }\n\n    private async setParagraphStyles(\n        studioBrandKit: StudioBrandKit,\n        sdk: SDK,\n        resources: {\n            localFonts: DocumentFontFamily[] | null;\n            localColors: DocumentColor[] | null;\n            localColorGuidMap: Map<string, string>;\n            localFontGuidMap: Map<string, string>;\n        },\n    ) {\n        const { localColors, localFonts, localColorGuidMap, localFontGuidMap } = resources;\n        for (const style of studioBrandKit.brandKit.paragraphStyles || []) {\n            const localColorId = localColorGuidMap.get(style.brandKitColorGuid);\n            const localStrokeColorId = localColorGuidMap.get(style.textStrokeColorGuid);\n\n            const fontFamilyId = localFontGuidMap.get(style.brandKitFontFamilyGuid);\n            const fontKey = getFontKey(localFonts, fontFamilyId, style.fontStyleId);\n\n            if (!fontFamilyId || !fontKey)\n                throw new Error(`Paragraph style could not be created with an empty font family: ${style.name}`);\n\n            const localColor = getColorById(localColors, localColorId);\n            const localStrokeColor = getColorById(localColors, localStrokeColorId);\n\n            if (!localColor) throw new Error(`Paragraph style could not be created with an empty color: ${style.name}`);\n\n            const { parsedData: styleId } = await sdk.paragraphStyle.create();\n\n            const paragraphStyleUpdate = mapBrandKitStyleToLocal<BrandKitParagraphStyle, ParagraphStyleUpdate>(\n                style,\n                localColor,\n                localStrokeColor,\n                `${fontKey}`,\n            );\n\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            await sdk.paragraphStyle.rename(styleId!, style.name);\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            await sdk.paragraphStyle.update(styleId!, paragraphStyleUpdate);\n        }\n    }\n\n    private async setCharacterStyles(\n        studioBrandKit: StudioBrandKit,\n        sdk: SDK,\n        resources: {\n            localFonts: DocumentFontFamily[] | null;\n            localColors: DocumentColor[] | null;\n            localColorGuidMap: Map<string, string>;\n            localFontGuidMap: Map<string, string>;\n        },\n    ) {\n        const { localColors, localFonts, localColorGuidMap, localFontGuidMap } = resources;\n        for (const style of studioBrandKit.brandKit.characterStyles || []) {\n            const localColorId = style.brandKitColorGuid ? localColorGuidMap.get(style.brandKitColorGuid) : undefined;\n            const localStrokeColorId = style.textStrokeColorGuid\n                ? localColorGuidMap.get(style.textStrokeColorGuid)\n                : undefined;\n\n            const fontFamilyId = style.brandKitFontFamilyGuid\n                ? localFontGuidMap.get(style.brandKitFontFamilyGuid)\n                : undefined;\n            const localColor = getColorById(localColors, localColorId);\n            const localStrokeColor = getColorById(localColors, localStrokeColorId);\n            const fontKey = getFontKey(localFonts, fontFamilyId, style.fontStyleId);\n\n            const { parsedData: styleId } = await sdk.characterStyle.create();\n\n            const characterStyleUpdate = mapBrandKitStyleToLocal<BrandKitCharacterStyle, CharacterStyleUpdate>(\n                style,\n                localColor,\n                localStrokeColor,\n                fontKey,\n            );\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            await sdk.characterStyle.rename(styleId!, style.name);\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            await sdk.characterStyle.update(styleId!, characterStyleUpdate);\n        }\n    }\n\n    private async setMedia(studioBrandKit: StudioBrandKit) {\n        for (const media of studioBrandKit.brandKit.media || []) {\n            await this.addMedia(media.name, media.mediaConnectorId, media.mediaId);\n        }\n    }\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ViewMode } from '../types/ViewModeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The CanvasController is responsible for all Canvas-related functionality.\n * Methods inside this controller can be called by `window.SDK.canvas.{method-name}`\n */\nexport class CanvasController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method fits the page to the given rectangle or the viewport available\n     * Optional parameters `left`, `top`, `width` and `height` are needed to define the rectangle to fit the page to\n     * If any or all of them aren't provided the page will fit the whole viewport available\n     * @param _id the id of a specific page\n     * @param left\n     * @param top\n     * @param width\n     * @param height\n     * @returns\n     */\n    zoomToPage = async (\n        _id?: Id | null,\n        left?: number | null,\n        top?: number | null,\n        width?: number | null,\n        height?: number | null,\n    ) => {\n        if (_id !== undefined) {\n            console.warn('id has no effect and will be deprecated in the future');\n        }\n        const res = await this.#editorAPI;\n        return res.zoomToPage(left, top, width, height).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method gets the scale factor of the canvas\n     * @returns scale factor in percents\n     */\n    getZoomPercentage = async () => {\n        const res = await this.#editorAPI;\n        return res.getZoomPercentage().then((result) => getEditorResponseData<number>(result));\n    };\n\n    /**\n     * This method sets the scale factor to the canvas and re-centers the page\n     * @param scaleFactor scale factor in percents\n     * @returns\n     */\n    setZoomPercentage = async (scaleFactor: number) => {\n        const res = await this.#editorAPI;\n        return res.setZoomPercentage(scaleFactor).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets a new view mode\n     * @param viewMode view mode of the editor\n     * @returns\n     */\n    setViewMode = async (viewMode: ViewMode) => {\n        const res = await this.#editorAPI;\n        return res.setViewMode(viewMode).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { CharacterStyle, CharacterStyleUpdate } from '../types/CharacterStyleTypes';\n\n/**\n * The CharacterStyleController is responsible for all communication regarding character styles.\n * Methods inside this controller can be called by `window.SDK.characterStyle.{method-name}`\n */\nexport class CharacterStyleController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method returns the list of character styles\n     * @returns list of all character styles\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getCharacterStyles().then((result) => getEditorResponseData<CharacterStyle[]>(result));\n    };\n\n    /**\n     * This method returns a character style by the id\n     * @param characterStyleId the id of a specific character style\n     * @returns character style for given id\n     */\n    getById = async (characterStyleId: Id) => {\n        const res = await this.#editorAPI;\n        return res\n            .getCharacterStyleById(characterStyleId)\n            .then((result) => getEditorResponseData<CharacterStyle>(result));\n    };\n\n    /**\n     * This method creates a new character style\n     * @returns the id of new character style\n     */\n    create = async () => {\n        const res = await this.#editorAPI;\n        return res.createCharacterStyle().then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method updates a character style by the id and provided properties\n     * @param characterStyleId the id of a specific character style\n     * @param characterStyle the new character style properties\n     * @returns\n     */\n    update = async (characterStyleId: Id, characterStyle: CharacterStyleUpdate) => {\n        const res = await this.#editorAPI;\n        return res\n            .updateCharacterStyle(characterStyleId, JSON.stringify(characterStyle))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method removes a character style by the id\n     * @param characterStyleId the id of a specific character style\n     * @returns\n     */\n    remove = async (characterStyleId: Id) => {\n        const res = await this.#editorAPI;\n        return res.removeCharacterStyle(characterStyleId).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method duplicates a character style by the id\n     * @param characterStyleId the id of a specific character style\n     * @returns id of the duplicated character style\n     */\n    duplicate = async (characterStyleId: Id) => {\n        const res = await this.#editorAPI;\n        return res.duplicateCharacterStyle(characterStyleId).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method renames a character style by the id\n     * @param characterStyleId the id of a specific character style\n     * @param characterStyleName the new name of the character style\n     * @returns\n     */\n    rename = async (characterStyleId: Id, characterStyleName: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .renameCharacterStyle(characterStyleId, characterStyleName)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method changes positions of character styles\n     * @param order the position of the character styles\n     * @param ids the list of character style ids\n     * @returns\n     */\n    move = async (order: number, ids: Id[]) => {\n        const res = await this.#editorAPI;\n        return res.moveCharacterStyles(order, ids).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { ClipboardContentType } from '../types/ClipboardTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ClipboardController is responsible for all communication regarding clipboard.\n * Methods inside this controller can be called by `window.SDK.clipboard.{method-name}`\n */\nexport class ClipboardController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method will copy the frames to the OS clipboard as a json frame\n     * @param ids An array of all frame ids you want to copy\n     * @returns\n     */\n    copyFrames = async (ids: Id[]) => {\n        const res = await this.#editorAPI;\n        const frameData = await res.copyFrames(ids);\n\n        if (frameData.data) {\n            await navigator.clipboard.writeText(frameData.data);\n        }\n\n        return getEditorResponseData<null>(frameData);\n    };\n\n    /**\n     * This method will remove the frames and store them to the OS clipboard as\n     * a json frame\n     * @param ids An array of all frame ids you want to cut\n     * @returns\n     */\n    cutFrames = async (ids: Id[]) => {\n        const res = await this.#editorAPI;\n        const frameData = await res.cutFrames(ids);\n\n        if (frameData.data) {\n            await navigator.clipboard.writeText(frameData.data);\n        }\n\n        return getEditorResponseData<null>(frameData);\n    };\n\n    /**\n     * This method will paste the OS clipboard content to the editor as frames\n     * @returns\n     */\n    pasteFrames = async () => {\n        const res = await this.#editorAPI;\n\n        const clipboardData = await navigator.clipboard.readText();\n        const result = await res.pasteFrames(clipboardData);\n\n        return getEditorResponseData<null>(result);\n    };\n\n    /**\n     * This method will get the content type of the OS clipboard\n     * @returns content type\n     */\n    getContentType = async () => {\n        const res = await this.#editorAPI;\n\n        const clipboardData = await navigator.clipboard.readText();\n        const result = await res.getClipboardContentType(clipboardData);\n\n        return getEditorResponseData<ClipboardContentType>(result);\n    };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { Color, RGBColor } from '../types/ColorStyleTypes';\n\n/**\n * The ColorConversionController is responsible for all communication regarding color coversion.\n * Methods inside this controller can be called by `window.SDK.colorConversion.{method-name}`\n */\nexport class ColorConversionController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method converts the given color to its rgb representation\n     * @param color the color to convert\n     * @returns the rgb representation of the given color\n     */\n    convertToRgb = async (color: Color) => {\n        const res = await this.#editorAPI;\n        return res.colorToRgb(JSON.stringify(color)).then((result) => getEditorResponseData<RGBColor>(result));\n    };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ColorType, ColorUpdate, DocumentColor } from '../types/ColorStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ColorStyleController is responsible for all communication regarding color styles.\n * Methods inside this controller can be called by `window.SDK.colorStyle.{method-name}`\n */\nexport class ColorStyleController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method returns the list of colors\n     * @returns list of all colors\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getColors().then((result) => getEditorResponseData<DocumentColor[]>(result));\n    };\n\n    /**\n     * This method returns a color by id\n     * @param id the id of a specific color\n     * @returns color properties for given id\n     */\n    getById = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.getColorById(id).then((result) => getEditorResponseData<DocumentColor>(result));\n    };\n\n    /**\n     * This method creates a new color\n     * @returns the new created color id\n     */\n    create = async () => {\n        const res = await this.#editorAPI;\n        return res.createColor().then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method duplicates a color by the id\n     * @param id the id of a specific color\n     * @returns id of the duplicated color\n     */\n    duplicate = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.duplicateColor(id).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method changes positions of colors\n     * @param order the position of the colors\n     * @param ids the list of color IDs\n     * @returns\n     */\n    move = async (order: number, ids: string[]) => {\n        const res = await this.#editorAPI;\n        return res.moveColors(order, ids).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method renames a color\n     * @param id the id of a specific color\n     * @param newColorName the new name of the color\n     * @returns\n     */\n    rename = async (id: string, newColorName: string) => {\n        const res = await this.#editorAPI;\n        return res.renameColor(id, newColorName).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method updates a color\n     * @param id the id of a specific color\n     * @param newColorProperties the new color properties\n     * @returns\n     */\n    update = async (id: string, newColorProperties: ColorUpdate) => {\n        const res = await this.#editorAPI;\n        const properties = newColorProperties;\n        if (properties.type === ColorType.spot) {\n            properties.type = ColorType.spotCMYK;\n        }\n        return res.updateColor(id, JSON.stringify(properties)).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method removes a color\n     * @param id the id of a specific color\n     * @returns\n     */\n    remove = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.removeColor(id).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import type {\n    Dictionary as ContextDictionary,\n    ConnectorConfigOptions as GenericConnectorConfigOptions,\n    ConnectorConfigValue as GenericConnectorConfigValue,\n    QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n    file = 0,\n    collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n    LowResolutionWeb = 'lowresWeb',\n    HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n    file = 'file',\n    collection = 'collection',\n}\n\nexport enum ConnectorType {\n    media = 'media',\n    fonts = 'fonts',\n    data = 'data',\n    /**\n     * @experimental This is still experimental and might change in future releases.\n     */\n    components = 'components',\n}\n\nexport enum SortBy {\n    name = 'name',\n    path = 'relativePath',\n    id = 'id',\n}\n\nexport enum SortOrder {\n    ascending = 'asc',\n    descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n    text = 'text',\n    boolean = 'boolean',\n}\n\nexport enum ConnectorConfigContextType {\n    query = 'query',\n    upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n    ConnectorConfigValueType,\n    ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n    /**\n     * Url to the connector.\n     *\n     * - If source is `url`, this must be a publicly accessible url.\n     *\n     * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n     */\n    url: string;\n\n    /**\n     * Connector source type.\n     */\n    source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n    source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n    source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n    source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n    id: Id;\n    name: string;\n    iconUrl: string;\n    source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n    /**\n     * Connector is hosted on a publicly accessible link.\n     */\n    url = 'url',\n\n    /**\n     * Connector is hosted on GraFx Environment API.\n     */\n    grafx = 'grafx',\n\n    /**\n     * Connector is embedded in the document.\n     * Note: This is a temporary type; only to be used internally.\n     */\n    local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n    name: string;\n    value: ContextDictionary[keyof ContextDictionary];\n    direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n    name: string;\n    value: string;\n    direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n    name: string;\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    value: any;\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    direction: any = ConnectorMappingDirection.engineToConnector;\n\n    constructor(\n        contextProperty: string,\n        mapFrom: ConnectorMappingSource.variable,\n        sourceValue: string,\n        direction: ConnectorMappingDirection.connectorToEngine,\n    );\n    constructor(\n        contextProperty: string,\n        mapFrom: ConnectorMappingSource,\n        sourceValue: string | boolean,\n        direction?: ConnectorMappingDirection.engineToConnector,\n    );\n    constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean);\n    constructor(\n        contextProperty: string,\n        mapFrom: ConnectorMappingSource,\n        sourceValue: string | boolean,\n        direction = ConnectorMappingDirection.engineToConnector,\n    ) {\n        this.name = contextProperty;\n        this.direction = direction;\n\n        if (mapFrom === ConnectorMappingSource.variable) {\n            this.value = `${mapFrom}.${sourceValue}`;\n        } else {\n            this.value = sourceValue;\n        }\n    }\n}\n\nexport type ConnectorState = {\n    id: Id;\n    type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n    id: Id;\n    type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n    nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n    variable = 'var',\n    value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n    /**\n     * Indicates the mapping will propagate a value to the connector. This\n     * mapping might cause the linked connector to refresh.\n     */\n    engineToConnector = 'engineToConnector',\n\n    /**\n     * Indicates the mapping will propagate a value from inside the connector\n     * to the engine. AKA \"reverse mapping\".\n     */\n    connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n    /**\n     * Connector loading process has started.\n     * Any SDK methods that required the connector id, will start working now.\n     */\n    loading = 'loading',\n\n    /**\n     * Connector loading completed.\n     */\n    loaded = 'loaded',\n\n    /**\n     * Connector is running in QuickJS.\n     */\n\n    running = 'running',\n\n    /**\n     * Connector is fully configured and has the correct authentication information.\n     * At this point the connector is ready to make requests.\n     */\n    ready = 'ready',\n\n    /**\n     * Something went wrong, the connector is in error state.\n     * Check the error message for more information.\n     */\n    error = 'error',\n}\n\nexport enum ConnectorEventType {\n    /**\n     * This event will be triggered by the following state changes of the connector\n     * - loading\n     * - loaded\n     * - running\n     * - ready\n     * - error\n     */\n    stateChanged = 'stateChanged',\n\n    /**\n     * Authentication information is changed\n     */\n    authChanged = 'authChanged',\n\n    /**\n     * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n     * This will trigger multiple 'stateChanged' events while it is reloading.\n     * Wait until 'ready'-stateChanged event is received to start using the connector again.\n     */\n    reloadRequired = 'reloadRequired',\n\n    /**\n     * Connector is unregistered and no longer exists inside the editor engine.\n     * Don't use the 'connectorId' after receiving this event.\n     */\n    unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n    url: 'grafx-media.json',\n    source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n    token: string;\n    type = AuthCredentialsTypeEnum.grafxToken;\n\n    constructor(token: string) {\n        this.token = token;\n    }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n    type = AuthCredentialsTypeEnum.refreshed;\n}\n\nexport enum AuthCredentialsTypeEnum {\n    grafxToken = 'grafxToken',\n    refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n    grafxToken = 'grafxToken',\n    any = 'any',\n}\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param type type of auth renewal needed\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n *      will notify that the dam authentication expired if it went through the\n *      proxy.\n *      Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n *      If the http request did not go through the proxy, headerValue is null.\n */\nexport type AuthRefreshRequest = {\n    connectorId: Id;\n    remoteConnectorId: Id;\n    type: AuthRefreshTypeEnum;\n    headerValue: string | null;\n};\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n    minWidthPixels?: number | null;\n    maxWidthPixels?: number | null;\n    minHeightPixels?: number | null;\n    maxHeightPixels?: number | null;\n    mimeTypes?: ('image/jpg' | 'image/jpeg' | 'image/png')[];\n};\n\nexport enum UploadAssetValidationErrorType {\n    minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n    constructor(message: string, public type: UploadAssetValidationErrorType) {\n        super(message);\n    }\n}\n","import { ConnectorInstance, ConnectorRegistration, ConnectorRegistrationSource } from '../types/ConnectorTypes';\nimport * as Next from '../next/types/ConnectorTypes';\n\nexport class ConnectorCompatibilityTools {\n    /**\n     * Since `ConnectorGrafxRegistration` uses `RemoteConnectorId` instead of `url` on the engine side,\n     * we extract that `id` from the source `url`\n     * **/\n    makeConnectorSourceForwardsCompatible = (\n        registration: ConnectorRegistration | Next.ConnectorGrafxRegistration,\n    ): ConnectorRegistration | Next.ConnectorGrafxRegistration => {\n        if (registration.source != ConnectorRegistrationSource.grafx) {\n            return registration;\n        }\n\n        if (this.isSourceMigrated(registration)) {\n            return registration;\n        }\n\n        let url = registration.url;\n\n        while (url.endsWith('/')) {\n            url = url.substring(0, url.length - 1);\n        }\n\n        const pathChunks = url.split('/');\n        // `RemoteConnectorId` is always the very last part of the URL\n        const remoteConnectorId = pathChunks[pathChunks.length - 1];\n\n        return { id: remoteConnectorId, source: ConnectorRegistrationSource.grafx };\n    };\n\n    makeMultipleConnectorsBackwardsCompatible = (\n        connectors: Next.ConnectorInstance[],\n        baseUrl: string | undefined,\n    ): ConnectorInstance[] =>\n        connectors.map((connector) => this.makeSingleConnectorBackwardsCompatible(connector, baseUrl));\n\n    makeSingleConnectorBackwardsCompatible = (\n        connector: Next.ConnectorInstance,\n        baseUrl: string | undefined,\n    ): ConnectorInstance => {\n        if (connector.source.source != ConnectorRegistrationSource.grafx) {\n            return connector as ConnectorInstance;\n        }\n\n        return {\n            id: connector.id,\n            name: connector.name,\n            iconUrl: connector.iconUrl,\n            source: this.makeConnectorSourceBackwardsCompatible(connector.source, baseUrl),\n        };\n    };\n\n    /**\n     * Since `ConnectorGrafxRegistration` uses `RemoteConnectorId` instead of `url` on the engine side,\n     * we generate that `url` from the `baseUrl` and `id`\n     * **/\n    makeConnectorSourceBackwardsCompatible = (\n        connector: Next.ConnectorGrafxRegistration,\n        baseUrl: string | undefined,\n    ): ConnectorRegistration => {\n        let url = baseUrl;\n\n        while (url?.endsWith('/')) {\n            url = url.substring(0, url.length - 1);\n        }\n\n        return {\n            url: `${url}/connectors/${connector.id}`,\n            source: ConnectorRegistrationSource.grafx,\n        };\n    };\n\n    // Helps to promote a correct type\n    private isSourceMigrated = (\n        registration: ConnectorRegistration | Next.ConnectorGrafxRegistration,\n    ): registration is Next.ConnectorGrafxRegistration => 'id' in registration;\n}\n","import { EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\r\nimport {\r\n    ConnectorInstance,\r\n    ConnectorMappingDirection,\r\n    ConnectorMappingType,\r\n    ConnectorOptions,\r\n    ConnectorRegistration,\r\n    ConnectorState,\r\n    ConnectorStateType,\r\n    ConnectorToEngineMapping,\r\n    ConnectorType,\r\n    EngineToConnectorMapping,\r\n} from '../types/ConnectorTypes';\r\nimport { getEditorResponseData } from '../utils/EditorResponseData';\r\n\r\nimport * as Next from '../next/types/ConnectorTypes';\r\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\r\nimport { ConnectorCompatibilityTools } from '../utils/ConnectorCompatibilityTools';\r\n\r\n/**\r\n * The ConnectorController manages lifetime of all available connectors, regardless of the type, in the\r\n * document. Use it to add/remove connectors to a template, or set specific configuration.\r\n *\r\n * The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an\r\n * implementation of a set of capabilities we need to interact with a certain external resource management system.\r\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\r\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\r\n * execute the media connector both on web using webassembly and on the server side during e.g. animation output\r\n * generation.\r\n * This controller is an interface to the running connector instance inside the studio engine. The engine will\r\n * automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered\r\n * manually.\r\n */\r\nexport class ConnectorController {\r\n    /**\r\n     * @ignore\r\n     */\r\n    #editorAPI: EditorAPI;\r\n    #localConfig: Map<string, string>;\r\n    #connectorCompatibilityTools: ConnectorCompatibilityTools;\r\n\r\n    /**\r\n     * @ignore\r\n     */\r\n    constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\r\n        this.#editorAPI = editorAPI;\r\n        this.#localConfig = localConfig;\r\n        this.#connectorCompatibilityTools = new ConnectorCompatibilityTools();\r\n    }\r\n\r\n    /**\r\n     * Gets a connector by its id\r\n     * @param id the id of the connector\r\n     * @returns connector\r\n     */\r\n    getById = async (id: Id) => {\r\n        // add backwards compatibility code\r\n        const res = await this.#editorAPI;\r\n        return res\r\n            .getConnectorById(id)\r\n            .then((result) => getEditorResponseData<Next.ConnectorInstance>(result))\r\n            .then((resp) => {\r\n                const update: EditorResponse<ConnectorInstance> = { ...resp, parsedData: null };\r\n                if (resp.parsedData) {\r\n                    update.parsedData = this.#connectorCompatibilityTools.makeSingleConnectorBackwardsCompatible(\r\n                        resp.parsedData,\r\n                        this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl),\r\n                    );\r\n                }\r\n                return update;\r\n            });\r\n    };\r\n\r\n    /**\r\n     * Gets all available connectors of a 'ConnectorType'\r\n     * @param type type of connector you want to get\r\n     * @returns list of all available connectors of a 'ConnectorType'\r\n     */\r\n    getAllByType = async (type: ConnectorType) => {\r\n        // add backwards compatibility code\r\n        const res = await this.#editorAPI;\r\n        return res\r\n            .getConnectors(type)\r\n            .then((result) => getEditorResponseData<Next.ConnectorInstance[]>(result))\r\n            .then((resp) => {\r\n                const update: EditorResponse<ConnectorInstance[]> = { ...resp, parsedData: null };\r\n                if (resp.parsedData) {\r\n                    update.parsedData = this.#connectorCompatibilityTools.makeMultipleConnectorsBackwardsCompatible(\r\n                        resp.parsedData,\r\n                        this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl),\r\n                    );\r\n                }\r\n                return update;\r\n            });\r\n    };\r\n\r\n    /**\r\n     * Registers a new connector in the SDK. After successful registration, depending\r\n     * on the connector type, the connector can be configured and used in the template\r\n     * Remember to add custom authentication information after registering the connector\r\n     * @param registration registration object containing all details about the connector\r\n     * @returns the Id of the newly created connector, this Id should be used going forward.\r\n     */\r\n    register = async (registration: ConnectorRegistration) => {\r\n        const res = await this.#editorAPI;\r\n\r\n        const connectorRegistration =\r\n            this.#connectorCompatibilityTools.makeConnectorSourceForwardsCompatible(registration);\r\n\r\n        return res\r\n            .registerConnector(JSON.stringify(connectorRegistration))\r\n            .then((result) => getEditorResponseData<Id>(result));\r\n    };\r\n\r\n    /**\r\n     * Unregisters a connector from the document.\r\n     * @param id the id of the connector to unregister\r\n     * @returns\r\n     */\r\n    unregister = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.unregisterConnector(id).then((result) => getEditorResponseData<null>(result));\r\n    };\r\n\r\n    /**\r\n     * Configures a registered connector. A configurator helper is passed as an argument\r\n     * of the callback for you to setup your connector.\r\n     * @param id the id of your registered connector\r\n     * @param configurationCallback callback to setup the connector\r\n     * @returns\r\n     */\r\n    configure = async (id: Id, configurationCallback: (configurator: ConnectorConfigurator) => Promise<void>) => {\r\n        const res = await this.#editorAPI;\r\n        // wait for connector to be ready\r\n        await this.waitToBeReady(id);\r\n        // execute callback\r\n        await configurationCallback(new ConnectorConfigurator(id, res));\r\n        // invalidate connector in engine\r\n        return res.updateConnectorConfiguration(id).then((result) => getEditorResponseData<null>(result));\r\n    };\r\n\r\n    /**\r\n     * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitToBeReady'\r\n     * method in this controller.\r\n     * @param id the id of your registered connector you want to make sure it is loaded\r\n     * @returns connector state\r\n     */\r\n    getState = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.getConnectorState(id).then((result) => getEditorResponseData<ConnectorState>(result));\r\n    };\r\n\r\n    /**\r\n     * Gets the mapped data from connector.\r\n     * @param id the id of your registered connector\r\n     * @param direction the mapping direction\r\n     * @returns mappings\r\n     */\r\n    async getMappings(\r\n        id: string,\r\n        direction: ConnectorMappingDirection.engineToConnector,\r\n    ): Promise<EditorResponse<EngineToConnectorMapping[]>>;\r\n    async getMappings(\r\n        id: string,\r\n        direction: ConnectorMappingDirection.connectorToEngine,\r\n    ): Promise<EditorResponse<ConnectorToEngineMapping[]>>;\r\n    async getMappings(id: string, direction?: undefined): Promise<EditorResponse<ConnectorMappingType[]>>;\r\n    async getMappings(id: string, direction?: ConnectorMappingDirection) {\r\n        const res = await this.#editorAPI;\r\n        return res\r\n            .getConnectorMappings(id)\r\n            .then((result) => getEditorResponseData<ConnectorMappingType[]>(result))\r\n            .then((result) =>\r\n                !direction\r\n                    ? result\r\n                    : {\r\n                          ...result,\r\n                          parsedData: result.parsedData?.filter((cm) => cm.direction === direction),\r\n                      },\r\n            );\r\n    }\r\n\r\n    /**\r\n     * Gets the options from the connector.\r\n     * @param id the id of your registered connector\r\n     * @returns options\r\n     */\r\n    getOptions = async (id: string) => {\r\n        const res = await this.#editorAPI;\r\n        return res.getConnectorOptions(id).then((result) => getEditorResponseData<ConnectorOptions>(result));\r\n    };\r\n\r\n    /**\r\n     * Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure\r\n     * an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure\r\n     * the connector is up and running. This is used internally by the configure method to ensure correct execution. It's especially\r\n     * useful during startup of the SDK / right after the loadDocument call.\r\n     * @param id the id of your registered connector you want to make sure it is loaded\r\n     * @returns\r\n     */\r\n    waitToBeReady = async (id: Id, timeoutMilliseconds = 2000): Promise<EditorResponse<null>> => {\r\n        // minimum timeout is 500ms\r\n        let timeout = Math.max(timeoutMilliseconds, 500);\r\n\r\n        // maximum timeout is 5000ms\r\n        timeout = Math.min(timeout, 5000);\r\n\r\n        const waitTime = 100;\r\n        let retries = 0;\r\n\r\n        try {\r\n            // using while loop will prevent stack overflow issues when using recursion\r\n            // wait for maximum 2 seconds to fail\r\n            while (retries * waitTime < timeout) {\r\n                const result = await this.getState(id);\r\n\r\n                if (\r\n                    result.success &&\r\n                    result.parsedData &&\r\n                    (result.parsedData.type === ConnectorStateType.running ||\r\n                        result.parsedData.type === ConnectorStateType.ready)\r\n                ) {\r\n                    return getEditorResponseData<null>(\r\n                        { data: null, success: true, error: undefined, status: 0, parsedData: undefined },\r\n                        false,\r\n                    );\r\n                }\r\n\r\n                await new Promise((resolve) => setTimeout(resolve, waitTime));\r\n                retries++;\r\n            }\r\n        } catch (err) {\r\n            return getEditorResponseData<null>(\r\n                {\r\n                    data: null,\r\n                    success: false,\r\n                    error: `Error while getting connector state ${err}`,\r\n                    status: 50000,\r\n                    parsedData: undefined,\r\n                },\r\n                false,\r\n            );\r\n        }\r\n\r\n        return getEditorResponseData<null>(\r\n            {\r\n                data: null,\r\n                success: false,\r\n                error: `Timed out waiting for connector`,\r\n                status: 50000,\r\n                parsedData: undefined,\r\n            },\r\n            false,\r\n        );\r\n    };\r\n\r\n    /**\r\n     * Updates the mappings for a given connector.\r\n     * @param id the id of your registered connector\r\n     * @param mappings An array of mapping objects\r\n     * @returns\r\n     */\r\n    updateMappings = async (id: Id, mappings: ConnectorMappingType[]) => {\r\n        return await this.configure(id, async (config) => {\r\n            // Retrieve all existing mappings\r\n            const { parsedData: existingMappings } = await this.getMappings(id);\r\n\r\n            // Filter out old mappings that are being replaced with new ones\r\n            const filteredMappings =\r\n                existingMappings?.filter(\r\n                    (mapping) =>\r\n                        !mappings.some(\r\n                            (newMapping) =>\r\n                                newMapping.name === mapping.name && newMapping.direction === mapping.direction,\r\n                        ),\r\n                ) ?? [];\r\n\r\n            // Filter out new mappings that have empty `name` or `value`\r\n            const validMappings = mappings.filter((i) => i.name !== '' && i.value !== '');\r\n\r\n            // Merge valid new mappings with the filtered existing mappings\r\n            const combinedMappings = [...filteredMappings, ...validMappings];\r\n\r\n            // Update the configuration with the resulted mappings\r\n            await config.setMappings(combinedMappings);\r\n        });\r\n    };\r\n}\r\n\r\n/**\r\n * Helper to setup your connector\r\n */\r\nclass ConnectorConfigurator {\r\n    /**\r\n     * @ignore\r\n     */\r\n    #connectorId: Id;\r\n    #res: EditorAPI;\r\n\r\n    /**\r\n     * @ignore\r\n     */\r\n    constructor(id: Id, res: EditorAPI) {\r\n        this.#connectorId = id;\r\n        this.#res = res;\r\n    }\r\n\r\n    /**\r\n     * Allows to customize the context data a connector can work with. The options data\r\n     * will be available using the context parameter in the connector implementation code.\r\n     * @param options object containing key value data to pass to connector context\r\n     * @returns\r\n     */\r\n    setOptions = async (options: ConnectorOptions) => {\r\n        return this.#res\r\n            .setConnectorOptions(this.#connectorId, JSON.stringify(options))\r\n            .then((result) => getEditorResponseData<null>(result));\r\n    };\r\n\r\n    /**\r\n     * Allows to map variables or strings to connector context data.\r\n     * By defining the mappings, we can trigger re-download of assets (dynamic asset provider)\r\n     * or populate filters for the query endpoint. The mapped data will be available using\r\n     * the context parameter in the connector implementation code.\r\n     *\r\n     * For the variables the mapping should follow the format \"var.[variable id]\". e.g. var.6B29FC40-CA47-1067-B31D-00DD010662DA\r\n     *\r\n     * @param mappings collection of mappings to set to this connector\r\n     * @returns\r\n     */\r\n    setMappings = async (mappings: ConnectorMappingType[]) => {\r\n        const result = await this.#res.setConnectorMappings(\r\n            this.#connectorId,\r\n            mappings.map(function (m) {\r\n                return JSON.stringify(m);\r\n            }),\r\n        );\r\n        return getEditorResponseData<null>(result);\r\n    };\r\n\r\n    /**\r\n     * This method sets the HTTP headers for the 'staticKey' authentication type.\r\n     * These additional headers will be added to all connector http calls.\r\n     * Can only be used after a connector has been registered. (if you are using a grafx connector no registration is needed)\r\n     * @param headerName name of the header\r\n     * @param headerValue value of the header\r\n     * @returns\r\n     */\r\n    setHttpHeader = async (headerName: string, headerValue: string) => {\r\n        return this.#res\r\n            .connectorAuthenticationSetHttpHeader(this.#connectorId, headerName, headerValue)\r\n            .then((result) => getEditorResponseData<null>(result));\r\n    };\r\n}\r\n","import { EditorAPI, EditorResponse } from '../types/CommonTypes';\nimport { ConnectorConfigOptions, MetaData } from '../types/ConnectorTypes';\nimport {\n    DataConnectorCapabilities,\n    DataModel,\n    DataPage,\n    EditorDataPage,\n    PageConfig,\n} from '../types/DataConnectorTypes';\nimport { DataItemMappingTools, EngineDataItem } from '../utils/DataItemMappingTools';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The DataConnectorController is responsible for all communication regarding Data connectors.\n * Methods inside this controller can be called by `window.SDK.dataConnector.{method-name}`\n *\n * The way GraFx Studio handles different sources of Data is called 'DataConnector'.\n * A DataConnector is an implementation of a set of capabilities we need\n * to interact with a certain Data Management system.\n * In essence, a connector is the combination of a JavaScript snippet and some metadata.\n * The JavaScript snippet is loaded in the studio engine using a sandboxed JavaScript execution engine (QuickJs).\n * This allows us to execute the Data connector\n * both on web using webassembly and on the server side during e.g., animation output generation.\n * This controller is an interface to the running connector instance inside the studio engine.\n */\nexport class DataConnectorController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    #dataItemMappingTools: DataItemMappingTools;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI, dataItemMappingTools: DataItemMappingTools) {\n        this.#editorAPI = editorAPI;\n        this.#dataItemMappingTools = dataItemMappingTools;\n    }\n\n    /**\n     * Query a specific DataConnector for data using both specific PageConfig and the dynamic\n     * context as parameters.\n     * @param connectorId unique id of the Data connector\n     * @param config page configuration\n     * @param context context that will be available in the connector script.\n     * @returns a DataPage with an array of data objects\n     */\n    getPage = async (\n        connectorId: string,\n        config: PageConfig,\n        context: MetaData = {},\n    ): Promise<EditorResponse<DataPage>> => {\n        const res = await this.#editorAPI;\n        return res\n            .dataConnectorGetPage(connectorId, JSON.stringify(config), JSON.stringify(context))\n            .then((result) => getEditorResponseData<EditorDataPage<EngineDataItem>>(result))\n            .then((resp) => {\n                const update: EditorResponse<DataPage> = { ...resp, parsedData: null };\n                if (resp.parsedData) {\n                    update.parsedData = {\n                        data: resp.parsedData.data.map((e: EngineDataItem) =>\n                            this.#dataItemMappingTools.mapEngineToDataItem(e),\n                        ),\n                        continuationToken: resp.parsedData.continuationToken,\n                    };\n                }\n                return update;\n            });\n    };\n\n    /**\n     * Query a specific DataConnector for a data model using the dynamic context as parameter.\n     * @param connectorId unique id of the data connector\n     * @param context context that will be available in the connector script.\n     * @returns DataModel\n     */\n    getModel = async (connectorId: string, context: MetaData = {}) => {\n        const res = await this.#editorAPI;\n        return res\n            .dataConnectorGetModel(connectorId, JSON.stringify(context))\n            .then((result) => getEditorResponseData<DataModel>(result));\n    };\n\n    /**\n     * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This\n     * method allows you to discover which mappings are available for a given connector. If you want to use any of these\n     * mappings, they will be available in the `context` parameter of any connector method.\n     * @param connectorId unique id of the data connector\n     * @returns connector mappings\n     */\n    getConfigurationOptions = async (connectorId: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .dataConnectorGetConfigurationOptions(connectorId)\n            .then((result) => getEditorResponseData<ConnectorConfigOptions>(result));\n    };\n\n    /**\n     * This method returns what capabilities the selected connector has. It gives an indication what methods can\n     * be used successfully for a certain connector.\n     * @param connectorId unique id of the Data connector\n     * @returns DataConnectorCapabilities\n     */\n    getCapabilities = async (connectorId: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .dataConnectorGetCapabilities(connectorId)\n            .then((result) => getEditorResponseData<DataConnectorCapabilities>(result));\n    };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { ConnectorInstance } from '../next';\nimport { DataItem } from '../types/DataConnectorTypes';\nimport { DataItemMappingTools } from '../utils/DataItemMappingTools';\n\n/**\n * The DataSourceController is responsible for all communication regarding data source.\n * Methods inside this controller can be called by `window.SDK.dataSource.{method-name}`\n *\n * A data source is a data connector selected to be used in the document.\n * Only one data source can be defined per template, this controller manages this\n * data source.\n *\n */\nexport class DataSourceController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    #dataItemMappingTools: DataItemMappingTools;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI, dataItemMappingTools: DataItemMappingTools) {\n        this.#editorAPI = editorAPI;\n        this.#dataItemMappingTools = dataItemMappingTools;\n    }\n\n    /**\n     * Sets the data source by id.\n     * @param connectorId the id of your data connector\n     * @returns\n     */\n    setDataSource = async (connectorId: string) => {\n        const res = await this.#editorAPI;\n        return res.setDataSource(connectorId).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Gets the data source.\n     * @returns the connector object\n     */\n    getDataSource = async () => {\n        const res = await this.#editorAPI;\n        return res.getDataSource().then((result) => getEditorResponseData<ConnectorInstance>(result));\n    };\n\n    /**\n     * Removes the data source if defined.\n     * @returns\n     */\n    removeDataSource = async () => {\n        const res = await this.#editorAPI;\n        return res.removeDataSource().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Maps the data row values to variables by names (data row keys).\n     * Variables must exist.\n     * @param dataRow DataItem to set\n     * @returns\n     */\n    setDataRow = async (dataRow: DataItem) => {\n        const res = await this.#editorAPI;\n        const engineDataItem = this.#dataItemMappingTools.mapDataItemToEngine(dataRow);\n        return res.setDataRow(JSON.stringify(engineDataItem)).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { DebugData } from '../types/DebugTypes';\n\n/**\n * The DebugController is responsible for all communication regarding Debugging.\n * Methods inside this controller can be called by `window.SDK.debug.{method-name}`\n */\nexport class DebugController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method returns all debug logs\n     * @returns list of all debug logs\n     */\n    getAllLogs = async () => {\n        const res = await this.#editorAPI;\n        return res.getLogs().then((result) => getEditorResponseData<DebugData[]>(result));\n    };\n\n    /**\n     * This method toggles the showcase of debug panel\n     * @returns\n     */\n    toggleDebugPanel = async () => {\n        const res = await this.#editorAPI;\n        return res.toggleDebugPanel().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method enables the debugging\n     * @returns\n     */\n    enableDebug = async () => {\n        const res = await this.#editorAPI;\n        return res.enableDebug().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method disables the debugging\n     * @returns\n     */\n    disableDebug = async () => {\n        const res = await this.#editorAPI;\n        return res.disableDebug().then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport type { ChiliDocument, DocumentLoadOptions } from '../types/DocumentTypes';\nimport { LayoutPreset } from '../types/LayoutTypes';\n\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n/**\n * The DocumentController is responsible for all communication regarding the Document.\n * Methods inside this controller can be called by `window.SDK.document.{method-name}`\n */\n\nexport class DocumentController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method retrieves the current document state from the editor\n     * @returns the JSON document in the form of a string\n     */\n    getCurrentState = async () => {\n        const res = await this.#editorAPI;\n        return res.getCurrentDocumentState().then((result) => getEditorResponseData<ChiliDocument>(result));\n    };\n\n    /**\n     * This method will load a provided document in the ChiliDocument format and\n     * clean old document states.\n     * If you set `DocumentLoadOptions.keepConnectors` to true, `load` will keep\n     * your old connectors states e.g. options, authentication..\n     * By default `keepConnectors` is false and your connectors states are reset.\n     * In this case, you would need to configure your connectors appropriately\n     * beforehand.\n     * @param doc the document to load in\n     * @param options the options object for setting up the document load\n     * @returns the document loaded inside of the canvas\n     */\n    load = async (doc: ChiliDocument | string, options: DocumentLoadOptions = { keepConnectors: false }) => {\n        const res = await this.#editorAPI;\n\n        const parsedDoc = typeof doc !== 'string' ? JSON.stringify(doc) : doc;\n\n        return res\n            .loadDocument(parsedDoc, JSON.stringify(options))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will create a new document, based on a document preset\n     * @param preset the preset where we will create a document of.\n     * @returns the new document created and loaded inside of the canvas\n     */\n    createAndLoad = async (preset: LayoutPreset) => {\n        const res = await this.#editorAPI;\n\n        const parsedDoc = JSON.stringify(preset);\n\n        return res.createAndLoadDocument(parsedDoc).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","// FramePropertiesDto\nimport { BarcodeCharacterSet, BarcodeErrorCorrectionLevel, BarcodeType, QuietZone } from './BarcodeTypes';\nimport { ColorUsage } from './ColorStyleTypes';\nimport { HasOverrideState, Id, PropertyState } from './CommonTypes';\nimport { GradientUsage } from './GradientStyleTypes';\nimport { CornerRadiusAll, CornerRadiusNone, CornerRadiusOnly, ShapeType } from './ShapeTypes';\n\nexport type FrameLayoutType = {\n    id: Id;\n    layoutId: Id;\n    horizontal: FrameAnchor;\n    vertical: FrameAnchor;\n    x: PropertyState<number>;\n    y: PropertyState<number>;\n    width: PropertyState<number>;\n    height: PropertyState<number>;\n    rotationDegrees: PropertyState<number>;\n    scaleX: PropertyState<number>;\n    scaleY: PropertyState<number>;\n    isVisible: PropertyState<boolean>;\n    fitMode: PropertyState<FitMode>;\n    fitModePosition: PropertyState<FitModePosition>;\n    hasImageCrop: PropertyState<boolean>;\n    hasFrameSubjectArea: PropertyState<boolean>;\n    minCopyfitting: PropertyState<number>;\n    maxCopyfitting: PropertyState<number>;\n    enableCopyfitting: PropertyState<boolean>;\n    autoGrow: AutoGrowSettings;\n    isShowingCustomCroppedAsset: boolean;\n    customCroppedAssetCount: number;\n} | null;\n\n//Frame.image\nexport type FrameType = {\n    id: Id;\n    name: string;\n    type: FrameTypeEnum;\n    // `imageUrl` is not generic: should be removed from model\n    imageUrl: string;\n    blendMode: string;\n    opacity: number;\n};\n\nexport type Frame = TextFrame | ImageFrame | ShapeFrame | BarcodeFrame | ComponentFrame;\n\nexport type ImageFrameVariableSource = {\n    type: ImageSourceTypeEnum.variable;\n    id: Id;\n};\n\nexport type ImageFrameUrlSource = {\n    type: ImageSourceTypeEnum.url;\n    url: string;\n};\n\nexport type ImageFrameConnectorSource = {\n    type: ImageSourceTypeEnum.connector;\n    assetId: Id;\n    id: Id;\n};\n\nexport type ImageFrameBrandkitMediaSource = {\n    type: ImageSourceTypeEnum.brandKitMedia;\n    name: string;\n};\n\nexport type ImageFrameSource =\n    | ImageFrameConnectorSource\n    | ImageFrameVariableSource\n    | ImageFrameUrlSource\n    | ImageFrameBrandkitMediaSource;\n\n// used by new getter methods\nexport type ImageFrame = {\n    id: Id;\n    name: string;\n    opacity: number;\n    type: FrameTypeEnum.image;\n    src?: ImageFrameSource;\n    blendMode: BlendMode;\n    dropShadowSettings?: DropShadowSettings;\n};\n\nexport type ShapeFrame = {\n    id: Id;\n    name: string;\n    opacity: number;\n    type: FrameTypeEnum.shape;\n    blendMode: BlendMode;\n    shapeProperties: {\n        enableFill: boolean;\n        fillColor: ColorUsage;\n        enableStroke: boolean;\n        strokeWeight: number;\n        strokeColor: ColorUsage;\n        allCornersSame: boolean;\n    };\n    src: {\n        type: ShapeType;\n        cornerRadius: CornerRadiusNone | CornerRadiusAll | CornerRadiusOnly;\n        sides?: number;\n    };\n    dropShadowSettings?: DropShadowSettings;\n    gradient?: GradientUsage;\n};\n\nexport type TextFrame = {\n    id: Id;\n    name: string;\n    opacity: number;\n    type: FrameTypeEnum.text;\n    textContent: string;\n    paddingLeft: number;\n    paddingTop: number;\n    paddingRight: number;\n    paddingBottom: number;\n    numberOfColumns: number;\n    columnGap: number;\n    textDirection: TextDirection;\n    flowDirection: FlowDirection;\n    verticalAlign: VerticalAlign;\n    textStroke: boolean;\n    textStrokeWeight: number;\n    textStrokeColor: number;\n    hasClippingPath: boolean;\n    blendMode: BlendMode;\n    dropShadowSettings?: DropShadowSettings;\n};\n\nexport type BarcodeFrame = {\n    id: Id;\n    name: string;\n    opacity: number;\n    type: FrameTypeEnum.barcode;\n    blendMode: BlendMode;\n    barcodeProperties: {\n        enableBackground: boolean;\n        backgroundColor: ColorUsage;\n        enableBarColor: boolean;\n        barColor: ColorUsage;\n        enableText: boolean;\n        barHeight: number;\n        magnification: number;\n        quietZone: QuietZone;\n        errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n        characterSet?: BarcodeCharacterSet;\n        drawStartStopChars: boolean;\n    };\n    src?: BarcodeSource;\n    barcodeType: BarcodeType;\n    dropShadowSettings?: DropShadowSettings;\n};\n\nexport type BarcodeSource = BarcodeVariableSource | BarcodeTextSource;\n\nexport type BarcodeVariableSource = {\n    type: BarcodeSourceTypeEnum.variable;\n    id: Id;\n};\n\nexport type BarcodeTextSource = {\n    type: BarcodeSourceTypeEnum.text;\n    text: string;\n};\n\nexport type ComponentFrame = {\n    id: Id;\n    name: string;\n    opacity: number;\n    type: FrameTypeEnum.component;\n    blendMode: BlendMode;\n    src: ComponentSource;\n    variableMappings: VariableMapping[];\n\n    /**\n     * How the component fits within the frame.\n     */\n    fitMode: ComponentFitEnum;\n};\n\nexport type ComponentSource = ConnectorComponentSource;\n\nexport type ConnectorComponentSource = {\n    type: ComponentSourceTypeEnum.connector;\n    id: Id;\n    assetId: Id;\n};\n\nexport type VariableMapping = {\n    source: Id;\n    target: Id;\n};\n\nexport enum ComponentFitEnum {\n    /**\n     * The component resizes to fit the frame size.\n     */\n    resize = 'resize',\n\n    /**\n     * The component scales to fit the frame size while maintaining its aspect ratio.\n     */\n    scale = 'scale',\n\n    /**\n     * The component first scales to fit the frame size while maintaining its aspect ratio,\n     * then resizes to fill the remaining space.\n     */\n    scaleAndResize = 'scaleAndResize',\n}\n\nexport type CropSettings = {\n    left: number;\n    top: number;\n    width: number;\n    height: number;\n    rotationDegrees: number;\n    type: 'default';\n};\n\nexport type NoCropSettings = {\n    type: 'noCrop';\n};\n\nexport type AutoGrowSettings = {\n    enabled: PropertyState<boolean>;\n    minWidth: PropertyState<number>;\n    maxWidth: PropertyState<number>;\n    minHeight: PropertyState<number>;\n    maxHeight: PropertyState<number>;\n    directions: PropertyState<Array<AutoGrowDirection>>;\n};\n\nexport interface AutoGrowDeltaUpdate {\n    enabled?: {\n        value: boolean;\n    };\n    minWidth?: {\n        value: string | null;\n    };\n    maxWidth?: {\n        value: string | null;\n    };\n    minHeight?: {\n        value: string | null;\n    };\n    maxHeight?: {\n        value: string | null;\n    };\n    directions?: {\n        value: Array<AutoGrowDirection>;\n    };\n}\n\nexport type DropShadowSettings = {\n    enabled: boolean;\n    distance: number;\n    angleDegrees: number;\n    blurRadius: number;\n    color: ColorUsage;\n};\n\nexport interface ShadowSettingsDeltaUpdate {\n    distance?: {\n        value: string;\n    };\n    angleDegrees?: {\n        value: number;\n    };\n    blurRadius?: {\n        value: number;\n    };\n    enabled?: {\n        value: boolean;\n    };\n    color?: {\n        value: ColorUsage;\n    };\n}\n\nexport enum AutoGrowDirection {\n    top = 'top',\n    bottom = 'bottom',\n    left = 'left',\n    right = 'right',\n}\n\nexport enum ImageSourceTypeEnum {\n    url = 'url',\n    variable = 'variable',\n    connector = 'connector',\n    brandKitMedia = 'brandKitMedia',\n}\n\nexport enum ComponentSourceTypeEnum {\n    connector = 'connector',\n}\n\nexport enum FrameTypeEnum {\n    text = 'text',\n    image = 'image',\n    shape = 'shape',\n    barcode = 'barcode',\n    component = 'component',\n}\n\nexport enum BarcodeSourceTypeEnum {\n    variable = 'variable',\n    text = 'text',\n}\n\nexport enum TextDirection {\n    leftToRight = 'leftToRight',\n    rightToLeft = 'rightToLeft',\n    weak = 'weak',\n}\n\nexport enum FlowDirection {\n    horizontal = 'horizontal',\n    vertical = 'vertical',\n    onPath = 'onPath',\n}\n\nexport enum VerticalAlign {\n    top = 'top',\n    bottom = 'bottom',\n    middle = 'middle',\n    justify = 'justify',\n}\n\nexport enum BlendMode {\n    normal = 'normal',\n    screen = 'screen',\n    overlay = 'overlay',\n    darken = 'darken',\n    lighten = 'lighten',\n    colorDodge = 'colorDodge',\n    colorBurn = 'colorBurn',\n    hardLight = 'hardLight',\n    softLight = 'softLight',\n    difference = 'difference',\n    exclusion = 'exclusion',\n    multiply = 'multiply',\n    hue = 'hue',\n    saturation = 'saturation',\n    color = 'color',\n    luminosity = 'luminosity',\n}\n\nexport enum FitMode {\n    fill = 'fill',\n    fit = 'fit',\n    smartCrop = 'smartCrop',\n    manualCrop = 'manualCrop',\n}\n\nexport enum FitModePosition {\n    topLeft = 'topLeft',\n    topCenter = 'topCenter',\n    topRight = 'topRight',\n    centerLeft = 'centerLeft',\n    center = 'center',\n    centerRight = 'centerRight',\n    bottomLeft = 'bottomLeft',\n    bottomCenter = 'bottomCenter',\n    bottomRight = 'bottomRight',\n}\n\nexport enum UpdateZIndexMethod {\n    bringToFront = 'bringToFront',\n    sendToBack = 'sendToBack',\n    bringForward = 'bringForward',\n    sendBackward = 'sendBackward',\n}\n\nexport enum FrameAnchorType {\n    relative = 'relative',\n    start = 'start',\n    end = 'end',\n    startAndEnd = 'startAndEnd',\n    center = 'center',\n}\n\nexport enum AnchorTargetType {\n    page = 'page',\n    frame = 'frame',\n}\n\nexport enum AnchorTargetEdgeType {\n    start = 'start',\n    end = 'end',\n    center = 'center',\n}\n\nexport class PageAnchorTarget {\n    type = AnchorTargetType.page;\n}\n\nexport class FrameAnchorTarget {\n    frameId: Id;\n    edge: AnchorTargetEdgeType;\n    type = AnchorTargetType.frame;\n\n    constructor(id: Id, edge: AnchorTargetEdgeType) {\n        (this.frameId = id), (this.edge = edge);\n    }\n}\n\nexport type AnchorTarget = PageAnchorTarget | FrameAnchorTarget;\n\nexport type RelativeFrameAnchor = {\n    start: PropertyState<number>;\n    end: PropertyState<number>;\n    target: AnchorTarget;\n    type: FrameAnchorType.relative;\n} & HasOverrideState;\n\nexport type StartFrameAnchor = {\n    offset: PropertyState<number>;\n    target: AnchorTarget;\n    type: FrameAnchorType.start;\n} & HasOverrideState;\n\nexport type EndFrameAnchor = {\n    offset: PropertyState<number>;\n    target: AnchorTarget;\n    type: FrameAnchorType.end;\n} & HasOverrideState;\n\nexport type StartAndEndFrameAnchor = {\n    start: PropertyState<number>;\n    startTarget: AnchorTarget;\n    end: PropertyState<number>;\n    endTarget: AnchorTarget;\n    type: FrameAnchorType.startAndEnd;\n} & HasOverrideState;\n\nexport type CenterFrameAnchor = {\n    offset: PropertyState<number>;\n    target: AnchorTarget;\n    type: FrameAnchorType.center;\n} & HasOverrideState;\n\nexport type FrameAnchor =\n    | RelativeFrameAnchor\n    | StartFrameAnchor\n    | EndFrameAnchor\n    | StartAndEndFrameAnchor\n    | CenterFrameAnchor;\n\nexport type FrameAnchorProperties = {\n    horizontal: boolean;\n    type: FrameAnchorType;\n    target: AnchorTarget;\n    endTarget?: AnchorTarget | null;\n};\n\nexport type AnchorConfiguration = {\n    allowedTypes: Set<FrameAnchorType>;\n    allowedFrameIds: Set<Id>;\n};\n\nexport type FrameConfiguration = {\n    horizontal: AnchorConfiguration;\n    vertical: AnchorConfiguration;\n};\n\nexport enum CropType {\n    frameCrop = 'frameCrop',\n    assetCrop = 'assetCrop',\n}\n\nexport type FrameConstraints = {\n    selectionAllowed: PropertyState<boolean>;\n    horizontalMovementAllowed: PropertyState<boolean>;\n    verticalMovementAllowed: PropertyState<boolean>;\n    rotationAllowed: PropertyState<boolean>;\n    resizeAllowed: PropertyState<boolean>;\n    cropAllowed: PropertyState<boolean>;\n    proportionLocked: PropertyState<boolean>;\n};\n\nexport interface FrameConstraintsDeltaUpdate {\n    selectionAllowed?: {\n        value: boolean | null;\n    };\n    horizontalMovementAllowed?: {\n        value: boolean | null;\n    };\n    verticalMovementAllowed?: {\n        value: boolean | null;\n    };\n    rotationAllowed?: {\n        value: boolean | null;\n    };\n    resizeAllowed?: {\n        value: boolean | null;\n    };\n    cropAllowed?: {\n        value: boolean | null;\n    };\n    proportionLocked?: {\n        value: boolean | null;\n    };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { ImageSourceTypeEnum, ImageFrameVariableSource } from '../types/FrameTypes';\nimport { TextType } from '../types/TextTypes';\n\n/**\n * The ExperimentController contains all SDK functions that are considered for addition,\n * or functions we want to keep open for changing definitions. This is a sneak peak\n * into future versions of the SDK. Never build production code relying on functions in\n * this controller.\n */\nexport class ExperimentController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method will assign an image from a variable to the correct ImageFrame\n     * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n     * @param variableId the id of the variable which contains the image\n     * @returns\n     */\n    insertImageVariableToFrame = async (imageFrameId: Id, variableId: Id) => {\n        const res = await this.#editorAPI;\n        const src: ImageFrameVariableSource = { id: variableId, type: ImageSourceTypeEnum.variable };\n        return res\n            .setImageSource(imageFrameId, JSON.stringify(src))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will insert a text variable in the selected frame. Calling this method\n     * requires that the selected frame is in text editing mode.\n     * @param id the id of the variable to be inserted.\n     * @returns\n     */\n    insertTextVariable = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.insertTextVariable(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will enter text editing mode on the provided frame.\n     * @param id the id frame to enter text edit mode on.\n     * @returns\n     */\n    enterTextEditMode = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.enterTextEditMode(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will exit text editing mode.\n     * @returns\n     */\n    exitTextEditMode = async () => {\n        const res = await this.#editorAPI;\n        return res.exitTextEditMode().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method gets the text content of a text frame.\n     * The variables contained in the text will return their values only if you\n     * are in text editing mode.\n     * @param frameId The ID of a text frame\n     * @param textType The type of the text\n     * @returns the text content\n     */\n    getText = async (frameId: string, textType: TextType) => {\n        const res = await this.#editorAPI;\n        return res.getTextByFrameId(frameId, textType).then((result) => getEditorResponseData<string>(result));\n    };\n\n    /**\n     * This method sets the text content of a text frame\n     * @param frameId The ID of a text frame\n     * @param text The new text content\n     * @returns\n     */\n    setText = async (frameId: string, text: string) => {\n        const res = await this.#editorAPI;\n        return res.setTextByFrameId(frameId, text).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method selects the text content of a text frame\n     * @param frameId The ID of a text frame\n     * @param startIndex The index where the selection starts\n     * @param length The length of selection from startIndex\n     * @returns\n     */\n    selectText = async (frameId: string, startIndex: number, length: number) => {\n        const res = await this.#editorAPI;\n        return res.selectTextById(frameId, startIndex, length).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method adds custom data that will be saved and restored when undoing and redoing.\n     * Duplicate values are overwritten. The data is exposed via the onCustomUndoDataChanged event.\n     *\n     * @param key The key of the custom data\n     * @param value The value of the custom data\n     * @param skipEvent Whether to skip the event that is triggered when the custom data is changed, defaults to false\n     * @returns\n     */\n    addCustomUndoData = async (key: string, value: string, skipEvent?: boolean) => {\n        const res = await this.#editorAPI;\n        return res\n            .setCustomUndoData(key, value, skipEvent ?? false)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { CallSender } from 'penpal';\nimport { EditorAPI, EditorRawAPI, EditorResponse } from '../types/CommonTypes';\nimport {\n    ConnectorConfigOptions,\n    DeprecatedMediaType,\n    MediaType,\n    MetaData,\n    QueryOptions,\n    QueryPage,\n} from '../types/ConnectorTypes';\nimport { FontConnectorCapabilities, FontFamily, FontPreviewFormat, FontStyle } from '../types/FontConnectorTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The FontConnectorController is responsible for all communication regarding Font connectors.\n * Methods inside this controller can be called by `window.SDK.FontConnector.{method-name}`\n *\n * The way GraFx Studio handles different sources of Font is called 'FontConnector'.\n * A FontConnector is an implementation of a set of capabilities we need\n * to interact with a certain Digital Asset Management system.\n * In essence, a connector is the combination of a JavaScript snippet and some metadata.\n * The JavaScript snippet is loaded in the studio engine using a sandboxed JavaScript execution engine (QuickJs).\n * This allows us to execute the Font connector\n * both on web using webassembly and on the server side during e.g. animation output generation.\n * This controller is an interface to the running connector instance inside the studio engine.\n */\nexport class FontConnectorController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    #blobAPI: EditorRawAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n    }\n\n    /**\n     * Query a specific FontConnector for data using both standardized queryOptions and the dynamic\n     * context as parameters.\n     * @param connectorId unique id of the Font connector\n     * @param queryOptions query options\n     * @param context context that will be available in the connector script.\n     * @returns array of font families\n     */\n    query = async (connectorId: string, queryOptions: QueryOptions, context: MetaData = {}) => {\n        const res = await this.#editorAPI;\n        return res\n            .fontConnectorQuery(connectorId, JSON.stringify(queryOptions), JSON.stringify(context))\n            .then((result) => getEditorResponseData<QueryPage<FontFamily>>(result));\n    };\n\n    /**\n     * Returns all font styles for a family using a specific FontConnector. The connector needs to list `detail` as a supported capability.\n     * @param connectorId unique id of the Font connector\n     * @param fontFamilyId unique id of the Font family\n     * @param context context that will be available in the connector script.\n     * @returns array of font styles\n     */\n    detail = async (connectorId: string, fontFamilyId: string, context: MetaData = {}) => {\n        const res = await this.#editorAPI;\n        return res\n            .fontConnectorDetail(connectorId, fontFamilyId, JSON.stringify(context))\n            .then((result) => getEditorResponseData<FontStyle[]>(result));\n    };\n\n    /**\n     * The combination of a `connectorId` and `fontId` is typically enough for a Font connector to\n     * perform the download of this asset. The `download` endpoint is capable of relaying this information to the\n     * Font connector instance running in the editor engine.\n     * @param connectorId unique id of the Font connector\n     * @param fontStyleId unique id of the Font style to download\n     * @param context context that will be available in the connector script.\n     * @returns\n     */\n    download = async (connectorId: string, fontStyleId: string, context: MetaData = {}): Promise<Uint8Array> => {\n        const res = await this.#blobAPI;\n        return res\n            .fontConnectorDownload(connectorId, fontStyleId, JSON.stringify(context))\n            .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n    };\n\n    /**\n     * The combination of a `connectorId` and `fontFamilyId` is typically enough for a Font connector to\n     * perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the\n     * Font connector instance running in the editor engine.\n     * @param connectorId unique id of the Font connector\n     * @param fontFamilyId unique id of the Font family to download\n     * @param previewFormat hint to the Font connector about desired format of the Font preview\n     * @param context dynamic map of additional options potentially used by the connector\n     * @returns\n     */\n    preview = async (\n        connectorId: string,\n        fontFamilyId: string,\n        previewFormat: FontPreviewFormat,\n        context: MetaData = {},\n    ): Promise<Uint8Array> => {\n        const res = await this.#blobAPI;\n        return res\n            .fontConnectorPreview(connectorId, fontFamilyId, previewFormat, JSON.stringify(context))\n            .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n    };\n\n    /**\n     * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This\n     * method allows you to discover which mappings are available for a given connector. If you want to use any of these\n     * mappings, they will be available in the `context` parameter of any connector method.\n     * @param connectorId unique id of the media connector\n     * @returns connector mappings\n     */\n    getConfigurationOptions = async (connectorId: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .fontConnectorGetConfigurationOptions(connectorId)\n            .then((result) => getEditorResponseData<ConnectorConfigOptions>(result));\n    };\n\n    /**\n     * This method returns what capabilities the selected connector has. It gives an indication what methods can\n     * be used successfully for a certain connector.\n     * @param connectorId unique id of the Font connector\n     * @returns FontConnectorCapabilities\n     */\n    getCapabilities = async (connectorId: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .fontConnectorGetCapabilities(connectorId)\n            .then((result) => getEditorResponseData<FontConnectorCapabilities>(result));\n    };\n\n    /**\n     * This method will parse the deprecatedFontType to the new Font type. This method will be removed once the deprecatedFontType is out of use\n     * @param deprecatedType is 0 or 1\n     * @returns MediaType value\n     */\n    parseDeprecatedFontType = (deprecatedType: DeprecatedMediaType) => {\n        if (deprecatedType === DeprecatedMediaType.file) return MediaType.file;\n        if (deprecatedType === DeprecatedMediaType.collection) return MediaType.collection;\n    };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\r\nimport {\r\n    AddDocumentFontFamily,\r\n    AddDocumentFontStyle,\r\n    CharacterPreview,\r\n    CharacterPreviewStyle,\r\n    DocumentFontFamily,\r\n    DocumentFontStyle,\r\n} from '../types/FontTypes';\r\nimport { getEditorResponseData } from '../utils/EditorResponseData';\r\n\r\n/**\r\n * The FontController is responsible for all communication regarding font styles.\r\n * Methods inside this controller can be called by `window.SDK.font.{method-name}`\r\n */\r\nexport class FontController {\r\n    /**\r\n     * @ignore\r\n     */\r\n    #editorAPI: EditorAPI;\r\n\r\n    /**\r\n     * @ignore\r\n     */\r\n    constructor(editorAPI: EditorAPI) {\r\n        this.#editorAPI = editorAPI;\r\n    }\r\n\r\n    /**\r\n     * This method adds a font family\r\n     * @param connectorId unique id of the font connector\r\n     * @param fontFamily the font family object\r\n     * @returns id generated on the engine side `CONNECTOR_ID::FONT_FAMILY_ID`\r\n     */\r\n    addFontFamily = async (connectorId: Id, fontFamily: AddDocumentFontFamily) => {\r\n        const res = await this.#editorAPI;\r\n        return res\r\n            .addFontFamily(connectorId, JSON.stringify(fontFamily))\r\n            .then((result) => getEditorResponseData<null>(result));\r\n    };\r\n\r\n    /**\r\n     * This method removes a font family\r\n     * @param id the id of a specific font family\r\n     * @returns\r\n     */\r\n    removeFontFamily = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.removeFontFamily(id).then((result) => getEditorResponseData<null>(result));\r\n    };\r\n\r\n    /**\r\n     * This method adds a font style\r\n     * @param connectorId unique id of the font connector\r\n     * @param fontStyle the font object\r\n     * @returns id generated on the engine side `CONNECTOR_ID::FONT_FAMILY_ID::FONT_STYLE_ID`\r\n     */\r\n    addFontStyle = async (connectorId: Id, fontStyle: AddDocumentFontStyle) => {\r\n        const res = await this.#editorAPI;\r\n        return res\r\n            .addFontStyle(connectorId, JSON.stringify(fontStyle))\r\n            .then((result) => getEditorResponseData<null>(result));\r\n    };\r\n\r\n    /**\r\n     * This method removes a font style\r\n     * @param id the id of a specific font style\r\n     * @returns\r\n     */\r\n    removeFontStyle = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.removeFontStyle(id).then((result) => getEditorResponseData<null>(result));\r\n    };\r\n\r\n    /**\r\n     * This method returns the list of font families\r\n     * @returns DocumentFontFamily[]\r\n     */\r\n    getFontFamilies = async () => {\r\n        const res = await this.#editorAPI;\r\n        return res.getFontFamilies().then((result) => getEditorResponseData<DocumentFontFamily[]>(result));\r\n    };\r\n\r\n    /**\r\n     * This method returns the list of font styles for a specific family\r\n     * @param id the id of a specific font style\r\n     * @returns DocumentFontStyle[]\r\n     */\r\n    getFontStyles = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.getFontStyles(id).then((result) => getEditorResponseData<DocumentFontStyle[]>(result));\r\n    };\r\n\r\n    /**\r\n     * This method returns a font family by id\r\n     * @param id the id of a specific font family\r\n     * @returns DocumentFontFamily properties\r\n     */\r\n    getFontFamilyById = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.getFontFamilyById(id).then((result) => getEditorResponseData<DocumentFontFamily>(result));\r\n    };\r\n\r\n    /**\r\n     * This method returns a font style by id\r\n     * @param id the id of a specific font style\r\n     * @returns DocumentFontStyle properties\r\n     */\r\n    getFontStyleById = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.getFontStyleById(id).then((result) => getEditorResponseData<DocumentFontStyle>(result));\r\n    };\r\n\r\n    /**\r\n     * This method returns the default font.\r\n     * Be aware that the default font will not change during the entire lifetime of the SDK session.\r\n     * It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session.\r\n     * @returns a default DocumentFontStyle\r\n     */\r\n\r\n    getDefaultFontStyle = async () => {\r\n        const res = await this.#editorAPI;\r\n        return res.getDefaultFontStyle().then((result) => getEditorResponseData<DocumentFontStyle>(result));\r\n    };\r\n\r\n    /**\r\n     * This method returns the default font family.\r\n     * Be aware that the default font family will not change during the entire lifetime of the SDK session.\r\n     * It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session.\r\n     * @returns a default DocumentFontFamily\r\n     */\r\n    getDefaultFontFamily = async () => {\r\n        const res = await this.#editorAPI;\r\n        return res.getDefaultFontFamily().then((result) => getEditorResponseData<DocumentFontFamily>(result));\r\n    };\r\n\r\n    /**\r\n     * Check if the font family is used anywhere in the document\r\n     * @param id the id of the font family to check\r\n     * @returns boolean\r\n     */\r\n    isFontFamilyUsed = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.isFontFamilyUsed(id).then((result) => getEditorResponseData<boolean>(result));\r\n    };\r\n\r\n    /**\r\n     * Check if the font style is used anywhere in the document\r\n     * @param id the id of the font style to check\r\n     * @returns boolean\r\n     */\r\n    isFontStyleUsed = async (id: Id) => {\r\n        const res = await this.#editorAPI;\r\n        return res.isFontStyleUsed(id).then((result) => getEditorResponseData<boolean>(result));\r\n    };\r\n\r\n    /**\r\n     * This method changes positions of font families\r\n     * @param order the position of the font family\r\n     * @param ids the list of font family  IDs\r\n     * @returns\r\n     */\r\n    moveFontFamilies = async (order: number, ids: string[]) => {\r\n        const res = await this.#editorAPI;\r\n        return res.moveFontFamilies(order, ids).then((result) => getEditorResponseData<null>(result));\r\n    };\r\n\r\n    /**\r\n     * @experimental This method is experimental and may be changed in the future.\r\n     * This method returns SVG graphics for requested characters used as bullets\r\n     * @param characters the list of characters to render as SVG\r\n     * @param characterPreviewStyle style to generate characters preview\r\n     * @returns An object with the characters as keys and the SVG graphics as values\r\n     */\r\n    getPreviewsOfCharacterStrings = async (characters: string[], characterPreviewStyle: CharacterPreviewStyle) => {\r\n        const res = await this.#editorAPI;\r\n        return res\r\n            .getPreviewsOfCharacterStrings(characters, JSON.stringify(characterPreviewStyle))\r\n            .then((result) => getEditorResponseData<CharacterPreview>(result));\r\n    };\r\n}\r\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport { CornerRadiusUpdateModel, ShapeProperties } from '../types/ShapeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ShapeController is responsible for all communication regarding Shapes.\n * Methods inside this controller can be called by `window.SDK.shape.{method-name}`\n */\nexport class ShapeController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method updates properties of the shape\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param properties A property to update\n     * @returns\n     */\n    private setShapeProperties = async (id: Id, properties: ShapeProperties) => {\n        const res = await this.#editorAPI;\n        return res\n            .setShapeProperties(id, JSON.stringify(properties))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the visibility of the shape fill.\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param enableFill Whether the shape fill is visible.\n     * @returns\n     */\n    setEnableFill = async (id: Id, enableFill: boolean) => {\n        const properties: ShapeProperties = { enableFill: enableFill };\n        return this.setShapeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the shape fill color of a specified shape frame.\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param fillColor the new shape fill color that you want to set to the shapeFrame.\n     * @returns\n     */\n    setFillColor = async (id: Id, fillColor: ColorUsage) => {\n        const properties: ShapeProperties = { fillColor: fillColor };\n        return this.setShapeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the visibility of the shape stroke.\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param enableStroke Whether the shape stroke is visible.\n     * @returns\n     */\n    setEnableStroke = async (id: Id, enableStroke: boolean) => {\n        const properties: ShapeProperties = { enableStroke: enableStroke };\n        return this.setShapeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the shape stroke color of a specified shape frame.\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param strokeColor the new shape stroke color that you want to set to the shapeFrame.\n     * @returns\n     */\n    setStrokeColor = async (id: Id, strokeColor: ColorUsage) => {\n        const properties: ShapeProperties = { strokeColor: strokeColor };\n        return this.setShapeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the shape stroke weight of a specified shape frame.\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param strokeWeight the new shape stroke weight that you want to set to the shapeFrame.\n     * @returns\n     */\n    setStrokeWeight = async (id: Id, strokeWeight: number) => {\n        const properties: ShapeProperties = { strokeWeight: strokeWeight };\n        return this.setShapeProperties(id, properties);\n    };\n\n    /**\n     * This method will set the flag to change the way the rectangle shape corners will be changed: all at once or separately.\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param allCornersSame the new flag that you want to set to the shapeFrame.\n     * @returns\n     */\n    setFlagAllCornersSame = async (id: Id, allCornersSame: boolean) => {\n        const properties: ShapeProperties = { allCornersSame: allCornersSame };\n        return this.setShapeProperties(id, properties);\n    };\n\n    /**\n     * This method updates radii of the rectangle and polygon shapes\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param radius A radius object to update a desired corner;\n     * @returns\n     */\n    private setShapeCorners = async (id: Id, radius: CornerRadiusUpdateModel) => {\n        const res = await this.#editorAPI;\n        return res.setShapeCorners(id, JSON.stringify(radius)).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the radius for all corners of the rectangle and polygon shapes\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param radius A radius to update all corners at once;\n     * @returns\n     */\n    setRadiusAll = async (id: Id, radius: number) => {\n        const cornerRadius: CornerRadiusUpdateModel = { radiusAll: radius };\n        return this.setShapeCorners(id, cornerRadius);\n    };\n\n    /**\n     * This method will set the radius for the top left corner of the rectangle shape\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param radius A radius to update the top left corner;\n     * @returns\n     */\n    setRadiusTopLeft = async (id: Id, radius: number) => {\n        const cornerRadius: CornerRadiusUpdateModel = { topLeft: radius };\n        return this.setShapeCorners(id, cornerRadius);\n    };\n\n    /**\n     * This method will set the radius for the bottom left corner of the rectangle shape\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param radius A radius to update the bottom left corner;\n     * @returns\n     */\n    setRadiusBottomLeft = async (id: Id, radius: number) => {\n        const cornerRadius: CornerRadiusUpdateModel = { bottomLeft: radius };\n        return this.setShapeCorners(id, cornerRadius);\n    };\n\n    /**\n     * This method will set the radius for the top right corner of the rectangle shape\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param radius A radius to update the top right corner;\n     * @returns\n     */\n    setRadiusTopRight = async (id: Id, radius: number) => {\n        const cornerRadius: CornerRadiusUpdateModel = { topRight: radius };\n        return this.setShapeCorners(id, cornerRadius);\n    };\n\n    /**\n     * This method will set the radius for the bottom right corner of the rectangle shape\n     * @param id the id of the shapeFrame that needs to get updated.\n     * @param radius A radius to update the bottom right corner;\n     * @returns\n     */\n    setRadiusBottomRight = async (id: Id, radius: number) => {\n        const cornerRadius: CornerRadiusUpdateModel = { bottomRight: radius };\n        return this.setShapeCorners(id, cornerRadius);\n    };\n}\n","import { BarcodeType } from '../types/BarcodeTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport type { EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\nimport {\n    AnchorTarget,\n    AutoGrowDeltaUpdate,\n    AutoGrowDirection,\n    BlendMode,\n    ComponentSource,\n    CropType,\n    FitMode,\n    FitModePosition,\n    FrameAnchorProperties,\n    FrameAnchorType,\n    FrameConfiguration,\n    FrameConstraints,\n    FrameConstraintsDeltaUpdate,\n    FrameLayoutType,\n    FrameType,\n    FrameTypeEnum,\n    ImageFrameConnectorSource,\n    ImageFrameSource,\n    ImageFrameUrlSource,\n    ImageSourceTypeEnum,\n    ShadowSettingsDeltaUpdate,\n    UpdateZIndexMethod,\n    VerticalAlign,\n} from '../types/FrameTypes';\nimport { GradientDeltaUpdate, GradientUpdate } from '../types/GradientStyleTypes';\nimport { ShapeType } from '../types/ShapeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { ShapeController } from './ShapeController';\n\n/**\n * The FrameController is responsible for all communication regarding Frames.\n * Methods inside this controller can be called by `window.SDK.frame.{method-name}`\n */\nexport class FrameController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    constraints: FrameConstraintController;\n    /**\n     * This variable helps to redirect shapes related methods to newly introduced ShapeController\n     * to avoid any breaking changes\n     */\n    private shapeController: ShapeController;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.shapeController = new ShapeController(this.#editorAPI);\n        this.constraints = new FrameConstraintController(this.#editorAPI);\n    }\n\n    /**\n     * This method returns the list of frames\n     * @returns list of all frames\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getFrames().then((result) => getEditorResponseData<FrameType[]>(result));\n    };\n\n    /**\n     * This method returns the list of selected frames\n     * @returns list of all selected frames\n     */\n    getSelected = async () => {\n        const res = await this.#editorAPI;\n        return res.getSelectedFrames().then((result) => getEditorResponseData<FrameType[]>(result));\n    };\n\n    /**\n     * This method returns the list of frames by id\n     * @param id the id of a specific page\n     * @returns list of all frames by id\n     */\n    getAllByPageId = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getFramesByPageId(id).then((result) => getEditorResponseData<FrameType[]>(result));\n    };\n\n    /**\n     * This method returns a frame by its name\n     * @param name the name of a specific frame\n     * @returns frame properties\n     */\n    getByName = async (name: string) => {\n        const res = await this.#editorAPI;\n        return res.getFrameByName(name).then((result) => getEditorResponseData<FrameType>(result));\n    };\n\n    /**\n     * This method returns a frame by its id\n     * @param id the id of a specific frame\n     * @returns frame properties\n     */\n    getById = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getFrameById(id).then((result) => getEditorResponseData<FrameType>(result));\n    };\n\n    /**\n     * This method returns all frame properties on current layout\n     * @returns all frame properties on current layout\n     */\n    getPropertiesOnSelectedLayout = async () => {\n        const res = await this.#editorAPI;\n        return res\n            .getFramePropertiesOnSelectedLayout()\n            .then((result) => getEditorResponseData<FrameLayoutType[]>(result));\n    };\n\n    /**\n     * This method returns frame layout properties for a given frame and layout\n     * @param id the id of a specific frame\n     * @param layoutId the id of a specific layout\n     * @returns frame layout properties\n     */\n    getLayoutProperties = async (id: Id, layoutId?: Id) => {\n        const res = await this.#editorAPI;\n        return res\n            .getFramePropertiesByFrameId(id, layoutId)\n            .then((result) => getEditorResponseData<FrameLayoutType>(result));\n    };\n\n    /**\n     * This method returns a list of frame properties for a given layout\n     * @param id the id of a specific layout\n     * @returns list of frame layout properties\n     */\n    getAllLayoutProperties = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getFramesProperties(id).then((result) => getEditorResponseData<FrameLayoutType[]>(result));\n    };\n\n    /**\n     * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n     * to the frame's to be inherited from the parent layout\n     * @param id the id of a specific frame\n     * @returns\n     */\n    resetTransformation = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n     * to the frame's to be inherited from the parent layout\n     * @param id the id of a specific frame\n     * @returns\n     * @deprecated Use 'resetTransformation' instead\n     */\n    resetSize = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will select a specific frame\n     * @param id the id of a specific frame\n     * @returns\n     */\n    select = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.selectFrames([id]).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will select multipleFrames\n     * @param ids An array of all ids you want to select\n     * @returns\n     */\n    selectMultiple = async (ids: Id[]) => {\n        const res = await this.#editorAPI;\n        return res.selectFrames(ids).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will deselect all frames\n     * @returns\n     */\n    deselectAll = async () => {\n        const res = await this.#editorAPI;\n        return res.deselectFrames().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method changes the order of frames in the z-index list.\n     * @param order the index in the list to move to\n     * @param ids An array of all IDs you want to move to the given index\n     * @returns\n     */\n    reorderFrames = async (order: number, ids: Id[]) => {\n        const res = await this.#editorAPI;\n        return res.reorderFrames(order, ids).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will update the z-index of a frame.\n     * @param id the id of the frame you want to change the z-index of\n     * @param method the z-index update method to perform\n     * @returns\n     */\n    setZIndex = async (id: Id, method: UpdateZIndexMethod) => {\n        const res = await this.#editorAPI;\n        return res.setFrameZIndex(id, method).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the height of a specific frame\n     * @param id the id of a specific frame\n     * @param height the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n     * @returns\n     */\n    setHeight = async (id: Id, height: string) => {\n        const res = await this.#editorAPI;\n        return res.setFrameHeight(id, height).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the rotation angle of a specific frame\n     * @param id the id of a specific frame\n     * @param rotation the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n     * @returns\n     */\n    setRotation = async (id: Id, rotation: string) => {\n        const res = await this.#editorAPI;\n        return res.setFrameRotation(id, rotation).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the width of a specific frame\n     * @param id the id of a specific frame\n     * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n     * @returns\n     */\n    setWidth = async (id: Id, width: string) => {\n        const res = await this.#editorAPI;\n        return res.setFrameWidth(id, width).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the x value of a specific frame\n     * @param id the id of a specific frame\n     * @param XValue the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n     * @returns\n     */\n    setX = async (id: Id, XValue: string) => {\n        const res = await this.#editorAPI;\n        return res.setFrameX(id, XValue).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the y value of a specific frame\n     * @param id the id of a specific frame\n     * @param YValue the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n     * @returns\n     */\n    setY = async (id: Id, YValue: string) => {\n        const res = await this.#editorAPI;\n        return res.setFrameY(id, YValue).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the frame opacity\n     * @param id the id of a specific frame\n     * @param opacity the opacity of the frame in range [0.0 - 1.0]\n     * @returns\n     */\n    setOpacity = async (id: Id, opacity: number) => {\n        const res = await this.#editorAPI;\n        return res.setFrameOpacity(id, opacity).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will update the name of a specific frame\n     * @param id the id of a specific frame\n     * @param name the new name that the frame should receive\n     * @returns\n     */\n    rename = async (id: Id, name: string) => {\n        const res = await this.#editorAPI;\n        return res.renameFrame(id, name).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset properties of a specific frame to their original values\n     * @param id the id of the frame that needs to get reset\n     * @returns\n     */\n    reset = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrame(id).then((result) => getEditorResponseData<null>(result));\n    };\n    /**\n     * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n     * to the frame's to be inherited from the parent layout\n     * @param id the id of a specific frame\n     * @returns\n     * @deprecated Use 'resetTransformation' instead\n     */\n    resetX = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n     * to the frame's to be inherited from the parent layout\n     * @param id the id of a specific frame\n     * @returns\n     * @deprecated Use 'resetTransformation' instead\n     */\n    resetY = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n     * to the frame's to be inherited from the parent layout\n     * @param id the id of a specific frame\n     * @returns\n     * @deprecated Use 'resetTransformation' instead\n     */\n    resetRotation = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n     * to the frame's to be inherited from the parent layout\n     * @param id the id of a specific frame\n     * @returns\n     * @deprecated Use 'resetTransformation' instead\n     */\n    resetWidth = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n     * to the frame's to be inherited from the parent layout\n     * @param id the id of a specific frame\n     * @returns\n     * @deprecated Use 'resetTransformation' instead\n     */\n    resetHeight = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the fitMode, position and crop properties of a specific frame to its original value\n     * @param id the id of the frame that needs to get reset\n     * @returns\n     */\n    resetImageFrameFitMode = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetImageFrameFitMode(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated Use `setIsVisible` instead.\n     *\n     * This method will set the visibility property of a specified frame. If set to false the frame will be invisible and vice versa.\n     * @param id the id of the frame that needs to get updated\n     * @param value True means the frame gets visible, false means the frame gets invisible\n     * @returns\n     */\n    setVisibility = async (id: Id, value: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setFrameIsVisible(id, value).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the isVisible property of a specified frame. If set to false the frame will be invisible and vice versa.\n     * @param id the id of the frame that needs to get updated\n     * @param value True means the frame gets visible, false means the frame gets invisible\n     * @returns\n     */\n    setIsVisible = async (id: Id, value: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setFrameIsVisible(id, value).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will remove a specific frame using the Id.\n     * @param id the id of the frame that needs to be deleted\n     * @returns\n     */\n    remove = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.removeFrames([id]).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will remove frames with the given ids.\n     * @param ids an array of ids of the frames to be removed.\n     * @returns\n     */\n    removeFrames = async (ids: Id[]) => {\n        const res = await this.#editorAPI;\n        return res.removeFrames(ids).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will create a new frame of 'type' to the template positioned on the requested\n     * coordinates.\n     * @param type the type of frame to create\n     * @param x X coordinate of the new frame within the template\n     * @param y Y coordinate of the new frame within the template\n     * @param width Width of the new frame within the template\n     * @param height Height of the new frame within the template\n     * @returns the newly created frame's id\n     */\n    create = async (type: FrameTypeEnum, x: number, y: number, width: number, height: number) => {\n        const res = await this.#editorAPI;\n        return res.addFrame(type, x, y, width, height).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method will create a new frame of 'type' type to the template positioned on the requested\n     * coordinates.\n     * @param type the type of frame to create\n     * @param x X coordinate of the new frame within the template\n     * @param y Y coordinate of the new frame within the template\n     * @param width Width of the new frame within the template\n     * @param height Height of the new frame within the template\n     * @returns the newly created shape frame's id\n     */\n    createShapeFrame = async (type: ShapeType, x: number, y: number, width: number, height: number) => {\n        const res = await this.#editorAPI;\n        return res.addFrame(type, x, y, width, height).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method will create a new barcode frame of 'type' type to the layout positioned on the requested\n     * coordinates. Any coordinate that is not specified will default to 'center'.\n     * @param type the type of barcode to create\n     * @param position optional position object where you can specify the x, y of the barcode frame\n     * @returns the newly created barcode frame's id\n     */\n    createBarcodeFrame = async (type: BarcodeType, position?: { x?: number; y?: number }) => {\n        const res = await this.#editorAPI;\n        return res.addBarcodeFrame(type, position?.x, position?.y).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * @experimental This method will add a new component frame to the current layout positioned on the requested\n     * coordinates with the given dimensions. The component is initialized with the provided source.\n     * @param source The source of the component frame\n     * @param x The X coordinate of the new component frame within the layout\n     * @param y The Y coordinate of the new component frame within the layout\n     * @param width The width of the new component frame within the layout\n     * @param height The height of the new component frame within the layout\n     * @returns the newly created component frame's id\n     */\n    createComponentFrame = async (source: ComponentSource, x: number, y: number, width: number, height: number) => {\n        const res = await this.#editorAPI;\n        return res\n            .addComponentFrame(x, y, width, height, JSON.stringify(source))\n            .then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method will duplicate a list of frames\n     * @param ids An array of all ids you want to duplicate\n     * @returns\n     */\n    duplicateFrames = async (ids: Id[]) => {\n        const res = await this.#editorAPI;\n        return res.duplicateFrames(ids).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method sets or removes the image source to the ImageFrame\n     * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n     * @param newImageSource A new image source\n     * @returns\n     */\n    private updateImageSource = async (imageFrameId: Id, src: ImageFrameSource | null) => {\n        const res = await this.#editorAPI;\n        const srcJson = src !== null ? JSON.stringify(src) : null;\n        return res.setImageSource(imageFrameId, srcJson).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method removes the image source from the ImageFrame\n     * @param imageFrameId the id of the imageFrame where an image needs to be removed from\n     */\n    removeImageSource = async (imageFrameId: string) => {\n        return this.updateImageSource(imageFrameId, null);\n    };\n\n    /**\n     * This method will assign an image from a mediaConnector to the correct ImageFrame\n     * @param id Unique Id of the media connector\n     * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n     * @param assetId Unique id of the asset that you want to assign to the imageFrame\n     * @returns\n     */\n    setImageFromConnector = async (imageFrameId: Id, connectorId: Id, assetId: Id) => {\n        const src: ImageFrameConnectorSource = {\n            id: connectorId,\n            assetId,\n            type: ImageSourceTypeEnum.connector,\n        };\n        return this.updateImageSource(imageFrameId, src);\n    };\n\n    /**\n     * This method will assign an image from url to the correct ImageFrame\n     * Make sure the url can be accessed by the editor.\n     * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n     * @param url A valid image uri\n     * @returns\n     */\n    setImageFromUrl = async (imageFrameId: Id, url: string) => {\n        const source: ImageFrameUrlSource = { url: url, type: ImageSourceTypeEnum.url };\n        return this.updateImageSource(imageFrameId, source);\n    };\n\n    /**\n     * This method will set the fitMode property of a specified image frame.\n     * @param imageFrameId the id of the imageFrame that needs to get updated.\n     * @param fitMode the new fitMode that you want to set to the imageFrame.\n     * @returns\n     */\n    setImageFrameFitMode = async (imageFrameId: Id, fitMode: FitMode) => {\n        const res = await this.#editorAPI;\n        return res.setImageFrameFitMode(imageFrameId, fitMode).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the fit mode position property of a specified image frame.\n     * @param imageFrameId the id of the imageFrame that needs to get updated.\n     * @param position the new position that you want to set to the imageFrame.\n     * @returns\n     */\n    setImageFrameFitModePosition = async (imageFrameId: Id, position: FitModePosition) => {\n        const res = await this.#editorAPI;\n        return res\n            .setImageFrameFitModePosition(imageFrameId, position)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated the constrain proportions setter is not supported anymore.\n     *\n     * This method will set the constrainProportions property of a specified frame. If constrainProportionsReadOnly is\n     * true, the frame's constrainProportions property cannot be changed and this method will return an error.\n     *\n     * @param _id the id of the frame that needs to get updated.\n     * @param _constrainProportions The new constraint that you want to set to the frame.\n     * @returns\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    setFrameConstrainProportions = async (_id: Id, _constrainProportions: boolean) => {\n        console.error('setFrameConstrainProportions is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'setFrameConstrainProportions is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * This method will set the vertical alignment property of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param verticalAlign the new vertical alignment to be set to the frame.\n     * @returns\n     */\n    setVerticalAlign = async (id: Id, verticalAlign: VerticalAlign) => {\n        const res = await this.#editorAPI;\n        return res.setVerticalAlignment(id, verticalAlign).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the number of columns property of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param numberOfColumns the number of columns to be set to the frame.\n     * @returns\n     */\n    setNumberOfColumns = async (id: Id, numberOfColumns: number) => {\n        const res = await this.#editorAPI;\n        return res.setNumberOfColumns(id, numberOfColumns).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the column gap property of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param columnGap the column gap value to be set to the frame.\n     * @returns\n     */\n    setColumnGap = async (id: Id, columnGap: string) => {\n        const res = await this.#editorAPI;\n        return res.setColumnGap(id, columnGap).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the min copyFitting property of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new min copyFitting value to be set to the frame.\n     * @returns\n     */\n    setMinCopyfitting = async (id: Id, value: string) => {\n        const res = await this.#editorAPI;\n        return res.setMinCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the max copyFitting property of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new max copyFitting value to be set to the frame.\n     * @returns\n     */\n    setMaxCopyfitting = async (id: Id, value: string) => {\n        const res = await this.#editorAPI;\n        return res.setMaxCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will enable copyFitting on a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new value to be set to the frame.\n     * @returns\n     */\n    setEnableCopyfitting = async (id: Id, value: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setEnableCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the frame minCopyfitting to the frame's original value\n     * @param id the id of a specific frame\n     * @returns\n     */\n    resetMinCopyfitting = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetMinCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the frame maxCopyfitting to the frame's original value\n     * @param id the id of a specific frame\n     * @returns\n     */\n    resetMaxCopyfitting = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetMaxCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the frame enableCopyfitting to the frame's original value\n     * @param id the id of a specific frame\n     * @returns\n     */\n    resetEnableCopyfitting = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetEnableCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the visibility of the shape fill.\n     * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n     * @param enableFill Whether the shape fill is visible.\n     * @returns\n     */\n    setShapeFrameEnableFill = async (shapeFrameId: Id, enableFill: boolean) => {\n        return this.shapeController.setEnableFill(shapeFrameId, enableFill);\n    };\n\n    /**\n     * This method will set the shape fill color of a specified shape frame.\n     * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n     * @param fillColor the new shape fill color that you want to set to the shapeFrame.\n     * @returns\n     */\n    setShapeFrameFillColor = async (shapeFrameId: Id, fillColor: ColorUsage) => {\n        return this.shapeController.setFillColor(shapeFrameId, fillColor);\n    };\n\n    /**\n     * This method will set the visibility of the shape stroke.\n     * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n     * @param enableStroke Whether the shape stroke is visible.\n     * @returns\n     */\n    setShapeFrameEnableStroke = async (shapeFrameId: Id, enableStroke: boolean) => {\n        return this.shapeController.setEnableStroke(shapeFrameId, enableStroke);\n    };\n\n    /**\n     * This method will set the shape stroke color of a specified shape frame.\n     * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n     * @param strokeColor the new shape stroke color that you want to set to the shapeFrame.\n     * @returns\n     */\n    setShapeFrameStrokeColor = async (shapeFrameId: Id, strokeColor: ColorUsage) => {\n        return this.shapeController.setStrokeColor(shapeFrameId, strokeColor);\n    };\n\n    /**\n     * This method will set the shape stroke weight of a specified shape frame.\n     * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n     * @param strokeWeight the new shape stroke weight that you want to set to the shapeFrame.\n     * @returns\n     */\n    setShapeFrameStrokeWeight = async (shapeFrameId: Id, strokeWeight: number) => {\n        return this.shapeController.setStrokeWeight(shapeFrameId, strokeWeight);\n    };\n\n    /**\n     * This method will set the blend mode of a specified frame\n     * @param id the id of a specific frame\n     * @param blendMode the blend mode\n     * @returns\n     */\n    setBlendMode = async (id: Id, blendMode: BlendMode) => {\n        const res = await this.#editorAPI;\n        return res.setFrameBlendMode(id, blendMode).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will make the specified image frame go into cropping mode.\n     * @param id the id of a specific image frame\n     * @param type the type of cropping mode to enter. Defaults to frameCrop.\n     * @returns\n     */\n    enterCropMode = async (id: Id, type: CropType = CropType.frameCrop) => {\n        const res = await this.#editorAPI;\n        return res.enterCropMode(id, type).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will exit cropping mode while saving the applied crop.\n     * @returns\n     */\n    applyCropMode = async () => {\n        const res = await this.#editorAPI;\n        return res.applyCropMode().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will exit cropping mode without saving the applied crop.\n     * @returns\n     */\n    exitCropMode = async () => {\n        const res = await this.#editorAPI;\n        return res.cancelCropMode().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will make the specified image frame go into subject mode.\n     * @param id the id of a specific image frame\n     * @returns\n     */\n    enterSubjectMode = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.enterSubjectMode(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will exit subject mode while saving the applied subject area.\n     * @returns\n     */\n    applySubjectMode = async () => {\n        const res = await this.#editorAPI;\n        return res.applySubjectMode().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will exit subject mode without saving the applied subject area.\n     * @returns\n     */\n    exitSubjectMode = async () => {\n        const res = await this.#editorAPI;\n        return res.cancelSubjectMode().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will make the specified shape frame go into gradient mode.\n     * @param id the id of a specific shape frame\n     * @returns\n     */\n    enterGradientMode = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.enterGradientMode(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will exit gradient mode while saving the applied gradient.\n     * @returns\n     */\n    applyGradientMode = async () => {\n        const res = await this.#editorAPI;\n        return res.applyGradientMode().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will exit gradient mode without saving the applied gradient.\n     * @returns\n     */\n    cancelGradientMode = async () => {\n        const res = await this.#editorAPI;\n        return res.cancelGradientMode().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated This method no longer has any effect. Use 'setImageFrameFitMode' or 'resetImageFrameFitMode' instead\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    resetCropMode = async (_id: Id) => {\n        console.error('resetCropMode is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'resetCropMode is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * This method will enable auto grow on a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new value to be set to the frame.\n     * @returns\n     */\n    setEnableAutoGrow = async (id: Id, value: boolean) => {\n        const update: AutoGrowDeltaUpdate = { enabled: { value: value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateAutoGrowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the minWidth for auto-grow of a specified frame. Set to null to remove the value.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new minWidth value to be set\n     * @returns\n     */\n    setAutoGrowMinWidth = async (id: Id, value: string | null) => {\n        const update: AutoGrowDeltaUpdate = { minWidth: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateAutoGrowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the maxWidth for auto-grow of a specified frame. Set to null to remove the value.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new maxWidth value to be set\n     * @returns\n     */\n    setAutoGrowMaxWidth = async (id: Id, value: string | null) => {\n        const update: AutoGrowDeltaUpdate = { maxWidth: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateAutoGrowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the minHeight for auto-grow of a specified frame. Set to null to remove the value.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new minHeight value to be set\n     * @returns\n     */\n    setAutoGrowMinHeight = async (id: Id, value: string | null) => {\n        const update: AutoGrowDeltaUpdate = { minHeight: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateAutoGrowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the maxHeight for auto-grow of a specified frame. Set to null to remove the value.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new maxHeight value to be set\n     * @returns\n     */\n    setAutoGrowMaxHeight = async (id: Id, value: string | null) => {\n        const update: AutoGrowDeltaUpdate = { maxHeight: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateAutoGrowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the auto grow directions for auto-grow of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new directions value to be set\n     * @returns\n     */\n    setAutoGrowDirections = async (id: Id, value: Array<AutoGrowDirection>) => {\n        const update: AutoGrowDeltaUpdate = { directions: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateAutoGrowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    resetAutoGrowSettingsEnabled = async (_id: Id) => {\n        console.error('resetAutoGrowSettingsEnabled is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'resetAutoGrowSettingsEnabled is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    resetAutoGrowMinWidth = async (_id: Id) => {\n        console.error('resetAutoGrowMinWidth is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'resetAutoGrowMinWidth is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    resetAutoGrowMaxWidth = async (_id: Id) => {\n        console.error('resetAutoGrowMaxWidth is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'resetAutoGrowMaxWidth is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    resetAutoGrowMinHeight = async (_id: Id) => {\n        console.error('resetAutoGrowMinHeight is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'resetAutoGrowMinHeight is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    resetAutoGrowMaxHeight = async (_id: Id) => {\n        console.error('resetAutoGrowMaxHeight is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'resetAutoGrowMaxHeight is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    resetAutoGrowDirections = async (_id: Id) => {\n        console.error('resetAutoGrowDirections is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'resetAutoGrowDirections is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n     */\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    resetAutoGrow = async (_id: Id) => {\n        console.error('resetAutoGrow is not supported anymore');\n\n        const res: EditorResponse<null> = {\n            success: false,\n            status: 0,\n            error: 'resetAutoGrow is not supported anymore',\n            parsedData: null,\n        };\n\n        return getEditorResponseData<null>(res);\n    };\n\n    /**\n     * This method will enable shadow on a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new value to be set to the frame.\n     * @returns\n     */\n    setShadowEnabled = async (id: Id, value: boolean) => {\n        const update: ShadowSettingsDeltaUpdate = { enabled: { value: value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameShadowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the distance for shadow of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new distance value to be set\n     * @returns\n     */\n    setShadowDistance = async (id: Id, value: string) => {\n        const update: ShadowSettingsDeltaUpdate = { distance: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameShadowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the angle in degrees for shadow of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new angle value to be set\n     * @returns\n     */\n    setShadowAngleDegrees = async (id: Id, value: number) => {\n        const update: ShadowSettingsDeltaUpdate = { angleDegrees: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameShadowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the blur radius for shadow of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new blur radius value to be set\n     * @returns\n     */\n    setShadowBlurRadius = async (id: Id, value: number) => {\n        const update: ShadowSettingsDeltaUpdate = { blurRadius: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameShadowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the color for shadow of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new color value to be set\n     * @returns\n     */\n    setShadowColor = async (id: Id, value: ColorUsage) => {\n        const update: ShadowSettingsDeltaUpdate = { color: { value } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameShadowSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    private setAnchor = async (\n        id: Id,\n        horizontal: boolean,\n        anchorType: FrameAnchorType,\n        anchorTarget: AnchorTarget,\n        endAnchorTarget?: AnchorTarget | null,\n    ) => {\n        const properties: FrameAnchorProperties = {\n            horizontal: horizontal,\n            type: anchorType,\n            target: anchorTarget,\n            endTarget: endAnchorTarget,\n        };\n\n        const res = await this.#editorAPI;\n        return res\n            .setAnchorProperties(id, JSON.stringify(properties))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @experimental\n     * This method will set the vertical anchor to target frame on a specified frame.\n     * @param id the id of the frame that needs to get a frame anchor set\n     * @param anchorType the type of positioning to be set to the frame\n     * @param anchorTarget the target frame to which it is anchored\n     * @param endAnchorTarget the target (end) frame to which it can be anchored\n     * @returns\n     */\n    setVerticalAnchor = async (\n        id: Id,\n        anchorType: FrameAnchorType,\n        anchorTarget: AnchorTarget,\n        endAnchorTarget?: AnchorTarget | null,\n    ) => {\n        return this.setAnchor(id, false, anchorType, anchorTarget, endAnchorTarget);\n    };\n\n    /**\n     * @experimental\n     * This method will set the horizontal anchor to target frame on a specified frame.\n     * @param id the id of the frame that needs to get a frame anchor set\n     * @param anchorType the type of positioning to be set to the frame\n     * @param anchorTarget the target frame to which it is anchored\n     * @param endAnchorTarget the target (end) frame to which it can be anchored\n     * @returns\n     */\n    setHorizontalAnchor = async (\n        id: Id,\n        anchorType: FrameAnchorType,\n        anchorTarget: AnchorTarget,\n        endAnchorTarget?: AnchorTarget | null,\n    ) => {\n        return this.setAnchor(id, true, anchorType, anchorTarget, endAnchorTarget);\n    };\n\n    /**\n     * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n     * to the frame's to be inherited from the parent layout\n     * @param id the id of a specific frame\n     * @returns\n     * @deprecated Use 'resetTransformation' instead\n     */\n    resetAnchoring = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the isVisible property of a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @returns\n     */\n    resetVisibility = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.setFrameIsVisible(id, null).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will get the frame configuration for a specified frame.\n     *\n     * A frame configuration is a set of rules that define what is allowed to\n     * do with a given behavior of a frame.\n     *\n     * e.g. list of allowed frame targets for a specific anchor\n     *\n     * @param id the id of the frame to get the frame configuration for\n     * @returns the frame's configuration\n     */\n    getConfiguration = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getFrameConfiguration(id).then((result) => getEditorResponseData<FrameConfiguration>(result));\n    };\n\n    /**\n     * This method will set the crop override for the current asset for the specified frame\n     * @param id the id of the frame that holds the override to reset\n     * @returns\n     */\n    resetAssetCropOverride = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetAssetCropOverride(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset all crop overrides for the specified frame\n     * @param id the id of the frame\n     * @returns\n     */\n    resetAllAssetCropOverrides = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetAllAssetCropOverrides(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will enable/disable gradient on a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new value to be set to the frame.\n     * @returns\n     */\n    setGradientApplied = async (id: Id, value: boolean) => {\n        const update: GradientDeltaUpdate = { isApplied: value };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameGradientSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will update (or set) the local gradient on a specified frame.\n     * @param id the id of the frame that needs to get updated\n     * @param value the new value to be set to the frame.\n     * @returns\n     */\n    setLocalGradient = async (id: Id, value: GradientUpdate) => {\n        const update: GradientDeltaUpdate = { gradient: value };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameGradientSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will update (or set) the frame to use the provided brand kit gradient\n     * @param id the id of the frame that needs to get updated\n     * @param value the id of an existing brandkit gradient\n     * @returns\n     */\n    setBrandKitGradient = async (id: Id, value: Id) => {\n        const update: GradientDeltaUpdate = { id: value };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameGradientSettings(id, JSON.stringify(update))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n}\n\nexport class FrameConstraintController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method will retrieve all constraints for a specified frame\n     * @param id the id of the frame that we want to know the constraints from\n     * @returns the constraints configuration for the frame\n     */\n    get = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getFrameConstraints(id).then((result) => getEditorResponseData<FrameConstraints>(result));\n    };\n\n    /**\n     * This method will set the selectable constraint for a specified frame\n     * @param id the id of the frame that needs to get updated\n     * @param allowed whether the frame is selectable or not\n     * @returns\n     */\n    setSelectable = async (id: Id, allowed: boolean) => {\n        const deltaUpdate: FrameConstraintsDeltaUpdate = { selectionAllowed: { value: allowed } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the horizontal movement constraint for a specified frame\n     * @param id the id of the frame that needs to get updated\n     * @param allowed whether horizontal movement is allowed or not\n     * @returns\n     */\n    setHorizontalMovement = async (id: Id, allowed: boolean) => {\n        const deltaUpdate: FrameConstraintsDeltaUpdate = { horizontalMovementAllowed: { value: allowed } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the vertical movement constraint for a specified frame\n     * @param id the id of the frame that needs to get updated\n     * @param allowed whether vertical movement is allowed or not\n     * @returns\n     */\n    setVerticalMovement = async (id: Id, allowed: boolean) => {\n        const deltaUpdate: FrameConstraintsDeltaUpdate = { verticalMovementAllowed: { value: allowed } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the rotation constraint for a specified frame\n     * @param id the id of the frame that needs to get updated\n     * @param allowed whether rotation is allowed or not\n     * @returns\n     */\n    setRotation = async (id: Id, allowed: boolean) => {\n        const deltaUpdate: FrameConstraintsDeltaUpdate = { rotationAllowed: { value: allowed } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the resize constraint for a specified frame\n     * @param id the id of the frame that needs to get updated\n     * @param allowed whether resize is allowed or not\n     * @param proportionLocked whether the frame's proportions are locked or not\n     * @returns\n     */\n    setResize = async (id: Id, allowed: boolean, proportionLocked?: boolean) => {\n        const deltaUpdate: FrameConstraintsDeltaUpdate = {\n            resizeAllowed: { value: allowed },\n            ...(proportionLocked !== undefined && { proportionLocked: { value: proportionLocked } }),\n        };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the crop constraint for a specified frame\n     * @param id the id of the frame that needs to get updated\n     * @param allowed whether crop is allowed or not\n     * @returns\n     */\n    setCrop = async (id: Id, allowed: boolean) => {\n        const deltaUpdate: FrameConstraintsDeltaUpdate = { cropAllowed: { value: allowed } };\n        const res = await this.#editorAPI;\n        return res\n            .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import engineInfo from '../../editor-engine.json';\nimport sdkInfo from '../../package.json';\n\n/**\n * The InfoController is responsible for getting info on the engine, like version f.e. .\n * Methods and properties inside this controller can be accessed by `window.SDK.engine.{name}`\n */\nexport class InfoController {\n    /**\n     * This property returns the current engine version.\n     * @returns current engine version\n     */\n    currentEngineVersion = engineInfo.current;\n\n    /**\n     * @returns The currently applicable SDK version\n     */\n    currentSDKVersion = sdkInfo.version;\n}\n","import { CallSender } from 'penpal';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport type { EditorAPI, EditorRawAPI, EditorResponse, Id, PrivateData } from '../types/CommonTypes';\nimport {\n    BleedDeltaUpdate,\n    Layout,\n    LayoutIntent,\n    LayoutPreset,\n    PositionEnum,\n    ResizableLayoutPropertiesUpdate,\n    SelectLayoutOptions,\n    LayoutOptionPageSize,\n    MeasurementUnit,\n} from '../types/LayoutTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n/**\n * The LayoutController is responsible for all communication regarding Layouts.\n * Methods inside this controller can be called by `window.SDK.layout.{method-name}`\n */\nexport class LayoutController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    #blobAPI: EditorRawAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n    }\n\n    /**\n     * This method returns the list of layouts\n     * @returns list of all layouts\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getLayouts().then((result) => getEditorResponseData<Layout[]>(result));\n    };\n\n    /**\n     * This method returns a layout by its id\n     * @param id the id of a specific layout\n     * @returns layout properties\n     */\n    getById = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getLayoutById(id).then((result) => getEditorResponseData<Layout>(result));\n    };\n\n    /**\n     * This method returns a layout by its name\n     * @param name the name of a specific layout\n     * @returns layout properties\n     */\n    getByName = async (name: string) => {\n        const res = await this.#editorAPI;\n        return res.getLayoutByName(name).then((result) => getEditorResponseData<Layout>(result));\n    };\n\n    /**\n     * This method returns the selected layout\n     * @returns layout properties\n     */\n    getSelected = async () => {\n        const res = await this.#editorAPI;\n        return res.getSelectedLayout().then((result) => getEditorResponseData<Layout>(result));\n    };\n\n    /**\n     * This method will remove a specific layout\n     * @param id the id of a specific layout\n     * @returns\n     */\n    remove = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.removeLayout(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will create a new child layout (a new layout is always child of a root / parent)\n     * @param parentId the id of a specific layout, being the parent\n     * @returns id of new layout\n     */\n    create = async (parentId: Id, presets?: LayoutPreset[]) => {\n        const res = await this.#editorAPI;\n\n        if (presets?.length) {\n            return res\n                .addLayouts(parentId, JSON.stringify(presets))\n                .then((result) => getEditorResponseData<Id>(result));\n        }\n\n        return res.addLayout(parentId).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method will update the name of a specific layout\n     * @param id the id of a specific layout\n     * @param name the new name that the layout should receive\n     * @returns\n     */\n    rename = async (id: Id, name: string) => {\n        const res = await this.#editorAPI;\n        return res.renameLayout(id, name).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will select a specific layout\n     * @param id the id of a specific layout\n     * @returns\n     */\n    select = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.selectLayoutWithOptions(id, null).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will select a specific layout and set the page size to the provided value. Note that\n     * the same limitations that apply to PageController.setSize also apply here.\n     * @param id the id of a specific layout\n     * @param pageSize the new page size that will be applied when selecting the layout\n     * @returns\n     */\n    selectWithPageSize = async (id: Id, pageSize: LayoutOptionPageSize) => {\n        const res = await this.#editorAPI;\n        const options: SelectLayoutOptions = {\n            pageSize: pageSize,\n        };\n        return res\n            .selectLayoutWithOptions(id, JSON.stringify(options))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will duplicate a specific layout\n     * @param id the id of a specific layout\n     * @returns id of specific layout\n     */\n    duplicate = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.duplicateLayout(id).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method will reset a specific layout to its original value\n     * @param id the id of a specific layout\n     * @returns\n     */\n    reset = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetLayout(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the height of the layout to a specific value\n     * @param id the id of a specific layout\n     * @param height the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n     * @returns\n     */\n    setHeight = async (id: Id, height: string) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutHeight(id, height).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the width of the layout to a specific value\n     * @param id the id of a specific layout\n     * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n     * @returns\n     */\n    setWidth = async (id: Id, width: string) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutWidth(id, width).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the unit of the layout to a specific value\n     *\n     * @param id The id of a specific layout\n     * @param unit the unit that will be used for the layout. All values in this layout will now be reported in this unit\n     * @returns\n     */\n    setUnit = async (id: Id, unit: MeasurementUnit) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutUnit(id, unit).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the height of a specific layout to its original value\n     * @param id the id of a specific layout\n     * @returns\n     */\n    resetHeight = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetLayoutHeight(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the width of a specific layout to its original value\n     * @param id the id of a specific layout\n     * @returns\n     */\n    resetWidth = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetLayoutWidth(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the unit of a specific layout to its original (inherited) value\n     * @param id the id of a specific layout\n     * @returns\n     */\n    resetUnit = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetLayoutUnit(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated\n     * This method returns a UInt8Array containing a PNG encoded image of the currently selected layout.\n     * This method is deprecated, please use getSnapshot in the PageController\n     * @returns UInt8Array snapshot of the current layout\n     */\n    getSelectedSnapshot = async () => {\n        const res = await this.#blobAPI;\n        return res.getPageSnapshot().then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n    };\n\n    /**\n     * This method sets the intent of a specific layout. Note that setting the intent for a layout\n     * can have side-effects such as updating the measurement unit\n     * @param id the id of a specific layout\n     * @param intent the intent that will be used for the layout\n     */\n    setIntent = async (id: Id, intent: LayoutIntent) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutIntent(id, intent).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method resets the intent of a specific layout to its original (inherited) value.\n     * Note: Calling this on the top layout is not valid\n     *\n     * @param id The id of the (child) layout to reset the intent for\n     */\n    resetIntent = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetLayoutIntent(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the fill color of a specific layout.\n     * Note: Depending on the layout intent, some colors might not be valid (eg opacity for digitalAnimated, any color for print)\n     *\n     * @param id the id of a specific layout\n     * @param color the color that will be used for the layout\n     */\n    setFillColor = async (id: Id, color: ColorUsage) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutFillColor(id, JSON.stringify(color)).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This is a convenience method to enable or disable the fill color of a specific layout.\n     * Note: Depending on the layout intent, disabling might not be valid (eg disabling for digitalAnimated)\n     *\n     * @param id the id of a specific layout\n     * @param enabled whether the fill color should be enabled or disabled\n     */\n    setFillColorEnabled = async (id: Id, enabled: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutFillColorEnabled(id, enabled).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method resets the fill color of a specific layout to its original (inherited) value.\n     * Note: Calling this on the top layout is not valid\n     *\n     * @param id The id of the (child) layout to reset the fill color for\n     */\n    resetFillColor = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.resetLayoutFillColor(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the bleed value of a specific layout.\n     * Note: this is only valid on a print layout\n     *\n     * @param id The id of the specific layout\n     * @param value The bleed value\n     * @param position When defined will update the bleed value of a single position,\n     * otherwise will set all positions to the same value. Depending on this parameter\n     * being defined, the `areBleedValuesCombined` will also be updated.\n     */\n    setBleedValue = async (id: Id, value: string, position?: PositionEnum) => {\n        const update: BleedDeltaUpdate = position\n            ? {\n                  left: position === PositionEnum.left ? value : undefined,\n                  top: position === PositionEnum.top ? value : undefined,\n                  right: position === PositionEnum.right ? value : undefined,\n                  bottom: position === PositionEnum.bottom ? value : undefined,\n              }\n            : { left: value, top: value, right: value, bottom: value };\n\n        const res = await this.#editorAPI;\n        return res.updateLayoutBleed(id, JSON.stringify(update)).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the combined state of the bleed values.\n     * Note: this is only valid on a print layout\n     *\n     * @param id The id of the specific layout\n     * @param value Whether the bleed values are combined\n     */\n    setAreBleedValuesCombined = async (id: Id, value: boolean) => {\n        const update: BleedDeltaUpdate = { areBleedValuesCombined: value };\n\n        const res = await this.#editorAPI;\n        return res.updateLayoutBleed(id, JSON.stringify(update)).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will reset the bleed values on the specified layout to its original (inherited) value.\n     * Note: Calling this on the top layout is not valid.\n     *\n     * @param id The id of the (child) layout to reset the bleed values for\n     */\n    resetBleedValues = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.updateLayoutBleed(id, null).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Sets the private data for any layout\n     * @param id the id of the layout to update\n     * @param privateData the private data\n     * @returns\n     */\n    setPrivateData = async (id: string, privateData: PrivateData) => {\n        const res = await this.#editorAPI;\n        return res\n            .setLayoutPrivateData(id, JSON.stringify(privateData))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Gets the private data for any layout\n     * @param id the id of the layout\n     * @returns the private data\n     */\n    getPrivateData = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.getLayoutPrivateData(id).then((result) => getEditorResponseData<PrivateData>(result));\n    };\n\n    /**\n     * Sets the display name for any layout\n     * @param id the id of the layout to update\n     * @param displayName the display name\n     * @returns\n     */\n    setDisplayName = async (id: string, displayName: string) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutDisplayName(id, displayName).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Gets the display name for any layout\n     * @param id the id of the layout\n     * @returns the display name\n     */\n    getDisplayName = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.getLayoutDisplayName(id).then((result) => getEditorResponseData<string>(result));\n    };\n\n    /**\n     * Resets the display name for any layout\n     * @param id the id of the layout to update\n     * @returns\n     */\n    resetDisplayName = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutDisplayName(id, null).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the layout availability for end-users\n     *\n     * @param id The id of a specific layout\n     * @param isAvailable whether this layout is available for end-users\n     * @returns\n     */\n    setAvailableForUser = async (id: Id, isAvailable: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutAvailableForUser(id, isAvailable).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the user selected layout\n     *\n     * @param id The id of a specific layout\n     * @param isSelected whether this layout is selected by end-users\n     * @returns\n     */\n    setSelectedByUser = async (id: Id, isSelected: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setLayoutSelectedByUser(id, isSelected).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the layout size boundaries for end-users\n     *\n     * @param id The id of a specific layout\n     * @param resizableLayoutProperties the new layout size boundaries\n     * @returns\n     */\n    setResizableByUser = async (id: Id, resizableLayoutProperties: ResizableLayoutPropertiesUpdate) => {\n        const res = await this.#editorAPI;\n        return res\n            .setLayoutResizableByUser(id, JSON.stringify(resizableLayoutProperties))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { Media as GenericMedia, MediaDetail as GenericMediaDetail } from '@chili-studio/connector-types';\nimport { MediaType } from './ConnectorTypes';\nexport type { MediaConnectorCapabilities } from '@chili-studio/connector-types';\n\nexport enum MediaDownloadType {\n    thumbnail = 'thumbnail',\n    mediumres = 'mediumres',\n    highres = 'highres',\n    original = 'original',\n}\n\nexport enum MediaDownloadIntent {\n    web = 'web',\n    print = 'print',\n    animation = 'animation',\n}\n\nexport type Media = GenericMedia<MediaType>;\nexport type MediaDetail = GenericMediaDetail<MediaType>;\n","import { CallSender } from 'penpal';\nimport { EditorAPI, EditorRawAPI, EditorResponse, Id } from '../types/CommonTypes';\nimport {\n    ConnectorConfigOptions,\n    DeprecatedMediaConnectorDownloadType,\n    DeprecatedMediaType,\n    FilePointer,\n    MediaType,\n    MetaData,\n    QueryOptions,\n    QueryPage,\n} from '../types/ConnectorTypes';\nimport {\n    Media,\n    MediaConnectorCapabilities,\n    MediaDetail,\n    MediaDownloadIntent,\n    MediaDownloadType,\n} from '../types/MediaConnectorTypes';\nimport { getEditorResponseData, throwEditorResponseError } from '../utils/EditorResponseData';\n\n/**\n * The MediaConnectorController is responsible for all communication regarding media connectors.\n * Methods inside this controller can be called by `window.SDK.mediaConnector.{method-name}`\n *\n * The way GraFx Studio handles different sources of media is called 'MediaConnector'.\n * A MediaConnector is an implementation of a set of capabilities we need\n * to interact with a certain Digital Asset Management system.\n * In essence, a connector is the combination of a JavaScript snippet and some metadata.\n * The JavaScript snippet is loaded in the studio engine using a sandboxed JavaScript execution engine (QuickJs).\n * This allows us to execute the media connector\n * both on web using webassembly and on the server side during e.g. animation output generation.\n * This controller is an interface to the running connector instance inside the studio engine.\n */\nexport class MediaConnectorController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    #blobAPI: EditorRawAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n    }\n\n    /**\n     * Query a specific MediaConnector for data using both standardized queryOptions and the dynamic\n     * context as parameters. This call returns an array of Media items.\n     * @param id unique id of the media connector\n     * @param queryOptions stringified instance of `QueryOptions`\n     * @param context context that will be available in the connector script.\n     * @returns array of Media items\n     */\n    query = async (id: Id, queryOptions: QueryOptions, context: MetaData = {}) => {\n        const res = await this.#editorAPI;\n        return res\n            .mediaConnectorQuery(id, JSON.stringify(queryOptions), JSON.stringify(context))\n            .then((result) => getEditorResponseData<QueryPage<Media>>(result));\n    };\n\n    /**\n     * Returns a single media using a specific MediaConnector.\n     *\n     * The connector needs to list `detail` as a supported capability.\n     * @param id unique id of the Media connector\n     * @param mediaId unique id of the Media\n     * @param context context that will be available in the connector script.\n     * @returns Media item\n     */\n    detail = async (id: Id, mediaId: string, context: MetaData = {}) => {\n        const res = await this.#editorAPI;\n        return res\n            .mediaConnectorDetail(id, mediaId, JSON.stringify(context))\n            .then((result) => getEditorResponseData<MediaDetail>(result));\n    };\n\n    /**\n     * The combination of a `connectorId` and `mediaId` is typically enough for a media connector to\n     * perform the download of this asset. The `download` endpoint is capable of relaying this information to the\n     * media connector instance running in the editor engine.\n     * @param id unique id of the media connector\n     * @param mediaId unique id of the media to download\n     * @param downloadType hint to the media connector about desired quality of the downloaded media\n     * @param context context that will be available in the connector script.\n     * @returns\n     */\n    download = async (id: Id, mediaId: Id, downloadType: MediaDownloadType, context: MetaData = {}) => {\n        const compatibleDownloadType = this.parseDeprecatedMediaDownloadType(\n            downloadType as unknown as DeprecatedMediaConnectorDownloadType,\n        ) as MediaDownloadType;\n        const res = await this.#blobAPI;\n\n        return res\n            .mediaConnectorDownload(\n                id,\n                mediaId,\n                compatibleDownloadType,\n                MediaDownloadIntent.web,\n                JSON.stringify(context),\n            )\n            .then((result) => {\n                // Handle binary data (Uint8Array) directly\n                if (result instanceof Uint8Array) {\n                    return result;\n                }\n\n                // Handle structured response (EditorResponse) for non-success cases\n                if (typeof result === 'object' && result !== null && 'success' in result && !result.success) {\n                    throwEditorResponseError(result as EditorResponse<null>);\n                }\n\n                // Unexpected response type - throw error\n                throw new Error(`Unexpected response type: ${typeof result}.`);\n            });\n    };\n\n    /**\n     * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This\n     * method allows you to discover which mappings are available for a given connector. If you want to use any of these\n     * mappings, they will be available in the `context` parameter of any connector method.\n     * @param id unique id of the media connector\n     * @returns connector mappings\n     */\n    getConfigurationOptions = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res\n            .mediaConnectorGetConfigurationOptions(id)\n            .then((result) => getEditorResponseData<ConnectorConfigOptions>(result));\n    };\n\n    /**\n     * This method returns what capabilities the selected connector has. It gives an indication what methods can\n     * be used successfully for a certain connector.\n     * @param id unique id of the media connector\n     * @returns MediaConnectorCapabilities\n     */\n    getCapabilities = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res\n            .mediaConnectorGetCapabilities(id)\n            .then((result) => getEditorResponseData<MediaConnectorCapabilities>(result));\n    };\n\n    /**\n     * This method will parse the deprecatedMediaType to the new media type. This method will be removed once the deprecatedMediaType is out of use\n     * @param deprecatedType is 0 or 1\n     * @returns connector capabilities\n     */\n    parseDeprecatedMediaType = (deprecatedType: DeprecatedMediaType) => {\n        if (deprecatedType === DeprecatedMediaType.file) return MediaType.file;\n        if (deprecatedType === DeprecatedMediaType.collection) return MediaType.collection;\n    };\n\n    /**\n     * This method will parse the deprecatedMediaDownloadType to the new media download type.\n     * This method will be removed once the deprecatedMediaDownloadType is out of use\n     * @param deprecatedMediaDownloadType legacy download type\n     * @returns MediaDownloadType\n     */\n    parseDeprecatedMediaDownloadType(\n        deprecatedMediaDownloadType: DeprecatedMediaConnectorDownloadType,\n    ): MediaDownloadType {\n        switch (deprecatedMediaDownloadType) {\n            case DeprecatedMediaConnectorDownloadType.HighResolutionWeb:\n                return MediaDownloadType.highres;\n            case DeprecatedMediaConnectorDownloadType.LowResolutionWeb:\n                return MediaDownloadType.thumbnail;\n            default:\n                return deprecatedMediaDownloadType as unknown as MediaDownloadType;\n        }\n    }\n\n    /**\n     * Invokes the upload on the connector, using the given staged pointer(s).\n     * If you want help with staging files, use the `stageFiles` method from the UtilsController.\n     * @param connectorId The MediaConnector instance to use (just like download API).\n     * @param filePointers Array of FilePointer as staged by stageFile(s).\n     * @param context Arbitrary metadata/context for the upload (auth, meta fields, etc).\n     * @returns Promise<Media[]>\n     */\n    upload = async (connectorId: Id, filePointers: FilePointer[], context: MetaData = {}) => {\n        const res = await this.#editorAPI;\n        return res\n            .mediaConnectorUpload(connectorId, JSON.stringify(filePointers), JSON.stringify(context))\n            .then((result) => getEditorResponseData<Media[]>(result));\n    };\n}\n","import { EditorAPI, EditorRawAPI, EditorResponse, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { Page, SnapshotSettings } from '../types/PageTypes';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    #blobAPI: EditorRawAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n    }\n\n    /**\n     * @experimental\n     * This method adds a new page.\n     * @returns the id of the new page\n     */\n    add = async () => {\n        const res = await this.#editorAPI;\n        return res.addPage().then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * @experimental\n     * This method removes a certain page.\n     * @param pageId the id of the page\n     * @returns the id of the current active page\n     */\n    remove = async (pageId: Id) => {\n        const res = await this.#editorAPI;\n        return res.removePage(pageId).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * @experimental\n     * This method selects a certain page to be the active page.\n     * @param pageId the id of the page\n     * @returns\n     */\n    select = async (pageId: Id) => {\n        const res = await this.#editorAPI;\n        return res.selectPage(pageId).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @experimental\n     * This method sets the page's visibility.\n     * @param pageId the id of the page\n     * @param isVisible the visibility of the page\n     * @returns\n     */\n    setVisibility = async (pageId: Id, isVisible: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setPageIsVisible(pageId, isVisible).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @experimental\n     * This method duplicates a certain page.\n     * @param pageId the id of the page\n     * @returns\n     */\n    duplicate = async (pageId: Id) => {\n        const res = await this.#editorAPI;\n        return res.duplicatePage(pageId).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method returns the list of pages\n     * @returns list of all pages\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getPages().then((result) => getEditorResponseData<Page[]>(result));\n    };\n\n    /**\n     * This method returns a page by its id\n     * @param pageId the id of a specific page\n     * @returns page properties\n     */\n    getById = async (pageId: Id) => {\n        const res = await this.#editorAPI;\n        return res.getPageById(pageId).then((result) => getEditorResponseData<Page>(result));\n    };\n\n    /**\n     * This method returns a UInt8Array containing a PNG encoded image of the page.\n     * @param pageId The id of a specific page.\n     * If not specified, selected page snapshot will be provided\n     * @param settings an object to specify desired snapshot properties, e.g., resolution.\n     * If it's not provided, default settings will be applied, e.g., page resolution.\n     * Limit for `largestAxisSize` is 1000 px\n     * @returns UInt8Array snapshot of the given page\n     */\n    getSnapshot = async (pageId?: Id, settings?: SnapshotSettings | null) => {\n        const res = await this.#blobAPI;\n        return res\n            .getPageSnapshotWithSettings(pageId, settings == null ? null : JSON.stringify(settings))\n            .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n    };\n\n    /**\n     * This method will set the width of the page to a specific value.\n     * This only works if the document is a project.\n     * @param _pageId the id of a specific page.\n     * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n     */\n    setWidth = async (_pageId: Id | undefined, width: string) => {\n        if (_pageId !== undefined) {\n            console.warn('pageId has no effect since all pages are being updated simultaneously.');\n        }\n\n        const res = await this.#editorAPI;\n        return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the height of the page to a specific value.\n     * This only works if the document is a project.\n     * @param _pageId the id of a specific page.\n     * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n     * @returns\n     */\n    setHeight = async (_pageId: Id | undefined, height: string) => {\n        if (_pageId !== undefined) {\n            console.warn('pageId has no effect since all pages are being updated simultaneously.');\n        }\n\n        const res = await this.#editorAPI;\n        return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Sets the width and height of the page to a specific value simultaneously.\n     * This only works if the document is a project.\n     * @param width the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n     * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n     */\n    setSize = async (width: string, height: string) => {\n        const res = await this.#editorAPI;\n        return res.setPageSize(width, height).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method changes the order of pages.\n     * @param order the index in the list to move to\n     * @param ids An array of all IDs you want to move to the given index\n     * @returns\n     */\n    move = async (order: number, ids: Id[]) => {\n        const res = await this.#editorAPI;\n        return res.reorderPages(order, ids).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ParagraphStyle, ParagraphStyleUpdate } from '../types/ParagraphStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ParagraphStyleController is responsible for all communication regarding paragraph styles.\n * Methods inside this controller can be called by `window.SDK.paragraphStyle.{method-name}`\n */\nexport class ParagraphStyleController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method returns the list of paragraph styles\n     * @returns\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getParagraphStyles().then((result) => getEditorResponseData<ParagraphStyle[]>(result));\n    };\n\n    /**\n     * This method returns a paragraph style by id\n     * @param id the id of a specific paragraph style\n     * @returns\n     */\n    getById = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getParagraphStyleById(id).then((result) => getEditorResponseData<ParagraphStyle>(result));\n    };\n\n    /**\n     * This method creates a new paragraph style\n     * @returns the id of new paragraph style\n     */\n    create = async () => {\n        const res = await this.#editorAPI;\n        return res.createParagraphStyle().then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method duplicates a paragraph style\n     * @param id the id of a specific paragraph style\n     * @returns the new paragraph style id\n     */\n    duplicate = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.duplicateParagraphStyle(id).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method updates a paragraph style\n     * @param id the id of a specific paragraph style\n     * @param properties The new paragraph style properties\n     * @returns\n     */\n    update = async (id: Id, properties: ParagraphStyleUpdate) => {\n        const res = await this.#editorAPI;\n        return res\n            .updateParagraphStyle(id, JSON.stringify(properties))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method renames a paragraph style\n     * @param id the id of a specific paragraph style\n     * @param name the new name of the paragraph style\n     * @returns\n     */\n    rename = async (id: Id, name: string) => {\n        const res = await this.#editorAPI;\n        return res.renameParagraphStyle(id, name).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method removes a paragraph style\n     * @param id the id of a specific paragraph style\n     * @returns\n     */\n    remove = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.removeParagraphStyle(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method changes positions of paragraph styles\n     * @param order the position of the paragraph styles\n     * @param ids the list of paragraph style ids\n     * @returns\n     */\n    move = async (order: number, ids: Id[]) => {\n        const res = await this.#editorAPI;\n        return res.moveParagraphStyles(order, ids).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { CallSender } from 'penpal';\nimport { ActionEditorEvent, ConnectorInstance, DocumentAction, DocumentFontFamily, ToolType, ViewMode } from '..';\nimport { EngineCallbackHandler } from '../utils/EngineCallbackHandler';\nimport { EngineEvent } from '../utils/EngineEvent';\nimport { AnimationPlaybackType, FrameAnimationType } from './AnimationTypes';\nimport { BarcodeFrameValidationResult } from './BarcodeTypes';\nimport { CharacterStyle } from './CharacterStyleTypes';\nimport { DocumentColor } from './ColorStyleTypes';\nimport { StudioOptionsDeltaUpdate, StudioStyling } from './ConfigurationTypes';\nimport { AuthCredentials, AuthRefreshRequest, ConnectorEvent } from './ConnectorTypes';\nimport { DocumentIssue, DocumentType, UndoState } from './DocumentTypes';\nimport { EngineEditMode } from './EngineEditModeTypes';\nimport type { FrameType } from './FrameTypes';\nimport { Frame, FrameLayoutType, FrameTypeEnum } from './FrameTypes';\nimport { LayoutListItemType, LayoutPropertiesType, LayoutWithFrameProperties, MeasurementUnit } from './LayoutTypes';\nimport { Page, PageSize } from './PageTypes';\nimport { ParagraphStyle } from './ParagraphStyleTypes';\nimport { CornerRadiusUpdateModel } from './ShapeTypes';\nimport { SelectedTextStyle } from './TextStyleTypes';\nimport { Variable } from './VariableTypes';\nimport { Viewport } from './ViewportTypes';\nimport { BrandKitMedia } from './BrandKitTypes';\n\nexport type Id = string;\nexport type BaseConfigType = {\n    editorLink?: string;\n    editorId?: string;\n    chiliEnvironmentUrl?: string;\n    documentType?: DocumentType;\n    studioStyling?: StudioStyling;\n    studioOptions?: StudioOptionsDeltaUpdate;\n    /**\n     * Whether the engine should cache query calls.\n     * When enabled it will cache the query calls regardless of the cache control headers.\n     */\n    enableQueryCallCache?: boolean;\n    enableNextSubscribers?: {\n        onVariableListChanged: boolean;\n    };\n    logging?: {\n        logLevel?: LogLevel;\n        logger?: LoggerFunction;\n    };\n    /**\n     * Callback function that is called when an error occurs during iframe setup or connection.\n     * @param error The error that occurred during setup or connection\n     */\n    onConnectionError?: (error: Error) => void;\n};\n\nexport type LoggerFunction = (logLevel: LogLevel, category: LogCategory, message: string) => void;\n\nexport enum LogLevel {\n    info = 'info',\n    warn = 'warn',\n    error = 'error',\n}\n\nexport enum LogCategory {\n    general = 'general',\n    connector = 'connector',\n    event = 'event',\n    engine = 'engine',\n}\n\n/**\n * Defines the behavior when encountering an error in the event / handler callback.\n */\nexport enum CallbackErrorBehavior {\n    /**\n     * Throws an error when encountering an error in a callback.\n     */\n    throw = 'throw',\n\n    /**\n     * Logs the error when encountering an error in a callback.\n     */\n    log = 'log',\n}\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type ManagedCallbacksConfigType = {\n    handlers: {\n        onAuthExpired: EngineCallbackHandler<\n            (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>\n        >;\n        onViewportRequested: EngineCallbackHandler<() => Viewport | null>;\n    };\n    events: {\n        onActionsChanged: EngineEvent<(state: DocumentAction[]) => MaybePromise<void>>;\n        onStateChanged: EngineEvent<() => MaybePromise<void>>;\n        onDocumentLoaded: EngineEvent<() => MaybePromise<void>>;\n        onSelectedFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n        onFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n        onSelectedFramesContentChanged: EngineEvent<(state: Frame[]) => MaybePromise<void>>;\n        onPageSelectionChanged: EngineEvent<(id: Id) => MaybePromise<void>>;\n        onSelectedLayoutPropertiesChanged: EngineEvent<(state: LayoutPropertiesType) => MaybePromise<void>>;\n        onSelectedLayoutUnitChanged: EngineEvent<(unit: MeasurementUnit) => MaybePromise<void>>;\n        onScrubberPositionChanged: EngineEvent<(state: AnimationPlaybackType) => MaybePromise<void>>;\n        onFrameAnimationsChanged: EngineEvent<(animationState: FrameAnimationType[]) => MaybePromise<void>>;\n        onVariableListChanged: EngineEvent<(variableList: Variable[]) => MaybePromise<void>>;\n        onSelectedToolChanged: EngineEvent<(tool: ToolType) => MaybePromise<void>>;\n        onUndoStackStateChanged: EngineEvent<(undoStackState: UndoState) => MaybePromise<void>>;\n        onSelectedLayoutFramesChanged: EngineEvent<(frames: SelectedLayoutFrame[]) => MaybePromise<void>>;\n        onSelectedTextStyleChanged: EngineEvent<(styles: SelectedTextStyle) => MaybePromise<void>>;\n        onColorsChanged: EngineEvent<(colors: DocumentColor[]) => MaybePromise<void>>;\n        onParagraphStylesChanged: EngineEvent<(paragraphStyles: ParagraphStyle[]) => MaybePromise<void>>;\n        onCharacterStylesChanged: EngineEvent<(characterStyles: CharacterStyle[]) => MaybePromise<void>>;\n        onFontFamiliesChanged: EngineEvent<(fontFamilies: DocumentFontFamily[]) => MaybePromise<void>>;\n        onSelectedLayoutIdChanged: EngineEvent<(layoutId: string) => MaybePromise<void>>;\n        onLayoutsChanged: EngineEvent<(layouts: LayoutListItemType[]) => MaybePromise<void>>;\n        onConnectorEvent: EngineEvent<(event: ConnectorEvent) => MaybePromise<void>>;\n        onConnectorsChanged: EngineEvent<(connectors: ConnectorInstance[]) => MaybePromise<void>>;\n        onZoomChanged: EngineEvent<(scaleFactor: number) => MaybePromise<void>>;\n        onSelectedPageIdChanged: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n        onPagesChanged: EngineEvent<(pages: Page[]) => MaybePromise<void>>;\n        onPageSnapshotInvalidated: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n        onPageSizeChanged: EngineEvent<(pageSize: PageSize) => MaybePromise<void>>;\n        onShapeCornerRadiusChanged: EngineEvent<(cornerRadius: CornerRadiusUpdateModel) => MaybePromise<void>>;\n        onCropActiveFrameIdChanged: EngineEvent<(id?: Id) => MaybePromise<void>>;\n        onAsyncError: EngineEvent<(asyncError: AsyncError) => MaybePromise<void>>;\n        onViewModeChanged: EngineEvent<(tool: ViewMode) => MaybePromise<void>>;\n        onBarcodeValidationChanged: EngineEvent<\n            (validationResults: BarcodeFrameValidationResult[]) => MaybePromise<void>\n        >;\n        onDataSourceIdChanged: EngineEvent<(connectorId?: Id) => MaybePromise<void>>;\n        onDocumentIssueListChanged: EngineEvent<(documentIssues: DocumentIssue[]) => MaybePromise<void>>;\n        onCustomUndoDataChanged: EngineEvent<(customData: Record<string, string>) => MaybePromise<void>>;\n        onEngineEditModeChanged: EngineEvent<(engineEditMode: EngineEditMode) => MaybePromise<void>>;\n        onBrandKitMediaChanged: EngineEvent<(brandKitMedia: BrandKitMedia[]) => MaybePromise<void>>;\n    };\n};\n\nexport type InitialCallbacksConfigType = {\n    /**\n     * @deprecated use `events.onActionsChanged` instead\n     */\n    onActionsChanged?: (state: DocumentAction[]) => void;\n\n    /**\n     * @deprecated use `events.onStateChanged` instead\n     */\n    onStateChanged?: () => void;\n\n    /**\n     * @deprecated use `events.onAuthExpired` instead\n     */\n    onAuthExpired?: (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>;\n\n    /**\n     * @deprecated use `events.onViewportRequested` instead\n     */\n    onViewportRequested?: () => Viewport | null;\n\n    /**\n     * @deprecated use `events.onDocumentLoaded` instead\n     */\n    onDocumentLoaded?: () => void;\n\n    /**\n     * @deprecated use `onSelectedFramesLayoutChanged` instead\n     *\n     */\n    onSelectedFrameLayoutChanged?: (state: FrameLayoutType) => void;\n\n    /**\n     * @deprecated use `events.onSelectedFramesLayoutChanged` instead\n     */\n    onSelectedFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n    /**\n     * @deprecated use `events.onFramesLayoutChanged` instead\n     */\n    onFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n    /**\n     * @deprecated use `onSelectedFramesContentChanged` instead\n     */\n    onSelectedFrameContentChanged?: (state: Frame | null) => void;\n\n    /**\n     * @deprecated use `events.onSelectedFramesContentChanged` instead\n     */\n    onSelectedFramesContentChanged?: (state: Frame[]) => void;\n\n    /**\n     * @deprecated use `onSelectedPageIdChanged` instead\n     */\n    onPageSelectionChanged?: (id: Id) => void;\n\n    /**\n     * @deprecated use `events.onSelectedLayoutPropertiesChanged` instead\n     */\n    onSelectedLayoutPropertiesChanged?: (state: LayoutPropertiesType) => void;\n\n    /**\n     * @deprecated use `events.onSelectedLayoutUnitChanged` instead\n     */\n    onSelectedLayoutUnitChanged?: (unit: MeasurementUnit) => void;\n\n    /**\n     * @deprecated use `events.onScrubberPositionChanged` instead\n     */\n    onScrubberPositionChanged?: (state: AnimationPlaybackType) => void;\n\n    /**\n     * @deprecated use `events.onFrameAnimationsChanged` instead\n     */\n    onFrameAnimationsChanged?: (animationState: FrameAnimationType[]) => void;\n\n    /**\n     * @deprecated use `events.onVariableListChanged` instead\n     */\n    onVariableListChanged?: (variableList: Variable[]) => void;\n\n    /**\n     * @deprecated use `events.onSelectedToolChanged` instead\n     */\n    onSelectedToolChanged?: (tool: ToolType) => void;\n\n    /**\n     * @deprecated use `events.onUndoStackStateChanged` instead\n     */\n    onUndoStackStateChanged?: (undoStackState: UndoState) => void;\n\n    /**\n     * @deprecated use `events.onSelectedLayoutFramesChanged` instead\n     */\n    onSelectedLayoutFramesChanged?: (frames: SelectedLayoutFrame[]) => void;\n\n    /**\n     * @deprecated use `events.onSelectedTextStyleChanged` instead\n     */\n    onSelectedTextStyleChanged?: (styles: SelectedTextStyle) => void;\n\n    /**\n     * @deprecated use `events.onColorsChanged` instead\n     */\n    onColorsChanged?: (colors: DocumentColor[]) => void;\n\n    /**\n     * @deprecated use `events.onParagraphStylesChanged` instead\n     */\n    onParagraphStylesChanged?: (paragraphStyles: ParagraphStyle[]) => void;\n\n    /**\n     * @deprecated use `events.onCharacterStylesChanged` instead\n     */\n    onCharacterStylesChanged?: (characterStyles: CharacterStyle[]) => void;\n\n    /**\n     * @deprecated use `events.onFontFamiliesChanged` instead\n     */\n    onFontFamiliesChanged?: (fontFamilies: DocumentFontFamily[]) => void;\n\n    /**\n     * @deprecated use `events.onSelectedLayoutIdChanged` instead\n     */\n    onSelectedLayoutIdChanged?: (layoutId: string) => void;\n\n    /**\n     * @deprecated use `events.onLayoutsChanged` instead\n     */\n    onLayoutsChanged?: (layouts: LayoutListItemType[]) => void;\n\n    /**\n     * @deprecated use `events.onConnectorEvent` instead\n     */\n    onConnectorEvent?: (event: ConnectorEvent) => void;\n\n    /**\n     * @deprecated use `events.onConnectorsChanged` instead\n     */\n    onConnectorsChanged?: (connectors: ConnectorInstance[]) => void;\n\n    /**\n     * @deprecated use `events.onZoomChanged` instead\n     */\n    onZoomChanged?: (scaleFactor: number) => void;\n\n    /**\n     *\n     * @deprecated use `events.onSelectedPageIdChanged` instead\n     */\n    onSelectedPageIdChanged?: (pageId: Id) => void;\n\n    /**\n     *\n     * @deprecated use `events.onPagesChanged` instead\n     */\n    onPagesChanged?: (pages: Page[]) => void;\n\n    /**\n     *\n     * @deprecated use `events.onPageSnapshotInvalidated` instead\n     */\n    onPageSnapshotInvalidated?: (pageId: Id) => void;\n\n    /**\n     * @deprecated use `events.onPageSizeChanged` instead\n     */\n    onPageSizeChanged?: (pageSize: PageSize) => void;\n\n    /**\n     * @deprecated use `events.onShapeCornerRadiusChanged` instead\n     */\n    onShapeCornerRadiusChanged?: (cornerRadius: CornerRadiusUpdateModel) => void;\n\n    /**\n     * @deprecated use `events.onCropActiveFrameIdChanged` instead\n     */\n    onCropActiveFrameIdChanged?: (id?: Id) => void;\n\n    /**\n     * @deprecated use `events.onAsyncError` instead\n     */\n    onAsyncError?: (asyncError: AsyncError) => void;\n\n    /**\n     * @deprecated use `events.onViewModeChanged` instead\n     */\n    onViewModeChanged?: (tool: ViewMode) => void;\n\n    /**\n     * @deprecated use `events.onBarcodeValidationChanged` instead\n     */\n    onBarcodeValidationChanged?: (validationResults: BarcodeFrameValidationResult[]) => void;\n\n    /**\n     * @deprecated use `events.onDataSourceIdChanged` instead\n     */\n    onDataSourceIdChanged?: (connectorId?: Id) => void;\n\n    /**\n     * @deprecated use `events.onDocumentIssueListChanged` instead\n     */\n    onDocumentIssueListChanged?: (documentIssues: DocumentIssue[]) => void;\n\n    /**\n     * @deprecated use `events.onCustomUndoDataChanged` instead\n     */\n    onCustomUndoDataChanged?: (customData: Record<string, string>) => void;\n\n    /**\n     * @deprecated use `events.onEngineEditModeChanged` instead\n     */\n    onEngineEditModeChanged?: (engineEditMode: EngineEditMode) => void;\n\n    /**\n     * @deprecated use `events.onBrandKitMediaChanged` instead\n     */\n    onBrandKitMediaChanged?: (brandKitMedia: BrandKitMedia[]) => void;\n};\n\nexport type ConfigType = InitialCallbacksConfigType & BaseConfigType;\nexport type RuntimeConfigType = ConfigType & ManagedCallbacksConfigType;\n\nexport type EditorResponseError = string;\n\nexport interface EditorResponse<T> {\n    success: boolean;\n    status: number;\n    data?: string | null;\n    error?: EditorResponseError | null;\n    parsedData: T | null;\n}\n\nexport interface EditorRawAPI extends CallSender {\n    [index: string]: <T>(...args: unknown[]) => Promise<T>;\n}\n\nexport interface EditorAPI extends CallSender {\n    [index: string]: <T>(...args: unknown[]) => Promise<EditorResponse<T>>;\n}\n\nexport type PageType = {\n    id: Id;\n    number: number;\n    width: number | null;\n    height: number | null;\n    frames: FrameType[];\n};\n\nexport type InitialStateType = {\n    layouts: LayoutWithFrameProperties[];\n    selectedLayoutId: Id;\n    pages: PageType[];\n    variables: Variable[];\n};\n\nexport interface PropertyState<T> {\n    value: T;\n    isOverride: boolean;\n    isReadOnly: boolean;\n}\n\nexport interface HasOverrideState {\n    isOverride: boolean;\n    isReadOnly: boolean;\n}\n\nexport interface SelectedLayoutFrame {\n    id: Id;\n    name: string;\n    type: FrameTypeEnum;\n    isVisible: boolean;\n}\nexport interface ActionEventErrorData {\n    event: ActionEditorEvent;\n    actionIds: Id[];\n}\n\ninterface AsyncErrorBase {\n    type: AsyncErrorType;\n    message: string;\n}\n\nexport class ActionAsyncError implements AsyncErrorBase {\n    type: AsyncErrorType;\n    id?: string;\n    event?: ActionEditorEvent;\n    eventChain?: ActionEventErrorData[];\n    message: string;\n\n    constructor(message: string, id?: string, event?: ActionEditorEvent, eventChain?: ActionEventErrorData[]) {\n        this.type = AsyncErrorType.action;\n        this.message = message;\n        this.id = id;\n        this.event = event;\n        this.eventChain = eventChain;\n    }\n}\n\nexport class DataRowAsyncError implements AsyncErrorBase {\n    type: AsyncErrorType;\n    count: number;\n    exceptions: EditorExceptionDto[];\n    message: string;\n\n    constructor(count: number, message: string, exceptions: EditorExceptionDto[]) {\n        this.type = AsyncErrorType.dataRow;\n        this.count = count;\n        this.message = message;\n        this.exceptions = exceptions;\n    }\n}\n\nexport enum AsyncErrorType {\n    action = 'action',\n    dataRow = 'dataRow',\n}\n\nexport interface ExceptionContext {\n    variableId?: Id;\n}\n\nexport interface EditorExceptionDto {\n    type: string;\n    code: number;\n    message: string;\n    context?: ExceptionContext;\n}\n\nexport type AsyncError = ActionAsyncError | DataRowAsyncError;\n\nexport type PrivateData = Record<string, string>;\n","import { Dictionary } from '@chili-studio/connector-types';\nimport { Id, PrivateData } from './CommonTypes';\n\nexport interface ConnectorImageVariableSource {\n    connectorId: string;\n    /**\n     * The requested asset id or name\n     */\n    assetId: string;\n    /**\n     * If the connector was able to query, this will contain\n     * the actual resolved media Id.\n     */\n    resolved?: ResolvedMedia;\n\n    /**\n     * The context of the variable that will be passed to the connector\n     */\n    context: Dictionary;\n}\n\n/**\n * Image variable query lookup result\n */\nexport interface ResolvedMedia {\n    /**\n     * The resolved media Id.\n     * This id can be used to perform the download call.\n     */\n    mediaId: string;\n}\n\nexport enum VariableType {\n    shortText = 'shortText',\n    longText = 'longText',\n    image = 'image',\n    list = 'list',\n    boolean = 'boolean',\n    group = 'group',\n    number = 'number',\n    date = 'date',\n}\n\nexport interface Variable {\n    id: string;\n    type: VariableType;\n    parentId?: string;\n    name: string;\n    label?: string | null;\n    isVisible: boolean;\n    visibility: VariableVisibility;\n    isReadonly: boolean;\n    isRequired: boolean;\n    occurrences: number;\n    placeholder?: string | null;\n    helpText?: string | null;\n    privateData: PrivateData;\n}\n\nexport interface ImageVariable extends Variable {\n    value?: ConnectorImageVariableSource;\n    allowQuery: boolean;\n    allowUpload: boolean;\n    uploadMinHeight?: number | null;\n    uploadMinWidth?: number | null;\n}\n\nexport interface ListVariableItem {\n    value: string;\n    displayValue?: string;\n}\n\nexport interface ListVariable extends Variable {\n    items: string[];\n    selected?: string;\n    prefix?: ValueWithStyle;\n    suffix?: ValueWithStyle;\n}\n\nexport interface BooleanVariable extends Variable {\n    value: boolean;\n}\n\nexport interface ShortTextVariable extends Variable {\n    value: string;\n    removeParagraphIfEmpty: boolean;\n    prefix?: ValueWithStyle;\n    suffix?: ValueWithStyle;\n    isDontBreak: boolean;\n    maxCharacters?: number;\n}\n\nexport interface NumberVariable extends Variable {\n    value: number;\n    numberOfDecimals: number;\n    decimalCharacterStyleId?: string;\n    decimalSeparator: string;\n    thousandsSeparator: string;\n    minValue?: number;\n    maxValue?: number;\n    showStepper: boolean;\n    stepSize: number;\n    prefix?: ValueWithStyle;\n    suffix?: ValueWithStyle;\n}\n\nexport interface DateVariable extends Variable {\n    value?: string;\n    removeParagraphIfEmpty: boolean;\n    displayFormat: string;\n    startDate?: DateRestriction;\n    endDate?: DateRestriction;\n    excludedDays: Day[];\n    locale: Locale;\n    prefix?: ValueWithStyle;\n    suffix?: ValueWithStyle;\n}\n\nexport type LongTextVariable = ShortTextVariable;\n\nexport type GroupVariable = Variable;\n\nexport type DateRestriction = RelativeDate | AbsoluteDate;\n\nexport interface ValueWithStyle {\n    value?: string;\n    style?: string;\n}\n\nexport interface RelativeDate {\n    offset: number;\n    type: 'relative';\n}\n\nexport interface AbsoluteDate {\n    value: string;\n    type: 'absolute';\n}\n\nexport enum Day {\n    Monday = 'monday',\n    Tuesday = 'tuesday',\n    Wednesday = 'wednesday',\n    Thursday = 'thursday',\n    Friday = 'friday',\n    Saturday = 'saturday',\n    Sunday = 'sunday',\n}\n\nexport enum Locale {\n    en_US = 'en_US',\n    cs = 'cs',\n    da = 'da',\n    nl = 'nl',\n    fi = 'fi',\n    fr = 'fr',\n    de = 'de',\n    it = 'it',\n    no = 'no',\n    pl = 'pl',\n    pt_PT = 'pt_PT',\n    es_ES = 'es_ES',\n    sv = 'sv',\n}\n\nexport interface DateVariablePropertiesDeltaUpdate {\n    startDate?: {\n        value: DateRestriction | null;\n    };\n    endDate?: {\n        value: DateRestriction | null;\n    };\n    excludedDays?: {\n        value: Day[] | null;\n    };\n    locale?: {\n        value: Locale;\n    };\n    displayFormat?: {\n        value: string;\n    };\n}\n\nexport interface NumberVariablePropertiesDeltaUpdate {\n    minValue?: {\n        value: number | null;\n    };\n    maxValue?: {\n        value: number | null;\n    };\n    showStepper?: {\n        value: boolean;\n    };\n    stepSize?: {\n        value: number;\n    };\n    numberOfDecimals?: {\n        value: number;\n    };\n    decimalCharacterStyleId?: {\n        value: string | null;\n    };\n    decimalSeparator?: {\n        value: string;\n    };\n    thousandsSeparator?: {\n        value: string;\n    };\n}\n\nexport interface PrefixSuffixDeltaUpdate {\n    prefix?: {\n        value: string | null;\n    };\n    suffix?: {\n        value: string | null;\n    };\n    prefixCharacterStyleId?: {\n        value: string | null;\n    };\n    suffixCharacterStyleId?: {\n        value: string | null;\n    };\n}\n\nexport enum VariableVisibilityType {\n    visible = 'visible',\n    invisible = 'invisible',\n    conditional = 'conditional',\n}\n\nexport enum VariableVisibilityTargetType {\n    boolean = 'boolean',\n    text = 'text',\n    number = 'number',\n}\n\nexport enum VariableVisibilityOperator {\n    equals = '=',\n    notEquals = '!=',\n    greaterThan = '>',\n    greaterThanOrEquals = '>=',\n    lessThan = '<',\n    lessThanOrEquals = '<=',\n}\n\nexport interface VariableVisibilityBase {\n    type: VariableVisibilityType;\n}\n\nexport interface VariableVisibilityVisible extends VariableVisibilityBase {\n    type: VariableVisibilityType.visible;\n}\n\nexport interface VariableVisibilityInvisible extends VariableVisibilityBase {\n    type: VariableVisibilityType.invisible;\n}\n\nexport interface VariableVisibilityConditional extends VariableVisibilityBase {\n    type: VariableVisibilityType.conditional;\n    layouts: VariableVisibilityLayout[];\n    variables: VariableWithValue[];\n}\n\nexport type VariableVisibility =\n    | VariableVisibilityVisible\n    | VariableVisibilityInvisible\n    | VariableVisibilityConditional;\n\nexport interface VariableVisibilityLayout {\n    layoutId: string;\n    includeChildren: boolean;\n}\n\nexport interface VariableWithValue {\n    id: string;\n    value: VariableVisibilityConditionValue;\n}\n\nexport interface VariableVisibilityConditionValueBase {\n    type: VariableVisibilityTargetType;\n}\n\nexport interface VariableVisibilityConditionValueBoolean extends VariableVisibilityConditionValueBase {\n    type: VariableVisibilityTargetType.boolean;\n    value: boolean;\n}\n\nexport interface VariableVisibilityConditionValueText extends VariableVisibilityConditionValueBase {\n    type: VariableVisibilityTargetType.text;\n    value: string;\n    operator: VariableVisibilityOperator;\n}\n\nexport interface VariableVisibilityConditionValueNumber extends VariableVisibilityConditionValueBase {\n    type: VariableVisibilityTargetType.number;\n    value: number;\n    operator: VariableVisibilityOperator;\n}\n\nexport type VariableVisibilityConditionValue =\n    | VariableVisibilityConditionValueBoolean\n    | VariableVisibilityConditionValueText\n    | VariableVisibilityConditionValueNumber;\n\nexport type VariableUsagesReport = {\n    pages: Id[];\n    frames: Id[];\n    actionTrigger: Id[];\n    variables: Id[];\n    outputDataSource: boolean;\n};\n","import { ActionAsyncError, DataRowAsyncError, Id, RuntimeConfigType } from '../types/CommonTypes';\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\nimport { ListVariable, ListVariableItem, Variable, VariableType } from '../types/VariableTypes';\nimport { ViewMode } from '../types/ViewModeTypes';\nimport { ConnectorCompatibilityTools } from '../utils/ConnectorCompatibilityTools';\nimport { ToolType } from '../utils/Enums';\nimport { MeasurementUnit } from '../types/LayoutTypes';\n\n/**\n * The SubscriberController is responsible for all listeners which can influence the application-state from outside.\n * Callbacks inside this controller can be set by `window.SDK.subscriber.{method-name}`\n */\nexport class SubscriberController {\n    /**\n     * @ignore\n     */\n    private config: RuntimeConfigType;\n\n    /**\n     * @ignore\n     */\n    private localConfig: Map<string, string>;\n\n    /**\n     * @ignore\n     */\n    constructor(config: RuntimeConfigType, localConfig: Map<string, string>) {\n        this.config = config;\n        this.localConfig = localConfig;\n    }\n\n    /**\n     * Listener on actions, if this changes, this listener will get triggered with the updates\n     * @param actions Stringified array of DocumentAction type\n     */\n    onActionsChanged = (actions: string) => {\n        this.config.events.onActionsChanged.trigger(JSON.parse(actions));\n    };\n\n    /**\n     * Listener on when a certain animation gets changed\n     * @param animation Stringified array of FrameAnimationType\n     */\n    onAnimationChanged = (animation: string) => {\n        this.config.events.onFrameAnimationsChanged.trigger(JSON.parse(animation));\n    };\n\n    /**\n     * Listener on the playback state of the animation, it contains the current time of the playback (in milliseconds) and a flag that describes if the animation is currently playing\n     * @param animationPlaybackState Stringified array of AnimationPlaybackType\n     */\n    onAnimationPlaybackChanged = (animationPlaybackState: string) => {\n        this.config.events.onScrubberPositionChanged.trigger(JSON.parse(animationPlaybackState));\n    };\n\n    /**\n     * Listener on the state of the currently selected layout, if its properties are changed, this listener will get triggered with the new properties\n     * @param layoutProperties Stringified object of LayoutPropertiesType\n     */\n    onSelectedLayoutPropertiesChanged = (layoutProperties: string) => {\n        this.config.events.onSelectedLayoutPropertiesChanged.trigger(JSON.parse(layoutProperties));\n    };\n\n    /**\n     * Listener on the unit of the currently active layout. If you switch between layouts with different units, this listener will get triggered with the new unit\n     * If you switch the unit of a layout this listener will get triggered with the new unit\n     *\n     * @param unit Stringified object of MeasurementUnit\n     */\n    onSelectedLayoutUnitChanged = (unit: string) => {\n        this.config.events.onSelectedLayoutUnitChanged.trigger(unit as MeasurementUnit);\n    };\n\n    /**\n     * Listener on the state of all frames, if this changes, this listener will get triggered with the updates\n     * @param framesLayout Stringified array of FrameLayoutType objects\n     */\n    onFramesLayoutChanged = (framesLayout: string) => {\n        const frames = JSON.parse(framesLayout);\n        this.config.events.onFramesLayoutChanged.trigger(frames);\n    };\n\n    /**\n     * Listener on the state of the currently selected frames, if this changes, this listener will get triggered with the updates\n     * @param framesLayout Stringified array of FrameLayoutType objects\n     */\n    onSelectedFramesLayoutChanged = (framesLayout: string) => {\n        const frames = JSON.parse(framesLayout);\n        this.config.events.onSelectedFramesLayoutChanged.trigger(frames);\n\n        const singleFrameCallBack = this.config.onSelectedFrameLayoutChanged;\n        singleFrameCallBack && singleFrameCallBack(frames.length > 1 ? undefined : frames[0]);\n    };\n\n    /**\n     * Listener on the state of the currently selected frame, it contains some basic information on the type of frame it is\n     * @param framesContent Stringified array of Frame objects\n     */\n    onSelectedFramesContentChanged = (framesContent: string) => {\n        const frames = JSON.parse(framesContent);\n        this.config.events.onSelectedFramesContentChanged.trigger(frames);\n\n        const singleFrameCallBack = this.config.onSelectedFrameContentChanged;\n        singleFrameCallBack && singleFrameCallBack(frames.length > 1 ? null : frames[0]);\n    };\n\n    /**\n     * Listener on the general state of the document, gets triggered every time a change is done on the document.\n     */\n    onStateChanged = () => {\n        this.config.events.onStateChanged.trigger();\n    };\n\n    /**\n     * Listener on authentication expiration.\n     * The callback should resolve to the refreshed authentication. If the\n     * listener is not defined, the http requests from the connector will return\n     * 401 with no refetch of assets.\n     *\n     * When this emits it means either:\n     * - the grafxToken needs to be renewed\n     * - any other authentication needs to be renewed (user impersonation, static..)\n     *\n     * @param authRefreshRequest Stringified object of AuthRefreshRequest\n     */\n    onAuthExpired = async (authRefreshRequest: string) => {\n        const authCredentials = await this.config.handlers.onAuthExpired.trigger(JSON.parse(authRefreshRequest));\n        return authCredentials != null ? JSON.stringify(authCredentials) : null;\n    };\n\n    /**\n     * Listener on viewport request.\n     * The callback should resolve to the visible viewport. If the\n     * listener is not defined, the viewport will take full size.\n     *\n     * When this emits it means that the engine requested the viewport for a\n     * zoom to page call.\n     */\n    onViewportRequested = () => {\n        const viewport = this.config.handlers.onViewportRequested.trigger();\n        return viewport != null ? JSON.stringify(viewport) : null;\n    };\n\n    /**\n     * Listener on when the document is fully loaded.\n     */\n    onDocumentLoaded = () => {\n        this.config.events.onDocumentLoaded.trigger();\n    };\n\n    /**\n     * @deprecated use `onSelectedPageIdChanged` instead\n     * To be implemented, gets triggered when clicking on the pageTitle on the canvas.\n     */\n    onPageSelectionChanged = (id: Id) => {\n        this.config.events.onPageSelectionChanged.trigger(id);\n    };\n\n    /**\n     * Listener on when variables change\n     * @param variablesJson Stringified array of Variable\n     */\n    onVariableListChanged = (variablesJson: string) => {\n        const parsed = JSON.parse(variablesJson) as Variable[];\n\n        const updated = parsed.map((variable) =>\n            variable.type === VariableType.list\n                ? {\n                      ...variable,\n                      items: ((variable as ListVariable).items as unknown as ListVariableItem[]).map(\n                          (item) => item.value,\n                      ),\n                      selected: ((variable as ListVariable).selected as unknown as ListVariableItem | undefined)?.value,\n                  }\n                : variable,\n        );\n\n        this.config.events.onVariableListChanged.trigger(updated);\n    };\n\n    /**\n     * Listener on when the tool has changed by the canvas\n     * @param tool the string representation of a certain tool\n     */\n    onSelectedToolChanged = (tool: string) => {\n        this.config.events.onSelectedToolChanged.trigger(tool as ToolType);\n    };\n\n    /**\n     * Listener on state changes\n     * @param undoState Stringified object of UndoState\n     */\n    onUndoStateChanged = (undoState: string) => {\n        this.config.events.onUndoStackStateChanged.trigger(JSON.parse(undoState));\n    };\n\n    /**\n     * Listener on custom undo data changes\n     *\n     * @param customData Stringified object of custom undo data\n     */\n    onCustomUndoDataChanged = (customData: string) => {\n        this.config.events.onCustomUndoDataChanged.trigger(JSON.parse(customData));\n    };\n\n    /**\n     * Listener on the state of the currently selected layout's frames, if this changes, this listener will get triggered with the updates\n     * @param layoutFrames Stringified object of Frames\n     */\n    onSelectedLayoutFramesChanged = (layoutFrames: string) => {\n        this.config.events.onSelectedLayoutFramesChanged.trigger(JSON.parse(layoutFrames));\n    };\n\n    /**\n     * Listener on the state of the currently selected text's styles, if this changes, this listener will get triggered with the updates\n     * @param styles Stringified object of styles\n     */\n    onSelectedTextStyleChanged = (styles: string) => {\n        this.config.events.onSelectedTextStyleChanged.trigger(JSON.parse(styles));\n    };\n\n    /**\n     * Listener on the state of the currently selected color's styles, if this changes, this listener will get triggered with the updates\n     * @param colors Stringified object of colors\n     */\n    onColorsChanged = (colors: string) => {\n        this.config.events.onColorsChanged.trigger(JSON.parse(colors));\n    };\n\n    /**\n     * Listener on paragraph styles, if this changes, this listener will get triggered with the updates\n     * @param paragraphStyles Stringified object of paragraph styles\n     */\n    onParagraphStylesChanged = (paragraphStyles: string) => {\n        this.config.events.onParagraphStylesChanged.trigger(JSON.parse(paragraphStyles));\n    };\n\n    /**\n     * Listener on character styles, if this changes, this listener will get triggered with the updates\n     * @param characterStyles Stringified object of character styles\n     */\n    onCharacterStylesChanged = (characterStyles: string) => {\n        this.config.events.onCharacterStylesChanged.trigger(JSON.parse(characterStyles));\n    };\n\n    /**\n     * Listener on fonts, if this changes, this listener will get triggered with the updates\n     * @param fonts Stringified object of font families\n     */\n    onFontFamiliesChanged = (fonts: string) => {\n        this.config.events.onFontFamiliesChanged.trigger(JSON.parse(fonts));\n    };\n\n    /**\n     * Listener on selected layout id, this listener will get triggered when a different layout is selected.\n     * @param id the currently selected layout id\n     */\n    onSelectedLayoutIdChanged = (id: Id) => {\n        this.config.events.onSelectedLayoutIdChanged.trigger(id);\n    };\n\n    /**\n     * Listener on layouts, this listener will get triggered when a (sub)layout is\n     * - created\n     * - removed\n     * - renamed\n     * - duplicated\n     * @param layouts Stringified object of layouts\n     */\n    onLayoutsChanged = (layouts: string) => {\n        this.config.events.onLayoutsChanged.trigger(JSON.parse(layouts));\n    };\n\n    /**\n     * Listener on scale factor of the canvas, this listener will get triggered when a zoom is applied to the canvas\n     * @param zoom Stringified scale factor\n     */\n    onZoomChanged = (zoom: string) => {\n        this.config.events.onZoomChanged.trigger(JSON.parse(zoom));\n    };\n\n    /**\n     * Listener on connector events, this listener will get triggered when a connector emits one of those events\n     * - reloadRequired\n     * - authChanged\n     * - unloaded\n     * - stateChanged\n     *\n     * stateChanged - this event will be triggered by connector states: loading, loaded, running, ready, error\n     * @param connectorEvent Stringified object of ConnectorEvent\n     */\n    onConnectorEvent = (connectorEvent: string) => {\n        this.config.events.onConnectorEvent.trigger(JSON.parse(connectorEvent));\n    };\n\n    /**\n     * Listener on connectors, if this changes, this listener will get triggered with the updates\n     * @param connectors Stringified array of ConnectorInstance type\n     */\n    onConnectorsChanged = (connectors: string) => {\n        const connectorCompatibilityTools = new ConnectorCompatibilityTools();\n        const compatibleConnectors = connectorCompatibilityTools.makeMultipleConnectorsBackwardsCompatible(\n            JSON.parse(connectors),\n            this.localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl),\n        );\n        this.config.events.onConnectorsChanged.trigger(compatibleConnectors);\n    };\n\n    /**\n     * @experimental\n     * Listener on when the selectedPageID is changed.\n     * @param pageId Stringified pageId\n     */\n    onSelectedPageIdChanged = (pageId: string) => {\n        this.config.events.onSelectedPageIdChanged.trigger(pageId);\n    };\n\n    /**\n     * @experimental\n     * Listener on pages list, this listener will get triggered when the pages are updated.\n     * @param pages Stringified object of the pages\n     */\n    onPagesChanged = (pages: string) => {\n        this.config.events.onPagesChanged.trigger(JSON.parse(pages));\n    };\n\n    /**\n     * @experimental\n     * Listener on pages snapshots, this will fire when a page snapshot is invalidated and should be updated.\n     * @param pageId id of the page\n     */\n    onPageSnapshotInvalidated = (pageId: Id) => {\n        this.config.events.onPageSnapshotInvalidated.trigger(pageId);\n    };\n    /**\n     * Listener on page size, this listener will get triggered when the page size is changed, while the document is a `project`.\n     * This will not emit anything if your document is a `template`.\n     * @param pageSize Stringified object of the PageSize\n     */\n    onPageSizeChanged = (pageSize: string) => {\n        this.config.events.onPageSizeChanged.trigger(JSON.parse(pageSize));\n    };\n\n    /**\n     * Listener on corner radii of rectangle and polygon shapes, this listener will get triggered when any corner radius is changed\n     * @param cornerRadius Stringified object of the CornerRadius\n     */\n    onShapeCornerRadiusChanged = (cornerRadius: string) => {\n        this.config.events.onShapeCornerRadiusChanged.trigger(JSON.parse(cornerRadius));\n    };\n\n    /**\n     * Listener of editor entering / exiting the crop mode\n     * @param id frame id when entering / null when exiting\n     */\n    onCropActiveFrameIdChanged = (id?: Id) => {\n        this.config.events.onCropActiveFrameIdChanged.trigger(id);\n    };\n\n    /**\n     * Listener on async errors.\n     * Async errors are thrown at times not directly tied to SDK calls.\n     * e.g. Getting an action error triggered after a late event.\n     *\n     * If this is an `ActionAsyncError`:\n     * - `id` refers to the action id\n     * - `event` refers to the event that triggered the action\n     * - `eventChain` refers the chain of events that lead to the action, first\n     * item being the closest parent.\n     * @param asyncError error triggered asynchronously\n     */\n    onAsyncError = (asyncError: string) => {\n        const parsedError = JSON.parse(asyncError);\n\n        if (parsedError?.type === 'dataRow') {\n            const dataRowException = new DataRowAsyncError(\n                parsedError.count,\n                parsedError.message,\n                parsedError.exceptions,\n            );\n\n            this.config.events.onAsyncError.trigger(dataRowException);\n        } else if (parsedError?.type === 'action') {\n            const actionException = new ActionAsyncError(\n                parsedError.message,\n                parsedError.id,\n                parsedError.event,\n                parsedError.eventChain,\n            );\n\n            this.config.events.onAsyncError.trigger(actionException);\n        } else {\n            this.config.events.onAsyncError.trigger(parsedError);\n        }\n    };\n\n    /**\n     * Listener on when the view mode has changed\n     * @param viewMode the string representation of a view mode\n     */\n    onViewModeChanged = (viewMode: string) => {\n        this.config.events.onViewModeChanged.trigger(viewMode as ViewMode);\n    };\n\n    /**\n     * Listener on when barcode frames change their validation state\n     *\n     * @param validationResults the json string representation of the validation results\n     */\n    onBarcodeValidationChanged = (validationResults: string) => {\n        this.config.events.onBarcodeValidationChanged.trigger(JSON.parse(validationResults));\n    };\n\n    /**\n     * Listener on when the data source has changed\n     *\n     * @param connectorId the id of the data connector\n     */\n    onDataSourceIdChanged = (connectorId?: Id) => {\n        this.config.events.onDataSourceIdChanged.trigger(connectorId);\n    };\n\n    /**\n     * Listener on document issues, if this changes, this listener will get triggered with the updates\n     * @param documentIssues Stringified object of document issues\n     */\n    onDocumentIssueListChanged = (documentIssues: string) => {\n        this.config.events.onDocumentIssueListChanged.trigger(JSON.parse(documentIssues));\n    };\n\n    /**\n     * Listener on engine editing mode, if this changes, this listener will get triggered with the updates\n     * @param engineEditMode Stringified object of engine edit mode\n     */\n    onEngineEditModeChanged = (engineEditMode: string) => {\n        this.config.events.onEngineEditModeChanged.trigger(JSON.parse(engineEditMode));\n    };\n\n    /**\n     * Listener on brand kit media, if this changes, this listener will get triggered with the updates\n     * @param brandKitMedia Stringified array of BrandKitMedia objects\n     */\n    onBrandKitMediaChanged = (brandKitMedia: string) => {\n        this.config.events.onBrandKitMediaChanged.trigger(JSON.parse(brandKitMedia));\n    };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { SelectedTextStyle, TextStyleUpdateType } from '../types/TextStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The TextStyleController is responsible for all communication regarding text styles.\n * Methods inside this controller can be called by `window.SDK.textStyle.{method-name}`\n */\nexport class TextStyleController {\n    /**\n     * @ignore\n     */\n    readonly #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method updates a selected Text's style properties\n     * @returns\n     */\n    set = async (style: TextStyleUpdateType) => {\n        const res = await this.#editorAPI;\n        return res\n            .selectedTextStyleDeltaUpdate(JSON.stringify(style))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method removes a selected Text's style properties\n     * If the text is selected, then the inline style properties will be removed\n     * If the text is not selected and user tried to change any style property, the temporary style will be removed\n     * if there is no text selection and there is no temporary style, the inline paragraph properties will be removed\n     * @returns\n     */\n    removeSelected = async () => {\n        const res = await this.#editorAPI;\n        return res.selectedTextStyleClean().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method gets a selected Text's style properties\n     * @returns\n     */\n    getSelected = async () => {\n        const res = await this.#editorAPI;\n        return res.getSelectedTextStyle().then((result) => getEditorResponseData<SelectedTextStyle>(result));\n    };\n}\n","export enum FramePropertyNames {\n    FRAME_X = 'frameX',\n    FRAME_Y = 'frameY',\n    WIDTH = 'width',\n    HEIGHT = 'height',\n    FRAME_ROTATION = 'frameRotation',\n}\nexport enum LayoutPropertyNames {\n    LAYOUT_HEIGHT = 'layoutHeight',\n    LAYOUT_WIDTH = 'layoutWidth',\n    BLEED_TOP = 'bleedTop',\n    BLEED_BOTTOM = 'bleedBottom',\n    BLEED_LEFT = 'bleedLeft',\n    BLEED_RIGHT = 'bleedRight',\n    BLEED_VALUES_COMBINED = 'areBleedValuesCombined',\n}\n\nexport enum ToolType {\n    SELECT = 'select',\n    ZOOM = 'zoom',\n    HAND = 'hand',\n    IMAGE_FRAME = 'imageFrame',\n    TEXT_FRAME = 'textFrame',\n    SHAPE_RECT = 'rect',\n    SHAPE_ELLIPSE = 'ellipse',\n    SHAPE_POLYGON = 'polygon',\n}\nexport enum DownloadFormats {\n    MP4 = 'mp4',\n    GIF = 'gif',\n    PNG = 'png',\n    JPG = 'jpg',\n    PDF = 'pdf',\n    /**\n     * @experimental This download format is experimental.\n     */\n    HTML = 'html',\n}\n\nexport enum EnvironmentType {\n    SANDBOX = 'sandbox',\n    PRODUCTION = 'online',\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { ToolType } from '../utils/Enums';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ToolController is responsible for all communication regarding the tools.\n * Methods inside this controller can be called by `window.SDK.tool.{method-name}`\n */\nexport class ToolController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method sets the currently used tool\n     * @param tool\n     */\n    setTool = async (tool: ToolType) => {\n        const res = await this.#editorAPI;\n        return res.setTool(tool).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method returns selected tool\n     */\n    getSelected = async () => {\n        const res = await this.#editorAPI;\n        return res.getSelectedTool().then((result) => getEditorResponseData<ToolType>(result));\n    };\n\n    /**\n     * @deprecated\n     * This method sets the used tool to the select tool.\n     * This method is deprecated in favour of the setSelect tool setter.\n     */\n    setPointer = async () => {\n        return this.setTool(ToolType.SELECT);\n    };\n\n    /**\n     * This method sets the used tool to the select tool.\n     */\n    setSelect = async () => {\n        return this.setTool(ToolType.SELECT);\n    };\n\n    /**\n     * This method sets the used tool to the Move tool\n     */\n    setHand = async () => {\n        return this.setTool(ToolType.HAND);\n    };\n\n    /**\n     * This method sets the used tool to the Zoom tool\n     */\n    setZoom = async () => {\n        return this.setTool(ToolType.ZOOM);\n    };\n\n    /**\n     * This method sets the used tool to the TextFrame tool\n     */\n    setTextFrame = async () => {\n        return this.setTool(ToolType.TEXT_FRAME);\n    };\n\n    /**\n     * This method sets the used tool to the ImageFrame tool\n     */\n    setImageFrame = async () => {\n        return this.setTool(ToolType.IMAGE_FRAME);\n    };\n\n    /**\n     * This method sets the used tool to the ShapeRectangle tool\n     */\n    setShapeRect = async () => {\n        return this.setTool(ToolType.SHAPE_RECT);\n    };\n\n    /**\n     * This method sets the used tool to the ShapeEllipse tool\n     */\n    setShapeEllipse = async () => {\n        return this.setTool(ToolType.SHAPE_ELLIPSE);\n    };\n\n    /**\n     * This method sets the used tool to the ShapePolygon tool\n     */\n    setShapePolygon = async () => {\n        return this.setTool(ToolType.SHAPE_POLYGON);\n    };\n}\n","import SDK from '..';\nimport { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The UndoManagerController is responsible for all communication regarding the Undo-Manager.\n * Methods inside this controller can be called by `window.SDK.undoManager.{method-name}`\n */\nexport class UndoManagerController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    #advanced: AdvancedUndoManagerController;\n    #sdk: SDK;\n\n    /**\n     * @ignore\n     */\n    constructor(children: EditorAPI, sdk: SDK) {\n        this.#editorAPI = children;\n        this.#sdk = sdk;\n        this.#advanced = new AdvancedUndoManagerController(children);\n    }\n\n    /**\n     * This method undoes the last operation\n     * @returns\n     */\n    undo = async () => {\n        const res = await this.#editorAPI;\n        return res.undo().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method redoes the last operation\n     * @returns\n     */\n    redo = async () => {\n        const res = await this.#editorAPI;\n        return res.redo().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method adds custom data that will be saved and restored when undoing and redoing.\n     * Duplicate values are overwritten. The data is exposed via the onCustomUndoDataChanged event.\n     *\n     * @param key The key of the custom data\n     * @param value The value of the custom data\n     * @returns\n     */\n    addCustomData = async (key: string, value: string) => {\n        const res = await this.#editorAPI;\n        return res.setCustomUndoData(key, value, false).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Record any operations in the current scope. This will automatically begin\n     * the undo operation. Once you leave the record scope, it will end the undo operation.\n     * Even if you throw an exception inside the record scope it will still end it properly.\n     * @returns\n     */\n    record = async (operationName: string, undoOperationCallback: (sdk: SDK) => Promise<void>) => {\n        try {\n            await this.#advanced.beginIfNoneActive(operationName);\n\n            await undoOperationCallback(this.#sdk);\n\n            await this.#advanced.end();\n        } catch (error) {\n            await this.#advanced.abort();\n            throw error;\n        }\n    };\n\n    /**\n     * This method pauses the undo manager\n     * @returns\n     */\n    pause = async () => {\n        const res = await this.#editorAPI;\n        return res.pause().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method resumes the undo manager\n     * @returns\n     */\n    resume = async () => {\n        const res = await this.#editorAPI;\n        return res.resume().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Advanced undo manager functionality for manually controlling undo operations.\n     * This will start a new undo operation.\n     * This will throw an exception when there is already an undo operation recording.\n     * @experimental This method is experimental and may change in future versions.\n     * @returns\n     */\n    advanced = {\n        /**\n         * This will start a new undo operation.\n         * This will throw an exception when there is already an undo operation recording.\n         * @experimental This method is experimental and may change in future versions.\n         * @returns\n         */\n        begin: async (operationName: string) => {\n            return this.#advanced.begin(operationName);\n        },\n\n        /**\n         * This will start a new undo operation if there is no other undo operation recording.\n         * This does not throw.\n         * @experimental This method is experimental and may change in future versions.\n         * @returns\n         */\n        beginIfNoneActive: async (operationName: string) => {\n            return this.#advanced.beginIfNoneActive(operationName);\n        },\n\n        /**\n         * Ends the currently active recording operation.\n         * If there is no recording operation currently running this will throw an exception.\n         * @experimental This method is experimental and may change in future versions.\n         * @returns\n         */\n        end: async () => {\n            return this.#advanced.end();\n        },\n\n        /**\n         * Aborts the currently active recording operation.\n         * If there is no recording operation currently running this will throw an exception.\n         * @experimental This method is experimental and may change in future versions.\n         * @returns\n         */\n        abort: async () => {\n            return this.#advanced.abort();\n        },\n    };\n}\n\nexport class AdvancedUndoManagerController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(children: EditorAPI) {\n        this.#editorAPI = children;\n    }\n\n    /**\n     * This will start a new undo operation.\n     * This will throw an exception when there is already an undo operation recording.\n     * @returns\n     */\n    begin = async (operationName: string) => {\n        const res = await this.#editorAPI;\n        return res.begin(operationName).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This will start a new undo operation if there is no other undo operation recording.\n     * This does not throw.\n     * @returns\n     */\n    beginIfNoneActive = async (operationName: string) => {\n        const res = await this.#editorAPI;\n        return res.beginIfNoneActive(operationName).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Ends the currently active recording operation.\n     * If there is no recording operation currently running this will throw an exception.\n     * @returns\n     */\n    end = async () => {\n        const res = await this.#editorAPI;\n        return res.end().then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Aborts the currently active recording operation.\n     * If there is no recording operation currently running this will throw an exception.\n     * @returns\n     */\n    abort = async () => {\n        const res = await this.#editorAPI;\n        return res.abort().then((result) => getEditorResponseData<null>(result));\n    };\n}\n","export const round = (val: number, precision = 2) => {\n    const hundred = Math.pow(10, precision);\n    return Math.round(val * hundred) / hundred;\n};\n","import type { EditorAPI, Id } from '../types/CommonTypes';\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\nimport {\n    FilePointer,\n    UploadAssetValidationError,\n    UploadAssetValidationErrorType,\n    UploadValidationConfiguration,\n} from '../types/ConnectorTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { EnvironmentType } from '../utils/Enums';\nimport { round } from '../utils/MathUtils';\nimport { MeasurementUnit } from '../types/LayoutTypes';\n\n/**\n * The UtilsController exposes a set of useful utilities that can be used to make some repeated tasks a bit easier\n * Methods inside this controller can be called by `window.SDK.utils.{method-name}`\n */\nexport class UtilsController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    #localConfig: Map<string, string>;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\n        this.#editorAPI = editorAPI;\n        this.#localConfig = localConfig;\n    }\n\n    /**\n     * This method can round a value to a certain precision, default is 2\n     * @param val the value that needs to be rounded\n     * @param precision the precision of the rounding operation\n     * @returns the rounded value as a number\n     */\n    round = (val: number, precision?: number) =>\n        getEditorResponseData<number>({\n            data: String(round(val, precision)),\n            success: true,\n            status: 200,\n            parsedData: null,\n        });\n\n    createEnvironmentBaseURL = (parameters: { type?: EnvironmentType; environment?: string; version?: string }) => {\n        const { type = EnvironmentType.SANDBOX, environment = 'ft-nostress', version = '1' } = parameters;\n        const host = type == EnvironmentType.SANDBOX ? 'chili-publish-sandbox' : 'chili-publish';\n        return `https://${environment}.${host}.online/grafx/api/v${version}/environment/${environment}`;\n    };\n\n    /**\n     * This method can help you stage a file to the CHILI GraFx Environment API for upload.\n     * @param files The Files or Blobs to stage.\n     * @param remoteConnectorId The connector ID from Environment API to stage the files for.\n     * @param validationConfiguration The validation configuration to use for the files.\n     * @returns Promise<FilePointer[]> referencing the staged data.\n     */\n    stageFiles = async (\n        files: File[] | Blob[],\n        remoteConnectorId: Id,\n        validationConfiguration?: UploadValidationConfiguration,\n    ): Promise<FilePointer[]> => {\n        const envApiUrl = this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl);\n        if (!envApiUrl) {\n            throw new Error('GraFx Studio Environment API URL is not set');\n        }\n\n        const stageUrl = `${envApiUrl}connectors/${remoteConnectorId}/stage`;\n\n        const accessToken = this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioAuthToken);\n        if (!accessToken) {\n            throw new Error('GraFx Studio Auth Token is not set');\n        }\n\n        const formData = new FormData();\n\n        // Add each file/blob to form data\n        files.forEach((file, idx) => {\n            const filename = file instanceof File ? file.name : `blob-${idx}`;\n            formData.append('files', file, filename);\n        });\n\n        if (validationConfiguration) {\n            formData.append(\n                'validationJson',\n                JSON.stringify({\n                    allowedMimeTypes: validationConfiguration.mimeTypes,\n                    minDimensions: {\n                        width: validationConfiguration.minWidthPixels,\n                        height: validationConfiguration.minHeightPixels,\n                    },\n                }),\n            );\n        }\n\n        const response = await fetch(stageUrl, {\n            method: 'POST',\n            body: formData,\n            headers: {\n                Authorization: `Bearer ${accessToken}`,\n            },\n        });\n\n        if (response.status === 422) {\n            const data = await response.json();\n            throw new UploadAssetValidationError(data.message, UploadAssetValidationErrorType.minDimension);\n        }\n\n        if (!response.ok) {\n            throw new Error('Failed to stage files');\n        }\n\n        const data = await response.json();\n        return data as FilePointer[];\n    };\n\n    /**\n     * Evaluates a unit expression and returns its value as a number in the\n     * specified conversionUnit, or in the current layout measurement unit if\n     * conversionUnit is not provided.\n     *\n     * Returns null if unitExpression is null, empty, or cannot be evaluated.\n     *\n     * Example:\n     * ```\n     * const value = await SDK.utils.unitEvaluate('10cm', MeasurementUnit.px);\n     * // value is the numeric value in px\n     * ```\n     *\n     * @param unitExpression The unit expression to evaluate (e.g., \"10px\", \"5mm + 2cm\", null)\n     * @param conversionUnit Optional target unit for conversion. If not provided, uses the current layout measurement unit.\n     * @returns The evaluated result as a number, or null if the expression cannot be evaluated\n     */\n    unitEvaluate = async (unitExpression: string | null, conversionUnit?: MeasurementUnit) => {\n        const res = await this.#editorAPI;\n        return res\n            .unitEvaluate(unitExpression, conversionUnit)\n            .then((result) => getEditorResponseData<number | null>(result));\n    };\n}\n","import { EditorAPI, EditorResponse, Id, PrivateData } from '../types/CommonTypes';\nimport { ConnectorRegistration } from '../types/ConnectorTypes';\nimport { Dictionary } from '@chili-studio/connector-types';\nimport {\n    DateRestriction,\n    DateVariablePropertiesDeltaUpdate,\n    Day,\n    ListVariable,\n    ListVariableItem,\n    Locale,\n    NumberVariablePropertiesDeltaUpdate,\n    PrefixSuffixDeltaUpdate,\n    Variable,\n    VariableType,\n    VariableUsagesReport,\n    VariableVisibility,\n    VariableVisibilityType,\n} from '../types/VariableTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { ConnectorCompatibilityTools } from '../utils/ConnectorCompatibilityTools';\n\nclass NumberVariable {\n    #editorAPI: EditorAPI;\n\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * @experimental Sets the minimum value for a number variable\n     * @param id the id of the variable to update\n     * @param minimum the minimum value or null to remove the minimum value\n     * @returns\n     */\n    setMinimum = async (id: string, minimum: number | null) => {\n        const update = { minValue: { value: minimum } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the maximum value for a number variable\n     * @param id the id of the variable to update\n     * @param maximum the maximum value or null to remove the maximum value\n     * @returns\n     */\n    setMaximum = async (id: string, maximum: number | null) => {\n        const update = { maxValue: { value: maximum } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the visibility of the stepper for a number variable\n     * @param id the id of the variable to update\n     * @param showStep true to show the stepper, false to hide it\n     * @returns\n     */\n    setShowStepper = async (id: string, showStepper: boolean) => {\n        const update = { showStepper: { value: showStepper } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the step size for a number variable\n     * @param id the id of the variable to update\n     * @param stepSize the step size. Must be > 0\n     * @returns\n     */\n    setStepSize = async (id: string, stepSize: number) => {\n        const update = { stepSize: { value: stepSize } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the thousands separator for a number variable\n     * @param id the id of the variable to update\n     * @param thousandsSeparator the thousands separator to use\n     * @returns\n     */\n    setThousandsSeparator = async (id: string, thousandsSeparator: '' | '.' | ',' | ' ') => {\n        const update = { thousandsSeparator: { value: thousandsSeparator } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the decimal separator for a number variable\n     * @param id the id of the variable to update\n     * @param decimalSeparator the decimal separator to use\n     * @returns\n     */\n    setDecimalSeparator = async (id: string, decimalSeparator: '' | '.' | ',' | ' ') => {\n        const update = { decimalSeparator: { value: decimalSeparator } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets or clears the decimal character style for a number variable\n     * @param id the id of the variable to update\n     * @param characterStyleId the id of the character style to use/clear for the decimals\n     * @returns\n     */\n    setDecimalCharacterStyle = async (id: string, characterStyleId: string | null) => {\n        const update = { decimalCharacterStyleId: { value: characterStyleId } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the number of decimals for a number variable\n     * @param id the id of the variable to update\n     * @param numberOfDecimals the number of decimals to use\n     * @returns\n     */\n    setNumberOfDecimals = async (id: string, numberOfDecimals: 0 | 1 | 2 | 3 | 4) => {\n        const update = { numberOfDecimals: { value: numberOfDecimals } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    private async applyPropertiesUpdate(id: string, update: NumberVariablePropertiesDeltaUpdate) {\n        const res = await this.#editorAPI;\n        const result = await res.updateNumberVariableProperties(id, JSON.stringify(update));\n        return getEditorResponseData<null>(result);\n    }\n}\n\nclass DateVariable {\n    #editorAPI: EditorAPI;\n\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * @experimental This method sets the display format for a date variable.\n     *\n     * The `displayFormat` is using ICU formatting (Unicode).\n     *\n     * Supported date formats:\n     * - Day -> `d`, `dd`\n     * - Month -> `M`, `MM`, `MMM`, `MMMM`\n     * - Year -> `yy`, `yyyy`\n     * - Day of week -> `ccc`, `cccc`\n     *\n     * Examples for an input date of `10-12-1815`:\n     * - Format `dd/MM/yyyy` will display `12/10/1815`\n     * - Format `d.M.yy` will display `12.10.15`\n     * - Format `d MMM yyyy` will display `12 Oct 1815` for the `en_US` language\n     * - Format `MMMM d, yyyy` will display `October 12, 1815` for the `en_US` language\n     * - Format `ccc, MMM d, yyyy` will display `Thu, Oct 12, 1815` for the `en_US` language\n     * - Format `cccc, MMMM d, yyyy` will display `Thursday, October 12, 1815` for the `en_US` language\n     * - Format `cccc, MMMM d, yyyy` will display `donderdag, oktober 12, 1815` for the `nl` language\n     *\n     * Patterns which output words such as `MMM`, `MMMM`, `ccc` and `cccc` will\n     * differ depending on chosen language (default is `en_US`).\n     *\n     * @param id The id of the date variable to update\n     * @param displayFormat The display format for the date variable\n     */\n    setDisplayFormat = async (id: string, displayFormat: string) => {\n        const update = { displayFormat: { value: displayFormat } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental This method sets the locale for a date variable.\n     *\n     * @param id The id of the date variable to update\n     * @param locale The locale for the date variable (`'en_US'`, `'fi'`, `'fr'`...)\n     */\n    setLocale = async (id: string, locale: Locale) => {\n        const update = { locale: { value: locale } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental This method sets or clears the start date for a date variable.\n     * @param id The id of the date variable to update\n     * @param date The start date for the date variable\n     */\n    setStartDate = async (id: string, date: DateRestriction | null) => {\n        const update = { startDate: { value: date } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental This method sets or clears the end date for a date variable.\n     * @param id The id of the date variable to update\n     * @param date The end date for the date variable\n     */\n    setEndDate = async (id: string, date: DateRestriction | null) => {\n        const update = { endDate: { value: date } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    /**\n     * @experimental This method sets or clears the excluded days for a date variable.\n     * @param id The id of the date variable to update\n     * @param excludedDays The excluded days for the date variable\n     */\n    setExcludedDays = async (id: string, excludedDays: Day[] | null) => {\n        const update = { excludedDays: { value: excludedDays } };\n        return this.applyPropertiesUpdate(id, update);\n    };\n\n    private async applyPropertiesUpdate(id: string, update: DateVariablePropertiesDeltaUpdate) {\n        const res = await this.#editorAPI;\n        const result = await res.updateDateVariableProperties(id, JSON.stringify(update));\n        return getEditorResponseData<null>(result);\n    }\n}\n\n/**\n * The VariableController is responsible for all communication regarding the variables.\n * Methods inside this controller can be called by `window.SDK.variable.{method-name}`\n */\nexport class VariableController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    number: NumberVariable;\n    date: DateVariable;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.number = new NumberVariable(this.#editorAPI);\n        this.date = new DateVariable(this.#editorAPI);\n    }\n\n    /**\n     * This method returns the list of variables\n     * @returns\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res\n            .getVariables()\n            .then((result) => getEditorResponseData<Variable[]>(result))\n            .then((resp) => {\n                const update = resp;\n                if (update.parsedData) {\n                    update.parsedData = this.makeVariablesBackwardsCompatible(update.parsedData);\n                }\n                return update;\n            });\n    };\n\n    /**\n     * This method returns a variable by id\n     * @param id the id of a specific variable\n     * @returns\n     */\n    getById = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .getVariableById(id)\n            .then((result) => getEditorResponseData<Variable>(result))\n            .then((resp) => {\n                const update = resp;\n                if (update.parsedData) {\n                    update.parsedData = this.makeVariableBackwardsCompatible(update.parsedData);\n                }\n                return update;\n            });\n    };\n\n    /**\n     * This method returns a variable by name\n     * @param name the name of a specific variable\n     * @returns\n     */\n    getByName = async (name: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .getVariableByName(name)\n            .then((result) => getEditorResponseData<Variable>(result))\n            .then((resp) => {\n                const update = resp;\n                if (update.parsedData) {\n                    update.parsedData = this.makeVariableBackwardsCompatible(update.parsedData);\n                }\n                return update;\n            });\n    };\n\n    /**\n     * This method creates a new variable\n     * @param parentId parent id of the created variable\n     * @param type type of the created variable\n     * @returns the new created variable id\n     */\n    create = async (parentId: string, type: VariableType) => {\n        const res = await this.#editorAPI;\n        return res.addVariable(parentId, type).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method removes a list of variables.\n     *\n     * All connectors linked to the variables will be unregistered.\n     * @param ids list of the variables to be removed\n     * @returns\n     */\n    remove = async (ids: string[]) => {\n        const res = await this.#editorAPI;\n        return res.removeVariables(ids).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets a new name for a variable\n     * @param id id of the variable\n     * @param name name of the variable\n     * @returns\n     */\n    rename = async (id: string, name: string) => {\n        const res = await this.#editorAPI;\n        return res.setVariableName(id, name).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets a new label for a variable\n     * @param id id of the variable\n     * @param label label of the variable\n     * @returns\n     */\n    setLabel = async (id: string, label: string | null) => {\n        const res = await this.#editorAPI;\n        return res.setVariableLabel(id, label).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Internal private method to set/reset a placeholder for a variable\n     */\n    #setPlaceholder = async (id: string, placeholder: string | null) => {\n        const res = await this.#editorAPI;\n        return res.setVariablePlaceholder(id, placeholder).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets a new placeholder for a variable\n     * @param id id of the variable\n     * @param placeholder placeholder of the variable\n     * @returns\n     */\n    setPlaceholder = async (id: string, placeholder: string) => {\n        return this.#setPlaceholder(id, placeholder);\n    };\n\n    /**\n     * This method resets a placeholder for a variable\n     * @param id id of the variable\n     * @returns\n     */\n    resetPlaceholder = async (id: string) => {\n        return this.#setPlaceholder(id, null);\n    };\n\n    /**\n     * Internal private method to set/reset a help text for a variable\n     */\n    #setHelpText = async (id: string, helpText: string | null) => {\n        const res = await this.#editorAPI;\n        return res.setVariableHelpText(id, helpText).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets a new help text for a variable\n     * @param id id of the variable\n     * @param helpText placeholder of the variable\n     * @returns\n     */\n    setHelpText = async (id: string, helpText: string) => {\n        return this.#setHelpText(id, helpText);\n    };\n\n    /**\n     * This method resets a help text for a variable\n     * @param id id of the variable\n     * @returns\n     */\n    resetHelpText = async (id: string) => {\n        return this.#setHelpText(id, null);\n    };\n\n    /**\n     * This method sets a new type for a variable\n     * @param id id of the variable\n     * @param type type of the variable\n     * @returns\n     */\n    setType = async (id: string, type: VariableType) => {\n        const res = await this.#editorAPI;\n        return res.setVariableType(id, type).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the items of the list variable\n     *\n     * The items need to be unique and are not case sensitive.\n     *\n     * @param id the id of the list variable\n     * @param items the items of the list\n     * @returns\n     */\n    setListVariable = async (id: Id, items: string[]) => {\n        const res = await this.#editorAPI;\n        return res\n            .setListVariableItems(\n                id,\n                items.map((item) => JSON.stringify(<ListVariableItem>{ value: item })),\n            )\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets a new value for a variable\n     *\n     * If the value is some text to be set on a ShortTextVariable, it must not\n     * contain any type of line breaks.\n     *\n     * If the value is passing a context on an image variable value, it will be\n     * available from the connector.\n     *\n     * @param id the id of the variable\n     * @param value the new value of the variable\n     * @returns\n     */\n    setValue = async (id: Id, value: string | boolean | number | null) => {\n        const res = await this.#editorAPI;\n        return res.setVariableValue(id, value).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method creates a copy of a variable\n     * @returns\n     */\n    duplicate = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.duplicateVariable(id).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method aggregates the provided variables into a new group\n     * @param name name of the new group\n     * @param ids list of variable ids to group together\n     * @returns group id\n     */\n    groupVariables = async (name: string, ids: string[]) => {\n        const res = await this.#editorAPI;\n        return res.groupVariables(name, ids).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method dissolves the specified group\n     * @param id id of the variable group\n     * @returns\n     */\n    ungroupVariables = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.ungroupVariable(id).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method moves a variable's position\n     * @param order new order of variable\n     * @param id id of the variable\n     * @param parentId parent id of the created variable\n     * @returns\n     */\n    move = async (order: number, id: string, parentId: string) => {\n        const res = await this.#editorAPI;\n        return res.moveVariable(id, parentId, order).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method changes positions of variables\n     * @param order new order of variable\n     * @param ids Array of the variable IDs\n     * @param parentId parent id of the variables\n     * @returns\n     */\n    moveVariables = async (order: number, ids: string[], parentId: string) => {\n        const res = await this.#editorAPI;\n        return res.moveVariables(ids, parentId, order).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated Use `setVariableVisibility` instead.\n     * This method redirects to `setVariableVisibility` and sets visibility config for a variable by id.\n     * @param id variable id\n     * @param isVisible visibility flag\n     * @returns\n     */\n    setIsVisible = async (id: string, isVisible: boolean) => {\n        const config = isVisible\n            ? { type: VariableVisibilityType.visible }\n            : { type: VariableVisibilityType.invisible };\n\n        return this.setVariableVisibility(id, config as VariableVisibility);\n    };\n\n    /**\n     * @deprecated Use `setVariableVisibility` instead.\n     * This method redirects to `setVariableVisibility` and sets visibility config for a variable by id.\n     * @param id variable id\n     * @param isHidden visibility flag\n     * @returns\n     */\n    setIsHidden = async (id: string, isHidden: boolean) => {\n        const config = isHidden ? { type: VariableVisibilityType.invisible } : { type: VariableVisibilityType.visible };\n\n        return this.setVariableVisibility(id, config as VariableVisibility);\n    };\n\n    /**\n     * This method sets visibility config for a variable by id\n     * @param id variable id\n     * @param config visibility config\n     * @returns\n     */\n    setVariableVisibility = async (id: string, config: VariableVisibility) => {\n        const res = await this.#editorAPI;\n        return res\n            .setVariableVisibility(id, JSON.stringify(config))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets which layouts are considered for variable visibility\n     * @param layoutIdList nullable layout id list.\n     * Pass null to reset to follow selected layout.\n     * @returns\n     */\n    setLayoutsForVariableVisibility = async (layoutIdList?: Id[] | null) => {\n        const res = await this.#editorAPI;\n        return res\n            .setLayoutsForVariableVisibility(layoutIdList ? JSON.stringify(layoutIdList) : null)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets isRequired flag for a variable\n     * @returns\n     */\n    setIsRequired = async (id: string, isRequired: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setVariableIsRequired(id, isRequired).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets removeParagraphIfEmpty flag for a variable\n     * @param id The id of the variable to update\n     * @param removeParagraphIfEmpty Set to true to remove the paragraph if it is empty, or false to keep it\n     * @returns\n     */\n    setRemoveParagraphIfEmpty = async (id: string, removeParagraphIfEmpty: boolean) => {\n        const res = await this.#editorAPI;\n        return res\n            .setVariableRemoveParagraphIfEmpty(id, removeParagraphIfEmpty)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets maxCharacters limit on a text variable\n     * @param id The id of the variable to update\n     * @param maxCharacters Sets the max number of characters for that variable\n     * maxCharacters > 0 && maxCharacters <= 10000 or it can be set to null\n     * @returns\n     */\n    setVariableCharacterLimit = async (id: string, maxCharacters: number | null) => {\n        const res = await this.#editorAPI;\n        return res.setVariableCharacterLimit(id, maxCharacters).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets isReadonly flag for a variable\n     * @returns\n     */\n    setIsReadonly = async (id: string, isReadonly: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setVariableIsReadonly(id, isReadonly).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method gets the image variable connector id.\n     * @param id The id of the image variable\n     * @returns The id of the connector\n     */\n    getImageVariableConnectorId = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.getImageVariableConnectorId(id).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method sets the image variable connector. Setting a connector will\n     * automatically remove the assetId linked to the connector if present.\n     * If a connector was the source of the variable, it will be unregistered.\n     * @param id The id of the image variable to update\n     * @param registration registration object containing all details about the connector\n     * @returns The new id of the connector\n     */\n    setImageVariableConnector = async (id: string, registration: ConnectorRegistration) => {\n        const res = await this.#editorAPI;\n        const connectorCompatibilityTools = new ConnectorCompatibilityTools();\n        const connectorRegistration = connectorCompatibilityTools.makeConnectorSourceForwardsCompatible(registration);\n\n        return res\n            .setImageVariableConnector(id, JSON.stringify(connectorRegistration))\n            .then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method sets the value of an image variable along with its context in a single atomic operation\n     * @param id the id of the image variable to update\n     * @param value the new value of the image variable\n     * @param context the context dictionary\n     * @returns\n     */\n    setImageVariableValueWithContext = async (id: string, value: string | null, context: Dictionary) => {\n        const res = await this.#editorAPI;\n        return res\n            .setImageVariableValueWithContext(id, value, JSON.stringify(context))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * @deprecated use `setValue` instead and pass `null` as the value argument.\n     *\n     * This method removes the variable source\n     * @param id the id of the variable to update\n     */\n    removeSource = async (id: string) => {\n        return this.setValue(id, null);\n    };\n\n    /**\n     * @experimental Sets the prefix for a supported variable\n     * @param id the id of the variable to update\n     * @param prefix the prefix to set/clear\n     * @returns\n     */\n    setPrefix = async (id: string, prefix: string | null) => {\n        const update = { prefix: { value: prefix } };\n        return this.applyPrefixSuffixDeltaUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the suffix for a supported variable\n     * @param id the id of the variable to update\n     * @param suffix the suffix to set/clear\n     * @returns\n     */\n    setSuffix = async (id: string, suffix: string | null) => {\n        const update = { suffix: { value: suffix } };\n        return this.applyPrefixSuffixDeltaUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the prefix character style for a supported variable\n     * @param id the id of the variable to update\n     * @param characterStyleId the id of the character style to use/clear for the prefix\n     * @returns\n     */\n    setPrefixCharacterStyle = async (id: string, characterStyleId: string | null) => {\n        const update = { prefixCharacterStyleId: { value: characterStyleId } };\n        return this.applyPrefixSuffixDeltaUpdate(id, update);\n    };\n\n    /**\n     * @experimental Sets the suffix character style for a supported variable\n     * @param id the id of the variable to update\n     * @param characterStyleId the id of the character style to use/clear for the suffix\n     * @returns\n     */\n    setSuffixCharacterStyle = async (id: string, characterStyleId: string | null) => {\n        const update = { suffixCharacterStyleId: { value: characterStyleId } };\n        return this.applyPrefixSuffixDeltaUpdate(id, update);\n    };\n\n    /**\n     * Sets the private data for any variable\n     * @param id the id of the variable to update\n     * @param privateData the private data\n     * @returns\n     */\n    setPrivateData = async (id: string, privateData: PrivateData) => {\n        const res = await this.#editorAPI;\n        return res\n            .setVariablePrivateData(id, JSON.stringify(privateData))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Gets the private data for any variable\n     * @param id the id of the variable\n     * @returns the private data\n     */\n    getPrivateData = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.getVariablePrivateData(id).then((result) => getEditorResponseData<PrivateData>(result));\n    };\n\n    /**\n     * This method sets the allowQuery flag for an image variable\n     * @param id the id of the variable\n     * @param allowQuery the allowQuery flag\n     * @returns\n     */\n    setAllowImageQuery = async (id: string, allowQuery: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setImageVariableAllowQuery(id, allowQuery).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the allowUpload flag for an image variable\n     * @param id the id of the variable\n     * @param allowUpload the allowUpload flag\n     * @returns\n     */\n    setAllowImageUpload = async (id: string, allowUpload: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setImageVariableAllowUpload(id, allowUpload).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the minimum size (both width and height) for an image variable that will be uploaded\n     * @param id the id of the variable\n     * @param minWidth the minimum width\n     * @param minHeight the minimum height\n     * @returns\n     */\n    setMinImageUploadSize = async (id: string, minWidth: string | null, minHeight: string | null) => {\n        const res = await this.#editorAPI;\n        return res\n            .setImageVariableUploadMinSize(id, minWidth, minHeight)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * Sets the \"don't break\" flag for a short text variable. When set to true, the variable will not be split across lines.\n     * @param id the id of the variable\n     * @param isDontBreak the value of the \"don't break\" flag\n     * @returns\n     */\n    setIsDontBreak = async (id: string, isDontBreak: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setVariableIsDontBreak(id, isDontBreak).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method highlights the usages of a variable in\n     * - pages\n     * - frames\n     * - actionTrigger\n     * - variables\n     * - outputDataSource\n     * @param id the id of the variable\n     * @returns the usages of the variable\n     */\n    highlightUsages = async (id: string): Promise<EditorResponse<VariableUsagesReport>> => {\n        const res = await this.#editorAPI;\n        return res.highlightVariableUsages(id).then((result) => getEditorResponseData<VariableUsagesReport>(result));\n    };\n\n    private makeVariablesBackwardsCompatible(variables: Variable[]) {\n        return variables.map((variable) => {\n            return this.makeVariableBackwardsCompatible(variable);\n        });\n    }\n\n    private makeVariableBackwardsCompatible(variable: Variable) {\n        if (variable.type !== VariableType.list) {\n            return variable;\n        }\n\n        return this.makeListVariableBackwardsCompatible(variable as ListVariable);\n    }\n\n    private makeListVariableBackwardsCompatible(listVariable: ListVariable) {\n        const updated = listVariable;\n\n        const items = listVariable.items as unknown as ListVariableItem[];\n        const selected = listVariable.selected as unknown as ListVariableItem | undefined;\n\n        const newItems = items.map((item) => item.value);\n\n        updated.items = newItems;\n        updated.selected = selected?.value;\n\n        return updated;\n    }\n\n    private async applyPrefixSuffixDeltaUpdate(id: string, update: PrefixSuffixDeltaUpdate) {\n        const res = await this.#editorAPI;\n        const result = await res.updateVariablePrefixSuffixProperties(id, JSON.stringify(update));\n        return getEditorResponseData<null>(result);\n    }\n}\n","import { RuntimeConfigType } from '../../types/CommonTypes';\n\n/**\n * The SubscriberController is responsible for all listeners which can influence the application-state from outside.\n * Callbacks inside this controller can be set by `window.SDK.subscriber.{method-name}`\n */\nexport class SubscriberController {\n    /**\n     * @ignore\n     */\n    private config: RuntimeConfigType;\n\n    /**\n     * @ignore\n     */\n    constructor(config: RuntimeConfigType) {\n        this.config = config;\n    }\n\n    /**\n     * Listener on when variables change\n     * @param variablesJson Stringified array of Variable\n     */\n    onVariableListChanged = (variablesJson: string) => {\n        this.config.events.onVariableListChanged.trigger(JSON.parse(variablesJson));\n    };\n\n    /**\n     * Listener on connectors, if this changes, this listener will get triggered with the updates\n     * @param connectors Stringified array of ConnectorInstance type\n     */\n    onConnectorsChanged = (connectors: string) => {\n        this.config.events.onConnectorsChanged.trigger(JSON.parse(connectors));\n    };\n\n    /**\n     * Listener on page size, this listener will get triggered when the page size is changed, while the document is a `project`.\n     * This will not emit anything if your document is a `template`.\n     * @param pageSize Stringified object of the PageSize\n     */\n    onPageSizeChanged = (pageSize: string) => {\n        this.config.events.onPageSizeChanged.trigger(JSON.parse(pageSize));\n    };\n\n    /**\n     * Listener on engine edit mode, if this changes, this listener will get triggered with the updates\n     * @param engineEditMode Stringified boolean of the EngineEditMode\n     */\n    onEngineEditModeChanged = (engineEditMode: string) => {\n        this.config.events.onEngineEditModeChanged.trigger(JSON.parse(engineEditMode));\n    };\n}\n","import { EditorAPI, Id } from '../../types/CommonTypes';\nimport { ListVariableItem, Variable } from '../../types/VariableTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { Dictionary } from '@chili-studio/connector-types';\n\nimport {\n    ConnectorGrafxRegistration,\n    ConnectorLocalRegistration,\n    ConnectorUrlRegistration,\n} from '../types/ConnectorTypes';\n\nexport class VariableController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    image: ImageVariableController;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.image = new ImageVariableController(editorAPI);\n    }\n\n    /**\n     * This method returns the list of variables\n     * @returns\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getVariables().then((result) => getEditorResponseData<Variable[]>(result));\n    };\n\n    /**\n     * This method returns a variable by id\n     * @param id the id of a specific variable\n     * @returns\n     */\n    getById = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.getVariableById(id).then((result) => getEditorResponseData<Variable>(result));\n    };\n\n    /**\n     * This method returns a variable by name\n     * @param name the name of a specific variable\n     * @returns\n     */\n    getByName = async (name: string) => {\n        const res = await this.#editorAPI;\n        return res.getVariableByName(name).then((result) => getEditorResponseData<Variable>(result));\n    };\n\n    /**\n     * This method sets the items of the list variable\n     *\n     * The items need to be unique and are not case sensitive.\n     *\n     * @param id the id of the list variable\n     * @param items the items of the list\n     * @returns\n     */\n    setListVariable = async (id: Id, items: ListVariableItem[]) => {\n        const res = await this.#editorAPI;\n        return res\n            .setListVariableItems(\n                id,\n                items.map((item) => JSON.stringify(item)),\n            )\n            .then((result) => getEditorResponseData<null>(result));\n    };\n}\n\nexport class ImageVariableController {\n    #editorAPI: EditorAPI;\n\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method sets the allow query for an image variable\n     * @param id the id of the variable\n     * @param allowQuery the allow query\n     * @returns\n     */\n    setAllowQuery = async (id: string, allowQuery: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setImageVariableAllowQuery(id, allowQuery).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the allow upload for an image variable\n     * @param id the id of the variable\n     * @param allowUpload the allow upload\n     * @returns\n     */\n    setAllowUpload = async (id: string, allowUpload: boolean) => {\n        const res = await this.#editorAPI;\n        return res.setImageVariableAllowUpload(id, allowUpload).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the minimum size (both width and height) for an image variable that will be uploaded\n     * @param id the id of the variable\n     * @param minWidth the minimum width\n     * @param minHeight the minimum height\n     * @returns\n     */\n    setMinUploadSize = async (id: string, minWidth: string | null, minHeight: string | null) => {\n        const res = await this.#editorAPI;\n        return res\n            .setImageVariableUploadMinSize(id, minWidth, minHeight)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method sets the image variable connector. Setting a connector will\n     * automatically remove the assetId linked to the connector if present.\n     * If a connector was the source of the variable, it will be unregistered.\n     * @param id The id of the image variable to update\n     * @param registration registration object containing all details about the connector\n     * @returns The new id of the connector\n     */\n    setConnector = async (\n        id: string,\n        registration: ConnectorLocalRegistration | ConnectorGrafxRegistration | ConnectorUrlRegistration,\n    ) => {\n        const res = await this.#editorAPI;\n\n        return res\n            .setImageVariableConnector(id, JSON.stringify(registration))\n            .then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method sets the connector context for an image variable\n     * @param id the id of the variable\n     * @param context the context dictionary\n     * @returns\n     */\n    setConnectorContext = async (id: string, context: Dictionary) => {\n        const res = await this.#editorAPI;\n        return res\n            .setImageVariableConnectorContext(id, JSON.stringify(context))\n            .then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import {\n    ConnectorGrafxRegistration,\n    ConnectorInstance,\n    ConnectorLocalRegistration,\n    ConnectorType,\n    ConnectorUrlRegistration,\n} from '../types/ConnectorTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { EditorAPI, Id } from '../../types/CommonTypes';\n\n/**\n * The ConnectorController manages lifetime of all available connectors, regardless of the type, in the\n * document. Use it to add/remove connectors to a template, or set specific configuration.\n *\n * The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an\n * implementation of a set of capabilities we need to interact with a certain external resource management system.\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\n * execute the media connector both on web using webassembly and on the server side during e.g. animation output\n * generation.\n * This controller is an interface to the running connector instance inside the studio engine. The engine will\n * automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered\n * manually.\n */\nexport class ConnectorController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * Registers a new connector in the SDK. After successful registration, depending\n     * on the connector type, the connector can be configured and used in the template\n     * Remember to add custom authentication information after registering the connector\n     * @param registration registration object containing all details about the connector\n     * @returns the Id of the newly created connector, this Id should be used going forward.\n     */\n    register = async (\n        registration: ConnectorGrafxRegistration | ConnectorUrlRegistration | ConnectorLocalRegistration,\n    ) => {\n        const res = await this.#editorAPI;\n\n        return res.registerConnector(JSON.stringify(registration)).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * Gets a connector by its id\n     * @param id the id of the connector\n     * @returns connector\n     */\n    getById = async (id: Id) => {\n        const res = await this.#editorAPI;\n        return res.getConnectorById(id).then((result) => getEditorResponseData<ConnectorInstance>(result));\n    };\n\n    /**\n     * Gets all available connectors of a 'ConnectorType'\n     * @param type type of connector you want to get\n     * @returns list of all available connectors of a 'ConnectorType'\n     */\n    getAllByType = async (type: ConnectorType) => {\n        const res = await this.#editorAPI;\n        return res.getConnectors(type).then((result) => getEditorResponseData<ConnectorInstance[]>(result));\n    };\n}\n","import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    #blobAPI: EditorRawAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n    }\n\n    /**\n     * This method will set the width of all pages to a specific value.\n     * This only works if the document is a project.\n     * @param width the string value that will be calculated (f.e. 1+1 will result in 2)  The default unit is in the current layout unit (e.g. px, mm, in)\n     * @returns\n     */\n    setWidth = async (width: string) => {\n        const res = await this.#editorAPI;\n        return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method will set the height of all pages to a specific value.\n     * This only works if the document is a project.\n     * @param height the string value that will be calculated (f.e. 1+1 will result in 2).  The default unit is in the current layout unit (e.g. px, mm, in)\n     * @returns\n     */\n    setHeight = async (height: string) => {\n        const res = await this.#editorAPI;\n        return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { Connection } from 'penpal';\nimport { EditorAPI, RuntimeConfigType } from '../types/CommonTypes';\nimport { SubscriberController } from './controllers/SubscriberController';\nimport { VariableController } from './controllers/VariableController';\nimport { ConnectorController } from './controllers/ConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { CanvasController } from '../controllers/CanvasController';\n\n/**\n * The next initiator is a split off on SDK level to tag next features.\n * The principle is that all breaking changes that we are anticipating, come into this section of the SDK.\n * This allows us to introduce breaking changes before bumping the SDK Major version, since we want to bundle some of them.\n * This way our major version can stay stable for longer, without sacrificing the flexibility we need to innovate.\n * Together with a major update, the functions and additions in this part of the SDK will be moved to the main part.\n * If you're using the next controller, you might need to import the typings also from the next types.\n * this can be referenced in your application as @chili-publish/studio-sdk/lib/src/next\n */\nexport class NextInitiator {\n    private config: RuntimeConfigType;\n    private connection: Connection;\n\n    /**\n     * @ignore\n     */\n    private editorAPI: EditorAPI;\n\n    subscriber: SubscriberController;\n    variable: VariableController;\n    connector: ConnectorController;\n    page: PageController;\n    canvas: CanvasController;\n\n    /**\n     * The next initiator is a split off on SDK level to tag next features\n     * The SDK should be configured clientside and it exposes all controllers to work with in other applications\n     * @param config The configuration object where the SDK and editor can get configured\n     */\n    constructor(config: RuntimeConfigType, connection: Connection, editorAPI: EditorAPI) {\n        this.config = config;\n        this.connection = connection;\n        this.editorAPI = editorAPI;\n\n        this.subscriber = new SubscriberController(config);\n        this.variable = new VariableController(this.editorAPI);\n        this.connector = new ConnectorController(this.editorAPI);\n        this.page = new PageController(this.editorAPI);\n        this.canvas = new CanvasController(this.editorAPI);\n    }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { CallbackErrorBehavior, LogCategory, LoggerFunction, LogLevel } from '../types/CommonTypes';\nexport abstract class EngineEventTrigger<T extends (...args: any[]) => any> {\n    constructor(protected logger?: LoggerFunction) {}\n\n    abstract trigger(...args: Parameters<T>): ReturnType<T>;\n\n    protected createEventHandlerFn(callbackFn: T, errorBehavior: CallbackErrorBehavior): T {\n        const wrapper: any = (...args: Parameters<T>) => {\n            try {\n                const result = callbackFn(...args);\n                // If the callback returns a promise, we need to await it\n                if (result instanceof Promise) {\n                    return result.catch((error) => this.handleError(error, errorBehavior, callbackFn.name));\n                }\n                return result;\n            } catch (error) {\n                this.handleError(error, errorBehavior, callbackFn.name);\n            }\n        };\n        return wrapper;\n    }\n\n    private handleError(error: unknown, errorBehavior: CallbackErrorBehavior, fnName: string) {\n        if (errorBehavior === CallbackErrorBehavior.log) {\n            this.logger?.(LogLevel.error, LogCategory.event, `Error in callback ${fnName}: ${error}`);\n        } else {\n            throw error;\n        }\n    }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { CallbackErrorBehavior, LoggerFunction } from '../types/CommonTypes';\nimport { EngineEventTrigger } from './EngineEventTrigger';\n\nexport class EngineCallbackHandler<T extends (...args: any[]) => any> extends EngineEventTrigger<T> {\n    constructor(private handler: () => T | undefined, logger?: LoggerFunction) {\n        super(logger);\n    }\n    /**\n     * Executes the defined handler with the provided arguments.\n     *\n     * @param args The arguments to pass to the callbacks.\n     * @returns The result of executing the callbacks.\n     */\n    trigger(...args: Parameters<T>): ReturnType<T> {\n        const handler = this.handler();\n        if (handler) {\n            return this.createEventHandlerFn(handler, CallbackErrorBehavior.throw)(...args);\n        }\n        return undefined as ReturnType<T>;\n    }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { CallbackErrorBehavior, LoggerFunction } from '../types/CommonTypes';\nimport { EngineEventTrigger } from './EngineEventTrigger';\n\ninterface Unsubscriber {\n    (): void;\n}\n\nexport class EngineEvent<T extends (...args: any[]) => void> extends EngineEventTrigger<T> {\n    private subscriptions: Set<T> = new Set();\n\n    constructor(private legacyHandler: () => T | undefined, logger?: LoggerFunction) {\n        super(logger);\n    }\n\n    /**\n     * Executes the registered callbacks with provided arguments\n     *\n     * @param args The arguments to pass to the callbacks.\n     * @returns The result of executing the callbacks.\n     */\n    trigger(...args: Parameters<T>): ReturnType<T> {\n        const handler = this.legacyHandler();\n        if (handler) {\n            this.createEventHandlerFn(handler, CallbackErrorBehavior.log)(...args);\n        }\n        for (const callback of this.subscriptions) {\n            callback(...args);\n        }\n        return undefined as ReturnType<T>;\n    }\n\n    /**\n     * Registers a callback function.\n     *\n     * @param callback - The callback function to register. This function will be invoked when the event occurs.\n     * @param errorBehavior - An optional parameter to define how to handle errors that appear in the callback function.\n     *                         Accepted values are:\n     *                         - \"log\": Logs the error to the console (default behavior)\n     *                         - \"throw\": Throws an error. Keep in mind that throwing of error in one of the callback will prevent calling of others\n     * @returns A function to unsubscribe the callback, preventing it from being invoked in the future.\n     */\n    registerCallback(callback: T, errorBehavior: CallbackErrorBehavior = CallbackErrorBehavior.log): Unsubscriber {\n        const callbackFn = this.createEventHandlerFn(callback, errorBehavior);\n        this.subscriptions.add(callbackFn);\n\n        return () => {\n            this.subscriptions.delete(callbackFn);\n        };\n    }\n}\n","import { DocumentAction } from '../types/ActionTypes';\nimport { AnimationPlaybackType, FrameAnimationType } from '../types/AnimationTypes';\nimport { BarcodeFrameValidationResult } from '../types/BarcodeTypes';\nimport { CharacterStyle } from '../types/CharacterStyleTypes';\nimport { DocumentColor } from '../types/ColorStyleTypes';\nimport {\n    AsyncError,\n    ConfigType,\n    Id,\n    LogLevel,\n    MaybePromise,\n    RuntimeConfigType,\n    SelectedLayoutFrame,\n} from '../types/CommonTypes';\nimport { AuthCredentials, AuthRefreshRequest, ConnectorEvent, ConnectorInstance } from '../types/ConnectorTypes';\nimport { DocumentIssue, UndoState } from '../types/DocumentTypes';\nimport { EngineEditMode } from '../types/EngineEditModeTypes';\nimport { DocumentFontFamily } from '../types/FontTypes';\nimport { Frame, FrameLayoutType } from '../types/FrameTypes';\nimport { LayoutListItemType, LayoutPropertiesType, MeasurementUnit } from '../types/LayoutTypes';\nimport { Page, PageSize } from '../types/PageTypes';\nimport { ParagraphStyle } from '../types/ParagraphStyleTypes';\nimport { CornerRadiusUpdateModel } from '../types/ShapeTypes';\nimport { SelectedTextStyle } from '../types/TextStyleTypes';\nimport { Variable } from '../types/VariableTypes';\nimport { ViewMode } from '../types/ViewModeTypes';\nimport { Viewport } from '../types/ViewportTypes';\nimport { EngineCallbackHandler } from './EngineCallbackHandler';\nimport { EngineEvent } from './EngineEvent';\nimport { ToolType } from './Enums';\nimport { BrandKitMedia } from '../types/BrandKitTypes';\n\nexport class ConfigHelper {\n    /**\n     * Creates a runtime configuration object from the provided configuration object.\n     *\n     * @param config The configuration object to create the runtime configuration object from.\n     * @returns The runtime configuration object.\n     */\n    static createRuntimeConfig(config: ConfigType): RuntimeConfigType {\n        // we need a reference to the clone object in the engineEvent, so we need to create the object in 2 steps\n        const clone: RuntimeConfigType = { ...config } as RuntimeConfigType;\n        clone.logging = {\n            logLevel: config.logging?.logLevel || LogLevel.error,\n            logger:\n                config.logging?.logger ||\n                ((level, cat, msg) => {\n                    if (!ConfigHelper.isLoggingEnabled(level, clone.logging?.logLevel ?? LogLevel.error)) {\n                        return;\n                    }\n\n                    switch (level) {\n                        case LogLevel.error:\n                            console.error(`[${cat}] [${level}] ${msg}`);\n                            break;\n                        case LogLevel.warn:\n                            console.warn(`[${cat}] [${level}] ${msg}`);\n                            break;\n                        default:\n                            console.log(`[${cat}] [${level}] ${msg}`);\n                    }\n                }),\n        };\n        clone.handlers = {\n            onAuthExpired: new EngineCallbackHandler<\n                (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>\n            >(() => clone.onAuthExpired, clone.logging?.logger),\n            onViewportRequested: new EngineCallbackHandler<() => Viewport | null>(\n                () => clone.onViewportRequested,\n                clone.logging?.logger,\n            ),\n        };\n        clone.events = {\n            onActionsChanged: new EngineEvent<(state: DocumentAction[]) => MaybePromise<void>>(\n                () => clone.onActionsChanged,\n                clone.logging?.logger,\n            ),\n            onStateChanged: new EngineEvent<() => MaybePromise<void>>(\n                () => clone.onStateChanged,\n                clone.logging?.logger,\n            ),\n\n            onDocumentLoaded: new EngineEvent<() => MaybePromise<void>>(\n                () => clone.onDocumentLoaded,\n                clone.logging?.logger,\n            ),\n            onSelectedFramesLayoutChanged: new EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>(\n                () => clone.onSelectedFramesLayoutChanged,\n                clone.logging?.logger,\n            ),\n            onFramesLayoutChanged: new EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>(\n                () => clone.onFramesLayoutChanged,\n                clone.logging?.logger,\n            ),\n            onSelectedFramesContentChanged: new EngineEvent<(state: Frame[]) => MaybePromise<void>>(\n                () => clone.onSelectedFramesContentChanged,\n                clone.logging?.logger,\n            ),\n            onPageSelectionChanged: new EngineEvent<(id: Id) => MaybePromise<void>>(\n                () => clone.onPageSelectionChanged,\n                clone.logging?.logger,\n            ),\n            onSelectedLayoutPropertiesChanged: new EngineEvent<(state: LayoutPropertiesType) => MaybePromise<void>>(\n                () => clone.onSelectedLayoutPropertiesChanged,\n                clone.logging?.logger,\n            ),\n            onSelectedLayoutUnitChanged: new EngineEvent<(unit: MeasurementUnit) => MaybePromise<void>>(\n                () => clone.onSelectedLayoutUnitChanged,\n                clone.logging?.logger,\n            ),\n            onScrubberPositionChanged: new EngineEvent<(state: AnimationPlaybackType) => MaybePromise<void>>(\n                () => clone.onScrubberPositionChanged,\n                clone.logging?.logger,\n            ),\n            onFrameAnimationsChanged: new EngineEvent<(animationState: FrameAnimationType[]) => MaybePromise<void>>(\n                () => clone.onFrameAnimationsChanged,\n                clone.logging?.logger,\n            ),\n            onVariableListChanged: new EngineEvent<(variableList: Variable[]) => MaybePromise<void>>(\n                () => clone.onVariableListChanged,\n                clone.logging?.logger,\n            ),\n            onSelectedToolChanged: new EngineEvent<(tool: ToolType) => MaybePromise<void>>(\n                () => clone.onSelectedToolChanged,\n                clone.logging?.logger,\n            ),\n            onUndoStackStateChanged: new EngineEvent<(undoStackState: UndoState) => MaybePromise<void>>(\n                () => clone.onUndoStackStateChanged,\n                clone.logging?.logger,\n            ),\n            onSelectedLayoutFramesChanged: new EngineEvent<(frames: SelectedLayoutFrame[]) => MaybePromise<void>>(\n                () => clone.onSelectedLayoutFramesChanged,\n                clone.logging?.logger,\n            ),\n            onSelectedTextStyleChanged: new EngineEvent<(styles: SelectedTextStyle) => MaybePromise<void>>(\n                () => clone.onSelectedTextStyleChanged,\n                clone.logging?.logger,\n            ),\n            onColorsChanged: new EngineEvent<(colors: DocumentColor[]) => MaybePromise<void>>(\n                () => clone.onColorsChanged,\n                clone.logging?.logger,\n            ),\n            onParagraphStylesChanged: new EngineEvent<(paragraphStyles: ParagraphStyle[]) => MaybePromise<void>>(\n                () => clone.onParagraphStylesChanged,\n                clone.logging?.logger,\n            ),\n            onCharacterStylesChanged: new EngineEvent<(characterStyles: CharacterStyle[]) => MaybePromise<void>>(\n                () => clone.onCharacterStylesChanged,\n                clone.logging?.logger,\n            ),\n            onFontFamiliesChanged: new EngineEvent<(fontFamilies: DocumentFontFamily[]) => MaybePromise<void>>(\n                () => clone.onFontFamiliesChanged,\n                clone.logging?.logger,\n            ),\n            onSelectedLayoutIdChanged: new EngineEvent<(layoutId: string) => MaybePromise<void>>(\n                () => clone.onSelectedLayoutIdChanged,\n                clone.logging?.logger,\n            ),\n            onLayoutsChanged: new EngineEvent<(layouts: LayoutListItemType[]) => MaybePromise<void>>(\n                () => clone.onLayoutsChanged,\n                clone.logging?.logger,\n            ),\n            onConnectorEvent: new EngineEvent<(event: ConnectorEvent) => MaybePromise<void>>(\n                () => clone.onConnectorEvent,\n                clone.logging?.logger,\n            ),\n            onConnectorsChanged: new EngineEvent<(connectors: ConnectorInstance[]) => MaybePromise<void>>(\n                () => clone.onConnectorsChanged,\n                clone.logging?.logger,\n            ),\n            onZoomChanged: new EngineEvent<(scaleFactor: number) => MaybePromise<void>>(\n                () => clone.onZoomChanged,\n                clone.logging?.logger,\n            ),\n            onSelectedPageIdChanged: new EngineEvent<(pageId: Id) => MaybePromise<void>>(\n                () => clone.onSelectedPageIdChanged,\n                clone.logging.logger,\n            ),\n            onPagesChanged: new EngineEvent<(pages: Page[]) => MaybePromise<void>>(\n                () => clone.onPagesChanged,\n                clone.logging.logger,\n            ),\n            onPageSnapshotInvalidated: new EngineEvent<(pageId: Id) => MaybePromise<void>>(\n                () => clone.onPageSnapshotInvalidated,\n                clone.logging.logger,\n            ),\n            onPageSizeChanged: new EngineEvent<(pageSize: PageSize) => MaybePromise<void>>(\n                () => clone.onPageSizeChanged,\n                clone.logging?.logger,\n            ),\n            onShapeCornerRadiusChanged: new EngineEvent<(cornerRadius: CornerRadiusUpdateModel) => MaybePromise<void>>(\n                () => clone.onShapeCornerRadiusChanged,\n                clone.logging?.logger,\n            ),\n            onCropActiveFrameIdChanged: new EngineEvent<(id?: Id) => MaybePromise<void>>(\n                () => clone.onCropActiveFrameIdChanged,\n                clone.logging?.logger,\n            ),\n            onAsyncError: new EngineEvent<(asyncError: AsyncError) => MaybePromise<void>>(\n                () => clone.onAsyncError,\n                clone.logging?.logger,\n            ),\n            onViewModeChanged: new EngineEvent<(tool: ViewMode) => MaybePromise<void>>(\n                () => clone.onViewModeChanged,\n                clone.logging?.logger,\n            ),\n            onBarcodeValidationChanged: new EngineEvent<\n                (validationResults: BarcodeFrameValidationResult[]) => MaybePromise<void>\n            >(() => clone.onBarcodeValidationChanged, clone.logging?.logger),\n            onDataSourceIdChanged: new EngineEvent<(connectorId?: Id) => MaybePromise<void>>(\n                () => clone.onDataSourceIdChanged,\n                clone.logging.logger,\n            ),\n            onDocumentIssueListChanged: new EngineEvent<(documentIssues: DocumentIssue[]) => MaybePromise<void>>(\n                () => clone.onDocumentIssueListChanged,\n                clone.logging.logger,\n            ),\n            onCustomUndoDataChanged: new EngineEvent<(customData: Record<string, string>) => MaybePromise<void>>(\n                () => clone.onCustomUndoDataChanged,\n                clone.logging.logger,\n            ),\n            onEngineEditModeChanged: new EngineEvent<(engineEditMode: EngineEditMode) => MaybePromise<void>>(\n                () => clone.onEngineEditModeChanged,\n                clone.logging.logger,\n            ),\n            onBrandKitMediaChanged: new EngineEvent<(brandKitMedia: BrandKitMedia[]) => MaybePromise<void>>(\n                () => clone.onBrandKitMediaChanged,\n                clone.logging.logger,\n            ),\n        };\n        return clone;\n    }\n\n    private static isLoggingEnabled(level: LogLevel, logLevel: LogLevel): boolean {\n        if (logLevel == LogLevel.info) {\n            return true;\n        }\n        if (logLevel == LogLevel.warn && (level == LogLevel.warn || level == LogLevel.error)) {\n            return true;\n        }\n        return logLevel == LogLevel.error && level == LogLevel.error;\n    }\n}\n","import { DataItem } from '../types/DataConnectorTypes';\n\n/**\n * Utility tools for mapping between `EngineDataItem` and `DataItem`.\n */\nexport class DataItemMappingTools {\n    /**\n     * Checks if the given value is a `DatePropertyWrapper`.\n     *\n     * @param value The value to check.\n     * @returns `true` if the value is a `DatePropertyWrapper`, otherwise `false`.\n     */\n    private isDatePropertyWrapper(\n        value: string | number | boolean | DatePropertyWrapper | null,\n    ): value is DatePropertyWrapper {\n        return typeof value === 'object' && value?.type === 'date';\n    }\n\n    /**\n     * Checks if the given value is a `Date` object instance.\n     *\n     * @param value The value to check.\n     * @returns `true` if the value is a `Date` object, otherwise `false`.\n     */\n    private isDateObject(value: string | number | boolean | Date | null): value is Date {\n        return value instanceof Date;\n    }\n\n    /**\n     * Transforms an `EngineDataItem` into a `DataItem`.\n     *\n     * Converts `DatePropertyWrapper` values to JavaScript `Date` objects\n     * while keeping other values unchanged.\n     *\n     * @param dataItem the EngineDataItem to transform.\n     * @returns the resulting `DataItem` with parsed date properties.\n     */\n    mapEngineToDataItem(dataItem: EngineDataItem): DataItem {\n        const parsedItem: DataItem = {};\n\n        Object.entries(dataItem).forEach(([key, value]) => {\n            parsedItem[key] = this.isDatePropertyWrapper(value) ? new Date(value.value) : value;\n        });\n\n        return parsedItem;\n    }\n\n    /**\n     * Transforms a `DataItem` into an `EngineDataItem`.\n     *\n     * Converts JavaScript `Date` objects to `DatePropertyWrapper` objects\n     * while keeping other values unchanged.\n     *\n     * @param dataItem the `DataItem` to transform.\n     * @returns the resulting `EngineDataItem` with parsed date properties.\n     */\n    mapDataItemToEngine(dataItem: DataItem): EngineDataItem {\n        const parsedItem: EngineDataItem = {};\n\n        Object.entries(dataItem).forEach(([key, value]) => {\n            parsedItem[key] = this.isDateObject(value)\n                ? ({ value: value.getTime(), type: 'date' } as DatePropertyWrapper)\n                : value;\n        });\n\n        return parsedItem;\n    }\n}\n\n/**\n * Internal type used to wrap date objects on the engine side.\n */\nexport type DatePropertyWrapper = {\n    value: number;\n    type: 'date';\n};\n\n/**\n * Engine data item type.\n */\nexport type EngineDataItem = {\n    [key: string]: string | number | boolean | DatePropertyWrapper | null;\n};\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { StudioOptionsDeltaUpdate, WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\n\n/**\n * The ConfigurationController allows setting editor session data. This data is not stored in the document and\n * can only be used at runtime. Amongst others, the configuration store is available to the editor connectors and\n * Javascript actions running in the editor.\n * Methods inside this controller can be called by `window.SDK.configuration.{method-name}`\n */\nexport abstract class ConfigurationController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    protected constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method returns the value for a given configuration key. If a value was not found in the configuration store\n     * this method returns an error. The key cannot be null.\n     * @returns value for a given configuration key\n     */\n    async getValue(key: WellKnownConfigurationKeys | string) {\n        const res = await this.#editorAPI;\n        return res.getConfigValue(key).then((result) => getEditorResponseData<string>(result));\n    }\n\n    /**\n     * This method sets, or overrides the value for a given key. Null values are not allowed for both key and value,\n     * using them will result in an error.\n     * @returns\n     */\n    async setValue(key: WellKnownConfigurationKeys | string, value: string) {\n        const res = await this.#editorAPI;\n        return res.setConfigValue(key, value).then((result) => getEditorResponseData<null>(result));\n    }\n\n    /**\n     * This method updates the studio options. Only defined options are updated, null values are ignored.\n     * @returns\n     */\n    async updateStudioOptions(options: StudioOptionsDeltaUpdate) {\n        const res = await this.#editorAPI;\n        return res.updateStudioOptions(JSON.stringify(options)).then((result) => getEditorResponseData<null>(result));\n    }\n\n    /**\n     * This method returns the engine session id. This id is unique for this engine session\n     * @returns the engine session id\n     */\n    async getEngineSessionId() {\n        const res = await this.#editorAPI;\n        return res.getEngineSessionId().then((result) => getEditorResponseData<string>(result));\n    }\n}\n","import { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\nimport { getEditorResponseData } from './EditorResponseData';\nimport { ConfigurationController } from '../controllers/ConfigurationController';\nimport { EditorAPI } from '../types/CommonTypes';\n\nexport class LocalConfigurationDecorator extends ConfigurationController {\n    /**\n     * @ignore\n     */\n    #localConfig: Map<string, string>;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\n        super(editorAPI);\n        this.#localConfig = localConfig;\n    }\n\n    /**\n     * This method returns the value for a given configuration key. If a value was not found in the configuration store,\n     * this method returns an error. The key cannot be null.\n     * @returns value for a given configuration key\n     */\n    async getValue(key: WellKnownConfigurationKeys | string) {\n        const value = this.#localConfig.get(key);\n        if (value != null) {\n            return getEditorResponseData<string>(\n                {\n                    status: 200,\n                    success: true,\n                    parsedData: value,\n                    data: value,\n                },\n                false,\n            );\n        }\n\n        return super.getValue(key);\n    }\n\n    /**\n     * This method sets or overrides the value for a given key.\n     * Null values are not allowed for both key and value,\n     * using them will result in an error.\n     * @returns\n     */\n    async setValue(key: WellKnownConfigurationKeys | string, value: string) {\n        const res = super.setValue(key, value);\n        this.#localConfig.set(key, value);\n        return res;\n    }\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { GradientUpdate, DocumentGradient } from '../types/GradientStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The GradientStyleController is responsible for all communication regarding gradient styles.\n * Methods inside this controller can be called by `window.SDK.gradientStyle.{method-name}`\n */\nexport class GradientStyleController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * This method returns the list of gradients\n     * @returns list of all gradients\n     */\n    getAll = async () => {\n        const res = await this.#editorAPI;\n        return res.getGradients().then((result) => getEditorResponseData<DocumentGradient[]>(result));\n    };\n\n    /**\n     * This method returns a gradient by id\n     * @param id the id of a specific gradient\n     * @returns gradient properties for given id\n     */\n    getById = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.getGradientById(id).then((result) => getEditorResponseData<DocumentGradient>(result));\n    };\n\n    /**\n     * This method creates a new gradient\n     * @returns the new created gradient id\n     */\n    create = async () => {\n        const res = await this.#editorAPI;\n        return res.createGradient().then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method duplicates a gradient by the id\n     * @param id the id of a specific gradient\n     * @returns id of the duplicated gradient\n     */\n    duplicate = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.duplicateGradient(id).then((result) => getEditorResponseData<Id>(result));\n    };\n\n    /**\n     * This method changes positions of gradients\n     * @param order the position of the gradients\n     * @param ids the list of gradient IDs\n     * @returns\n     */\n    move = async (order: number, ids: string[]) => {\n        const res = await this.#editorAPI;\n        return res.moveGradients(order, ids).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method renames a gradient\n     * @param id the id of a specific gradient\n     * @param newGradientName the new name of the gradient\n     * @returns\n     */\n    rename = async (id: string, newGradientName: string) => {\n        const res = await this.#editorAPI;\n        return res.renameGradient(id, newGradientName).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method updates a gradient\n     * @param id the id of a specific gradient\n     * @param newGradientProperties the new gradient properties\n     * @returns\n     */\n    update = async (id: string, newGradientProperties: GradientUpdate) => {\n        const res = await this.#editorAPI;\n        const properties = newGradientProperties;\n        return res.updateGradient(id, JSON.stringify(properties)).then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method removes a gradient\n     * @param id the id of a specific gradient\n     * @returns\n     */\n    remove = async (id: string) => {\n        const res = await this.#editorAPI;\n        return res.removeGradient(id).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { CallSender } from 'penpal';\nimport { EditorAPI, EditorRawAPI, EditorResponse } from '../types/CommonTypes';\nimport { Component, ComponentConnectorCapabilities, ComponentPreviewType } from '../types/ComponentConnectorTypes';\nimport { ConnectorConfigOptions, MetaData, QueryOptions, QueryPage } from '../types/ConnectorTypes';\nimport { getEditorResponseData, throwEditorResponseError } from '../utils/EditorResponseData';\n\n/**\n * @experimental This controller is still experimental and might change in future releases.\n *\n * The ComponentConnectorController is responsible for all communication regarding Component connectors.\n * Methods inside this controller can be called by `window.SDK.componentConnector.{method-name}`\n *\n * The way GraFx Studio handles different sources of Component is called 'ComponentConnector'.\n * A ComponentConnector is an implementation of a set of capabilities we need\n * to interact with a certain Component Asset Management system.\n * In essence, a connector is the combination of a JavaScript snippet and some metadata.\n * The JavaScript snippet is loaded in the studio engine using a sandboxed JavaScript execution engine (QuickJs).\n * This allows us to execute the Component connector\n * both on web using webassembly and on the server side during output generation.\n * This controller is an interface to the running connector instance inside the studio engine.\n */\nexport class ComponentConnectorController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n    #blobAPI: EditorRawAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n        this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n    }\n\n    /**\n     * @experimental This method is still experimental and might change in future releases.\n     * Query a specific ComponentConnector for data using both standardized queryOptions and the dynamic\n     * context as parameters.\n     * @param connectorId unique id of the Component connector\n     * @param queryOptions query options\n     * @param context context that will be available in the connector script.\n     * @returns array of component instances\n     */\n    query = async (connectorId: string, queryOptions: QueryOptions, context: MetaData = {}) => {\n        const res = await this.#editorAPI;\n        return res\n            .componentConnectorQuery(connectorId, JSON.stringify(queryOptions), JSON.stringify(context))\n            .then((result) => getEditorResponseData<QueryPage<Component>>(result));\n    };\n\n    /**\n     * @experimental This method is still experimental and might change in future releases.\n     * The combination of a `connectorId` and `componentId` is typically enough for a Component connector to\n     * perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the\n     * Component connector instance running in the editor engine.\n     * @param connectorId unique id of the Component connector\n     * @param componentId unique id of the Component to download\n     * @param previewType hint to the Component connector about desired format of the Component preview\n     * @param context dynamic map of additional options potentially used by the connector\n     * @returns\n     */\n    preview = async (\n        connectorId: string,\n        componentId: string,\n        previewType: ComponentPreviewType,\n        context: MetaData = {},\n    ): Promise<Uint8Array> => {\n        const res = await this.#blobAPI;\n        return res\n            .componentConnectorPreview(connectorId, componentId, previewType, JSON.stringify(context))\n            .then((result) => {\n                // Handle binary data (Uint8Array) directly\n                if (result instanceof Uint8Array) {\n                    return result;\n                }\n\n                // Handle structured response (EditorResponse) for non-success cases\n                if (typeof result === 'object' && result !== null && 'success' in result && !result.success) {\n                    throwEditorResponseError(result as EditorResponse<null>);\n                }\n\n                // Unexpected response type - throw error\n                throw new Error(`Unexpected response type: ${typeof result}.`);\n            });\n    };\n\n    /**\n     * @experimental This method is still experimental and might change in future releases.\n     * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This\n     * method allows you to discover which mappings are available for a given connector. If you want to use any of these\n     * mappings, they will be available in the `context` parameter of any connector method.\n     * @param connectorId unique id of the component connector\n     * @returns connector mappings\n     */\n    getConfigurationOptions = async (connectorId: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .componentConnectorGetConfigurationOptions(connectorId)\n            .then((result) => getEditorResponseData<ConnectorConfigOptions>(result));\n    };\n\n    /**\n     * @experimental This method is still experimental and might change in future releases.\n     * This method returns what capabilities the selected connector has. It gives an indication what methods can\n     * be used successfully for a certain connector.\n     * @param connectorId unique id of the component connector\n     * @returns ComponentConnectorCapabilities\n     */\n    getCapabilities = async (connectorId: string) => {\n        const res = await this.#editorAPI;\n        return res\n            .componentConnectorGetCapabilities(connectorId)\n            .then((result) => getEditorResponseData<ComponentConnectorCapabilities>(result));\n    };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ComponentFitEnum } from '../types/FrameTypes';\nimport { Variable } from '../types/VariableTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * @experimental This controller is experimental and may change without warning.\n * The ComponentController is responsible for all communication regarding Component frames.\n * Methods inside this controller can be called by `window.SDK.component.{method-name}`\n */\nexport class ComponentController {\n    /**\n     * @ignore\n     */\n    #editorAPI: EditorAPI;\n\n    /**\n     * @ignore\n     */\n    constructor(editorAPI: EditorAPI) {\n        this.#editorAPI = editorAPI;\n    }\n\n    /**\n     * @experimental This method will link (or unlink) a variable from the template to the component frame\n     * @param id the id of the componentFrame that needs to be updated.\n     * @param target the id of the variable, inside the component, that will be linked (or unlinked) to the source variable.\n     * @param source the id of the source variable from the template. If not provided, the variable will be unlinked.\n     * @returns\n     */\n    linkVariable = async (frameId: Id, target: Id, source?: Id) => {\n        const res = await this.#editorAPI;\n        return res\n            .linkComponentVariable(frameId, target, source, null)\n            .then((result) => getEditorResponseData<null>(result));\n    };\n\n    /**\n     * This method returns the list of variables of a component frame.\n     * @param id the id of the componentFrame.\n     * @returns\n     */\n    getComponentVariables = async (frameId: Id) => {\n        const res = await this.#editorAPI;\n        return res.getComponentVariables(frameId).then((result) => getEditorResponseData<Variable[]>(result));\n    };\n\n    /**\n     * This method sets the fit mode of a component frame.\n     * @param frameId the id of the component frame.\n     * @param fitMode the fit mode to set.\n     * @returns\n     */\n    setFitMode = async (frameId: Id, fitMode: ComponentFitEnum) => {\n        const res = await this.#editorAPI;\n        return res.setComponentLayoutFit(frameId, fitMode).then((result) => getEditorResponseData<null>(result));\n    };\n}\n","import { Connection } from 'penpal';\nimport engineInfo from '../editor-engine.json';\nimport packageInfo from '../package.json';\nimport Connect from './interactions/Connector';\nimport { defaultStudioOptions, WellKnownConfigurationKeys } from './types/ConfigurationTypes';\n\nimport type { ConfigType, EditorAPI, RuntimeConfigType } from './types/CommonTypes';\nimport { DocumentType } from './types/DocumentTypes';\n\nimport { ActionController } from './controllers/ActionController';\nimport { AnimationController } from './controllers/AnimationController';\nimport { BarcodeController } from './controllers/BarcodeController';\nimport { BrandKitController } from './controllers/BrandKitController';\nimport { CanvasController } from './controllers/CanvasController';\nimport { CharacterStyleController } from './controllers/CharacterStyleController';\nimport { ClipboardController } from './controllers/ClipboardController';\nimport { ColorConversionController } from './controllers/ColorConversionController';\nimport { ColorStyleController } from './controllers/ColorStyleController';\nimport { ConfigurationController } from './controllers/ConfigurationController';\nimport { ConnectorController } from './controllers/ConnectorController';\nimport { DataConnectorController } from './controllers/DataConnectorController';\nimport { DataSourceController } from './controllers/DataSourceController';\nimport { DebugController } from './controllers/DebugController';\nimport { DocumentController } from './controllers/DocumentController';\nimport { ExperimentController } from './controllers/ExperimentController';\nimport { FontConnectorController } from './controllers/FontConnectorController';\nimport { FontController } from './controllers/FontController';\nimport { FrameController } from './controllers/FrameController';\nimport { InfoController } from './controllers/InfoController';\nimport { LayoutController } from './controllers/LayoutController';\nimport { MediaConnectorController } from './controllers/MediaConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { ParagraphStyleController } from './controllers/ParagraphStyleController';\nimport { ShapeController } from './controllers/ShapeController';\nimport { SubscriberController } from './controllers/SubscriberController';\nimport { TextStyleController } from './controllers/TextStyleController';\nimport { ToolController } from './controllers/ToolController';\nimport { UndoManagerController } from './controllers/UndoManagerController';\nimport { UtilsController } from './controllers/UtilsController';\nimport { VariableController } from './controllers/VariableController';\nimport { NextSubscribers } from './next';\nimport { NextInitiator } from './next/NextInitiator';\nimport { ConfigHelper } from './utils/ConfigHelper';\nimport { DataItemMappingTools } from './utils/DataItemMappingTools';\nimport { LocalConfigurationDecorator } from './utils/LocalConfigurationDecorator';\nimport { GradientStyleController } from './controllers/GradientStyleController';\nimport { ComponentConnectorController } from './controllers/ComponentConnectorController';\nimport { ComponentController } from './controllers/ComponentController';\n\ndeclare const __ENGINE_DOMAIN__: string;\nconst ENGINE_DOMAIN = typeof __ENGINE_DOMAIN__ !== 'undefined' ? __ENGINE_DOMAIN__ : 'studio-cdn.chiligrafx.com';\nconst FIXED_EDITOR_LINK = `https://${ENGINE_DOMAIN}/editor/${engineInfo.current}/web`;\n\nlet connection: Connection;\n\nexport class SDK {\n    config: RuntimeConfigType;\n    connection: Connection;\n\n    /**\n     * @ignore\n     */\n    editorAPI: EditorAPI;\n\n    action: ActionController;\n    layout: LayoutController;\n    frame: FrameController;\n    shape: ShapeController;\n    barcode: BarcodeController;\n    /** @experimental */\n    component: ComponentController;\n    connector: ConnectorController;\n    mediaConnector: MediaConnectorController;\n    fontConnector: FontConnectorController;\n    /**\n     * @experimental This controller is still experimental and might change in future releases.\n     */\n    componentConnector: ComponentConnectorController;\n    dataConnector: DataConnectorController;\n    dataSource: DataSourceController;\n    animation: AnimationController;\n    document: DocumentController;\n    configuration: ConfigurationController;\n    variable: VariableController;\n    utils: UtilsController;\n    tool: ToolController;\n    page: PageController;\n    debug: DebugController;\n    undoManager: UndoManagerController;\n    textSelection: TextStyleController;\n    paragraphStyle: ParagraphStyleController;\n    characterStyle: CharacterStyleController;\n    colorStyle: ColorStyleController;\n    gradientStyle: GradientStyleController;\n    font: FontController;\n    experiment: ExperimentController;\n    canvas: CanvasController;\n    colorConversion: ColorConversionController;\n    info: InfoController;\n    clipboard: ClipboardController;\n    brandKit: BrandKitController;\n    next: NextInitiator;\n\n    private subscriber: SubscriberController;\n    private enabledNextSubscribers: NextSubscribers | undefined;\n    private localConfig = new Map<string, string>();\n    private dataItemMappingTools = new DataItemMappingTools();\n\n    /**\n     * The SDK should be configured clientside and it exposes all controllers to work with in other applications\n     * @param config The configuration object where the SDK and editor can get configured\n     */\n    constructor(config: ConfigType) {\n        this.config = ConfigHelper.createRuntimeConfig(config);\n\n        this.connection = connection;\n        this.editorAPI = connection?.promise.then((child) => {\n            return child;\n        }) as unknown as EditorAPI;\n\n        this.action = new ActionController(this.editorAPI);\n        this.layout = new LayoutController(this.editorAPI);\n        this.frame = new FrameController(this.editorAPI);\n        this.shape = new ShapeController(this.editorAPI);\n        this.barcode = new BarcodeController(this.editorAPI);\n        this.component = new ComponentController(this.editorAPI);\n        this.undoManager = new UndoManagerController(this.editorAPI, this);\n        this.connector = new ConnectorController(this.editorAPI, this.localConfig);\n        this.mediaConnector = new MediaConnectorController(this.editorAPI);\n        this.fontConnector = new FontConnectorController(this.editorAPI);\n        this.componentConnector = new ComponentConnectorController(this.editorAPI);\n        this.dataConnector = new DataConnectorController(this.editorAPI, this.dataItemMappingTools);\n        this.dataSource = new DataSourceController(this.editorAPI, this.dataItemMappingTools);\n        this.animation = new AnimationController(this.editorAPI);\n        this.document = new DocumentController(this.editorAPI);\n\n        this.configuration = new LocalConfigurationDecorator(this.editorAPI, this.localConfig);\n        this.variable = new VariableController(this.editorAPI);\n        this.utils = new UtilsController(this.editorAPI, this.localConfig);\n        this.subscriber = new SubscriberController(this.config, this.localConfig);\n        this.tool = new ToolController(this.editorAPI);\n        this.page = new PageController(this.editorAPI);\n        this.debug = new DebugController(this.editorAPI);\n        // To be renamed textSelection > textStyle\n        this.textSelection = new TextStyleController(this.editorAPI);\n        this.colorStyle = new ColorStyleController(this.editorAPI);\n        this.gradientStyle = new GradientStyleController(this.editorAPI);\n        this.paragraphStyle = new ParagraphStyleController(this.editorAPI);\n        this.characterStyle = new CharacterStyleController(this.editorAPI);\n        this.font = new FontController(this.editorAPI);\n        this.experiment = new ExperimentController(this.editorAPI);\n        this.canvas = new CanvasController(this.editorAPI);\n        this.colorConversion = new ColorConversionController(this.editorAPI);\n        this.info = new InfoController();\n        this.clipboard = new ClipboardController(this.editorAPI);\n        this.next = new NextInitiator(this.config, this.connection, this.editorAPI);\n        this.enabledNextSubscribers = this.config.enableNextSubscribers;\n        this.brandKit = new BrandKitController(this.editorAPI, this);\n    }\n\n    /**\n     * This method will initiate the editor, running this will result in the editor restarting\n     * It will generate an iframe in the document\n     */\n    loadEditor = () => {\n        Connect(\n            this.config.editorLink || FIXED_EDITOR_LINK,\n            {\n                onActionsChanged: this.subscriber.onActionsChanged,\n                onStateChanged: this.subscriber.onStateChanged,\n                onAuthExpired: this.subscriber.onAuthExpired,\n                onViewportRequested: this.subscriber.onViewportRequested,\n                onDocumentLoaded: this.subscriber.onDocumentLoaded,\n                onSelectedFramesContentChanged: this.subscriber.onSelectedFramesContentChanged,\n                onSelectedFramesLayoutChanged: this.subscriber.onSelectedFramesLayoutChanged,\n                onFramesLayoutChanged: this.subscriber.onFramesLayoutChanged,\n                onSelectedLayoutPropertiesChanged: this.subscriber.onSelectedLayoutPropertiesChanged,\n                onSelectedLayoutUnitChanged: this.subscriber.onSelectedLayoutUnitChanged,\n                onPageSelectionChanged: this.subscriber.onPageSelectionChanged,\n                onScrubberPositionChanged: this.subscriber.onAnimationPlaybackChanged,\n                onFrameAnimationsChanged: this.subscriber.onAnimationChanged,\n                onVariableListChanged: (state) => {\n                    if (this.enabledNextSubscribers?.onVariableListChanged) {\n                        this.next.subscriber.onVariableListChanged(state);\n                    } else {\n                        this.subscriber.onVariableListChanged(state);\n                    }\n                },\n                onSelectedToolChanged: this.subscriber.onSelectedToolChanged,\n                onUndoStateChanged: this.subscriber.onUndoStateChanged,\n                onSelectedLayoutFramesChanged: this.subscriber.onSelectedLayoutFramesChanged,\n                onSelectedTextStyleChanged: this.subscriber.onSelectedTextStyleChanged,\n                onColorsChanged: this.subscriber.onColorsChanged,\n                onParagraphStylesChanged: this.subscriber.onParagraphStylesChanged,\n                onCharacterStylesChanged: this.subscriber.onCharacterStylesChanged,\n                onFontFamiliesChanged: this.subscriber.onFontFamiliesChanged,\n                onSelectedLayoutIdChanged: this.subscriber.onSelectedLayoutIdChanged,\n                onLayoutsChanged: this.subscriber.onLayoutsChanged,\n                onConnectorEvent: this.subscriber.onConnectorEvent,\n                onConnectorsChanged: (state) => {\n                    if (this.enabledNextSubscribers?.onConnectorsChanged) {\n                        this.next.subscriber.onConnectorsChanged(state);\n                    } else {\n                        this.subscriber.onConnectorsChanged(state);\n                    }\n                },\n                onZoomChanged: this.subscriber.onZoomChanged,\n                onSelectedPageIdChanged: this.subscriber.onSelectedPageIdChanged,\n                onPagesChanged: this.subscriber.onPagesChanged,\n                onPageSnapshotInvalidated: this.subscriber.onPageSnapshotInvalidated,\n                onPageSizeChanged: (state) => {\n                    if (this.enabledNextSubscribers?.onPageSizeChanged) {\n                        this.next.subscriber.onPageSizeChanged(state);\n                    } else {\n                        this.subscriber.onPageSizeChanged(state);\n                    }\n                },\n                onShapeCornerRadiusChanged: this.subscriber.onShapeCornerRadiusChanged,\n                onCropActiveFrameIdChanged: this.subscriber.onCropActiveFrameIdChanged,\n                onAsyncError: this.subscriber.onAsyncError,\n                onViewModeChanged: this.subscriber.onViewModeChanged,\n                onBarcodeValidationChanged: this.subscriber.onBarcodeValidationChanged,\n                onDataSourceIdChanged: this.subscriber.onDataSourceIdChanged,\n                onDocumentIssueListChanged: this.subscriber.onDocumentIssueListChanged,\n                onCustomUndoDataChanged: this.subscriber.onCustomUndoDataChanged,\n                onEngineEditModeChanged: this.subscriber.onEngineEditModeChanged,\n                onBrandKitMediaChanged: this.subscriber.onBrandKitMediaChanged,\n            },\n            this.setConnection,\n            this.config.editorId,\n            this.config.studioStyling,\n            (error) => {\n                this.config.onConnectionError?.(error);\n            },\n        );\n        this.editorAPI = connection?.promise.then((editorAPI) => {\n            return editorAPI;\n        }) as unknown as EditorAPI;\n\n        this.action = new ActionController(this.editorAPI);\n        this.layout = new LayoutController(this.editorAPI);\n        this.frame = new FrameController(this.editorAPI);\n        this.barcode = new BarcodeController(this.editorAPI);\n        this.component = new ComponentController(this.editorAPI);\n        this.animation = new AnimationController(this.editorAPI);\n        this.document = new DocumentController(this.editorAPI);\n        this.configuration = new LocalConfigurationDecorator(this.editorAPI, this.localConfig);\n        this.utils = new UtilsController(this.editorAPI, this.localConfig);\n        this.tool = new ToolController(this.editorAPI);\n        this.page = new PageController(this.editorAPI);\n        this.debug = new DebugController(this.editorAPI);\n        this.undoManager = new UndoManagerController(this.editorAPI, this);\n        this.textSelection = new TextStyleController(this.editorAPI);\n        this.colorStyle = new ColorStyleController(this.editorAPI);\n        this.gradientStyle = new GradientStyleController(this.editorAPI);\n        this.paragraphStyle = new ParagraphStyleController(this.editorAPI);\n        this.characterStyle = new CharacterStyleController(this.editorAPI);\n        this.mediaConnector = new MediaConnectorController(this.editorAPI);\n        this.fontConnector = new FontConnectorController(this.editorAPI);\n        this.componentConnector = new ComponentConnectorController(this.editorAPI);\n        this.dataConnector = new DataConnectorController(this.editorAPI, this.dataItemMappingTools);\n        this.dataSource = new DataSourceController(this.editorAPI, this.dataItemMappingTools);\n        this.connector = new ConnectorController(this.editorAPI, this.localConfig);\n        this.variable = new VariableController(this.editorAPI);\n        this.font = new FontController(this.editorAPI);\n        this.experiment = new ExperimentController(this.editorAPI);\n        this.canvas = new CanvasController(this.editorAPI);\n        this.shape = new ShapeController(this.editorAPI);\n        this.colorConversion = new ColorConversionController(this.editorAPI);\n        this.info = new InfoController();\n        this.clipboard = new ClipboardController(this.editorAPI);\n        this.brandKit = new BrandKitController(this.editorAPI, this);\n        this.next = new NextInitiator(this.config, this.connection, this.editorAPI);\n\n        // as soon as the editor loads, provide it with the SDK version\n        // used to make it start. This enables engine compatibility checks\n        // on the Flutter side\n        this.configuration.setValue(WellKnownConfigurationKeys.GraFxStudioSdkVersion, packageInfo.version);\n\n        // Makes the engine aware which document type it should render, if this call\n        // isn't made, the engine will fall back to the type specified in the document.\n        //\n        // Loading a template JSON and setting the engine to `project` will cause\n        // the document JSON structure to be converted to a project on save.\n        // Using `getCurrentDocumentState` will also output the converted document.\n        this.configuration.setValue(\n            WellKnownConfigurationKeys.GraFxStudioDocumentType,\n            this.config.documentType || DocumentType.template,\n        );\n\n        // Update the engine with the specified options from the config or fall back to the defaults.\n        this.configuration.updateStudioOptions(this.config.studioOptions || defaultStudioOptions);\n\n        // Whether the engine should cache query calls. This is disabled by default.\n        this.configuration.setValue(\n            WellKnownConfigurationKeys.QueryCallCacheEnabled,\n            this.config.enableQueryCallCache?.toString() || 'false',\n        );\n    };\n\n    setConnection = (newConnection: Connection) => {\n        connection = newConnection;\n    };\n}\n\nexport default SDK;\n","import { Id } from './CommonTypes';\n\nexport enum SlideDirections {\n    top = 'top',\n    left = 'left',\n    right = 'right',\n    bottom = 'bottom',\n    topLeft = 'topLeft',\n    topRight = 'topRight',\n    bottomLeft = 'bottomLeft',\n    bottomRight = 'bottomRight',\n}\n\nexport enum ShakeDirections {\n    horizontal = 'horizontal',\n    vertical = 'vertical',\n}\n\nexport enum EaseTypes {\n    easeIn = 'easeIn',\n    easeOut = 'easeOut',\n    easeInOut = 'easeInOut',\n}\n\nexport enum TweenTypes {\n    quadratic = 'Quadratic',\n    cubic = 'Cubic',\n    quartic = 'Quartic',\n    quintic = 'Quintic',\n    sine = 'Sine',\n    exponential = 'Exponential',\n    circular = 'Circular',\n    elastic = 'Elastic',\n    bounce = 'Bounce',\n    back = 'Back',\n}\n\nexport enum BasicAnimationsEmphasisStyles {\n    bounce = 'bounce',\n    flash = 'flash',\n    headshake = 'headShake',\n    heartbeat = 'heartbeat',\n    pulse = 'pulse',\n    rubberBand = 'rubberBand',\n    vertical = 'vertical',\n    horizontal = 'horizontal',\n    swing = 'swing',\n    tada = 'tada',\n}\n\nexport type EaseTweenCombinationType = `${EaseTypes}${TweenTypes}` | 'noEase';\n\nexport type BasicAnimationsIntroOutroStylesType = {\n    slide?: {\n        direction: SlideDirections;\n        offsetPercent: number;\n    };\n    rotation?: {\n        angleDegrees: number;\n        numberOfRotations?: number;\n    };\n    scale?: {\n        scalePercent: number;\n    };\n    fade?: boolean;\n};\n\nexport type BasicAnimationsIntroType = {\n    from: number;\n    to: number;\n    ease: EaseTweenCombinationType;\n    styles: BasicAnimationsIntroOutroStylesType;\n};\n\nexport type BasicAnimationsEmphasisType = {\n    from: number;\n    to: number;\n    ease: EaseTweenCombinationType;\n    styles: {\n        bounce?: boolean;\n        flash?: boolean;\n        pulse?: boolean;\n        rubberBand?: boolean;\n        shake?: {\n            direction: ShakeDirections;\n        };\n        vertical?: boolean;\n        horizontal?: boolean;\n        headshake?: boolean;\n        swing?: boolean;\n        tada?: boolean;\n        heartbeat?: boolean;\n    };\n};\n\nexport type BasicAnimationsOutroType = {\n    from: number;\n    to: number;\n    ease: EaseTweenCombinationType;\n    styles: BasicAnimationsIntroOutroStylesType;\n};\n\nexport type BasicAnimationsType = {\n    intro?: BasicAnimationsIntroType;\n    emphasis?: BasicAnimationsEmphasisType;\n    outro?: BasicAnimationsOutroType;\n};\n\nexport type FrameAnimationPropertiesType = {\n    id: Id;\n    from: number;\n    to: number;\n    basicAnimations: BasicAnimationsType;\n    advancedAnimations?: unknown; // TBI\n};\nexport type FrameAnimationType = {\n    animation: FrameAnimationPropertiesType;\n    isOverride: boolean;\n};\n\nexport type AnimationPlaybackType = {\n    currentAnimationTimeMs: number;\n    animationIsPlaying: boolean;\n} | null;\n","export enum ViewMode {\n    preview = 'preview',\n    normal = 'normal',\n}\n","import { ColorUsage } from './ColorStyleTypes';\nimport { Id } from './CommonTypes';\n\nexport enum GradientType {\n    linear = 'linear',\n}\n\nexport type GradientDefinition = LinearGradientDefinition;\n\nexport type LinearGradientDefinition = {\n    colors: ColorUsage[];\n    stops: number[];\n    type: GradientType;\n};\n\nexport type GradientUpdate = GradientDefinition;\n\nexport type DocumentGradient = {\n    id: string;\n    name: string;\n    gradient: GradientDefinition;\n};\n\nexport type GradientUsage = LinearGradientUsage;\n\nexport type LinearGradientUsage = {\n    /**\n     * Indicates if the gradient will be applied or not.\n     */\n    enabled: boolean;\n    /**\n     * Reference to the brand kit color, can only be used if it is a brand kit color.\n     */\n    id?: Id;\n    /**\n     * The local color object, can only be used if it is a local color.\n     */\n    gradient?: LinearGradientDefinition;\n    /**\n     * The start and stop positions of the gradient. Relative to the frame size\n     */\n    startStop: RelativeOffsets;\n    type: GradientUsageType;\n};\n\nexport enum GradientUsageType {\n    /**\n     * The linear gradient is defined locally on the object\n     */\n    local = 'linearLocal',\n    /**\n     * The linear gradient is referencing a document gradient\n     */\n    linearBrandKit = 'linearBrandKit',\n}\n\nexport type GradientDeltaUpdate = {\n    /**\n     * Reference to the brand kit gradient, can only be used if it is a brand kit gradient.\n     */\n    id?: Id;\n    /**\n     * The local gradient object, can only be used if it is a local gradient.\n     */\n    gradient?: GradientUpdate;\n    /**\n     * Indicates if the gradient will be applied or not.\n     */\n    isApplied?: boolean;\n};\n\n/**\n * Represents relative start and end offsets\n */\nexport type RelativeOffsets = {\n    startX: number;\n    startY: number;\n    endX: number;\n    endY: number;\n};\n","export type { FontConnectorCapabilities, FontFamily, FontStyle } from '@chili-studio/connector-types';\n\nexport enum FontPreviewFormat {\n    Square = 'square',\n    Line = 'line',\n}\n","export type { Component, ComponentConnectorCapabilities } from '@chili-studio/connector-types';\n\n/**\n * @experimental This is still experimental and might change in future releases.\n */\nexport enum ComponentPreviewType {\n    thumbnail = 'thumbnail',\n    highest = 'highest',\n    medium = 'medium',\n}\n","import { ColorUsage } from './ColorStyleTypes';\nimport { VerticalAlign } from './FrameTypes';\n\nexport enum FontWeights {\n    BOLD = 'Bold',\n    ITALIC = 'Italic',\n    REGULAR = 'Regular',\n}\nexport enum Alignment {\n    LEFT = 'left',\n    CENTER = 'center',\n    RIGHT = 'right',\n    JUSTIFY = 'justify',\n}\n\nexport enum TextPosition {\n    TOP = 'top',\n    CENTER = 'center',\n    BOTTOM = 'bottom',\n}\nexport enum Case {\n    TO_LOWER_CASE = 'lowercase',\n    TO_UPPER_CASE = 'uppercase',\n    NORMAL = 'normal',\n}\nexport enum Scripting {\n    SUPERSCRIPT = 'superscript',\n    SUBSCRIPT = 'subscript',\n    NORMAL = 'normal',\n}\n\nexport type DisplayColor = ColorUsage & {\n    isApplied: boolean;\n};\nexport interface TextProperties {\n    fontKey?: string;\n    fontStyle?: FontWeights;\n    fontSize?: number;\n    textAlign?: Alignment;\n    verticalAlign?: VerticalAlign;\n    underline?: boolean;\n    lineThrough?: boolean;\n    letterSpacing?: string;\n    trackingRight?: string;\n    lineHeight?: number;\n    SUB_SUPER_SCRIPT?: Scripting;\n    typographicCase?: Case;\n    color?: DisplayColor;\n    [key: string]: number | string | Record<string, unknown> | null | boolean | undefined;\n}\n\nexport interface TextStyle {\n    paragraph?: string;\n    character?: string;\n    [key: string]: number | string | Record<string, unknown> | null | boolean | undefined;\n}\nexport type TextStyleUpdateType = {\n    [key in keyof typeof SelectedTextStyles]?: {\n        value: number | string | boolean;\n    };\n};\n\nexport interface AppearanceProperties {\n    blendMode?: string;\n    opacity?: string;\n    useFill?: boolean;\n    useStroke?: boolean;\n    useDropShadow?: boolean;\n    fillColor?: string;\n    strokeColor?: string;\n    dropShadowColor?: string;\n}\n\nexport interface SelectedTextStyle {\n    paragraphStyleId?: string;\n    characterStyleId?: string;\n    fontKey?: string;\n    fontSize?: number;\n    typographicCase?: Case;\n    kerningOn?: boolean;\n    subSuperScript?: Scripting;\n    trackingLeft?: number;\n    trackingRight?: number;\n    paragraphIndentStart?: string;\n    paragraphIndentEnd?: string;\n    paragraphSpaceBefore?: string;\n    paragraphSpaceAfter?: string;\n    textIndent?: string;\n    alignToBaseLine?: boolean;\n    baselineShiftValue?: string;\n    lineHeight?: number;\n    verticalAlign?: VerticalAlign;\n    copyfittingScale?: number;\n    textAlign?: HorizontalAlign;\n    textAlignLast?: HorizontalAlign;\n    textOverprint?: boolean;\n    color?: DisplayColor;\n    strokeColor?: DisplayColor;\n    fillColorApplied?: boolean;\n    strokeColorApplied?: boolean;\n    strokeWidth?: number;\n    underline?: boolean;\n    lineThrough?: boolean;\n    hasLocalFormatting: boolean;\n    markedListType?: MarkedListType;\n    markedListGroup?: string;\n    markedListLevel?: number;\n}\n\nexport enum HorizontalAlign {\n    left = 'left',\n    center = 'center',\n    right = 'right',\n    justify = 'justify',\n}\n\nexport enum MarkedListType {\n    none = 'none',\n    bullet = 'bullet',\n    number = 'number',\n}\n\nexport enum SelectedTextStyleSections {\n    STYLE = 'textStyle',\n    PROPERTIES = 'textProperties',\n    APPEARANCE = 'appearance',\n}\n\nexport enum SelectedTextStyles {\n    PARAGRAPH = 'paragraphStyleId',\n    CHARACTER = 'characterStyleId',\n    FONT_FAMILY = 'fontKey',\n    FONT_STYLE = 'fontStyle',\n    FONT_SIZE = 'fontSize',\n    LETTER_SPACING = 'letterSpacing',\n    LINE_HEIGHT = 'lineHeight',\n    TEXT_ALIGN = 'textAlign',\n    VERTICAL_ALIGN = 'verticalAlign',\n    TYPOGRAPHIC_CASE = 'typographicCase',\n    SUB_SUPER_SCRIPT = 'subSuperScript',\n    UNDERLINE = 'underline',\n    LINE_THROUGH = 'lineThrough',\n    FILL_COLOR = 'fillColor',\n    COLOR = 'color',\n    FILL_COLOR_APPLIED = 'fillColorApplied',\n    STROKE_COLOR = 'strokeColor',\n    STROKE_COLOR_APPLIED = 'strokeColorApplied',\n    DROP_SHADOW_COLOR = 'dropShadowColor',\n    BLEND_MODE = 'blendMode',\n    OPACITY = 'opacity',\n    TRACKING_RIGHT = 'trackingRight',\n    BASELINE_SHIFT = 'baselineShiftValue',\n    STROKE_WIDTH = 'strokeWidth',\n    MARKED_LIST_TYPE = 'markedListType',\n    MARKED_LIST_GROUP = 'markedListGroup',\n    MARKED_LIST_LEVEL = 'markedListLevel',\n}\n\nexport interface UpdateStyleType {\n    path: { value: number | string | Record<string, unknown> | null | boolean | undefined };\n}\n","import { ColorUsage, ColorUsageUpdate } from './ColorStyleTypes';\nimport { Id } from './CommonTypes';\nimport { Alignment, Case, Scripting } from './TextStyleTypes';\n\nexport type ParagraphStyle = {\n    id: Id;\n    name: string;\n    fontKey: string;\n    fontStyle: string;\n    fontSize: number;\n    typographicCase: Case;\n    kerningOn: boolean;\n    subSuperScript: Scripting;\n    // the following properties are unit properties\n    trackingLeft: number;\n    trackingRight: number;\n    startIndent: string;\n    endIndent: string;\n    spaceBefore: string;\n    spaceAfter: string;\n    textIndent: string;\n    // end of unit properties\n    alignToBaseLine: boolean;\n    baselineShiftValue: string;\n    lineHeight: number;\n    textAlign: Alignment;\n    textAlignLast: Alignment;\n    textOverprint: boolean;\n    color: ColorUsage;\n    strokeColor: ColorUsage;\n    fillColorApplied: boolean;\n    strokeColorApplied: boolean;\n    strokeWidth: number;\n    underline: boolean;\n    lineThrough: boolean;\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    bulletListStyle: BulletListStyle;\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    numericListStyle: NumericListStyle;\n};\n\nexport type ParagraphStyleUpdate = {\n    fontKey?: {\n        value: string;\n    };\n    fontSize?: {\n        value: number;\n    };\n    typographicCase?: {\n        value: Case;\n    };\n    kerningOn?: {\n        value: boolean;\n    };\n    subSuperScript?: {\n        value: Scripting;\n    };\n    trackingLeft?: {\n        value: number;\n    };\n    trackingRight?: {\n        value: number;\n    };\n    textIndent?: {\n        value: string;\n    };\n    alignToBaseLine?: {\n        value: boolean;\n    };\n    baselineShiftValue?: {\n        value: string;\n    };\n    lineHeight?: {\n        value: number;\n    };\n    textAlign?: {\n        value: Alignment;\n    };\n    textAlignLast?: {\n        value: Alignment;\n    };\n    textOverprint?: {\n        value: boolean;\n    };\n    color?: {\n        value: ColorUsageUpdate;\n    };\n    fillColorApplied?: {\n        value: boolean;\n    };\n    strokeColor?: {\n        value: ColorUsageUpdate;\n    };\n    strokeColorApplied?: {\n        value: boolean;\n    };\n    strokeWidth?: {\n        value: string;\n    };\n    underline?: {\n        value: boolean;\n    };\n    lineThrough?: {\n        value: boolean;\n    };\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    bulletListBulletMarks?: {\n        value: string[];\n    };\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    bulletListLeftIndent?: {\n        value: string;\n    };\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    bulletListTextIndent?: {\n        value: string;\n    };\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    bulletListCharacterStyleId?: {\n        value?: string;\n    };\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    numericListNumberingStyle?: {\n        value: NumericListNumberingStyle[];\n    };\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    numericListLeftIndent?: {\n        value: string;\n    };\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    numericListTextIndent?: {\n        value: string;\n    };\n    /**\n     * @experimental This property is experimental and may be changed in the future.\n     */\n    numericListCharacterStyleId?: {\n        value?: string;\n    };\n};\n\nexport type BulletListStyle = {\n    /**\n     * Array of bullet marks for each level\n     * The position of the item in the array is the level of the bullet list\n     * The value of the item is the bullet mark\n     */\n    bulletMarks: string[];\n    leftIndent: number;\n    textIndent: number;\n    characterStyleId?: string;\n};\n\nexport type NumericListStyle = {\n    leftIndent: number;\n    textIndent: number;\n    numberingStyle: NumericListNumberingStyle[];\n    characterStyleId?: string;\n};\n\nexport type NumericListNumberingStyle = {\n    format: NumberListFormat;\n    symbol: NumberListSeparatorSymbol;\n};\n\nexport enum NumberListFormat {\n    arabic = 'arabic',\n    romanUpperCase = 'romanUpperCase',\n    romanLowerCase = 'romanLowerCase',\n    latinUpperCase = 'latinUpperCase',\n    latinLowerCase = 'latinLowerCase',\n}\n\nexport enum NumberListSeparatorSymbol {\n    none = 'none',\n    dash = 'dash',\n    dot = 'dot',\n    colon = 'colon',\n    roundBracket = 'roundBracket',\n}\n","import { Id } from './CommonTypes';\n\n/**\n * Editor Events that Actions can react to.\n */\nexport enum ActionEditorEvent {\n    /**\n     * Indicates the selected layout changed.\n     */\n    selectedLayoutChanged = 'selectedLayoutChanged',\n\n    /**\n     * Indicates a frame was moved, resized, rotated.\n     * Note: this does not trigger when a different layout is selected.\n     */\n    frameMoved = 'frameMoved',\n\n    /**\n     * Indicates the size of a page has changed.\n     */\n    pageSizeChanged = 'pageSizeChanged',\n\n    /**\n     * Indicates the document is fully initialized, actions can safely be executed.\n     * Note: the other events will only be triggered after a document is fully initialized.\n     */\n    documentLoaded = 'documentLoaded',\n\n    /**\n     * Indicates the value of a variable changed.\n     */\n    variableValueChanged = 'variableValueChanged',\n}\n\n/**\n * Action used by the document.\n */\nexport interface DocumentAction {\n    /**\n     * Unique Id of the action.\n     */\n    id: Id;\n\n    /**\n     * Unique action name\n     */\n    name: string;\n\n    /**\n     * All the triggers this action will react to.\n     */\n    triggers: ActionTrigger[];\n\n    /**\n     * The JavaScript based action script.\n     */\n    script: string;\n}\n\n/**\n * Trigger used to fire an action.\n */\nexport type ActionTrigger =\n    | SelectedLayoutChangedTrigger\n    | FrameMovedTrigger\n    | PageSizeChangedTrigger\n    | DocumentLoadedTrigger\n    | VariableValueChangedTrigger;\n\nexport interface SelectedLayoutChangedTrigger {\n    event: ActionEditorEvent.selectedLayoutChanged;\n}\n\n/**\n * Model to update an Action.\n */\nexport type ActionDeltaUpdate = {\n    /**\n     * The new Action JS script.\n     */\n    script?: string;\n\n    /**\n     * The new name of the Action.\n     */\n    name?: string;\n\n    /**\n     * Whether the Action has any typing errors.\n     */\n    hasTypeError?: boolean;\n\n    /**\n     * The new list of triggers.\n     */\n    triggers?: ActionTrigger[];\n};\n\nexport interface FrameMovedTrigger {\n    event: ActionEditorEvent.frameMoved;\n    /**\n     * The frame id's this trigger should react to.\n     * Leaving this `undefined`, will make this trigger react to any frame that moves in any direction (also rotation, resize and ).\n     */\n    triggers?: Id[];\n}\n\nexport interface PageSizeChangedTrigger {\n    event: ActionEditorEvent.pageSizeChanged;\n}\n\nexport interface DocumentLoadedTrigger {\n    event: ActionEditorEvent.documentLoaded;\n}\n\nexport interface VariableValueChangedTrigger {\n    event: ActionEditorEvent.variableValueChanged;\n\n    /**\n     * The variable id's this trigger should react to.\n     * Leaving this `undefined`, will make this trigger react to all variableValueChanges.\n     */\n    triggers?: Id[];\n}\n","import { ColorUsage } from './ColorStyleTypes';\n\nexport enum ShapeType {\n    ellipse = 'ellipse',\n    rectangle = 'rectangle',\n    polygon = 'polygon',\n}\n\nexport interface ShapeProperties {\n    enableFill?: boolean;\n    fillColor?: ColorUsage;\n    enableStroke?: boolean;\n    strokeColor?: ColorUsage;\n    strokeWeight?: number;\n    allCornersSame?: boolean;\n}\n\nexport interface CornerRadiusUpdateModel {\n    radiusAll?: number;\n    topLeft?: number;\n    bottomLeft?: number;\n    topRight?: number;\n    bottomRight?: number;\n    allCornersSame?: boolean;\n}\n\nexport interface CornerRadiusNone {\n    type: string;\n}\n\nexport interface CornerRadiusAll {\n    type: string;\n    radius: number;\n}\n\nexport interface CornerRadiusOnly {\n    type: string;\n    topLeft: number;\n    bottomLeft: number;\n    topRight: number;\n    bottomRight: number;\n}\n\nexport enum CornerRadiusType {\n    all = 'all',\n    only = 'only',\n    none = 'none',\n}\n","import { Id } from './CommonTypes';\n\nexport type EngineEditMode = {\n    frameId: Id | null;\n    mode: EngineEditModeType;\n};\n\nexport enum EngineEditModeType {\n    normal = 'normal',\n    textEdit = 'textEdit',\n    customCrop = 'customCrop',\n    frameSubjectArea = 'frameSubjectArea',\n    perAssetCrop = 'perAssetCrop',\n    gradient = 'gradient',\n}\n","import { Id } from '../../types/CommonTypes';\n\nexport interface ConnectorUrlRegistration {\n    /**\n     * Url to the connector. Must be a publicly accessible url.\n     */\n    url: string;\n    source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration {\n    /**\n     * `RemoteConnectorId` of the connector with `grafx` source.\n     */\n    id: Id;\n    source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration {\n    url: string;\n    source: ConnectorRegistrationSource.local;\n}\n\nexport enum ConnectorRegistrationSource {\n    /**\n     * Connector is hosted on a publicly accessible link.\n     */\n    url = 'url',\n\n    /**\n     * Connector is hosted on GraFx Environment API.\n     */\n    grafx = 'grafx',\n\n    /**\n     * Connector is embedded in the document.\n     * Note: This is a temporary type; only to be used internally.\n     */\n    local = 'local',\n}\n\nexport enum ConnectorType {\n    media = 'media',\n    fonts = 'fonts',\n    data = 'data',\n    /**\n     * @experimental This is still experimental and might change in future releases.\n     */\n    components = 'components',\n}\n\nexport type ConnectorInstance = {\n    id: Id;\n    name: string;\n    iconUrl: string;\n    source: ConnectorGrafxRegistration | ConnectorUrlRegistration | ConnectorLocalRegistration;\n};\n"]}