import{Command as k,Plugin as g}from"@ckeditor/ckeditor5-core";import{Delete as Nt}from"@ckeditor/ckeditor5-typing";import{Enter as Ot}from"@ckeditor/ckeditor5-enter";import{toArray as S,first as x,uid as li,env as lt,CKEditorError as ci,FocusTracker as Rt,KeystrokeHandler as Mt,global as ai,getCode as zt,parseKeystroke as Dt,getLocalizedArrowKeyCodeDirection as Ut,createElement as ui}from"@ckeditor/ckeditor5-utils";import{_normalizeFontSizeOptions as $t}from"@ckeditor/ckeditor5-font";import{ClipboardPipeline as di}from"@ckeditor/ckeditor5-clipboard";import{ButtonView as ct,MenuBarMenuListItemButtonView as mi,View as Wt,ViewCollection as fi,FocusCycler as pi,addKeyboardHandlingForGrid as gi,CollapsibleView as bi,LabeledFieldView as hi,createLabeledInputNumber as Ii,SwitchButtonView as ki,createDropdown as yi,SplitButtonView as Ai,MenuBarMenuView as wi,focusChildOnDropdownOpen as Li}from"@ckeditor/ckeditor5-ui";import{IconNumberedList as at,IconBulletedList as ut,IconListStyleDisc as vi,IconListStyleCircle as _i,IconListStyleSquare as Ti,IconListStyleDecimal as Si,IconListStyleDecimalLeadingZero as Ci,IconListStyleLowerRoman as xi,IconListStyleUpperRoman as Ei,IconListStyleLowerLatin as Pi,IconListStyleUpperLatin as Bi,IconTodoList as Fi}from"@ckeditor/ckeditor5-icons";import{DomEventObserver as Vi,Matcher as jt,ModelTreeWalker as qt,getViewFillerOffset as Ni}from"@ckeditor/ckeditor5-engine";/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class A{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward=e.direction=="forward",this._includeSelf=!!e.includeSelf,this._sameAttributes=S(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){const s=new this(t,e)[Symbol.iterator]();return x(s)}*[Symbol.iterator](){const t=[];for(const{node:e}of new E(this._getStartNode(),this._isForward?"forward":"backward")){const i=e.getAttribute("listIndent");if(i<this._referenceIndent){if(!this._lowerIndent)break;this._referenceIndent=i}else if(i>this._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some(s=>e.getAttribute(s)!==this._startElement.getAttribute(s)))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class E{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(t,e="forward"){this._node=t,this._isForward=e==="forward"}[Symbol.iterator](){return this}next(){if(!p(this._node))return{done:!0,value:void 0};const t=this._node.getAttribute("listIndent");let e=null;if(this._previous){const s=this._previousNodeIndent;t>s?this._previousNodesByIndent[s]=this._previous:t<s?(e=this._previousNodesByIndent[t]||null,this._previousNodesByIndent.length=t):e=this._previous}const i={node:this._node,previous:this._previous,previousNodeInList:e};return this._previous=this._node,this._previousNodeIndent=t,this._node=this._isForward?this._node.nextSibling:this._node.previousSibling,{value:i,done:!1}}}class Kt{_listHead;constructor(t){this._listHead=t}[Symbol.iterator](){return new E(this._listHead)}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class P{static next(){return li()}}function p(o){return!!o&&o.is("element")&&o.hasAttribute("listItemId")}function _(o,t={}){return[...T(o,{...t,direction:"backward"}),...T(o,{...t,direction:"forward"})]}function T(o,t={}){const e=t.direction=="forward",i=Array.from(new A(o,{...t,includeSelf:e,sameIndent:!0,sameAttributes:"listItemId"}));return e?i:i.reverse()}function Yt(o){return Array.from(new A(o,{direction:"forward",higherIndent:!0}))}function dt(o,t){const e=new A(o,{sameIndent:!0,sameAttributes:"listType",...t}),i=new A(o,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...t});return[...Array.from(e).reverse(),...i]}function v(o){return!A.first(o,{sameIndent:!0,sameAttributes:"listItemId"})}function mt(o){return!A.first(o,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function B(o,t={}){o=S(o);const e=t.withNested!==!1,i=new Set;for(const s of o)for(const n of _(s,{higherIndent:e}))i.add(n);return C(i)}function z(o){o=S(o);const t=new Set;for(const e of o)for(const i of dt(e))t.add(i);return C(t)}function q(o,t){const e=T(o,{direction:"forward"}),i=P.next();for(const s of e)t.setAttribute("listItemId",i,s);return e}function K(o,t,e){const i={};for(const[n,r]of t.getAttributes())n.startsWith("list")&&(i[n]=r);const s=T(o,{direction:"forward"});for(const n of s)e.setAttributes(i,n);return s}function Y(o,t,{expand:e,indentBy:i=1}={}){o=S(o);const s=e?B(o):o;for(const n of s){const r=n.getAttribute("listIndent")+i;r<0?D(n,t):t.setAttribute("listIndent",r,n)}return s}function Ht(o,t){o=S(o);const e=B(o),i=new Set,s=Math.min(...e.map(r=>r.getAttribute("listIndent"))),n=new Map;for(const r of e)n.set(r,A.first(r,{lowerIndent:!0}));for(const r of e){if(i.has(r))continue;i.add(r);const l=r.getAttribute("listIndent")-1;if(l<0){D(r,t);continue}if(r.getAttribute("listIndent")==s){const c=Oi(r,n.get(r),t);for(const a of c)i.add(a);if(c.length)continue}t.setAttribute("listIndent",l,r)}return C(i)}function D(o,t){o=S(o);for(const e of o)e.is("element","listItem")&&t.rename(e,"paragraph");for(const e of o)for(const i of e.getAttributeKeys())i.startsWith("list")&&t.removeAttribute(i,e);return o}function F(o){if(!o.length)return!1;const t=o[0].getAttribute("listItemId");return t?!o.some(e=>e.getAttribute("listItemId")!=t):!1}function Gt(o,t){const e=[];let i=Number.POSITIVE_INFINITY;for(const{node:s}of new E(o.nextSibling)){const n=s.getAttribute("listIndent");if(n==0)break;n<i&&(i=n);const r=n-i;t.setAttribute("listIndent",r,s),e.push(s)}return e}function C(o){return Array.from(o).filter(t=>t.root.rootName!=="$graveyard").sort((t,e)=>t.index-e.index)}function V(o){const t=o.document.selection.getSelectedElement();return t&&o.schema.isObject(t)&&o.schema.isBlock(t)?t:null}function H(o,t){return t.checkChild(o.parent,"listItem")&&t.checkChild(o,"$text")&&!t.isObject(o)}function U(o){return o=="numbered"||o=="customNumbered"}function Oi(o,t,e){return T(t,{direction:"forward"}).pop().index>o.index?K(o,t,e):[]}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ft extends k{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=Zt(t.document.selection);t.change(i=>{const s=[];F(e)&&!v(e[0])?(this._direction=="forward"&&s.push(...Y(e,i)),s.push(...q(e[0],i))):this._direction=="forward"?s.push(...Y(e,i,{expand:!0})):s.push(...Ht(e,i));for(const n of s){if(!n.hasAttribute("listType"))continue;const r=A.first(n,{sameIndent:!0});r&&i.setAttribute("listType",r.getAttribute("listType"),n)}this._fireAfterExecute(s)})}_fireAfterExecute(t){this.fire("afterExecute",C(new Set(t)))}_checkEnabled(){let t=Zt(this.editor.model.document.selection),e=t[0];if(!e)return!1;if(this._direction=="backward"||F(t)&&!v(t[0]))return!0;t=B(t),e=t[0];const i=A.first(e,{sameIndent:!0});return i?i.getAttribute("listType")==e.getAttribute("listType"):!1}}function Zt(o){const t=Array.from(o.getSelectedBlocks()),e=t.findIndex(i=>!p(i));return e!=-1&&(t.length=e),t}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class N extends k{type;_listWalkerOptions;constructor(t,e,i={}){super(t),this.type=e,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,s=V(e),n=Array.from(i.selection.getSelectedBlocks()).filter(l=>e.schema.checkAttribute(l,"listType")||H(l,e.schema)),r=t.forceValue!==void 0?!t.forceValue:this.value;e.change(l=>{if(r){const c=n[n.length-1],a=T(c,{direction:"forward"}),u=[];a.length>1&&u.push(...q(a[1],l)),u.push(...D(n,l)),u.push(...Gt(c,l)),this._fireAfterExecute(u)}else if((s||i.selection.isCollapsed)&&p(n[0])){const c=dt(s||n[0],this._listWalkerOptions);for(const a of c)l.setAttributes({...t.additionalAttributes,listType:this.type},a);this._fireAfterExecute(c)}else{const c=[];for(const a of n)if(!a.hasAttribute("listType"))!a.is("element","listItem")&&H(a,e.schema)&&l.rename(a,"listItem"),l.setAttributes({...t.additionalAttributes,listIndent:0,listItemId:P.next(),listType:this.type},a),c.push(a);else for(const u of B(a,{withNested:!1}))u.getAttribute("listType")!=this.type&&(l.setAttributes({...t.additionalAttributes,listType:this.type},u),c.push(u));this._fireAfterExecute(c)}})}_fireAfterExecute(t){this.fire("afterExecute",C(new Set(t)))}_getValue(){const t=this.editor.model.document.selection,e=Array.from(t.getSelectedBlocks());if(!e.length)return!1;for(const i of e)if(i.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){const t=this.editor.model,e=t.schema,i=t.document.selection,s=Array.from(i.getSelectedBlocks());if(!s.length)return!1;if(this.value)return!0;for(const n of s)if(e.checkAttribute(n,"listType")||H(n,e))return!0;return!1}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class pt extends k{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:t=!1}={}){const e=this.editor.model,i=e.document.selection,s=[];e.change(n=>{const{firstElement:r,lastElement:l}=this._getMergeSubjectElements(i,t),c=r.getAttribute("listIndent")||0,a=l.getAttribute("listIndent"),u=l.getAttribute("listItemId");if(c!=a){const d=Yt(l);s.push(...Y([l,...d],n,{indentBy:c-a,expand:c<a}))}if(t){let d=i;i.isCollapsed&&(d=n.createSelection(n.createRange(n.createPositionAt(r,"end"),n.createPositionAt(l,0)))),e.deleteContent(d,{doNotResetEntireContent:i.isCollapsed});const m=d.getLastPosition().parent,f=m.nextSibling;s.push(m),f&&f!==l&&f.getAttribute("listItemId")==u&&s.push(...K(f,m,n))}else s.push(...K(l,r,n));this._fireAfterExecute(s)})}_fireAfterExecute(t){this.fire("afterExecute",C(new Set(t)))}_checkEnabled(){const t=this.editor.model,e=t.document.selection,i=V(t);if(e.isCollapsed||i){const s=i||e.getFirstPosition().parent;if(!p(s))return!1;const n=this._direction=="backward"?s.previousSibling:s.nextSibling;if(!n||F([s,n]))return!1}else{const s=e.getLastPosition(),n=e.getFirstPosition();if(s.parent===n.parent||!p(s.parent))return!1}return!0}_getMergeSubjectElements(t,e){const i=this.editor.model,s=V(i);let n,r;if(t.isCollapsed||s){const l=s||t.getFirstPosition().parent,c=v(l);this._direction=="backward"?(r=l,c&&!e?n=A.first(l,{sameIndent:!0,lowerIndent:!0}):n=l.previousSibling):(n=l,r=l.nextSibling)}else n=t.getFirstPosition().parent,r=t.getLastPosition().parent;return{firstElement:n,lastElement:r}}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class gt extends k{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change(e=>{const i=q(this._getStartBlock(),e);this._fireAfterExecute(i)})}_fireAfterExecute(t){this.fire("afterExecute",C(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&p(e)&&!v(e)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?e:e.nextSibling}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Jt extends g{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(I);!t.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(s,n,r,l){n&&(s.addClass("ck-list-marker-bold",r),lt.isSafari&&!(l&&l.dataPipeline)&&s.setStyle("--ck-content-list-marker-dummy-bold","0",r))}}))}afterInit(){const t=this.editor,e=t.model;!t.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.schema.extend("$listItem",{allowAttributes:"listItemBold"}),e.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),e.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemBold"),t.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Qt extends g{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(I);!t.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(s,n,r,l){n&&(s.addClass("ck-list-marker-italic",r),lt.isSafari&&!(l&&l.dataPipeline)&&s.setStyle("--ck-content-list-marker-dummy-italic","0",r))}}))}afterInit(){const t=this.editor,e=t.model;!t.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),e.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),e.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemItalic"),t.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Xt extends g{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(I);if(!t.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;const s=$t(t.config.get("fontSize.options"));e.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(n,r,l,c){if(r){const a=s.find(u=>u.model==r);a&&a.view&&typeof a.view!="string"?a.view.styles?(n.addClass("ck-list-marker-font-size",l),n.setStyle("--ck-content-list-marker-font-size",a.view.styles["font-size"],l)):a.view.classes&&(n.addClass(`ck-list-marker-font-size-${r}`,l),lt.isSafari&&!(c&&c.dataPipeline)&&n.setStyle("--ck-content-list-marker-dummy-font-size","0",l)):(n.addClass("ck-list-marker-font-size",l),n.setStyle("--ck-content-list-marker-font-size",r,l))}}})}afterInit(){const t=this.editor,e=t.model;if(!t.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;e.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),e.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),e.schema.addAttributeCheck(s=>{if(!s.last.getAttribute("listItemId"))return!1},"listItemFontSize"),t.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:s=>s.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});const i=$t(t.config.get("fontSize.options"));for(const s of i)s.model&&s.view&&t.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:s.model},view:{name:"li",classes:`ck-list-marker-font-size-${s.model}`}})}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class te extends g{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(I);!t.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(s,n,r){n&&(s.addClass("ck-list-marker-color",r),s.setStyle("--ck-content-list-marker-color",n,r))}}))}afterInit(){const t=this.editor,e=t.model;!t.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),e.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),e.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontColor"),t.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:i=>i.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ee extends g{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(I);!t.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(s,n,r){n&&(s.addClass("ck-list-marker-font-family",r),s.setStyle("--ck-content-list-marker-font-family",n,r))}}))}afterInit(){const t=this.editor,e=t.model;!t.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),e.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),e.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),t.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:i=>i.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}}function O(o,{insertAt:t}={}){if(!o||typeof document>"u")return;const e=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",window.litNonce&&i.setAttribute("nonce",window.litNonce),t==="top"&&e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i),i.styleSheet?i.styleSheet.cssText=o:i.appendChild(document.createTextNode(o))}O(":root{--ck-content-list-marker-color:var(--ck-content-font-color);--ck-content-list-marker-font-family:var(--ck-content-font-family);--ck-content-list-marker-font-size:var(--ck-content-font-size)}.ck-content li>p:first-of-type{margin-top:0}.ck-content li>p:only-of-type{margin-bottom:0;margin-top:0}.ck-content li.ck-list-marker-bold::marker{font-weight:700}.ck-content li.ck-list-marker-italic::marker{font-style:italic}.ck-content li.ck-list-marker-color::marker{color:var(--ck-content-list-marker-color)}.ck-content li.ck-list-marker-font-family::marker{font-family:var(--ck-content-list-marker-font-family)}.ck-content li.ck-list-marker-font-size::marker{font-size:var(--ck-content-list-marker-font-size)}.ck-content li.ck-list-marker-font-size-tiny::marker{font-size:var(--ck-content-font-size-tiny)}.ck-content li.ck-list-marker-font-size-small::marker{font-size:var(--ck-content-font-size-small)}.ck-content li.ck-list-marker-font-size-big::marker{font-size:var(--ck-content-font-size-big)}.ck-content li.ck-list-marker-font-size-huge::marker{font-size:var(--ck-content-font-size-huge)}");/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ie extends g{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[Jt,Qt,Xt,te,ee]}constructor(t){super(t),t.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){const t=this.editor.model;t.document.registerPostFixer(e=>{const i=t.document.differ.getChanges(),s=new Set;let n=!1;for(const r of i)if(r.type==="attribute")(r.attributeKey=="listItemId"||r.attributeKey=="listType"||this._isInlineOrSelectionFormatting(r.attributeKey)||Object.values(this._loadedFormatting).includes(r.attributeKey))&&(p(r.range.start.nodeAfter)?s.add(r.range.start.nodeAfter):p(r.range.start.parent)&&s.add(r.range.start.parent));else if(p(r.position.nodeAfter)&&s.add(r.position.nodeAfter),p(r.position.nodeBefore)&&s.add(r.position.nodeBefore),p(r.position.parent)&&s.add(r.position.parent),r.type=="insert"&&r.name!="$text"){const l=e.createRangeIn(r.position.nodeAfter);for(const c of l.getItems())p(c)&&s.add(c)}for(const r of s){const l=Ri(t,r,Object.keys(this._loadedFormatting));for(const[c,a]of Object.entries(l)){const u=this._loadedFormatting[c];(a&&Mi(e,r,u,a)||!a&&zi(e,r,u))&&(n=!0)}}return n})}registerFormatAttribute(t,e){this._loadedFormatting[t]=e}_isInlineOrSelectionFormatting(t){return t.replace(/^selection:/,"")in this._loadedFormatting}}function Ri(o,t,e){if(v(t))return se(o,t,e);const i=_(t);return se(o,i[0],e)}function se(o,t,e){if(!Di(t)||o.schema.isLimit(t))return Object.fromEntries(e.map(l=>[l]));if(t.isEmpty)return Object.fromEntries(e.map(l=>[l,t.getAttribute(`selection:${l}`)]));const i=new Set(e),s={},r=o.createRangeIn(t).getWalker({ignoreElementEnd:!0});for(const{item:l}of r){for(const c of i)if(o.schema.checkAttribute(l,c)){const a=l.getAttribute(c);a===void 0?(i.delete(c),s[c]=void 0):s[c]===void 0?s[c]=a:s[c]!==a&&(i.delete(c),s[c]=void 0)}else c in s||(s[c]=void 0);if(!i.size)break;o.schema.isLimit(l)&&r.jumpTo(o.createPositionAfter(l))}return s}function Mi(o,t,e,i){const s=_(t);let n=!1;for(const r of s)(!r.hasAttribute(e)||r.getAttribute(e)!==i)&&(o.setAttribute(e,i,r),n=!0);return n}function zi(o,t,e){const i=_(t);let s=!1;for(const n of i)n.hasAttribute(e)&&(o.removeAttribute(e,n),s=!0);return s}function Di(o){return["numbered","bulleted","customNumbered","customBulleted"].includes(o.getAttribute("listType"))}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ne extends g{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(t){return z(t)}isFirstBlockOfListItem(t){return v(t)}isListItemBlock(t){return p(t)}expandListBlocksToCompleteItems(t,e={}){return B(t,e)}isNumberedListType(t){return U(t)}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function oe(o){return o.is("element","ol")||o.is("element","ul")}function G(o){return o.is("element","li")}function re(o){let t=0,e=o.parent;for(;e;){if(G(e))t++;else{const i=e.previousSibling;i&&G(i)&&t++}e=e.parent}return t}function le(o,t,e,i=ht(e,t)){return o.createAttributeElement(bt(e),null,{priority:2*t/100-100,id:i})}function ce(o,t,e){return o.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:e})}function bt(o){return o=="numbered"||o=="customNumbered"?"ol":"ul"}function ht(o,t){return`list-${o}-${t}`}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function w(o,t,e){const i=o.nodeBefore;if(p(i)){let s=i;for(const{node:n}of new E(s,"backward"))if(s=n,e.has(s)||(e.add(s),t.has(i)))return;t.add(s)}else{const s=o.nodeAfter;p(s)&&t.add(s)}}function ae(o,t){let e=0,i=-1,s=null,n=!1;for(const{node:r}of o){const l=r.getAttribute("listIndent");if(l>e){let c;s===null?(s=l-e,c=e):(s>l&&(s=l),c=l-s),c>i+1&&(c=i+1),t.setAttribute("listIndent",c,r),n=!0,i=c}else s=null,e=l+1,i=l}return n}function ue(o,t,e){const i=new Set;let s=!1;for(const{node:n}of o){if(i.has(n))continue;let r=n.getAttribute("listType"),l=n.getAttribute("listItemId");if(t.has(l)&&(l=P.next()),t.add(l),n.is("element","listItem")){n.getAttribute("listItemId")!=l&&(e.setAttribute("listItemId",l,n),s=!0);continue}for(const c of T(n,{direction:"forward"}))i.add(c),c.getAttribute("listType")!=r&&(l=P.next(),r=c.getAttribute("listType")),c.getAttribute("listItemId")!=l&&(e.setAttribute("listItemId",l,c),s=!0)}return s}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function de(){return(o,t,e)=>{const{writer:i,schema:s}=e;if(!t.modelRange)return;const n=Array.from(t.modelRange.getItems({shallow:!0})).filter(d=>s.checkAttribute(d,"listItemId"));if(!n.length)return;const r=t.viewItem.getAttribute("data-list-item-id")||P.next();e.consumable.consume(t.viewItem,{attributes:"data-list-item-id"});const l=re(t.viewItem);let c=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const a=n[0].getAttribute("listType");a&&(c=a);const u={listItemId:r,listIndent:l,listType:c};for(const d of n)d.hasAttribute("listItemId")||i.setAttributes(u,d);n.length>1&&n[1].getAttribute("listItemId")!=u.listItemId&&e.keepEmptyElement(n[0])}}function me(o,t,e,i){return()=>{const l=o.document.differ.getChanges(),c=[],a=new Set,u=new Set,d=new Set;for(const m of l)if(m.type=="insert"&&m.name!="$text")w(m.position,a,d),m.attributes.has("listItemId")?u.add(m.position.nodeAfter):w(m.position.getShiftedBy(m.length),a,d);else if(m.type=="remove"&&m.attributes.has("listItemId"))w(m.position,a,d);else if(m.type=="attribute"){const f=m.range.start.nodeAfter;e.includes(m.attributeKey)?(w(m.range.start,a,d),m.attributeNewValue===null?(w(m.range.start.getShiftedBy(1),a,d),n(f)&&c.push(f)):u.add(f)):p(f)&&n(f)&&c.push(f)}for(const m of a.values())c.push(...s(m,u));for(const m of new Set(c))t.reconvertItem(m)};function s(l,c){const a=[],u=new Set,d=[];for(const{node:m,previous:f}of new E(l)){if(u.has(m))continue;const b=m.getAttribute("listIndent");f&&b<f.getAttribute("listIndent")&&(d.length=b+1),d[b]={modelAttributes:Object.fromEntries(Array.from(m.getAttributes()).filter(([h])=>e.includes(h))),modelElement:m};const y=T(m,{direction:"forward"});for(const h of y)u.add(h),(n(h,y)||r(h,d,c))&&a.push(h)}return a}function n(l,c){const a=t.mapper.toViewElement(l);if(!a)return!1;if(i.fire("checkElement",{modelElement:l,viewElement:a}))return!0;if(!l.is("element","paragraph")&&!l.is("element","listItem"))return!1;const d=he(l,e,c);return d&&a.is("element","p")?!0:!!(!d&&a.is("element","span"))}function r(l,c,a){if(a.has(l))return!1;const u=t.mapper.toViewElement(l);let d=c.length-1;for(let m=u.parent;!m.is("editableElement");m=m.parent){const f=G(m),b=oe(m);if(!b&&!f)continue;const y=`checkAttributes:${f?"item":"list"}`;if(i.fire(y,{viewElement:m,modelAttributes:c[d].modelAttributes,modelReferenceElement:c[d].modelElement}))break;if(b&&(d--,d<0))return!1}return!0}}function It(o,t,e,{dataPipeline:i}={}){const s=ji(o);return(n,r,l)=>{const{writer:c,mapper:a,consumable:u}=l,d=r.item;if(!o.includes(r.attributeKey)||!s(d,u))return;const m={...l.options,dataPipeline:i},f=pe(d,a,e);be(f,c,a),$i(f,c);const b=Ui(d,f,t,c,m);Wi(d,b,t,c,m)}}function fe(o){return(t,e,i)=>{const{writer:s,mapper:n}=i,r=t.name.split(":")[1];if(!o.checkAttribute(r,"listItemId"))return;const l=n.toViewPosition(e.position),c=e.position.getShiftedBy(e.length),a=n.toViewPosition(c,{isPhantom:!0}),d=s.createRange(l,a).getTrimmed().end.nodeBefore;/* istanbul ignore next -- @preserve */d&&be(d,s,n)}}function kt(o,{dataPipeline:t}={}){return(e,{writer:i})=>{if(!he(e,o))return null;if(!t)return i.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const s=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,s),s}}function pe(o,t,e){const i=e.createRangeOn(o);return t.toViewRange(i).getTrimmed().end.nodeBefore}function ge(o,t){return(e,i)=>{if(i.modelPosition.offset>0)return;const s=i.modelPosition.parent;if(!p(s)||!o.some(a=>a.scope=="itemMarker"&&a.canInjectMarkerIntoElement&&a.canInjectMarkerIntoElement(s)))return;const n=i.mapper.toViewElement(s),r=t.createRangeIn(n),l=r.getWalker();let c=r.start;for(const{item:a}of l){if(a.is("element")&&i.mapper.toModelElement(a)||a.is("$textProxy"))break;a.is("element")&&a.getCustomProperty("listItemMarker")&&(c=t.createPositionAfter(a),l.skip(({previousPosition:u})=>!u.isEqual(c)))}i.viewPosition=c}}function be(o,t,e){for(;o.parent.is("attributeElement")&&o.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(o),o.parent);const i=[];s(t.createPositionBefore(o).getWalker({direction:"backward"})),s(t.createRangeIn(o).getWalker());for(const n of i)t.remove(n);function s(n){for(const{item:r}of n){if(r.is("element")&&e.toModelElement(r))break;r.is("element")&&r.getCustomProperty("listItemMarker")&&i.push(r)}}}function Ui(o,t,e,i,{dataPipeline:s}){let n=i.createRangeOn(t);if(!v(o))return n;for(const r of e){if(r.scope!="itemMarker")continue;const l=r.createElement(i,o,{dataPipeline:s});if(!l||(i.setCustomProperty("listItemMarker",!0,l),r.canInjectMarkerIntoElement&&r.canInjectMarkerIntoElement(o)?i.insert(i.createPositionAt(t,0),l):(i.insert(n.start,l),n=i.createRange(i.createPositionBefore(l),i.createPositionAfter(t))),!r.createWrapperElement||!r.canWrapElement))continue;const c=r.createWrapperElement(i,o,{dataPipeline:s});i.setCustomProperty("listItemWrapper",!0,c),r.canWrapElement(o)?n=i.wrap(n,c):(n=i.wrap(i.createRangeOn(l),c),n=i.createRange(n.start,i.createPositionAfter(t)))}return n}function $i(o,t){let e=o.parent;for(;e.is("attributeElement")&&["ul","ol","li"].includes(e.name);){const i=e.parent;t.unwrap(t.createRangeOn(o),e),e=i}}function Wi(o,t,e,i,s){if(!o.hasAttribute("listIndent"))return;const n=o.getAttribute("listIndent");let r=o;for(let l=n;l>=0;l--){const c=ce(i,l,r.getAttribute("listItemId")),a=le(i,l,r.getAttribute("listType"));for(const u of e)(u.scope=="list"||u.scope=="item")&&r.hasAttribute(u.attributeName)&&u.setAttributeOnDowncast(i,r.getAttribute(u.attributeName),u.scope=="list"?a:c,s);if(t=i.wrap(t,c),t=i.wrap(t,a),l==0||(r=A.first(r,{lowerIndent:!0}),!r))break}}function ji(o){return(t,e)=>{const i=[];for(const s of o)t.hasAttribute(s)&&i.push(`attribute:${s}`);return i.every(s=>e.test(t,s)!==!1)?(i.forEach(s=>e.consume(t,s)),!0):!1}}function he(o,t,e=_(o)){if(!p(o))return!1;for(const i of o.getAttributeKeys())if(!(i.startsWith("selection:")||i=="htmlEmptyBlock")&&!t.includes(i))return!1;return e.length<2}O(".ck-editor__editable .ck-list-bogus-paragraph{display:block}"),O(".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}");/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const Z=["listType","listIndent","listItemId"];class I extends g{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ot,Nt,ne,di,ie]}constructor(t){super(t),t.config.define("list.multiBlock",!0)}init(){const t=this.editor,e=t.model,i=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new ci("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});e.schema.register("$listItem",{allowAttributes:Z}),i?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const s of Z)e.schema.setAttributeProperties(s,{copyOnReplace:!0});t.commands.add("numberedList",new N(t,"numbered")),t.commands.add("bulletedList",new N(t,"bulleted")),t.commands.add("customNumberedList",new N(t,"customNumbered",{multiLevel:!0})),t.commands.add("customBulletedList",new N(t,"customBulleted",{multiLevel:!0})),t.commands.add("indentList",new ft(t,"forward")),t.commands.add("outdentList",new ft(t,"backward")),t.commands.add("splitListItemBefore",new gt(t,"before")),t.commands.add("splitListItemAfter",new gt(t,"after")),i&&(t.commands.add("mergeListItemBackward",new pt(t,"backward")),t.commands.add("mergeListItemForward",new pt(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){const e=this.editor.commands,i=e.get("indent"),s=e.get("outdent");i&&i.registerChildCommand(e.get("indentList"),{priority:"high"}),s&&s.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...Z,...this._downcastStrategies.map(t=>t.attributeName)]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),i=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",(s,n)=>{const r=t.model.document.selection;V(t.model)||t.model.change(()=>{const l=r.getFirstPosition();if(r.isCollapsed&&n.direction=="backward"){if(!l.isAtStart)return;const c=l.parent;if(!p(c))return;if(!A.first(c,{sameAttributes:"listType",sameIndent:!0})&&c.getAttribute("listIndent")===0)mt(c)||t.execute("splitListItemAfter"),t.execute("outdentList");else{if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:Ie(t.model,"backward")})}n.preventDefault(),s.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd||!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:Ie(t.model,"forward")}),n.preventDefault(),s.stop()}})},{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,i=t.commands,s=i.get("enter");this.listenTo(t.editing.view.document,"enter",(n,r)=>{const l=e.document,c=l.selection.getFirstPosition().parent;if(l.selection.isCollapsed&&p(c)&&c.isEmpty&&!r.isSoft){const a=v(c),u=mt(c);a&&u?(t.execute("outdentList"),r.preventDefault(),n.stop()):a&&!u?(t.execute("splitListItemAfter"),r.preventDefault(),n.stop()):u&&(t.execute("splitListItemBefore"),r.preventDefault(),n.stop())}},{context:"li"}),this.listenTo(s,"afterExecute",()=>{const n=i.get("splitListItemBefore");if(n.refresh(),!n.isEnabled)return;const l=t.model.document.selection.getLastPosition().parent;_(l).length===2&&n.execute()})}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",(e,i)=>{const s=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(s).isEnabled&&(t.execute(s),i.stopPropagation(),i.preventDefault(),e.stop())},{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,i=this.getListAttributeNames(),s=t.config.get("list.multiBlock"),n=s?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(l,{writer:c})=>c.createElement(n,{listType:""})}).elementToElement({view:"p",model:(l,{writer:c})=>l.parent&&l.parent.is("element","li")?c.createElement(n,{listType:""}):null,converterPriority:"high"}).add(l=>{l.on("element:li",de())}),s||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:n,view:kt(i),converterPriority:"high"}).add(l=>{l.on("attribute",It(i,this._downcastStrategies,e)),l.on("remove",fe(e.schema))}),t.conversion.for("dataDowncast").elementToElement({model:n,view:kt(i,{dataPipeline:!0}),converterPriority:"high"}).add(l=>{l.on("attribute",It(i,this._downcastStrategies,e,{dataPipeline:!0}))});const r=ge(this._downcastStrategies,t.editing.view);t.editing.mapper.on("modelToViewPosition",r),t.data.mapper.on("modelToViewPosition",r),this.listenTo(e.document,"change:data",me(e,t.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",(l,{viewElement:c,modelAttributes:a})=>{c.id!=a.listItemId&&(l.return=!0,l.stop())}),this.on("checkAttributes:list",(l,{viewElement:c,modelAttributes:a})=>{(c.name!=bt(a.listType)||c.id!=ht(a.listType,a.listIndent))&&(l.return=!0,l.stop())})}_setupModelPostFixing(){const t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer(i=>qi(t,i,e,this)),this.on("postFixer",(i,{listNodes:s,writer:n})=>{i.return=ae(s,n)||i.return},{priority:"high"}),this.on("postFixer",(i,{listNodes:s,writer:n,seenIds:r})=>{i.return=ue(s,r,n)||i.return},{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",Ki(t),{priority:"high"}),this.listenTo(e,"outputTransformation",(i,s)=>{t.change(n=>{const r=Array.from(s.content.getChildren()),l=r[r.length-1];if(r.length>1&&l.is("element")&&l.isEmpty&&r.slice(0,-1).every(p)&&n.remove(l),s.method=="copy"||s.method=="cut"){const c=Array.from(s.content.getChildren());F(c)&&D(c,n)}})})}_setupAccessibilityIntegration(){const t=this.editor,e=t.t;t.accessibility.addKeystrokeInfoGroup({id:"list",label:e("Keystrokes that can be used in a list"),keystrokes:[{label:e("Increase list item indent"),keystroke:"Tab"},{label:e("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(t,e,i,s){s&&(s.skipListItemIds||s.isClipboardPipeline)||t.setAttribute("data-list-item-id",e,i)}})}}function qi(o,t,e,i){const s=o.document.differ.getChanges(),n=new Set,r=new Set,l=i.editor.config.get("list.multiBlock");let c=!1;for(const u of s){if(u.type=="insert"&&u.name!="$text"){const d=u.position.nodeAfter;if(!o.schema.checkAttribute(d,"listItemId"))for(const m of Array.from(d.getAttributeKeys()))e.includes(m)&&(t.removeAttribute(m,d),c=!0);w(u.position,r,n),u.attributes.has("listItemId")||w(u.position.getShiftedBy(u.length),r,n);for(const{item:m,previousPosition:f}of o.createRangeIn(d))p(m)&&w(f,r,n)}else u.type=="remove"?w(u.position,r,n):u.type=="attribute"&&e.includes(u.attributeKey)&&(w(u.range.start,r,n),u.attributeNewValue===null&&w(u.range.start.getShiftedBy(1),r,n));if(!l&&u.type=="attribute"&&Z.includes(u.attributeKey)){const d=u.range.start.nodeAfter;u.attributeNewValue===null&&d&&d.is("element","listItem")?(t.rename(d,"paragraph"),c=!0):u.attributeOldValue===null&&d&&d.is("element")&&d.name!="listItem"&&(t.rename(d,"listItem"),c=!0)}}const a=new Set;for(const u of r.values())c=i.fire("postFixer",{listNodes:new Kt(u),listHead:u,writer:t,seenIds:a})||c;return c}function Ki(o){return(t,[e,i])=>{const s=e.is("documentFragment")?Array.from(e.getChildren()):[e];if(!s.length)return;const r=(i?o.createSelection(i):o.document.selection).getFirstPosition();let l;if(p(r.parent))l=r.parent;else if(p(r.nodeBefore)&&p(r.nodeAfter))l=r.nodeBefore;else return;o.change(c=>{const a=l.getAttribute("listType"),u=l.getAttribute("listIndent"),d=s[0].getAttribute("listIndent")||0,m=Math.max(u-d,0);for(const f of s){const b=p(f);l.is("element","listItem")&&f.is("element","paragraph")&&c.rename(f,"listItem"),c.setAttributes({listIndent:(b?f.getAttribute("listIndent"):0)+m,listItemId:b?f.getAttribute("listItemId"):P.next(),listType:a},f)}})}}function Ie(o,t){const e=o.document.selection;if(!e.isCollapsed)return!V(o);if(t==="forward")return!0;const s=e.getFirstPosition().parent,n=s.previousSibling;return o.schema.isObject(n)?!1:n.isEmpty?!0:F([s,n])}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function J(o,t,e,i){o.ui.componentFactory.add(t,()=>{const s=ke(ct,o,t,e,i);return s.set({tooltip:!0,isToggleable:!0}),s}),o.ui.componentFactory.add(`menuBar:${t}`,()=>{const s=ke(mi,o,t,e,i);return s.set({role:"menuitemcheckbox",isToggleable:!0}),s})}function ke(o,t,e,i,s){const n=t.commands.get(e),r=new o(t.locale);return r.set({label:i,icon:s}),r.bind("isOn","isEnabled").to(n,"value","isEnabled"),r.on("execute",()=>{t.execute(e),t.editing.view.focus()}),r}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class yt extends g{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||J(this.editor,"numberedList",t("Numbered List"),at),this.editor.ui.componentFactory.has("bulletedList")||J(this.editor,"bulletedList",t("Bulleted List"),ut)}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Yi extends g{static get requires(){return[I,yt]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ye extends k{refresh(){const t=this._getValue();this.value=t,this.isEnabled=t!=null}execute({startIndex:t=1}={}){const e=this.editor.model,i=e.document;let s=Array.from(i.selection.getSelectedBlocks()).filter(n=>p(n)&&U(n.getAttribute("listType")));s=z(s),e.change(n=>{for(const r of s)n.setAttribute("listStart",t>=0?t:1,r)})}_getValue(){const e=this.editor.model.document,i=x(e.selection.getSelectedBlocks());return i&&p(i)&&U(i.getAttribute("listType"))?i.getAttribute("listStart"):null}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const Ae={},we={},Le={},ve=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:o,typeAttribute:t,listType:e}of ve)Ae[o]=e,we[o]=t,t&&(Le[t]=o);function At(){return ve.map(o=>o.listStyle)}function Q(o){return Ae[o]||null}function wt(o){return Le[o]||null}function X(o){return we[o]||null}function Lt(o){switch(o){case"lower-alpha":return"lower-latin";case"upper-alpha":return"upper-latin";default:return o}}/**
* @license Copyright (c) 2003-2025, 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 k{defaultType;_supportedTypes;constructor(t,e,i){super(t),this.defaultType=e,this._supportedTypes=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document;e.change(s=>{this._tryToConvertItemsToList(t);let n=Array.from(i.selection.getSelectedBlocks()).filter(r=>r.hasAttribute("listType"));if(n.length){n=z(n);for(const r of n)s.setAttribute("listStyle",t.type||this.defaultType,r)}})}isStyleTypeSupported(t){return this._supportedTypes?this._supportedTypes.includes(t):!0}_getValue(){const t=x(this.editor.model.document.selection.getSelectedBlocks());return p(t)?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=Q(t.type);if(!e)return;const i=this.editor,s=`${e}List`;i.commands.get(s).value||i.execute(s)}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Te extends k{refresh(){const t=this._getValue();this.value=t,this.isEnabled=t!=null}execute(t={}){const e=this.editor.model,i=e.document;let s=Array.from(i.selection.getSelectedBlocks()).filter(n=>p(n)&&n.getAttribute("listType")=="numbered");s=z(s),e.change(n=>{for(const r of s)n.setAttribute("listReversed",!!t.reversed,r)})}_getValue(){const e=this.editor.model.document,i=x(e.selection.getSelectedBlocks());return p(i)&&i.getAttribute("listType")=="numbered"?i.getAttribute("listReversed"):null}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function vt(o){return(t,e,i)=>{const{writer:s,schema:n,consumable:r}=i;if(r.test(e.viewItem,o.viewConsumables)===!1)return;e.modelRange||Object.assign(e,i.convertChildren(e.viewItem,e.modelCursor));let l=!1;for(const c of e.modelRange.getItems({shallow:!0}))n.checkAttribute(c,o.attributeName)&&o.appliesToListItem(c)&&(c.hasAttribute(o.attributeName)||(s.setAttribute(o.attributeName,o.getAttributeOnUpcast(e.viewItem),c),l=!0));l&&r.consume(e.viewItem,o.viewConsumables)}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Se extends g{static get pluginName(){return"ListPropertiesUtils"}static get isOfficialPlugin(){return!0}getAllSupportedStyleTypes(){return At()}getListTypeFromListStyleType(t){return Q(t)}getListStyleTypeFromTypeAttribute(t){return wt(t)}getTypeAttributeFromListStyleType(t){return X(t)}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function _t(o){const{startIndex:t,reversed:e,styles:i}=o;return{styles:Hi(i),startIndex:t||!1,reversed:e||!1}}function Hi(o){const t={listTypes:["bulleted","numbered"],useAttribute:!1};return o===!0||(o?Array.isArray(o)||typeof o=="string"?t.listTypes=S(o):(t.listTypes=o.listTypes?S(o.listTypes):t.listTypes,t.useAttribute=!!o.useAttribute,o.listStyleTypes&&(t.listStyleTypes=o.listStyleTypes)):t.listTypes=[]),t}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const $="default";class Ce extends g{static get requires(){return[I,Se]}static get pluginName(){return"ListPropertiesEditing"}static get licenseFeatureCode(){return"LP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(t){super(t),t.config.define("list.properties",{styles:!0,startIndex:!1,reversed:!1})}init(){const t=this.editor,e=t.model,i=t.plugins.get(I),s=t.config.get("list.properties"),n=Gi(s);for(const r of n)r.addCommand(t),e.schema.extend("$listItem",{allowAttributes:r.attributeName}),i.registerDowncastStrategy({scope:"list",attributeName:r.attributeName,setAttributeOnDowncast(l,c,a){r.setAttributeOnDowncast(l,c,a)}});t.conversion.for("upcast").add(r=>{for(const l of n)r.on("element:ol",vt(l)),r.on("element:ul",vt(l))}),i.on("checkAttributes:list",(r,{viewElement:l,modelAttributes:c,modelReferenceElement:a})=>{for(const u of n)u.appliesToListItem(a)&&u.getAttributeOnUpcast(l)!=c[u.attributeName]&&(r.return=!0,r.stop())}),this.listenTo(t.commands.get("indentList"),"afterExecute",(r,l)=>{e.change(c=>{for(const a of l)for(const u of n)u.appliesToListItem(a)&&c.setAttribute(u.attributeName,u.defaultValue,a)})}),i.on("postFixer",(r,{listNodes:l,writer:c})=>{for(const{node:a}of l)for(const u of n)u.hasValidAttribute(a)||(u.appliesToListItem(a)?c.setAttribute(u.attributeName,u.defaultValue,a):c.removeAttribute(u.attributeName,a),r.return=!0)}),i.on("postFixer",(r,{listNodes:l,writer:c})=>{for(const{node:a,previousNodeInList:u}of l)if(u&&u.getAttribute("listType")==a.getAttribute("listType"))for(const d of n){const{attributeName:m}=d;if(!d.appliesToListItem(a))continue;const f=u.getAttribute(m);a.getAttribute(m)!=f&&(c.setAttribute(m,f,a),r.return=!0)}})}}function Gi(o){const t=[],e=_t(o);if(o.styles){const i=e.styles.useAttribute;t.push({attributeName:"listStyle",defaultValue:$,viewConsumables:{styles:"list-style-type"},addCommand(s){let n=At();i&&(n=n.filter(r=>!!X(r))),s.commands.add("listStyle",new _e(s,$,n))},appliesToListItem(s){return s.getAttribute("listType")=="numbered"||s.getAttribute("listType")=="bulleted"},hasValidAttribute(s){if(!this.appliesToListItem(s))return!s.hasAttribute("listStyle");if(!s.hasAttribute("listStyle"))return!1;const n=s.getAttribute("listStyle");return n==$?!0:Q(n)==s.getAttribute("listType")},setAttributeOnDowncast(s,n,r){if(n&&n!==$)if(i){const l=X(n);if(l){s.setAttribute("type",l,r);return}}else{s.setStyle("list-style-type",n,r);return}s.removeStyle("list-style-type",r),s.removeAttribute("type",r)},getAttributeOnUpcast(s){const n=s.getStyle("list-style-type");if(n)return Lt(n);const r=s.getAttribute("type");return r?wt(r):$}})}return o.reversed&&t.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(i){i.commands.add("listReversed",new Te(i))},appliesToListItem(i){return i.getAttribute("listType")=="numbered"},hasValidAttribute(i){return this.appliesToListItem(i)==i.hasAttribute("listReversed")},setAttributeOnDowncast(i,s,n){s?i.setAttribute("reversed","reversed",n):i.removeAttribute("reversed",n)},getAttributeOnUpcast(i){return i.hasAttribute("reversed")}}),o.startIndex&&t.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(i){i.commands.add("listStart",new ye(i))},appliesToListItem(i){return U(i.getAttribute("listType"))},hasValidAttribute(i){return this.appliesToListItem(i)==i.hasAttribute("listStart")},setAttributeOnDowncast(i,s,n){s==0||s>1?i.setAttribute("start",s,n):i.removeAttribute("start",n)},getAttributeOnUpcast(i){const s=i.getAttribute("start");return s>=0?s:1}}),t}O(".ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}");/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Tt extends Wt{children;stylesView=null;additionalPropertiesCollapsibleView=null;startIndexFieldView=null;reversedSwitchButtonView=null;focusTracker=new Rt;keystrokes=new Mt;focusables=new fi;focusCycler;constructor(t,{enabledProperties:e,styleButtonViews:i,styleGridAriaLabel:s}){super(t);const n=["ck","ck-list-properties"];this.children=this.createCollection(),this.focusCycler=new pi({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),i&&i.length?(this.stylesView=this._createStylesView(i,s),this.children.add(this.stylesView)):n.push("ck-list-properties_without-styles"),(e.startIndex||e.reversed)&&(this._addNumberedListPropertyViews(e),n.push("ck-list-properties_with-numbered-properties")),this.setTemplate({tag:"div",attributes:{class:n},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element),(this.startIndexFieldView||this.reversedSwitchButtonView)&&(this.focusables.add(this.children.last.buttonView),this.focusTracker.add(this.children.last.buttonView.element));for(const t of this.stylesView.children)this.stylesView.focusTracker.add(t.element);gi({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>ai.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView),this.focusTracker.add(this.startIndexFieldView.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}this.reversedSwitchButtonView&&(this.focusables.add(this.reversedSwitchButtonView),this.focusTracker.add(this.reversedSwitchButtonView.element)),this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createStylesView(t,e){const i=new Wt(this.locale);return i.children=i.createCollection(),i.children.addMany(t),i.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-list-styles-list"]},children:i.children}),i.children.delegate("execute").to(this),i.focus=function(){for(const s of this.children)if(s instanceof ct&&s.isOn){s.focus();return}this.children.first.focus()},i.focusTracker=new Rt,i.keystrokes=new Mt,i.render(),i.keystrokes.listenTo(i.element),i}_addNumberedListPropertyViews(t){const e=this.locale.t,i=[];t.startIndex&&(this.startIndexFieldView=this._createStartIndexField(),i.push(this.startIndexFieldView)),t.reversed&&(this.reversedSwitchButtonView=this._createReversedSwitchButton(),i.push(this.reversedSwitchButtonView)),this.stylesView?(this.additionalPropertiesCollapsibleView=new bi(this.locale,i),this.additionalPropertiesCollapsibleView.set({label:e("List properties"),isCollapsed:!0}),this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(i,"isEnabled",(...s)=>s.some(n=>n)),this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",(s,n,r)=>{r||(this.additionalPropertiesCollapsibleView.isCollapsed=!0)}),this.children.add(this.additionalPropertiesCollapsibleView)):this.children.addMany(i)}_createStartIndexField(){const t=this.locale.t,e=new hi(this.locale,Ii);return e.set({label:t("Start at"),class:"ck-numbered-list-properties__start-index"}),e.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"}),e.fieldView.on("input",()=>{const i=e.fieldView.element,s=i.valueAsNumber;if(Number.isNaN(s)){e.errorText=t("Invalid start index value.");return}i.checkValidity()?this.fire("listStart",{startIndex:s}):e.errorText=t("Start index must be greater than 0.")}),e}_createReversedSwitchButton(){const t=this.locale.t,e=new ki(this.locale);return e.set({withText:!0,label:t("Reversed order"),class:"ck-numbered-list-properties__reversed-order"}),e.delegate("execute").to(this,"listReversed"),e}}O(".ck.ck-list-styles-list{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}");/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class St extends g{static get pluginName(){return"ListPropertiesUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=t.config.get("list.properties"),s=_t(i),n=s.styles.listTypes;if(n.includes("bulleted")){const r=[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:vi},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:_i},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:Ti}],l=e("Bulleted List"),c=e("Bulleted list styles toolbar"),a="bulletedList";t.ui.componentFactory.add(a,xe({editor:t,normalizedConfig:s,parentCommandName:a,buttonLabel:l,buttonIcon:ut,styleGridAriaLabel:c,styleDefinitions:r})),t.ui.componentFactory.add(`menuBar:${a}`,Pe({editor:t,normalizedConfig:s,parentCommandName:a,buttonLabel:l,styleGridAriaLabel:c,styleDefinitions:r}))}if(n.includes("numbered")||i.startIndex||i.reversed){const r=[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:Si},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:Ci},{label:e("Toggle the lower\u2013roman list style"),tooltip:e("Lower\u2013roman"),type:"lower-roman",icon:xi},{label:e("Toggle the upper\u2013roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:Ei},{label:e("Toggle the lower\u2013latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:Pi},{label:e("Toggle the upper\u2013latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:Bi}],l=e("Numbered List"),c=e("Numbered list styles toolbar"),a="numberedList";t.ui.componentFactory.add(a,xe({editor:t,normalizedConfig:s,parentCommandName:a,buttonLabel:l,buttonIcon:at,styleGridAriaLabel:c,styleDefinitions:r})),n.includes("numbered")&&t.ui.componentFactory.add(`menuBar:${a}`,Pe({editor:t,normalizedConfig:s,parentCommandName:a,buttonLabel:l,styleGridAriaLabel:c,styleDefinitions:r}))}}}function xe({editor:o,normalizedConfig:t,parentCommandName:e,buttonLabel:i,buttonIcon:s,styleGridAriaLabel:n,styleDefinitions:r}){const l=o.commands.get(e);return c=>{const a=yi(c,Ai),u=a.buttonView;return a.bind("isEnabled").to(l),a.class="ck-list-styles-dropdown",u.on("execute",()=>{o.execute(e),o.editing.view.focus()}),u.set({label:i,icon:s,tooltip:!0,isToggleable:!0}),u.bind("isOn").to(l,"value",d=>!!d),a.once("change:isOpen",()=>{const d=Zi({editor:o,normalizedConfig:t,dropdownView:a,parentCommandName:e,styleGridAriaLabel:n,styleDefinitions:r});a.panelView.children.add(d)}),a.on("execute",()=>{o.editing.view.focus()}),a}}function Ee({editor:o,listStyleCommand:t,parentCommandName:e}){const i=o.locale,s=o.commands.get(e);return({label:n,type:r,icon:l,tooltip:c})=>{const a=new ct(i);return a.set({label:n,icon:l,tooltip:c}),a.bind("isOn").to(t,"value",u=>u===r),a.on("execute",()=>{s.value?t.value===r?o.execute(e):t.value!==r&&o.execute("listStyle",{type:r}):o.model.change(()=>{o.execute("listStyle",{type:r})})}),a}}function Zi({editor:o,normalizedConfig:t,dropdownView:e,parentCommandName:i,styleDefinitions:s,styleGridAriaLabel:n}){const r=o.locale,l={...t,...i!="numberedList"?{startIndex:!1,reversed:!1}:null},c=i.replace("List","");let a=null;if(t.styles.listTypes.includes(c)){const d=o.commands.get("listStyle"),m=Ee({editor:o,parentCommandName:i,listStyleCommand:d}),f=t.styles.listStyleTypes;let b=s;if(f){const h=f[c];h&&(b=s.filter(j=>h.includes(j.type)))}const y=Be(d);a=b.filter(y).map(m)}const u=new Tt(r,{styleGridAriaLabel:n,enabledProperties:l,styleButtonViews:a});if(t.styles.listTypes.includes(c)&&Li(e,()=>u.stylesView.children.find(d=>d.isOn)),l.startIndex){const d=o.commands.get("listStart");u.startIndexFieldView.bind("isEnabled").to(d),u.startIndexFieldView.fieldView.bind("value").to(d),u.on("listStart",(m,f)=>o.execute("listStart",f))}if(l.reversed){const d=o.commands.get("listReversed");u.reversedSwitchButtonView.bind("isEnabled").to(d),u.reversedSwitchButtonView.bind("isOn").to(d,"value",m=>!!m),u.on("listReversed",()=>{const m=d.value;o.execute("listReversed",{reversed:!m})})}return u.delegate("execute").to(e),u}function Pe({editor:o,normalizedConfig:t,parentCommandName:e,buttonLabel:i,styleGridAriaLabel:s,styleDefinitions:n}){return r=>{const l=new wi(r),c=o.commands.get(e),a=o.commands.get("listStyle"),u=Be(a),d=Ee({editor:o,parentCommandName:e,listStyleCommand:a}),m=t.styles.listStyleTypes;let f=n;if(m){const h=c.type,j=m[h];j&&(f=n.filter(ri=>j.includes(ri.type)))}const b=f.filter(u).map(d),y=new Tt(r,{styleGridAriaLabel:s,enabledProperties:{...t,startIndex:!1,reversed:!1},styleButtonViews:b});return y.delegate("execute").to(l),l.buttonView.set({label:i,icon:e==="bulletedList"?ut:at}),l.panelView.children.add(y),l.bind("isEnabled").to(c,"isEnabled"),l.on("execute",()=>{o.editing.view.focus()}),l}}function Be(o){return typeof o.isStyleTypeSupported=="function"?t=>o.isStyleTypeSupported(t.type):()=>!0}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ji extends g{static get requires(){return[Ce,St]}static get pluginName(){return"ListProperties"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Fe extends k{constructor(t){super(t),this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){const t=this._getSelectedItems();this.value=this._getValue(t),this.isEnabled=!!t.length}execute(t={}){this.editor.model.change(e=>{const i=this._getSelectedItems(),s=t.forceValue===void 0?!this._getValue(i):t.forceValue;for(const n of i)s?e.setAttribute("todoListChecked",!0,n):e.removeAttribute("todoListChecked",n)})}_getValue(t){return t.every(e=>e.getAttribute("todoListChecked"))}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),s=i.start.parent,n=[];e.checkAttribute(s,"todoListChecked")&&n.push(..._(s));for(const r of i.getItems({shallow:!0}))e.checkAttribute(r,"todoListChecked")&&!n.includes(r)&&n.push(..._(r));return n}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ve extends Vi{domEventType=["change"];onDomEvent(t){if(t.target){const e=this.view.domConverter.mapDomToView(t.target);e&&e.is("element","input")&&e.getAttribute("type")=="checkbox"&&e.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",t)}}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const Qi=Dt("Ctrl+Enter");class Ne extends g{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}init(){const t=this.editor,e=t.model,i=t.editing,s=t.plugins.get(I),r=t.config.get("list.multiBlock")?"paragraph":"listItem";t.commands.add("todoList",new N(t,"todo")),t.commands.add("checkTodoList",new Fe(t)),i.view.addObserver(Ve),e.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),e.schema.addAttributeCheck(l=>{const c=l.last;if(!c.getAttribute("listItemId")||c.getAttribute("listType")!="todo")return!1},"todoListChecked"),t.conversion.for("upcast").add(l=>{l.on("element:input",ts()),l.on("element:li",Xi(),{priority:"low"}),l.on("element:label",Ct({name:"label",classes:"todo-list__label"})),l.on("element:label",Ct({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),l.on("element:span",Ct({name:"span",classes:"todo-list__label__description"})),l.on("element:ul",es({name:"ul",classes:"todo-list"}))}),t.conversion.for("downcast").elementToElement({model:r,view:(l,{writer:c})=>{if(tt(l,s.getListAttributeNames()))return c.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),s.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(l,c,a){c=="todo"?l.addClass("todo-list",a):l.removeClass("todo-list",a)}}),s.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(l,c,{dataPipeline:a}){if(c.getAttribute("listType")!="todo")return null;const u=l.createUIElement("input",{type:"checkbox",...c.getAttribute("todoListChecked")?{checked:"checked"}:null,...a?{disabled:"disabled"}:{tabindex:"-1"}});if(a)return u;const d=l.createContainerElement("span",{contenteditable:"false"},u);return d.getFillerOffset=()=>null,d},canWrapElement(l){return tt(l,s.getListAttributeNames())},createWrapperElement(l,c,{dataPipeline:a}){const u=["todo-list__label"];return tt(c,s.getListAttributeNames())||u.push("todo-list__label_without-description"),l.createAttributeElement(a?"label":"span",{class:u.join(" ")})}}),s.on("checkElement",(l,{modelElement:c,viewElement:a})=>{const u=tt(c,s.getListAttributeNames());a.hasClass("todo-list__label__description")!=u&&(l.return=!0,l.stop())}),s.on("checkElement",(l,{modelElement:c,viewElement:a})=>{const u=c.getAttribute("listType")=="todo"&&v(c);let d=!1;const m=t.editing.view.createPositionBefore(a).getWalker({direction:"backward"});for(const{item:f}of m){if(f.is("element")&&t.editing.mapper.toModelElement(f))break;f.is("element","input")&&f.getAttribute("type")=="checkbox"&&(d=!0)}d!=u&&(l.return=!0,l.stop())}),s.on("postFixer",(l,{listNodes:c,writer:a})=>{for(const{node:u,previousNodeInList:d}of c){if(!d||d.getAttribute("listItemId")!=u.getAttribute("listItemId"))continue;const m=d.hasAttribute("todoListChecked"),f=u.hasAttribute("todoListChecked");f&&!m?(a.removeAttribute("todoListChecked",u),l.return=!0):!f&&m&&(a.setAttribute("todoListChecked",!0,u),l.return=!0)}}),e.document.registerPostFixer(l=>{const c=e.document.differ.getChanges();let a=!1;for(const u of c)if(u.type=="attribute"&&u.attributeKey=="listType"){const d=u.range.start.nodeAfter;u.attributeOldValue=="todo"&&d.hasAttribute("todoListChecked")&&(l.removeAttribute("todoListChecked",d),a=!0)}else if(u.type=="insert"&&u.name!="$text")for(const{item:d}of l.createRangeOn(u.position.nodeAfter))d.is("element")&&d.getAttribute("listType")!="todo"&&d.hasAttribute("todoListChecked")&&(l.removeAttribute("todoListChecked",d),a=!0);return a}),this.listenTo(i.view.document,"keydown",(l,c)=>{zt(c)===Qi&&(t.execute("checkTodoList"),l.stop())},{priority:"high"}),this.listenTo(i.view.document,"todoCheckboxChange",(l,c)=>{const a=c.target;if(!a||!a.is("element","input"))return;const u=i.view.createPositionAfter(a),m=i.mapper.toModelPosition(u).parent;m&&p(m)&&m.getAttribute("listType")=="todo"&&this._handleCheckmarkChange(m)}),this.listenTo(i.view.document,"arrowKey",ss(e,t.locale),{context:"$text"}),this.listenTo(i.mapper,"viewToModelPosition",(l,c)=>{const a=c.viewPosition.parent,u=a.is("attributeElement","li")&&c.viewPosition.offset==0,d=Oe(a)&&c.viewPosition.offset<=1,m=a.is("element","span")&&a.getAttribute("contenteditable")=="false"&&Oe(a.parent);if(!u&&!d&&!m)return;const f=c.modelPosition.nodeAfter;f&&f.getAttribute("listType")=="todo"&&(c.modelPosition=e.createPositionAt(f,0))},{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){const e=this.editor,i=e.model,s=Array.from(i.document.selection.getRanges());i.change(n=>{n.setSelection(t,"end"),e.execute("checkTodoList"),n.setSelection(s)})}_initAriaAnnouncements(){const{model:t,ui:e,t:i}=this.editor;let s=null;e&&t.document.selection.on("change:range",()=>{const n=t.document.selection.focus.parent,r=Re(s),l=Re(n);r&&!l?e.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!r&&l&&e.ariaLiveAnnouncer.announce(i("Entering a to-do list")),s=n})}}function Xi(){return(o,t,e)=>{const{writer:i,schema:s}=e;if(!t.modelRange)return;const n=Array.from(t.modelRange.getItems({shallow:!0})).filter(r=>r.getAttribute("listType")==="todo"&&s.checkAttribute(r,"listItemId")).reduce((r,l)=>{const c=l.getAttribute("listItemId");return r.has(c)||r.set(c,_(l)),r},new Map);for(const[,r]of n.entries())if(r.some(l=>l.getAttribute("todoListChecked")))for(const l of r)i.setAttribute("todoListChecked",!0,l)}}function ts(){return(o,t,e)=>{const i=t.modelCursor,s=i.parent,n=t.viewItem;if(!e.consumable.test(n,{name:!0})||n.getAttribute("type")!="checkbox"||!i.isAtStart||!s.hasAttribute("listType"))return;e.consumable.consume(n,{name:!0});const r=e.writer;r.setAttribute("listType","todo",s),t.viewItem.hasAttribute("checked")&&r.setAttribute("todoListChecked",!0,s),t.modelRange=r.createRange(i)}}function Ct(o){const t=new jt(o);return(e,i,s)=>{const n=t.match(i.viewItem);n&&s.consumable.consume(i.viewItem,n.match)&&Object.assign(i,s.convertChildren(i.viewItem,i.modelCursor))}}function es(o){const t=new jt(o);return(e,i,s)=>{const n=t.match(i.viewItem);if(!n)return;const r=n.match;r.name=!1,s.consumable.consume(i.viewItem,r)}}function tt(o,t){return(o.is("element","paragraph")||o.is("element","listItem"))&&o.getAttribute("listType")=="todo"&&v(o)&&is(o,t)}function is(o,t){for(const e of o.getAttributeKeys())if(!e.startsWith("selection:")&&!t.includes(e))return!1;return!0}function ss(o,t){return(e,i)=>{const s=Ut(i.keyCode,t.contentLanguageDirection),n=o.schema,r=o.document.selection;if(!r.isCollapsed)return;const l=r.getFirstPosition(),c=l.parent;if(s=="right"&&l.isAtEnd){const a=n.getNearestSelectionRange(o.createPositionAfter(c),"forward");if(!a)return;const u=a.start.parent;u&&p(u)&&u.getAttribute("listType")=="todo"&&(o.change(d=>d.setSelection(a)),i.preventDefault(),i.stopPropagation(),e.stop())}else if(s=="left"&&l.isAtStart&&p(c)&&c.getAttribute("listType")=="todo"){const a=n.getNearestSelectionRange(o.createPositionBefore(c),"backward");if(!a)return;o.change(u=>u.setSelection(a)),i.preventDefault(),i.stopPropagation(),e.stop()}}}function Oe(o){return!!o&&o.is("attributeElement")&&o.hasClass("todo-list__label")}function Re(o){return!o||!o.is("element","paragraph")&&!o.is("element","listItem")?!1:o.getAttribute("listType")=="todo"}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class xt extends g{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;J(this.editor,"todoList",t("To-do List"),Fi)}}O(':root{--ck-content-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px;position:relative}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-content-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-content-todo-list-checkmark-size)}.ck-content[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-content .todo-list .todo-list__label>input:before{transition:none}}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-content-todo-list-checkmark-size)/8) calc(var(--ck-content-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-content-todo-list-checkmark-size)/2.6);left:calc(var(--ck-content-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-content-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-content-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-editor__editable.ck-content .todo-list .todo-list__label>input,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{cursor:pointer}.ck-editor__editable.ck-content .todo-list .todo-list__label>input:hover:before,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-content-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-content-todo-list-checkmark-size)}.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label>span[contenteditable=false]>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{transition:none}}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-content-todo-list-checkmark-size)/8) calc(var(--ck-content-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-content-todo-list-checkmark-size)/2.6);left:calc(var(--ck-content-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-content-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-content-todo-list-checkmark-size)/5.3)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:after{border-color:#fff}.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}');/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ns extends g{static get requires(){return[Ne,xt]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class et extends k{type;constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,s=Array.from(i.selection.getSelectedBlocks()).filter(r=>ze(r,e.schema)),n=t.forceValue!==void 0?!t.forceValue:this.value;e.change(r=>{if(n){let l=s[s.length-1].nextSibling,c=Number.POSITIVE_INFINITY,a=[];for(;l&&l.name=="listItem"&&l.getAttribute("listIndent")!==0;){const u=l.getAttribute("listIndent");u<c&&(c=u);const d=u-c;a.push({element:l,listIndent:d}),l=l.nextSibling}a=a.reverse();for(const u of a)r.setAttribute("listIndent",u.listIndent,u.element)}if(!n){let l=Number.POSITIVE_INFINITY;for(const c of s)c.is("element","listItem")&&c.getAttribute("listIndent")<l&&(l=c.getAttribute("listIndent"));l=l===0?1:l,Me(s,!0,l),Me(s,!1,l)}for(const l of s.reverse())n&&l.name=="listItem"?r.rename(l,"paragraph"):!n&&l.name!="listItem"?(r.setAttributes({listType:this.type,listIndent:0},l),r.rename(l,"listItem")):!n&&l.name=="listItem"&&l.getAttribute("listType")!=this.type&&r.setAttribute("listType",this.type,l);this.fire("_executeCleanup",s)})}_getValue(){const t=x(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("element","listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=x(t.getSelectedBlocks());return i?ze(i,e):!1}}function Me(o,t,e){const i=t?o[0]:o[o.length-1];if(i.is("element","listItem")){let s=i[t?"previousSibling":"nextSibling"],n=i.getAttribute("listIndent");for(;s&&s.is("element","listItem")&&s.getAttribute("listIndent")>=e;)n>s.getAttribute("listIndent")&&(n=s.getAttribute("listIndent")),s.getAttribute("listIndent")==n&&o[t?"unshift":"push"](s),s=s[t?"previousSibling":"nextSibling"]}}function ze(o,t){return t.checkChild(o.parent,"listItem")&&!t.isObject(o)}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Et extends k{_indentBy;constructor(t,e){super(t),this._indentBy=e=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change(s=>{const n=i[i.length-1];let r=n.nextSibling;for(;r&&r.name=="listItem"&&r.getAttribute("listIndent")>n.getAttribute("listIndent");)i.push(r),r=r.nextSibling;this._indentBy<0&&(i=i.reverse());for(const l of i){const c=l.getAttribute("listIndent")+this._indentBy;c<0?s.rename(l,"paragraph"):s.setAttribute("listIndent",c,l)}this.fire("_executeCleanup",i)})}_checkEnabled(){const t=x(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let s=t.previousSibling;for(;s&&s.is("element","listItem")&&s.getAttribute("listIndent")>=e;){if(s.getAttribute("listIndent")==e)return s.getAttribute("listType")==i;s=s.previousSibling}return!1}return!0}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function os(o){const t=o.createContainerElement("li");return t.getFillerOffset=cs,t}function Pt(o,t){const e=t.mapper,i=t.writer,s=o.getAttribute("listType")=="numbered"?"ol":"ul",n=os(i),r=i.createContainerElement(s,null);return i.insert(i.createPositionAt(r,0),n),e.bindElements(o,n),n}function it(o,t,e,i){const s=t.parent,n=e.mapper,r=e.writer;let l=n.toViewPosition(i.createPositionBefore(o));const c=R(o.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:o.getAttribute("listIndent")}),a=o.previousSibling;if(c&&c.getAttribute("listIndent")==o.getAttribute("listIndent")){const u=n.toViewElement(c);l=r.breakContainer(r.createPositionAfter(u))}else if(a&&a.name=="listItem"){l=n.toViewPosition(i.createPositionAt(a,"end"));const u=n.findMappedViewAncestor(l),d=De(u);d?l=r.createPositionBefore(d):l=r.createPositionAt(u,"end")}else l=n.toViewPosition(i.createPositionBefore(o));if(l=Bt(l),r.insert(l,s),a&&a.name=="listItem"){const u=n.toViewElement(a),m=r.createRange(r.createPositionAt(u,0),l).getWalker({ignoreElementEnd:!0});for(const f of m)if(f.item.is("element","li")){const b=r.breakContainer(r.createPositionBefore(f.item)),y=f.item.parent,h=r.createPositionAt(t,"end");L(r,h.nodeBefore,h.nodeAfter),r.move(r.createRangeOn(y),h),m._position=b}}else{const u=s.nextSibling;if(u&&(u.is("element","ul")||u.is("element","ol"))){let d=null;for(const m of u.getChildren()){const f=n.toModelElement(m);if(f&&f.getAttribute("listIndent")>o.getAttribute("listIndent"))d=m;else break}d&&(r.breakContainer(r.createPositionAfter(d)),r.move(r.createRangeOn(d.parent),r.createPositionAt(t,"end")))}}L(r,s,s.nextSibling),L(r,s.previousSibling,s)}function L(o,t,e){return!t||!e||t.name!="ul"&&t.name!="ol"||t.name!=e.name||t.getAttribute("class")!==e.getAttribute("class")?null:o.mergeContainers(o.createPositionAfter(t))}function Bt(o){return o.getLastMatchingPosition(t=>t.item.is("uiElement"))}function R(o,t){const e=!!t.sameIndent,i=!!t.smallerIndent,s=t.listIndent;let n=o;for(;n&&n.name=="listItem";){const r=n.getAttribute("listIndent");if(e&&s==r||i&&s>r)return n;t.direction==="forward"?n=n.nextSibling:n=n.previousSibling}return null}function De(o){for(const t of o.getChildren())if(t.name=="ul"||t.name=="ol")return t;return null}function st(o,t){const e=[],i=o.parent,s={ignoreElementEnd:!1,startPosition:o,shallow:!0,direction:t},n=i.getAttribute("listIndent"),r=[...new qt(s)].filter(l=>l.item.is("element")).map(l=>l.item);for(const l of r){if(!l.is("element","listItem")||l.getAttribute("listIndent")<n)break;if(!(l.getAttribute("listIndent")>n)){if(l.getAttribute("listType")!==i.getAttribute("listType")||l.getAttribute("listStyle")!==i.getAttribute("listStyle")||l.getAttribute("listReversed")!==i.getAttribute("listReversed")||l.getAttribute("listStart")!==i.getAttribute("listStart"))break;t==="backward"?e.unshift(l):e.push(l)}}return e}function nt(o){let e=[...o.document.selection.getSelectedBlocks()].filter(i=>i.is("element","listItem")).map(i=>{const s=o.change(n=>n.createPositionAt(i,0));return[...st(s,"backward"),...st(s,"forward")]}).flat();return e=[...new Set(e)],e}const rs=["disc","circle","square"],ls=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function Ue(o){return rs.includes(o)?"bulleted":ls.includes(o)?"numbered":null}function cs(){const o=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||o?0:Ni.call(this)}/**
* @license Copyright (c) 2003-2025, 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 g{static get pluginName(){return"LegacyListUtils"}static get isOfficialPlugin(){return!0}getListTypeFromListStyleType(t){return Ue(t)}getSelectedListItems(t){return nt(t)}getSiblingNodes(t,e){return st(t,e)}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function We(o){return(t,e,i)=>{const s=i.consumable;if(!s.test(e.item,"insert")||!s.test(e.item,"attribute:listType")||!s.test(e.item,"attribute:listIndent"))return;s.consume(e.item,"insert"),s.consume(e.item,"attribute:listType"),s.consume(e.item,"attribute:listIndent");const n=e.item,r=Pt(n,i);it(n,r,i,o)}}function as(o){return(t,e,i)=>{const r=i.mapper.toViewPosition(e.position).getLastMatchingPosition(f=>!f.item.is("element","li")).nodeAfter,l=i.writer;l.breakContainer(l.createPositionBefore(r)),l.breakContainer(l.createPositionAfter(r));const c=r.parent,a=c.previousSibling,u=l.createRangeOn(c),d=l.remove(u);a&&a.nextSibling&&L(l,a,a.nextSibling);const m=i.mapper.toModelElement(r);Ye(m.getAttribute("listIndent")+1,e.position,u.start,r,i,o);for(const f of l.createRangeIn(d).getItems())i.mapper.unbindViewElement(f);t.stop()}}const us=(o,t,e)=>{if(!e.consumable.test(t.item,o.name))return;const i=e.mapper.toViewElement(t.item),s=e.writer;s.breakContainer(s.createPositionBefore(i)),s.breakContainer(s.createPositionAfter(i));const n=i.parent,r=t.attributeNewValue=="numbered"?"ol":"ul";s.rename(r,n)},ds=(o,t,e)=>{e.consumable.consume(t.item,o.name);const s=e.mapper.toViewElement(t.item).parent,n=e.writer;L(n,s,s.nextSibling),L(n,s.previousSibling,s)};function ms(o){return(t,e,i)=>{if(!i.consumable.consume(e.item,"attribute:listIndent"))return;const s=i.mapper.toViewElement(e.item),n=i.writer;n.breakContainer(n.createPositionBefore(s)),n.breakContainer(n.createPositionAfter(s));const r=s.parent,l=r.previousSibling,c=n.createRangeOn(r);n.remove(c),l&&l.nextSibling&&L(n,l,l.nextSibling),Ye(e.attributeOldValue+1,e.range.start,c.start,s,i,o),it(e.item,s,i,o);for(const a of e.item.getChildren())i.consumable.consume(a,"insert")}}const je=(o,t,e)=>{if(e.consumable.test(t.item,o.name)&&t.item.name!="listItem"){let i=e.mapper.toViewPosition(t.range.start);const s=e.writer,n=[];for(;(i.parent.name=="ul"||i.parent.name=="ol")&&(i=s.breakContainer(i),i.parent.name=="li");){const r=i,l=s.createPositionAt(i.parent,"end");if(!r.isEqual(l)){const c=s.remove(s.createRange(r,l));n.push(c)}i=s.createPositionAfter(i.parent)}if(n.length>0){for(let r=0;r<n.length;r++){const l=i.nodeBefore;if(i=s.insert(i,n[r]).end,r>0){const a=L(s,l,l.nextSibling);a&&a.parent==l&&i.offset--}}L(s,i.nodeBefore,i.nodeAfter)}}},fs=(o,t,e)=>{const i=e.mapper.toViewPosition(t.position),s=i.nodeBefore,n=i.nodeAfter;L(e.writer,s,n)},ps=(o,t,e)=>{if(e.consumable.consume(t.viewItem,{name:!0})){const i=e.writer,s=i.createElement("listItem"),n=As(t.viewItem);i.setAttribute("listIndent",n,s);const r=t.viewItem.parent&&t.viewItem.parent.name=="ol"?"numbered":"bulleted";if(i.setAttribute("listType",r,s),!e.safeInsert(s,t.modelCursor))return;const l=ks(s,t.viewItem.getChildren(),e);t.modelRange=i.createRange(t.modelCursor,l),e.updateConversionResult(s,t)}},qe=(o,t,e)=>{if(e.consumable.test(t.viewItem,{name:!0})){const i=Array.from(t.viewItem.getChildren());for(const s of i)!(s.is("element","li")||M(s))&&s._remove()}},gs=(o,t,e)=>{if(e.consumable.test(t.viewItem,{name:!0})){if(t.viewItem.childCount===0)return;const i=[...t.viewItem.getChildren()];let s=!1;for(const n of i)s&&!M(n)&&n._remove(),M(n)&&(s=!0)}};function Ke(o){return(t,e)=>{if(e.isPhantom)return;const i=e.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const s=e.mapper.toViewElement(i),n=s.getAncestors().find(M),r=o.createPositionAt(s,0).getWalker();for(const l of r)if(l.type=="elementStart"&&l.item.is("element","li")){e.viewPosition=l.previousPosition;break}else if(l.type=="elementEnd"&&l.item==n){e.viewPosition=l.nextPosition;break}}}}function bs(o){return(t,e)=>{const i=e.viewPosition,s=i.parent,n=e.mapper;if(s.name=="ul"||s.name=="ol"){if(i.isAtEnd){const r=n.toModelElement(i.nodeBefore),l=n.getModelLength(i.nodeBefore);e.modelPosition=o.createPositionBefore(r).getShiftedBy(l)}else{const r=n.toModelElement(i.nodeAfter);e.modelPosition=o.createPositionBefore(r)}t.stop()}else if(s.name=="li"&&i.nodeBefore&&(i.nodeBefore.name=="ul"||i.nodeBefore.name=="ol")){const r=n.toModelElement(s);let l=1,c=i.nodeBefore;for(;c&&M(c);)l+=n.getModelLength(c),c=c.previousSibling;e.modelPosition=o.createPositionBefore(r).getShiftedBy(l),t.stop()}}}function hs(o,t){const e=o.document.differ.getChanges(),i=new Map;let s=!1;for(const c of e)if(c.type=="insert"&&c.name=="listItem")n(c.position);else if(c.type=="insert"&&c.name!="listItem"){if(c.name!="$text"){const u=c.position.nodeAfter;u.hasAttribute("listIndent")&&(t.removeAttribute("listIndent",u),s=!0),u.hasAttribute("listType")&&(t.removeAttribute("listType",u),s=!0),u.hasAttribute("listStyle")&&(t.removeAttribute("listStyle",u),s=!0),u.hasAttribute("listReversed")&&(t.removeAttribute("listReversed",u),s=!0),u.hasAttribute("listStart")&&(t.removeAttribute("listStart",u),s=!0);for(const d of Array.from(o.createRangeIn(u)).filter(m=>m.item.is("element","listItem")))n(d.previousPosition)}const a=c.position.getShiftedBy(c.length);n(a)}else c.type=="remove"&&c.name=="listItem"?n(c.position):(c.type=="attribute"&&c.attributeKey=="listIndent"||c.type=="attribute"&&c.attributeKey=="listType")&&n(c.range.start);for(const c of i.values())r(c),l(c);return s;function n(c){const a=c.nodeBefore;if(!a||!a.is("element","listItem")){const u=c.nodeAfter;u&&u.is("element","listItem")&&i.set(u,u)}else{let u=a;if(i.has(u))return;for(let d=u.previousSibling;d&&d.is("element","listItem");d=u.previousSibling)if(u=d,i.has(u))return;i.set(a,u)}}function r(c){let a=0,u=null;for(;c&&c.is("element","listItem");){const d=c.getAttribute("listIndent");if(d>a){let m;u===null?(u=d-a,m=a):(u>d&&(u=d),m=d-u),t.setAttribute("listIndent",m,c),s=!0}else u=null,a=c.getAttribute("listIndent")+1;c=c.nextSibling}}function l(c){let a=[],u=null;for(;c&&c.is("element","listItem");){const d=c.getAttribute("listIndent");if(u&&u.getAttribute("listIndent")>d&&(a=a.slice(0,d+1)),d!=0)if(a[d]){const m=a[d];c.getAttribute("listType")!=m&&(t.setAttribute("listType",m,c),s=!0)}else a[d]=c.getAttribute("listType");u=c,c=c.nextSibling}}}const Is=function(o,[t,e]){const i=this;let s=t.is("documentFragment")?t.getChild(0):t,n;if(e?n=i.createSelection(e):n=i.document.selection,s&&s.is("element","listItem")){const r=n.getFirstPosition();let l=null;if(r.parent.is("element","listItem")?l=r.parent:r.nodeBefore&&r.nodeBefore.is("element","listItem")&&(l=r.nodeBefore),l){const c=l.getAttribute("listIndent");if(c>0)for(;s&&s.is("element","listItem");)s._setAttribute("listIndent",s.getAttribute("listIndent")+c),s=s.nextSibling}}};function ks(o,t,e){const{writer:i,schema:s}=e;let n=i.createPositionAfter(o);for(const r of t)if(r.name=="ul"||r.name=="ol")n=e.convertItem(r,n).modelCursor;else{const l=e.convertItem(r,i.createPositionAt(o,"end")),c=l.modelRange.start.nodeAfter;c&&c.is("element")&&!s.checkChild(o,c.name)&&(l.modelCursor.parent.is("element","listItem")?o=l.modelCursor.parent:o=ys(l.modelCursor),n=i.createPositionAfter(o))}return n}function ys(o){const t=new qt({startPosition:o});let e;do e=t.next();while(!e.value.item.is("element","listItem"));return e.value.item}function Ye(o,t,e,i,s,n){const r=R(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:o}),l=s.mapper,c=s.writer,a=r?r.getAttribute("listIndent"):null;let u;if(!r)u=e;else if(a==o){const d=l.toViewElement(r).parent;u=c.createPositionAfter(d)}else{const d=n.createPositionAt(r,"end");u=l.toViewPosition(d)}u=Bt(u);for(const d of[...i.getChildren()])M(d)&&(u=c.move(c.createRangeOn(d),u).end,L(c,d,d.nextSibling),L(c,d.previousSibling,d))}function M(o){return o.is("element","ol")||o.is("element","ul")}function As(o){let t=0,e=o.parent;for(;e;){if(e.is("element","li"))t++;else{const i=e.previousSibling;i&&i.is("element","li")&&t++}e=e.parent}return t}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ot extends g{static get pluginName(){return"LegacyListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ot,Nt,$e]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;t.model.document.registerPostFixer(n=>hs(t.model,n)),i.mapper.registerViewToModelLength("li",Ft),e.mapper.registerViewToModelLength("li",Ft),i.mapper.on("modelToViewPosition",Ke(i.view)),i.mapper.on("viewToModelPosition",bs(t.model)),e.mapper.on("modelToViewPosition",Ke(i.view)),t.conversion.for("editingDowncast").add(n=>{n.on("insert",je,{priority:"high"}),n.on("insert:listItem",We(t.model)),n.on("attribute:listType:listItem",us,{priority:"high"}),n.on("attribute:listType:listItem",ds,{priority:"low"}),n.on("attribute:listIndent:listItem",ms(t.model)),n.on("remove:listItem",as(t.model)),n.on("remove",fs,{priority:"low"})}),t.conversion.for("dataDowncast").add(n=>{n.on("insert",je,{priority:"high"}),n.on("insert:listItem",We(t.model))}),t.conversion.for("upcast").add(n=>{n.on("element:ul",qe,{priority:"high"}),n.on("element:ol",qe,{priority:"high"}),n.on("element:li",gs,{priority:"high"}),n.on("element:li",ps)}),t.model.on("insertContent",Is,{priority:"high"}),t.commands.add("numberedList",new et(t,"numbered")),t.commands.add("bulletedList",new et(t,"bulleted")),t.commands.add("indentList",new Et(t,"forward")),t.commands.add("outdentList",new Et(t,"backward"));const s=i.view.document;this.listenTo(s,"enter",(n,r)=>{const l=this.editor.model.document,c=l.selection.getLastPosition().parent;l.selection.isCollapsed&&c.name=="listItem"&&c.isEmpty&&(this.editor.execute("outdentList"),r.preventDefault(),n.stop())},{context:"li"}),this.listenTo(s,"delete",(n,r)=>{if(r.direction!=="backward")return;const l=this.editor.model.document.selection;if(!l.isCollapsed)return;const c=l.getFirstPosition();if(!c.isAtStart)return;const a=c.parent;a.name!=="listItem"||a.previousSibling&&a.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),r.preventDefault(),n.stop())},{context:"li"}),this.listenTo(t.editing.view.document,"tab",(n,r)=>{const l=r.shiftKey?"outdentList":"indentList";this.editor.commands.get(l).isEnabled&&(t.execute(l),r.stopPropagation(),r.preventDefault(),n.stop())},{context:"li"})}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function Ft(o){let t=1;for(const e of o.getChildren())if(e.name=="ul"||e.name=="ol")for(const i of e.getChildren())t+=Ft(i);return t}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ws extends g{static get requires(){return[ot,yt]}static get pluginName(){return"LegacyList"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2025, 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 k{defaultType;constructor(t,e){super(t),this.defaultType=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);const e=this.editor.model,i=nt(e);i.length&&e.change(s=>{for(const n of i)s.setAttribute("listStyle",t.type||this.defaultType,n)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=Ue(t.type);/* istanbul ignore next -- @preserve */if(!e)return;const i=this.editor,s=`${e}List`;i.commands.get(s).value||i.execute(s)}}/**
* @license Copyright (c) 2003-2025, 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 k{refresh(){const t=this._getValue();this.value=t,this.isEnabled=t!=null}execute(t={}){const e=this.editor.model,i=nt(e).filter(s=>s.getAttribute("listType")=="numbered");e.change(s=>{for(const n of i)s.setAttribute("listReversed",!!t.reversed,n)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&t.getAttribute("listType")=="numbered"?t.getAttribute("listReversed"):null}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ze extends k{refresh(){const t=this._getValue();this.value=t,this.isEnabled=t!=null}execute({startIndex:t=1}={}){const e=this.editor.model,i=nt(e).filter(s=>s.getAttribute("listType")=="numbered");e.change(s=>{for(const n of i)s.setAttribute("listStart",t>=0?t:1,n)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&t.getAttribute("listType")=="numbered"?t.getAttribute("listStart"):null}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const rt="default";class Je extends g{static get requires(){return[ot]}static get pluginName(){return"LegacyListPropertiesEditing"}static get isOfficialPlugin(){return!0}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,e=t.model,i=t.config.get("list.properties"),s=Ls(i);e.schema.extend("listItem",{allowAttributes:s.map(n=>n.attributeName)});for(const n of s)n.addCommand(t);this.listenTo(t.commands.get("indentList"),"_executeCleanup",Ts(t,s)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",Ss(t,s)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",Qe(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",Qe(t)),e.document.registerPostFixer(Cs(t,s)),t.conversion.for("upcast").add(vs(s)),t.conversion.for("downcast").add(_s(s)),this._mergeListAttributesWhileMergingLists(s)}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(Ps(t))}_mergeListAttributesWhileMergingLists(t){const i=this.editor.model;let s;this.listenTo(i,"deleteContent",(n,[r])=>{const l=r.getFirstPosition(),c=r.getLastPosition();if(l.parent===c.parent||!l.parent.is("element","listItem"))return;const a=c.parent.nextSibling;if(!a||!a.is("element","listItem"))return;const u=R(l.parent,{sameIndent:!0,listIndent:a.getAttribute("listIndent")});u&&u.getAttribute("listType")===a.getAttribute("listType")&&(s=u)},{priority:"high"}),this.listenTo(i,"deleteContent",()=>{s&&(i.change(n=>{const r=R(s.nextSibling,{sameIndent:!0,listIndent:s.getAttribute("listIndent"),direction:"forward"});if(!r){s=null;return}const l=[r,...st(n.createPositionAt(r,0),"forward")];for(const c of l)for(const a of t)if(a.appliesToListItem(c)){const u=a.attributeName,d=s.getAttribute(u);n.setAttribute(u,d,c)}}),s=null)},{priority:"low"})}}function Ls(o){const t=[];return o.styles&&t.push({attributeName:"listStyle",defaultValue:rt,addCommand(e){e.commands.add("listStyle",new He(e,rt))},appliesToListItem(){return!0},setAttributeOnDowncast(e,i,s){i&&i!==rt?e.setStyle("list-style-type",i,s):e.removeStyle("list-style-type",s)},getAttributeOnUpcast(e){return Lt(e.getStyle("list-style-type"))||rt}}),o.reversed&&t.push({attributeName:"listReversed",defaultValue:!1,addCommand(e){e.commands.add("listReversed",new Ge(e))},appliesToListItem(e){return e.getAttribute("listType")=="numbered"},setAttributeOnDowncast(e,i,s){i?e.setAttribute("reversed","reversed",s):e.removeAttribute("reversed",s)},getAttributeOnUpcast(e){return e.hasAttribute("reversed")}}),o.startIndex&&t.push({attributeName:"listStart",defaultValue:1,addCommand(e){e.commands.add("listStart",new Ze(e))},appliesToListItem(e){return e.getAttribute("listType")=="numbered"},setAttributeOnDowncast(e,i,s){i==0||i>1?e.setAttribute("start",i,s):e.removeAttribute("start",s)},getAttributeOnUpcast(e){const i=e.getAttribute("start");return i>=0?i:1}}),t}function vs(o){return t=>{t.on("element:li",(e,i,s)=>{if(!i.modelRange)return;const n=i.viewItem.parent,r=i.modelRange.start.nodeAfter||i.modelRange.end.nodeBefore;for(const l of o)if(l.appliesToListItem(r)){const c=l.getAttributeOnUpcast(n);s.writer.setAttribute(l.attributeName,c,r)}},{priority:"low"})}}function _s(o){return e=>{for(const i of o)e.on(`attribute:${i.attributeName}:listItem`,(s,n,r)=>{const l=r.writer,c=n.item,a=R(c.previousSibling,{sameIndent:!0,listIndent:c.getAttribute("listIndent"),direction:"backward"}),u=r.mapper.toViewElement(c);t(c,a)||l.breakContainer(l.createPositionBefore(u)),i.setAttributeOnDowncast(l,n.attributeNewValue,u.parent)},{priority:"low"})};function t(e,i){return i&&e.getAttribute("listType")===i.getAttribute("listType")&&e.getAttribute("listIndent")===i.getAttribute("listIndent")&&e.getAttribute("listStyle")===i.getAttribute("listStyle")&&e.getAttribute("listReversed")===i.getAttribute("listReversed")&&e.getAttribute("listStart")===i.getAttribute("listStart")}}function Ts(o,t){return(e,i)=>{const s=i[0],n=s.getAttribute("listIndent"),r=i.filter(c=>c.getAttribute("listIndent")===n);let l=null;s.previousSibling.getAttribute("listIndent")+1!==n&&(l=R(s.previousSibling,{sameIndent:!0,direction:"backward",listIndent:n})),o.model.change(c=>{for(const a of r)for(const u of t)if(u.appliesToListItem(a)){const d=l==null?u.defaultValue:l.getAttribute(u.attributeName);c.setAttribute(u.attributeName,d,a)}})}}function Ss(o,t){return(e,i)=>{if(i=i.reverse().filter(l=>l.is("element","listItem")),!i.length)return;const s=i[0].getAttribute("listIndent"),n=i[0].getAttribute("listType");let r=i[0].previousSibling;if(r.is("element","listItem"))for(;r.getAttribute("listIndent")!==s;)r=r.previousSibling;else r=null;r||(r=i[i.length-1].nextSibling),!(!r||!r.is("element","listItem"))&&r.getAttribute("listType")===n&&o.model.change(l=>{const c=i.filter(a=>a.getAttribute("listIndent")===s);for(const a of c)for(const u of t)if(u.appliesToListItem(a)){const d=u.attributeName,m=r.getAttribute(d);l.setAttribute(d,m,a)}})}}function Cs(o,t){return e=>{let i=!1;const s=Xe(o.model.document.differ.getChanges()).filter(r=>r.getAttribute("listType")!=="todo");if(!s.length)return i;let n=s[s.length-1].nextSibling;if((!n||!n.is("element","listItem"))&&(n=s[0].previousSibling,n)){const r=s[0].getAttribute("listIndent");for(;n.is("element","listItem")&&n.getAttribute("listIndent")!==r&&(n=n.previousSibling,!!n););}for(const r of t){const l=r.attributeName;for(const c of s){if(!r.appliesToListItem(c)){e.removeAttribute(l,c);continue}if(!c.hasAttribute(l))xs(n,c,r)?e.setAttribute(l,n.getAttribute(l),c):e.setAttribute(l,r.defaultValue,c),i=!0;else{const a=c.previousSibling;Es(a,c,r.attributeName)&&(e.setAttribute(l,a.getAttribute(l),c),i=!0)}}}return i}}function xs(o,t,e){if(!o)return!1;const i=o.getAttribute(e.attributeName);return!(!i||i==e.defaultValue||o.getAttribute("listType")!==t.getAttribute("listType"))}function Es(o,t,e){if(!o||!o.is("element","listItem")||t.getAttribute("listType")!==o.getAttribute("listType"))return!1;const i=o.getAttribute("listIndent");if(i<1||i!==t.getAttribute("listIndent"))return!1;const s=o.getAttribute(e);return!(!s||s===t.getAttribute(e))}function Ps(o){return t=>{const e=Xe(o.model.document.differ.getChanges()).filter(i=>i.getAttribute("listType")==="todo"&&(i.hasAttribute("listStyle")||i.hasAttribute("listReversed")||i.hasAttribute("listStart")));if(!e.length)return!1;for(const i of e)t.removeAttribute("listStyle",i),t.removeAttribute("listReversed",i),t.removeAttribute("listStart",i);return!0}}function Qe(o){return(t,e)=>{e=e.filter(i=>i.is("element","listItem")),o.model.change(i=>{for(const s of e)i.removeAttribute("listStyle",s)})}}function Xe(o){const t=[];for(const e of o){const i=Bs(e);i&&i.is("element","listItem")&&t.push(i)}return t}function Bs(o){return o.type==="attribute"?o.range.start.nodeAfter:o.type==="insert"?o.position.nodeAfter:null}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Fs extends g{static get requires(){return[Je,St]}static get pluginName(){return"LegacyListProperties"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const W="todoListChecked";class ti extends k{_selectedElements;constructor(t){super(t),this._selectedElements=[],this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every(t=>!!t.getAttribute(W)),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,e=t.schema,i=t.document.selection.getFirstRange(),s=i.start.parent,n=[];e.checkAttribute(s,W)&&n.push(s);for(const r of i.getItems())e.checkAttribute(r,W)&&!n.includes(r)&&n.push(r);return n}execute(t={}){this.editor.model.change(e=>{for(const i of this._selectedElements)(t.forceValue===void 0?!this.value:t.forceValue)?e.setAttribute(W,!0,i):e.removeAttribute(W,i)})}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function Vs(o,t){return(e,i,s)=>{const n=s.consumable;if(!n.test(i.item,"insert")||!n.test(i.item,"attribute:listType")||!n.test(i.item,"attribute:listIndent")||i.item.getAttribute("listType")!="todo")return;const r=i.item;n.consume(r,"insert"),n.consume(r,"attribute:listType"),n.consume(r,"attribute:listIndent"),n.consume(r,"attribute:todoListChecked");const l=s.writer,c=Pt(r,s),a=!!r.getAttribute("todoListChecked"),u=Vt(r,l,a,t),d=l.createContainerElement("span",{class:"todo-list__label__description"});l.addClass("todo-list",c.parent),l.insert(l.createPositionAt(c,0),u),l.insert(l.createPositionAfter(u),d),it(r,c,s,o)}}function Ns(o){return(t,e,i)=>{const s=i.consumable;if(!s.test(e.item,"insert")||!s.test(e.item,"attribute:listType")||!s.test(e.item,"attribute:listIndent")||e.item.getAttribute("listType")!="todo")return;const n=e.item;s.consume(n,"insert"),s.consume(n,"attribute:listType"),s.consume(n,"attribute:listIndent"),s.consume(n,"attribute:todoListChecked");const r=i.writer,l=Pt(n,i);r.addClass("todo-list",l.parent);const c=r.createContainerElement("label",{class:"todo-list__label"}),a=r.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),u=r.createContainerElement("span",{class:"todo-list__label__description"});n.getAttribute("todoListChecked")&&r.setAttribute("checked","checked",a),r.insert(r.createPositionAt(l,0),c),r.insert(r.createPositionAt(c,0),a),r.insert(r.createPositionAfter(a),u),it(n,l,i,o)}}const Os=(o,t,e)=>{const i=t.modelCursor,s=i.parent,n=t.viewItem;if(n.getAttribute("type")!="checkbox"||s.name!="listItem"||!i.isAtStart||!e.consumable.consume(n,{name:!0}))return;const r=e.writer;r.setAttribute("listType","todo",s),t.viewItem.hasAttribute("checked")&&r.setAttribute("todoListChecked",!0,s),t.modelRange=r.createRange(i)};function Rs(o,t){return(e,i,s)=>{if(!s.consumable.consume(i.item,e.name))return;const n=s.mapper.toViewElement(i.item),r=s.writer,l=zs(n,t);if(i.attributeNewValue=="todo"){const c=!!i.item.getAttribute("todoListChecked"),a=Vt(i.item,r,c,o),u=r.createContainerElement("span",{class:"todo-list__label__description"}),d=r.createRangeIn(n),m=De(n),f=Bt(d.start),b=m?r.createPositionBefore(m):d.end,y=r.createRange(f,b);r.addClass("todo-list",n.parent),r.move(y,r.createPositionAt(u,0)),r.insert(r.createPositionAt(n,0),a),r.insert(r.createPositionAfter(a),u)}else if(i.attributeOldValue=="todo"){const c=ii(n,t);r.removeClass("todo-list",n.parent),r.remove(l),r.move(r.createRangeIn(c),r.createPositionBefore(c)),r.remove(c)}}}function Ms(o){return(t,e,i)=>{if(e.item.getAttribute("listType")!="todo"||!i.consumable.consume(e.item,"attribute:todoListChecked"))return;const{mapper:s,writer:n}=i,r=!!e.item.getAttribute("todoListChecked"),c=s.toViewElement(e.item).getChild(0),a=Vt(e.item,n,r,o);n.insert(n.createPositionAfter(c),a),n.remove(c)}}function ei(o){return(t,e)=>{const i=e.modelPosition,s=i.parent;if(!s.is("element","listItem")||s.getAttribute("listType")!="todo")return;const n=e.mapper.toViewElement(s),r=ii(n,o);r&&(e.viewPosition=e.mapper.findPositionIn(r,i.offset))}}function Vt(o,t,e,i){return t.createUIElement("label",{class:"todo-list__label",contenteditable:!1},function(n){const r=ui(document,"input",{type:"checkbox",tabindex:"-1"});e&&r.setAttribute("checked","checked"),r.addEventListener("change",()=>i(o));const l=this.toDomElement(n);return l.appendChild(r),l})}function zs(o,t){const e=t.createRangeIn(o);for(const i of e)if(i.item.is("uiElement","label"))return i.item}function ii(o,t){const e=t.createRangeIn(o);for(const i of e)if(i.item.is("containerElement","span")&&i.item.hasClass("todo-list__label__description"))return i.item}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const Ds=Dt("Ctrl+Enter");class si extends g{static get pluginName(){return"LegacyTodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[ot]}init(){const t=this.editor,{editing:e,data:i,model:s}=t;s.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),s.schema.addAttributeCheck((l,c)=>{const a=l.last;if(c=="todoListChecked"&&a.name=="listItem"&&a.getAttribute("listType")!="todo")return!1}),t.commands.add("todoList",new et(t,"todo"));const n=new ti(t);t.commands.add("checkTodoList",n),t.commands.add("todoListCheck",n),i.downcastDispatcher.on("insert:listItem",Ns(s),{priority:"high"}),i.upcastDispatcher.on("element:input",Os,{priority:"high"}),e.downcastDispatcher.on("insert:listItem",Vs(s,l=>this._handleCheckmarkChange(l)),{priority:"high"}),e.downcastDispatcher.on("attribute:listType:listItem",Rs(l=>this._handleCheckmarkChange(l),e.view)),e.downcastDispatcher.on("attribute:todoListChecked:listItem",Ms(l=>this._handleCheckmarkChange(l))),e.mapper.on("modelToViewPosition",ei(e.view)),i.mapper.on("modelToViewPosition",ei(e.view)),this.listenTo(e.view.document,"arrowKey",Us(s,t.locale),{context:"li"}),this.listenTo(e.view.document,"keydown",(l,c)=>{zt(c)===Ds&&(t.execute("checkTodoList"),l.stop())},{priority:"high"});const r=new Set;this.listenTo(s,"applyOperation",(l,c)=>{const a=c[0];if(a.type=="rename"&&a.oldName=="listItem"){const u=a.position.nodeAfter;u.hasAttribute("todoListChecked")&&r.add(u)}else if(a.type=="changeAttribute"&&a.key=="listType"&&a.oldValue==="todo")for(const u of a.range.getItems())u.hasAttribute("todoListChecked")&&u.getAttribute("listType")!=="todo"&&r.add(u)}),s.document.registerPostFixer(l=>{let c=!1;for(const a of r)l.removeAttribute("todoListChecked",a),c=!0;return r.clear(),c}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){const e=this.editor,i=e.model,s=Array.from(i.document.selection.getRanges());i.change(n=>{n.setSelection(t,"end"),e.execute("checkTodoList"),n.setSelection(s)})}_initAriaAnnouncements(){const{model:t,ui:e,t:i}=this.editor;let s=null;e&&t.document.selection.on("change:range",()=>{const n=t.document.selection.focus.parent,r=ni(s),l=ni(n);r&&!l?e.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!r&&l&&e.ariaLiveAnnouncer.announce(i("Entering a to-do list")),s=n})}}function Us(o,t){return(e,i)=>{if(Ut(i.keyCode,t.contentLanguageDirection)!="left")return;const n=o.schema,r=o.document.selection;if(!r.isCollapsed)return;const l=r.getFirstPosition(),c=l.parent;if(c.name==="listItem"&&c.getAttribute("listType")=="todo"&&l.isAtStart){const a=n.getNearestSelectionRange(o.createPositionBefore(c),"backward");a&&o.change(u=>u.setSelection(a)),i.preventDefault(),i.stopPropagation(),e.stop()}}}function ni(o){return!!o&&o.is("element","listItem")&&o.getAttribute("listType")==="todo"}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class $s extends g{static get requires(){return[si,xt]}static get pluginName(){return"LegacyTodoList"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ws extends g{static get pluginName(){return"AdjacentListsSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.register("listSeparator",{allowWhere:"$block",isBlock:!0}),t.conversion.for("upcast").add(i=>{i.on("element:ol",oi()),i.on("element:ul",oi())}).elementToElement({model:"listSeparator",view:"ck-list-separator"}),t.conversion.for("editingDowncast").elementToElement({model:"listSeparator",view:{name:"div",classes:["ck-list-separator","ck-hidden"]}}),t.conversion.for("dataDowncast").elementToElement({model:"listSeparator",view:(i,s)=>{const n=s.writer.createContainerElement("ck-list-separator");return s.writer.setCustomProperty("dataPipeline:transparentRendering",!0,n),n.getFillerOffset=()=>null,n}})}}function oi(){return(o,t,e)=>{const i=t.viewItem,s=i.nextSibling;if(!s||i.name!==s.name)return;t.modelRange||Object.assign(t,e.convertChildren(t.viewItem,t.modelCursor));const n=e.writer,r=n.createElement("listSeparator");if(!e.safeInsert(r,t.modelCursor))return;const l=e.getSplitParts(r);t.modelRange=n.createRange(t.modelRange.start,n.createPositionAfter(l[l.length-1])),e.updateConversionResult(r,t)}}export{Ws as AdjacentListsSupport,Fe as CheckTodoListCommand,ti as LegacyCheckTodoListCommand,Et as LegacyIndentCommand,ws as LegacyList,et as LegacyListCommand,ot as LegacyListEditing,Fs as LegacyListProperties,Je as LegacyListPropertiesEditing,Ge as LegacyListReversedCommand,Ze as LegacyListStartCommand,He as LegacyListStyleCommand,$e as LegacyListUtils,$s as LegacyTodoList,si as LegacyTodoListEditing,Yi as List,N as ListCommand,I as ListEditing,ie as ListFormatting,ft as ListIndentCommand,Jt as ListItemBoldIntegration,te as ListItemFontColorIntegration,ee as ListItemFontFamilyIntegration,Xt as ListItemFontSizeIntegration,Qt as ListItemItalicIntegration,pt as ListMergeCommand,Ji as ListProperties,Ce as ListPropertiesEditing,St as ListPropertiesUI,Se as ListPropertiesUtils,Te as ListReversedCommand,gt as ListSplitCommand,ye as ListStartCommand,_e as ListStyleCommand,yt as ListUI,ne as ListUtils,ns as TodoList,Ne as TodoListEditing,xt as TodoListUI,Kt as _ListBlocksIterable,Tt as _ListPropertiesView,A as _ListWalker,E as _SiblingListBlocksIterator,Ve as _TodoCheckboxChangeObserver,H as _canBecomeSimpleListItem,le as _createListElement,ce as _createListItemElement,J as _createListUIComponents,ge as _createModelToViewListPositionMapper,B as _expandListBlocksToCompleteItems,z as _expandListBlocksToCompleteList,w as _findAndAddListHeadToMap,pe as _findMappedListItemViewElement,ae as _fixListIndents,ue as _fixListItemIds,_ as _getAllListItemBlocks,At as _getAllSupportedListStyleTypes,re as _getListIndent,T as _getListItemBlocks,dt as _getListItems,wt as _getListStyleTypeFromTypeAttribute,Q as _getListTypeFromListStyleType,Yt as _getNestedListBlocks,_t as _getNormalizedListConfig,V as _getSelectedBlockObject,X as _getTypeAttributeFromListStyleType,ht as _getViewElementIdForListType,bt as _getViewElementNameForListType,Y as _indentListBlocks,v as _isFirstBlockOfListItem,mt as _isLastBlockOfListItem,p as _isListItemBlock,G as _isListItemView,oe as _isListView,U as _isNumberedListType,F as _isSingleListItem,kt as _listItemBogusParagraphCreator,It as _listItemDowncastConverter,fe as _listItemDowncastRemoveConverter,de as _listItemUpcastConverter,vt as _listPropertiesUpcastConverter,K as _mergeListItemBefore,Lt as _normalizeListStyle,Gt as _outdentFollowingListItems,Ht as _outdentListBlocksWithMerge,me as _reconvertListItemsOnDataChange,D as _removeListAttributes,C as _sortListBlocks,q as _splitListItemBefore};
