PageSourceSearch

https://www.mecalux.nl/o/frontend-editor-ckeditor-web/__liferay__/…/@ckeditor$ckeditor5-list$dist$index.js.js

js mecalux.nl collected 2026-09-28 06:11:22 UTC 114,496 bytes, 11 lines download raw bytes

1import{Accessibility as Kn,Command as w,CommandCollection as qn,Context as Yn,ContextPlugin as Gn,EditingKeystrokeHandler as Qn,Editor as Zn,ElementApiMixin as Jn,MultiCommand as Xn,PendingActions as es,Plugin as p,_DEFAULT_ACCESSIBILITY_GROUP_ID as ts,_getEditorUsageData as is,attachToForm as ns,secureSourceElement as ss}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{Delete as We,DeleteCommand as ls,Input as as,InsertTextCommand as cs,TextTransformation as us,TextWatcher as ds,TwoStepCaretMovement as ms,Typing as fs,TypingChangeBuffer as gs,_DeleteObserver as ps,findAttributeRange as bs,findAttributeRangeBound as hs,getLastTextLine as Is,inlineHighlight as ws}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-typing$dist$index.js.js";import{Enter as ze,EnterCommand as Ls,EnterObserver as ks,ShiftEnter as vs,ShiftEnterCommand as Ts,_getCopyOnEnterAttributes as _s}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-enter$dist$index.js.js";import{CKEditorError as At,Collection as Es,Config as Vs,DOCUMENTATION_URL as Ps,DomEmitterMixin as xs,ElementReplacer as Bs,EmitterMixin as Fs,EventInfo as Os,FocusTracker as He,KeystrokeHandler as je,Locale as Ms,ObservableMixin as Rs,Rect as Ds,ResizeObserver as Ns,_clearTranslations as Us,_getEmitterId as Ws,_getEmitterListenedTo as zs,_getUserAgent as Hs,_isAndroid as js,_isBlink as $s,_isGecko as Ks,_isMac as qs,_isMediaForcedColors as Ys,_isMotionReduced as Gs,_isRegExpUnicodePropertySupported as Qs,_isSafari as Zs,_isWindows as Js,_isiOS as Xs,_setEmitterId as eo,_translate as to,_unifyTranslations as io,abortableDebounce as no,add as so,areConnectedThroughProperties as oo,collectStylesheets as ro,compareArrays as lo,count as ao,crc32 as co,createElement as Lt,delay as uo,diff as mo,diffToChanges as fo,env as ee,exponentialDelay as go,fastDiff as po,findClosestScrollableAncestor as bo,first as C,formatHtml as ho,getAncestors as Io,getBorderWidths as wo,getCode as $e,getCommonAncestor as yo,getDataFromElement as Ao,getEnvKeystrokeText as Lo,getLanguageDirection as ko,getLocalizedArrowKeyCodeDirection as Ke,getOptimalPosition as vo,getPositionedAncestor as To,getRangeFromMouseEvent as _o,getVisualViewportOffset as So,global as kt,indexOf as Co,insertAt as Eo,insertToPriorityArray as Vo,isArrowKeyCode as Po,isCombiningMark as xo,isComment as Bo,isForwardArrowKeyCode as Fo,isHighSurrogateHalf as Oo,isInsideCombinedSymbol as Mo,isInsideEmojiSequence as Ro,isInsideSurrogatePair as Do,isIterable as No,isLowSurrogateHalf as Uo,isNode as Wo,isRange as zo,isText as Ho,isValidAttributeName as jo,isViewWithFocusTracker as $o,isVisible as Ko,isWindow as qo,keyCodes as Yo,logError as Go,logWarning as Qo,mapsEqual as Zo,nth as Jo,objectToMap as Xo,parseBase64EncodedObject as er,parseKeystroke as qe,priorities as tr,releaseDate as ir,remove as nr,retry as sr,scrollAncestorsToShowTarget as or,scrollViewportToShowTarget as rr,setDataInElement as lr,spliceArray as ar,spy as cr,toArray as _,toMap as ur,toUnit as dr,uid as vt,version as mr,wait as fr}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";import{Font as br,FontBackgroundColor as hr,FontBackgroundColorCommand as Ir,FontBackgroundColorEditing as wr,FontBackgroundColorUI as yr,FontColor as Ar,FontColorCommand as Lr,FontColorEditing as kr,FontColorUI as vr,FontColorUIBase as Tr,FontCommand as _r,FontFamily as Sr,FontFamilyCommand as Cr,FontFamilyEditing as Er,FontFamilyUI as Vr,FontSize as Pr,FontSizeCommand as xr,FontSizeEditing as Br,FontSizeUI as Fr,_addFontColorSelectorToDropdown as Or,_buildFontDefinition as Mr,_normalizeFontFamilyOptions as Rr,_normalizeFontSizeOptions as Ye,_renderDowncastFontElement as Dr,_renderUpcastFontColorAttribute as Nr}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-font$dist$index.js.js";import{Clipboard as zr,ClipboardMarkersUtils as Hr,ClipboardObserver as jr,ClipboardPipeline as Tt,DragDrop as $r,DragDropBlockToolbar as Kr,DragDropTarget as qr,PastePlainText as Yr,_ClipboardLineVie
1w as Gr,_DragDrop as Qr,_DragDropBlockToolbar as Zr,_DragDropTarget as Jr,_normalizeClipboardData as Xr,plainTextToHtml as el,viewToPlainText as tl}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-clipboard$dist$index.js.js";import{AccessibilityHelp as sl,AccessibilityHelpContentView as ol,AriaLiveAnnouncer as rl,AriaLiveAnnouncerPoliteness as ll,AriaLiveAnnouncerRegionView as al,AriaLiveAnnouncerView as cl,AutocompleteView as ul,Badge as dl,BalloonPanelView as ml,BalloonToolbar as fl,BlockButtonView as gl,BlockToolbar as pl,BodyCollection as bl,BoxedEditorUIView as hl,ButtonLabelView as Il,ButtonLabelWithHighlightView as wl,ButtonView as te,CollapsibleView as _t,ColorGridView as yl,ColorGridsFragmentView as Al,ColorPickerFragmentView as Ll,ColorPickerInputRowView as kl,ColorPickerView as vl,ColorSelectorView as Tl,ColorTileView as _l,ComponentFactory as Sl,ContextualBalloon as Cl,CssTransitionDisablerMixin as El,DefaultMenuBarItems as Vl,Dialog as Pl,DialogActionsView as xl,DialogContentView as Bl,DialogView as Fl,DialogViewPosition as Ol,DocumentColorCollection as Ml,DraggableViewMixin as Rl,DropdownButtonView as Dl,DropdownMenuButtonView as Nl,DropdownMenuListItemButtonView as Ul,DropdownMenuListItemView as Wl,DropdownMenuListView as zl,DropdownMenuNestedMenuPanelView as Hl,DropdownMenuNestedMenuView as jl,DropdownMenuPanelPositioningFunctions as $l,DropdownMenuRootListView as Kl,DropdownPanelView as ql,DropdownView as Yl,EditableUIView as Gl,EditorUI as Ql,EditorUIView as Zl,EvaluationBadge as Jl,FileDialogButtonView as Xl,FileDialogListItemButtonView as ea,FileDialogViewMixin as ta,FocusCycler as St,FormHeaderView as ia,FormRowView as na,HighlightedTextView as sa,IconView as oa,IframeView as ra,InlineEditableUIView as la,InputBase as aa,InputNumberView as ca,InputTextView as ua,InputView as da,ItemsView as ma,LabelView as fa,LabelWithHighlightView as ga,LabeledFieldView as Ct,LabeledInputView as pa,ListItemButtonView as ba,ListItemGroupView as ha,ListItemView as Ia,ListSeparatorView as wa,ListView as ya,MenuBarMenuButtonView as Aa,MenuBarMenuListItemButtonView as Et,MenuBarMenuListItemFileDialogButtonView as La,MenuBarMenuListItemView as ka,MenuBarMenuListView as va,MenuBarMenuPanelView as Ta,MenuBarMenuView as Vt,MenuBarView as _a,NESTED_TOOLBAR_ICONS as Sa,Notification as Ca,PoweredBy as Ea,SearchInfoView as Va,SearchResultsView as Pa,SearchTextView as xa,SliderView as Ba,SpinnerView as Fa,SplitButtonView as Pt,StickyPanelView as Oa,SwitchButtonView as xt,Template as Ma,TextareaView as Ra,ToolbarLineBreakView as Da,ToolbarSeparatorView as Na,ToolbarView as Ua,TooltipManager as Wa,UIModel as za,View as Ge,ViewCollection as Bt,ViewModel as Ha,_CheckIconHolderView as ja,_CollapsibleView as $a,_ContextualBalloonRotatorView as Ka,_DropdownMenuBehaviors as qa,_DropdownRootMenuBehaviors as Ya,_MenuBarBehaviors as Ga,_MenuBarMenuBehaviors as Qa,_MenuBarMenuViewPanelPositioningFunctions as Za,_SearchInfoView as Ja,_SearchTextQueryView as Xa,_TemplateBinding as ec,_TemplateIfBinding as tc,_TemplateToBinding as ic,_convertColor as nc,_convertColorToHex as sc,_preventUiViewDefault as oc,_processMenuBarConfig as rc,_registerCustomElement as lc,_tryNormalizeHexColor as ac,addKeyboardHandlingForGrid as Ft,addListToDropdown as cc,addMenuToDropdown as uc,addToolbarToDropdown as dc,clickOutsideHandler as mc,createDropdown as Ot,createLabeledDropdown as fc,createLabeledInputNumber as Mt,createLabeledInputText as gc,createLabeledTextarea as pc,filterGroupAndItemNames as bc,focusChildOnDropdownOpen as Rt,getLocalizedColorOptions as hc,isFocusable as Ic,isViewWithFocusCycler as wc,normalizeColorOptions as yc,normalizeMenuBarConfig as Ac,normalizeSingleColorDefinition as Lc,normalizeToolbarConfig as kc,submitHandler as vc}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-ui$dist$index.js.js";import{IconAccessibility as Sc,IconAddComment as Cc,IconAlignBottom as Ec,IconAlignCenter as Vc,IconAlignJustify as Pc,IconAlignLeft as xc,IconAlignMiddle as Bc,IconAlignRight as Fc,IconAlignTop as Oc,IconArrowDown as Mc,IconArrowUp as Rc,IconBold as Dc,IconBookmark as Nc,IconBookmarkInline as Uc,IconBookmarkMedium as Wc,IconBookmarkSmall as zc,IconBrowseFiles as Hc,IconBulletedList as ie,IconCancel as jc,IconCaption as $c,IconCaseChange as Kc,IconCheck as qc,IconChevronDown as Yc,IconChevronUp as Gc,IconCkboxImageEdit as Qc,IconCode as Zc,IconCodeBlock as Jc,IconCog as Xc,IconColorPalette as eu,IconColorTileCheck as tu,IconCommentsArchive as iu,IconContentLock as nu,IconContentUnlock as su,IconCopy as ou,IconDragHandle as ru,IconDragIndicator as lu,IconDropbox as au,IconDropdownArrow as cu,IconEditComment as uu,IconEmoji as du,IconEraser as mu,IconError as fu,IconExportPdf as gu,IconExportWord as pu,IconFacebook as bu,IconFindReplace as hu,IconFontBackgroun
1d as Iu,IconFontColor as wu,IconFontFamily as yu,IconFontSize as Au,IconFullscreenEnter as Lu,IconFullscreenLeave as ku,IconGoogleDrive as vu,IconGooglePhotos as Tu,IconHeading1 as _u,IconHeading2 as Su,IconHeading3 as Cu,IconHeading4 as Eu,IconHeading5 as Vu,IconHeading6 as Pu,IconHistory as xu,IconHorizontalLine as Bu,IconHtml as Fu,IconImage as Ou,IconImageAssetManager as Mu,IconImageUpload as Ru,IconImageUrl as Du,IconImportExport as Nu,IconImportWord as Uu,IconIndent as Wu,IconInsertMergeField as zu,IconItalic as Hu,IconLegalStyleList as ju,IconLineHeight as $u,IconLink as Ku,IconListStyleCircle as Dt,IconListStyleDecimal as Nt,IconListStyleDecimalLeadingZero as Ut,IconListStyleDisc as Wt,IconListStyleLowerLatin as zt,IconListStyleLowerRoman as Ht,IconListStyleSquare as jt,IconListStyleUpperLatin as $t,IconListStyleUpperRoman as Kt,IconLocal as qu,IconLoupe as Yu,IconLowVision as Gu,IconMagicWand as Qu,IconMarker as Zu,IconMedia as Ju,IconMediaPlaceholder as Xu,IconMultiLevelList as ed,IconNextArrow as td,IconNotification as id,IconNumberedList as ne,IconObjectCenter as nd,IconObjectFullWidth as sd,IconObjectInline as od,IconObjectInlineLeft as rd,IconObjectInlineRight as ld,IconObjectLeft as ad,IconObjectRight as cd,IconObjectSizeCustom as ud,IconObjectSizeFull as dd,IconObjectSizeLarge as md,IconObjectSizeMedium as fd,IconObjectSizeSmall as gd,IconOneDrive as pd,IconOutdent as bd,IconPageBreak as hd,IconPaginationExample as Id,IconPaintRoller as wd,IconPaintRollerCursorDefault as yd,IconPaintRollerCursorText as Ad,IconParagraph as Ld,IconPen as kd,IconPencil as vd,IconPilcrow as Td,IconPlay as _d,IconPlus as Sd,IconPreviewMergeFields as Cd,IconPreviousArrow as Ed,IconPrint as Vd,IconProjectLogo as Pd,IconQuote as xd,IconRedo as Bd,IconRemove as Fd,IconRemoveComment as Od,IconRemoveFormat as Md,IconReturnArrow as Rd,IconRevisionHistory as Dd,IconRobotPencil as Nd,IconSelectAll as Ud,IconSettings as Wd,IconShowBlocks as zd,IconSource as Hd,IconSpecialCharacters as jd,IconStrikethrough as $d,IconSubmit as Kd,IconSubscript as qd,IconSuperscript as Yd,IconTable as Gd,IconTableCellProperties as Qd,IconTableColumn as Zd,IconTableLayout as Jd,IconTableMergeCell as Xd,IconTableOfContents as em,IconTableProperties as tm,IconTableRow as im,IconTemplate as nm,IconTemplateGeneric as sm,IconText as om,IconTextAlternative as rm,IconThreeVerticalDots as lm,IconTodoList as qt,IconTrackChanges as am,IconTrackChangesAccept as cm,IconTrackChangesDiscard as um,IconUnderline as dm,IconUndo as mm,IconUnlink as fm,IconUploadcareImageEdit as gm,IconUploadcareImageUpload as pm,IconUploadcareLink as bm,IconUser as hm,IconWarning as Im}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-icons$dist$index.js.js";import{AttributeOperation as Am,Batch as Lm,BubblingEmitterMixin as km,BubblingEventInfo as vm,ClickObserver as Tm,CompositionObserver as _m,Conversion as Sm,ConversionHelpers as Cm,DataController as Em,Differ as Vm,DomEventObserver as Yt,DowncastHelpers as Pm,EditingController as xm,EditingView as Bm,FakeSelectionObserver as Fm,FocusObserver as Om,History as Mm,HtmlDataProcessor as Rm,InputObserver as Dm,InsertOperation as Nm,KeyObserver as Um,MarkerCollection as Wm,MarkerOperation as zm,Matcher as Qe,MergeOperation as Hm,Model as jm,ModelDocument as $m,ModelDocumentFragment as Km,ModelDocumentSelection as qm,ModelElement as Ym,ModelLivePosition as Gm,ModelLiveRange as Qm,ModelNode as Zm,ModelNodeList as Jm,ModelPosition as Xm,ModelRange as ef,ModelRootElement as tf,ModelSchemaContext as nf,ModelSelection as sf,ModelText as of,ModelTextProxy as rf,ModelTreeWalker as Ze,ModelTypeCheckable as lf,ModelWriter as af,MouseObserver as cf,MoveOperation as uf,MutationObserver as df,NoOperation as mf,Observer as ff,OperationFactory as gf,RenameOperation as pf,RootAttributeOperation as bf,RootOperation as hf,SelectionObserver as If,SplitOperation as wf,StylesMap as yf,StylesProcessor as Af,TabObserver as Lf,TouchObserver as kf,UpcastHelpers as vf,UpcastWriter as Tf,ViewAttributeElement as _f,ViewContainerElement as Sf,ViewDataTransfer as Cf,ViewDocument as Ef,ViewDocumentDomEventData as Vf,ViewDocumentFragment as Pf,ViewDocumentSelection as xf,ViewDomConverter as Bf,ViewDowncastWriter as Ff,ViewEditableElement as Of,ViewElement as Mf,ViewEmptyElement as Rf,ViewNode as Df,ViewPosition as Nf,ViewRange as Uf,ViewRawElement as Wf,ViewRenderer as zf,ViewRootEditableElement as Hf,Vie
vendor: 24,723 bytes, line 1
1wSelection as jf,ViewText as $f,ViewTextProxy as Kf,ViewTokenList as qf,ViewTreeWalker as Yf,ViewTypeCheckable as Gf,ViewUIElement as Qf,ViewUpcastWriter as Zf,XmlDataProcessor as Jf,_DataProcessorBasicHtmlWriter as Xf,_DetachOperation as eg,_MapperCache as tg,_OperationReplayer as ig,_VIEW_BR_FILLER as ng,_VIEW_INLINE_FILLER as sg,_VIEW_INLINE_FILLER_LENGTH as og,_VIEW_MARKED_NBSP_FILLER as rg,_VIEW_NBSP_FILLER as lg,_ViewElementConversionConsumables as ag,_autoParagraphEmptyModelRoots as cg,_convertMapToStringifiedObject as ug,_convertMapToTags as dg,_deleteModelContent as mg,_downcastCleanSelection as fg,_downcastConvertCollapsedSelection as gg,_downcastConvertRangeSelection as pg,_downcastCreateViewElementFromDowncastHighlightDescriptor as bg,_downcastInsertAttributesAndChildren as hg,_downcastInsertElement as Ig,_downcastInsertStructure as wg,_downcastInsertText as yg,_downcastInsertUIElement as Ag,_downcastRemove as Lg,_downcastWrap as kg,_dumpTrees as vg,_getDataWithoutViewFiller as Tg,_getModelData as _g,_getModelNodeAfterPosition as Sg,_getModelNodeBeforePosition as Cg,_getModelTextNodeAtPosition as Eg,_getSelectedModelContent as Vg,_getViewData as Pg,_initDocumentDumping as xg,_injectModelSelectionPostFixer as Bg,_injectViewQuirksHandling as Fg,_injectViewUIElementHandling as Og,_insertIntoModelNodeList as Mg,_insertModelContent as Rg,_insertModelObject as Dg,_isInlineViewFiller as Ng,_isParagraphableModelNode as Ug,_isViewPatternMatched as Wg,_logDocument as zg,_mergeIntersectingModelRanges as Hg,_modifyModelSelection as jg,_moveInModelNodeList as $g,_normalizeConversionConsumables as Kg,_normalizeInModelNodeList as qg,_operationTransform as Yg,_parseModel as Gg,_parseView as Qg,_removeFromModelNodeList as Zg,_setAttributeInModelNodeList as Jg,_setModelData as Xg,_setViewData as ep,_startsWithViewFiller as tp,_stringifyModel as ip,_stringifyView as np,_tryFixingModelRange as sp,_upcastConvertSelectionChange as op,_upcastConvertText as rp,_upcastConvertToModelFragment as lp,_wrapInModelParagraph as ap,addBackgroundStylesRules as cp,addBorderStylesRules as up,addMarginStylesRules as dp,addPaddingStylesRules as mp,autoParagraphEmptyRoots as fp,disableViewPlaceholder as gp,enableViewPlaceholder as pp,getBoxSidesStyleShorthandValue as bp,getBoxSidesStyleValueReducer as hp,getBoxSidesStyleValues as Ip,getPositionStyleShorthandNormalizer as wp,getShorthandStylesValues as yp,getViewFillerOffset as Gt,hideViewPlaceholder as Ap,isAttachmentStyleValue as Lp,isColorStyleValue as kp,isLengthStyleValue as vp,isLineStyleValue as Tp,isParagraphable as _p,isPercentageStyleValue as Sp,isPositionStyleValue as Cp,isRepeatStyleValue as Ep,isURLStyleValue as Vp,needsViewPlaceholder as Pp,showViewPlaceholder as xp,transformOperationSets as Bp,wrapInParagraph as Fp}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";var y=class{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward=t.direction=="forward",this._includeSelf=!!t.includeSelf,this._sameAttributes=_(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){let n=new this(e,t)[Symbol.iterator]();return C(n)}*[Symbol.iterator](){let e=[];for(let{node:t}of new V(this._getStartNode(),this._isForward?"forward":"backward")){let i=t.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){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some(n=>t.getAttribute(n)!==this._startElement.getAttribute(n)))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}},V=class{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(e,t="forward"){this._node=e,this._isForward=t==="forward"}[Symbol.iterator](){return this}next(){if(!g(this._node))return{done:!0,value:void 0};let e=this._node.getAttribute("listIndent"),t=null;if(this._previous){let n=this._previousNodeIndent;e>n?this._previousNodesByIndent[n]=this._previous:e<n?(t=this._previousNodesByIndent[e]||null,this._previousNodesByIndent.length=e):t=this._previous}let i={node:this._node,previous:this._previous,previousNodeInList:t};return this._previous=this._node,this._previousNodeIndent=e,this._node=this._isForward?this._node.nextSibling:this._node.previousSibling,{value:i,done:!1}}},ae=class{_listHead;constructor(e){this._listHead=e}[Symbol.iterator](){return new V(this._listHead)}},P=class{static next(){return vt()}};function g(r){return!!r&&r.is("element")&&r.hasAttribute("listItemId")}function T(r,e={}){return[...S(r,{...e,direction:"backward"}),...S(r,{...e,direction:"forward"})]}function S(r,e={}){let t=e.direction=="forward",i=Array.from(new y(r,{...e,includeSelf:t,sameIndent:!0,sameAttributes:"listItemId"}));return t?i:i.reverse()}function gi(r){return Array.from(new y(r,{direction:"forward",higherIndent:!0}))}function dt(r,e){let t=new y(r,{sameIndent:!0,sameAttributes:"listType",...e}),i=new y(r,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...e});return[...Array.from(t).reverse(),...i]}function v(r){return!y.first(r,{sameIndent:!0,sameAttributes:"listItemId"})}function Xe(r){return!y.first(r,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function N(r,e={}){r=_(r);let t=e.withNested!==!1,i=new Set;for(let n of r)for(let s of T(n,{higherIndent:t}))i.add(s);return x(i)}function Z(r){r=_(r);let e=new Set;for(let t of r)for(let i of dt(t))e.add(i);return x(e)}function Re(r,e){let t=S(r,{direction:"forward"}),i=P.next();for(let n of t)e.setAttribute("listItemId",i,n);return t}function ce(r,e,t){let i={};for(let[s,o]of e.getAttributes())s.startsWith("list")&&(i[s]=o);let n=S(r,{direction:"forward"});for(let s of n)t.setAttributes(i,s);return n}function ue(r,e,{expand:t,indentBy:i=1}={}){r=_(r);let n=t?N(r):r;for(let s of n){let o=s.getAttribute("listIndent")+i;o<0?J(s,e):e.setAttribute("listIndent",o,s)}return n}function pi(r,e){r=_(r);let t=N(r),i=new Set,n=Math.min(...t.map(o=>o.getAttribute("listIndent"))),s=new Map;for(let o of t)s.set(o,y.first(o,{lowerIndent:!0}));for(let o of t){if(i.has(o))continue;i.add(o);let l=o.getAttribute("listIndent")-1;if(l<0){J(o,e);continue}if(o.getAttribute("listIndent")==n){let a=zi(o,s.get(o),e);for(let c of a)i.add(c);if(a.length)continue}e.setAttribute("listIndent",l,o)}return x(i)}function J(r,e){r=_(r);for(let t of r)t.is("element","listItem")&&e.rename(t,"paragraph");for(let t of r)for(let i of t.getAttributeKeys())i.startsWith("list")&&e.removeAttribute(i,t);return r}function B(r){if(!r.length)return!1;let e=r[0].getAttribute("listItemId");return e?!r.some(t=>t.getAttribute("listItemId")!=e):!1}function bi(r,e){let t=[],i=Number.POSITIVE_INFINITY;for(let{node:n}of new V(r.nextSibling)){let s=n.getAttribute("listIndent");if(s==0)break;s<i&&(i=s);let o=s-i;e.setAttribute("listIndent",o,n),t.push(n)}return t}function x(r){return Array.from(r).filter(e=>e.root.rootName!=="$graveyard").sort((e,t)=>e.index-t.index)}function F(r){let e=r.document.selection.getSelectedElement();return e&&r.schema.isObject(e)&&r.schema.isBlock(e)?e:null}function re(r,e){return e.checkChild(r.parent,"listItem")&&e.checkChild(r,"$text")&&!e.isObject(r)}function z(r){return r=="numbered"||r=="customNumbered"}function zi(r,e,t){return S(e,{direction:"forward"}).pop().index>r.index?ce(r,e,t):[]}var H=class extends w{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){let e=this.editor.model,t=Qt(e.document.selection);e.change(i=>{let n=[];B(t)&&!v(t[0])?(this._direction=="forward"&&n.push(...ue(t,i)),n.push(...Re(t[0],i))):this._direction=="forward"?n.push(...ue(t,i,{expand:!0})):n.push(...pi(t,i));for(let s of n){if(!s.hasAttribute("listType"))continue;let o=y.first(s,{sameIndent:!0});o&&i.setAttribute("listType",o.getAttribute("listType"),s)}this._fireAfterExecute(n)})}_fireAfterExecute(e){this.fire("afterExecute",x(new Set(e)))}_checkEnabled(){let e=Qt(this.editor.model.document.selection),t=e[0];if(!t)return!1;if(this._direction=="backward"||B(e)&&!v(e[0]))return!0;e=N(e),t=e[0];let i=y.first(t,{sameIndent:!0});return i?i.getAttribute("listType")==t.getAttribute("listType"):!1}};function Qt(r){let e=Array.from(r.getSelectedBlocks()),t=e.findIndex(i=>!g(i));return t!=-1&&(e.length=t),e}var E=class extends w{type;_listWalkerOptions;constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){let t=this.editor.model,i=t.document,n=F(t),s=Array.from(i.selection.getSelectedBlocks()).filter(l=>t.schema.checkAttribute(l,"listType")||re(l,t.schema)),o=e.forceValue!==void 0?!e.forceValue:this.value;t.change(l=>{if(o){let a=s[s.length-1],c=S(a,{direction:"forward"}),u=[];c.length>1&&u.push(...Re(c[1],l)),u.push(...J(s,l)),u.push(...bi(a,l)),this._fireAfterExecute(u)}else if((n||i.selection.isCollapsed)&&g(s[0])){let a=dt(n||s[0],this._listWalkerOptions);for(let c of a)l.setAttributes({...e.additionalAttributes,listType:this.type},c);this._fireAfterExecute(a)}else{let a=[];for(let c of s)if(!c.hasAttribute("listType"))!c.is("element","listItem")&&re(c,t.schema)&&l.rename(c,"listItem"),l.setAttributes({...e.additionalAttributes,listIndent:0,listItemId:P.next(),listType:this.type},c),a.push(c);else for(let u of N(c,{withNested:!1}))u.getAttribute("listType")!=this.type&&(l.setAttributes({...e.additionalAttributes,listType:this.type},u),a.push(u));this._fireAfterExecute(a)}})}_fireAfterExecute(e){this.fire("afterExecute",x(new Set(e)))}_getValue(){let e=this.editor.model.document.selection,t=Array.from(e.getSelectedBlocks());if(!t.length)return!1;for(let i of t)if(i.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){let e=this.editor.model,t=e.schema,i=e.document.selection,n=Array.from(i.getSelectedBlocks());if(!n.length)return!1;if(this.value)return!0;for(let s of n)if(t.checkAttribute(s,"listType")||re(s,t))return!0;return!1}},j=class extends w{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:e=!1}={}){let t=this.editor.model,i=t.document.selection,n=[];t.change(s=>{let{firstElement:o,lastElement:l}=this._getMergeSubjectElements(i,e),a=o.getAttribute("listIndent")||0,c=l.getAttribute("listIndent"),u=l.getAttribute("listItemId");if(a!=c){let d=gi(l);n.push(...ue([l,...d],s,{indentBy:a-c,expand:a<c}))}if(e){let d=i;i.isCollapsed&&(d=s.createSelection(s.createRange(s.createPositionAt(o,"end"),s.createPositionAt(l,0)))),t.deleteContent(d,{doNotResetEntireContent:i.isCollapsed});let m=d.getLastPosition().parent,f=m.nextSibling;n.push(m),f&&f!==l&&f.getAttribute("listItemId")==u&&n.push(...ce(f,m,s))}else n.push(...ce(l,o,s));this._fireAfterExecute(n)})}_fireAfterExecute(e){this.fire("afterExecute",x(new Set(e)))}_checkEnabled(){let e=this.editor.model,t=e.document.selection,i=F(e);if(t.isCollapsed||i){let n=i||t.getFirstPosition().parent;if(!g(n))return!1;let s=this._direction=="backward"?n.previousSibling:n.nextSibling;if(!s||B([n,s]))return!1}else{let n=t.getLastPosition(),s=t.getFirstPosition();if(n.parent===s.parent||!g(n.parent))return!1}return!0}_getMergeSubjectElements(e,t){let i=this.editor.model,n=F(i),s,o;if(e.isCollapsed||n){let l=n||e.getFirstPosition().parent,a=v(l);this._direction=="backward"?(o=l,a&&!t?s=y.first(l,{sameIndent:!0,lowerIndent:!0}):s=l.previousSibling):(s=l,o=l.nextSibling)}else s=e.getFirstPosition().parent,o=e.getLastPosition().parent;return{firstElement:s,lastElement:o}}},$=class extends w{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change(t=>{let i=Re(this._getStartBlock(),t);this._fireAfterExecute(i)})}_fireAfterExecute(e){this.fire("afterExecute",x(new Set(e)))}_checkEnabled(){let e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&g(t)&&!v(t)}_getStartBlock(){let t=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?t:t.nextSibling}},de=class extends p{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(h);!e.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(n,s,o,l){s&&(n.addClass("ck-list-marker-bold",o),ee.isSafari&&!(l&&l.dataPipeline)&&n.setStyle("--ck-content-list-marker-dummy-bold","0",o))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemBold"}),t.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemBold"),e.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}},me=class extends p{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(h);!e.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(n,s,o,l){s&&(n.addClass("ck-list-marker-italic",o),ee.isSafari&&!(l&&l.dataPipeline)&&n.setStyle("--ck-content-list-marker-dummy-italic","0",o))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),t.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemItalic"),e.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}},fe=class extends p{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(h);if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;let n=Ye(e.config.get("fontSize.options"));t.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(s,o,l,a){if(o){let c=n.find(u=>u.model==o);c&&c.view&&typeof c.view!="string"?c.view.styles?(s.addClass("ck-list-marker-font-size",l),s.setStyle("--ck-content-list-marker-font-size",c.view.styles["font-size"],l)):c.view.classes&&(s.addClass(`ck-list-marker-font-size-${o}`,l),ee.isSafari&&!(a&&a.dataPipeline)&&s.setStyle("--ck-content-list-marker-dummy-font-size","0",l)):(s.addClass("ck-list-marker-font-size",l),s.setStyle("--ck-content-list-marker-font-size",o,l))}}})}afterInit(){let e=this.editor,t=e.model;if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;t.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),t.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),t.schema.addAttributeCheck(n=>{if(!n.last.getAttribute("listItemId"))return!1},"listItemFontSize"),e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:n=>n.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});let i=Ye(e.config.get("fontSize.options"));for(let n of i)n.model&&n.view&&e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:n.model},view:{name:"li",classes:`ck-list-marker-font-size-${n.model}`}})}},ge=class extends p{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(h);!e.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(n,s,o){s&&(n.addClass("ck-list-marker-color",o),n.setStyle("--ck-content-list-marker-color",s,o))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),t.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontColor"),e.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":/.*/}}}))}},pe=class extends p{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(h);!e.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(n,s,o){s&&(n.addClass("ck-list-marker-font-family",o),n.setStyle("--ck-content-list-marker-font-family",s,o))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),t.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),e.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":/.*/}}}))}},be=class extends p{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[de,me,fe,ge,pe]}constructor(e){super(e),e.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){let e=this.editor.model;e.document.registerPostFixer(t=>{let i=e.document.differ.getChanges(),n=new Set,s=!1;for(let o of i)if(o.type==="attribute")(o.attributeKey=="listItemId"||o.attributeKey=="listType"||this._isInlineOrSelectionFormatting(o.attributeKey)||Object.values(this._loadedFormatting).includes(o.attributeKey))&&(g(o.range.start.nodeAfter)?n.add(o.range.start.nodeAfter):g(o.range.start.parent)&&n.add(o.range.start.parent));else if(g(o.position.nodeAfter)&&n.add(o.position.nodeAfter),g(o.position.nodeBefore)&&n.add(o.position.nodeBefore),g(o.position.parent)&&n.add(o.position.parent),o.type=="insert"&&o.name!="$text"){let l=t.createRangeIn(o.position.nodeAfter);for(let a of l.getItems())g(a)&&n.add(a)}for(let o of n){let l=Hi(e,o,Object.keys(this._loadedFormatting));for(let[a,c]of Object.entries(l)){let u=this._loadedFormatting[a];(c&&ji(t,o,u,c)||!c&&$i(t,o,u))&&(s=!0)}}return s})}registerFormatAttribute(e,t){this._loadedFormatting[e]=t}_isInlineOrSelectionFormatting(e){return e.replace(/^selection:/,"")in this._loadedFormatting}};function Hi(r,e,t){if(v(e))return Zt(r,e,t);let i=T(e);return Zt(r,i[0],t)}function Zt(r,e,t){if(!Ki(e)||r.schema.isLimit(e))return Object.fromEntries(t.map(l=>[l]));if(e.isEmpty)return Object.fromEntries(t.map(l=>[l,e.getAttribute(`selection:${l}`)]));let i=new Set(t),n={},o=r.createRangeIn(e).getWalker({ignoreElementEnd:!0});for(let{item:l}of o){for(let a of i)if(r.schema.checkAttribute(l,a)){let c=l.getAttribute(a);c===void 0?(i.delete(a),n[a]=void 0):n[a]===void 0?n[a]=c:n[a]!==c&&(i.delete(a),n[a]=void 0)}else a in n||(n[a]=void 0);if(!i.size)break;r.schema.isLimit(l)&&o.jumpTo(r.createPositionAfter(l))}return n}function ji(r,e,t,i){let n=T(e),s=!1;for(let o of n)(!o.hasAttribute(t)||o.getAttribute(t)!==i)&&(r.setAttribute(t,i,o),s=!0);return s}function $i(r,e,t){let i=T(e),n=!1;for(let s of i)s.hasAttribute(t)&&(r.removeAttribute(t,s),n=!0);return n}function Ki(r){return["numbered","bulleted","customNumbered","customBulleted"].includes(r.getAttribute("listType"))}var he=class extends p{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return Z(e)}isFirstBlockOfListItem(e){return v(e)}isListItemBlock(e){return g(e)}expandListBlocksToCompleteItems(e,t={}){return N(e,t)}isNumberedListType(e){return z(e)}};function hi(r){return r.is("element","ol")||r.is("element","ul")}function Ie(r){return r.is("element","li")}function Ii(r){let e=0,t=r.parent;for(;t;){if(Ie(t))e++;else{let i=t.previousSibling;i&&Ie(i)&&e++}t=t.parent}return e}function wi(r,e,t,i=ft(t,e)){return r.createAttributeElement(mt(t),null,{priority:2*e/100-100,id:i})}function yi(r,e,t){return r.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:t})}function mt(r){return r=="numbered"||r=="customNumbered"?"ol":"ul"}function ft(r,e){return`list-${r}-${e}`}function L(r,e,t){let i=r.nodeBefore;if(g(i)){let n=i;for(let{node:s}of new V(n,"backward"))if(n=s,t.has(n)||(t.add(n),e.has(i)))return;e.add(n)}else{let n=r.nodeAfter;g(n)&&e.add(n)}}function Ai(r,e){let t=0,i=-1,n=null,s=!1;for(let{node:o}of r){let l=o.getAttribute("listIndent");if(l>t){let a;n===null?(n=l-t,a=t):(n>l&&(n=l),a=l-n),a>i+1&&(a=i+1),e.setAttribute("listIndent",a,o),s=!0,i=a}else n=null,t=l+1,i=l}return s}function Li(r,e,t){let i=new Set,n=!1;for(let{node:s}of r){if(i.has(s))continue;let o=s.getAttribute("listType"),l=s.getAttribute("listItemId");if(e.has(l)&&(l=P.next()),e.add(l),s.is("element","listItem")){s.getAttribute("listItemId")!=l&&(t.setAttribute("listItemId",l,s),n=!0);continue}for(let a of S(s,{direction:"forward"}))i.add(a),a.getAttribute("listType")!=o&&(l=P.next(),o=a.getAttribute("listType")),a.getAttribute("listItemId")!=l&&(t.setAttribute("listItemId",l,a),n=!0)}return n}function ki(){return(r,e,t)=>{let{writer:i,schema:n}=t;if(!e.modelRange)return;let s=Array.from(e.modelRange.getItems({shallow:!0})).filter(d=>n.checkAttribute(d,"listItemId"));if(!s.length)return;let o=e.viewItem.getAttribute("data-list-item-id")||P.next();t.consumable.consume(e.viewItem,{attributes:"data-list-item-id"});let l=Ii(e.viewItem),a=e.viewItem.parent&&e.viewItem.parent.is("element","ol")?"numbered":"bulleted",c=s[0].getAttribute("listType");c&&(a=c);let u={listItemId:o,listIndent:l,listType:a};for(let d of s)d.hasAttribute("listItemId")||i.setAttributes(u,d);s.length>1&&s[1].getAttribute("listItemId")!=u.listItemId&&t.keepEmptyElement(s[0])}}function vi(r,e,t,i){return()=>{let l=r.document.differ.getChanges(),a=[],c=new Set,u=new Set,d=new Set;for(let m of l)if(m.type=="insert"&&m.name!="$text")L(m.position,c,d),m.attributes.has("listItemId")?u.add(m.position.nodeAfter):L(m.position.getShiftedBy(m.length),c,d);else if(m.type=="remove"&&m.attributes.has("listItemId"))L(m.position,c,d);else if(m.type=="attribute"){let f=m.range.start.nodeAfter;t.includes(m.attributeKey)?(L(m.range.start,c,d),m.attributeNewValue===null?(L(m.range.start.getShiftedBy(1),c,d),s(f)&&a.push(f)):u.add(f)):g(f)&&s(f)&&a.push(f)}for(let m of c.values())a.push(...n(m,u));
1for(let m of new Set(a))e.reconvertItem(m)};function n(l,a){let c=[],u=new Set,d=[];for(let{node:m,previous:f}of new V(l)){if(u.has(m))continue;let b=m.getAttribute("listIndent");f&&b<f.getAttribute("listIndent")&&(d.length=b+1),d[b]={modelAttributes:Object.fromEntries(Array.from(m.getAttributes()).filter(([I])=>t.includes(I))),modelElement:m};let A=S(m,{direction:"forward"});for(let I of A)u.add(I),(s(I,A)||o(I,d,a))&&c.push(I)}return c}function s(l,a){let c=e.mapper.toViewElement(l);if(!c)return!1;if(i.fire("checkElement",{modelElement:l,viewElement:c}))return!0;if(!l.is("element","paragraph")&&!l.is("element","listItem"))return!1;let d=Ei(l,t,a);return d&&c.is("element","p")?!0:!!(!d&&c.is("element","span"))}function o(l,a,c){if(c.has(l))return!1;let u=e.mapper.toViewElement(l),d=a.length-1;for(let m=u.parent;!m.is("editableElement");m=m.parent){let f=Ie(m),b=hi(m);if(!b&&!f)continue;let A=`checkAttributes:${f?"item":"list"}`;if(i.fire(A,{viewElement:m,modelAttributes:a[d].modelAttributes,modelReferenceElement:a[d].modelElement}))break;if(b&&(d--,d<0))return!1}return!0}}function et(r,e,t,{dataPipeline:i}={}){let n=Qi(r);return(s,o,l)=>{let{writer:a,mapper:c,consumable:u}=l,d=o.item;if(!r.includes(o.attributeKey)||!n(d,u))return;let m={...l.options,dataPipeline:i},f=_i(d,c,t);Ci(f,a,c),Yi(f,a);let b=qi(d,f,e,a,m);Gi(d,b,e,a,m)}}function Ti(r){return(e,t,i)=>{let{writer:n,mapper:s}=i,o=e.name.split(":")[1];if(!r.checkAttribute(o,"listItemId"))return;let l=s.toViewPosition(t.position),a=t.position.getShiftedBy(t.length),c=s.toViewPosition(a,{isPhantom:!0}),d=n.createRange(l,c).getTrimmed().end.nodeBefore;d&&Ci(d,n,s)}}function tt(r,{dataPipeline:e}={}){return(t,{writer:i})=>{if(!Ei(t,r))return null;if(!e)return i.createContainerElement("span",{class:"ck-list-bogus-paragraph"});let n=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}function _i(r,e,t){let i=t.createRangeOn(r);return e.toViewRange(i).getTrimmed().end.nodeBefore}function Si(r,e){return(t,i)=>{if(i.modelPosition.offset>0)return;let n=i.modelPosition.parent;if(!g(n)||!r.some(c=>c.scope=="itemMarker"&&c.canInjectMarkerIntoElement&&c.canInjectMarkerIntoElement(n)))return;let s=i.mapper.toViewElement(n),o=e.createRangeIn(s),l=o.getWalker(),a=o.start;for(let{item:c}of l){if(c.is("element")&&i.mapper.toModelElement(c)||c.is("$textProxy"))break;c.is("element")&&c.getCustomProperty("listItemMarker")&&(a=e.createPositionAfter(c),l.skip(({previousPosition:u})=>!u.isEqual(a)))}i.viewPosition=a}}function Ci(r,e,t){for(;r.parent.is("attributeElement")&&r.parent.getCustomProperty("listItemWrapper");)e.unwrap(e.createRangeOn(r),r.parent);let i=[];n(e.createPositionBefore(r).getWalker({direction:"backward"})),n(e.createRangeIn(r).getWalker());for(let s of i)e.remove(s);function n(s){for(let{item:o}of s){if(o.is("element")&&t.toModelElement(o))break;o.is("element")&&o.getCustomProperty("listItemMarker")&&i.push(o)}}}function qi(r,e,t,i,{dataPipeline:n}){let s=i.createRangeOn(e);if(!v(r))return s;for(let o of t){if(o.scope!="itemMarker")continue;let l=o.createElement(i,r,{dataPipeline:n});if(!l||(i.setCustomProperty("listItemMarker",!0,l),o.canInjectMarkerIntoElement&&o.canInjectMarkerIntoElement(r)?i.insert(i.createPositionAt(e,0),l):(i.insert(s.start,l),s=i.createRange(i.createPositionBefore(l),i.createPositionAfter(e))),!o.createWrapperElement||!o.canWrapElement))continue;let a=o.createWrapperElement(i,r,{dataPipeline:n});i.setCustomProperty("listItemWrapper",!0,a),o.canWrapElement(r)?s=i.wrap(s,a):(s=i.wrap(i.createRangeOn(l),a),s=i.createRange(s.start,i.createPositionAfter(e)))}return s}function Yi(r,e){let t=r.parent;for(;t.is("attributeElement")&&["ul","ol","li"].includes(t.name);){let i=t.parent;e.unwrap(e.createRangeOn(r),t),t=i}}function Gi(r,e,t,i,n){if(!r.hasAttribute("listIndent"))return;let s=r.getAttribute("listIndent"),o=r;for(let l=s;l>=0;l--){let a=yi(i,l,o.getAttribute("listItemId")),c=wi(i,l,o.getAttribute("listType"));for(let u of t)(u.scope=="list"||u.scope=="item")&&o.hasAttribute(u.attributeName)&&u.setAttributeOnDowncast(i,o.getAttribute(u.attributeName),u.scope=="list"?c:a,n);if(e=i.wrap(e,a),e=i.wrap(e,c),l==0||(o=y.first(o,{lowerIndent:!0}),!o))break}}function Qi(r){return(e,t)=>{let i=[];for(let n of r)e.hasAttribute(n)&&i.push(`attribute:${n}`);return i.every(n=>t.test(e,n)!==!1)?(i.forEach(n=>t.consume(e,n)),!0):!1}}function Ei(r,e,t=T(r)){if(!g(r))return!1;for(let i of r.getAttributeKeys())if(!(i.startsWith("selection:")||i=="htmlEmptyBlock")&&!e.includes(i))return!1;return t.length<2}var le=["listType","listIndent","listItemId"],h=class extends p{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[ze,We,he,Tt,be]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){let e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new At("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:le}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"}
vendor: 68,367 bytes, line 1
1)):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(let n of le)t.schema.setAttributeProperties(n,{copyOnReplace:!0});e.commands.add("numberedList",new E(e,"numbered")),e.commands.add("bulletedList",new E(e,"bulleted")),e.commands.add("customNumberedList",new E(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new E(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new H(e,"forward")),e.commands.add("outdentList",new H(e,"backward")),e.commands.add("splitListItemBefore",new $(e,"before")),e.commands.add("splitListItemAfter",new $(e,"after")),i&&(e.commands.add("mergeListItemBackward",new j(e,"backward")),e.commands.add("mergeListItemForward",new j(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){let t=this.editor.commands,i=t.get("indent"),n=t.get("outdent");i&&i.registerChildCommand(t.get("indentList"),{priority:"high"}),n&&n.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...le,...this._downcastStrategies.map(e=>e.attributeName)]}_setupDeleteIntegration(){let e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",(n,s)=>{let o=e.model.document.selection;F(e.model)||e.model.change(()=>{let l=o.getFirstPosition();if(o.isCollapsed&&s.direction=="backward"){if(!l.isAtStart)return;let a=l.parent;if(!g(a))return;if(!y.first(a,{sameAttributes:"listType",sameIndent:!0})&&a.getAttribute("listIndent")===0)Xe(a)||e.execute("splitListItemAfter"),e.execute("outdentList");else{if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:Jt(e.model,"backward")})}s.preventDefault(),n.stop()}else{if(o.isCollapsed&&!o.getLastPosition().isAtEnd||!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:Jt(e.model,"forward")}),s.preventDefault(),n.stop()}})},{context:"li"})}_setupEnterIntegration(){let e=this.editor,t=e.model,i=e.commands,n=i.get("enter");this.listenTo(e.editing.view.document,"enter",(s,o)=>{let l=t.document,a=l.selection.getFirstPosition().parent;if(l.selection.isCollapsed&&g(a)&&a.isEmpty&&!o.isSoft){let c=v(a),u=Xe(a);c&&u?(e.execute("outdentList"),o.preventDefault(),s.stop()):c&&!u?(e.execute("splitListItemAfter"),o.preventDefault(),s.stop()):u&&(e.execute("splitListItemBefore"),o.preventDefault(),s.stop())}},{context:"li"}),this.listenTo(n,"afterExecute",()=>{let s=i.get("splitListItemBefore");if(s.refresh(),!s.isEnabled)return;let l=e.model.document.selection.getLastPosition().parent;T(l).length===2&&s.execute()})}_setupTabIntegration(){let e=this.editor;this.listenTo(e.editing.view.document,"tab",(t,i)=>{let n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(e.execute(n),i.stopPropagation(),i.preventDefault(),t.stop())},{context:"li"})}_setupConversion(){let e=this.editor,t=e.model,i=this.getListAttributeNames(),n=e.config.get("list.multiBlock"),s=n?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(l,{writer:a})=>a.createElement(s,{listType:""})}).elementToElement({view:"p",model:(l,{writer:a})=>l.parent&&l.parent.is("element","li")?a.createElement(s,{listType:""}):null,converterPriority:"high"}).add(l=>{l.on("element:li",ki())}),n||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:s,view:tt(i),converterPriority:"high"}).add(l=>{l.on("attribute",et(i,this._downcastStrategies,t)),l.on("remove",Ti(t.schema))}),e.conversion.for("dataDowncast").elementToElement({model:s,view:tt(i,{dataPipeline:!0}),converterPriority:"high"}).add(l=>{l.on("attribute",et(i,this._downcastStrategies,t,{dataPipeline:!0}))});let o=Si(this._downcastStrategies,e.editing.view);e.editing.mapper.on("modelToViewPosition",o),e.data.mapper.on("modelToViewPosition",o),this.listenTo(t.document,"change:data",vi(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",(l,{viewElement:a,modelAttributes:c})=>{a.id!=c.listItemId&&(l.return=!0,l.stop())}),this.on("checkAttributes:list",(l,{viewElement:a,modelAttributes:c})=>{(a.name!=mt(c.listType)||a.id!=ft(c.listType,c.listIndent))&&(l.return=!0,l.stop())})}_setupModelPostFixing(){let e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer(i=>Zi(e,i,t,this)),this.on("postFixer",(i,{listNodes:n,writer:s})=>{i.return=Ai(n,s)||i.return},{priority:"high"}),this.on("postFixer",(i,{listNodes:n,writer:s,seenIds:o})=>{i.return=Li(n,o,s)||i.return},{priority:"high"})}_setupClipboardIntegration(){let e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",Ji(e),{priority:"high"}),this.listenTo(t,"outputTransformation",(i,n)=>{e.change(s=>{let o=Array.from(n.content.getChildren()),l=o[o.length-1];if(o.length>1&&l.is("element")&&l.isEmpty&&o.slice(0,-1).every(g)&&s.remove(l),n.method=="copy"||n.method=="cut"){let a=Array.from(n.content.getChildren());B(a)&&J(a,s)}})})}_setupAccessibilityIntegration(){let e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(e,t,i,n){n&&(n.skipListItemIds||n.isClipboardPipeline)||e.setAttribute("data-list-item-id",t,i)}})}};function Zi(r,e,t,i){let n=r.document.differ.getChanges(),s=new Set,o=new Set,l=i.editor.config.get("list.multiBlock"),a=!1;for(let u of n){if(u.type=="insert"&&u.name!="$text"){let d=u.position.nodeAfter;if(!r.schema.checkAttribute(d,"listItemId"))for(let m of Array.from(d.getAttributeKeys()))t.includes(m)&&(e.removeAttribute(m,d),a=!0);L(u.position,o,s),u.attributes.has("listItemId")||L(u.position.getShiftedBy(u.length),o,s);for(let{item:m,previousPosition:f}of r.createRangeIn(d))g(m)&&L(f,o,s)}else u.type=="remove"?L(u.position,o,s):u.type=="attribute"&&t.includes(u.attributeKey)&&(L(u.range.start,o,s),u.attributeNewValue===null&&L(u.range.start.getShiftedBy(1),o,s));if(!l&&u.type=="attribute"&&le.includes(u.attributeKey)){let d=u.range.start.nodeAfter;u.attributeNewValue===null&&d&&d.is("element","listItem")?(e.rename(d,"paragraph"),a=!0):u.attributeOldValue===null&&d&&d.is("element")&&d.name!="listItem"&&(e.rename(d,"listItem"),a=!0)}}let c=new Set;for(let u of o.values())a=i.fire("postFixer",{listNodes:new ae(u),listHead:u,writer:e,seenIds:c})||a;return a}function Ji(r){return(e,[t,i])=>{let n=t.is("documentFragment")?Array.from(t.getChildren()):[t];if(!n.length)return;let o=(i?r.createSelection(i):r.document.selection).getFirstPosition(),l;if(g(o.parent))l=o.parent;else if(g(o.nodeBefore)&&g(o.nodeAfter))l=o.nodeBefore;else return;r.change(a=>{let c=l.getAttribute("listType"),u=l.getAttribute("listIndent"),d=n[0].getAttribute("listIndent")||0,m=Math.max(u-d,0);for(let f of n){let b=g(f);l.is("element","listItem")&&f.is("element","paragraph")&&a.rename(f,"listItem"),a.setAttributes({listIndent:(b?f.getAttribute("listIndent"):0)+m,listItemId:b?f.getAttribute("listItemId"):P.next(),listType:c},f)}})}}function Jt(r,e){let t=r.document.selection;if(!t.isCollapsed)return!F(r);if(e==="forward")return!0;let n=t.getFirstPosition().parent,s=n.previousSibling;return r.schema.isObject(s)?!1:s.isEmpty?!0:B([n,s])}function we(r,e,t,i){r.ui.componentFactory.add(e,()=>{let n=Xt(te,r,e,t,i);return n.set({tooltip:!0,isToggleable:!0}),n}),r.ui.componentFactory.add(`menuBar:${e}`,()=>{let n=Xt(Et,r,e,t,i);return n.set({role:"menuitemcheckbox",isToggleable:!0}),n})}function Xt(r,e,t,i,n){let s=e.commands.get(t),o=new r(e.locale);return o.set({label:i,icon:n}),o.bind("isOn","isEnabled").to(s,"value","isEnabled"),o.on("execute",()=>{e.execute(t),e.editing.view.focus()}),o}var K=class extends p{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||we(this.editor,"numberedList",e("Numbered List"),ne),this.editor.ui.componentFactory.has("bulletedList")||we(this.editor,"bulletedList",e("Bulleted List"),ie)}},it=class extends p{static get requires(){return[h,K]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}},ye=class extends w{refresh(){let e=this._getValue();this.value=e,this.isEnabled=e!=null}execute({startIndex:e=1}={}){let t=this.editor.model,i=t.document,n=Array.from(i.selection.getSelectedBlocks()).filter(s=>g(s)&&z(s.getAttribute("listType")));n=Z(n),t.change(s=>{for(let o of n)s.setAttribute("listStart",e>=0?e:1,o)})}_getValue(){let t=this.editor.model.document,i=C(t.selection.getSelectedBlocks());return i&&g(i)&&z(i.getAttribute("listType"))?i.getAttribute("listStart"):null}};var Vi={},Pi={},xi={},Bi=[{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(let{listStyle:r,typeAttribute:e,listType:t}of Bi)Vi[r]=t,Pi[r]=e,e&&(xi[e]=r);function gt(){return Bi.map(r=>r.listStyle)}function De(r){return Vi[r]||null}function pt(r){return xi[r]||null}function Ae(r){return Pi[r]||null}function bt(r){switch(r){case"lower-alpha":return"lower-latin";case"upper-alpha":return"upper-latin";default:return r}}var Le=class extends w{defaultType;_supportedTypes;constructor(e,t,i){super(e),this.defaultType=t,this._supportedTypes=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){let t=this.editor.model,i=t.document;t.change(n=>{this._tryToConvertItemsToList(e);let s=Array.from(i.selection.getSelectedBlocks()).filter(o=>o.hasAttribute("listType"));if(s.length){s=Z(s);for(let o of s)n.setAttribute("listStyle",e.type||this.defaultType,o)}})}isStyleTypeSupported(e){return this._supportedTypes?this._supportedTypes.includes(e):!0}_getValue(){let e=C(this.editor.model.document.selection.getSelectedBlocks());return g(e)?e.getAttribute("listStyle"):null}_checkEnabled(){let e=this.editor,t=e.commands.get("numberedList"),i=e.commands.get("bulletedList");return t.isEnabled||i.isEnabled}_tryToConvertItemsToList(e){if(!e.type)return;let t=De(e.type);if(!t)return;let i=this.editor,n=`${t}List`;i.commands.get(n).value||i.execute(n)}},ke=class extends w{refresh(){let e=this._getValue();this.value=e,this.isEnabled=e!=null}execute(e={}){let t=this.editor.model,i=t.document,n=Array.from(i.selection.getSelectedBlocks()).filter(s=>g(s)&&s.getAttribute("listType")=="numbered");n=Z(n),t.change(s=>{for(let o of n)s.setAttribute("listReversed",!!e.reversed,o)})}_getValue(){let t=this.editor.model.document,i=C(t.selection.getSelectedBlocks());return g(i)&&i.getAttribute("listType")=="numbered"?i.getAttribute("listReversed"):null}};function nt(r){return(e,t,i)=>{let{writer:n,schema:s,consumable:o}=i;if(o.test(t.viewItem,r.viewConsumables)===!1)return;t.modelRange||Object.assign(t,i.convertChildren(t.viewItem,t.modelCursor));let l=!1;for(let a of t.modelRange.getItems({shallow:!0}))s.checkAttribute(a,r.attributeName)&&r.appliesToListItem(a)&&(a.hasAttribute(r.attributeName)||(n.setAttribute(r.attributeName,r.getAttributeOnUpcast(t.viewItem),a),l=!0));l&&o.consume(t.viewItem,r.viewConsumables)}}var ve=class extends p{static get pluginName(){return"ListPropertiesUtils"}static get isOfficialPlugin(){return!0}getAllSupportedStyleTypes(){return gt()}getListTypeFromListStyleType(e){return De(e)}getListStyleTypeFromTypeAttribute(e){return pt(e)}getTypeAttributeFromListStyleType(e){return Ae(e)}};function ht(r){let{startIndex:e,reversed:t,styles:i}=r;return{styles:Xi(i),startIndex:e||!1,reversed:t||!1}}function Xi(r){let e={listTypes:["bulleted","numbered"],useAttribute:!1};return r===!0||(r?Array.isArray(r)||typeof r=="string"?e.listTypes=_(r):(e.listTypes=r.listTypes?_(r.listTypes):e.listTypes,e.useAttribute=!!r.useAttribute,r.listStyleTypes&&(e.listStyleTypes=r.listStyleTypes)):e.listTypes=[]),e}var U="default",Te=class extends p{static get requires(){return[h,ve]}static get pluginName(){return"ListPropertiesEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("list.properties",{styles:!0,startIndex:!1,reversed:!1})}init(){let e=this.editor,t=e.model,i=e.plugins.get(h),n=e.config.get("list.properties"),s=en(n);for(let o of s)o.addCommand(e),t.schema.extend("$listItem",{allowAttributes:o.attributeName}),i.registerDowncastStrategy({scope:"list",attributeName:o.attributeName,setAttributeOnDowncast(l,a,c){o.setAttributeOnDowncast(l,a,c)}});e.conversion.for("upcast").add(o=>{for(let l of s)o.on("element:ol",nt(l)),o.on("element:ul",nt(l))}),i.on("checkAttributes:list",(o,{viewElement:l,modelAttributes:a,modelReferenceElement:c})=>{for(let u of s)u.appliesToListItem(c)&&u.getAttributeOnUpcast(l)!=a[u.attributeName]&&(o.return=!0,o.stop())}),this.listenTo(e.commands.get("indentList"),"afterExecute",(o,l)=>{t.change(a=>{for(let c of l)for(let u of s)u.appliesToListItem(c)&&a.setAttribute(u.attributeName,u.defaultValue,c)})}),i.on("postFixer",(o,{listNodes:l,writer:a})=>{for(let{node:c}of l)for(let u of s)u.hasValidAttribute(c)||(u.appliesToListItem(c)?a.setAttribute(u.attributeName,u.defaultValue,c):a.removeAttribute(u.attributeName,c),o.return=!0)}),i.on("postFixer",(o,{listNodes:l,writer:a})=>{for(let{node:c,previousNodeInList:u}of l)if(u&&u.getAttribute("listType")==c.getAttribute("listType"))for(let d of s){let{attributeName:m}=d;if(!d.appliesToListItem(c))continue;let f=u.getAttribute(m);c.getAttribute(m)!=f&&(a.setAttribute(m,f,c),o.return=!0)}})}};function en(r){let e=[],t=ht(r);if(r.styles){let i=t.styles.useAttribute;e.push({attributeName:"listStyle",defaultValue:U,viewConsumables:{styles:"list-style-type"},addCommand(n){let s=gt();i&&(s=s.filter(o=>!!Ae(o))),n.commands.add("listStyle",new Le(n,U,s))},appliesToListItem(n){return n.getAttribute("listType")=="numbered"||n.getAttribute("listType")=="bulleted"},hasValidAttribute(n){if(!this.appliesToListItem(n))return!n.hasAttribute("listStyle");if(!n.hasAttribute("listStyle"))return!1;let s=n.getAttribute("listStyle");return s==U?!0:De(s)==n.getAttribute("listType")},setAttributeOnDowncast(n,s,o){if(s&&s!==U)if(i){let l=Ae(s);if(l){n.setAttribute("type",l,o);return}}else{n.setStyle("list-style-type",s,o);return}n.removeStyle("list-style-type",o),n.removeAttribute("type",o)},getAttributeOnUpcast(n){let s=n.getStyle("list-style-type");if(s)return bt(s);let o=n.getAttribute("type");return o?pt(o):U}})}return r.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(i){i.commands.add("listReversed",new ke(i))},appliesToListItem(i){return i.getAttribute("listType")=="numbered"},hasValidAttribute(i){return this.appliesToListItem(i)==i.hasAttribute("listReversed")},setAttributeOnDowncast(i,n,s){n?i.setAttribute("reversed","reversed",s):i.removeAttribute("reversed",s)},getAttributeOnUpcast(i){return i.hasAttribute("reversed")}}),r.startIndex&&e.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(i){i.commands.add("listStart",new ye(i))},appliesToListItem(i){return z(i.getAttribute("listType"))},hasValidAttribute(i){return this.appliesToListItem(i)==i.hasAttribute("listStart")},setAttributeOnDowncast(i,n,s){n==0||n>1?i.setAttribute("start",n,s):i.removeAttribute("start",s)},getAttributeOnUpcast(i){let n=i.getAttribute("start");return n>=0?n:1}}),e}var q=class extends Ge{children;stylesView=null;additionalPropertiesCollapsibleView=null;startIndexFieldView=null;reversedSwitchButtonView=null;focusTracker=new He;keystrokes=new je;focusables=new Bt;focusCycler;constructor(e,{enabledProperties:t,styleButtonViews:i,styleGridAriaLabel:n}){super(e);let s=["ck","ck-list-properties"];this.children=this.createCollection(),this.focusCycler=new St({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),i&&i.length?(this.stylesView=this._createStylesView(i,n),this.children.add(this.stylesView)):s.push("ck-list-properties_without-styles"),(t.startIndex||t.reversed)&&(this._addNumberedListPropertyViews(t),s.push("ck-list-properties_with-numbered-properties")),this.setTemplate({tag:"div",attributes:{class:s},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(let e of this.stylesView.children)this.stylesView.focusTracker.add(e.element);Ft({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>kt.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);let e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}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(e,t){let i=new Ge(this.locale);return i.children=i.createCollection(),i.children.addMany(e),i.setTemplate({tag:"div",attributes:{"aria-label":t,class:["ck","ck-list-styles-list"]},children:i.children}),i.children.delegate("execute").to(this),i.focus=function(){for(let n of this.children)if(n instanceof te&&n.isOn){n.focus();return}this.children.first.focus()},i.focusTracker=new He,i.keystrokes=new je,i.render(),i.keystrokes.listenTo(i.element),i}_addNumberedListPropertyViews(e){let t=this.locale.t,i=[];e.startIndex&&(this.startIndexFieldView=this._createStartIndexField(),i.push(this.startIndexFieldView)),e.reversed&&(this.reversedSwitchButtonView=this._createReversedSwitchButton(),i.push(this.reversedSwitchButtonView)),this.stylesView?(this.additionalPropertiesCollapsibleView=new _t(this.locale,i),this.additionalPropertiesCollapsibleView.set({label:t("List properties"),isCollapsed:!0}),this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(i,"isEnabled",(...n)=>n.some(s=>s)),this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",(n,s,o)=>{o||(this.additionalPropertiesCollapsibleView.isCollapsed=!0)}),this.children.add(this.additionalPropertiesCollapsibleView)):this.children.addMany(i)}_createStartIndexField(){let e=this.locale.t,t=new Ct(this.locale,Mt);return t.set({label:e("Start at"),class:"ck-numbered-list-properties__start-index"}),t.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"}),t.fieldView.on("input",()=>{let i=t.fieldView.element,n=i.valueAsNumber;if(Number.isNaN(n)){t.errorText=e("Invalid start index value.");return}i.checkValidity()?this.fire("listStart",{startIndex:n}):t.errorText=e("Start index must be greater than 0.")}),t}_createReversedSwitchButton(){let e=this.locale.t,t=new xt(this.locale);return t.set({withText:!0,label:e("Reversed order"),class:"ck-numbered-list-properties__reversed-order"}),t.delegate("execute").to(this,"listReversed"),t}},Y=class extends p{static get pluginName(){return"ListPropertiesUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=e.config.get("list.properties"),n=ht(i),s=n.styles.listTypes;if(s.includes("bulleted")){let o=[{label:t("Toggle the disc list style"),tooltip:t("Disc"),type:"disc",icon:Wt},{label:t("Toggle the circle list style"),tooltip:t("Circle"),type:"circle",icon:Dt},{label:t("Toggle the square list style"),tooltip:t("Square"),type:"square",icon:jt}],l=t("Bulleted List"),a=t("Bulleted list styles toolbar"),c="bulletedList";e.ui.componentFactory.add(c,ei({editor:e,normalizedConfig:n,parentCommandName:c,buttonLabel:l,buttonIcon:ie,styleGridAriaLabel:a,styleDefinitions:o})),e.ui.componentFactory.add(`menuBar:${c}`,ti({editor:e,normalizedConfig:n,parentCommandName:c,buttonLabel:l,styleGridAriaLabel:a,styleDefinitions:o}))}if(s.includes("numbered")||i.startIndex||i.reversed){let o=[{label:t("Toggle the decimal list style"),tooltip:t("Decimal"),type:"decimal",icon:Nt},{label:t("Toggle the decimal with leading zero list style"),tooltip:t("Decimal with leading zero"),type:"decimal-leading-zero",icon:Ut},{label:t("Toggle the lower\u2013roman list style"),tooltip:t("Lower\u2013roman"),type:"lower-roman",icon:Ht},{label:t("Toggle the upper\u2013roman list style"),tooltip:t("Upper-roman"),type:"upper-roman",icon:Kt},{label:t("Toggle the lower\u2013latin list style"),tooltip:t("Lower-latin"),type:"lower-latin",icon:zt},{label:t("Toggle the upper\u2013latin list style"),tooltip:t("Upper-latin"),type:"upper-latin",icon:$t}],l=t("Numbered List"),a=t("Numbered list styles toolbar"),c="numberedList";e.ui.componentFactory.add(c,ei({editor:e,normalizedConfig:n,parentCommandName:c,buttonLabel:l,buttonIcon:ne,styleGridAriaLabel:a,styleDefinitions:o})),s.includes("numbered")&&e.ui.componentFactory.add(`menuBar:${c}`,ti({editor:e,normalizedConfig:n,parentCommandName:c,buttonLabel:l,styleGridAriaLabel:a,styleDefinitions:o}))}}};function ei({editor:r,normalizedConfig:e,parentCommandName:t,buttonLabel:i,buttonIcon:n,styleGridAriaLabel:s,styleDefinitions:o}){let l=r.commands.get(t);return a=>{let c=Ot(a,Pt),u=c.buttonView;return c.bind("isEnabled").to(l),c.class="ck-list-styles-dropdown",u.on("execute",()=>{r.execute(t),r.editing.view.focus()}),u.set({label:i,icon:n,tooltip:!0,isToggleable:!0}),u.bind("isOn").to(l,"value",d=>!!d),c.once("change:isOpen",()=>{let d=tn({editor:r,normalizedConfig:e,dropdownView:c,parentCommandName:t,styleGridAriaLabel:s,styleDefinitions:o});c.panelView.children.add(d)}),c.on("execute",()=>{r.editing.view.focus()}),c}}function Fi({editor:r,listStyleCommand:e,parentCommandName:t}){let i=r.locale,n=r.commands.get(t);return({label:s,type:o,icon:l,tooltip:a})=>{let c=new te(i);return c.set({label:s,icon:l,tooltip:a}),c.bind("isOn").to(e,"value",u=>u===o),c.on("execute",()=>{n.value?e.value===o?r.execute(t):e.value!==o&&r.execute("listStyle",{type:o}):r.model.change(()=>{r.execute("listStyle",{type:o})})}),c}}function tn({editor:r,normalizedConfig:e,dropdownView:t,parentCommandName:i,styleDefinitions:n,styleGridAriaLabel:s}){let o=r.locale,l={...e,...i!="numberedList"?{startIndex:!1,reversed:!1}:null},a=i.replace("List",""),c=null;if(e.styles.listTypes.includes(a)){let d=r.commands.get("listStyle"),m=Fi({editor:r,parentCommandName:i,listStyleCommand:d}),f=e.styles.listStyleTypes,b=n;if(f){let I=f[a];I&&(b=n.filter(X=>I.includes(X.type)))}let A=Oi(d);c=b.filter(A).map(m)}let u=new q(o,{styleGridAriaLabel:s,enabledProperties:l,styleButtonViews:c});if(e.styles.listTypes.includes(a)&&Rt(t,()=>u.stylesView.children.find(d=>d.isOn)),l.startIndex){let d=r.commands.get("listStart");u.startIndexFieldView.bind("isEnabled").to(d),u.startIndexFieldView.fieldView.bind("value").to(d),u.on("listStart",(m,f)=>r.execute("listStart",f))}if(l.reversed){let d=r.commands.get("listReversed");u.reversedSwitchButtonView.bind("isEnabled").to(d),u.reversedSwitchButtonView.bind("isOn").to(d,"value",m=>!!m),u.on("listReversed",()=>{let m=d.value;r.execute("listReversed",{reversed:!m})})}return u.delegate("execute").to(t),u}function ti({editor:r,normalizedConfig:e,parentCommandName:t,buttonLabel:i,styleGridAriaLabel:n,styleDefinitions:s}){return o=>{let l=new Vt(o),a=r.commands.get(t),c=r.commands.get("listStyle"),u=Oi(c),d=Fi({editor:r,parentCommandName:t,listStyleCommand:c}),m=e.styles.listStyleTypes,f=s;if(m){let I=a.type,X=m[I];X&&(f=s.filter(Wi=>X.includes(Wi.type)))}let b=f.filter(u).map(d),A=new q(o,{styleGridAriaLabel:n,enabledProperties:{...e,startIndex:!1,reversed:!1},styleButtonViews:b});return A.delegate("execute").to(l),l.buttonView.set({label:i,icon:t==="bulletedList"?ie:ne}),l.panelView.children.add(A),l.bind("isEnabled").to(a,"isEnabled"),l.on("execute",()=>{r.editing.view.focus()}),l}}function Oi(r){return typeof r.isStyleTypeSupported=="function"?e=>r.isStyleTypeSupported(e.type):()=>!0}var st=class extends p{static get requires(){return[Te,Y]}static get pluginName(){return"ListProperties"}static get isOfficialPlugin(){return!0}},_e=class extends w{constructor(e){super(e),this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){let e=this._getSelectedItems();this.value=this._getValue(e),this.isEnabled=!!e.length}execute(e={}){this.editor.model.change(t=>{let i=this._getSelectedItems(),n=e.forceValue===void 0?!this._getValue(i):e.forceValue;for(let s of i)n?t.setAttribute("todoListChecked",!0,s):t.removeAttribute("todoListChecked",s)})}_getValue(e){return e.every(t=>t.getAttribute("todoListChecked"))}_getSelectedItems(){let e=this.editor.model,t=e.schema,i=e.document.selection.getFirstRange(),n=i.start.parent,s=[];t.checkAttribute(n,"todoListChecked")&&s.push(...T(n));for(let o of i.getItems({shallow:!0}))t.checkAttribute(o,"todoListChecked")&&!s.includes(o)&&s.push(...T(o));return s}},Se=class extends Yt{domEventType=["change"];onDomEvent(e){if(e.target){let t=this.view.domConverter.mapDomToView(e.target);t&&t.is("element","input")&&t.getAttribute("type")=="checkbox"&&t.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",e)}}},nn=qe("Ctrl+Enter"),Ce=class extends p{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[h]}init(){let e=this.editor,t=e.model,i=e.editing,n=e.plugins.get(h),o=e.config.get("list.multiBlock")?"paragraph":"listItem";e.commands.add("todoList",new E(e,"todo")),e.commands.add("checkTodoList",new _e(e)),i.view.addObserver(Se),t.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),t.schema.addAttributeCheck(l=>{let a=l.last;if(!a.getAttribute("listItemId")||a.getAttribute("listType")!="todo")return!1},"todoListChecked"),e.conversion.for("upcast").add(l=>{l.on("element:input",on()),l.on("element:li",sn(),{priority:"low"}),l.on("element:label",Je({name:"label",classes:"todo-list__label"})),l.on("element:label",Je({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),l.on("element:span",Je({name:"span",classes:"todo-list__label__description"})),l.on("element:ul",rn({name:"ul",classes:"todo-list"}))}),e.conversion.for("downcast").elementToElement({model:o,view:(l,{writer:a})=>{if(se(l,n.getListAttributeNames()))return a.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),n.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(l,a,c){a=="todo"?l.addClass("todo-list",c):l.removeClass("todo-list",c)}}),n.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(l,a,{dataPipeline:c}){if(a.getAttribute("listType")!="todo")return null;let u=l.createUIElement("input",{type:"checkbox",...a.getAttribute("todoListChecked")?{checked:"checked"}:null,...c?{disabled:"disabled"}:{tabindex:"-1"}});if(c)return u;let d=l.createContainerElement("span",{contenteditable:"false"},u);return d.getFillerOffset=()=>null,d},canWrapElement(l){return se(l,n.getListAttributeNames())},createWrapperElement(l,a,{dataPipeline:c}){let u=["todo-list__label"];return se(a,n.getListAttributeNames())||u.push("todo-list__label_without-description"),l.createAttributeElement(c?"label":"span",{class:u.join(" ")})}}),n.on("checkElement",(l,{modelElement:a,viewElement:c})=>{let u=se(a,n.getListAttributeNames());c.hasClass("todo-list__label__description")!=u&&(l.return=!0,l.stop())}),n.on("checkElement",(l,{modelElement:a,viewElement:c})=>{let u=a.getAttribute("listType")=="todo"&&v(a),d=!1,m=e.editing.view.createPositionBefore(c).getWalker({direction:"backward"});for(let{item:f}of m){if(f.is("element")&&e.editing.mapper.toModelElement(f))break;f.is("element","input")&&f.getAttribute("type")=="checkbox"&&(d=!0)}d!=u&&(l.return=!0,l.stop())}),n.on("postFixer",(l,{listNodes:a,writer:c})=>{for(let{node:u,previousNodeInList:d}of a){if(!d||d.getAttribute("listItemId")!=u.getAttribute("listItemId"))continue;let m=d.hasAttribute("todoListChecked"),f=u.hasAttribute("todoListChecked");f&&!m?(c.removeAttribute("todoListChecked",u),l.return=!0):!f&&m&&(c.setAttribute("todoListChecked",!0,u),l.return=!0)}}),t.document.registerPostFixer(l=>{let a=t.document.differ.getChanges(),c=!1;for(let u of a)if(u.type=="attribute"&&u.attributeKey=="listType"){let d=u.range.start.nodeAfter;u.attributeOldValue=="todo"&&d.hasAttribute("todoListChecked")&&(l.removeAttribute("todoListChecked",d),c=!0)}else if(u.type=="insert"&&u.name!="$text")for(let{item:d}of l.createRangeOn(u.position.nodeAfter))d.is("element")&&d.getAttribute("listType")!="todo"&&d.hasAttribute("todoListChecked")&&(l.removeAttribute("todoListChecked",d),c=!0);return c}),this.listenTo(i.view.document,"keydown",(l,a)=>{$e(a)===nn&&(e.execute("checkTodoList"),l.stop())},{priority:"high"}),this.listenTo(i.view.document,"todoCheckboxChange",(l,a)=>{let c=a.target;if(!c||!c.is("element","input"))return;let u=i.view.createPositionAfter(c),m=i.mapper.toModelPosition(u).parent;m&&g(m)&&m.getAttribute("listType")=="todo"&&this._handleCheckmarkChange(m)}),this.listenTo(i.view.document,"arrowKey",an(t,e.locale),{context:"$text"}),this.listenTo(i.mapper,"viewToModelPosition",(l,a)=>{let c=a.viewPosition.parent,u=c.is("attributeElement","li")&&a.viewPosition.offset==0,d=ii(c)&&a.viewPosition.offset<=1,m=c.is("element","span")&&c.getAttribute("contenteditable")=="false"&&ii(c.parent);if(!u&&!d&&!m)return;let f=a.modelPosition.nodeAfter;f&&f.getAttribute("listType")=="todo"&&(a.modelPosition=t.createPositionAt(f,0))},{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(e){let t=this.editor,i=t.model,n=Array.from(i.document.selection.getRanges());i.change(s=>{s.setSelection(e,"end"),t.execute("checkTodoList"),s.setSelection(n)})}_initAriaAnnouncements(){let{model:e,ui:t,t:i}=this.editor,n=null;t&&e.document.selection.on("change:range",()=>{let s=e.document.selection.focus.parent,o=ni(n),l=ni(s);o&&!l?t.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!o&&l&&t.ariaLiveAnnouncer.announce(i("Entering a to-do list")),n=s})}};function sn(){return(r,e,t)=>{let{writer:i,schema:n}=t;if(!e.modelRange)return;let s=Array.from(e.modelRange.getItems({shallow:!0})).filter(o=>o.getAttribute("listType")==="todo"&&n.checkAttribute(o,"listItemId")).reduce((o,l)=>{let a=l.getAttribute("listItemId");return o.has(a)||o.set(a,T(l)),o},new Map);for(let[,o]of s.entries())if(o.some(l=>l.getAttribute("todoListChecked")))for(let l of o)i.setAttribute("todoListChecked",!0,l)}}function on(){return(r,e,t)=>{let i=e.modelCursor,n=i.parent,s=e.viewItem;if(!t.consumable.test(s,{name:!0})||s.getAttribute("type")!="checkbox"||!i.isAtStart||!n.hasAttribute("listType"))return;t.consumable.consume(s,{name:!0});let o=t.writer;o.setAttribute("listType","todo",n),e.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,n),e.modelRange=o.createRange(i)}}function Je(r){let e=new Qe(r);return(t,i,n)=>{let s=e.match(i.viewItem);s&&n.consumable.consume(i.viewItem,s.match)&&Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor))}}function rn(r){let e=new Qe(r);return(t,i,n)=>{let s=e.match(i.viewItem);if(!s)return;let o=s.match;o.name=!1,n.consumable.consume(i.viewItem,o)}}function se(r,e){return(r.is("element","paragraph")||r.is("element","listItem"))&&r.getAttribute("listType")=="todo"&&v(r)&&ln(r,e)}function ln(r,e){for(let t of r.getAttributeKeys())if(!t.startsWith("selection:")&&!e.includes(t))return!1;return!0}function an(r,e){return(t,i)=>{let n=Ke(i.keyCode,e.contentLanguageDirection),s=r.schema,o=r.document.selection;if(!o.isCollapsed)return;let l=o.getFirstPosition(),a=l.parent;if(n=="right"&&l.isAtEnd){let c=s.getNearestSelectionRange(r.createPositionAfter(a),"forward");if(!c)return;let u=c.start.parent;u&&g(u)&&u.getAttribute("listType")=="todo"&&(r.change(d=>d.setSelection(c)),i.preventDefault(),i.stopPropagation(),t.stop())}else if(n=="left"&&l.isAtStart&&g(a)&&a.getAttribute("listType")=="todo"){let c=s.getNearestSelectionRange(r.createPositionBefore(a),"backward");if(!c)return;r.change(u=>u.setSelection(c)),i.preventDefault(),i.stopPropagation(),t.stop()}}}function ii(r){return!!r&&r.is("attributeElement")&&r.hasClass("todo-list__label")}function ni(r){return!r||!r.is("element","paragraph")&&!r.is("element","listItem")?!1:r.getAttribute("listType")=="todo"}var G=class extends p{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.t;we(this.editor,"todoList",e("To-do List"),qt)}},ot=class extends p{static get requires(){return[Ce,G]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}},O=class extends w{type;constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){let t=this.editor.model,i=t.document,n=Array.from(i.selection.getSelectedBlocks()).filter(o=>oi(o,t.schema)),s=e.forceValue!==void 0?!e.forceValue:this.value;t.change(o=>{if(s){let l=n[n.length-1].nextSibling,a=Number.POSITIVE_INFINITY,c=[];for(;l&&l.name=="listItem"&&l.getAttribute("listIndent")!==0;){let u=l.getAttribute("listIndent");u<a&&(a=u);let d=u-a;c.push({element:l,listIndent:d}),l=l.nextSibling}c=c.reverse();for(let u of c)o.setAttribute("listIndent",u.listIndent,u.element)}if(!s){let l=Number.POSITIVE_INFINITY;for(let a of n)a.is("element","listItem")&&a.getAttribute("listIndent")<l&&(l=a.getAttribute("listIndent"));l=l===0?1:l,si(n,!0,l),si(n,!1,l)}for(let l of n.reverse())s&&l.name=="listItem"?o.rename(l,"paragraph"):!s&&l.name!="listItem"?(o.setAttributes({listType:this.type,listIndent:0},l),o.rename(l,"listItem")):!s&&l.name=="listItem"&&l.getAttribute("listType")!=this.type&&o.setAttribute("listType",this.type,l);this.fire("_executeCleanup",n)})}_getValue(){let e=C(this.editor.model.document.selection.getSelectedBlocks());return!!e&&e.is("element","listItem")&&e.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;let e=this.editor.model.document.selection,t=this.editor.model.schema,i=C(e.getSelectedBlocks());return i?oi(i,t):!1}};function si(r,e,t){let i=e?r[0]:r[r.length-1];if(i.is("element","listItem")){let n=i[e?"previousSibling":"nextSibling"],s=i.getAttribute("listIndent");for(;n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=t;)s>n.getAttribute("listIndent")&&(s=n.getAttribute("listIndent")),n.getAttribute("listIndent")==s&&r[e?"unshift":"push"](n),n=n[e?"previousSibling":"nextSibling"]}}function oi(r,e){return e.checkChild(r.parent,"listItem")&&!e.isObject(r)}var Q=class extends w{_indentBy;constructor(e,t){super(e),this._indentBy=t=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){let e=this.editor.model,t=e.document,i=Array.from(t.selection.getSelectedBlocks());e.change(n=>{let s=i[i.length-1],o=s.nextSibling;for(;o&&o.name=="listItem"&&o.getAttribute("listIndent")>s.getAttribute("listIndent");)i.push(o),o=o.nextSibling;this._indentBy<0&&(i=i.reverse());for(let l of i){let a=l.getAttribute("listIndent")+this._indentBy;a<0?n.rename(l,"paragraph"):n.setAttribute("listIndent",a,l)}this.fire("_executeCleanup",i)})}_checkEnabled(){let e=C(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){let t=e.getAttribute("listIndent"),i=e.getAttribute("listType"),n=e.previousSibling;for(;n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=t;){if(n.getAttribute("listIndent")==t)return n.getAttribute("listType")==i;n=n.previousSibling}return!1}return!0}};function cn(r){let e=r.createContainerElement("li");return e.getFillerOffset=mn,e}function It(r,e){let t=e.mapper,i=e.writer,n=r.getAttribute("listType")=="numbered"?"ol":"ul",s=cn(i),o=i.createContainerElement(n,null);return i.insert(i.createPositionAt(o,0),s),t.bindElements(r,s),s}function Ne(r,e,t,i){let n=e.parent,s=t.mapper,o=t.writer,l=s.toViewPosition(i.createPositionBefore(r)),a=M(r.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:r.getAttribute("listIndent")}),c=r.previousSibling;if(a&&a.getAttribute("listIndent")==r.getAttribute("listIndent")){let u=s.toViewElement(a);l=o.breakContainer(o.createPositionAfter(u))}else if(c&&c.name=="listItem"){l=s.toViewPosition(i.createPositionAt(c,"end"));let u=s.findMappedViewAncestor(l),d=Mi(u);d?l=o.createPositionBefore(d):l=o.createPositionAt(u,"end")}else l=s.toViewPosition(i.createPositionBefore(r));if(l=wt(l),o.insert(l,n),c&&c.name=="listItem"){let u=s.toViewElement(c),m=o.createRange(o.createPositionAt(u,0),l).getWalker({ignoreElementEnd:!0});for(let f of m)if(f.item.is("element","li")){let b=o.breakContainer(o.createPositionBefore(f.item)),A=f.item.parent,I=o.createPositionAt(e,"end");k(o,I.nodeBefore,I.nodeAfter),o.move(o.createRangeOn(A),I),m._position=b}}else{let u=n.nextSibling;if(u&&(u.is("element","ul")||u.is("element","ol"))){let d=null;for(let m of u.getChildren()){let f=s.toModelElement(m);if(f&&f.getAttribute("listIndent")>r.getAttribute("listIndent"))d=m;else break}d&&(o.breakContainer(o.createPositionAfter(d)),o.move(o.createRangeOn(d.parent),o.createPositionAt(e,"end")))}}k(o,n,n.nextSibling),k(o,n.previousSibling,n)}function k(r,e,t){return!e||!t||e.name!="ul"&&e.name!="ol"||e.name!=t.name||e.getAttribute("class")!==t.getAttribute("class")?null:r.mergeContainers(r.createPositionAfter(e))}function wt(r){return r.getLastMatchingPosition(e=>e.item.is("uiElement"))}function M(r,e){let t=!!e.sameIndent,i=!!e.smallerIndent,n=e.listIndent,s=r;for(;s&&s.name=="listItem";){let o=s.getAttribute("listIndent");if(t&&n==o||i&&n>o)return s;e.direction==="forward"?s=s.nextSibling:s=s.previousSibling}return null}function Mi(r){for(let e of r.getChildren())if(e.name=="ul"||e.name=="ol")return e;return null}function Ee(r,e){let t=[],i=r.parent,n={ignoreElementEnd:!1,startPosition:r,shallow:!0,direction:e},s=i.getAttribute("listIndent"),o=[...new Ze(n)].filter(l=>l.item.is("element")).map(l=>l.item);for(let l of o){if(!l.is("element","listItem")||l.getAttribute("listIndent")<s)break;if(!(l.getAttribute("listIndent")>s)){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;e==="backward"?t.unshift(l):t.push(l)}}return t}function Ue(r){let t=[...r.document.selection.getSelectedBlocks()].filter(i=>i.is("element","listItem")).map(i=>{let n=r.change(s=>s.createPositionAt(i,0));return[...Ee(n,"backward"),...Ee(n,"forward")]}).flat();return t=[...new Set(t)],t}var un=["disc","circle","square"],dn=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function Ri(r){return un.includes(r)?"bulleted":dn.includes(r)?"numbered":null}function mn(){let r=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||r?0:Gt.call(this)}var Ve=class extends p{static get pluginName(){return"LegacyListUtils"}static get isOfficialPlugin(){return!0}getListTypeFromListStyleType(e){return Ri(e)}getSelectedListItems(e){return Ue(e)}getSiblingNodes(e,t){return Ee(e,t)}};function ri(r){return(e,t,i)=>{let n=i.consumable;if(!n.test(t.item,"insert")||!n.test(t.item,"attribute:listType")||!n.test(t.item,"attribute:listIndent"))return;n.consume(t.item,"insert"),n.consume(t.item,"attribute:listType"),n.consume(t.item,"attribute:listIndent");let s=t.item,o=It(s,i);Ne(s,o,i,r)}}function fn(r){return(e,t,i)=>{let o=i.mapper.toViewPosition(t.position).getLastMatchingPosition(f=>!f.item.is("element","li")).nodeAfter,l=i.writer;l.breakContainer(l.createPositionBefore(o)),l.breakContainer(l.createPositionAfter(o));let a=o.parent,c=a.previousSibling,u=l.createRangeOn(a),d=l.remove(u);c&&c.nextSibling&&k(l,c,c.nextSibling);let m=i.mapper.toModelElement(o);Di(m.getAttribute("listIndent")+1,t.position,u.start,o,i,r);for(let f of l.createRangeIn(d).getItems())i.mapper.unbindViewElement(f);e.stop()}}var gn=(r,e,t)=>{if(!t.consumable.test(e.item,r.name))return;let i=t.mapper.toViewElement(e.item),n=t.writer;n.breakContainer(n.createPositionBefore(i)),n.breakContainer(n.createPositionAfter(i));let s=i.parent,o=e.attributeNewValue=="numbered"?"ol":"ul";n.rename(o,s)},pn=(r,e,t)=>{t.consumable.consume(e.item,r.name);let n=t.mapper.toViewElement(e.item).parent,s=t.writer;k(s,n,n.nextSibling),k(s,n.previousSibling,n)};function bn(r){return(e,t,i)=>{if(!i.consumable.consume(t.item,"attribute:listIndent"))return;let n=i.mapper.toViewElement(t.item),s=i.writer;s.breakContainer(s.createPositionBefore(n)),s.breakContainer(s.createPositionAfter(n));let o=n.parent,l=o.previousSibling,a=s.createRangeOn(o);s.remove(a),l&&l.nextSibling&&k(s,l,l.nextSibling),Di(t.attributeOldValue+1,t.range.start,a.start,n,i,r),Ne(t.item,n,i,r);for(let c of t.item.getChildren())i.consumable.consume(c,"insert")}}var li=(r,e,t)=>{if(t.consumable.test(e.item,r.name)&&e.item.name!="listItem"){let i=t.mapper.toViewPosition(e.range.start),n=t.writer,s=[];for(;(i.parent.name=="ul"||i.parent.name=="ol")&&(i=n.breakContainer(i),i.parent.name=="li");){let o=i,l=n.createPositionAt(i.parent,"end");if(!o.isEqual(l)){let a=n.remove(n.createRange(o,l));s.push(a)}i=n.createPositionAfter(i.parent)}if(s.length>0){for(let o=0;o<s.length;o++){let l=i.nodeBefore;if(i=n.insert(i,s[o]).end,o>0){let c=k(n,l,l.nextSibling);c&&c.parent==l&&i.offset--}}k(n,i.nodeBefore,i.nodeAfter)}}},hn=(r,e,t)=>{let i=t.mapper.toViewPosition(e.position),n=i.nodeBefore,s=i.nodeAfter;k(t.writer,n,s)},In=(r,e,t)=>{if(t.consumable.consume(e.viewItem,{name:!0})){let i=t.writer,n=i.createElement("listItem"),s=Tn(e.viewItem);i.setAttribute("listIndent",s,n);let o=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";if(i.setAttribute("listType",o,n),!t.safeInsert(n,e.modelCursor))return;let l=kn(n,e.viewItem.getChildren(),t);e.modelRange=i.createRange(e.modelCursor,l),t.updateConversionResult(n,e)}},ai=(r,e,t)=>{if(t.consumable.test(e.viewItem,{name:!0})){let i=Array.from(e.viewItem.getChildren());for(let n of i)!(n.is("element","li")||R(n))&&n._remove()}},wn=(r,e,t)=>{if(t.consumable.test(e.viewItem,{name:!0})){if(e.viewItem.childCount===0)return;let i=[...e.viewItem.getChildren()],n=!1;for(let s of i)n&&!R(s)&&s._remove(),R(s)&&(n=!0)}};function ci(r){return(e,t)=>{if(t.isPhantom)return;let i=t.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){let n=t.mapper.toViewElement(i),s=n.getAncestors().find(R),o=r.createPositionAt(n,0).getWalker();for(let l of o)if(l.type=="elementStart"&&l.item.is("element","li")){t.viewPosition=l.previousPosition;break}else if(l.type=="elementEnd"&&l.item==s){t.viewPosition=l.nextPosition;break}}}}function yn(r){return(e,t)=>{let i=t.viewPosition,n=i.parent,s=t.mapper;if(n.name=="ul"||n.name=="ol"){if(i.isAtEnd){let o=s.toModelElement(i.nodeBefore),l=s.getModelLength(i.nodeBefore);t.modelPosition=r.createPositionBefore(o).getShiftedBy(l)}else{let o=s.toModelElement(i.nodeAfter);t.modelPosition=r.createPositionBefore(o)}e.stop()}else if(n.name=="li"&&i.nodeBefore&&(i.nodeBefore.name=="ul"||i.nodeBefore.name=="ol")){let o=s.toModelElement(n),l=1,a=i.nodeBefore;for(;a&&R(a);)l+=s.getModelLength(a),a=a.previousSibling;t.modelPosition=r.createPositionBefore(o).getShiftedBy(l),e.stop()}}}function An(r,e){let t=r.document.differ.getChanges(),i=new Map,n=!1;for(let a of t)if(a.type=="insert"&&a.name=="listItem")s(a.position);else if(a.type=="insert"&&a.name!="listItem"){if(a.name!="$text"){let u=a.position.nodeAfter;u.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",u),n=!0),u.hasAttribute("listType")&&(e.removeAttribute("listType",u),n=!0),u.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",u),n=!0),u.hasAttribute("listReversed")&&(e.removeAttribute("listReversed",u),n=!0),u.hasAttribute("listStart")&&(e.removeAttribute("listStart",u),n=!0);for(let d of Array.from(r.createRangeIn(u)).filter(m=>m.item.is("element","listItem")))s(d.previousPosition)}let c=a.position.getShiftedBy(a.length);s(c)}else a.type=="remove"&&a.name=="listItem"?s(a.position):(a.type=="attribute"&&a.attributeKey=="listIndent"||a.type=="attribute"&&a.attributeKey=="listType")&&s(a.range.start);for(let a of i.values())o(a),l(a);return n;function s(a){let c=a.nodeBefore;if(!c||!c.is("element","listItem")){let u=a.nodeAfter;u&&u.is("element","listItem")&&i.set(u,u)}else{let u=c;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(c,u)}}function o(a){let c=0,u=null;for(;a&&a.is("element","listItem");){let d=a.getAttribute("listIndent");if(d>c){let m;u===null?(u=d-c,m=c):(u>d&&(u=d),m=d-u),e.setAttribute("listIndent",m,a),n=!0}else u=null,c=a.getAttribute("listIndent")+1;a=a.nextSibling}}function l(a){let c=[],u=null;for(;a&&a.is("element","listItem");){let d=a.getAttribute("listIndent");if(u&&u.getAttribute("listIndent")>d&&(c=c.slice(0,d+1)),d!=0)if(c[d]){let m=c[d];a.getAttribute("listType")!=m&&(e.setAttribute("listType",m,a),n=!0)}else c[d]=a.getAttribute("listType");u=a,a=a.nextSibling}}}var Ln=function(r,[e,t]){let i=this,n=e.is("documentFragment")?e.getChild(0):e,s;if(t?s=i.createSelection(t):s=i.document.selection,n&&n.is("element","listItem")){let o=s.getFirstPosition(),l=null;if(o.parent.is("element","listItem")?l=o.parent:o.nodeBefore&&o.nodeBefore.is("element","listItem")&&(l=o.nodeBefore),l){let a=l.getAttribute("listIndent");if(a>0)for(;n&&n.is("element","listItem");)n._setAttribute("listIndent",n.getAttribute("listIndent")+a),n=n.nextSibling}}};function kn(r,e,t){let{writer:i,schema:n}=t,s=i.createPositionAfter(r);for(let o of e)if(o.name=="ul"||o.name=="ol")s=t.convertItem(o,s).modelCursor;else{let l=t.convertItem(o,i.createPositionAt(r,"end")),a=l.modelRange.start.nodeAfter;a&&a.is("element")&&!n.checkChild(r,a.name)&&(l.modelCursor.parent.is("element","listItem")?r=l.modelCursor.parent:r=vn(l.modelCursor),s=i.createPositionAfter(r))}return s}function vn(r){let e=new Ze({startPosition:r}),t;do t=e.next();while(!t.value.item.is("element","listItem"));return t.value.item}function Di(r,e,t,i,n,s){let o=M(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:r}),l=n.mapper,a=n.writer,c=o?o.getAttribute("listIndent"):null,u;if(!o)u=t;else if(c==r){let d=l.toViewElement(o).parent;u=a.createPositionAfter(d)}else{let d=s.createPositionAt(o,"end");u=l.toViewPosition(d)}u=wt(u);for(let d of[...i.getChildren()])R(d)&&(u=a.move(a.createRangeOn(d),u).end,k(a,d,d.nextSibling),k(a,d.previousSibling,d))}function R(r){return r.is("element","ol")||r.is("element","ul")}function Tn(r){let e=0,t=r.parent;for(;t;){if(t.is("element","li"))e++;else{let i=t.previousSibling;i&&i.is("element","li")&&e++}t=t.parent}return e}var D=class extends p{static get pluginName(){return"LegacyListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[ze,We,Ve]}init(){let e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});let t=e.data,i=e.editing;e.model.document.registerPostFixer(s=>An(e.model,s)),i.mapper.registerViewToModelLength("li",rt),t.mapper.registerViewToModelLength("li",rt),i.mapper.on("modelToViewPosition",ci(i.view)),i.mapper.on("viewToModelPosition",yn(e.model)),t.mapper.on("modelToViewPosition",ci(i.view)),e.conversion.for("editingDowncast").add(s=>{s.on("insert",li,{priority:"high"}),s.on("insert:listItem",ri(e.model)),s.on("attribute:listType:listItem",gn,{priority:"high"}),s.on("attribute:listType:listItem",pn,{priority:"low"}),s.on("attribute:listIndent:listItem",bn(e.model)),s.on("remove:listItem",fn(e.model)),s.on("remove",hn,{priority:"low"})}),e.conversion.for("dataDowncast").add(s=>{s.on("insert",li,{priority:"high"}),s.on("insert:listItem",ri(e.model))}),e.conversion.for("upcast").add(s=>{s.on("element:ul",ai,{priority:"high"}),s.on("element:ol",ai,{priority:"high"}),s.on("element:li",wn,{priority:"high"}),s.on("element:li",In)}),e.model.on("insertContent",Ln,{priority:"high"}),e.commands.add("numberedList",new O(e,"numbered")),e.commands.add("bulletedList",new O(e,"bulleted")),e.commands.add("indentList",new Q(e,"forward")),e.commands.add("outdentList",new Q(e,"backward"));let n=i.view.document;this.listenTo(n,"enter",(s,o)=>{let l=this.editor.model.document,a=l.selection.getLastPosition().parent;l.selection.isCollapsed&&a.name=="listItem"&&a.isEmpty&&(this.editor.execute("outdentList"),o.preventDefault(),s.stop())},{context:"li"}),this.listenTo(n,"delete",(s,o)=>{if(o.direction!=="backward")return;let l=this.editor.model.document.selection;if(!l.isCollapsed)return;let a=l.getFirstPosition();if(!a.isAtStart)return;let c=a.parent;c.name!=="listItem"||c.previousSibling&&c.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),o.preventDefault(),s.stop())},{context:"li"}),this.listenTo(e.editing.view.document,"tab",(s,o)=>{let l=o.shiftKey?"outdentList":"indentList";this.editor.commands.get(l).isEnabled&&(e.execute(l),o.stopPropagation(),o.preventDefault(),s.stop())},{context:"li"})}afterInit(){let e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),i&&i.registerChildCommand(e.get("outdentList"))}};function rt(r){let e=1;for(let t of r.getChildren())if(t.name=="ul"||t.name=="ol")for(let i of t.getChildren())e+=rt(i);return e}var lt=class extends p{static get requires(){return[D,K]}static get pluginName(){return"LegacyList"}static get isOfficialPlugin(){return!0}},Pe=class extends w{defaultType;constructor(e,t){super(e),this.defaultType=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){this._tryToConvertItemsToList(e);let t=this.editor.model,i=Ue(t);i.length&&t.change(n=>{for(let s of i)n.setAttribute("listStyle",e.type||this.defaultType,s)})}_getValue(){let e=this.editor.model.document.selection.getFirstPosition().parent;return e&&e.is("element","listItem")?e.getAttribute("listStyle"):null}_checkEnabled(){let e=this.editor,t=e.commands.get("numberedList"),i=e.commands.get("bulletedList");return t.isEnabled||i.isEnabled}_tryToConvertItemsToList(e){if(!e.type)return;let t=Ri(e.type);if(!t)return;let i=this.editor,n=`${t}List`;i.commands.get(n).value||i.execute(n)}},xe=class extends w{refresh(){let e=this._getValue();this.value=e,this.isEnabled=e!=null}execute(e={}){let t=this.editor.model,i=Ue(t).filter(n=>n.getAttribute("listType")=="numbered");t.change(n=>{for(let s of i)n.setAttribute("listReversed",!!e.reversed,s)})}_getValue(){let e=this.editor.model.document.selection.getFirstPosition().parent;return e&&e.is("element","listItem")&&e.getAttribute("listType")=="numbered"?e.getAttribute("listReversed"):null}},Be=class extends w{refresh(){let e=this._getValue();this.value=e,this.isEnabled=e!=null}execute({startIndex:e=1}={}){let t=this.editor.model,i=Ue(t).filter(n=>n.getAttribute("listType")=="numbered");t.change(n=>{for(let s of i)n.setAttribute("listStart",e>=0?e:1,s)})}_getValue(){let e=this.editor.model.document.selection.getFirstPosition().parent;return e&&e.is("element","listItem")&&e.getAttribute("listType")=="numbered"?e.getAttribute("listStart"):null}},oe="default",Fe=class extends p{static get requires(){return[D]}static get pluginName(){return"LegacyListPropertiesEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){let e=this.editor,t=e.model,i=e.config.get("list.properties"),n=_n(i);t.schema.extend("listItem",{allowAttributes:n.map(s=>s.attributeName)});for(let s of n)s.addCommand(e);this.listenTo(e.commands.get("indentList"),"_executeCleanup",En(e,n)),this.listenTo(e.commands.get("outdentList"),"_executeCleanup",Vn(e,n)),this.listenTo(e.commands.get("bulletedList"),"_executeCleanup",ui(e)),this.listenTo(e.commands.get("numberedList"),"_executeCleanup",ui(e)),t.document.registerPostFixer(Pn(e,n)),e.conversion.for("upcast").add(Sn(n)),e.conversion.for("downcast").add(Cn(n)),this._mergeListAttributesWhileMergingLists(n)}afterInit(){let e=this.editor;e.commands.get("todoList")&&e.model.document.registerPostFixer(Fn(e))}_mergeListAttributesWhileMergingLists(e){let i=this.editor.model,n;this.listenTo(i,"deleteContent",(s,[o])=>{let l=o.getFirstPosition(),a=o.getLastPosition();if(l.parent===a.parent||!l.parent.is("element","listItem"))return;let c=a.parent.nextSibling;if(!c||!c.is("element","listItem"))return;let u=M(l.parent,{sameIndent:!0,listIndent:c.getAttribute("listIndent")});u&&u.getAttribute("listType")===c.getAttribute("listType")&&(n=u)},{priority:"high"}),this.listenTo(i,"deleteContent",()=>{n&&(i.change(s=>{let o=M(n.nextSibling,{sameIndent:!0,listIndent:n.getAttribute("listIndent"),direction:"forward"});if(!o){n=null;return}let l=[o,...Ee(s.createPositionAt(o,0),"forward")];for(let a of l)for(let c of e)if(c.appliesToListItem(a)){let u=c.attributeName,d=n.getAttribute(u);s.setAttribute(u,d,a)}}),n=null)},{priority:"low"})}};function _n(r){let e=[];return r.styles&&e.push({attributeName:"listStyle",defaultValue:oe,addCommand(t){t.commands.add("listStyle",new Pe(t,oe))},appliesToListItem(){return!0},setAttributeOnDowncast(t,i,n){i&&i!==oe?t.setStyle("list-style-type",i,n):t.removeStyle("list-style-type",n)},getAttributeOnUpcast(t){return bt(t.getStyle("list-style-type"))||oe}}),r.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,addCommand(t){t.commands.add("listReversed",new xe(t))},appliesToListItem(t){return t.getAttribute("listType")=="numbered"},setAttributeOnDowncast(t,i,n){i?t.setAttribute("reversed","reversed",n):t.removeAttribute("reversed",n)},getAttributeOnUpcast(t){return t.hasAttribute("reversed")}}),r.startIndex&&e.push({attributeName:"listStart",defaultValue:1,addCommand(t){t.commands.add("listStart",new Be(t))},appliesToListItem(t){return t.getAttribute("listType")=="numbered"},setAttributeOnDowncast(t,i,n){i==0||i>1?t.setAttribute("start",i,n):t.removeAttribute("start",n)},getAttributeOnUpcast(t){let i=t.getAttribute("start");return i>=0?i:1}}),e}function Sn(r){return e=>{e.on("element:li",(t,i,n)=>{if(!i.modelRange)return;let s=i.viewItem.parent,o=i.modelRange.start.nodeAfter||i.modelRange.end.nodeBefore;for(let l of r)if(l.appliesToListItem(o)){let a=l.getAttributeOnUpcast(s);n.writer.setAttribute(l.attributeName,a,o)}},{priority:"low"})}}function Cn(r){return t=>{for(let i of r)t.on(`attribute:${i.attributeName}:listItem`,(n,s,o)=>{let l=o.writer,a=s.item,c=M(a.previousSibling,{sameIndent:!0,listIndent:a.getAttribute("listIndent"),direction:"backward"}),u=o.mapper.toViewElement(a);e(a,c)||l.breakContainer(l.createPositionBefore(u)),i.setAttributeOnDowncast(l,s.attributeNewValue,u.parent)},{priority:"low"})};function e(t,i){return i&&t.getAttribute("listType")===i.getAttribute("listType")&&t.getAttribute("listIndent")===i.getAttribute("listIndent")&&t.getAttribute("listStyle")===i.getAttribute("listStyle")&&t.getAttribute("listReversed")===i.getAttribute("listReversed")&&t.getAttribute("listStart")===i.getAttribute("listStart")}}function En(r,e){return(t,i)=>{let n=i[0],s=n.getAttribute("listIndent"),o=i.filter(a=>a.getAttribute("listIndent")===s),l=null;n.previousSibling.getAttribute("listIndent")+1!==s&&(l=M(n.previousSibling,{sameIndent:!0,direction:"backward",listIndent:s})),r.model.change(a=>{for(let c of o)for(let u of e)if(u.appliesToListItem(c)){let d=l==null?u.defaultValue:l.getAttribute(u.attributeName);a.setAttribute(u.attributeName,d,c)}})}}function Vn(r,e){return(t,i)=>{if(i=i.reverse().filter(l=>l.is("element","listItem")),!i.length)return;let n=i[0].getAttribute("listIndent"),s=i[0].getAttribute("listType"),o=i[0].previousSibling;if(o.is("element","listItem"))for(;o.getAttribute("listIndent")!==n;)o=o.previousSibling;else o=null;o||(o=i[i.length-1].nextSibling),!(!o||!o.is("element","listItem"))&&o.getAttribute("listType")===s&&r.model.change(l=>{let a=i.filter(c=>c.getAttribute("listIndent")===n);for(let c of a)for(let u of e)if(u.appliesToListItem(c)){let d=u.attributeName,m=o.getAttribute(d);l.setAttribute(d,m,c)}})}}function Pn(r,e){return t=>{let i=!1,n=Ni(r.model.document.differ.getChanges()).filter(o=>o.getAttribute("listType")!=="todo");if(!n.length)return i;let s=n[n.length-1].nextSibling;if((!s||!s.is("element","listItem"))&&(s=n[0].previousSibling,s)){let o=n[0].getAttribute("listIndent");for(;s.is("element","listItem")&&s.getAttribute("listIndent")!==o&&(s=s.previousSibling,!!s););}for(let o of e){let l=o.attributeName;for(let a of n){if(!o.appliesToListItem(a)){t.removeAttribute(l,a);continue}if(!a.hasAttribute(l))xn(s,a,o)?t.setAttribute(l,s.getAttribute(l),a):t.setAttribute(l,o.defaultValue,a),i=!0;else{let c=a.previousSibling;Bn(c,a,o.attributeName)&&(t.setAttribute(l,c.getAttribute(l),a),i=!0)}}}return i}}function xn(r,e,t){if(!r)return!1;let i=r.getAttribute(t.attributeName);return!(!i||i==t.defaultValue||r.getAttribute("listType")!==e.getAttribute("listType"))}function Bn(r,e,t){if(!r||!r.is("element","listItem")||e.getAttribute("listType")!==r.getAttribute("listType"))return!1;let i=r.getAttribute("listIndent");if(i<1||i!==e.getAttribute("listIndent"))return!1;let n=r.getAttribute(t);return!(!n||n===e.getAttribute(t))}function Fn(r){return e=>{let t=Ni(r.model.document.differ.getChanges()).filter(i=>i.getAttribute("listType")==="todo"&&(i.hasAttribute("listStyle")||i.hasAttribute("listReversed")||i.hasAttribute("listStart")));if(!t.length)return!1;for(let i of t)e.removeAttribute("listStyle",i),e.removeAttribute("listReversed",i),e.removeAttribute("listStart",i);return!0}}function ui(r){return(e,t)=>{t=t.filter(i=>i.is("element","listItem")),r.model.change(i=>{for(let n of t)i.removeAttribute("listStyle",n)})}}function Ni(r){let e=[];for(let t of r){let i=On(t);i&&i.is("element","listItem")&&e.push(i)}return e}function On(r){return r.type==="attribute"?r.range.start.nodeAfter:r.type==="insert"?r.position.nodeAfter:null}var at=class extends p{static get requires(){return[Fe,Y]}static get pluginName(){return"LegacyListProperties"}static get isOfficialPlugin(){return!0}},W="todoListChecked",Oe=class extends w{_selectedElements;constructor(e){super(e),this._selectedElements=[],this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems(),this.value=this._selectedElements.every(e=>!!e.getAttribute(W)),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){let e=this.editor.model,t=e.schema,i=e.document.selection.getFirstRange(),n=i.start.parent,s=[];t.checkAttribute(n,W)&&s.push(n);for(let o of i.getItems())t.checkAttribute(o,W)&&!s.includes(o)&&s.push(o);return s}execute(e={}){this.editor.model.change(t=>{for(let i of this._selectedElements)(e.forceValue===void 0?!this.value:e.forceValue)?t.setAttribute(W,!0,i):t.removeAttribute(W,i)})}};function Mn(r,e){return(t,i,n)=>{let s=n.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent")||i.item.getAttribute("listType")!="todo")return;let o=i.item;s.consume(o,"insert"),s.consume(o,"attribute:listType"),s.consume(o,"attribute:listIndent"),s.consume(o,"attribute:todoListChecked");let l=n.writer,a=It(o,n),c=!!o.getAttribute("todoListChecked"),u=yt(o,l,c,e),d=l.createContainerElement("span",{class:"todo-list__label__description"});l.addClass("todo-list",a.parent),l.insert(l.createPositionAt(a,0),u),l.insert(l.createPositionAfter(u),d),Ne(o,a,n,r)}}function Rn(r){return(e,t,i)=>{let n=i.consumable;if(!n.test(t.item,"insert")||!n.test(t.item,"attribute:listType")||!n.test(t.item,"attribute:listIndent")||t.item.getAttribute("listType")!="todo")return;let s=t.item;n.consume(s,"insert"),n.consume(s,"attribute:listType"),n.consume(s,"attribute:listIndent"),n.consume(s,"attribute:todoListChecked");let o=i.writer,l=It(s,i);o.addClass("todo-list",l.parent);let a=o.createContainerElement("label",{class:"todo-list__label"}),c=o.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),u=o.createContainerElement("span",{class:"todo-list__label__description"});s.getAttribute("todoListChecked")&&o.setAttribute("checked","checked",c),o.insert(o.createPositionAt(l,0),a),o.insert(o.createPositionAt(a,0),c),o.insert(o.createPositionAfter(c),u),Ne(s,l,i,r)}}var Dn=(r,e,t)=>{let i=e.modelCursor,n=i.parent,s=e.viewItem;if(s.getAttribute("type")!="checkbox"||n.name!="listItem"||!i.isAtStart||!t.consumable.consume(s,{name:!0}))return;let o=t.writer;o.setAttribute("listType","todo",n),e.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,n),e.modelRange=o.createRange(i)};function Nn(r,e){return(t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;let s=n.mapper.toViewElement(i.item),o=n.writer,l=Wn(s,e);if(i.attributeNewValue=="todo"){let a=!!i.item.getAttribute("todoListChecked"),c=yt(i.item,o,a,r),u=o.createContainerElement("span",{class:"todo-list__label__description"}),d=o.createRangeIn(s),m=Mi(s),f=wt(d.start),b=m?o.createPositionBefore(m):d.end,A=o.createRange(f,b);o.addClass("todo-list",s.parent),o.move(A,o.createPositionAt(u,0)),o.insert(o.createPositionAt(s,0),c),o.insert(o.createPositionAfter(c),u)}else if(i.attributeOldValue=="todo"){let a=Ui(s,e);o.removeClass("todo-list",s.parent),o.remove(l),o.move(o.createRangeIn(a),o.createPositionBefore(a)),o.remove(a)}}}function Un(r){return(e,t,i)=>{if(t.item.getAttribute("listType")!="todo"||!i.consumable.consume(t.item,"attribute:todoListChecked"))return;let{mapper:n,writer:s}=i,o=!!t.item.getAttribute("todoListChecked"),a=n.toViewElement(t.item).getChild(0),c=yt(t.item,s,o,r);s.insert(s.createPositionAfter(a),c),s.remove(a)}}function di(r){return(e,t)=>{let i=t.modelPosition,n=i.parent;if(!n.is("element","listItem")||n.getAttribute("listType")!="todo")return;let s=t.mapper.toViewElement(n),o=Ui(s,r);o&&(t.viewPosition=t.mapper.findPositionIn(o,i.offset))}}function yt(r,e,t,i){return e.createUIElement("label",{class:"todo-list__label",contenteditable:!1},function(s){let o=Lt(document,"input",{type:"checkbox",tabindex:"-1"});t&&o.setAttribute("checked","checked"),o.addEventListener("change",()=>i(r));let l=this.toDomElement(s);return l.appendChild(o),l})}function Wn(r,e){let t=e.createRangeIn(r);for(let i of t)if(i.item.is("uiElement","label"))return i.item}function Ui(r,e){let t=e.createRangeIn(r);for(let i of t)if(i.item.is("containerElement","span")&&i.item.hasClass("todo-list__label__description"))return i.item}var zn=qe("Ctrl+Enter"),Me=class extends p{static get pluginName(){return"LegacyTodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[D]}init(){let e=this.editor,{editing:t,data:i,model:n}=e;n.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),n.schema.addAttributeCheck((l,a)=>{let c=l.last;if(a=="todoListChecked"&&c.name=="listItem"&&c.getAttribute("listType")!="todo")return!1}),e.commands.add("todoList",new O(e,"todo"));let s=new Oe(e);e.commands.add("checkTodoList",s),e.commands.add("todoListCheck",s),i.downcastDispatcher.on("insert:listItem",Rn(n),{priority:"high"}),i.upcastDispatcher.on("element:input",Dn,{priority:"high"}),t.downcastDispatcher.on("insert:listItem",Mn(n,l=>this._handleCheckmarkChange(l)),{priority:"high"}),t.downcastDispatcher.on("attribute:listType:listItem",Nn(l=>this._handleCheckmarkChange(l),t.view)),t.downcastDispatcher.on("attribute:todoListChecked:listItem",Un(l=>this._handleCheckmarkChange(l))),t.mapper.on("modelToViewPosition",di(t.view)),i.mapper.on("modelToViewPosition",di(t.view)),this.listenTo(t.view.document,"arrowKey",Hn(n,e.locale),{context:"li"}),this.listenTo(t.view.document,"keydown",(l,a)=>{$e(a)===zn&&(e.execute("checkTodoList"),l.stop())},{priority:"high"});let o=new Set;this.listenTo(n,"applyOperation",(l,a)=>{let c=a[0];if(c.type=="rename"&&c.oldName=="listItem"){let u=c.position.nodeAfter;u.hasAttribute("todoListChecked")&&o.add(u)}else if(c.type=="changeAttribute"&&c.key=="listType"&&c.oldValue==="todo")for(let u of c.range.getItems())u.hasAttribute("todoListChecked")&&u.getAttribute("listType")!=="todo"&&o.add(u)}),n.document.registerPostFixer(l=>{let a=!1;for(let c of o)l.removeAttribute("todoListChecked",c),a=!0;return o.clear(),a}),this._initAriaAnnouncements()}_handleCheckmarkChange(e){let t=this.editor,i=t.model,n=Array.from(i.document.selection.getRanges());i.change(s=>{s.setSelection(e,"end"),t.execute("checkTodoList"),s.setSelection(n)})}_initAriaAnnouncements(){let{model:e,ui:t,t:i}=this.editor,n=null;t&&e.document.selection.on("change:range",()=>{let s=e.document.selection.focus.parent,o=mi(n),l=mi(s);o&&!l?t.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!o&&l&&t.ariaLiveAnnouncer.announce(i("Entering a to-do list")),n=s})}};function Hn(r,e){return(t,i)=>{if(Ke(i.keyCode,e.contentLanguageDirection)!="left")return;let s=r.schema,o=r.document.selection;if(!o.isCollapsed)return;let l=o.getFirstPosition(),a=l.parent;if(a.name==="listItem"&&a.getAttribute("listType")=="todo"&&l.isAtStart){let c=s.getNearestSelectionRange(r.createPositionBefore(a),"backward");c&&r.change(u=>u.setSelection(c)),i.preventDefault(),i.stopPropagation(),t.stop()}}}function mi(r){return!!r&&r.is("element","listItem")&&r.getAttribute("listType")==="todo"}var ct=class extends p{static get requires(){return[Me,G]}static get pluginName(){return"LegacyTodoList"}static get isOfficialPlugin(){return!0}},ut=class extends p{static get pluginName(){return"AdjacentListsSupport"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.model.schema.register("listSeparator",{allowWhere:"$block",isBlock:!0}),e.conversion.for("upcast").add(i=>{i.on("element:ol",fi()),i.on("element:ul",fi())}).elementToElement({model:"listSeparator",view:"ck-list-separator"}),e.conversion.for("editingDowncast").elementToElement({model:"listSeparator",view:{name:"div",classes:["ck-list-separator","ck-hidden"]}}),e.conversion.for("dataDowncast").elementToElement({model:"listSeparator",view:(i,n)=>{let s=n.writer.createContainerElement("ck-list-separator");return n.writer.setCustomProperty("dataPipeline:transparentRendering",!0,s),s.getFillerOffset=()=>null,s}})}};function fi(){return(r,e,t)=>{let i=e.viewItem,n=i.nextSibling;if(!n||i.name!==n.name)return;e.modelRange||Object.assign(e,t.convertChildren(e.viewItem,e.modelCursor));let s=t.writer,o=s.createElement("listSeparator");if(!t.safeInsert(o,e.modelCursor))return;let l=t.getSplitParts(o);e.modelRange=s.createRange(e.modelRange.start,s.createPositionAfter(l[l.length-1])),t.updateConversionResult(o,e)}}export{ut as AdjacentListsSupport,_e as CheckTodoListCommand,Oe as LegacyCheckTodoListCommand,Q as LegacyIndentCommand,lt as LegacyList,O as LegacyListCommand,D as LegacyListEditing,at as LegacyListProperties,Fe as LegacyListPropertiesEditing,xe as LegacyListRever
1sedCommand,Be as LegacyListStartCommand,Pe as LegacyListStyleCommand,Ve as LegacyListUtils,ct as LegacyTodoList,Me as LegacyTodoListEditing,it as List,E as ListCommand,h as ListEditing,be as ListFormatting,H as ListIndentCommand,de as ListItemBoldIntegration,ge as ListItemFontColorIntegration,pe as ListItemFontFamilyIntegration,fe as ListItemFontSizeIntegration,me as ListItemItalicIntegration,j as ListMergeCommand,st as ListProperties,Te as ListPropertiesEditing,Y as ListPropertiesUI,ve as ListPropertiesUtils,ke as ListReversedCommand,$ as ListSplitCommand,ye as ListStartCommand,Le as ListStyleCommand,K as ListUI,he as ListUtils,ot as TodoList,Ce as TodoListEditing,G as TodoListUI,ae as _ListBlocksIterable,q as _ListPropertiesView,y as _ListWalker,V as _SiblingListBlocksIterator,Se as _TodoCheckboxChangeObserver,re as _canBecomeSimpleListItem,wi as _createListElement,yi as _createListItemElement,we as _createListUIComponents,Si as _createModelToViewListPositionMapper,N as _expandListBlocksToCompleteItems,Z as _expandListBlocksToCompleteList,L as _findAndAddListHeadToMap,_i as _findMappedListItemViewElement,Ai as _fixListIndents,Li as _fixListItemIds,T as _getAllListItemBlocks,gt as _getAllSupportedListStyleTypes,Ii as _getListIndent,S as _getListItemBlocks,dt as _getListItems,pt as _getListStyleTypeFromTypeAttribute,De as _getListTypeFromListStyleType,gi as _getNestedListBlocks,ht as _getNormalizedListConfig,F as _getSelectedBlockObject,Ae as _getTypeAttributeFromListStyleType,ft as _getViewElementIdForListType,mt as _getViewElementNameForListType,ue as _indentListBlocks,v as _isFirstBlockOfListItem,Xe as _isLastBlockOfListItem,g as _isListItemBlock,Ie as _isListItemView,hi as _isListView,z as _isNumberedListType,B as _isSingleListItem,tt as _listItemBogusParagraphCreator,et as _listItemDowncastConverter,Ti as _listItemDowncastRemoveConverter,ki as _listItemUpcastConverter,nt as _listPropertiesUpcastConverter,ce as _mergeListItemBefore,bt as _normalizeListStyle,bi as _outdentFollowingListItems,pi as _outdentListBlocksWithMerge,vi as _reconvertListItemsOnDataChange,J as _removeListAttributes,x as _sortListBlocks,Re as _splitListItemBefore};
2/*! Bundled license information:
3
4@ckeditor/ckeditor5-list/dist/index.js:
5  (**
6   * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
7   * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8   *)
9  (* istanbul ignore next -- @preserve *)
10*/
11//# sourceMappingURL=@ckeditor$ckeditor5-list$dist$index.js.(GXJLSRO7).js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.