PageSourceSearch

https://www.strasbourg.eu/o/frontend-editor-ckeditor-web/__liferay…ckeditor5-find-and-replace$dist$index.js.js

js strasbourg.eu collected 2026-09-24 08:37:41 UTC 32,068 bytes, 12 lines download raw bytes

1import{Accessibility as me,Command as I,CommandCollection as xe,Context as ge,ContextPlugin as we,EditingKeystrokeHandler as Ie,Editor as _e,ElementApiMixin as be,MultiCommand as Ve,PendingActions as ye,Plugin as u,_DEFAULT_ACCESSIBILITY_GROUP_ID as Ce,_getEditorUsageData as ke,attachToForm as Re,secureSourceElement as Te}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{IconAccessibility as De,IconAddComment as ve,IconAlignBottom as Ee,IconAlignCenter as Fe,IconAlignJustify as Se,IconAlignLeft as Me,IconAlignMiddle as Le,IconAlignRight as Oe,IconAlignTop as Pe,IconArrowDown as We,IconArrowUp as Ne,IconBold as He,IconBookmark as Ue,IconBookmarkInline as je,IconBookmarkMedium as ze,IconBookmarkSmall as $e,IconBrowseFiles as Ke,IconBulletedList as qe,IconCancel as Ge,IconCaption as Qe,IconCaseChange as Ze,IconCheck as Je,IconChevronDown as Ye,IconChevronUp as Xe,IconCkboxImageEdit as et,IconCode as tt,IconCodeBlock as ot,IconCog as it,IconColorPalette as rt,IconColorTileCheck as nt,IconCommentsArchive as st,IconContentLock as at,IconContentUnlock as lt,IconCopy as ct,IconDragHandle as dt,IconDragIndicator as ft,IconDropbox as ht,IconDropdownArrow as pt,IconEditComment as ut,IconEmoji as mt,IconEraser as xt,IconError as gt,IconExportPdf as wt,IconExportWord as It,IconFacebook as _t,IconFindReplace as v,IconFontBackground as bt,IconFontColor as Vt,IconFontFamily as yt,IconFontSize as Ct,IconFullscreenEnter as kt,IconFullscreenLeave as Rt,IconGoogleDrive as Tt,IconGooglePhotos as Bt,IconHeading1 as At,IconHeading2 as Dt,IconHeading3 as vt,IconHeading4 as Et,IconHeading5 as Ft,IconHeading6 as St,IconHistory as Mt,IconHorizontalLine as Lt,IconHtml as Ot,IconImage as Pt,IconImageAssetManager as Wt,IconImageUpload as Nt,IconImageUrl as Ht,IconImportExport as Ut,IconImportWord as jt,IconIndent as zt,IconInsertMergeField as $t,IconItalic as Kt,IconLegalStyleList as qt,IconLineHeight as Gt,IconLink as Qt,IconListStyleCircle as Zt,IconListStyleDecimal as Jt,IconListStyleDecimalLeadingZero as Yt,IconListStyleDisc as Xt,IconListStyleLowerLatin as eo,IconListStyleLowerRoman as to,IconListStyleSquare as oo,IconListStyleUpperLatin as io,IconListStyleUpperRoman as ro,IconLocal as no,IconLoupe as so,IconLowVision as ao,IconMagicWand as lo,IconMarker as co,IconMedia as fo,IconMediaPlaceholder as ho,IconMultiLevelList as po,IconNextArrow as uo,IconNotification as mo,IconNumberedList as xo,IconObjectCenter as go,IconObjectFullWidth as wo,IconObjectInline as Io,IconObjectInlineLeft as _o,IconObjectInlineRight as bo,IconObjectLeft as Vo,IconObjectRight as yo,IconObjectSizeCustom as Co,IconObjectSizeFull as ko,IconObjectSizeLarge as Ro,IconObjectSizeMedium as To,IconObjectSizeSmall as Bo,IconOneDrive as Ao,IconOutdent as Do,IconPageBreak as vo,IconPaginationExample as Eo,IconPaintRoller as Fo,IconPaintRollerCursorDefault as So,IconPaintRollerCursorText as Mo,IconParagraph as Lo,IconPen as Oo,IconPencil as Po,IconPilcrow as Wo,IconPlay as No,IconPlus as Ho,IconPreviewMergeFields as Uo,IconPreviousArrow as E,IconPrint as jo,IconProjectLogo as zo,IconQuote as $o,IconRedo as Ko,IconRemove as qo,IconRemoveComment as Go,IconRemoveFormat as Qo,IconReturnArrow as Zo,IconRevisionHistory as Jo,IconRobotPencil as Yo,IconSelectAll as Xo,IconSettings as ei,IconShowBlocks as ti,IconSource as oi,IconSpecialCharacters as ii,IconStrikethrough as ri,IconSubmit as ni,IconSubscript as si,IconSuperscript as ai,IconTable as li,IconTableCellProperties as ci,IconTableColumn as di,IconTableLayout as fi,IconTableMergeCell as hi,IconTableOfContents as pi,IconTableProperties as ui,IconTableRow as mi,IconTemplate as xi,IconTemplateGeneric as gi,IconText as wi,IconTextAlternative as Ii,IconThreeVerticalDots as _i,IconTodoList as bi,IconTrackChanges as Vi,IconTrackChangesAccept as yi,IconTrackChangesDiscard as Ci,IconUnderline as ki,IconUndo as Ri,IconUnlink as Ti,IconUploadcareImageEdit as Bi,IconUploadcareImageUpload as Ai,IconUploadcareLink as Di,IconUser as vi,IconWarning as Ei}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-icons$dist$index.js.js";
vendor: 6,438 bytes, line 1
1import{AccessibilityHelp as Mi,AccessibilityHelpContentView as Li,AriaLiveAnnouncer as Oi,AriaLiveAnnouncerPoliteness as Pi,AriaLiveAnnouncerRegionView as Wi,AriaLiveAnnouncerView as Ni,AutocompleteView as Hi,Badge as Ui,BalloonPanelView as ji,BalloonToolbar as zi,BlockButtonView as $i,BlockToolbar as Ki,BodyCollection as qi,BoxedEditorUIView as Gi,ButtonLabelView as Qi,ButtonLabelWithHighlightView as Zi,ButtonView as F,CollapsibleView as N,ColorGridView as Ji,ColorGridsFragmentView as Yi,ColorPickerFragmentView as Xi,ColorPickerInputRowView as er,ColorPickerView as tr,ColorSelectorView as or,ColorTileView as ir,ComponentFactory as rr,ContextualBalloon as nr,CssTransitionDisablerMixin as H,DefaultMenuBarItems as sr,Dialog as U,DialogActionsView as ar,DialogContentView as lr,DialogView as cr,DialogViewPosition as j,DocumentColorCollection as dr,DraggableViewMixin as fr,DropdownButtonView as hr,DropdownMenuButtonView as pr,DropdownMenuListItemButtonView as ur,DropdownMenuListItemView as mr,DropdownMenuListView as xr,DropdownMenuNestedMenuPanelView as gr,DropdownMenuNestedMenuView as wr,DropdownMenuPanelPositioningFunctions as Ir,DropdownMenuRootListView as _r,DropdownPanelView as br,DropdownView as z,EditableUIView as Vr,EditorUI as yr,EditorUIView as Cr,EvaluationBadge as kr,FileDialogButtonView as Rr,FileDialogListItemButtonView as Tr,FileDialogViewMixin as Br,FocusCycler as $,FormHeaderView as K,FormRowView as Ar,HighlightedTextView as Dr,IconView as vr,IframeView as Er,InlineEditableUIView as Fr,InputBase as Sr,InputNumberView as Mr,InputTextView as Lr,InputView as Or,ItemsView as Pr,LabelView as Wr,LabelWithHighlightView as Nr,LabeledFieldView as q,LabeledInputView as Hr,ListItemButtonView as Ur,ListItemGroupView as jr,ListItemView as zr,ListSeparatorView as $r,ListView as Kr,MenuBarMenuButtonView as qr,MenuBarMenuListItemButtonView as G,MenuBarMenuListItemFileDialogButtonView as Gr,MenuBarMenuListItemView as Qr,MenuBarMenuListView as Zr,MenuBarMenuPanelView as Jr,MenuBarMenuView as Yr,MenuBarView as Xr,NESTED_TOOLBAR_ICONS as en,Notification as tn,PoweredBy as on,SearchInfoView as rn,SearchResultsView as nn,SearchTextView as sn,SliderView as an,SpinnerView as ln,SplitButtonView as cn,StickyPanelView as dn,SwitchButtonView as S,Template as fn,TextareaView as hn,ToolbarLineBreakView as pn,ToolbarSeparatorView as un,ToolbarView as mn,TooltipManager as xn,UIModel as gn,View as m,ViewCollection as Q,ViewModel as wn,_CheckIconHolderView as In,_CollapsibleView as _n,_ContextualBalloonRotatorView as bn,_DropdownMenuBehaviors as Vn,_DropdownRootMenuBehaviors as yn,_MenuBarBehaviors as Cn,_MenuBarMenuBehaviors as kn,_MenuBarMenuViewPanelPositioningFunctions as Rn,_SearchInfoView as Tn,_SearchTextQueryView as Bn,_TemplateBinding as An,_TemplateIfBinding as Dn,_TemplateToBinding as vn,_convertColor as En,_convertColorToHex as Fn,_preventUiViewDefault as Sn,_processMenuBarConfig as Mn,_registerCustomElement as Ln,_tryNormalizeHexColor as On,addKeyboardHandlingForGrid as Pn,addListToDropdown as Wn,addMenuToDropdown as Nn,addToolbarToDropdown as Hn,clickOutsideHandler as Un,createDropdown as Z,createLabeledDropdown as jn,createLabeledInputNumber as zn,createLabeledInputText as J,createLabeledTextarea as $n,filterGroupAndItemNames as Kn,focusChildOnDropdownOpen as qn,getLocalizedColorOptions as Gn,isFocusable as Qn,isViewWithFocusCycler as Zn,normalizeColorOptions as Jn,normalizeMenuBarConfig as Yn,normalizeSingleColorDefinition as Xn,normalizeToolbarConfig as es,submitHandler as Y}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-ui$dist$index.js.js";import{CKEditorError as is,Collection as _,Config as rs,DOCUMENTATION_URL as ns,DomEmitterMixin as ss,ElementReplacer as as,EmitterMixin as ls,EventInfo as cs,FocusTracker as X,KeystrokeHandler as ee,Locale as ds,ObservableMixin as te,Rect as oe,ResizeObserver as fs,_clearTranslations as hs,_getEmitterId as ps,_getEmitterListenedTo as us,_getUserAgent as ms,_isAndroid as xs,_isBlink as gs,_isGecko as ws,_isMac as Is,_isMediaForcedColors as _s,_isMotionReduced as bs,_isRegExpUnicodePropertySupported as Vs,_isSafari as ys,_isWindows as Cs,_isiOS as ks,_setEmitterId as Rs,_translate as Ts,_unifyTranslations as Bs,abortableDebounce as As,add as Ds,areConnectedThroughProperties as vs,collectStylesheets as Es,compareArrays as Fs,count as Ss,crc32 as Ms,createElement as Ls,delay as Os,diff as Ps,diffToChanges as Ws,env as Ns,exponentialDelay as Hs,fastDiff as Us,findClosestScrollableAncestor as js,first as zs,formatHtml as $s,getAncestors as Ks,getBorderWidths as qs,getCode as Gs,getCommonAncestor as Qs,getDataFromElement as Zs,getEnvKeystrokeText as Js,getLanguageDirection as Ys,getLocalizedArrowKeyCodeDirection as Xs,getOptimalPosition as ea,getPositionedAncestor as ta,getRangeFromMouseEvent as oa,getVisualViewportOffset as ia,global as ra,indexOf as na,insertAt as sa,insertToPriorityArray as aa,isArrowKeyCode as la,isCombiningMark as ca,isComment as da,isForwardArrowKeyCode as fa,isHighSurrogateHalf as ha,isInsideCombinedSymbol as pa,isInsideEmojiSequence as ua,isInsideSurrogatePair as ma,isIterable as xa,isLowSurrogateHalf as ga,isNode as wa,isRange as Ia,isText as _a,isValidAttributeName as ba,isViewWithFocusTracker as Va,isVisible as ie,isWindow as ya,keyCodes as Ca,logError as ka,logWarning as Ra,mapsEqual as Ta,nth as Ba,objectToMap as Aa,parseBase64EncodedObject as Da,parseKeystroke as va,priorities as Ea,releaseDate as Fa,remove as Sa,retry as Ma,scrollAncestorsToShowTarget as La,scrollViewportToShowTarget as re,setDataInElement as Oa,spliceArray as Pa,spy as Wa,toArray as Na,toMap as Ha,toUnit as Ua,uid as ne,version as ja,wait as za}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";function se(l,t,{signal:e,edges:o}={}){let i,r=null,a=o!=null&&o.includes("leading"),n=o==null||o.includes("trailing"),d=()=>{r!==null&&(l.apply(i,r),i=void 0,r=null)},s=()=>{n&&d(),p()},c=null,f=()=>{c!=null&&clearTimeout(c),c=setTimeout(()=>{c=null,s()},t)},h=()=>{c!==null&&(clearTimeout(c),c=null)},p=()=>{h(),i=void 0,r=null},D=()=>{h(),d()},w=function(...le){if(e?.aborted)return;i=this,r=le;let ce=c==null;f(),a&&ce&&d()};return w.schedule=f,w.cancel=p,w.flush=D,e?.addEventListener("abort",p,{once:!0}),w}function M(l,t=0,e={}){typeof e!="object"&&(e={});let{leading:o=!1,trailing:i=!0,maxWait:r}=e,a=Array(2);
1o&&(a[0]="leading"),i&&(a[1]="trailing");let n,d=null,s=se(function(...h){n=l.apply(this,h),d=null},t,{edges:a}),c=function(...h){return r!=null&&(d===null&&(d=Date.now()),Date.now()-d>=r)?(n=l.apply(this,h),d=Date.now(),s.cancel(),s.schedule(),n):(s.apply(this,h),n)},f=()=>(s.flush(),n);return c.cancel=s.cancel,c.flush=f,c}function L(l){if(l==null)return"";if(typeof l=="string")return l;if(Array.isArray(l))return l.map(L).join(",");let t=String(l);return t==="0"&&Object.is(Number(l),-0)?"-0":t}function ae(l){return l.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function O(l){return ae(L(l))}var b=class extends m{children;_findInputView;_replaceInputView;_findButtonView;_findPrevButtonView;_findNextButtonView;_advancedOptionsCollapsibleView;_matchCaseSwitchView;_wholeWordsOnlySwitchView;_replaceButtonView;_replaceAllButtonView;_inputsDivView;_actionButtonsDivView;_focusTracker;_keystrokes;_focusables;focusCycler;constructor(t){super(t);let e=t.t;this.children=this.createCollection(),this.set("matchCount",0),this.set("highlightOffset",0),this.set("isDirty",!1),this.set("_areCommandsEnabled",{}),this.set("_resultsCounterText",""),this.set("_matchCase",!1),this.set("_wholeWordsOnly",!1),this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",(o,i)=>o>0&&!i),this._findInputView=this._createInputField(e("Find in text\u2026")),this._findPrevButtonView=this._createButton({label:e("Previous result"),class:"ck-button-prev",icon:E,keystroke:"Shift+F3",tooltip:!0}),this._findNextButtonView=this._createButton({label:e("Next result"),class:"ck-button-next",icon:E,keystroke:"F3",tooltip:!0}),this._replaceInputView=this._createInputField(e("Replace with\u2026"),"ck-labeled-field-replace"),this._inputsDivView=this._createInputsDiv(),this._matchCaseSwitchView=this._createMatchCaseSwitch(),this._wholeWordsOnlySwitchView=this._createWholeWordsOnlySwitch(),this._advancedOptionsCollapsibleView=this._createAdvancedOptionsCollapsible(),this._replaceAllButtonView=this._createButton({label:e("Replace all"),class:"ck-button-replaceall",withText:!0}),this._replaceButtonView=this._createButton({label:e("Replace"),class:"ck-button-replace",withText:!0}),this._findButtonView=this._createButton({label:e("Find"),class:"ck-button-find ck-button-action",withText:!0}),this._actionButtonsDivView=this._createActionButtonsDiv(),this._focusTracker=new X,this._keystrokes=new ee,this._focusables=new Q,this.focusCycler=new $({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.addMany([this._inputsDivView,this._advancedOptionsCollapsibleView,this._actionButtonsDivView]),this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Y({view:this}),this._initFocusCycling(),this._initKeystrokeHandling()}destroy(){super.destroy(),this._focusTracker.destroy(),this._keystrokes.destroy()}focus(t){t===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}reset(){this._findInputView.errorText=null,this.isDirty=!0}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createInputsDiv(){let t=this.locale,e=t.t,o=new m(t);return this._findInputView.fieldView.on("input",()=>{this.isDirty=!0}),this._findPrevButtonView.delegate("execute").to(this,"findPrevious"),this._findNextButtonView.delegate("execute").to(this,"findNext"),this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findPrevious:i})=>i),this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",({findNext:i})=>i),this._injectFindResultsCounter(),this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:i},r)=>i&&r),this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",(i,r)=>i||!r?"":e("Tip: Find some text first in order to replace it.")),o.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__inputs"]}
1,children:[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView]}),o}_onFindButtonExecute(){if(!this._textToFind){let t=this.t;this._findInputView.errorText=t("Text to find must not be empty.");return}this.isDirty=!1,this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly})}_injectFindResultsCounter(){let t=this.locale,e=t.t,o=this.bindTemplate,i=new m(this.locale);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",(a,n)=>e("%0 of %1",[a,n])),i.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",o.if("isDirty","ck-hidden")]},children:[{text:o.to("_resultsCounterText")}]});let r=()=>{let a=this._findInputView.fieldView.element;if(!a||!ie(a))return;let n=new oe(i.element).width,d=t.uiLanguageDirection==="ltr"?"paddingRight":"paddingLeft";n?a.style[d]=`calc( 2 * var(--ck-spacing-standard) + ${n}px )`:a.style[d]=""};this.on("change:_resultsCounterText",r,{priority:"low"}),this.on("change:isDirty",r,{priority:"low"}),this._findInputView.template.children[0].children.push(i)}_createAdvancedOptionsCollapsible(){let t=this.locale.t,e=new N(this.locale,[this._matchCaseSwitchView,this._wholeWordsOnlySwitchView]);return e.set({label:t("Advanced options"),isCollapsed:!0}),e}_createActionButtonsDiv(){let t=new m(this.locale);return this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replace:e},o)=>e&&o),this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",({replaceAll:e},o)=>e&&o),this._replaceButtonView.on("execute",()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})}),this._replaceAllButtonView.on("execute",()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace}),this.focus()}),this._findButtonView.on("execute",this._onFindButtonExecute.bind(this)),t.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__actions"]},children:[this._replaceAllButtonView,this._replaceButtonView,this._findButtonView]}),t}_createMatchCaseSwitch(){let t=this.locale.t,e=new S(this.locale);return e.set({label:t("Match case"),withText:!0}),e.bind("isOn").to(this,"_matchCase"),e.on("execute",()=>{this._matchCase=!this._matchCase,this.isDirty=!0}),e}_createWholeWordsOnlySwitch(){let t=this.locale.t,e=new S(this.locale);return e.set({label:t("Whole words only"),withText:!0}),e.bind("isOn").to(this,"_wholeWordsOnly"),e.on("execute",()=>{this._wholeWordsOnly=!this._wholeWordsOnly,this.isDirty=!0}),e}_initFocusCycling(){[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._advancedOptionsCollapsibleView.buttonView,this._matchCaseSwitchView,this._wholeWordsOnlySwitchView,this._replaceAllButtonView,this._replaceButtonView,this._findButtonView].forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}_initKeystrokeHandling(){let t=o=>o.stopPropagation(),e=o=>{o.stopPropagation(),o.preventDefault()};this._keystrokes.listenTo(this.element),this._keystrokes.set("f3",o=>{e(o),this._findNextButtonView.fire("execute")}),this._keystrokes.set("shift+f3",o=>{e(o),this._findPrevButtonView.fire("execute")}),this._keystrokes.set("enter",o=>{let i=o.target;i===this._findInputView.fieldView.element?(this._areCommandsEnabled.findNext?this._findNextButtonView.fire("execute"):this._findButtonView.fire("execute"),e(o)):i===this._replaceInputView.fieldView.element&&!this.isDirty&&(this._replaceButtonView.fire("execute"),e(o))}),this._keystrokes.set("shift+enter",o=>{o.target===this._findInputView.fieldView.element&&(this._areCommandsEnabled.findPrevious?this._findPrevButtonView.fire("execute"):this._findButtonView.fire("execute"),e(o))}),this._keystrokes.set("arrowright",t),this._keystrokes.set("arrowleft",t),this._keystrokes.set("arrowup",t),this._keystrokes.set("arrowdown",t)}_createButton(t){let e=new F(this.locale);return e.set(t),e}_createInputField(t,e){let o=new q(this.locale,J);return o.label=t,o.class=e,o}},V=class extends u{static get requires(){return[U]}static get pluginName(){return"FindAndReplaceUI"}static get isOfficialPlugin(){return!0}formView;constructor(t){super(t),t.config.define("findAndReplace.uiType","dialog"),this.formView=null}init(){let t=this.editor,e=t.config.get("findAndReplace.uiType")==="dropdown",o=t.commands.get("find"),i=this.editor.t;t.ui.componentFactory.add("findAndReplace",()=>{let r;return e?(r=this._createDropdown(),r.bind("isEnabled").to(o)):r=this._createDialogButtonForToolbar(),t.keystrokes.set("Ctrl+F",(a,n)=>{if(o.isEnabled){if(r instanceof z){let d=r.buttonView;d.isOn||d.fire("execute")}else r.isOn?t.plugins.get("Dialog").view.focus():r.fire("execute");n()}}),r}),e||t.ui.componentFactory.add("menuBar:findAndReplace",()=>this._createDialogButtonForMenuBar()),t.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Find in the document"),keystroke:"CTRL+F"}]})}_createDropdown(){let t=this.editor,e=t.locale.t,o=Z(t.locale);return o.once("change:isOpen",()=>{this.formView=this._createFormView(),this.formView.children.add(new K(t.locale,{label:e("Find and replace")}),0),o.panelView.children.add(this.formView)}),o.on("change:isOpen",(i,r,a)=>{a?this._setupFormView():this.fire("searchReseted")},{priority:"low"}),o.buttonView.set({icon:v,label:e("Find and replace"),keystroke:"CTRL+F",tooltip:!0}),o}_createDialogButtonForToolbar(){let t=this.editor,e=this._createButton(F),o=t.plugins.get("Dialog");return e.set({tooltip:!0}),e.bind("isOn").to(o,"id",i=>i==="findAndReplace"),e.on("execute",()=>{e.isOn?o.hide():this._showDialog()}),e}_createDialogButtonForMenuBar(){let t=this._createButton(G),e=this.editor.plugins.get("Dialog"),o=this.editor.plugins.get("Dialog");return t.set({role:"menuitemcheckbox",isToggleable:!0}),t.bind("isOn").to(o,"id",i=>i==="findAndReplace"),t.on("execute",()=>{if(e.id==="findAndReplace"){e.hide();return}this._showDialog()}),t}_createButton(t){let e=this.editor,o=e.commands.get("find"),i=new t(e.locale),r=e.locale.t;return i.bind("isEnabled").to(o),i.set({icon:v,label:r("Find and replace"),keystroke:"CTRL+F"}),i}_showDialog(){let t=this.editor,e=t.plugins.get("Dialog"),o=t.locale.t;this.formView||(this.formView=this._createFormView()),e.show({id:"findAndReplace",title:o("Find and replace"),content:this.formView,position:j.EDITOR_TOP_S
1IDE,onShow:()=>{this._setupFormView()},onHide:()=>{this.fire("searchReseted")}})}_createFormView(){let t=this.editor,e=new(H(b))(t.locale),o=t.commands,r=this.editor.plugins.get("FindAndReplaceEditing").state;e.bind("highlightOffset").to(r,"highlightedOffset"),e.listenTo(r.results,"change",()=>{e.matchCount=r.results.length});let a=o.get("findNext"),n=o.get("findPrevious"),d=o.get("replace"),s=o.get("replaceAll");return e.bind("_areCommandsEnabled").to(a,"isEnabled",n,"isEnabled",d,"isEnabled",s,"isEnabled",(c,f,h,p)=>({findNext:c,findPrevious:f,replace:h,replaceAll:p})),e.delegate("findNext","findPrevious","replace","replaceAll").to(this),e.on("change:isDirty",(c,f,h)=>{h&&this.fire("searchReseted")}),e}_setupFormView(){this.formView.disableCssTransitions(),this.formView.reset(),this.formView._findInputView.fieldView.select(),this.formView.enableCssTransitions()}},y=class extends I{_state;constructor(t,e){super(t),this.isEnabled=!0,this.affectsData=!1,this._state=e}execute(t,{matchCase:e,wholeWords:o}={}){let{editor:i}=this,{model:r}=i,a=i.plugins.get("FindAndReplaceUtils"),n,d="";typeof t=="string"?n=(...f)=>({results:a.findByTextCallback(t,{matchCase:e,wholeWords:o})(...f),searchText:t}):n=t;let s=n;n=(...f)=>{let h=s(...f);return h&&"searchText"in h&&(d=h.searchText),h};let c=r.document.getRootNames().reduce((f,h)=>a.updateFindResultFromRange(r.createRangeIn(r.document.getRoot(h)),r,n,f),null);return this._state.clear(r),this._state.results.addMany(c),this._state.highlightedResult=c.get(0),this._state.searchText=d,n&&(this._state.lastSearchCallback=n),this._state.matchCase=!!e,this._state.matchWholeWords=!!o,{results:c,findCallback:n}}},C=class extends te(){constructor(t){super(),this.set("results",new _),this.set("highlightedResult",null),this.set("highlightedOffset",0),this.set("searchText",""),this.set("replaceText",""),this.set("lastSearchCallback",null),this.set("matchCase",!1),this.set("matchWholeWords",!1),this.results.on("change",(e,{removed:o,index:i})=>{if(Array.from(o).length){let r=!1;if(t.change(a=>{for(let n of o)this.highlightedResult===n&&(r=!0),t.markers.has(n.marker.name)&&a.removeMarker(n.marker)}),r){let a=i>=this.results.length?0:i;this.highlightedResult=this.results.get(a)}}}),this.on("change:highlightedResult",()=>{this.refreshHighlightOffset(t)})}clear(t){this.searchText="",t.change(e=>{if(this.highlightedResult){let o=this.highlightedResult.marker.name.split(":")[1],i=t.markers.get(`findResultHighlighted:${o}`);i&&e.removeMarker(i)}[...this.results].forEach(({marker:o})=>{e.removeMarker(o)})}),this.results.clear()}refreshHighlightOffset(t){let{highlightedResult:e,results:o}=this;e?this.highlightedOffset=W(t,[...o]).indexOf(e)+1:this.highlightedOffset=0}};function W(l,t){let e={before:-1,same:0,after:1,different:1};return l.document.getRootNames().flatMap(o=>t.filter(i=>i.marker.getStart().root.rootName===o).sort((i,r)=>e[i.marker.getStart().compareWith(r.marker.getStart())]))}var x=class extends I{_state;constructor(t,e){super(t),this.isEnabled=!0,this._state=e,this._isEnabledBasedOnSelection=!1}_replace(t,e){let{model:o}=this.editor,i=e.marker.getRange();o.canEditAt(i)&&o.change(r=>{if(i.root.rootName==="$graveyard"){this._state.results.remove(e);return}let a={};for(let n of i.getItems())if(n.is("$text")||n.is("$textProxy")){a=n.getAttributes();break}o.insertContent(r.createText(t,a),i),this._state.results.has(e)&&this._state.results.remove(e)})}},k=class extends x{execute(t,e){let o=Math.max(this._state.highlightedOffset-1,0);if(this._replace(t,e),this._state.results.length){let i=W(this.editor.model,[...this._state.results]);this._state.highlightedResult=i[o%i.length]}}},R=class extends x{execute(t,e){let{editor:o}=this,{model:i}=o,r=o.plugins.get("FindAndReplaceUtils"),a=e instanceof _?e:i.document.getRootNames().reduce((n,d)=>r.updateFindResultFromRange(i.createRangeIn(i.document.getRoot(d)),i,r.findByTextCallback(e,this._state),n),null);a.length&&i.change(()=>{[...a].forEach(n=>{this._replace(t,n)})})}},g=class extends I{_state;constructor(t,e){super(t),this.affectsData=!1,this._state=e,this.isEnabled=!1,this.listenTo(this._state.results,"change",()=>{this.isEnabled=this._state.results.length>1})}refresh(){this.isEnabled=this._state.results.length>1}execute(){let t=this._state.results,e=t.getIndex(this._state.highlightedResult),o=e+1>=t.length?0:e+1;this._state.highlightedResult=this._state.results.get(o)}},T=class extends g{execute(){let e=this._state.results.getIndex(this._state.highlightedResult),o=e-1<0?this._state.results.length-1:e-1;this._state.highlightedResult=this._state.results.get(o)}},B=class extends u{static get pluginName(){return"FindAndReplaceUtils"}static get isOfficialPlugin(){return!0}updateFindResultFromRange(t,e,o,i){let r=i||new _,a=n=>r.find(d=>{let{marker:s}=d,c=s.getRange(),f=n.getRange();return c.isEqual(f)});return e.change(n=>{[...t].forEach(({type:d,item:s})=>{if(d==="elementStart"&&e.schema.checkChild(s,"$text")){let c=o({item:s,text:this.rangeToText(e.createRangeIn(s))});if(!c)return;
1"results"in c&&(c=c.results),c.forEach(f=>{let h=`findResult:${ne()}`,p=n.addMarker(h,{usingOperation:!1,affectsData:!1,range:n.createRange(n.createPositionAt(s,f.start),n.createPositionAt(s,f.end))}),D=de(r,p);a(p)||r.add({id:h,label:f.label,marker:p},D)})}})}),r}rangeToText(t){return Array.from(t.getItems({shallow:!0})).reduce((e,o)=>o.is("$text")||o.is("$textProxy")?e+o.data:`${e}
2`,"")}findByTextCallback(t,e){let o="gu";e.matchCase||(o+="i");let i=`(${O(t)})`;if(e.wholeWords){let n="[^a-zA-Z\xC0-\u024F\u1E00-\u1EFF]";new RegExp("^"+n).test(t)||(i=`(^|${n}|_)${i}`),new RegExp(n+"$").test(t)||(i=`${i}(?=_|${n}|$)`)}let r=new RegExp(i,o);function a({text:n}){return[...n.matchAll(r)].map(fe)}return a}};function de(l,t){let e=l.find(({marker:o})=>t.getStart().isBefore(o.getStart()));return e?l.getIndex(e):l.length}function fe(l){let t=l.length-1,e=l.index;return l.length===3&&(e+=l[1].length),{label:l[t],start:e,end:e+l[t].length}}var he="ck-find-result_selected",A=class extends u{static get requires(){return[B]}static get pluginName(){return"FindAndReplaceEditing"}static get isOfficialPlugin(){return!0}state;init(){this.state=new C(this.editor.model),this.set("_isSearchActive",!1),this._defineConverters(),this._defineCommands(),this.listenTo(this.state,"change:highlightedResult",(o,i,r,a)=>{let{model:n}=this.editor;n.change(d=>{if(a){let s=a.marker.name.split(":")[1],c=n.markers.get(`findResultHighlighted:${s}`);c&&d.removeMarker(c)}if(r){let s=r.marker.name.split(":")[1];d.addMarker(`findResultHighlighted:${s}`,{usingOperation:!1,affectsData:!1,range:r.marker.getRange()})}})});let e=M(((o,i,r)=>{if(r){let a=this.editor.editing.view.domConverter,n=this.editor.editing.mapper.toViewRange(r.marker.getRange());re({target:a.viewRangeToDom(n),viewportOffset:40})}}).bind(this),32);this.listenTo(this.state,"change:highlightedResult",e,{priority:"low"}),this.listenTo(this.editor,"destroy",e.cancel),this.on("change:_isSearchActive",(o,i,r)=>{r?this.listenTo(this.editor.model.document,"change:data",this._onDocumentChange):this.stopListening(this.editor.model.document,"change:data",this._onDocumentChange)})}find(t,e){return this._isSearchActive=!0,this.editor.execute("find",t,e),this.state.results}stop(){this.state.clear(this.editor.model),this._isSearchActive=!1}_defineCommands(){this.editor.commands.add("find",new y(this.editor,this.state)),this.editor.commands.add("findNext",new g(this.editor,this.state)),this.editor.commands.add("findPrevious",new T(this.editor,this.state)),this.editor.commands.add("replace",new k(this.editor,this.state)),this.editor.commands.add("replaceAll",new R(this.editor,this.state))}_defineConverters(){let{editor:t}=this;t.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:e})=>{let[,o]=e.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":o}}}}),t.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:e})=>{let[,o]=e.split(":");return{name:"span",classes:[he],attributes:{"data-find-result":o}}}})}_onDocumentChange=()=>{let t=new Set,e=new Set,o=this.editor.model,{results:i}=this.state,r=o.document.differ.getChanges(),a=o.document.differ.getChangedMarkers();r.forEach(s=>{s.position&&(s.name==="$text"||s.position.nodeAfter&&o.schema.isInline(s.position.nodeAfter)?(t.add(s.position.parent),[...o.markers.getMarkersAtPosition(s.position)].forEach(c=>{e.add(c.name)})):s.type==="insert"&&s.position.nodeAfter&&t.add(s.position.nodeAfter))}),a.forEach(({name:s,data:{newRange:c}})=>{c&&c.start.root.rootName==="$graveyard"&&e.add(s)}),t.forEach(s=>{[...o.markers.getMarkersIntersectingRange(o.createRangeIn(s))].forEach(f=>e.add(f.name))}),e.forEach(s=>{i.has(s)&&(i.get(s)===this.state.highlightedResult&&(this.state.highlightedResult=null),i.remove(s))});let n=[],d=this.editor.plugins.get("FindAndReplaceUtils");t.forEach(s=>{let c=d.updateFindResultFromRange(o.createRangeOn(s),o,this.state.lastSearchCallback,i);n.push(...c)}),a.forEach(s=>{if(s.data.newRange){let c=d.updateFindResultFromRange(s.data.newRange,o,this.state.lastSearchCallback,i);n.push(...c)}}),!this.state.highlightedResult&&n.length?this.state.highlightedResult=n[0]:this.state.refreshHighlightOffset(o)}},P=class extends u{static get requires(){return[A,V]}static get pluginName(){return"FindAndReplace"}static get isOfficialPlugin(){return!0}init(){let t=this.editor.plugins.get("FindAndReplaceUI"),e=this.editor.plugins.get("FindAndReplaceEditing"),o=e.state;t.on("findNext",(i,r)=>{r?(o.searchText=r.searchText,e.find(r.searchText,r)):this.editor.execute("findNext")}),t.on("findPrevious",(i,r)=>{r&&o.searchText!==r.searchText?e.find(r.searchText):this.editor.execute("findPrevious")}),t.on("replace",(i,r)=>{o.searchText!==r.searchText&&e.find(r.searchText);let a=o.highlightedResult;a&&this.editor.execute("replace",r.replaceText,a)}),t.on("replaceAll",(i,r)=>{o.searchText!==r.searchText&&e.find(r.searchText),this.editor.execute("replaceAll",r.replaceText,o.results)}),t.on("searchReseted",()=>{o.clear(this.editor.model),e.stop()})}};export{P as FindAndReplace,A as FindAndReplaceEditing,b as FindAndReplaceFormView,C as FindAndReplaceState,V as FindAndReplaceUI,B as FindAndReplaceUtils,y as FindCommand,g as FindNextCommand,T as FindPreviousCommand,x as FindReplaceCommandBase,R as ReplaceAllCommand,k as ReplaceCommand,W as _sortFindResultsByMarkerPositions};
3/*! Bundled license information:
4
5@ckeditor/ckeditor5-find-and-replace/dist/index.js:
6  (**
7   * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
8   * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
9   *)
10  (* istanbul ignore next -- @preserve *)
11*/
12//# sourceMappingURL=@ckeditor$ckeditor5-find-and-replace$dist$index.js.(XWC2GCZO).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.