import{ObservableMixin as C,insertToPriorityArray as ie,CKEditorError as c,EmitterMixin as se,Config as M,Locale as oe,Collection as G,KeystrokeHandler as re,env as k,global as L,uid as T,decodeLicenseKey as F,toArray as ae,crc32 as le,releaseDate as ce,logError as ue,isFeatureBlockedByLicenseKey as de,setDataInElement as B}from"@ckeditor/ckeditor5-utils";import{Model as fe,StylesProcessor as he,DataController as ge,EditingController as me,Conversion as ye}from"@ckeditor/ckeditor5-engine";import{EditorWatchdog as we,ContextWatchdog as pe}from"@ckeditor/ckeditor5-watchdog";/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class be extends C(){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",z,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",z),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function z(t){t.return=!1,t.stop()}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class W extends C(){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",n=>{if(!this.affectsData)return;const i=e.model.document.selection,a=!(i.getFirstPosition().root.rootName=="$graveyard")&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!a)&&(n.return=!1,n.stop())},{priority:"highest"}),this.on("execute",n=>{this.isEnabled||n.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",$,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",$),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function $(t){t.return=!1,t.stop()}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class _e extends W{_childCommandsDefinitions=[];refresh(){}execute(...e){const n=this._getFirstEnabledCommand();return!!n&&n.execute(e)}registerChildCommand(e,n={}){ie(this._childCommandsDefinitions,{command:e,priority:n.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:n})=>n.isEnabled);return e&&e.command}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class H{_commands;constructor(){this._commands=new Map}add(e,n){this._commands.set(e,n)}get(e){return this._commands.get(e)}execute(e,...n){const i=this.get(e);if(!i)throw new c("commandcollection-command-not-found",this,{commandName:e});return i.execute(...n)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Y extends se(){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,n=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const s of n)s.pluginName&&this._availablePlugins.set(s.pluginName,s);this._contextPlugins=new Map;for(const[s,a]of i)this._contextPlugins.set(s,a),this._contextPlugins.set(a,s),s.pluginName&&this._availablePlugins.set(s.pluginName,s)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const n=this._plugins.get(e);if(!n){let i=e;throw typeof e=="function"&&(i=e.pluginName||e.name),new c("plugincollection-plugin-not-loaded",this._context,{plugin:i})}return n}has(e){return this._plugins.has(e)}async init(e,n=[],i=[]){const s=this,a=this._context;p(e),w(e);const f=e.filter(o=>!_(o,n)),d=[...P(f)];x(d,i);const y=g(d);return await A(y,"init"),await A(y,"afterInit"),y;function m(o){return typeof o=="function"}function b(o){return m(o)&&!!o.isContextPlugin}function _(o,l){return l.some(r=>r===o||h(o)===r||h(r)===o)}function h(o){return m(o)?o.pluginName||o.name:o}function p(o,l=new Set){o.forEach(r=>{m(r)&&(l.has(r)||(l.add(r),r.pluginName&&!s._availablePlugins.has(r.pluginName)&&s._availablePlugins.set(r.pluginName,r),r.requires&&p(r.requires,l)))})}function P(o,l=new Set){return o.map(r=>m(r)?r:s._availablePlugins.get(r)).reduce((r,u)=>l.has(u)?r:(l.add(u),u.requires&&(w(u.requires,u),P(u.requires,l).forEach(E=>r.add(E))),r.add(u)),new Set)}function w(o,l=null){o.map(r=>m(r)?r:s._availablePlugins.get(r)||r).forEach(r=>{v(r),D(r,l),N(r,l),I(r,l)})}function v(o){if(typeof o=="function"&&o._throwErrorWhenUsedAsAPlugin)throw new c("plugincollection-plugin-invalid-constructor",a,{name:o.name})}function D(o,l){if(!m(o))throw l?new c("plugincollection-soft-required",a,{missingPlugin:o,requiredBy:h(l)}):new c("plugincollection-plugin-not-found",a,{plugin:o})}function N(o,l){if(b(l)&&!b(o))throw new c("plugincollection-context-required",a,{plugin:h(o),requiredBy:h(l)})}function I(o,l){if(l&&_(o,n))throw new c("plugincollection-required",a,{plugin:h(o),requiredBy:h(l)})}function g(o){return o.map(l=>{let r=s._contextPlugins.get(l);return r=r||new l(a),s._add(l,r),r})}function A(o,l){return o.reduce((r,u)=>!u[l]||s._contextPlugins.has(u)?r:r.then(u[l].bind(u)),Promise.resolve())}function x(o,l){for(const r of l){if(typeof r!="function")throw new c("plugincollection-replace-plugin-invalid-type",null,{pluginItem:r});const u=r.pluginName;if(!u)throw new c("plugincollection-replace-plugin-missing-name",null,{pluginItem:r});if(r.requires&&r.requires.length)throw new c("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:u});const E=s._availablePlugins.get(u);if(!E)throw new c("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:u});const S=o.indexOf(E);if(S===-1){if(s._contextPlugins.has(E))return;throw new c("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:u})}if(E.requires&&E.requires.length)throw new c("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:u});o.splice(S,1,r),s._availablePlugins.set(u,r)}}}destroy(){const e=[];for(const[,n]of this)typeof n.destroy=="function"&&!this._contextPlugins.has(n)&&e.push(n.destroy());return Promise.all(e)}_add(e,n){this._plugins.set(e,n);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new c("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,n)}}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class R{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:n,...i}=e||{};this.config=new M(i,this.constructor.defaultConfig);const s=this.constructor.builtinPlugins;this.config.define("plugins",s),this.plugins=new Y(this,s);const a=this.config.get("language")||{};this.locale=new oe({uiLanguage:typeof a=="string"?a:a.ui,contentLanguage:this.config.get("language.content"),translations:n}),this.t=this.locale.t,this.editors=new G}initPlugins(){const e=this.config.get("plugins")||[],n=this.config.get("substitutePlugins")||[];for(const i of e.concat(n)){if(typeof i!="function")throw new c("context-initplugins-constructor-only",null,{Plugin:i});if(i.isContextPlugin!==!0)throw new c("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],n)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,n){if(this._contextOwner)throw new c("context-addeditor-private-context");this.editors.add(e),n&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const n of this.config.names())["plugins","removePlugins","extraPlugins"].includes(n)||(e[n]=this.config.get(n));return e}static create(e){return new Promise(n=>{const i=new this(e);n(i.initPlugins().then(()=>i))})}static get _throwErrorWhenUsedAsAPlugin(){return!0}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class V extends C(){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class j extends re{editor;constructor(e){super(),this.editor=e}set(e,n,i={}){if(typeof n=="string"){const s=n;n=(a,f)=>{this.editor.execute(s),f()}}super.set(e,n,i)}}function O(t){return t==="__proto__"}function Ee(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function J(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}function X(t){const e=[],n=t.length;if(n===0)return e;let i=0,s="",a="",f=!1;for(t.charCodeAt(0)===46&&(e.push(""),i++);i<n;){const d=t[i];a?d==="\\"&&i+1<n?(i++,s+=t[i]):d===a?a="":s+=d:f?d==='"'||d==="'"?a=d:d==="]"?(f=!1,e.push(s),s=""):s+=d:d==="["?(f=!0,s&&(e.push(s),s="")):d==="."?s&&(e.push(s),s=""):s+=d,i++}return s&&e.push(s),e}function Q(t,e,n){if(t==null)return n;switch(typeof e){case"string":{if(O(e))return n;const i=t[e];return i===void 0?Ee(e)?Q(t,X(e),n):n:i}case"number":case"symbol":{typeof e=="number"&&(e=J(e));const i=t[e];return i===void 0?n:i}default:{if(Array.isArray(e))return ke(t,e,n);if(Object.is(e?.valueOf(),-0)?e="-0":e=String(e),O(e))return n;const i=t[e];return i===void 0?n:i}}}function ke(t,e,n){if(e.length===0)return n;let i=t;for(let s=0;s<e.length;s++){if(i==null||O(e[s]))return n;i=i[e[s]]}return i===void 0?n:i}function Z(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function Pe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}const xe=/^(?:0|[1-9]\d*)$/;function Se(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<e;case"symbol":return!1;case"string":return xe.test(t)}}function Ce(t){return typeof t=="symbol"||t instanceof Symbol}const Oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ve=/^\w*$/;function De(t,e){return Array.isArray(t)?!1:typeof t=="number"||typeof t=="boolean"||t==null||Ce(t)?!0:typeof t=="string"&&(ve.test(t)||!Oe.test(t))||e!=null&&Object.hasOwn(e,t)}const Ne=(t,e,n)=>{const i=t[e];(!(Object.hasOwn(t,e)&&Pe(i,n))||n===void 0&&!(e in t))&&(t[e]=n)};function Ie(t,e,n,i){if(t==null&&!Z(t))return t;const s=De(e,t)?[e]:Array.isArray(e)?e:typeof e=="string"?X(e):[e];let a=t;for(let f=0;f<s.length&&a!=null;f++){const d=J(s[f]);if(O(d))continue;let y;if(f===s.length-1)y=n(a[d]);else{const m=a[d],b=i?.(m,d,t);y=b!==void 0?b:Z(m)?m:Se(s[f+1])?[]:{}}Ne(a,d,y),a=a[d]}return t}function Ae(t,e,n){return Ie(t,e,()=>n,()=>{})}function ee(t){return typeof t=="function"}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const K="contentEditing",U="common";class te{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const n=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:K,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const s=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];n&&s.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:s}]})}addKeystrokeInfoCategory({id:e,label:n,description:i,groups:s}){this.keystrokeInfos.set(e,{id:e,label:n,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:U}),s&&s.forEach(a=>{this.addKeystrokeInfoGroup({categoryId:e,...a})})}addKeystrokeInfoGroup({categoryId:e=K,id:n,label:i,keystrokes:s}){const a=this.keystrokeInfos.get(e);if(!a)throw new c("accessibility-unknown-keystroke-info-category",this._editor,{groupId:n,categoryId:e});a.groups.set(n,{id:n,label:i,keystrokes:s||[]})}addKeystrokeInfos({categoryId:e=K,groupId:n=U,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new c("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const s=this.keystrokeInfos.get(e);if(!s.groups.has(n))throw new c("accessibility-unknown-keystroke-info-group",this._editor,{groupId:n,categoryId:e,keystrokes:i});s.groups.get(n).keystrokes.push(...i)}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function ne(t){return{sessionId:Ue(),pageSessionId:qe(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:Le(t),plugins:Te(t.plugins),distribution:Re(),env:Ke(),integration:Object.create(null),menuBar:{isVisible:!!t.config.get("menuBar.isVisible")},language:{ui:t.locale.uiLanguage,content:t.locale.contentLanguage},toolbar:{main:q(t.config.get("toolbar")),block:q(t.config.get("blockToolbar")),balloon:q(t.config.get("balloonToolbar"))}}}function Le(t){return Object.getPrototypeOf(t).constructor.editorName}function Te(t){return Array.from(t).filter(([e])=>!!e.pluginName).map(([e])=>{const{pluginName:n,isContextPlugin:i,isOfficialPlugin:s,isPremiumPlugin:a}=e;return{isContext:!!i,isOfficial:!!s,isPremium:!!a,name:n}})}function q(t){if(!t)return;const e=Array.isArray(t)?{items:t}:t,n=a(e.items||[]);return{isMultiline:n.includes("-"),shouldNotGroupWhenFull:!!e.shouldNotGroupWhenFull,items:s(n)};function s(f){return f.filter(d=>d!=="|"&&d!=="-")}function a(f){return f.flatMap(d=>typeof d=="string"?[d]:a(d.items))}}function Re(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function Ke(){let t="unknown",e="unknown";return k.isMac?t="mac":k.isWindows?t="windows":k.isiOS?t="ios":k.isAndroid&&(t="android"),k.isGecko?e="gecko":k.isBlink?e="blink":k.isSafari&&(e="safari"),{os:t,browser:e}}function Ue(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",T()),localStorage.getItem("__ckeditor-session-id")}function qe(){return L.window.CKEDITOR_PAGE_SESSION_ID=L.window.CKEDITOR_PAGE_SESSION_ID||T(),L.window.CKEDITOR_PAGE_SESSION_ID}function Me(t,{insertAt:e}={}){if(typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",window.litNonce&&i.setAttribute("nonce",window.litNonce),e==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}Me(":root{--ck-content-font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-content-font-size:medium;--ck-content-font-color:#000;--ck-content-line-height:1.5;--ck-content-word-break:break-word}.ck-content{color:var(--ck-content-font-color);font-family:var(--ck-content-font-family);font-size:var(--ck-content-font-size);line-height:var(--ck-content-line-height);word-break:var(--ck-content-word-break)}");/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ge extends C(){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e={}){if(super(),typeof e!="object"||Array.isArray(e))throw new c("editor-config-invalid-type");if("sanitizeHtml"in e)throw new c("editor-config-sanitizehtml-not-supported");const n=this.constructor,{translations:i,...s}=n.defaultConfig||{},{translations:a=i,...f}=e,d=e.language||s.language;this._context=e.context||new R({language:d,translations:a}),this._context._addEditor(this,!e.context);const y=Array.from(n.builtinPlugins||[]);this.config=new M(f,s),this.config.define("plugins",y),this.config.define(this._context._getEditorConfig()),b(this.config),this.plugins=new Y(this,y,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new H,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new fe(this.config),this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const m=new he;this.data=new ge(this.model,m),this.editing=new me(this.model,m),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new ye([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new j(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new te(this),_(this);function b(h){let p=h.get("licenseKey");if(!p&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(p=window.CKEDITOR_GLOBAL_LICENSE_KEY,h.set("licenseKey",p)),!p)throw new c("license-key-missing")}function _(h){const p=h.config.get("licenseKey"),P=window[Symbol.for("cke distribution")]||"sh";function w(o,l){h.enableReadOnlyMode(Symbol("invalidLicense")),h._showLicenseError(o,l)}function v(o){return["exp","jti","vc"].every(r=>r in o)}function D(o){return Object.getOwnPropertyNames(o).sort().filter(u=>u!="vc"&&o[u]!=null).map(u=>o[u])}function N(o){const{hostname:l}=new URL(window.location.href);if(o.includes(l))return!0;const r=l.split(".");return o.filter(u=>u.includes("*")).map(u=>u.split(".")).filter(u=>u.length<=r.length).map(u=>Array(r.length-u.length).fill(u[0]==="*"?"*":"").concat(u)).some(u=>r.every((E,S)=>u[S]===E||u[S]==="*"))}function I(o){const l=o[0].toUpperCase()+o.slice(1),r=o==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${l} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`\u26A0\uFE0F You are using ${r} ${o} license of CKEditor 5${o==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(p=="GPL"){P=="cloud"&&w("distributionChannel");return}const g=F(p);if(!g){w("invalid");return}if(!v(g)){w("invalid");return}if(g.distributionChannel&&!ae(g.distributionChannel).includes(P)){w("distributionChannel");return}if(le(D(g))!=g.vc.toLowerCase()){w("invalid");return}if(new Date(g.exp*1e3)<ce){w("expired");return}const x=g.licensedHosts;if(x&&x.length>0&&!N(x)){w("domainLimit");return}if(["evaluation","trial"].includes(g.licenseType)&&g.exp*1e3<Date.now()){w("expired");return}if(["development","evaluation","trial"].includes(g.licenseType)){const{licenseType:o}=g;window.CKEDITOR_WARNING_SUPPRESSIONS=window.CKEDITOR_WARNING_SUPPRESSIONS||{},window.CKEDITOR_WARNING_SUPPRESSIONS[o]||(I(o),window.CKEDITOR_WARNING_SUPPRESSIONS[o]=!0)}if(g.licenseType==="evaluation"){const o=setTimeout(()=>{w("evaluationLimit")},6e5);h.on("destroy",()=>{clearTimeout(o)})}g.usageEndpoint&&h.once("ready",()=>{const o={requestId:T(),requestTime:Math.round(Date.now()/1e3),license:p,editor:Fe(h)};h._sendUsageRequest(g.usageEndpoint,o).then(l=>{const{status:r,message:u}=l;u&&console.warn(u),r!="ok"&&w("usageLimit")},()=>{ue("license-key-validation-endpoint-not-reachable",{url:g.usageEndpoint})})},{priority:"high"})}}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new c("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new c("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new c("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,n=e.get("plugins"),i=e.get("removePlugins")||[],s=e.get("extraPlugins")||[],a=e.get("substitutePlugins")||[];return this.plugins.init(n.concat(s),i,a).then(d=>(f(this),d));function f(d){const y=d.config.get("licenseKey");if(y==="GPL")return;const m=F(y);if(!m)return;const b=[...d.plugins].map(([_])=>_).find(_=>!_.pluginName||!_.licenseFeatureCode?!1:de(m,_.licenseFeatureCode));b&&(d.enableReadOnlyMode(Symbol("invalidLicense")),d._showLicenseError("pluginNotAllowed",b.pluginName))}}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(n=>this.once("ready",n))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...n){try{return this.commands.execute(e,...n)}catch(i){/* istanbul ignore next -- @preserve */c.rethrowUnexpectedError(i,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=R;static EditorWatchdog=we;static ContextWatchdog=pe;_showLicenseError(e,n){setTimeout(()=>{if(e=="invalid")throw new c("invalid-license-key");if(e=="expired")throw new c("license-key-expired");if(e=="domainLimit")throw new c("license-key-domain-limit");if(e=="pluginNotAllowed"){const i=n.replace(/(Editing|UI)$/,""),s=this.plugins.has(i);throw new c("license-key-plugin-not-allowed",null,{pluginName:s?i:n})}if(e=="featureNotAllowed")throw new c("license-key-feature-not-allowed",null,{featureName:n});if(e=="evaluationLimit")throw new c("license-key-evaluation-limit");if(e=="trialLimit")throw new c("license-key-trial-limit");if(e=="developmentLimit")throw new c("license-key-development-limit");if(e=="usageLimit")throw new c("license-key-usage-limit");if(e=="distributionChannel")throw new c("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,n){const i=new Headers({"Content-Type":"application/json"}),s=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(n)});if(!s.ok)throw new Error(`HTTP Response: ${s.status}`);return s.json()}}function Fe(t){const e=ne(t);function n(i,s){if(Q(e,i)!==void 0)throw new c("editor-usage-data-path-already-set",{path:i});Ae(e,i,s)}return t.fire("collectUsageData",{setUsageData:n}),e}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function Be(t){if(!ee(t.updateSourceElement))throw new c("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(ze(e)&&e.form){let n;const i=e.form,s=()=>t.updateSourceElement();ee(i.submit)&&(n=i.submit,i.submit=()=>{s(),n.apply(i)}),i.addEventListener("submit",s),t.on("destroy",()=>{i.removeEventListener("submit",s),n&&(i.submit=n)})}}function ze(t){return!!t&&t.tagName.toLowerCase()==="textarea"}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function We(t){class e extends t{sourceElement;updateSourceElement(i){if(!this.sourceElement)throw new c("editor-missing-sourceelement",this);const s=this.config.get("updateSourceElementOnDestroy"),a=this.sourceElement instanceof HTMLTextAreaElement;if(!s&&!a){B(this.sourceElement,"");return}const f=typeof i=="string"?i:this.data.get();B(this.sourceElement,f)}}return e}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function $e(t,e){if(e.ckeditorInstance)throw new c("editor-source-element-already-used",t);e.ckeditorInstance=t,t.once("destroy",()=>{delete e.ckeditorInstance})}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class He extends V{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new G({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new c("pendingactions-add-invalid-message",this);const n=new(C());return n.set("message",e),this._actions.add(n),this.hasAny=!0,n}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}export{te as Accessibility,W as Command,H as CommandCollection,R as Context,V as ContextPlugin,j as EditingKeystrokeHandler,Ge as Editor,We as ElementApiMixin,_e as MultiCommand,He as PendingActions,be as Plugin,U as _DEFAULT_ACCESSIBILITY_GROUP_ID,ne as _getEditorUsageData,Be as attachToForm,$e as secureSourceElement};
