{"version":3,"file":"ckeditor.umd.cjs","names":[],"sources":["../src/plugins/VueIntegrationUsageDataPlugin.ts","../src/utils/cleanupOrphanEditorElements.ts","../src/utils/wrapWithWatchdogIfPresent.ts","../src/composables/useIsUnmounted.ts","../src/composables/useEditorLifecycleEvents.ts","../src/composables/useEditorVModel.ts","../src/composables/useEditorReadOnly.ts","../src/composables/useEditorVersionCheck.ts","../src/utils/isClassicEditor.ts","../src/composables/useEditorElementDefinition.ts","../src/utils/normalizeEditorElementDefinition.ts","../src/DynamicElement.vue","../src/DynamicElement.vue","../src/Ckeditor.vue","../src/Ckeditor.vue","../src/CkeditorElement.vue","../src/CkeditorElement.vue","../src/multiroot/constants.ts","../src/multiroot/MultiRootEditorEditable.vue","../src/multiroot/MultiRootEditorEditable.vue","../src/multiroot/useMultiRootEditor.ts","../src/CkeditorMultiRoot.vue","../src/CkeditorMultiRoot.vue","../src/composables/useAsync.ts","../src/useCKEditorCloud.ts","../src/plugin.ts"],"sourcesContent":["/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { version } from 'vue';\nimport {\n\tcreateIntegrationUsageDataPlugin,\n\tappendExtraPluginsToEditorConfig,\n\tisCKEditorFreeLicense\n} from '@ckeditor/ckeditor5-integrations-common';\n\nimport type { EditorConfig } from 'ckeditor5';\n\n/**\n * This part of the code is not executed in open-source implementations using a GPL key.\n * It only runs when a specific license key is provided. If you are uncertain whether\n * this applies to your installation, please contact our support team.\n */\nexport const VueIntegrationUsageDataPlugin = createIntegrationUsageDataPlugin(\n\t'vue',\n\t{\n\t\tversion: __VUE_INTEGRATION_VERSION__,\n\t\tframeworkVersion: version\n\t}\n);\n\n/**\n * Appends all integration plugins to the editor configuration.\n *\n * @param editorConfig The editor configuration.\n * @returns The editor configuration with all integration plugins appended.\n */\nexport function appendUsageDataPluginToConfig( editorConfig: EditorConfig ): EditorConfig {\n\t/**\n\t * Do not modify the editor configuration if the editor is using a free license.\n\t */\n\tif ( isCKEditorFreeLicense( editorConfig.licenseKey ) ) {\n\t\treturn editorConfig;\n\t}\n\n\treturn appendExtraPluginsToEditorConfig( editorConfig, [\n\t\t/**\n\t\t * This part of the code is not executed in open-source implementations using a GPL key.\n\t\t * It only runs when a specific license key is provided. If you are uncertain whether\n\t\t * this applies to your installation, please contact our support team.\n\t\t */\n\t\tVueIntegrationUsageDataPlugin\n\t] );\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { Editor } from 'ckeditor5';\n\n/**\n * Removes all DOM elements injected by a specific CKEditor instance.\n * Call this before assigning a new instance (e.g. in the 'restart' watchdog handler),\n * because the watchdog does not clean up the previous editor's DOM on its own.\n */\nexport function cleanupOrphanEditorElements( editor: Editor ): void {\n\tconst uiElement = editor.ui?.element;\n\n\tif ( uiElement?.isConnected ) {\n\t\tuiElement.remove();\n\t}\n\n\tconst bodyCollectionContainer = ( editor.ui as any )?.view?.body?._bodyCollectionContainer;\n\n\tif ( bodyCollectionContainer?.isConnected ) {\n\t\tbodyCollectionContainer.remove();\n\t}\n\n\tconst editingView = editor.editing?.view;\n\n\tif ( editingView ) {\n\t\tfor ( const domRoot of editingView.domRoots.values() ) {\n\t\t\tif ( !( domRoot instanceof HTMLElement ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdomRoot.removeAttribute( 'contenteditable' );\n\t\t\tdomRoot.removeAttribute( 'role' );\n\t\t\tdomRoot.removeAttribute( 'aria-label' );\n\t\t\tdomRoot.removeAttribute( 'aria-multiline' );\n\t\t\tdomRoot.removeAttribute( 'spellcheck' );\n\t\t\tdomRoot.classList.remove(\n\t\t\t\t'ck',\n\t\t\t\t'ck-content',\n\t\t\t\t'ck-editor__editable',\n\t\t\t\t'ck-rounded-corners',\n\t\t\t\t'ck-editor__editable_inline',\n\t\t\t\t'ck-blurred',\n\t\t\t\t'ck-focused'\n\t\t\t);\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { EditorRelaxedConstructor } from '@ckeditor/ckeditor5-integrations-common';\nimport type { EditorWithWatchdogRelaxedConstructor } from '../types.js';\nimport type { Editor, EditorWatchdog, WatchdogConfig } from 'ckeditor5';\n\nconst EDITOR_WATCHDOG_SYMBOL = Symbol.for( 'vue-editor-watchdog' );\n\nexport type EditorWithAttachedWatchdog<TEditor extends Editor = Editor> = TEditor & {\n\t[EDITOR_WATCHDOG_SYMBOL]?: EditorWatchdog;\n};\n\nexport type WatchdogErrorEventData<TEditor extends Editor> = {\n\terror: Error;\n\tcausesRestart: boolean;\n\twatchdog: EditorWatchdog;\n\teditor: TEditor;\n};\n\n/**\n * Returns an editor constructor optionally wrapped with EditorWatchdog.\n */\nexport function resolveEditorConstructor<TEditor extends Editor, TConstructor extends EditorWithWatchdogRelaxedConstructor<TEditor>>(\n\tEditor: TConstructor,\n\tdisableWatchdog: boolean,\n\twatchdogConfig?: WatchdogConfig\n): TConstructor {\n\treturn disableWatchdog ?\n\t\tEditor :\n\t\twrapWithWatchdogIfPresent( Editor, watchdogConfig ) as TConstructor;\n}\n\n/**\n * `EditorWatchdog#create` method does not return editor instance (returns `undefined` instead).\n * This function wraps editor constructor with EditorWatchdog and returns fake constructor that\n * returns editor instance assigned to initialized watchdog.\n *\n * It stores watchdog instance in hidden symbol assigned to editor. It simplifies storing both\n * instances in component's state (it's no longer required to store them separately).\n *\n * @param Editor The Editor creator to wrap.\n * @param watchdogConfig Watchdog configuration.\n * @returns The Editor creator wrapped with a watchdog.\n */\nexport function wrapWithWatchdogIfPresent<TEditor extends Editor>(\n\tEditor: EditorWithWatchdogRelaxedConstructor<TEditor>,\n\twatchdogConfig?: WatchdogConfig\n): EditorRelaxedConstructor<EditorWithAttachedWatchdog<TEditor>> {\n\tconst { EditorWatchdog } = Editor;\n\n\tif ( !EditorWatchdog ) {\n\t\treturn Editor;\n\t}\n\n\tconst watchdog = new EditorWatchdog( Editor, watchdogConfig );\n\n\twatchdog.setCreator( async ( ...args: Parameters<typeof Editor['create']> ) => {\n\t\tconst editor = await Editor.create( ...args );\n\n\t\t( editor as EditorWithAttachedWatchdog )[ EDITOR_WATCHDOG_SYMBOL ] = watchdog;\n\n\t\treturn editor;\n\t} );\n\n\treturn {\n\t\t...Editor,\n\t\teditorName: Editor.editorName,\n\t\tcreate: async ( ...args: Parameters<typeof watchdog.create> ) => {\n\t\t\tawait watchdog.create( ...args );\n\n\t\t\treturn watchdog.editor!;\n\t\t}\n\t};\n}\n\n/**\n * Unwraps the EditorWatchdog from the editor instance.\n *\n * @param editor Editor with attached watchdog.\n */\nexport function unwrapEditorWatchdog( editor: EditorWithAttachedWatchdog ): EditorWatchdog | null {\n\treturn editor[ EDITOR_WATCHDOG_SYMBOL ] ?? null;\n}\n\n/**\n * Attaches common EditorWatchdog runtime error handling.\n */\nexport function attachEditorWatchdogErrorHandler<TEditor extends Editor>(\n\teditor: EditorWithAttachedWatchdog<TEditor>,\n\t{\n\t\tisUnmounted,\n\t\tonError\n\t}: {\n\t\tisUnmounted: () => boolean;\n\t\tonError: ( data: WatchdogErrorEventData<TEditor> ) => void;\n\t}\n): EditorWatchdog | null {\n\tconst watchdog = unwrapEditorWatchdog( editor );\n\n\tif ( !watchdog ) {\n\t\treturn null;\n\t}\n\n\twatchdog.on( 'error', ( _, { error, causesRestart } ) => {\n\t\tif ( isUnmounted() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonError( {\n\t\t\terror,\n\t\t\tcausesRestart,\n\t\t\twatchdog,\n\t\t\teditor: watchdog.editor as TEditor\n\t\t} );\n\t} );\n\n\treturn watchdog;\n}\n\n/**\n * It destroys the editor watchdog if it is assigned to the editor. If it is not, the editor is destroyed.\n *\n * @param editor Editor with attached watchdog.\n */\nexport async function destroyEditorWithWatchdog( editor: EditorWithAttachedWatchdog ): Promise<void> {\n\tconst watchdog = unwrapEditorWatchdog( editor );\n\n\tif ( watchdog ) {\n\t\t// If watchdog is present on the editor, then destroy the watchdog. It'll automatically kill assigned editors.\n\t\tawait watchdog.destroy();\n\t} else {\n\t\t// If there is no watchdog, kill the editor.\n\t\tawait editor.destroy();\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { ref, onBeforeUnmount, type Ref } from 'vue';\n\nexport function useIsUnmounted(): Ref<boolean> {\n\tconst isUnmounted = ref( false );\n\n\tonBeforeUnmount( () => {\n\t\tisUnmounted.value = true;\n\t} );\n\n\treturn isUnmounted;\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { Editor, EventInfo } from 'ckeditor5';\nimport { watch, type Ref, type EmitFn } from 'vue';\n\n/**\n * Hook that watches editor lifecycle events and maps them to Vue event emitters.\n */\nexport function useEditorLifecycleEvents<TEditor extends Editor>(\n\tinstance: Ref<TEditor | undefined>,\n\temit: EmitFn<EditorLifecycleEvents<TEditor>>\n): void {\n\twatch( instance, newInstance => {\n\t\t/* istanbul ignore if -- @preserve - Defensive check, instance never becomes undefined. */\n\t\tif ( !newInstance ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { document } = newInstance.editing.view;\n\n\t\tdocument.on( 'focus', ( evt: EventInfo ) => emit( 'focus', evt, newInstance ) );\n\t\tdocument.on( 'blur', ( evt: EventInfo ) => emit( 'blur', evt, newInstance ) );\n\n\t\t// Let the world know the editor is ready.\n\t\temit( 'ready', newInstance );\n\n\t\tnewInstance.once( 'destroy', () => {\n\t\t\temit( 'destroy', newInstance );\n\t\t} );\n\t}, { flush: 'post' } );\n}\n\nexport type EditorLifecycleEvents<TEditor extends Editor> = {\n\tready: [ editor: TEditor ];\n\tdestroy: [ editor: TEditor ];\n\tblur: [ event: EventInfo, editor: TEditor ];\n\tfocus: [ event: EventInfo, editor: TEditor ];\n};\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { Editor, EventInfo } from 'ckeditor5';\nimport { debounce } from 'lodash-es';\nimport {\n\tref, watch, toValue,\n\ttype Ref, type EmitFn, type ModelRef, type MaybeRefOrGetter\n} from 'vue';\n\nimport { useIsUnmounted } from './useIsUnmounted.js';\n\nconst INPUT_EVENT_DEBOUNCE_WAIT = 300;\n\n/**\n * Hook that synchronizes editor state with currently set vue model.\n */\nexport function useEditorVModel<TEditor extends Editor>(\n\t{\n\t\tdisableTwoWayDataBinding,\n\t\temit,\n\t\tinstance,\n\t\tmodel\n\t}: Attrs<TEditor>\n): Result<TEditor> {\n\tconst lastEditorData = ref<string>();\n\tconst isUnmounted = useIsUnmounted();\n\n\t/**\n\t * Updates the internal cache and emits Vue-compatible events.\n\t */\n\tfunction assignEditorDataToModel( editor: TEditor, evt: EventInfo | null = null ) {\n\t\tconst data = lastEditorData.value = editor.data.get();\n\n\t\temit( 'update:modelValue', data, evt, editor );\n\t\temit( 'input', data, evt, editor );\n\t}\n\n\twatch( model, newModel => {\n\t\t// Synchronize changes of #modelValue. There are two sources of changes:\n\t\t//\n\t\t//                External modelValue change      ──────╮\n\t\t//                                                      ╰─────> ┏━━━━━━━━━━━┓\n\t\t//                                                              ┃ Component ┃\n\t\t//                                                      ╭─────> ┗━━━━━━━━━━━┛\n\t\t//                   Internal data change         ──────╯\n\t\t//             (typing, commands, collaboration)\n\t\t//\n\t\t// Case 1: If the change was external (via props), the editor data must be synced with\n\t\t// the component using instance#setData() and it is OK to destroy the selection.\n\t\t//\n\t\t// Case 2: If the change is the result of internal data change, the #modelValue is the\n\t\t// same as this.lastEditorData, which has been cached on #change:data. If we called\n\t\t// instance#setData() at this point, that would demolish the selection.\n\t\t//\n\t\t// To limit the number of instance#setData() which is time-consuming when there is a\n\t\t// lot of data we make sure:\n\t\t//    * the new modelValue is at least different than the old modelValue (Case 1.)\n\t\t//    * the new modelValue is different than the last internal instance state (Case 2.)\n\t\t//\n\t\t// See: https://github.com/ckeditor/ckeditor5-vue/issues/42.\n\t\tif ( instance.value && newModel !== lastEditorData.value ) {\n\t\t\tinstance.value.data.set( newModel );\n\t\t}\n\t} );\n\n\twatch( instance, ( newInstance, _oldInstance, onCleanup ) => {\n\t\t/* istanbul ignore if -- @preserve - Defensive check, instance never becomes undefined. */\n\t\tif ( !newInstance ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emitDebouncedInputEvent = debounce( ( evt: EventInfo ) => {\n\t\t\tif ( toValue( disableTwoWayDataBinding ) || isUnmounted.value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tassignEditorDataToModel( newInstance, evt );\n\t\t}, INPUT_EVENT_DEBOUNCE_WAIT, { leading: true } );\n\n\t\t// Debounce emitting the #input event. When data is huge, instance#getData()\n\t\t// takes a lot of time to execute on every single key press and ruins the UX.\n\t\t//\n\t\t// See: https://github.com/ckeditor/ckeditor5-vue/issues/42\n\t\tnewInstance.model.document.on( 'change:data', emitDebouncedInputEvent );\n\n\t\tnewInstance.once( 'destroy', () => {\n\t\t\temitDebouncedInputEvent.cancel();\n\t\t} );\n\n\t\tonCleanup( () => {\n\t\t\temitDebouncedInputEvent.cancel();\n\t\t} );\n\t} );\n\n\treturn {\n\t\tlastEditorData,\n\t\tassignEditorDataToModel\n\t};\n}\n\ntype Attrs<TEditor extends Editor> = {\n\tdisableTwoWayDataBinding: MaybeRefOrGetter<boolean>;\n\tmodel: ModelRef<string>;\n\temit: EmitFn<EditorVModelEvents<TEditor>>;\n\tinstance: Ref<TEditor | undefined>;\n};\n\ntype Result<TEditor extends Editor> = {\n\tlastEditorData: Ref<string | undefined>;\n\tassignEditorDataToModel( editor: TEditor, evt?: EventInfo | null ): void;\n};\n\nexport type EditorVModelEvents<TEditor extends Editor> = {\n\tinput: [ data: string, event: EventInfo | null, editor: TEditor ];\n\t'update:modelValue': [ data: string, event: EventInfo | null, editor: TEditor ];\n};\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { toValue, watchEffect, type MaybeRefOrGetter } from 'vue';\nimport type { Editor } from 'ckeditor5';\n\nconst INTEGRATION_READ_ONLY_LOCK_ID = 'Lock from Vue integration (@ckeditor/ckeditor5-vue)';\n\n/**\n * Hook that toggles readonly state on provided instance.\n */\nexport function useEditorReadOnly(\n\tinstance: MaybeRefOrGetter<Editor | undefined>,\n\tdisabled: MaybeRefOrGetter<boolean | undefined>\n): void {\n\twatchEffect( () => {\n\t\tconst editor = toValue( instance );\n\t\tconst isDisabled = !!toValue( disabled );\n\n\t\tif ( editor ) {\n\t\t\ttoggleEditorReadOnly( editor, isDisabled );\n\t\t}\n\t}, { flush: 'sync' } );\n}\n\n/**\n * Toggles editor to readonly state.\n */\nfunction toggleEditorReadOnly( editor: Editor, readOnly: boolean ): void {\n\tif ( readOnly ) {\n\t\teditor.enableReadOnlyMode( INTEGRATION_READ_ONLY_LOCK_ID );\n\t} else {\n\t\teditor.disableReadOnlyMode( INTEGRATION_READ_ONLY_LOCK_ID );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { compareInstalledCKBaseVersion } from '@ckeditor/ckeditor5-integrations-common';\n\n/**\n * Hook that check if integration is compatible with installed version of the editor.\n */\nexport function useEditorVersionCheck(): void {\n\tswitch ( compareInstalledCKBaseVersion( '42.0.0' ) ) {\n\t\tcase null:\n\t\t\tconsole.warn( 'Cannot find the \"CKEDITOR_VERSION\" in the \"window\" scope.' );\n\t\t\tbreak;\n\n\t\tcase -1:\n\t\t\tconsole.warn( 'The <CKEditor> component requires using CKEditor 5 in version 42+ or nightly build.' );\n\t\t\tbreak;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { EditorRelaxedConstructor } from '@ckeditor/ckeditor5-integrations-common';\n\nexport function isClassicEditor( Editor: EditorRelaxedConstructor ): boolean {\n\treturn !Editor.editorName || Editor.editorName === 'ClassicEditor';\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from 'vue';\nimport type { EditorRelaxedConfig } from '@ckeditor/ckeditor5-integrations-common';\n\nimport type { EditorWithWatchdogRelaxedConstructor } from '../types.js';\nimport type { EditorElementDefinition } from '../utils/normalizeEditorElementDefinition.js';\nimport { isClassicEditor } from '../utils/isClassicEditor.js';\n\n/**\n * Picks editor element definition from config if provided.\n */\nexport function useEditorElementDefinition(\n\t{\n\t\tEditor,\n\t\tconfig,\n\t\tdefaultElementName\n\t}: Options\n): ComputedRef<EditorElementDefinition> {\n\treturn computed<EditorElementDefinition>( () => {\n\t\tconst _config = toValue( config );\n\t\tconst _Editor = toValue( Editor );\n\n\t\tif ( !isClassicEditor( _Editor ) ) {\n\t\t\tconst customElementDefinition = _config.roots?.main?.element ?? _config.root?.element;\n\n\t\t\tif ( customElementDefinition ) {\n\t\t\t\treturn customElementDefinition;\n\t\t\t}\n\t\t}\n\n\t\treturn toValue( defaultElementName );\n\t} );\n}\n\ntype Options = {\n\tEditor: MaybeRefOrGetter<EditorWithWatchdogRelaxedConstructor>;\n\tconfig: MaybeRefOrGetter<EditorRelaxedConfig>;\n\tdefaultElementName: MaybeRefOrGetter<string>;\n};\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * Normalizes an editor element definition into a structured object.\n *\n * @param definition The definition to normalize.\n * @returns A strictly typed object definition containing at least the element name.\n */\nexport function normalizeEditorElementDefinition( definition: EditorElementDefinition ): EditorElementObjectDefinition {\n\tif ( typeof HTMLElement !== 'undefined' && definition instanceof HTMLElement ) {\n\t\tthrow new Error(\n\t\t\t'An HTMLElement cannot be used as an editor element definition. ' +\n\t\t\t'Please pass a string or an object definition.'\n\t\t);\n\t}\n\n\tif ( typeof definition !== 'object' || definition === null ) {\n\t\treturn {\n\t\t\tname: definition\n\t\t};\n\t}\n\n\treturn definition as EditorElementObjectDefinition;\n}\n\n/**\n * Defines an editor element. It can be a tag name string or a detailed configuration object.\n */\nexport type EditorElementDefinition = string | EditorElementObjectDefinition;\n\n/**\n * An object-based definition for an editor element, allowing customization\n * of classes, styles, and HTML attributes.\n */\nexport type EditorElementObjectDefinition = {\n\n\t/**\n     * The DOM tag name to use.\n     */\n\tname: string;\n\n\t/**\n     * Class name or array of class names to apply to the editable element. Each name can be provided as a string.\n     */\n\tclasses?: string | Array<string>;\n\n\t/**\n     * Inline styles to apply to the editable element as a record of style properties.\n     */\n\tstyles?: Record<string, string>;\n\n\t/**\n     * Additional DOM attributes to apply to the editable element.\n     */\n\tattributes?: Record<string, string>;\n};\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\n\nimport { type EditorElementDefinition, normalizeEditorElementDefinition } from './utils/normalizeEditorElementDefinition.js';\n\nconst props = withDefaults(\n\tdefineProps<{\n\t\tdefinition?: EditorElementDefinition | null;\n\t}>(),\n\t{\n\t\tdefinition: null\n\t}\n);\n\nconst elementRef = ref<HTMLElement>();\n\ndefineExpose( { elementRef } );\n\nconst definition = computed( () =>\n\tnormalizeEditorElementDefinition( props.definition ?? 'div' )\n);\n</script>\n\n<template>\n  <component\n    :is=\"definition.name\"\n    ref=\"elementRef\"\n    v-bind=\"definition.attributes\"\n    :class=\"definition.classes\"\n    :style=\"definition.styles\"\n  />\n</template>\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\n\nimport { type EditorElementDefinition, normalizeEditorElementDefinition } from './utils/normalizeEditorElementDefinition.js';\n\nconst props = withDefaults(\n\tdefineProps<{\n\t\tdefinition?: EditorElementDefinition | null;\n\t}>(),\n\t{\n\t\tdefinition: null\n\t}\n);\n\nconst elementRef = ref<HTMLElement>();\n\ndefineExpose( { elementRef } );\n\nconst definition = computed( () =>\n\tnormalizeEditorElementDefinition( props.definition ?? 'div' )\n);\n</script>\n\n<template>\n  <component\n    :is=\"definition.name\"\n    ref=\"elementRef\"\n    v-bind=\"definition.attributes\"\n    :class=\"definition.classes\"\n    :style=\"definition.styles\"\n  />\n</template>\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<template>\n  <DynamicElement\n    ref=\"editorElementRef\"\n    :definition=\"elementDefinition\"\n  />\n</template>\n\n<script\n\tsetup\n\tlang=\"ts\"\n\tgeneric=\"TEditorConstructor extends EditorWithWatchdogRelaxedConstructor\"\n>\nimport {\n\tref,\n\tonMounted,\n\tonBeforeUnmount,\n\tmarkRaw,\n\ttype Raw,\n\tgetCurrentInstance\n} from 'vue';\n\nimport type { CKEditorError, EditorConfig } from 'ckeditor5';\nimport type { EditorErrorDescription, EditorWithWatchdogRelaxedConstructor, Props } from './types.js';\n\nimport {\n\tassignElementToEditorConfig,\n\tassignInitialDataToEditorConfig,\n\tExtractEditorType,\n\tgetInstalledCKBaseFeatures\n} from '@ckeditor/ckeditor5-integrations-common';\n\nimport { appendUsageDataPluginToConfig } from './plugins/VueIntegrationUsageDataPlugin.js';\nimport { cleanupOrphanEditorElements } from './utils/cleanupOrphanEditorElements.js';\nimport {\n\tdestroyEditorWithWatchdog,\n\tattachEditorWatchdogErrorHandler,\n\tresolveEditorConstructor,\n\ttype EditorWithAttachedWatchdog\n} from './utils/wrapWithWatchdogIfPresent.js';\n\nimport { useIsUnmounted } from './composables/useIsUnmounted.js';\nimport { EditorLifecycleEvents, useEditorLifecycleEvents } from './composables/useEditorLifecycleEvents.js';\nimport { EditorVModelEvents, useEditorVModel } from './composables/useEditorVModel.js';\nimport { useEditorReadOnly } from './composables/useEditorReadOnly.js';\nimport { useEditorVersionCheck } from './composables/useEditorVersionCheck.js';\nimport { useEditorElementDefinition } from './composables/useEditorElementDefinition.js';\nimport DynamicElement from './DynamicElement.vue';\nimport { isClassicEditor } from './utils/isClassicEditor.js';\n\ntype TEditor = ExtractEditorType<TEditorConstructor>;\n\ndefineOptions( {\n\tname: 'CKEditor'\n} );\n\nconst model = defineModel( 'modelValue', { type: String, default: '' } );\nconst props = withDefaults( defineProps<Props<TEditorConstructor>>(), {\n\tconfig: () => ( {} ),\n\ttagName: 'div',\n\tdisableWatchdog: false,\n\tdisabled: false,\n\tdisableTwoWayDataBinding: false\n} );\n\nconst emit = defineEmits<\n\t& EditorLifecycleEvents<TEditor>\n\t& EditorVModelEvents<TEditor>\n\t& {\n\t\terror: [ error: Error | CKEditorError, description: EditorErrorDescription<TEditor> ],\n\t}\n>();\n\nconst currentInstance = getCurrentInstance();\nconst hasErrorHandler = () => !!currentInstance?.vnode.props?.onError;\n\nconst editorElementRef = ref<InstanceType<typeof DynamicElement>>();\nconst instance = ref<Raw<EditorWithAttachedWatchdog<TEditor>>>();\nconst isUnmounted = useIsUnmounted();\n\nconst { lastEditorData, assignEditorDataToModel } = useEditorVModel<TEditor>( {\n\tdisableTwoWayDataBinding: () => props.disableTwoWayDataBinding,\n\tmodel,\n\temit,\n\tinstance\n} );\n\nconst elementDefinition = useEditorElementDefinition({\n\tEditor: () => props.editor,\n\tconfig: () => props.config,\n\tdefaultElementName: () => props.tagName\n});\n\nuseEditorVersionCheck();\nuseEditorLifecycleEvents( instance, emit );\nuseEditorReadOnly( instance, () => props.disabled );\n\ndefineExpose( {\n\tinstance,\n\tlastEditorData\n} );\n\nonMounted( async () => {\n\tconst supports = getInstalledCKBaseFeatures();\n\n\t// Clone the config first so it never gets mutated (across multiple editor instances).\n\t// https://github.com/ckeditor/ckeditor5-vue/issues/101\n\tlet editorConfig: EditorConfig = appendUsageDataPluginToConfig( { ...props.config } );\n\n\t// Store model value before initialization to verify if it changed in the meantime.\n\tlet prevModelValue = model.value;\n\n\tif ( model.value ) {\n\t\teditorConfig = assignInitialDataToEditorConfig( editorConfig, model.value, true );\n\t}\n\n\tconst Constructor = resolveEditorConstructor( props.editor, props.disableWatchdog, props.watchdogConfig );\n\n\ttry {\n\t\tconst domElement = editorElementRef.value?.elementRef;\n\n\t\tif ( !domElement ) {\n\t\t\tthrow new Error( 'Editor element is not available. Make sure the component is mounted.' );\n\t\t}\n\n\t\tconst editor = await (\n\t\t\tsupports.elementConfigAttachment ?\n\t\t\t\tConstructor.create( assignElementToEditorConfig( Constructor, domElement, editorConfig ) ) :\n\t\t\t\tConstructor.create( domElement, editorConfig )\n\t\t) as unknown as EditorWithAttachedWatchdog<TEditor>;\n\n\t\tif ( isUnmounted.value ) {\n\t\t\tawait destroyEditorWithWatchdog( editor );\n\t\t\treturn;\n\t\t}\n\n\t\t// Synchronize the editor content. The #modelValue may change while the editor is being created, so the editor content has\n\t\t// to be synchronized with these potential changes as soon as it is ready.\n\t\tif ( model.value !== prevModelValue ) {\n\t\t\teditor.data.set( model.value );\n\t\t}\n\n\t\tconst watchdog = attachEditorWatchdogErrorHandler( editor, {\n\t\t\tisUnmounted: () => isUnmounted.value,\n\t\t\tonError: ( { error, watchdog, editor, causesRestart } ) => {\n\t\t\t\tif ( !hasErrorHandler() ) {\n\t\t\t\t\tconsole.error( error );\n\t\t\t\t}\n\n\t\t\t\temit( 'error', error, {\n\t\t\t\t\tphase: 'runtime',\n\t\t\t\t\twatchdog,\n\t\t\t\t\teditor,\n\t\t\t\t\tcausesRestart\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tif ( watchdog ) {\n\t\t\twatchdog.on( 'restart', () => {\n\t\t\t\t// Sometimes editor leave a lot of orphaned elements. Try to remove them.\n\t\t\t\ttry {\n\t\t\t\t\tif ( instance.value && isClassicEditor( Constructor ) ) {\n\t\t\t\t\t\tcleanupOrphanEditorElements( instance.value );\n\t\t\t\t\t}\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tconsole.error( err );\n\t\t\t\t}\n\n\t\t\t\tif ( !isUnmounted.value ) {\n\t\t\t\t\tinstance.value = markRaw( watchdog.editor! as TEditor );\n\n\t\t\t\t\t// Rewind vue model back to old working state.\n\t\t\t\t\tassignEditorDataToModel( instance.value );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tinstance.value = markRaw( editor );\n\t} catch ( error: any ) {\n\t\tif ( isUnmounted.value ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !hasErrorHandler() ) {\n\t\t\tconsole.error( error );\n\t\t}\n\n\t\temit( 'error', error, {\n\t\t\tphase: 'initialization'\n\t\t} );\n\t}\n} );\n\nonBeforeUnmount( async () => {\n\tconst editor = instance.value;\n\n\tif ( !editor ) {\n\t\treturn;\n\t}\n\n\tinstance.value = undefined;\n\n\tawait destroyEditorWithWatchdog( editor );\n} );\n</script>\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<template>\n  <DynamicElement\n    ref=\"editorElementRef\"\n    :definition=\"elementDefinition\"\n  />\n</template>\n\n<script\n\tsetup\n\tlang=\"ts\"\n\tgeneric=\"TEditorConstructor extends EditorWithWatchdogRelaxedConstructor\"\n>\nimport {\n\tref,\n\tonMounted,\n\tonBeforeUnmount,\n\tmarkRaw,\n\ttype Raw,\n\tgetCurrentInstance\n} from 'vue';\n\nimport type { CKEditorError, EditorConfig } from 'ckeditor5';\nimport type { EditorErrorDescription, EditorWithWatchdogRelaxedConstructor, Props } from './types.js';\n\nimport {\n\tassignElementToEditorConfig,\n\tassignInitialDataToEditorConfig,\n\tExtractEditorType,\n\tgetInstalledCKBaseFeatures\n} from '@ckeditor/ckeditor5-integrations-common';\n\nimport { appendUsageDataPluginToConfig } from './plugins/VueIntegrationUsageDataPlugin.js';\nimport { cleanupOrphanEditorElements } from './utils/cleanupOrphanEditorElements.js';\nimport {\n\tdestroyEditorWithWatchdog,\n\tattachEditorWatchdogErrorHandler,\n\tresolveEditorConstructor,\n\ttype EditorWithAttachedWatchdog\n} from './utils/wrapWithWatchdogIfPresent.js';\n\nimport { useIsUnmounted } from './composables/useIsUnmounted.js';\nimport { EditorLifecycleEvents, useEditorLifecycleEvents } from './composables/useEditorLifecycleEvents.js';\nimport { EditorVModelEvents, useEditorVModel } from './composables/useEditorVModel.js';\nimport { useEditorReadOnly } from './composables/useEditorReadOnly.js';\nimport { useEditorVersionCheck } from './composables/useEditorVersionCheck.js';\nimport { useEditorElementDefinition } from './composables/useEditorElementDefinition.js';\nimport DynamicElement from './DynamicElement.vue';\nimport { isClassicEditor } from './utils/isClassicEditor.js';\n\ntype TEditor = ExtractEditorType<TEditorConstructor>;\n\ndefineOptions( {\n\tname: 'CKEditor'\n} );\n\nconst model = defineModel( 'modelValue', { type: String, default: '' } );\nconst props = withDefaults( defineProps<Props<TEditorConstructor>>(), {\n\tconfig: () => ( {} ),\n\ttagName: 'div',\n\tdisableWatchdog: false,\n\tdisabled: false,\n\tdisableTwoWayDataBinding: false\n} );\n\nconst emit = defineEmits<\n\t& EditorLifecycleEvents<TEditor>\n\t& EditorVModelEvents<TEditor>\n\t& {\n\t\terror: [ error: Error | CKEditorError, description: EditorErrorDescription<TEditor> ],\n\t}\n>();\n\nconst currentInstance = getCurrentInstance();\nconst hasErrorHandler = () => !!currentInstance?.vnode.props?.onError;\n\nconst editorElementRef = ref<InstanceType<typeof DynamicElement>>();\nconst instance = ref<Raw<EditorWithAttachedWatchdog<TEditor>>>();\nconst isUnmounted = useIsUnmounted();\n\nconst { lastEditorData, assignEditorDataToModel } = useEditorVModel<TEditor>( {\n\tdisableTwoWayDataBinding: () => props.disableTwoWayDataBinding,\n\tmodel,\n\temit,\n\tinstance\n} );\n\nconst elementDefinition = useEditorElementDefinition({\n\tEditor: () => props.editor,\n\tconfig: () => props.config,\n\tdefaultElementName: () => props.tagName\n});\n\nuseEditorVersionCheck();\nuseEditorLifecycleEvents( instance, emit );\nuseEditorReadOnly( instance, () => props.disabled );\n\ndefineExpose( {\n\tinstance,\n\tlastEditorData\n} );\n\nonMounted( async () => {\n\tconst supports = getInstalledCKBaseFeatures();\n\n\t// Clone the config first so it never gets mutated (across multiple editor instances).\n\t// https://github.com/ckeditor/ckeditor5-vue/issues/101\n\tlet editorConfig: EditorConfig = appendUsageDataPluginToConfig( { ...props.config } );\n\n\t// Store model value before initialization to verify if it changed in the meantime.\n\tlet prevModelValue = model.value;\n\n\tif ( model.value ) {\n\t\teditorConfig = assignInitialDataToEditorConfig( editorConfig, model.value, true );\n\t}\n\n\tconst Constructor = resolveEditorConstructor( props.editor, props.disableWatchdog, props.watchdogConfig );\n\n\ttry {\n\t\tconst domElement = editorElementRef.value?.elementRef;\n\n\t\tif ( !domElement ) {\n\t\t\tthrow new Error( 'Editor element is not available. Make sure the component is mounted.' );\n\t\t}\n\n\t\tconst editor = await (\n\t\t\tsupports.elementConfigAttachment ?\n\t\t\t\tConstructor.create( assignElementToEditorConfig( Constructor, domElement, editorConfig ) ) :\n\t\t\t\tConstructor.create( domElement, editorConfig )\n\t\t) as unknown as EditorWithAttachedWatchdog<TEditor>;\n\n\t\tif ( isUnmounted.value ) {\n\t\t\tawait destroyEditorWithWatchdog( editor );\n\t\t\treturn;\n\t\t}\n\n\t\t// Synchronize the editor content. The #modelValue may change while the editor is being created, so the editor content has\n\t\t// to be synchronized with these potential changes as soon as it is ready.\n\t\tif ( model.value !== prevModelValue ) {\n\t\t\teditor.data.set( model.value );\n\t\t}\n\n\t\tconst watchdog = attachEditorWatchdogErrorHandler( editor, {\n\t\t\tisUnmounted: () => isUnmounted.value,\n\t\t\tonError: ( { error, watchdog, editor, causesRestart } ) => {\n\t\t\t\tif ( !hasErrorHandler() ) {\n\t\t\t\t\tconsole.error( error );\n\t\t\t\t}\n\n\t\t\t\temit( 'error', error, {\n\t\t\t\t\tphase: 'runtime',\n\t\t\t\t\twatchdog,\n\t\t\t\t\teditor,\n\t\t\t\t\tcausesRestart\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tif ( watchdog ) {\n\t\t\twatchdog.on( 'restart', () => {\n\t\t\t\t// Sometimes editor leave a lot of orphaned elements. Try to remove them.\n\t\t\t\ttry {\n\t\t\t\t\tif ( instance.value && isClassicEditor( Constructor ) ) {\n\t\t\t\t\t\tcleanupOrphanEditorElements( instance.value );\n\t\t\t\t\t}\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tconsole.error( err );\n\t\t\t\t}\n\n\t\t\t\tif ( !isUnmounted.value ) {\n\t\t\t\t\tinstance.value = markRaw( watchdog.editor! as TEditor );\n\n\t\t\t\t\t// Rewind vue model back to old working state.\n\t\t\t\t\tassignEditorDataToModel( instance.value );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tinstance.value = markRaw( editor );\n\t} catch ( error: any ) {\n\t\tif ( isUnmounted.value ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !hasErrorHandler() ) {\n\t\t\tconsole.error( error );\n\t\t}\n\n\t\temit( 'error', error, {\n\t\t\tphase: 'initialization'\n\t\t} );\n\t}\n} );\n\nonBeforeUnmount( async () => {\n\tconst editor = instance.value;\n\n\tif ( !editor ) {\n\t\treturn;\n\t}\n\n\tinstance.value = undefined;\n\n\tawait destroyEditorWithWatchdog( editor );\n} );\n</script>\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<template>\n  <div ref=\"uiRef\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watchEffect } from 'vue';\nimport type { Editor } from 'ckeditor5';\n\ndefineOptions( {\n\tname: 'CkeditorElement'\n} );\n\ntype UIElementName = 'menuBar' | 'toolbar';\n\ntype EditorWithUIView = Editor & {\n\tui: {\n\t\tview: EditorUIViewWithElements;\n\t};\n};\n\ntype EditorUIViewWithElements = {\n\tmenuBarView?: {\n\t\telement?: HTMLElement | null;\n\t};\n\ttoolbar?: {\n\t\telement?: HTMLElement | null;\n\t};\n};\n\nconst props = withDefaults( defineProps<{\n\teditor?: EditorWithUIView | null;\n\telement?: UIElementName;\n}>(), {\n\teditor: null,\n\telement: 'toolbar'\n} );\n\nconst uiRef = ref<HTMLDivElement>();\n\nwatchEffect( onCleanup => {\n\tconst editor = props.editor;\n\tconst uiContainer = uiRef.value;\n\n\tif ( !editor || !uiContainer ) {\n\t\treturn;\n\t}\n\n\tconst uiElement = props.element === 'menuBar' ?\n\t\teditor.ui.view.menuBarView?.element :\n\t\teditor.ui.view.toolbar?.element;\n\n\tif ( !uiElement ) {\n\t\treturn;\n\t}\n\n\tuiContainer.appendChild( uiElement );\n\n\tonCleanup( () => {\n\t\tif ( uiContainer.contains( uiElement ) ) {\n\t\t\tuiContainer.removeChild( uiElement );\n\t\t}\n\t} );\n}, { flush: 'post' } );\n</script>\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<template>\n  <div ref=\"uiRef\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watchEffect } from 'vue';\nimport type { Editor } from 'ckeditor5';\n\ndefineOptions( {\n\tname: 'CkeditorElement'\n} );\n\ntype UIElementName = 'menuBar' | 'toolbar';\n\ntype EditorWithUIView = Editor & {\n\tui: {\n\t\tview: EditorUIViewWithElements;\n\t};\n};\n\ntype EditorUIViewWithElements = {\n\tmenuBarView?: {\n\t\telement?: HTMLElement | null;\n\t};\n\ttoolbar?: {\n\t\telement?: HTMLElement | null;\n\t};\n};\n\nconst props = withDefaults( defineProps<{\n\teditor?: EditorWithUIView | null;\n\telement?: UIElementName;\n}>(), {\n\teditor: null,\n\telement: 'toolbar'\n} );\n\nconst uiRef = ref<HTMLDivElement>();\n\nwatchEffect( onCleanup => {\n\tconst editor = props.editor;\n\tconst uiContainer = uiRef.value;\n\n\tif ( !editor || !uiContainer ) {\n\t\treturn;\n\t}\n\n\tconst uiElement = props.element === 'menuBar' ?\n\t\teditor.ui.view.menuBarView?.element :\n\t\teditor.ui.view.toolbar?.element;\n\n\tif ( !uiElement ) {\n\t\treturn;\n\t}\n\n\tuiContainer.appendChild( uiElement );\n\n\tonCleanup( () => {\n\t\tif ( uiContainer.contains( uiElement ) ) {\n\t\t\tuiContainer.removeChild( uiElement );\n\t\t}\n\t} );\n}, { flush: 'post' } );\n</script>\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nexport const ROOT_EDITABLE_OPTIONS_ATTRIBUTE = '$rootEditableOptions';\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<template>\n  <DynamicElement\n    v-if=\"elementDefinition\"\n    ref=\"editorElementRef\"\n    :definition=\"elementDefinition\"\n  />\n</template>\n\n\n<script setup lang=\"ts\">\nimport { computed, ref, watchEffect } from 'vue';\nimport type { MultiRootEditor } from 'ckeditor5';\n\nimport DynamicElement from '../DynamicElement.vue';\nimport { normalizeEditorElementDefinition } from '../utils/normalizeEditorElementDefinition.js';\nimport { ROOT_EDITABLE_OPTIONS_ATTRIBUTE } from './constants.js';\nimport type { RootEditableOptionsAttribute } from './types.js';\n\ndefineOptions( {\n\tname: 'CkeditorMultiRootEditable'\n} );\n\nconst props = withDefaults( defineProps<{\n\tid?: string;\n\trootName: string;\n\teditor?: MultiRootEditor | null;\n\teditableOptions?: RootEditableOptionsAttribute | null;\n}>(), {\n\tid: undefined,\n\teditor: null,\n\teditableOptions: null\n} );\n\nconst editorElementRef = ref<InstanceType<typeof DynamicElement>>();\n\nconst root = computed( () => props.editor?.model.document.getRoot( props.rootName ) ?? null );\n\nconst rootEditableOptions = computed<RootEditableOptionsAttribute | null>( () => {\n\tconst currentRoot = root.value;\n\n\tif ( !currentRoot ) {\n\t\treturn null;\n\t}\n\n\tconst options = props.editableOptions ??\n\t\tcurrentRoot.getAttribute( ROOT_EDITABLE_OPTIONS_ATTRIBUTE ) as RootEditableOptionsAttribute | undefined;\n\n\treturn { ...options };\n} );\n\nconst elementDefinition = computed( () => {\n\tconst options = rootEditableOptions.value;\n\n\tif ( !options ) {\n\t\treturn null;\n\t}\n\n\tconst normalizedDefinition = normalizeEditorElementDefinition( options.element ?? { name: 'div' } );\n\n\treturn {\n\t\t...normalizedDefinition,\n\t\tattributes: {\n\t\t\t...normalizedDefinition.attributes,\n\t\t\tid: props.id ?? props.rootName\n\t\t}\n\t};\n} );\n\nwatchEffect( onCleanup => {\n\tconst editor = props.editor;\n\tconst currentRoot = root.value;\n\tconst options = rootEditableOptions.value;\n\tconst element = editorElementRef.value?.elementRef;\n\n\tif ( !editor || !currentRoot || !options || !element ) {\n\t\treturn;\n\t}\n\n\tif ( editor.ui.getEditableElement( props.rootName ) ) {\n\t\teditor.detachEditable( currentRoot );\n\t}\n\n\tconst editable = editor.ui.view.createEditable( props.rootName, element, options.label );\n\n\teditable.isInlineRoot = !editor.model.schema.checkChild( currentRoot, '$block' );\n\teditor.ui.addEditable( editable, options.placeholder );\n\teditor.editing.view.forceRender();\n\n\tonCleanup( () => {\n\t\tif ( editor.state === 'destroyed' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst latestRoot = editor.model.document.getRoot( props.rootName );\n\n\t\tif ( latestRoot === currentRoot ) {\n\t\t\teditor.detachEditable( currentRoot );\n\t\t}\n\t} );\n}, { flush: 'post' } );\n</script>\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<template>\n  <DynamicElement\n    v-if=\"elementDefinition\"\n    ref=\"editorElementRef\"\n    :definition=\"elementDefinition\"\n  />\n</template>\n\n\n<script setup lang=\"ts\">\nimport { computed, ref, watchEffect } from 'vue';\nimport type { MultiRootEditor } from 'ckeditor5';\n\nimport DynamicElement from '../DynamicElement.vue';\nimport { normalizeEditorElementDefinition } from '../utils/normalizeEditorElementDefinition.js';\nimport { ROOT_EDITABLE_OPTIONS_ATTRIBUTE } from './constants.js';\nimport type { RootEditableOptionsAttribute } from './types.js';\n\ndefineOptions( {\n\tname: 'CkeditorMultiRootEditable'\n} );\n\nconst props = withDefaults( defineProps<{\n\tid?: string;\n\trootName: string;\n\teditor?: MultiRootEditor | null;\n\teditableOptions?: RootEditableOptionsAttribute | null;\n}>(), {\n\tid: undefined,\n\teditor: null,\n\teditableOptions: null\n} );\n\nconst editorElementRef = ref<InstanceType<typeof DynamicElement>>();\n\nconst root = computed( () => props.editor?.model.document.getRoot( props.rootName ) ?? null );\n\nconst rootEditableOptions = computed<RootEditableOptionsAttribute | null>( () => {\n\tconst currentRoot = root.value;\n\n\tif ( !currentRoot ) {\n\t\treturn null;\n\t}\n\n\tconst options = props.editableOptions ??\n\t\tcurrentRoot.getAttribute( ROOT_EDITABLE_OPTIONS_ATTRIBUTE ) as RootEditableOptionsAttribute | undefined;\n\n\treturn { ...options };\n} );\n\nconst elementDefinition = computed( () => {\n\tconst options = rootEditableOptions.value;\n\n\tif ( !options ) {\n\t\treturn null;\n\t}\n\n\tconst normalizedDefinition = normalizeEditorElementDefinition( options.element ?? { name: 'div' } );\n\n\treturn {\n\t\t...normalizedDefinition,\n\t\tattributes: {\n\t\t\t...normalizedDefinition.attributes,\n\t\t\tid: props.id ?? props.rootName\n\t\t}\n\t};\n} );\n\nwatchEffect( onCleanup => {\n\tconst editor = props.editor;\n\tconst currentRoot = root.value;\n\tconst options = rootEditableOptions.value;\n\tconst element = editorElementRef.value?.elementRef;\n\n\tif ( !editor || !currentRoot || !options || !element ) {\n\t\treturn;\n\t}\n\n\tif ( editor.ui.getEditableElement( props.rootName ) ) {\n\t\teditor.detachEditable( currentRoot );\n\t}\n\n\tconst editable = editor.ui.view.createEditable( props.rootName, element, options.label );\n\n\teditable.isInlineRoot = !editor.model.schema.checkChild( currentRoot, '$block' );\n\teditor.ui.addEditable( editable, options.placeholder );\n\teditor.editing.view.forceRender();\n\n\tonCleanup( () => {\n\t\tif ( editor.state === 'destroyed' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst latestRoot = editor.model.document.getRoot( props.rootName );\n\n\t\tif ( latestRoot === currentRoot ) {\n\t\t\teditor.detachEditable( currentRoot );\n\t\t}\n\t} );\n}, { flush: 'post' } );\n</script>\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport {\n\tmarkRaw,\n\tnextTick,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\ttoValue,\n\twatch,\n\ttype MaybeRefOrGetter,\n\ttype Ref\n} from 'vue';\nimport { debounce } from 'lodash-es';\n\nimport type {\n\tAddRootEvent,\n\tCKEditorError,\n\tDetachRootEvent,\n\tEditorConfig,\n\tEventInfo,\n\tInlineEditableUIView,\n\tModelRootElement,\n\tModelWriter,\n\tMultiRootEditor,\n\tWatchdogConfig\n} from 'ckeditor5';\n\nimport {\n\tassignAttributesPropToMultiRootEditorConfig,\n\tassignInitialDataToMultirootEditorConfig,\n\tgetInstalledCKBaseFeatures,\n\ttype ExtractEditorType\n} from '@ckeditor/ckeditor5-integrations-common';\n\nimport { appendUsageDataPluginToConfig } from '../plugins/VueIntegrationUsageDataPlugin.js';\nimport { useIsUnmounted } from '../composables/useIsUnmounted.js';\nimport { useEditorReadOnly } from '../composables/useEditorReadOnly.js';\nimport { cleanupOrphanEditorElements } from '../utils/cleanupOrphanEditorElements.js';\nimport {\n\tattachEditorWatchdogErrorHandler,\n\tdestroyEditorWithWatchdog,\n\tresolveEditorConstructor,\n\ttype EditorWithAttachedWatchdog\n} from '../utils/wrapWithWatchdogIfPresent.js';\n\nimport { ROOT_EDITABLE_OPTIONS_ATTRIBUTE } from './constants.js';\nimport type {\n\tAddRootOptions,\n\tMultiRootEditorData,\n\tMultiRootEditorErrorDescription,\n\tMultiRootEditorRootsAttributes,\n\tMultiRootEditorWithWatchdogRelaxedConstructor\n} from './types.js';\n\nconst INPUT_EVENT_DEBOUNCE_WAIT = 300;\nconst EDITOR_DESTROYED_BEFORE_READY_MESSAGE = 'The editor was destroyed before it became ready.';\n\ntype EditorReadyCallback<TEditor extends MultiRootEditor> = {\n\tresolve: ( editor: TEditor ) => void;\n\treject: ( error: Error ) => void;\n};\n\nexport function useMultiRootEditor<TEditorConstructor extends MultiRootEditorWithWatchdogRelaxedConstructor>(\n\toptions: UseMultiRootEditorOptions<TEditorConstructor>\n): UseMultiRootEditorResult<ExtractEditorType<TEditorConstructor> & MultiRootEditor> {\n\ttype TEditor = ExtractEditorType<TEditorConstructor> & MultiRootEditor;\n\n\tconst isUnmounted = useIsUnmounted();\n\tconst instance = ref<EditorWithAttachedWatchdog<TEditor>>();\n\tconst data = ref<MultiRootEditorData>( cloneData( toValue( options.data ) ) );\n\tconst rootsAttributes = ref<MultiRootEditorRootsAttributes>(\n\t\tnormalizeRootsAttributes( toValue( options.rootsAttributes ), data.value )\n\t);\n\tconst roots = ref<Array<string>>( Object.keys( data.value ) );\n\tconst shouldUpdateEditor = ref( false );\n\tconst lastEditorData = ref<MultiRootEditorData>();\n\tconst lastEditorRootsAttributes = ref<MultiRootEditorRootsAttributes>();\n\n\tlet editorReadyCallbacks: Array<EditorReadyCallback<TEditor>> = [];\n\n\tuseEditorReadOnly( instance, () => toValue( options.disabled ) );\n\n\twatch( () => toValue( options.data ), newData => {\n\t\tif ( instance.value && lastEditorData.value && areRecordsEqual( newData, lastEditorData.value ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetData( cloneData( newData ) );\n\t}, { deep: true } );\n\n\twatch( () => toValue( options.rootsAttributes ), newRootsAttributes => {\n\t\tconst sourceRootsAttributes = cloneRootsAttributes( newRootsAttributes );\n\t\tconst normalizedRootsAttributes = normalizeRootsAttributes( newRootsAttributes, data.value );\n\t\tconst nextRootsAttributes = instance.value ?\n\t\t\tmergeRootsAttributes( rootsAttributes.value, normalizedRootsAttributes, data.value ) :\n\t\t\tnormalizedRootsAttributes;\n\t\tconst shouldEmitNormalizedRootsAttributes = !!instance.value && !areRecordsEqual( nextRootsAttributes, sourceRootsAttributes );\n\n\t\tif (\n\t\t\tinstance.value &&\n\t\t\tlastEditorRootsAttributes.value &&\n\t\t\tareRecordsEqual( nextRootsAttributes, lastEditorRootsAttributes.value )\n\t\t) {\n\t\t\tif ( shouldEmitNormalizedRootsAttributes ) {\n\t\t\t\tsetRootsAttributes( nextRootsAttributes );\n\t\t\t\temitRootsAttributes( null, instance.value as TEditor );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tsetRootsAttributes( nextRootsAttributes );\n\n\t\tif ( shouldEmitNormalizedRootsAttributes ) {\n\t\t\temitRootsAttributes( null, instance.value as TEditor );\n\t\t}\n\t}, { deep: true } );\n\n\twatch( [ data, rootsAttributes ], () => {\n\t\tconst editor = instance.value;\n\n\t\tif ( !editor || !shouldUpdateEditor.value ) {\n\t\t\treturn;\n\t\t}\n\n\t\tshouldUpdateEditor.value = false;\n\t\tsyncEditorWithState( editor );\n\t}, { deep: true, flush: 'post' } );\n\n\twatch( instance, async ( newInstance, _oldInstance, onCleanup ) => {\n\t\t/* istanbul ignore if -- @preserve - Defensive check, instance can only be set to an editor here. */\n\t\tif ( !newInstance ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet isCurrentInstance = true;\n\t\tconst editor = newInstance as TEditor;\n\t\tconst modelDocument = editor.model.document;\n\t\tconst viewDocument = editor.editing.view.document;\n\t\tconst emitDebouncedDataUpdate = debounce( ( event: EventInfo ) => {\n\t\t\tupdateStateFromEditor( editor, event );\n\t\t}, INPUT_EVENT_DEBOUNCE_WAIT, { leading: true } );\n\t\tconst onChangeDataListener = ( event: EventInfo ) => onChangeData( editor, event, emitDebouncedDataUpdate );\n\t\tconst onAddRootListener = ( event: EventInfo, root: ModelRootElement ) => onAddRoot( editor, event, root );\n\t\tconst onDetachRootListener = ( event: EventInfo, root: ModelRootElement ) => onDetachRoot( editor, event, root );\n\t\tconst onFocusListener = ( event: EventInfo ) => options.onFocus?.( event, editor );\n\t\tconst onBlurListener = ( event: EventInfo ) => options.onBlur?.( event, editor );\n\t\tconst onDestroyListener = () => {\n\t\t\temitDebouncedDataUpdate.cancel();\n\t\t\toptions.onDestroy?.( editor );\n\t\t};\n\n\t\tmodelDocument.on( 'change:data', onChangeDataListener );\n\t\teditor.on<AddRootEvent>( 'addRoot', onAddRootListener );\n\t\teditor.on<DetachRootEvent>( 'detachRoot', onDetachRootListener );\n\t\tviewDocument.on( 'focus', onFocusListener );\n\t\tviewDocument.on( 'blur', onBlurListener );\n\t\teditor.once( 'destroy', onDestroyListener );\n\n\t\tonCleanup( () => {\n\t\t\tisCurrentInstance = false;\n\t\t\tmodelDocument.off( 'change:data', onChangeDataListener );\n\t\t\teditor.off( 'addRoot', onAddRootListener );\n\t\t\teditor.off( 'detachRoot', onDetachRootListener );\n\t\t\tviewDocument.off( 'focus', onFocusListener );\n\t\t\tviewDocument.off( 'blur', onBlurListener );\n\t\t\temitDebouncedDataUpdate.cancel();\n\t\t} );\n\n\t\tawait nextTick();\n\n\t\t/* istanbul ignore if -- @preserve - Instance replacement/unmount before deferred ready is a defensive race guard. */\n\t\tif ( !isCurrentInstance || isUnmounted.value || instance.value !== editor ) {\n\t\t\treturn;\n\t\t}\n\n\t\toptions.onReady?.( editor );\n\n\t\tresolveEditorReadyCallbacks( editor );\n\t}, { flush: 'post' } );\n\n\tonMounted( initializeEditor );\n\n\tonBeforeUnmount( async () => {\n\t\tconst editor = instance.value;\n\n\t\trejectEditorReadyCallbacks( new Error( EDITOR_DESTROYED_BEFORE_READY_MESSAGE ) );\n\n\t\tif ( !editor ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinstance.value = undefined;\n\t\tforceAssignFakeEditableElements( editor );\n\n\t\tawait destroyEditorWithWatchdog( editor );\n\t} );\n\n\tasync function initializeEditor() {\n\t\tconst creationData = cloneData( data.value );\n\t\tconst creationRootsAttributes = cloneRootsAttributes( rootsAttributes.value );\n\t\tconst Constructor = resolveEditorConstructor(\n\t\t\ttoValue( options.editor ),\n\t\t\t!!toValue( options.disableWatchdog ),\n\t\t\ttoValue( options.watchdogConfig )\n\t\t);\n\n\t\ttry {\n\t\t\tconst editor = await createEditor( Constructor, creationData, creationRootsAttributes );\n\n\t\t\tif ( isUnmounted.value ) {\n\t\t\t\trejectEditorReadyCallbacks( new Error( EDITOR_DESTROYED_BEFORE_READY_MESSAGE ) );\n\t\t\t\tforceAssignFakeEditableElements( editor );\n\t\t\t\tawait destroyEditorWithWatchdog( editor );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst watchdog = attachEditorWatchdogErrorHandler( editor, {\n\t\t\t\tisUnmounted: () => isUnmounted.value,\n\t\t\t\tonError: ( { error, watchdog, editor, causesRestart } ) => {\n\t\t\t\t\treportError( error, {\n\t\t\t\t\t\tphase: 'runtime',\n\t\t\t\t\t\twatchdog,\n\t\t\t\t\t\teditor,\n\t\t\t\t\t\tcausesRestart\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( watchdog ) {\n\t\t\t\twatchdog.on( 'restart', () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t/* istanbul ignore else -- @preserve - Restart is only handled after an editor instance is assigned. */\n\t\t\t\t\t\tif ( instance.value ) {\n\t\t\t\t\t\t\tcleanupOrphanEditorElements( instance.value );\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch ( err ) {\n\t\t\t\t\t\tconsole.error( err );\n\t\t\t\t\t}\n\n\t\t\t\t\t/* istanbul ignore if -- @preserve - Restart without an editor or after unmount is a watchdog edge case. */\n\t\t\t\t\tif ( isUnmounted.value || !watchdog.editor ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst restartedEditor = watchdog.editor as EditorWithAttachedWatchdog<TEditor>;\n\n\t\t\t\t\tinstance.value = markRaw( restartedEditor );\n\t\t\t\t\tsyncStateFromEditor( restartedEditor );\n\t\t\t\t\temitData( null, restartedEditor );\n\t\t\t\t\temitRootsAttributes( null, restartedEditor );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tinstance.value = markRaw( editor );\n\n\t\t\tif (\n\t\t\t\tareRecordsEqual( data.value, creationData ) &&\n\t\t\t\tareRecordsEqual( rootsAttributes.value, creationRootsAttributes )\n\t\t\t) {\n\t\t\t\tsyncStateFromEditor( editor );\n\t\t\t} else {\n\t\t\t\tsyncEditorWithState( editor );\n\t\t\t\tsyncStateFromEditor( editor );\n\t\t\t}\n\t\t} catch ( error: any ) {\n\t\t\trejectEditorReadyCallbacks( error );\n\n\t\t\t/* istanbul ignore if -- @preserve - Initialization errors after unmount are intentionally ignored. */\n\t\t\tif ( isUnmounted.value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treportError( error, {\n\t\t\t\tphase: 'initialization'\n\t\t\t} );\n\t\t}\n\t}\n\n\tasync function createEditor(\n\t\tConstructor: TEditorConstructor,\n\t\tinitialData: MultiRootEditorData,\n\t\tinitialRootsAttributes: MultiRootEditorRootsAttributes\n\t): Promise<EditorWithAttachedWatchdog<TEditor>> {\n\t\tlet editorConfig = assignAttributesPropToMultiRootEditorConfig(\n\t\t\tinitialRootsAttributes,\n\t\t\t{ ...toValue( options.config ) }\n\t\t);\n\n\t\teditorConfig = appendUsageDataPluginToConfig( editorConfig );\n\n\t\tconst {\n\t\t\tinitialData: mergedInitialData,\n\t\t\t...mergedConfig\n\t\t} = assignInitialDataToMultirootEditorConfig( initialData, editorConfig ) as EditorConfig & {\n\t\t\tinitialData?: MultiRootEditorData;\n\t\t};\n\t\tconst supports = getInstalledCKBaseFeatures();\n\t\tconst Editor = Constructor as unknown as {\n\t\t\tcreate( data: MultiRootEditorData, config: EditorConfig ): Promise<EditorWithAttachedWatchdog<TEditor>>;\n\t\t\tcreate( config: EditorConfig ): Promise<EditorWithAttachedWatchdog<TEditor>>;\n\t\t};\n\n\t\treturn await (\n\t\t\tsupports.elementConfigAttachment ?\n\t\t\t\tEditor.create( { ...mergedConfig, initialData: mergedInitialData } ) :\n\t\t\t\tEditor.create( mergedInitialData as MultiRootEditorData, mergedConfig )\n\t\t);\n\t}\n\n\tfunction syncEditorWithState( editor: TEditor ) {\n\t\tconst desiredData = cloneData( data.value );\n\t\tconst desiredRootsAttributes = normalizeRootsAttributes( rootsAttributes.value, desiredData );\n\t\tconst editorData = editor.getFullData();\n\t\tconst editorRootsAttributes = normalizeRootsAttributes( editor.getRootsAttributes(), editorData );\n\t\tconst { addedKeys: newRoots, removedKeys: removedRoots } = getRecordDiff( editorData, desiredData );\n\t\tconst modifiedRoots = Object.keys( desiredData ).filter( rootName =>\n\t\t\teditorData[ rootName ] !== undefined && editorData[ rootName ] !== desiredData[ rootName ]\n\t\t);\n\t\tconst rootsWithChangedAttributes = Object.keys( desiredRootsAttributes ).filter( rootName =>\n\t\t\teditorData[ rootName ] !== undefined &&\n\t\t\t!areRecordsEqual( editorRootsAttributes[ rootName ], desiredRootsAttributes[ rootName ] )\n\t\t);\n\n\t\trootsAttributes.value = desiredRootsAttributes;\n\n\t\teditor.model.change( writer => {\n\t\t\thandleNewRoots( editor, newRoots, desiredData, desiredRootsAttributes );\n\t\t\thandleRemovedRoots( editor, removedRoots );\n\n\t\t\tif ( modifiedRoots.length ) {\n\t\t\t\tupdateEditorData( editor, modifiedRoots, desiredData );\n\t\t\t}\n\n\t\t\tif ( rootsWithChangedAttributes.length ) {\n\t\t\t\tupdateEditorAttributes( editor, writer, rootsWithChangedAttributes, desiredRootsAttributes );\n\t\t\t}\n\t\t} );\n\t}\n\n\tfunction syncStateFromEditor( editor: TEditor ) {\n\t\tdata.value = cloneData( editor.getFullData() );\n\t\trootsAttributes.value = normalizeRootsAttributes( editor.getRootsAttributes(), data.value );\n\t\troots.value = Object.keys( data.value );\n\t}\n\n\tfunction onChangeData(\n\t\teditor: TEditor,\n\t\tevent: EventInfo,\n\t\temitDebouncedDataUpdate: ( event: EventInfo ) => void\n\t) {\n\t\temitDebouncedDataUpdate( event );\n\n\t\toptions.onChange?.( event, editor );\n\t}\n\n\tfunction updateStateFromEditor( editor: TEditor, event: EventInfo | null ) {\n\t\tif ( toValue( options.disableTwoWayDataBinding ) || isUnmounted.value ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editorData = cloneData( editor.getFullData() );\n\t\tconst editorRootsAttributes = normalizeRootsAttributes( editor.getRootsAttributes(), editorData );\n\t\tconst shouldEmitData = !areRecordsEqual( data.value, editorData );\n\t\tconst shouldEmitRootsAttributes = !areRecordsEqual( rootsAttributes.value, editorRootsAttributes );\n\n\t\tdata.value = editorData;\n\t\trootsAttributes.value = editorRootsAttributes;\n\t\troots.value = Object.keys( editorData );\n\t\tlastEditorData.value = cloneData( editorData );\n\t\tlastEditorRootsAttributes.value = cloneRootsAttributes( editorRootsAttributes );\n\n\t\tif ( shouldEmitData ) {\n\t\t\temitData( event, editor );\n\t\t}\n\n\t\tif ( shouldEmitRootsAttributes ) {\n\t\t\temitRootsAttributes( event, editor );\n\t\t}\n\t}\n\n\tfunction onAddRoot( editor: TEditor, event: EventInfo, root: ModelRootElement ) {\n\t\tconst rootName = root.rootName;\n\n\t\tif ( !toValue( options.disableTwoWayDataBinding ) ) {\n\t\t\tdata.value = {\n\t\t\t\t...data.value,\n\t\t\t\t[ rootName ]: editor.getData( { rootName } )\n\t\t\t};\n\n\t\t\trootsAttributes.value = normalizeRootsAttributes( {\n\t\t\t\t...rootsAttributes.value,\n\t\t\t\t[ rootName ]: editor.getRootAttributes( rootName )\n\t\t\t}, data.value );\n\n\t\t\temitData( event, editor );\n\t\t\temitRootsAttributes( event, editor );\n\t\t}\n\n\t\troots.value = unique( [ ...roots.value, rootName ] );\n\t}\n\n\tfunction onDetachRoot( editor: TEditor, event: EventInfo, root: ModelRootElement ) {\n\t\tconst rootName = root.rootName;\n\n\t\tif ( !toValue( options.disableTwoWayDataBinding ) ) {\n\t\t\tconst newData = { ...data.value };\n\t\t\tconst newRootsAttributes = { ...rootsAttributes.value };\n\n\t\t\tdelete newData[ rootName ];\n\t\t\tdelete newRootsAttributes[ rootName ];\n\n\t\t\tdata.value = newData;\n\t\t\trootsAttributes.value = newRootsAttributes;\n\n\t\t\temitData( event, editor );\n\t\t\temitRootsAttributes( event, editor );\n\t\t}\n\n\t\troots.value = roots.value.filter( currentRootName => currentRootName !== rootName );\n\t}\n\n\tfunction emitData( event: EventInfo | null, editor: TEditor ) {\n\t\tlastEditorData.value = cloneData( data.value );\n\t\toptions.onUpdateData?.( cloneData( data.value ), event, editor );\n\t}\n\n\tfunction emitRootsAttributes( event: EventInfo | null, editor: TEditor ) {\n\t\tlastEditorRootsAttributes.value = cloneRootsAttributes( rootsAttributes.value );\n\t\toptions.onUpdateRootsAttributes?.( cloneRootsAttributes( rootsAttributes.value ), event, editor );\n\t}\n\n\tfunction reportError( error: Error | CKEditorError, description: MultiRootEditorErrorDescription<TEditor> ) {\n\t\t/* istanbul ignore else -- @preserve - The Vue component always provides an error callback. */\n\t\tif ( options.onError ) {\n\t\t\toptions.onError( error, description );\n\t\t} else {\n\t\t\tconsole.error( error );\n\t\t}\n\t}\n\n\tfunction setData( newData: MultiRootEditorData ) {\n\t\tshouldUpdateEditor.value = true;\n\t\tdata.value = cloneData( newData );\n\t\trootsAttributes.value = normalizeRootsAttributes( rootsAttributes.value, data.value );\n\n\t\tif ( !instance.value ) {\n\t\t\troots.value = Object.keys( data.value );\n\t\t}\n\t}\n\n\tfunction setRootsAttributes( newRootsAttributes: MultiRootEditorRootsAttributes ) {\n\t\tshouldUpdateEditor.value = true;\n\t\trootsAttributes.value = normalizeRootsAttributes( newRootsAttributes, data.value );\n\t}\n\n\tasync function addRoot( { name, data: rootData = '', attributes = {}, editableOptions, ...rootOptions }: AddRootOptions ) {\n\t\tconst editor = await waitForEditor();\n\t\tconst supports = getInstalledCKBaseFeatures();\n\n\t\teditor.model.change( () => {\n\t\t\tconst mappedAttributes = {\n\t\t\t\t...attributes,\n\t\t\t\t...editableOptions && {\n\t\t\t\t\t[ ROOT_EDITABLE_OPTIONS_ATTRIBUTE ]: editableOptions\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfor ( const key of Object.keys( mappedAttributes ) ) {\n\t\t\t\teditor.registerRootAttribute( key );\n\t\t\t}\n\n\t\t\tlet options: Record<string, unknown> = {\n\t\t\t\tisUndoable: true,\n\t\t\t\t...rootOptions\n\t\t\t};\n\n\t\t\tif ( supports.rootsConfigEntry ) {\n\t\t\t\toptions = {\n\t\t\t\t\t...options,\n\t\t\t\t\tinitialData: rootData,\n\t\t\t\t\tmodelAttributes: mappedAttributes\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\toptions = {\n\t\t\t\t\t...options,\n\t\t\t\t\tdata: rootData,\n\t\t\t\t\tattributes: mappedAttributes\n\t\t\t\t};\n\t\t\t}\n\n\t\t\teditor.addRoot( name, options );\n\t\t} );\n\t}\n\n\tasync function removeRoot( name: string ) {\n\t\tconst editor = await waitForEditor();\n\n\t\teditor.model.change( () => {\n\t\t\teditor.detachRoot( name, true );\n\t\t} );\n\t}\n\n\tfunction waitForEditor(): Promise<TEditor> {\n\t\tif ( instance.value ) {\n\t\t\treturn Promise.resolve( instance.value as TEditor );\n\t\t}\n\n\t\tif ( isUnmounted.value ) {\n\t\t\treturn Promise.reject( new Error( EDITOR_DESTROYED_BEFORE_READY_MESSAGE ) );\n\t\t}\n\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\teditorReadyCallbacks.push( { resolve, reject } );\n\t\t} );\n\t}\n\n\tfunction resolveEditorReadyCallbacks( editor: TEditor ) {\n\t\teditorReadyCallbacks.forEach( ( { resolve } ) => resolve( editor ) );\n\t\teditorReadyCallbacks = [];\n\t}\n\n\tfunction rejectEditorReadyCallbacks( error: Error ) {\n\t\teditorReadyCallbacks.forEach( ( { reject } ) => reject( error ) );\n\t\teditorReadyCallbacks = [];\n\t}\n\n\treturn {\n\t\tinstance: instance as Ref<EditorWithAttachedWatchdog<TEditor> | undefined>,\n\t\troots,\n\t\tdata,\n\t\trootsAttributes,\n\t\tsetData,\n\t\tsetRootsAttributes,\n\t\taddRoot,\n\t\tremoveRoot\n\t};\n}\n\nfunction handleNewRoots(\n\teditor: MultiRootEditor,\n\trootNames: Array<string>,\n\tdata: MultiRootEditorData,\n\trootsAttributes: MultiRootEditorRootsAttributes\n) {\n\tconst supports = getInstalledCKBaseFeatures();\n\n\tfor ( const rootName of rootNames ) {\n\t\t// The root may already exist in the model (e.g. it was detached earlier), but calling\n\t\t// `getRootAttributes()` for a root that is not in the model throws `get-root-attributes-missing-root`.\n\t\tconst existingRoot = editor.model.document.getRoot( rootName );\n\t\tconst rootAttributes = {\n\t\t\t...existingRoot && editor.getRootAttributes( rootName ),\n\t\t\t...rootsAttributes[ rootName ]\n\t\t};\n\t\tconst rootData = data[ rootName ];\n\n\t\tfor ( const key of Object.keys( rootAttributes ) ) {\n\t\t\teditor.registerRootAttribute( key );\n\t\t}\n\n\t\tlet options: Record<string, unknown> = {\n\t\t\tisUndoable: true\n\t\t};\n\n\t\tif ( supports.rootsConfigEntry ) {\n\t\t\toptions = {\n\t\t\t\t...options,\n\t\t\t\tinitialData: rootData,\n\t\t\t\tmodelAttributes: rootAttributes\n\t\t\t};\n\t\t} else {\n\t\t\toptions = {\n\t\t\t\t...options,\n\t\t\t\tdata: rootData,\n\t\t\t\tattributes: rootAttributes\n\t\t\t};\n\t\t}\n\n\t\teditor.addRoot( rootName, options );\n\t}\n}\n\nfunction handleRemovedRoots( editor: MultiRootEditor, rootNames: Array<string> ) {\n\tfor ( const rootName of rootNames ) {\n\t\teditor.detachRoot( rootName, true );\n\t}\n}\n\nfunction updateEditorData( editor: MultiRootEditor, rootNames: Array<string>, data: MultiRootEditorData ) {\n\tconst dataToUpdate = rootNames.reduce<MultiRootEditorData>(\n\t\t( result, rootName ) => ( { ...result, [ rootName ]: data[ rootName ] } ),\n\t\tObject.create( null )\n\t);\n\n\teditor.data.set( dataToUpdate, { suppressErrorInCollaboration: true } as any );\n}\n\nfunction updateEditorAttributes(\n\teditor: MultiRootEditor,\n\twriter: ModelWriter,\n\trootNames: Array<string>,\n\trootsAttributes: MultiRootEditorRootsAttributes\n) {\n\tfor ( const rootName of rootNames ) {\n\t\tconst rootAttributes = rootsAttributes[ rootName ];\n\n\t\tfor ( const key of Object.keys( rootAttributes ) ) {\n\t\t\teditor.registerRootAttribute( key );\n\t\t}\n\n\t\tconst root = editor.model.document.getRoot( rootName );\n\n\t\t/* istanbul ignore if -- @preserve - Attribute updates are only requested for existing roots. */\n\t\tif ( !root ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\twriter.setAttributes( rootAttributes, root );\n\t}\n}\n\nfunction forceAssignFakeEditableElements( editor: MultiRootEditor ) {\n\tconst initializeEditableWithFakeElement = ( editable: InlineEditableUIView ) => {\n\t\tif ( editable.name && !editor.editing.view.getDomRoot( editable.name ) ) {\n\t\t\teditor.editing.view.attachDomRoot( document.createElement( 'div' ), editable.name );\n\t\t}\n\t};\n\n\tObject\n\t\t.values( editor.ui.view.editables )\n\t\t.forEach( initializeEditableWithFakeElement );\n}\n\nfunction normalizeRootsAttributes(\n\trootsAttributes: MultiRootEditorRootsAttributes | undefined,\n\tdata: MultiRootEditorData\n): MultiRootEditorRootsAttributes {\n\t/* istanbul ignore next -- @preserve - Direct composable usage may omit roots attributes. */\n\tconst source = rootsAttributes ?? {};\n\n\treturn Object.keys( data ).reduce<MultiRootEditorRootsAttributes>( ( result, rootName ) => {\n\t\tresult[ rootName ] = { ...source[ rootName ] };\n\n\t\treturn result;\n\t}, Object.create( null ) );\n}\n\nfunction mergeRootsAttributes(\n\tpreviousRootsAttributes: MultiRootEditorRootsAttributes,\n\tnextRootsAttributes: MultiRootEditorRootsAttributes,\n\tdata: MultiRootEditorData\n): MultiRootEditorRootsAttributes {\n\treturn Object.keys( data ).reduce<MultiRootEditorRootsAttributes>( ( result, rootName ) => {\n\t\tresult[ rootName ] = {\n\t\t\t...previousRootsAttributes[ rootName ],\n\t\t\t...nextRootsAttributes[ rootName ]\n\t\t};\n\n\t\treturn result;\n\t}, Object.create( null ) );\n}\n\nfunction cloneData( data: MultiRootEditorData | undefined ): MultiRootEditorData {\n\treturn {\n\t\t...data\n\t};\n}\n\nfunction cloneRootsAttributes(\n\trootsAttributes: MultiRootEditorRootsAttributes | undefined\n): MultiRootEditorRootsAttributes {\n\t/* istanbul ignore next -- @preserve - Direct composable usage may omit roots attributes. */\n\treturn Object.keys( rootsAttributes ?? {} ).reduce<MultiRootEditorRootsAttributes>( ( result, rootName ) => {\n\t\tresult[ rootName ] = {\n\t\t\t...rootsAttributes![ rootName ]\n\t\t};\n\n\t\treturn result;\n\t}, Object.create( null ) );\n}\n\nfunction getRecordDiff( previousState: Record<string, unknown>, newState: Record<string, unknown> ) {\n\tconst previousStateKeys = Object.keys( previousState );\n\tconst newStateKeys = Object.keys( newState );\n\n\treturn {\n\t\taddedKeys: newStateKeys.filter( key => !previousStateKeys.includes( key ) ),\n\t\tremovedKeys: previousStateKeys.filter( key => !newStateKeys.includes( key ) )\n\t};\n}\n\nfunction areRecordsEqual( first: Record<string, unknown>, second: Record<string, unknown> ): boolean {\n\treturn JSON.stringify( first ) === JSON.stringify( second );\n}\n\nfunction unique<TValue>( values: Array<TValue> ): Array<TValue> {\n\treturn [ ...new Set( values ) ];\n}\n\nexport type UseMultiRootEditorOptions<TEditorConstructor extends MultiRootEditorWithWatchdogRelaxedConstructor> = {\n\teditor: MaybeRefOrGetter<TEditorConstructor>;\n\tdata: MaybeRefOrGetter<MultiRootEditorData>;\n\trootsAttributes?: MaybeRefOrGetter<MultiRootEditorRootsAttributes | undefined>;\n\tconfig?: MaybeRefOrGetter<EditorConfig | undefined>;\n\tdisabled?: MaybeRefOrGetter<boolean | undefined>;\n\twatchdogConfig?: MaybeRefOrGetter<WatchdogConfig | undefined>;\n\tdisableWatchdog?: MaybeRefOrGetter<boolean | undefined>;\n\tdisableTwoWayDataBinding?: MaybeRefOrGetter<boolean | undefined>;\n\tonReady?: ( editor: ExtractEditorType<TEditorConstructor> & MultiRootEditor ) => void;\n\tonDestroy?: ( editor: ExtractEditorType<TEditorConstructor> & MultiRootEditor ) => void;\n\tonChange?: ( event: EventInfo, editor: ExtractEditorType<TEditorConstructor> & MultiRootEditor ) => void;\n\tonFocus?: ( event: EventInfo, editor: ExtractEditorType<TEditorConstructor> & MultiRootEditor ) => void;\n\tonBlur?: ( event: EventInfo, editor: ExtractEditorType<TEditorConstructor> & MultiRootEditor ) => void;\n\tonUpdateData?: (\n\t\tdata: MultiRootEditorData,\n\t\tevent: EventInfo | null,\n\t\teditor: ExtractEditorType<TEditorConstructor> & MultiRootEditor\n\t) => void;\n\tonUpdateRootsAttributes?: (\n\t\trootsAttributes: MultiRootEditorRootsAttributes,\n\t\tevent: EventInfo | null,\n\t\teditor: ExtractEditorType<TEditorConstructor> & MultiRootEditor\n\t) => void;\n\tonError?: (\n\t\terror: Error | CKEditorError,\n\t\tdescription: MultiRootEditorErrorDescription<ExtractEditorType<TEditorConstructor> & MultiRootEditor>\n\t) => void;\n};\n\nexport type UseMultiRootEditorResult<TEditor extends MultiRootEditor> = {\n\tinstance: Ref<EditorWithAttachedWatchdog<TEditor> | undefined>;\n\troots: Ref<Array<string>>;\n\tdata: Ref<MultiRootEditorData>;\n\trootsAttributes: Ref<MultiRootEditorRootsAttributes>;\n\tsetData( data: MultiRootEditorData ): void;\n\tsetRootsAttributes( rootsAttributes: MultiRootEditorRootsAttributes ): void;\n\taddRoot( options: AddRootOptions ): Promise<void>;\n\tremoveRoot( name: string ): Promise<void>;\n};\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<template>\n  <slot\n    :editor=\"instance\"\n    :roots=\"roots\"\n    :data=\"data\"\n    :attributes=\"rootsAttributes\"\n    :roots-attributes=\"rootsAttributes\"\n    :add-root=\"addRoot\"\n    :remove-root=\"removeRoot\"\n  >\n    <CkeditorElement\n      :editor=\"instance\"\n      element=\"menuBar\"\n    />\n    <CkeditorElement :editor=\"instance\" />\n    <MultiRootEditorEditable\n      v-for=\"rootName in roots\"\n      :id=\"rootName\"\n      :key=\"rootName\"\n      :root-name=\"rootName\"\n      :editor=\"instance\"\n    />\n  </slot>\n</template>\n\n<script\n\tsetup\n\tlang=\"ts\"\n\tgeneric=\"TEditorConstructor extends MultiRootEditorWithWatchdogRelaxedConstructor\"\n>\nimport { getCurrentInstance } from 'vue';\nimport type { CKEditorError, MultiRootEditor } from 'ckeditor5';\nimport type { ExtractEditorType } from '@ckeditor/ckeditor5-integrations-common';\n\nimport CkeditorElement from './CkeditorElement.vue';\nimport MultiRootEditorEditable from './multiroot/MultiRootEditorEditable.vue';\nimport { useMultiRootEditor } from './multiroot/useMultiRootEditor.js';\nimport type {\n\tMultiRootEditorData,\n\tMultiRootEditorErrorDescription,\n\tMultiRootEditorLifecycleEvents,\n\tMultiRootEditorRootsAttributes,\n\tMultiRootEditorVModelEvents,\n\tMultiRootEditorWithWatchdogRelaxedConstructor,\n\tMultiRootProps\n} from './multiroot/types.js';\n\ntype TEditor = ExtractEditorType<TEditorConstructor> & MultiRootEditor;\n\ndefineOptions( {\n\tname: 'CkeditorMultiRoot'\n} );\n\nconst model = defineModel<MultiRootEditorData>( 'modelValue', { default: () => ( {} ) } );\nconst rootsAttributesModel = defineModel<MultiRootEditorRootsAttributes>( 'rootsAttributes', { default: () => ( {} ) } );\n\nconst props = withDefaults( defineProps<MultiRootProps<TEditorConstructor>>(), {\n\tconfig: () => ( {} ),\n\tdisableWatchdog: false,\n\tdisabled: false,\n\tdisableTwoWayDataBinding: false\n} );\n\nconst emit = defineEmits<\n\t& MultiRootEditorLifecycleEvents<TEditor>\n\t& MultiRootEditorVModelEvents<TEditor>\n\t& {\n\t\terror: [ error: Error | CKEditorError, description: MultiRootEditorErrorDescription<TEditor> ];\n\t\tchange: [ event: unknown, editor: TEditor ];\n\t}\n>();\n\nconst currentInstance = getCurrentInstance();\nconst hasErrorHandler = () => !!currentInstance?.vnode.props?.onError;\n\nconst {\n\tinstance,\n\troots,\n\tdata,\n\trootsAttributes,\n\taddRoot,\n\tremoveRoot\n} = useMultiRootEditor<TEditorConstructor>( {\n\teditor: () => props.editor,\n\tconfig: () => props.config,\n\tdata: model,\n\trootsAttributes: rootsAttributesModel,\n\tdisabled: () => props.disabled,\n\tdisableWatchdog: () => props.disableWatchdog,\n\tdisableTwoWayDataBinding: () => props.disableTwoWayDataBinding,\n\twatchdogConfig: () => props.watchdogConfig,\n\tonReady: editor => emit( 'ready', editor as TEditor ),\n\tonDestroy: editor => emit( 'destroy', editor as TEditor ),\n\tonFocus: ( event, editor ) => emit( 'focus', event, editor as TEditor ),\n\tonBlur: ( event, editor ) => emit( 'blur', event, editor as TEditor ),\n\tonChange: ( event, editor ) => emit( 'change', event, editor as TEditor ),\n\tonUpdateData: ( data, event, editor ) => {\n\t\temit( 'update:modelValue', data, event, editor as TEditor );\n\t\temit( 'input', data, event, editor as TEditor );\n\t},\n\tonUpdateRootsAttributes: ( rootsAttributes, event, editor ) => {\n\t\temit( 'update:rootsAttributes', rootsAttributes, event, editor as TEditor );\n\t},\n\tonError: ( error, description ) => {\n\t\tif ( !hasErrorHandler() ) {\n\t\t\tconsole.error( error );\n\t\t}\n\n\t\temit( 'error', error, description );\n\t}\n} );\n\ndefineExpose( {\n\tinstance,\n\troots,\n\tdata,\n\trootsAttributes,\n\taddRoot,\n\tremoveRoot\n} );\n</script>\n","<!--\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n-->\n\n<template>\n  <slot\n    :editor=\"instance\"\n    :roots=\"roots\"\n    :data=\"data\"\n    :attributes=\"rootsAttributes\"\n    :roots-attributes=\"rootsAttributes\"\n    :add-root=\"addRoot\"\n    :remove-root=\"removeRoot\"\n  >\n    <CkeditorElement\n      :editor=\"instance\"\n      element=\"menuBar\"\n    />\n    <CkeditorElement :editor=\"instance\" />\n    <MultiRootEditorEditable\n      v-for=\"rootName in roots\"\n      :id=\"rootName\"\n      :key=\"rootName\"\n      :root-name=\"rootName\"\n      :editor=\"instance\"\n    />\n  </slot>\n</template>\n\n<script\n\tsetup\n\tlang=\"ts\"\n\tgeneric=\"TEditorConstructor extends MultiRootEditorWithWatchdogRelaxedConstructor\"\n>\nimport { getCurrentInstance } from 'vue';\nimport type { CKEditorError, MultiRootEditor } from 'ckeditor5';\nimport type { ExtractEditorType } from '@ckeditor/ckeditor5-integrations-common';\n\nimport CkeditorElement from './CkeditorElement.vue';\nimport MultiRootEditorEditable from './multiroot/MultiRootEditorEditable.vue';\nimport { useMultiRootEditor } from './multiroot/useMultiRootEditor.js';\nimport type {\n\tMultiRootEditorData,\n\tMultiRootEditorErrorDescription,\n\tMultiRootEditorLifecycleEvents,\n\tMultiRootEditorRootsAttributes,\n\tMultiRootEditorVModelEvents,\n\tMultiRootEditorWithWatchdogRelaxedConstructor,\n\tMultiRootProps\n} from './multiroot/types.js';\n\ntype TEditor = ExtractEditorType<TEditorConstructor> & MultiRootEditor;\n\ndefineOptions( {\n\tname: 'CkeditorMultiRoot'\n} );\n\nconst model = defineModel<MultiRootEditorData>( 'modelValue', { default: () => ( {} ) } );\nconst rootsAttributesModel = defineModel<MultiRootEditorRootsAttributes>( 'rootsAttributes', { default: () => ( {} ) } );\n\nconst props = withDefaults( defineProps<MultiRootProps<TEditorConstructor>>(), {\n\tconfig: () => ( {} ),\n\tdisableWatchdog: false,\n\tdisabled: false,\n\tdisableTwoWayDataBinding: false\n} );\n\nconst emit = defineEmits<\n\t& MultiRootEditorLifecycleEvents<TEditor>\n\t& MultiRootEditorVModelEvents<TEditor>\n\t& {\n\t\terror: [ error: Error | CKEditorError, description: MultiRootEditorErrorDescription<TEditor> ];\n\t\tchange: [ event: unknown, editor: TEditor ];\n\t}\n>();\n\nconst currentInstance = getCurrentInstance();\nconst hasErrorHandler = () => !!currentInstance?.vnode.props?.onError;\n\nconst {\n\tinstance,\n\troots,\n\tdata,\n\trootsAttributes,\n\taddRoot,\n\tremoveRoot\n} = useMultiRootEditor<TEditorConstructor>( {\n\teditor: () => props.editor,\n\tconfig: () => props.config,\n\tdata: model,\n\trootsAttributes: rootsAttributesModel,\n\tdisabled: () => props.disabled,\n\tdisableWatchdog: () => props.disableWatchdog,\n\tdisableTwoWayDataBinding: () => props.disableTwoWayDataBinding,\n\twatchdogConfig: () => props.watchdogConfig,\n\tonReady: editor => emit( 'ready', editor as TEditor ),\n\tonDestroy: editor => emit( 'destroy', editor as TEditor ),\n\tonFocus: ( event, editor ) => emit( 'focus', event, editor as TEditor ),\n\tonBlur: ( event, editor ) => emit( 'blur', event, editor as TEditor ),\n\tonChange: ( event, editor ) => emit( 'change', event, editor as TEditor ),\n\tonUpdateData: ( data, event, editor ) => {\n\t\temit( 'update:modelValue', data, event, editor as TEditor );\n\t\temit( 'input', data, event, editor as TEditor );\n\t},\n\tonUpdateRootsAttributes: ( rootsAttributes, event, editor ) => {\n\t\temit( 'update:rootsAttributes', rootsAttributes, event, editor as TEditor );\n\t},\n\tonError: ( error, description ) => {\n\t\tif ( !hasErrorHandler() ) {\n\t\t\tconsole.error( error );\n\t\t}\n\n\t\temit( 'error', error, description );\n\t}\n} );\n\ndefineExpose( {\n\tinstance,\n\troots,\n\tdata,\n\trootsAttributes,\n\taddRoot,\n\tremoveRoot\n} );\n</script>\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport {\n\tcomputed, ref,\n\tshallowReadonly, watchEffect,\n\ttype ComputedRef, type Ref\n} from 'vue';\n\nimport { uid } from '@ckeditor/ckeditor5-integrations-common';\n\n/**\n * A composable that executes an async function and provides the result.\n *\n * @param asyncFunc The async function to execute.\n * @returns The result of the async function.\n * @example\n *\n * ```ts\n * const { loading, data, error } = useAsync( async () => {\n * \tconst response = await fetch( 'https://api.example.com/data' );\n * \treturn response.json();\n * } );\n * ```\n */\nexport const useAsync = <R>(\n\tasyncFunc: () => Promise<R>\n): AsyncComposableResult<R> => {\n\t// The UUID of the last query to prevent race conditions between multiple queries.\n\tconst lastQueryUUID = ref<string | null>( null );\n\n\t// The error thrown by the async function.\n\tconst error = ref<Error | null>( null );\n\n\t// The data returned by the async function.\n\tconst data: Ref<R | null> = ref( null );\n\n\t// Whether the async function is currently loading.\n\tconst loading = computed( () => lastQueryUUID.value !== null );\n\n\t// Execute the async function and update the result. This will be re-executed\n\t// whenever refs used inside the `asyncFunc` change.\n\twatchEffect( async () => {\n\t\tconst currentQueryUID = uid();\n\n\t\tlastQueryUUID.value = currentQueryUID;\n\t\tdata.value = null;\n\t\terror.value = null;\n\n\t\t// This function is called before updating `data`, `error` or `loading`\n\t\t// because the `watchEffect` could be re-triggered with the new data\n\t\t// while waiting for the previous `asyncFunc` to resolve.\n\t\tconst shouldDiscardQuery = () => lastQueryUUID.value !== currentQueryUID;\n\n\t\ttry {\n\t\t\tconst result = await asyncFunc();\n\n\t\t\tif ( !shouldDiscardQuery() ) {\n\t\t\t\tdata.value = result;\n\t\t\t}\n\t\t} catch ( err: any ) {\n\t\t\tconsole.error( err );\n\n\t\t\tif ( !shouldDiscardQuery() ) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t} finally {\n\t\t\tif ( !shouldDiscardQuery() ) {\n\t\t\t\tlastQueryUUID.value = null;\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn {\n\t\tloading: shallowReadonly( loading ),\n\t\tdata: shallowReadonly( data ),\n\t\terror: shallowReadonly( error )\n\t};\n};\n\n/**\n * The result of the `useAsync` composable.\n */\nexport type AsyncComposableResult<R> = {\n\n\t/**\n\t * Whether the async function is currently loading.\n\t */\n\tloading: ComputedRef<boolean>;\n\n\t/**\n\t * \tThe data returned by the async function.\n\t */\n\tdata: Ref<R | null>;\n\n\t/**\n\t * The error thrown by the async function.\n\t */\n\terror: Ref<Error | null>;\n};\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { toValue, type MaybeRefOrGetter } from 'vue';\nimport { useAsync, type AsyncComposableResult } from './composables/useAsync.js';\n\nimport {\n\tloadCKEditorCloud,\n\ttype CKEditorCloudConfig,\n\ttype CKEditorCloudResult\n} from '@ckeditor/ckeditor5-integrations-common';\n\n/**\n * A composable function that loads CKEditor Cloud services.\n *\n * @param config The configuration of the CKEditor Cloud services.\n * @returns The result of the loaded CKEditor Cloud services.\n * @template Config The type of the CKEditor Cloud configuration.\n * @example\n * ```ts\n * const { data } = useCKEditorCloud( {\n * \tversion: '43.0.0',\n * \tlanguages: [ 'en', 'de' ],\n * \tpremium: true\n * } );\n *\n * if ( data.value ) {\n * \tconst { CKEditor, CKEditorPremiumFeatures } = data.value;\n * \tconst { Paragraph } = CKEditor;\n *\n * \t// ..\n * }\n */\nexport default function useCKEditorCloud<Config extends CKEditorCloudConfig>(\n\tconfig: MaybeRefOrGetter<Config>\n): AsyncComposableResult<CKEditorCloudResult<Config>> {\n\treturn useAsync(\n\t\t(): Promise<CKEditorCloudResult<Config>> => loadCKEditorCloud(\n\t\t\ttoValue( config )\n\t\t)\n\t);\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport * as Vue from 'vue';\nimport Ckeditor from './Ckeditor.vue';\nimport CkeditorElement from './CkeditorElement.vue';\nimport CkeditorMultiRoot from './CkeditorMultiRoot.vue';\nimport CkeditorMultiRootEditable from './multiroot/MultiRootEditorEditable.vue';\n\n/* istanbul ignore if -- @preserve */\nif ( !Vue.version || !Vue.version.startsWith( '3.' ) ) {\n\tthrow new Error(\n\t\t'The CKEditor plugin works only with Vue 3+. ' +\n\t\t'For more information, please refer to ' +\n\t\t'https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs-v3.html'\n\t);\n}\n\nconst CkeditorPlugin = {\n\t/**\n\t * Installs the plugin, registering the `<ckeditor>` component.\n\t *\n\t * @param app The application instance.\n\t */\n\tinstall( app: Vue.App ): void {\n\t\tapp.component( 'Ckeditor', Ckeditor );\n\t\tapp.component( 'CkeditorElement', CkeditorElement );\n\t\tapp.component( 'CkeditorMultiRoot', CkeditorMultiRoot );\n\t\tapp.component( 'CkeditorMultiRootEditable', CkeditorMultiRootEditable );\n\t}\n};\n\n/**\n * The component is exported as `Ckeditor` and not `CKEditor`, because of how Vue handles components with\n * capitalized names. The component with more than one consecutive capital letter will also be be available\n * in kebab-case, where each capital letter is separated by `-`. This way, the `CKEditor` component will\n * be available as `c-k-editor`, which doesn't look good.\n */\nexport {\n\tCkeditorPlugin,\n\tCkeditor,\n\tCkeditorElement,\n\tCkeditorMultiRoot,\n\tCkeditorMultiRootEditable\n};\n\nexport type { EditorErrorDescription } from './types.js';\n\nexport {\n\tuseMultiRootEditor,\n\ttype UseMultiRootEditorOptions,\n\ttype UseMultiRootEditorResult\n} from './multiroot/useMultiRootEditor.js';\n\nexport type {\n\tAddRootOptions,\n\tMultiRootEditorData,\n\tMultiRootEditorErrorDescription,\n\tMultiRootEditorLifecycleEvents,\n\tMultiRootEditorRootAttributes,\n\tMultiRootEditorRootsAttributes,\n\tMultiRootEditorVModelEvents,\n\tMultiRootEditorWithWatchdogRelaxedConstructor,\n\tRootEditableOptionsAttribute\n} from './multiroot/types.js';\n\n/**\n * CDN related exports.\n */\n\nexport { default as useCKEditorCloud } from './useCKEditorCloud.js';\n\nexport {\n\tloadCKEditorCloud,\n\ttype CKEditorCloudResult,\n\ttype CKEditorCloudConfig,\n\ttype CdnPluginsPacks\n} from '@ckeditor/ckeditor5-integrations-common';\n\ndeclare module 'vue' {\n\tinterface GlobalComponents {\n\t\tCkeditor: typeof Ckeditor;\n\t\tckeditor: typeof Ckeditor;\n\t\tCkeditorElement: typeof CkeditorElement;\n\t\tCkeditorMultiRoot: typeof CkeditorMultiRoot;\n\t\tCkeditorMultiRootEditable: typeof CkeditorMultiRootEditable;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBA,IAAa,iCAAA,GAAA,wCAAA,iCAAA,CACZ,OACA;EACC,SAAA;EACA,kBAAkB,IAAA;CACnB,CACD;;;;;;;CAQA,SAAgB,8BAA+B,cAA2C;;;;EAIzF,KAAA,GAAA,wCAAA,sBAAA,CAA4B,aAAa,UAAW,GACnD,OAAO;EAGR,QAAA,GAAA,wCAAA,iCAAA,CAAyC,cAAc,CAMtD,6BACD,CAAE;CACH;;;;;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