1import{Accessibility as it,Command as nt,CommandCollection as rt,Context as st,ContextPlugin as lt,EditingKeystrokeHandler as at,Editor as ct,ElementApiMixin as dt,MultiCommand as pt,PendingActions as mt,Plugin as I,_DEFAULT_ACCESSIBILITY_GROUP_ID as ut,_getEditorUsageData as ft,attachToForm as ht,secureSourceElement as gt}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{AttributeOperation as xt,Batch as bt,BubblingEmitterMixin as It,BubblingEventInfo as yt,ClickObserver as Et,CompositionObserver as Ct,Conversion as St,ConversionHelpers as vt,DataController as Tt,Differ as Pt,DomEventObserver as Vt,DowncastHelpers as At,EditingController as kt,EditingView as Rt,FakeSelectionObserver as Mt,FocusObserver as Dt,History as Wt,HtmlDataProcessor as Lt,InputObserver as Bt,InsertOperation as Ot,KeyObserver as Ht,MarkerCollection as Ft,MarkerOperation as zt,Matcher as Nt,MergeOperation as Ut,Model as jt,ModelDocument as Kt,ModelDocumentFragment as $t,ModelDocumentSelection as Gt,ModelElement as qt,ModelLivePosition as Yt,ModelLiveRange as Qt,ModelNode as Xt,ModelNodeList as Jt,ModelPosition as Zt,ModelRange as eo,ModelRootElement as to,ModelSchemaContext as oo,ModelSelection as io,ModelText as no,ModelTextProxy as ro,ModelTreeWalker as K,ModelTypeCheckable as so,ModelWriter as lo,MouseObserver as k,MoveOperation as ao,MutationObserver as co,NoOperation as po,Observer as mo,OperationFactory as uo,RenameOperation as fo,RootAttributeOperation as ho,RootOperation as go,SelectionObserver as wo,SplitOperation as _o,StylesMap as xo,StylesProcessor as bo,TabObserver as Io,TouchObserver as yo,UpcastHelpers as Eo,UpcastWriter as Co,ViewAttributeElement as So,ViewContainerElement as vo,ViewDataTransfer as To,ViewDocument as Po,ViewDocumentDomEventData as Vo,ViewDocumentFragment as Ao,ViewDocumentSelection as ko,ViewDomConverter as Ro,ViewDowncastWriter as Mo,ViewEditableElement as Do,ViewElement as Wo,ViewEmptyElement as Lo,ViewNode as Bo,ViewPosition as Oo,ViewRange as Ho,ViewRawElement as Fo,ViewRenderer as zo,ViewRootEditableElement as No,ViewSelection as Uo,ViewText as jo,ViewTextProxy as Ko,ViewTokenList as $o,ViewTreeWalker as Go,ViewTypeCheckable as qo,ViewUIElement as Yo,ViewUpcastWriter as Qo,XmlDataProcessor as Xo,_DataProcessorBasicHtmlWriter as Jo,_DetachOperation as Zo,_MapperCache as ei,_OperationReplayer as ti,_VIEW_BR_FILLER as oi,_VIEW_INLINE_FILLER as ii,_VIEW_INLINE_FILLER_LENGTH as ni,_VIEW_MARKED_NBSP_FILLER as ri,_VIEW_NBSP_FILLER as si,_ViewElementConversionConsumables as li,_autoParagraphEmptyModelRoots as ai,_convertMapToStringifiedObject as ci,_convertMapToTags as di,_deleteModelContent as pi,_downcastCleanSelection as mi,_downcastConvertCollapsedSelection as ui,_downcastConvertRangeSelection as fi,_downcastCreateViewElementFromDowncastHighlightDescriptor as hi,_downcastInsertAttributesAndChildren as gi,_downcastInsertElement as wi,_downcastInsertStructure as _i,_downcastInsertText as xi,_downcastInsertUIElement as bi,_downcastRemove as Ii,_downcastWrap as yi,_dumpTrees as Ei,_getDataWithoutViewFiller as Ci,_getModelData as Si,_getModelNodeAfterPosition as vi,_getModelNodeBeforePosition as Ti,_getModelTextNodeAtPosition as Pi,_getSelectedModelContent as Vi,_getViewData as Ai,_initDocumentDumping as ki,_injectModelSelectionPostFixer as Ri,_injectViewQuirksHandling as Mi,_injectViewUIElementHandling as Di,_insertIntoModelNodeList as Wi,_insertModelContent as Li,_insertModelObject as Bi,_isInlineViewFiller as Oi,_isParagraphableModelNode as Hi,_isViewPatternMatched as Fi,_logDocument as zi,_mergeIntersectingModelRanges as Ni,_modifyModelSelection as Ui,_moveInModelNodeList as ji,_normalizeConversionConsumables as Ki,_normalizeInModelNodeList as $i,_operationTransform as Gi,_parseModel as qi,_parseView as Yi,_removeFromModelNodeList as Qi,_setAttributeInModelNodeList as Xi,_setModelData as Ji,_setViewData as Zi,_startsWithViewFiller as en,_stringifyModel as tn,_stringifyView as on,_tryFixingModelRange as nn,_upcastConvertSelectionChange as rn,_upcastConvertText as sn,_upcastConvertToModelFragment as ln,_wrapInModelParagraph as an,addBackgroun
1dStylesRules as cn,addBorderStylesRules as dn,addMarginStylesRules as pn,addPaddingStylesRules as mn,autoParagraphEmptyRoots as un,disableViewPlaceholder as fn,enableViewPlaceholder as hn,getBoxSidesStyleShorthandValue as gn,getBoxSidesStyleValueReducer as wn,getBoxSidesStyleValues as _n,getPositionStyleShorthandNormalizer as xn,getShorthandStylesValues as bn,getViewFillerOffset as In,hideViewPlaceholder as yn,isAttachmentStyleValue as En,isColorStyleValue as Cn,isLengthStyleValue as Sn,isLineStyleValue as vn,isParagraphable as Tn,isPercentageStyleValue as Pn,isPositionStyleValue as Vn,isRepeatStyleValue as An,isURLStyleValue as kn,needsViewPlaceholder as Rn,showViewPlaceholder as Mn,transformOperationSets as Dn,wrapInParagraph as Wn}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";import{Delete as R,DeleteCommand as On,Input as Hn,InsertTextCommand as Fn,TextTransformation as zn,TextWatcher as Nn,TwoStepCaretMovement as Un,Typing as jn,TypingChangeBuffer as Kn,_DeleteObserver as $n,findAttributeRange as Gn,findAttributeRangeBound as qn,getLastTextLine as Yn,inlineHighlight as Qn}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-typing$dist$index.js.js";import{CKEditorError as M,Collection as Zn,Config as er,DOCUMENTATION_URL as tr,DomEmitterMixin as $,ElementReplacer as or,EmitterMixin as G,EventInfo as ir,FocusTracker as nr,KeystrokeHandler as rr,Locale as sr,ObservableMixin as D,Rect as x,ResizeObserver as lr,_clearTranslations as ar,_getEmitterId as cr,_getEmitterListenedTo as dr,_getUserAgent as pr,_isAndroid as mr,_isBlink as ur,_isGecko as fr,_isMac as hr,_isMediaForcedColors as gr,_isMotionReduced as wr,_isRegExpUnicodePropertySupported as _r,_isSafari as xr,_isWindows as br,_isiOS as Ir,_setEmitterId as yr,_translate as Er,_unifyTranslations as Cr,abortableDebounce as Sr,add as vr,areConnectedThroughProperties as Tr,collectStylesheets as Pr,compareArrays as q,count as Vr,crc32 as Ar,createElement as kr,delay as Rr,diff as Mr,diffToChanges as Dr,env as W,exponentialDelay as Wr,fastDiff as Lr,findClosestScrollableAncestor as Br,first as Or,formatHtml as Hr,getAncestors as Fr,getBorderWidths as zr,getCode as Nr,getCommonAncestor as Ur,getDataFromElement as jr,getEnvKeystrokeText as Kr,getLanguageDirection as $r,getLocalizedArrowKeyCodeDirection as Y,getOptimalPosition as Gr,getPositionedAncestor as qr,getRangeFromMouseEvent as Q,getVisualViewportOffset as Yr,global as L,indexOf as Qr,insertAt as Xr,insertToPriorityArray as Jr,isArrowKeyCode as Zr,isCombiningMark as es,isComment as ts,isForwardArrowKeyCode as X,isHighSurrogateHalf as os,isInsideCombinedSymbol as is,isInsideEmojiSequence as ns,isInsideSurrogatePair as rs,isIterable as ss,isLowSurrogateHalf as ls,isNode as as,isRange as cs,isText as ds,isValidAttributeName as ps,isViewWithFocusTracker as ms,isVisible as us,isWindow as fs,keyCodes as E,logError as hs,logWarning as J,mapsEqual as gs,nth as ws,objectToMap as _s,parseBase64EncodedObject as xs,parseKeystroke as bs,priorities as Is,releaseDate as ys,remove as Es,retry as Cs,scrollAncestorsToShowTarget as Ss,scrollViewportToShowTarget as vs,setDataInElement as Ts,spliceArray as Ps,spy as Vs,toArray as B,toMap as As,toUnit as ks,uid as Rs,version as Ms,wait as Ds}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";import{IconAccessibility as Bs,IconAddComment as Os,IconAlignBottom as Hs,IconAlignCenter as Fs,IconAlignJustify as zs,IconAlignLeft as Ns,IconAlignMiddle as Us,IconAlignRight as js,IconAlignTop as Ks,IconArrowDown as $s,IconArrowUp as Gs,IconBold as qs,IconBookmark as Ys,IconBookmarkInline as Qs,IconBookmarkMedium as Xs,IconBookmarkSmall as Js,IconBrowseFiles as Zs,IconBulletedList as el,IconCancel as tl,IconCaption as ol,IconCaseChange as il,IconCheck as nl,IconChevronDown as rl,IconChevronUp as sl,IconCkboxImageEdit as ll,IconCode as al,IconCodeBlock as cl,IconCog as dl,IconColorPalette as pl,IconColorTileCheck as ml,IconCommentsArchive as ul,IconContentLock as fl,IconContentUnlock as hl,IconCopy as gl,IconDragHandle as Z,IconDragIndicator as wl,IconDropbox as _l,IconDropdownArrow as xl,IconEditComment as bl,IconEmoji as Il,IconEraser as yl,IconError as El,IconExportPdf as Cl,IconExportWord as Sl,IconFacebook as vl,IconFindReplace as Tl,IconFontBackgroun
1d as Pl,IconFontColor as Vl,IconFontFamily as Al,IconFontSize as kl,IconFullscreenEnter as Rl,IconFullscreenLeave as Ml,IconGoogleDrive as Dl,IconGooglePhotos as Wl,IconHeading1 as Ll,IconHeading2 as Bl,IconHeading3 as Ol,IconHeading4 as Hl,IconHeading5 as Fl,IconHeading6 as zl,IconHistory as Nl,IconHorizontalLine as Ul,IconHtml as jl,IconImage as Kl,IconImageAssetManager as $l,IconImageUpload as Gl,IconImageUrl as ql,IconImportExport as Yl,IconImportWord as Ql,IconIndent as Xl,IconInsertMergeField as Jl,IconItalic as Zl,IconLegalStyleList as ea,IconLineHeight as ta,IconLink as oa,IconListStyleCircle as ia,IconListStyleDecimal as na,IconListStyleDecimalLeadingZero as ra,IconListStyleDisc as sa,IconListStyleLowerLatin as la,IconListStyleLowerRoman as aa,IconListStyleSquare as ca,IconListStyleUpperLatin as da,IconListStyleUpperRoman as pa,IconLocal as ma,IconLoupe as ua,IconLowVision as fa,IconMagicWand as ha,IconMarker as ga,IconMedia as wa,IconMediaPlaceholder as _a,IconMultiLevelList as xa,IconNextArrow as ba,IconNotification as Ia,IconNumberedList as ya,IconObjectCenter as Ea,IconObjectFullWidth as Ca,IconObjectInline as Sa,IconObjectInlineLeft as va,IconObjectInlineRight as Ta,IconObjectLeft as Pa,IconObjectRight as Va,IconObjectSizeCustom as Aa,IconObjectSizeFull as ka,IconObjectSizeLarge as Ra,IconObjectSizeMedium as Ma,IconObjectSizeSmall as Da,IconOneDrive as Wa,IconOutdent as La,IconPageBreak as Ba,IconPaginationExample as Oa,IconPaintRoller as Ha,IconPaintRollerCursorDefault as Fa,IconPaintRollerCursorText as za,IconParagraph as Na,IconPen as Ua,IconPencil as ja,IconPilcrow as Ka,IconPlay as $a,IconPlus as Ga,IconPreviewMergeFields as qa,IconPreviousArrow as Ya,IconPrint as Qa,IconProjectLogo as Xa,IconQuote as Ja,IconRedo as Za,IconRemove as ec,IconRemoveComment as tc,IconRemoveFormat as oc,IconReturnArrow as ee,IconRevisionHistory as ic,IconRobotPencil as nc,IconSelectAll as rc,IconSettings as sc,IconShowBlocks as lc,IconSource as ac,IconSpecialCharacters as cc,IconStrikethrough as dc,IconSubmit as pc,IconSubscript as mc,IconSuperscript as uc,IconTable as fc,IconTableCellProperties as hc,IconTableColumn as gc,IconTableLayout as wc,IconTableMergeCell as _c,IconTableOfContents as xc,IconTableProperties as bc,IconTableRow as Ic,IconTemplate as yc,IconTemplateGeneric as Ec,IconText as Cc,IconTextAlternative as Sc,IconThreeVerticalDots as vc,IconTodoList as Tc,IconTrackChanges as Pc,IconTrackChangesAccept as Vc,IconTrackChangesDiscard as Ac,IconUnderline as kc,IconUndo as Rc,IconUnlink as Mc,IconUploadcareImageEdit as Dc,IconUploadcareImageUpload as Wc,IconUploadcareLink as Lc,IconUser as Bc,IconWarning as Oc}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-icons$dist$index.js.js";import{AccessibilityHelp as zc,AccessibilityHelpContentView as Nc,AriaLiveAnnouncer as Uc,AriaLiveAnnouncerPoliteness as jc,AriaLiveAnnouncerRegionView as Kc,AriaLiveAnnouncerView as $c,AutocompleteView as Gc,Badge as qc,BalloonPanelView as te,BalloonToolbar as Yc,BlockButtonView as Qc,BlockToolbar as Xc,BodyCollection as Jc,BoxedEditorUIView as Zc,ButtonLabelView as ed,ButtonLabelWithHighlightView as td,ButtonView as od,CollapsibleView as id,ColorGridView as nd,ColorGridsFragmentView as rd,ColorPickerFragmentView as sd,ColorPickerInputRowView as ld,ColorPickerView as ad,ColorSelectorView as cd,ColorTileView as dd,ComponentFactory as pd,ContextualBalloon as oe,CssTransitionDisablerMixin as md,DefaultMenuBarItems as ud,Dialog as fd,DialogActionsView as hd,DialogContentView as gd,DialogView as wd,DialogViewPosition as _d,DocumentColorCollection as xd,DraggableViewMixin as bd,DropdownButtonView as Id,DropdownMenuButtonView as yd,DropdownMenuListItemButtonView as Ed,DropdownMenuListItemView as Cd,DropdownMenuListView as Sd,DropdownMenuNestedMenuPanelView as vd,DropdownMenuNestedMenuView as Td,DropdownMenuPanelPositioningFunctions as Pd,DropdownMenuRootListView as Vd,DropdownPanelView as Ad,DropdownView as kd,EditableUIView as Rd,EditorUI as Md,EditorUIView as Dd,EvaluationBadge as Wd,FileDialogButtonView as Ld,FileDialogListItemButtonView as Bd,FileDialogViewMixin as Od,FocusCycler as Hd,FormHeaderView as Fd,FormRowView as zd,HighlightedTextView as Nd,IconView as ie,IframeView as Ud,InlineEditableUIView as jd,InputBase as Kd,InputNumberView as $d,InputTextView as Gd,InputView as qd,ItemsView as Yd,LabelView as Qd,LabelWithHighlightView as Xd,LabeledFieldView as Jd,LabeledInputVie
vendor: 8,414 bytes, line 1
1w as Zd,ListItemButtonView as ep,ListItemGroupView as tp,ListItemView as op,ListSeparatorView as ip,ListView as np,MenuBarMenuButtonView as rp,MenuBarMenuListItemButtonView as sp,MenuBarMenuListItemFileDialogButtonView as lp,MenuBarMenuListItemView as ap,MenuBarMenuListView as cp,MenuBarMenuPanelView as dp,MenuBarMenuView as pp,MenuBarView as mp,NESTED_TOOLBAR_ICONS as up,Notification as fp,PoweredBy as hp,SearchInfoView as gp,SearchResultsView as wp,SearchTextView as _p,SliderView as xp,SpinnerView as bp,SplitButtonView as Ip,StickyPanelView as yp,SwitchButtonView as Ep,Template as C,TextareaView as Cp,ToolbarLineBreakView as Sp,ToolbarSeparatorView as vp,ToolbarView as ne,TooltipManager as Tp,UIModel as Pp,View as re,ViewCollection as Vp,ViewModel as Ap,_CheckIconHolderView as kp,_CollapsibleView as Rp,_ContextualBalloonRotatorView as Mp,_DropdownMenuBehaviors as Dp,_DropdownRootMenuBehaviors as Wp,_MenuBarBehaviors as Lp,_MenuBarMenuBehaviors as Bp,_MenuBarMenuViewPanelPositioningFunctions as Op,_SearchInfoView as Hp,_SearchTextQueryView as Fp,_TemplateBinding as zp,_TemplateIfBinding as Np,_TemplateToBinding as Up,_convertColor as jp,_convertColorToHex as Kp,_preventUiViewDefault as $p,_processMenuBarConfig as Gp,_registerCustomElement as qp,_tryNormalizeHexColor as Yp,addKeyboardHandlingForGrid as Qp,addListToDropdown as Xp,addMenuToDropdown as Jp,addToolbarToDropdown as Zp,clickOutsideHandler as em,createDropdown as tm,createLabeledDropdown as om,createLabeledInputNumber as im,createLabeledInputText as nm,createLabeledTextarea as rm,filterGroupAndItemNames as sm,focusChildOnDropdownOpen as lm,getLocalizedColorOptions as am,isFocusable as cm,isViewWithFocusCycler as dm,normalizeColorOptions as pm,normalizeMenuBarConfig as mm,normalizeSingleColorDefinition as um,normalizeToolbarConfig as fm,submitHandler as hm}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-ui$dist$index.js.js";import{Enter as se,EnterCommand as _m,EnterObserver as xm,ShiftEnter as bm,ShiftEnterCommand as Im,_getCopyOnEnterAttributes as ym}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-enter$dist$index.js.js";function le(r,e,{signal:t,edges:o}={}){let i,n=null,s=o!=null&&o.includes("leading"),l=o==null||o.includes("trailing"),a=()=>{n!==null&&(r.apply(i,n),i=void 0,n=null)},c=()=>{l&&a(),u()},d=null,p=()=>{d!=null&&clearTimeout(d),d=setTimeout(()=>{d=null,c()},e)},m=()=>{d!==null&&(clearTimeout(d),d=null)},u=()=>{m(),i=void 0,n=null},h=()=>{m(),a()},g=function(...A){if(t?.aborted)return;i=this,n=A;let Ce=d==null;p(),s&&Ce&&a()};return g.schedule=p,g.cancel=u,g.flush=h,t?.addEventListener("abort",u,{once:!0}),g}function ae(r,e=0,t={}){typeof t!="object"&&(t={});let{leading:o=!1,trailing:i=!0,maxWait:n}=t,s=Array(2);o&&(s[0]="leading"),i&&(s[1]="trailing");let l,a=null,c=le(function(...m){l=r.apply(this,m),a=null},e,{edges:s}),d=function(...m){return n!=null&&(a===null&&(a=Date.now()),Date.now()-a>=n)?(l=r.apply(this,m),a=Date.now(),c.cancel(),c.schedule(),l):(c.apply(this,m),l)},p=()=>(c.flush(),l);return d.cancel=c.cancel,d.flush=p,d}function O(r,e=0,t={}){typeof t!="object"&&(t={});let{leading:o=!0,trailing:i=!0}=t;return ae(r,e,{leading:o,trailing:i,maxWait:e})}var S=class extends G(){_stack=[];add(e,t){let o=this._stack,i=o[0];this._insertDescriptor(e);let n=o[0];i!==n&&!H(i,n)&&this.fire("change:top",{oldDescriptor:i,newDescriptor:n,writer:t})}remove(e,t){let o=this._stack,i=o[0];this._removeDescriptor(e);let n=o[0];i!==n&&!H(i,n)&&this.fire("change:top",{oldDescriptor:i,newDescriptor:n,writer:t})}_insertDescriptor(e){let t=this._stack,o=t.findIndex(n=>n.id===e.id);if(H(e,t[o]))return;o>-1&&t.splice(o,1);let i=0;for(;t[i]&&Se(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){let t=this._stack,o=t.findIndex(i=>i.id===e);o>-1&&t.splice(o,1)}};function H(r,e){return r&&e&&r.priority==e.priority&&v(r.classes)==v(e.classes)}function Se(r,e){return r.priority>e.priority?!0:r.priority<e.priority?!1:v(r.classes)>v(e.classes)}function v(r){return Array.isArray(r)?r.sort().join(","):r}var ue="ck-widget",F="ck-widget_selected";function f(r){return r.is("element")?!!r.getCustomProperty("widget"):!1}function ve(r,e,t={}){if(!r.is("containerElement"))throw new M("widget-to-widget-wrong-element-type",null,{element:r});return e.setAttribute("contenteditable","false",r),e.addClass(ue,r),e.setCustomProperty("widget",!0,r),r.getFillerOffset=Re,e.setCustomProperty("widgetLabel",[],r),t.label&&fe(r,t.label),t.hasSelectionHandle&&Me(r,e),j(r,e),r}function Te(r,e,t){if(e.classes&&t.addClass(B(e.classes),r),e.attributes)for(let o in e.attributes)t.setAttribute(o,e.attributes[o],r)}function Pe(r,e,t){if(e.classes&&t.removeClass(B(e.classes),r),e.attributes)for(let o in e.attributes)t.removeAttribute(o,r)}function j(r,e,t=Te,o=Pe){let i=new S;i.on("change:top",(l,a)=>{a.oldDescriptor&&o(r,a.oldDescriptor,a.writer),a.newDescriptor&&t(r,a.newDescriptor,a.writer)});let n=(l,a,c)=>i.add(a,c),s=(l,a,c)=>i.remove(a,c);e.setCustomProperty("addHighlight",n,r),e.setCustomProperty("removeHighlight",s,r)}function fe(r,e){r.getCustomProperty("widgetLabel").push(e)}function he(r){return r.getCustomProperty("widgetLabel").reduce((t,o)=>typeof o=="function"?t?t+". "+o():o():t?t+". "+o:o,"")}function Ve(r,e,t={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],r),t.withAriaRole!==!1&&e.setAttribute("role","textbox",r),e.setAttribute("tabindex","-1",r),t.label&&e.setAttribute("aria-label",t.label,r),e.setAttribute("contenteditable",r.isReadOnly?"false":"true",r),r.on("change:isReadOnly",(o,i,n)=>{e.setAttribute("contenteditable",n?"false":"true",r)}),r.on("change:isFocused",(o,i,n)=>{n?e.addClass("ck-editor__nested-editable_focused",r):e.removeClass("ck-editor__nested-editable_focused",r)}),j(r,e),r}function Ae(r,e){let t=r.getSelectedElement();if(t){let o=_(r);if(o)return e.createRange(e.createPositionAt(t,o))}return e.schema.findOptimalInsertionRange(r)}function ke(r,e){return(t,o)=>{let{mapper:i,viewPosition:n}=o,s=i.findMappedViewAncestor(n);if(!e(s))return;let l=i.toModelElement(s);o.modelPosition=r.createPositionAt(l,n.isAtStart?"before":"after")}}function Re(){return null}function Me(r,e){let t=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(o){let i=this.toDomElement(o),n=new ie;return n.set("content",Z),n.render(),i.appendChild(n.element),i});e.insert(e.createPositionAt(r,0),t),e.addClass(["ck-widget_with-selection-handle"],r)}function ge(r){let e=l=>{let{width:a,paddingLeft:c,paddingRight:d}=l.ownerDocument.defaultView.getComputedStyle(l);return parseFloat(a)-(parseFloat(c)||0)-(parseFloat(d)||0)},t=r.parentElement;if(!t)return 0;let o=e(t),i=5,n=0,s=t;for(;isNaN(o);){if(s=s.parentElement,++n>i)return 0;o=e(s)}return o}function we(r,e=new x(r)){let t=ge(r);return t?e.width/t*100:0}var w="widget-type-around";function b(r,e,t){return!!r&&f(r)&&!t.isInline(e)}function _e(r){return r.closest(".ck-widget__type-around__button")}function xe(r){return r.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function be(r,e){let t=r.closest(".ck-widget");return e.mapDomToView(t)}function _(r){return r.getAttribute(w)}var Ie=["before","after"],De=new DOMParser().parseFromString(ee,"image/svg+xml").firstChild,ce="ck-widget__type-around_disabled",T=class extends I{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[se,R]}init(){let e=this.editor,t=e.editing.view;this.on("change:isEnabled",(o,i,n)=>{t.change(s=>{for(let l of t.document.roots)n?s.removeClass(ce,l):s.addClass(ce,l)}),n||e.model.change(s=>{s.removeSelectionAttribute(w)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){let o=this.editor,i=o.editing.view,n=o.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);o.execute("insertParagraph",{position:o.model.createPositionAt(e,t),attributes:n}
vendor: 8,499 bytes, line 1
1),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,o,i){this.listenTo(e,t,(...n)=>{this.isEnabled&&o(...n)},i)}_insertParagraphAccordingToFakeCaretPosition(){let o=this.editor.model.document.selection,i=_(o);if(!i)return!1;let n=o.getSelectedElement();return this._insertParagraph(n,i),!0}_enableTypeAroundUIInjection(){let e=this.editor,t=e.model.schema,o=e.locale.t,i={before:o("Insert paragraph before block"),after:o("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(n,s,l)=>{let a=l.mapper.toViewElement(s.item);a&&b(a,s.item,t)&&(We(l.writer,i,a),a.getCustomProperty("widgetLabel").push(()=>this.isEnabled?o("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){let e=this.editor,t=e.model,o=t.document.selection,i=t.schema,n=e.editing.view;this._listenToIfEnabled(n.document,"arrowKey",(l,a)=>{this._handleArrowKeyPress(l,a)},{context:[f,"$text"],priority:"high"}),this._listenToIfEnabled(o,"change:range",(l,a)=>{a.directChange&&e.model.change(c=>{c.removeSelectionAttribute(w)})}),this._listenToIfEnabled(t.document,"change:data",()=>{let l=o.getSelectedElement();if(l){let a=e.editing.mapper.toViewElement(l);if(b(a,l,i))return}e.model.change(a=>{a.removeSelectionAttribute(w)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(l,a,c)=>{let d=c.writer;if(this._currentFakeCaretModelElement){let h=c.mapper.toViewElement(this._currentFakeCaretModelElement);h&&(d.removeClass(Ie.map(s),h),this._currentFakeCaretModelElement=null)}let p=a.selection.getSelectedElement();if(!p)return;let m=c.mapper.toViewElement(p);if(!b(m,p,i))return;let u=_(a.selection);u&&(d.addClass(s(u),m),this._currentFakeCaretModelElement=p)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(l,a,c)=>{c||e.model.change(d=>{d.removeSelectionAttribute(w)})});function s(l){return`ck-widget_type-around_show-fake-caret_${l}`}}_handleArrowKeyPress(e,t){let o=this.editor,i=o.model,n=i.document.selection,s=i.schema,l=o.editing.view,a=t.keyCode,c=X(a,o.locale.contentLanguageDirection),d=l.document.selection.getSelectedElement(),p=o.editing.mapper.toModelElement(d),m;b(d,p,s)?m=this._handleArrowKeyPressOnSelectedWidget(c):n.isCollapsed?m=this._handleArrowKeyPressWhenSelectionNextToAWidget(c):t.shiftKey||(m=this._handleArrowKeyPressWhenNonCollapsedSelection(c)),m&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){let o=this.editor.model,i=o.document.selection,n=_(i);return o.change(s=>{if(n){if(!(n===(e?"after":"before")))return s.removeSelectionAttribute(w),!0}else return s.setSelectionAttribute(w,e?"after":"before"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){let t=this.editor,o=t.model,i=o.schema,n=t.plugins.get("Widget"),s=n._getObjectElementNextToSelection(e),l=t.editing.mapper.toViewElement(s);return b(l,s,i)?(o.change(a=>{n._setSelectionOverElement(s),a.setSelectionAttribute(w,e?"before":"after")}),!0):!1}_handleArrowKeyPressWhenNonCollapsedSelection(e){let t=this.editor,o=t.model,i=o.schema,n=t.editing.mapper,s=o.document.selection,l=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter,a=n.toViewElement(l);return b(a,l,i)?(o.change(c=>{c.setSelection(l,"on"),c.setSelectionAttribute(w,e?"after":"before")}),!0):!1}_enableInsertingParagraphsOnButtonClick(){let e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(o,i)=>{let n=_e(i.domTarget);if(!n)return;let s=xe(n),l=be(n,t.domConverter),a=e.editing.mapper.toModelElement(l);this._insertParagraph(a,s),i.preventDefault(),o.stop()})}_enableInsertingParagraphsOnEnterKeypress(){let e=this.editor,t=e.model.document.selection,o=e.editing.view;this._listenToIfEnabled(o.document,"enter",(i,n)=>{if(i.eventPhase!="atTarget")return;let s=t.getSelectedElement(),l=e.editing.mapper.toViewElement(s),a=e.model.schema,c;this._insertParagraphAccordingToFakeCaretPosition()?c=!0:b(l,s,a)&&(this._insertParagraph(s,n.isSoft?"before":"after"),c=!0),c&&(n.preventDefault(),i.stop())},{context:f})}_enableInsertingParagraphsOnTypingKeystroke(){let t=this.editor.editing.view.document;this._listenToIfEnabled(t,"insertText",(o,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=t.selection)},{priority:"high"}),W.isAndroid?this._listenToIfEnabled(t,"keydown",(o,i)=>{i.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(t,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"highest"})}_enableDeleteIntegration(){let e=this.editor,t=e.editing.view,o=e.model,i=o.schema;this._listenToIfEnabled(t.document,"delete",(n,s)=>{if(n.eventPhase!="atTarget")return;let l=_(o.document.selection);if(!l)return;let a=s.direction,c=o.document.selection.getSelectedElement(),d=l==="before",p=a=="forward";if(d===p)e.execute("delete",{selection:o.createSelection(c,"on")});else{let u=i.getNearestSelectionRange(o.createPositionAt(c,l),a);if(u)if(!u.isCollapsed)o.change(h=>{h.setSelection(u),e.execute(p?"deleteForward":"delete")});else{let h=o.createSelection(u.start);if(o.modifySelection(h,{direction:a}),!h.focus.isEqual(u.start))o.change(g=>{g.setSelection(u),e.execute(p?"deleteForward":"delete")});else{let g=Oe(i,u.start.parent);o.deleteContent(o.createSelection(g,"on"),{doNotAutoparagraph:!0})}}}s.preventDefault(),n.stop()},{context:f})}_enableInsertContentIntegration(){let e=this.editor,t=this.editor.model,o=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(i,[n,s])=>{if(s&&!s.is("documentSelection"))return;let l=_(o);if(l)return i.stop(),t.change(a=>{let c=o.getSelectedElement(),d=t.createPositionAt(c,l),p=a.createSelection(d),m=t.insertContent(n,p);return a.setSelection(p),m})},{priority:"high"})}_enableInsertObjectIntegration(){let e=this.editor,o=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(i,n)=>{let[,s,l={}]=n;if(s&&!s.is("documentSelection"))return;let a=_(o);a&&(l.findOptimalPosition=a,n[3]=l)},{priority:"high"})}_enableDeleteContentIntegration(){let e=this.editor,o=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(i,[n])=>{if(n&&!n.is("documentSelection"))return;_(o)&&i.stop()},{priority:"high"})}};function We(r,e,t){let o=r.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(i){let n=this.toDomElement(i);return Le(n,e),Be(n),n});r.insert(r.createPositionAt(t,"end"),o)}function Le(r,e){for(let t of Ie){let o=new C({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${t}`],title:e[t],"aria-hidden":"true"},children:[r.ownerDocument.importNode(De,!0)]});r.appendChild(o.render())}}function Be(r){let e=new C({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});r.appendChild(e.render())}function Oe(r,e){let t=e;for(let o of e.getAncestors({parentFirst:!0})){if(o.childCount>1||r.isLimit(o))break;t=o}return t}function ye(r){let e=r.model;return(t,o)=>{let i=o.keyCode==E.arrowup,n=o.keyCode==E.arrowdown,s=o.shiftKey,l=e.document.selection;if(!i&&!n)return;let a=n;if(s&&ze(l,a))return;let c=He(r,l,a);if(c){if(c.isCollapsed){if(l.isCollapsed)return;if(s)return}(c.isCollapsed||Fe(r,c,a))&&(e.change(d=>{let p=a?c.end:c.start;if(s){let m=e.createSelection(l.anchor);m.setFocus(p),d.setSelection(m)}else d.setSelection(p)}),t.stop(),o.preventDefault(),o.stopPropagation())}}}function He(r,e,t){let o=r.model;if(t){let i=e.isCollapsed?e.focus:e.getLastPosition(),n=de(o,i,"forward");if(!n)return null;let s=o.createRange(i,n),l=pe(o.schema,s,"backward");return l?o.createRange(i,l):null}else{let i=e.isCollapsed?e.focus:e.getFirstPosition(),n=de(o,i,"backward");if(!n)return null;let s=o.createRange(n,i),l=pe(o.schema,s,"forward");return l?o.createRange(l,i):null}}function de(r,e,t){let o=r.schema,i=r.createRangeIn(e.root),n=t=="forward"?"elementStart":"elementEnd";for(let{previousPosition:s,item:l,type:a}of i.getWalker({startPosition:e,direction:t})){if(o.isLimit(l)&&!o.isInline(l))return s;if(a==n&&o.isBlock(l))return null}return null}function pe(r,e,t){let o=t=="backward"?e.end:e.start;if(r.checkChild(o,"$text"))return o;for(let{nextPosition:i}of e.getWalker({direction:t}))if(r.checkChild(i,"$text"))return i;return null}function Fe(r,e,t){let o=r.model,i=r.view.domConverter;if(t){let c=o.createSelection(e.start);o.modifySelection(c),!c.focus.isAtEnd&&!e.start.isEqual(c.focus)&&
1(e=o.createRange(c.focus,e.end))}let n=r.mapper.toViewRange(e),s=i.viewRangeToDom(n),l=x.getDomRangeRects(s),a;for(let c of l){if(a===void 0){a=Math.round(c.bottom);continue}if(Math.round(c.top)>=a)return!1;a=Math.max(a,Math.round(c.bottom))}return!0}function ze(r,e){return!r.isCollapsed&&r.isBackward==e}var z=class extends I{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[T,R]}init(){let e=this.editor,t=e.editing.view,o=t.document,i=e.t;this.editor.editing.downcastDispatcher.on("selection",(n,s,l)=>{let a=l.writer,c=s.selection;if(c.isCollapsed)return;let d=c.getSelectedElement();if(!d)return;let p=e.editing.mapper.toViewElement(d);f(p)&&l.consumable.consume(c,"selection")&&a.setSelection(a.createRangeOn(p),{fake:!0,label:he(p)})}),this.editor.editing.downcastDispatcher.on("selection",(n,s,l)=>{this._clearPreviouslySelectedWidgets(l.writer);let a=l.writer,c=a.document.selection,d=null;for(let p of c.getRanges())for(let m of p){let u=m.item;f(u)&&!je(u,d)&&(a.addClass(F,u),this._previouslySelected.add(u),d=u)}},{priority:"low"}),t.addObserver(k),this.listenTo(o,"mousedown",(...n)=>this._onMousedown(...n)),this.listenTo(o,"arrowKey",(...n)=>{this._handleSelectionChangeOnArrowKeyPress(...n)},{context:[f,"$text"]}),this.listenTo(o,"arrowKey",(...n)=>{this._preventDefaultOnArrowKeyPress(...n)},{context:"$root"}),this.listenTo(o,"arrowKey",ye(this.editor.editing),{context:"$text"}),this.listenTo(o,"delete",(n,s)=>{this._handleDelete(s.direction=="forward")&&(s.preventDefault(),n.stop())},{context:"$root"}),this.listenTo(o,"tab",(n,s)=>{n.eventPhase=="atTarget"&&(s.shiftKey||this._selectFirstNestedEditable()&&(s.preventDefault(),n.stop()))},{context:f,priority:"low"}),this.listenTo(o,"tab",(n,s)=>{s.shiftKey&&this._selectAncestorWidget()&&(s.preventDefault(),n.stop())},{priority:"low"}),this.listenTo(o,"keydown",(n,s)=>{s.keystroke==E.esc&&this._selectAncestorWidget()&&(s.preventDefault(),n.stop())},{priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:i("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:i("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:i("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:i("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:i("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:i("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){let o=this.editor,i=o.editing.view,n=i.document,s=t.target;if(!s)return;if(t.domEvent.detail>=3){this._selectBlockContent(s)&&t.preventDefault();return}if(!f(s)){let a=Ne(s);if(!a)return;if(f(a))s=a;else{let c=Ue(i,t);if(c&&f(c))s=c;else return}}W.isAndroid&&t.preventDefault(),n.isFocused||i.focus();let l=o.editing.mapper.toModelElement(s);this._setSelectionOverElement(l)}_selectBlockContent(e){let t=this.editor,o=t.model,i=t.editing.mapper,n=o.schema,s=i.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),l=Ke(i.toModelElement(s),o.schema);return l?(o.change(a=>{let c=n.isLimit(l)?null:$e(a.createPositionAfter(l),n),d=a.createPositionAt(l,0),p=c?a.createPositionAt(c,0):a.createPositionAt(l,"end");a.setSelection(a.createRange(d,p))}),!0):!1}_handleSelectionChangeOnArrowKeyPress(e,t){let o=t.keyCode,i=this.editor.model,n=i.schema,s=i.document.selection,l=s.getSelectedElement(),a=Y(o,this.editor.locale.contentLanguageDirection),c=a=="down"||a=="right",d=a=="up"||a=="down";if(l&&n.isObject(l)){let m=c?s.getLastPosition():s.getFirstPosition(),u=n.getNearestSelectionRange(m,c?"forward":"backward");u&&(i.change(h=>{h.setSelection(u)}),t.preventDefault(),e.stop());return}if(!s.isCollapsed&&!t.shiftKey){let m=s.getFirstPosition(),u=s.getLastPosition(),h=m.nodeAfter,g=u.nodeBefore;(h&&n.isObject(h)||g&&n.isObject(g))&&(i.change(A=>{A.setSelection(c?u:m)}),t.preventDefault(),e.stop());return}if(!s.isCollapsed)return;let p=this._getObjectElementNextToSelection(c);if(p&&n.isObject(p)){if(n.isInline(p)&&d)return;this._setSelectionOverElement(p),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){let o=this.editor.model,i=o.schema,n=o.document.selection.getSelectedElement();n&&i.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){let o=this.editor.model.document.selection;if(!this.editor.model.canEditAt(o)||!o.isCollapsed)return;let i=this._getObjectElementNextToSelection(e);if(i)return this.editor.model.change(n=>{let s=o.anchor.parent;for(;s.isEmpty;){let l=s;s=l.parent,n.remove(l)}this._setSelectionOverElement(i)}),!0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){let t=this.editor.model,o=t.schema,i=t.document.selection,n=t.createSelection(i);if(t.modifySelection(n,{direction:e?"forward":"backward"}),n.isEqual(i))return null;let s=e?n.focus.nodeBefore:n.focus.nodeAfter;return s&&o.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(let t of this._previouslySelected)e.removeClass(F,t);this._previouslySelected.clear()}_selectFirstNestedEditable(){let e=this.editor,o=this.editor.editing.view.document;for(let i of o.selection.getFirstRange().getItems())if(i.is("editableElement")){let n=e.editing.mapper.toModelElement(i);if(!n)continue;let s=e.model.createPositionAt(n,0),l=e.model.schema.getNearestSelectionRange(s,"forward");return e.model.change(a=>{a.setSelection(l)}),!0}return!1}_selectAncestorWidget(){let e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,s=(i.is("$text")?i.parent:i).findAnce
vendor: 5,608 bytes, line 1
1stor(f);if(!s)return!1;let l=t.toModelElement(s);return l?(e.model.change(a=>{a.setSelection(l,"on")}),!0):!1}};function Ne(r){let e=r;for(;e;){if(e.is("editableElement")||f(e))return e;e=e.parent}return null}function Ue(r,e){let t=Q(e.domEvent),o=null;if(t?o=r.domConverter.domRangeToView(t):o=r.createRange(r.createPositionAt(e.target,0)),!o)return null;let i=o.start;if(!i.parent)return null;let n=i.parent;return i.parent.is("editableElement")&&(i.isAtEnd&&i.nodeBefore?n=i.nodeBefore:i.isAtStart&&i.nodeAfter&&(n=i.nodeAfter)),n.is("$text")?n.parent:n}function je(r,e){return e?Array.from(r.getAncestors()).includes(e):!1}function Ke(r,e){for(let t of r.getAncestors({includeSelf:!0,parentFirst:!0})){if(e.checkChild(t,"$text"))return t;if(e.isLimit(t)&&!e.isObject(t))break}return null}function $e(r,e){let t=new K({startPosition:r});for(let{item:o}of t){if(e.isLimit(o)||!o.is("element"))return null;if(e.checkChild(o,"$text"))return o}return null}var N=class extends I{_toolbarDefinitions=new Map;_balloon;static get requires(){return[oe]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;if(e.plugins.has("BalloonToolbar")){let t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",o=>{Ge(e.editing.view.document.selection)&&o.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(let e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:o,getRelatedElement:i,balloonClassName:n="ck-toolbar-container",positions:s}){if(!o.length){J("widget-toolbar-no-items",{toolbarId:e});return}let l=this.editor,a=l.t,c=new ne(l.locale);if(c.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new M("widget-toolbar-duplicated",this,{toolbarId:e});let d={view:c,getRelatedElement:i,balloonClassName:n,itemsConfig:o,positions:s,initialized:!1};l.ui.addToolbar(c,{isContextual:!0,beforeFocus:()=>{let p=i(l.editing.view.document.selection);p&&this._showToolbar(d,p)},afterBlur:()=>{this._hideToolbar(d)}}),this._toolbarDefinitions.set(e,d)}_updateToolbarsVisibility(){let e=0,t=null,o=null;for(let i of this._toolbarDefinitions.values()){let n=i.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!n)this._isToolbarInBalloon(i)&&this._hideToolbar(i);else if(!this.editor.ui.focusTracker.isFocused)this._isToolbarVisible(i)&&this._hideToolbar(i);else{let s=n.getAncestors().length;s>e&&(e=s,t=n,o=i)}}o&&this._showToolbar(o,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?me(this.editor,t,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Ee(this.editor,t,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(let o of this._toolbarDefinitions.values())if(this._isToolbarVisible(o)){let i=o.getRelatedElement(this.editor.editing.view.document.selection);me(this.editor,i,e.positions)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}};function me(r,e,t){let o=r.plugins.get("ContextualBalloon"),i=Ee(r,e,t);o.updatePosition(i)}function Ee(r,e,t){let o=r.editing.view,i=te.defaultPositions;return{target:o.domConverter.mapViewToDom(e),positions:t||[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}function Ge(r){let e=r.getSelectedElement();return!!(e&&f(e))}var P=class extends D(){_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,o){let i=new x(t);this.activeHandlePosition=Qe(e),this._referenceCoordinates=qe(t,Xe(this.activeHandlePosition)),this._originalWidth=i.width,this._originalHeight=i.height,this._aspectRatio=i.width/i.height;let n=o.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(n):this._originalWidthPercents=we(o,i)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}};function qe(r,e){let t=new x(r),o=e.split("-"),i={x:o[1]=="right"?t.right:t.left,y:o[0]=="bottom"?t.bottom:t.top};return i.x+=r.ownerDocument.defaultView.scrollX,i.y+=r.ownerDocument.defaultView.scrollY,i}function Ye(r){return`ck-widget__resizer__handle-${r}`}function Qe(r){let e=["top-left","top-right","bottom-right","bottom-left"];for(let t of e)if(r.classList.contains(Ye(t)))return t}function Xe(r){let e=r.split("-"),t={top:"bottom",bottom:"top",left:"r
1ight",right:"left"};return`${t[e[0]]}-${t[e[1]]}`}var V=class extends re{constructor(){super();let e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",t=>t?`ck-orientation-${t}`:"")],style:{display:e.if("_isVisible","none",t=>!t)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(o,i)=>o!==null&&i!==null),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(o,i,n)=>e.unit==="px"?`${o}\xD7${i}`:`${n}%`),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(o,i,n)=>i<50||n<50?"above-center":o)}_dismiss(){this.unbind(),this._isVisible=!1}},y=class extends D(){_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",(t,o)=>t&&o),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{!this.state.proposedWidth&&!this.state.proposedWidthPercents&&(this._cleanup(),t.stop())},{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change(t=>{t.removeClass("ck-hidden",this._viewResizerWrapper)})}hide(){this._options.editor.editing.view.change(t=>{t.addClass("ck-hidden",this._viewResizerWrapper)})}attach(){let e=this,t=this._options.viewElement;this._options.editor.editing.view.change(i=>{let n=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(s){let l=this.toDomElement(s);return e._appendHandles(l),e._appendSizeUI(l),l});i.insert(i.createPositionAt(t,"end"),n),i.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=n,this.isVisible||this.hide()}),this.on("change:isVisible",()=>{this.isVisible?(this.show(),this.redraw()):this.hide()})}begin(e){this._state=new P(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){let t=this._proposeNewSize(e);this._options.editor.editing.view.change(c=>{let d=this._options.unit||"%",p=(d==="%"?t.widthPercents:t.width)+d;c.setStyle("width",p,this._options.viewElement)});let i=this._getHandleHost(),n=new x(i),s=Math.round(n.width),l=Math.round(n.height),a=new x(i);t.width=Math.round(a.width),t.height=Math.round(a.height),this.redraw(n),this.state.update({...t,handleHostWidth:s,handleHostHeight:l})}commit(){let e=this._options.unit||"%",t=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){let t=this._domResizerWrapper;if(!et(t))return;let o=t.parentElement,i=this._getHandleHost(),n=this._viewResizerWrapper,s=[n.getStyle("width"),n.getStyle("height"),n.getStyle("left"),n.getStyle("top")],l;if(o.isSameNode(i)){let a=e||new x(i);l=[a.width+"px",a.height+"px",void 0,void 0]}else l=[i.offsetWidth+"px",i.offsetHeight+"px",i.offsetLeft+"px",i.offsetTop+"px"];q(s,l)!=="same"&&this._options.editor.editing.view.change(a=>{a.setStyle({width:l[0],height:l[1],left:l[2],top:l[3]},n)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){let t=this.state,o=Ze(e),i=this._options.isCentered?this._options.isCentered(this):!0,n={x:t._referenceCoordinates.x-(o.x+t.originalWidth),y:o.y-t.originalHeight-t._referenceCoordinates.y};i&&t.activeHandlePosition.endsWith("-right")&&(n.x=o.x-(t._referenceCoordinates.x+t.originalWidth)),i&&(n.x*=2);let s=Math.abs(t.originalWidth+n.x),l=Math.abs(t.originalHeight+n.y);return(s/t.aspectRatio>l?"width":"height")=="width"?l=s/t.aspectRatio:s=l*t.aspectRatio,{width:Math.round(s),height:Math.round(l),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s*100)/100,100)}}_getResizeHost(){let e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){let e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){let t=["top-left","top-right","bottom-right","bottom-left"];for(let o of t)e.appendChild(new C({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Je(o)}`}}).render())}_appendSizeUI(e){this._sizeView=new V,this._sizeView.render(),e.appendChild(this._sizeView.element)}};function Je(r){return`ck-widget__resizer__handle-${r}`}function Ze(r){return{x:r.pageX,y:r.pageY}}function et(r){return r&&r.ownerDocument&&r.ownerDocument.contains(r)}var U=class extends I{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.editing,t=L.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(k),this._observer=new($()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=O(()=>this.redrawSelectedResizer(),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",()=>{for(let[i,n]of this._resizers)i.isAttached()||(this._resizers.delete(i),n.destroy())},{priority:"lowest"}),this._observer.listenTo(L.window,"resize",this._redrawSelectedResizerThrottled);let o=this.editor.editing.view.document.selection;o.on("change",()=>{let i=o.getSelectedElement(),n=this.getResizerByViewElement(i)||null;n?this.select(n):this.deselect()})}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(let e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){let t=new y(e),o=this.editor.plugins;if(t.attach(),o.has("WidgetToolbarRepository")){let s=o.get("WidgetToolbarRepository");t.on("begin",()=>{s.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{s.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{s.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);let n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(let t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){let o=t.domTarget;y.isResizeHandle(o)&&(this._activeResizer=this._getResizerByHandle(o)||null,this._activeResizer&&(this._activeResizer.begin(o),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}};export{ue as WIDGET_CLASS_NAME,F as WIDGET_SELECTED_CLASS_NAME,z as Widget,S as WidgetHighlightStack,U as Wi
1dgetResize,P as WidgetResizeState,y as WidgetResizer,N as WidgetToolbarRepository,T as WidgetTypeAround,w as _WIDGET_TYPE_AROUND_SELECTION_ATTRIBUTE,V as _WidgetSizeView,_e as _getClosestWidgetTypeAroundDomButton,be as _getClosestWidgetViewElement,xe as _getWidgetTypeAroundButtonPosition,_ as _getWidgetTypeAroundFakeCaretPosition,ge as calculateResizeHostAncestorWidth,we as calculateResizeHostPercentageWidth,Ae as findOptimalInsertionRange,he as getLabel,b as isTypeAroundWidget,f as isWidget,j as setHighlightHandling,fe as setLabel,ve as toWidget,Ve as toWidgetEditable,ye as verticalWidgetNavigationHandler,ke as viewToModelPositionOutsideModelElement}; 2/*! Bundled license information: 3 4@ckeditor/ckeditor5-widget/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-widget$dist$index.js.(IOZGFRMN).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.