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hB4rB,IAAK1rB,EAAW0rB,IAAM5rB,EAAUqtB,OAChCnB,KAAMhsB,EAAWgsB,KAAOlsB,EAAUotB,MA3WP,EA4W3BrW,KAAM,QAiRL20F,GAAsB,CAC/B,CACIC,OAAQ,OACRx6F,MAAO,OACPwpE,OAAQ,CACJ,CACII,QAAS,SACT91B,MAAO,CACH,oBACA,uBAGR,CACI81B,QAAS,SACT91B,MAAO,CACH,uBAGR,CACI81B,QAAS,kBACT91B,MAAO,CACH,8BAKhB,CACI0mD,OAAQ,OACRx6F,MAAO,OACPwpE,OAAQ,CACJ,CACII,QAAS,OACT91B,MAAO,CACH,eACA,iBAGR,CACI81B,QAAS,YACT91B,MAAO,CACH,sBAGR,CACI81B,QAAS,iBACT91B,MAAO,CACH,6BAKhB,CACI0mD,OAAQ,OACRx6F,MAAO,OACPwpE,OAAQ,CACJ,CACII,QAAS,gBACT91B,MAAO,CACH,0BAGR,CACI81B,QAAS,aACT91B,MAAO,CACH,uBAGR,CACI81B,QAAS,qBACT91B,MAAO,CACH,+BAGR,CACI81B,QAAS,oBACT91B,MAAO,CACH,gCAKhB,CACI0mD,OAAQ,SACRx6F,MAAO,SACPwpE,OAAQ,CACJ,CACII,QAAS,oBACT91B,MAAO,CACH,sBACA,gBACA,mBACA,wBAGR,CACI81B,QAAS,eACT91B,MAAO,CACH,eACA,kBACA,6BAGR,CACI81B,QAAS,qBACT91B,MAAO,CACH,qBACA,yBACA,4BACA,qBACA,oBACA,sBAGR,CACI81B,QAAS,yBACT91B,MAAO,CACH,yBACA,oBACA,4BAGR,CACI81B,QAAS,6BACT91B,MAAO,CACH,yCAKhB,CACI0mD,OAAQ,SACRx6F,MAAO,SACPwpE,OAAQ,CACJ,CACII,QAAS,cACT91B,MAAO,CACH,CACI0mD,OAAQ,OACRx6F,MAAO,OACPwpE,OAAQ,CACJ,CACII,QAAS,cACT91B,MAAO,CACH,eACA,iBACA,oBACA,wBACA,sBACA,oBACA,iBAGR,CACI81B,QAAS,mBACT91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AMzpH,EAAiBq4K,GAAellK,QAAOnT,IAAyD,IAA/CC,EAAQwpH,OAAO94G,QAAQ3Q,EAAO68B,cACrF38B,EAAcg+K,cAAcnxK,QAAQ/M,EACrC,CAGAE,EAAcm+K,iBAAmB,GACjC,MAAM/9K,EAAmBL,EAAQo+K,iBAMjC,OALI9uK,MAAMuG,QAAQxV,KACjBJ,EAAcm+K,iBAAmB/9K,GAI3BN,EAAYiU,OAAOnU,EAASI,GAAe8T,MAAKhU,GAC/CA,GACN,CAEJ,CClCO,MAAMs+K,WAA0BjmE,IAChC,MAAMkmE,WAAmBlmE,IAGhC7lG,OAAOgsK,oBAAsBF,GAC7B9rK,OAAOisK,gBAAkBF,GAGzB/rK,OAAOksK,iBAAmBpoG,GAE1BioG,GAAWI,iBAAmBX,GAAwBO,IACtDA,GAAW1gJ,eAAiB26I,GAC5B+F,GAAW3gJ,cAAgBx9B,OAAO8wB,OAAO,CAAC,EAAGwrJ,IAC7C6B,GAAW3gJ,cAAcs6E,QAAU,CACjCnzD,MAAO,CACN,UACA,IACA,OACA,SACA,gBACA,OACA,kBACA,OACA,eACA,eACA,WACA,cACA,aACA,IACA,cACA,YACA,IACA,qBACA,OACA,OACA,gCACA,IACA,YACA,IACA,UACA,iBAIHu5H,GAAkBK,iBAAmBX,GAAwBM,IAC7DA,GAAkBzgJ,eAAiB26I,GACnC8F,GAAkB1gJ,cAAgBx9B,OAAO8wB,OAAO,CAAC,EAAGwrJ,IACpD4B,GAAkB1gJ,cAAcs6E,QAAU,CACzCnzD,MAAO,CACN,OACA,SACA,gBACA,OACA,kBACA,OACA,eACA,eACA,WACA,cACA,aACA,IACA,qBACA,OACA,OACA,gCACA,UACA,gC1mC9DF,GAREtiC,EAAOjhB,QAAU1B","sources":["OPEditor/webpack/universalModuleDefinition","OPEditor/webpack/runtime/create fake namespace object","OPEditor/node_modules/color-convert/conversions.js","OPEditor/node_modules/color-convert/index.js","OPEditor/node_modules/color-convert/route.js","OPEditor/node_modules/color-name/index.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css","OPEditor/node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css","OPEditor/node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css","OPEditor/node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css","OPEditor/node_modules/@ckeditor/ckeditor5-heading/theme/heading.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/image.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagecustomresizeform.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageinsert.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageplaceholder.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css","OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css","OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/link.css","OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css","OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkform.css","OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css","OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/documentlist.css","OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/list.css","OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/listproperties.css","OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/liststyles.css","OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/todolist.css","OPEditor/node_modules/@ckeditor/ckeditor5-mention/theme/mention.css","OPEditor/node_modules/@ckeditor/ckeditor5-mention/theme/mentionui.css","OPEditor/node_modules/@ckeditor/ckeditor5-page-break/theme/pagebreak.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/form.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/formrow.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/table.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableform.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/arialiveannouncer/arialiveannouncer.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/autocomplete/autocomplete.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/listitembutton.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/collapsible/collapsible.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorselector/colorselector.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dialog/dialog.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dialog/dialogactions.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/accessibilityhelp.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/highlightedtext/highlightedtext.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/input/input.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubar.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenu.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenubutton.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenulistitem.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenulistitembutton.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenupanel.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/search/search.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/spinner/spinner.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/textarea/textarea.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css","OPEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widget.css","OPEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css","OPEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css","OPEditor/node_modules/css-loader/dist/runtime/api.js","OPEditor/node_modules/css-loader/dist/runtime/getUrl.js","OPEditor/node_modules/css-loader/dist/runtime/sourceMaps.js","OPEditor/node_modules/lz-string/libs/lz-string.js","OPEditor/node_modules/markdown-it-task-lists/index.js","OPEditor/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","OPEditor/node_modules/style-loader/dist/runtime/insertBySelector.js","OPEditor/node_modules/style-loader/dist/runtime/insertStyleElement.js","OPEditor/node_modules/style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js","OPEditor/node_modules/style-loader/dist/runtime/singletonStyleDomAPI.js","OPEditor/webpack/bootstrap","OPEditor/webpack/runtime/compat get default export","OPEditor/webpack/runtime/define property getters","OPEditor/webpack/runtime/hasOwnProperty shorthand","OPEditor/webpack/runtime/make namespace object","OPEditor/webpack/runtime/jsonp chunk loading","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/env.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/diff.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/spy.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/uid.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/priorities.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/inserttopriorityarray.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/version.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js","OPEditor/node_modules/lodash-es/isObject.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/count.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js","OPEditor/node_modules/lodash-es/_freeGlobal.js","OPEditor/node_modules/lodash-es/_root.js","OPEditor/node_modules/lodash-es/_Symbol.js","OPEditor/node_modules/lodash-es/_getRawTag.js","OPEditor/node_modules/lodash-es/_objectToString.js","OPEditor/node_modules/lodash-es/_baseGetTag.js","OPEditor/node_modules/lodash-es/isArray.js","OPEditor/node_modules/lodash-es/isObjectLike.js","OPEditor/node_modules/lodash-es/isString.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js","OPEditor/node_modules/lodash-es/_overArg.js","OPEditor/node_modules/lodash-es/_getPrototype.js","OPEditor/node_modules/lodash-es/isPlainObject.js","OPEditor/node_modules/lodash-es/eq.js","OPEditor/node_modules/lodash-es/_assocIndexOf.js","OPEditor/node_modules/lodash-es/_listCacheDelete.js","OPEditor/node_modules/lodash-es/_ListCache.js","OPEditor/node_modules/lodash-es/_listCacheClear.js","OPEditor/node_modules/lodash-es/_listCacheGet.js","OPEditor/node_modules/lodash-es/_listCacheHas.js","OPEditor/node_modules/lodash-es/_listCacheSet.js","OPEditor/node_modules/lodash-es/isFunction.js","OPEditor/node_modules/lodash-es/_coreJsData.js","OPEditor/node_modules/lodash-es/_isMasked.js","OPEditor/node_modules/lodash-es/_toSource.js","OPEditor/node_modules/lodash-es/_baseIsNative.js","OPEditor/node_modules/lodash-es/_getNative.js","OPEditor/node_modules/lodash-es/_getValue.js","OPEditor/node_modules/lodash-es/_Map.js","OPEditor/node_modules/lodash-es/_nativeCreate.js","OPEditor/node_modules/lodash-es/_hashGet.js","OPEditor/node_modules/lodash-es/_hashHas.js","OPEditor/node_modules/lodash-es/_Hash.js","OPEditor/node_modules/lodash-es/_hashClear.js","OPEditor/node_modules/lodash-es/_hashDelete.js","OPEditor/node_modules/lodash-es/_hashSet.js","OPEditor/node_modules/lodash-es/_getMapData.js","OPEditor/node_modules/lodash-es/_isKeyable.js","OPEditor/node_modules/lodash-es/_MapCache.js","OPEditor/node_modules/lodash-es/_mapCacheClear.js","OPEditor/node_modules/lodash-es/_mapCacheDelete.js","OPEditor/node_modules/lodash-es/_mapCacheGet.js","OPEditor/node_modules/lodash-es/_mapCacheHas.js","OPEditor/node_modules/lodash-es/_mapCacheSet.js","OPEditor/node_modules/lodash-es/_Stack.js","OPEditor/node_modules/lodash-es/_stackClear.js","OPEditor/node_modules/lodash-es/_stackDelete.js","OPEditor/node_modules/lodash-es/_stackGet.js","OPEditor/node_modules/lodash-es/_stackHas.js","OPEditor/node_modules/lodash-es/_stackSet.js","OPEditor/node_modules/lodash-es/_defineProperty.js","OPEditor/node_modules/lodash-es/_baseAssignValue.js","OPEditor/node_modules/lodash-es/_assignValue.js","OPEditor/node_modules/lodash-es/_copyObject.js","OPEditor/node_modules/lodash-es/_baseIsArguments.js","OPEditor/node_modules/lodash-es/isArguments.js","OPEditor/node_modules/lodash-es/isBuffer.js","OPEditor/node_modules/lodash-es/stubFalse.js","OPEditor/node_modules/lodash-es/_isIndex.js","OPEditor/node_modules/lodash-es/isLength.js","OPEditor/node_modules/lodash-es/_baseIsTypedArray.js","OPEditor/node_modules/lodash-es/_baseUnary.js","OPEditor/node_modules/lodash-es/_nodeUtil.js","OPEditor/node_modules/lodash-es/isTypedArray.js","OPEditor/node_modules/lodash-es/_arrayLikeKeys.js","OPEditor/node_modules/lodash-es/_baseTimes.js","OPEditor/node_modules/lodash-es/_isPrototype.js","OPEditor/node_modules/lodash-es/_nativeKeys.js","OPEditor/node_modules/lodash-es/_baseKeys.js","OPEditor/node_modules/lodash-es/isArrayLike.js","OPEditor/node_modules/lodash-es/keys.js","OPEditor/node_modules/lodash-es/_baseKeysIn.js","OPEditor/node_modules/lodash-es/_nativeKeysIn.js","OPEditor/node_modules/lodash-es/keysIn.js","OPEditor/node_modules/lodash-es/_cloneBuffer.js","OPEditor/node_modules/lodash-es/_copyArray.js","OPEditor/node_modules/lodash-es/stubArray.js","OPEditor/node_modules/lodash-es/_getSymbols.js","OPEditor/node_modules/lodash-es/_arrayFilter.js","OPEditor/node_modules/lodash-es/_arrayPush.js","OPEditor/node_modules/lodash-es/_getSymbolsIn.js","OPEditor/node_modules/lodash-es/_baseGetAllKeys.js","OPEditor/node_modules/lodash-es/_getAllKeys.js","OPEditor/node_modules/lodash-es/_getAllKeysIn.js","OPEditor/node_modules/lodash-es/_DataView.js","OPEditor/node_modules/lodash-es/_Promise.js","OPEditor/node_modules/lodash-es/_Set.js","OPEditor/node_modules/lodash-es/_WeakMap.js","OPEditor/node_modules/lodash-es/_getTag.js","OPEditor/node_modules/lodash-es/_initCloneArray.js","OPEditor/node_modules/lodash-es/_Uint8Array.js","OPEditor/node_modules/lodash-es/_cloneArrayBuffer.js","OPEditor/node_modules/lodash-es/_cloneRegExp.js","OPEditor/node_modules/lodash-es/_cloneSymbol.js","OPEditor/node_modules/lodash-es/_cloneTypedArray.js","OPEditor/node_modules/lodash-es/_initCloneByTag.js","OPEditor/node_modules/lodash-es/_cloneDataView.js","OPEditor/node_modules/lodash-es/_baseCreate.js","OPEditor/node_modules/lodash-es/_initCloneObject.js","OPEditor/node_modules/lodash-es/isMap.js","OPEditor/node_modules/lodash-es/_baseIsMap.js","OPEditor/node_modules/lodash-es/isSet.js","OPEditor/node_modules/lodash-es/_baseIsSet.js","OPEditor/node_modules/lodash-es/_baseClone.js","OPEditor/node_modules/lodash-es/_copySymbolsIn.js","OPEditor/node_modules/lodash-es/_baseAssignIn.js","OPEditor/node_modules/lodash-es/_copySymbols.js","OPEditor/node_modules/lodash-es/_baseAssign.js","OPEditor/node_modules/lodash-es/_arrayEach.js","OPEditor/node_modules/lodash-es/cloneDeepWith.js","OPEditor/node_modules/lodash-es/isElement.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/config.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/iscomment.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/isvisible.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/toarray.js","OPEditor/node_modules/lodash-es/_assignMergeValue.js","OPEditor/node_modules/lodash-es/_baseFor.js","OPEditor/node_modules/lodash-es/_createBaseFor.js","OPEditor/node_modules/lodash-es/_safeGet.js","OPEditor/node_modules/lodash-es/_baseMergeDeep.js","OPEditor/node_modules/lodash-es/isArrayLikeObject.js","OPEditor/node_modules/lodash-es/toPlainObject.js","OPEditor/node_modules/lodash-es/_baseMerge.js","OPEditor/node_modules/lodash-es/identity.js","OPEditor/node_modules/lodash-es/_overRest.js","OPEditor/node_modules/lodash-es/constant.js","OPEditor/node_modules/lodash-es/_baseSetToString.js","OPEditor/node_modules/lodash-es/_shortOut.js","OPEditor/node_modules/lodash-es/_setToString.js","OPEditor/node_modules/lodash-es/_baseRest.js","OPEditor/node_modules/lodash-es/_apply.js","OPEditor/node_modules/lodash-es/_createAssigner.js","OPEditor/node_modules/lodash-es/_isIterateeCall.js","OPEditor/node_modules/lodash-es/merge.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/language.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/locale.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/collection.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/first.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/tomap.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/delay.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/unicode.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/plugin.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/command.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/context.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css?fb4f","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/typecheckable.js","OPEditor/node_modules/lodash-es/clone.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/node.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/text.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js","OPEditor/node_modules/lodash-es/isSymbol.js","OPEditor/node_modules/lodash-es/_isKey.js","OPEditor/node_modules/lodash-es/memoize.js","OPEditor/node_modules/lodash-es/_stringToPath.js","OPEditor/node_modules/lodash-es/_memoizeCapped.js","OPEditor/node_modules/lodash-es/_arrayMap.js","OPEditor/node_modules/lodash-es/_baseToString.js","OPEditor/node_modules/lodash-es/toString.js","OPEditor/node_modules/lodash-es/_castPath.js","OPEditor/node_modules/lodash-es/_toKey.js","OPEditor/node_modules/lodash-es/_baseGet.js","OPEditor/node_modules/lodash-es/_baseSlice.js","OPEditor/node_modules/lodash-es/_baseUnset.js","OPEditor/node_modules/lodash-es/_parent.js","OPEditor/node_modules/lodash-es/last.js","OPEditor/node_modules/lodash-es/get.js","OPEditor/node_modules/lodash-es/set.js","OPEditor/node_modules/lodash-es/_baseSet.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js","OPEditor/node_modules/lodash-es/unset.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/element.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/position.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/range.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/document.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css?3211","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/isvalidattributename.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js","OPEditor/node_modules/lodash-es/assignIn.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js","OPEditor/node_modules/lodash-es/now.js","OPEditor/node_modules/lodash-es/_trimmedEndIndex.js","OPEditor/node_modules/lodash-es/_baseTrim.js","OPEditor/node_modules/lodash-es/toNumber.js","OPEditor/node_modules/lodash-es/debounce.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js","OPEditor/node_modules/lodash-es/_SetCache.js","OPEditor/node_modules/lodash-es/_setCacheAdd.js","OPEditor/node_modules/lodash-es/_setCacheHas.js","OPEditor/node_modules/lodash-es/_arraySome.js","OPEditor/node_modules/lodash-es/_cacheHas.js","OPEditor/node_modules/lodash-es/_equalArrays.js","OPEditor/node_modules/lodash-es/_mapToArray.js","OPEditor/node_modules/lodash-es/_setToArray.js","OPEditor/node_modules/lodash-es/_equalByTag.js","OPEditor/node_modules/lodash-es/_equalObjects.js","OPEditor/node_modules/lodash-es/_baseIsEqualDeep.js","OPEditor/node_modules/lodash-es/_baseIsEqual.js","OPEditor/node_modules/lodash-es/isEqualWith.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/datatransfer.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/tabobserver.js","OPEditor/node_modules/lodash-es/cloneDeep.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/view.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/typecheckable.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/node.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/splicearray.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/text.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/element.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/position.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/range.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js","OPEditor/node_modules/lodash-es/isEqual.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/history.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/document.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/model.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertobject.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js","OPEditor/node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js","OPEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/watchdog.js","OPEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/utils/getsubnodes.js","OPEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/utils/areconnectedthroughproperties.js","OPEditor/node_modules/lodash-es/throttle.js","OPEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/editorwatchdog.js","OPEditor/node_modules/@ckeditor/ckeditor5-watchdog/src/contextwatchdog.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/accessibility.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/index.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/bold.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/color-palette.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/image-upload.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/text-alternative.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/loupe.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/previous-arrow.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/next-arrow.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/importexport.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/paragraph.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/plus.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/text.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-left.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-right.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-custom.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/drag-indicator.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/redo.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/undo.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/bulletedlist.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/numberedlist.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/todolist.svg","OPEditor/node_modules/@ckeditor/ckeditor5-core/theme/icons/table.svg","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/template.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css?1573","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/view.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/csstransitiondisablermixin.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/addkeyboardhandlingforgrid.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css?25c7","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/button/buttonlabelview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css?5964","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css?cfa1","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dialog/dialogactions.css?ccdf","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dialog/dialogactionsview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dialog/dialogcontentview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dialog/dialog.css?0092","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dialog/dialogview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/draggableviewmixin.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dialog/dialog.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/listitembutton.css?ad50","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/button/listitembuttonview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenulistitembutton.css?7dec","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistitembuttonview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css?265c","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/accessibilityhelp/accessibilityhelpcontentview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/accessibility.svg","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/accessibilityhelp.css?3a78","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/accessibilityhelp/accessibilityhelp.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css?037c","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/button/filedialogbuttonview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/collapsible/collapsible.css?168c","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/collapsible/collapsibleview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css?bdb7","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js","OPEditor/node_modules/color-parse/index.mjs","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorpicker/utils.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css?a8c3","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/input/inputbase.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/input/input.css?fba5","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/input/inputview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/inputnumber/inputnumberview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/textarea/textarea.css?073b","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css?7b22","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css?d697","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/list/listitemgroupview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css?55c1","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css?6946","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css?ef28","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css?c93a","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js","OPEditor/node_modules/vanilla-colorful/lib/utils/math.js","OPEditor/node_modules/vanilla-colorful/lib/utils/convert.js","OPEditor/node_modules/vanilla-colorful/lib/utils/compare.js","OPEditor/node_modules/vanilla-colorful/lib/utils/dom.js","OPEditor/node_modules/vanilla-colorful/lib/components/slider.js","OPEditor/node_modules/vanilla-colorful/lib/components/hue.js","OPEditor/node_modules/vanilla-colorful/lib/components/saturation.js","OPEditor/node_modules/vanilla-colorful/lib/styles/color-picker.js","OPEditor/node_modules/vanilla-colorful/lib/components/color-picker.js","OPEditor/node_modules/vanilla-colorful/lib/styles/hue.js","OPEditor/node_modules/vanilla-colorful/lib/styles/saturation.js","OPEditor/node_modules/vanilla-colorful/lib/entrypoints/hex.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css?d045","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorpicker/colorpickerview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorselector/documentcolorcollection.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorselector/colorgridsfragmentview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorselector/colorpickerfragmentview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/colorselector/colorselector.css?5624","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/colorselector/colorselectorview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css?ccd4","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css?78a5","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/tooltipmanager.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/poweredby.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/verifylicense.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/icons/project-logo.svg","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/arialiveannouncer/arialiveannouncer.css?7e57","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/arialiveannouncer.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenulistitem.css?4539","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistitemview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/editorui.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css?5c2b","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/model.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css?b32e","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css?0336","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css?f6fc","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/search/text/searchtextqueryview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/search/searchinfoview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/search/searchresultsview.js","OPEditor/node_modules/lodash-es/escapeRegExp.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/search/search.css?b298","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/search/text/searchtextview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/autocomplete/autocomplete.css?5b5d","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/autocomplete/autocompleteview.js","OPEditor/node_modules/lodash-es/escape.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/highlightedtext/highlightedtext.css?458a","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/spinner/spinner.css?516a","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css?1be2","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenubutton.css?bfd2","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenubuttonview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenupanel.css?d7e2","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenupanelview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenu.css?dc60","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenuview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistview.js","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistitemfiledialogbuttonview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubar.css?e89d","OPEditor/node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarview.js","OPEditor/node_modules/@ckeditor/ckeditor5-editor-decoupled/src/decouplededitorui.js","OPEditor/node_modules/@ckeditor/ckeditor5-editor-decoupled/src/decouplededitoruiview.js","OPEditor/node_modules/@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor.js","OPEditor/node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/utils.js","OPEditor/src/plugins/op-macro-toc-plugin.js","OPEditor/src/plugins/op-macro-embedded-table/utils.js","OPEditor/src/plugins/op-context/op-context.js","OPEditor/src/plugins/op-macro-embedded-table/embedded-table-editing.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/inserttextcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/inserttextobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/input.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/delete.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/typing.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js","OPEditor/node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js","OPEditor/node_modules/@ckeditor/ckeditor5-enter/src/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-enter/src/enter.js","OPEditor/node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css?963f","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js","OPEditor/node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widget.css?ede2","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/widget.js","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/sizeview.js","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css?0e2a","OPEditor/node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js","OPEditor/src/helpers/create-toolbar-edit-button.js","OPEditor/src/icons/edit.svg","OPEditor/src/helpers/create-toolbar.js","OPEditor/src/plugins/op-macro-embedded-table/embedded-table-toolbar.js","OPEditor/src/plugins/op-macro-wp-button/utils.js","OPEditor/src/plugins/op-macro-wp-button/op-macro-wp-button-editing.js","OPEditor/src/plugins/op-macro-wp-button/op-macro-wp-button-toolbar.js","OPEditor/node_modules/@ckeditor/ckeditor5-upload/src/filereader.js","OPEditor/node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js","OPEditor/src/plugins/op-upload-resource-adapter.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js","OPEditor/node_modules/lodash-es/_baseForOwn.js","OPEditor/node_modules/lodash-es/_isStrictComparable.js","OPEditor/node_modules/lodash-es/_matchesStrictComparable.js","OPEditor/node_modules/lodash-es/_baseMatches.js","OPEditor/node_modules/lodash-es/_getMatchData.js","OPEditor/node_modules/lodash-es/_baseIsMatch.js","OPEditor/node_modules/lodash-es/_baseHasIn.js","OPEditor/node_modules/lodash-es/hasIn.js","OPEditor/node_modules/lodash-es/_hasPath.js","OPEditor/node_modules/lodash-es/property.js","OPEditor/node_modules/lodash-es/_baseProperty.js","OPEditor/node_modules/lodash-es/_basePropertyDeep.js","OPEditor/node_modules/lodash-es/_baseIteratee.js","OPEditor/node_modules/lodash-es/_baseMatchesProperty.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardmarkersutils.js","OPEditor/node_modules/lodash-es/mapValues.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/lineview.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/dragdroptarget.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/dragdropblocktoolbar.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css?1074","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js","OPEditor/node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js","OPEditor/node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-undo/src/undoui.js","OPEditor/node_modules/@ckeditor/ckeditor5-undo/src/undo.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageutils.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/autoimage.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css?1898","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css?ec97","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/converters.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/replaceimagesourcecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagesizeattributes.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imagetypecommand.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageplaceholder.css?6862","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageplaceholder.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageblockediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageinsert.css?db94","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageinsert/ui/imageinsertformview.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageinsert/imageinsertui.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/image.css?c289","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/image/imageinlineediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionutils.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption/toggleimagecaptioncommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionui.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css?a848","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css?4c71","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css?71ed","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css?c748","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageupload.js","OPEditor/node_modules/lodash-es/_baseEach.js","OPEditor/node_modules/lodash-es/_createBaseEach.js","OPEditor/node_modules/lodash-es/_baseMap.js","OPEditor/node_modules/lodash-es/map.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/utils/tryparsedimensionwithunit.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/utils/getselectedimageeditornodes.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagecustomresizeform.css?d645","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/ui/imagecustomresizeformview.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/imagecustomresizeui.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/utils/getselectedimagewidthinunits.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize/utils/getselectedimagepossibleresizerange.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css?266c","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css?06f1","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js","OPEditor/src/plugins/op-macro-child-pages/utils.js","OPEditor/src/plugins/op-macro-child-pages/op-macro-child-pages-editing.js","OPEditor/src/plugins/op-macro-child-pages/op-macro-child-pages-toolbar.js","OPEditor/node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js","OPEditor/node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg","OPEditor/node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js","OPEditor/node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js","OPEditor/node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css?9af2","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeui.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/code.svg","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js","OPEditor/node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css?c6a4","OPEditor/node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js","OPEditor/node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js","OPEditor/node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-heading/theme/heading.css?e875","OPEditor/node_modules/@ckeditor/ckeditor5-heading/src/headingui.js","OPEditor/node_modules/@ckeditor/ckeditor5-heading/src/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-heading/src/title.js","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js","OPEditor/node_modules/lodash-es/_hasUnicode.js","OPEditor/node_modules/lodash-es/_unicodeToArray.js","OPEditor/node_modules/lodash-es/_stringToArray.js","OPEditor/node_modules/lodash-es/_asciiToArray.js","OPEditor/node_modules/lodash-es/upperFirst.js","OPEditor/node_modules/lodash-es/_createCaseFirst.js","OPEditor/node_modules/lodash-es/_castSlice.js","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/link.css?2daf","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/linkediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkform.css?39f8","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css?2570","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js","OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg","OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/linkui.js","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/autolink.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css?ce70","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/utils/listwalker.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/utils/model.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listindentcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listmergecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listsplitcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listutils.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/utils/view.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/utils/postfixers.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/converters.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/documentlist.css?91b8","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/list.css?d678","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list/listui.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/listproperties/utils/style.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/listproperties.css?a646","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/liststyles.css?4678","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/todolist/checktodolistcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/todolist/todocheckboxchangeobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/todolist/todolistediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/todolist/todolistui.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-list/theme/todolist.css?3b95","OPEditor/src/icons/code-block.svg","OPEditor/src/plugins/code-block/widget.js","OPEditor/src/plugins/code-block/click-observer.js","OPEditor/src/plugins/code-block/code-block-editing.js","OPEditor/src/plugins/code-block/converters.js","OPEditor/src/plugins/code-block/code-block-toolbar.js","OPEditor/src/helpers/button-disabler.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/tableproperties.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/common.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableutils.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-handler.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css?4123","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/converters/table-headings-refresh-handler.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css?6cac","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableui.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css?25dc","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableselection.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/table.css?c755","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css?4c76","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/ui/colorinputview.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/ui/table-properties.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/formrow.css?fd9a","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/ui/formrowview.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/form.css?849a","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableform.css?a550","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css?2f3d","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/ui/contextualballoon.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/utils/table-properties.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-cell-properties.svg","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellpropertycommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellwidth/commands/tablecellwidthcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellwidth/tablecellwidthediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellpaddingcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellheightcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellborderstylecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellbordercolorcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellborderwidthcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablepropertycommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablebackgroundcolorcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablebordercolorcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableborderstylecommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableborderwidthcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablewidthcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableheightcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablealignmentcommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css?4115","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/icons/table-properties.svg","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesui.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css?8383","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css?e3e0","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/utils.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removemsattributes.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/br.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googlesheetsnormalizer.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removegooglesheetstag.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removexmlns.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeinvalidtablewidth.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removestyleblock.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js","OPEditor/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js","OPEditor/node_modules/turndown/lib/turndown.browser.es.js","OPEditor/src/commonmark/utils/preprocessor.js","OPEditor/src/commonmark/utils/page-breaks.js","OPEditor/node_modules/mdurl/lib/decode.mjs","OPEditor/node_modules/mdurl/lib/encode.mjs","OPEditor/node_modules/mdurl/lib/format.mjs","OPEditor/node_modules/mdurl/lib/parse.mjs","OPEditor/node_modules/uc.micro/categories/P/regex.mjs","OPEditor/node_modules/uc.micro/categories/S/regex.mjs","OPEditor/node_modules/uc.micro/properties/Any/regex.mjs","OPEditor/node_modules/uc.micro/categories/Cc/regex.mjs","OPEditor/node_modules/uc.micro/categories/Cf/regex.mjs","OPEditor/node_modules/uc.micro/categories/Z/regex.mjs","OPEditor/node_modules/entities/lib/esm/generated/decode-data-html.js","OPEditor/node_modules/entities/lib/esm/generated/decode-data-xml.js","OPEditor/node_modules/entities/lib/esm/decode_codepoint.js","OPEditor/node_modules/entities/lib/esm/decode.js","OPEditor/node_modules/entities/lib/esm/generated/encode-html.js","OPEditor/node_modules/entities/lib/esm/escape.js","OPEditor/node_modules/entities/lib/esm/index.js","OPEditor/node_modules/markdown-it/lib/common/utils.mjs","OPEditor/node_modules/markdown-it/lib/helpers/parse_link_label.mjs","OPEditor/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs","OPEditor/node_modules/markdown-it/lib/helpers/parse_link_title.mjs","OPEditor/node_modules/markdown-it/lib/renderer.mjs","OPEditor/node_modules/markdown-it/lib/ruler.mjs","OPEditor/node_modules/markdown-it/lib/token.mjs","OPEditor/node_modules/markdown-it/lib/rules_core/state_core.mjs","OPEditor/node_modules/markdown-it/lib/rules_core/normalize.mjs","OPEditor/node_modules/markdown-it/lib/rules_core/linkify.mjs","OPEditor/node_modules/markdown-it/lib/rules_core/replacements.mjs","OPEditor/node_modules/markdown-it/lib/rules_core/smartquotes.mjs","OPEditor/node_modules/markdown-it/lib/parser_core.mjs","OPEditor/node_modules/markdown-it/lib/rules_core/block.mjs","OPEditor/node_modules/markdown-it/lib/rules_core/inline.mjs","OPEditor/node_modules/markdown-it/lib/rules_core/text_join.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/state_block.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/table.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/list.mjs","OPEditor/node_modules/markdown-it/lib/common/html_blocks.mjs","OPEditor/node_modules/markdown-it/lib/common/html_re.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/html_block.mjs","OPEditor/node_modules/markdown-it/lib/parser_block.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/code.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/fence.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/blockquote.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/hr.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/reference.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/heading.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/lheading.mjs","OPEditor/node_modules/markdown-it/lib/rules_block/paragraph.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/state_inline.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/text.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/linkify.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/escape.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/emphasis.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/autolink.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/entity.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs","OPEditor/node_modules/markdown-it/lib/parser_inline.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/newline.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/backticks.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/link.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/image.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/html_inline.mjs","OPEditor/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs","OPEditor/node_modules/linkify-it/index.mjs","OPEditor/node_modules/linkify-it/lib/re.mjs","OPEditor/node_modules/punycode.js/punycode.es6.js","OPEditor/node_modules/markdown-it/lib/index.mjs","OPEditor/node_modules/markdown-it/lib/presets/default.mjs","OPEditor/node_modules/markdown-it/lib/presets/zero.mjs","OPEditor/node_modules/markdown-it/lib/presets/commonmark.mjs","OPEditor/src/commonmark/commonmarkdataprocessor.js","OPEditor/src/commonmark/utils/fix-tasklist-whitespaces.js","OPEditor/src/commonmark/utils/fix-breaks.js","OPEditor/src/icons/source.svg","OPEditor/node_modules/@ckeditor/ckeditor5-mention/src/mentioncommand.js","OPEditor/node_modules/@ckeditor/ckeditor5-mention/src/mentionediting.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-mention/theme/mentionui.css?882d","OPEditor/node_modules/@ckeditor/ckeditor5-mention/src/ui/mentionsview.js","OPEditor/node_modules/@ckeditor/ckeditor5-mention/src/ui/domwrapperview.js","OPEditor/node_modules/@ckeditor/ckeditor5-mention/src/ui/mentionlistitemview.js","OPEditor/node_modules/@ckeditor/ckeditor5-mention/src/mentionui.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-mention/theme/mention.css?e2d7","OPEditor/node_modules/@ckeditor/ckeditor5-page-break/src/pagebreakcommand.js","webpack:///OPEditor/node_modules/@ckeditor/ckeditor5-page-break/theme/pagebreak.css?e43e","OPEditor/node_modules/@ckeditor/ckeditor5-page-break/src/pagebreakediting.js","OPEditor/node_modules/@ckeditor/ckeditor5-page-break/src/pagebreakui.js","OPEditor/node_modules/@ckeditor/ckeditor5-page-break/theme/icons/pagebreak.svg","OPEditor/node_modules/@ckeditor/ckeditor5-autosave/src/autosave.js","OPEditor/src/plugins/op-content-revisions/utils.js","OPEditor/src/plugins/op-content-revisions/storage.js","OPEditor/src/plugins/op-content-revisions/ui.js","OPEditor/src/icons/revisions.svg","OPEditor/src/plugins/op-content-revisions/command.js","OPEditor/src/plugins/op-content-revisions/op-content-revisions.js","OPEditor/src/op-plugins.js","OPEditor/src/plugins/op-macro-embedded-table/embedded-table-plugin.js","OPEditor/src/plugins/op-macro-wp-button/op-macro-wp-button-plugin.js","OPEditor/src/plugins/op-macro-child-pages/op-macro-child-pages-plugin.js","OPEditor/src/plugins/op-upload-plugin.js","OPEditor/src/plugins/op-attachment-listener-plugin.js","OPEditor/node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/code.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js","OPEditor/node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js","OPEditor/node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js","OPEditor/node_modules/@ckeditor/ckeditor5-heading/src/heading.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageblock.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageinline.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js","OPEditor/node_modules/@ckeditor/ckeditor5-image/src/imageresize.js","OPEditor/src/plugins/op-image-attachment-lookup/op-image-attachment-lookup-plugin.js","OPEditor/node_modules/@ckeditor/ckeditor5-link/src/link.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/list.js","OPEditor/node_modules/@ckeditor/ckeditor5-list/src/todolist.js","OPEditor/node_modules/@ckeditor/ckeditor5-page-break/src/pagebreak.js","OPEditor/node_modules/@ckeditor/ckeditor5-mention/src/mention.js","OPEditor/src/mentions/mentions-caster.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js","OPEditor/node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js","OPEditor/src/plugins/op-help-link-plugin/op-help-link-plugin.js","OPEditor/src/icons/help.svg","OPEditor/src/plugins/op-preview.plugin.js","OPEditor/src/icons/preview.svg","OPEditor/src/plugins/op-source-code.plugin.js","OPEditor/src/icons/wysiwyg.svg","OPEditor/src/plugins/code-block/code-block.js","OPEditor/src/commonmark/commonmark.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/table.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tableproperties.js","OPEditor/node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties.js","OPEditor/src/plugins/op-macro-list-plugin.js","OPEditor/src/plugins/op-custom-css-classes-plugin.js","OPEditor/src/mentions/mentions-item-renderer.js","OPEditor/src/op-ckeditor-config.js","OPEditor/src/mentions/user-mentions.js","OPEditor/src/mentions/work-package-mentions.js","OPEditor/src/mentions/emoji-mentions.js","OPEditor/src/op-config-customizer.js","OPEditor/src/op-ckeditor.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OPEditor\"] = factory();\n\telse\n\t\troot[\"OPEditor\"] = factory();\n})(self, () => {\nreturn ","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","/* MIT license */\n/* eslint-disable no-mixed-operators */\nconst cssKeywords = require('color-name');\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nconst reverseKeywords = {};\nfor (const key of Object.keys(cssKeywords)) {\n\treverseKeywords[cssKeywords[key]] = key;\n}\n\nconst convert = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\nmodule.exports = convert;\n\n// Hide .channels and .labels properties\nfor (const model of Object.keys(convert)) {\n\tif (!('channels' in convert[model])) {\n\t\tthrow new Error('missing channels property: ' + model);\n\t}\n\n\tif (!('labels' in convert[model])) {\n\t\tthrow new Error('missing channel labels property: ' + model);\n\t}\n\n\tif (convert[model].labels.length !== convert[model].channels) {\n\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t}\n\n\tconst {channels, labels} = convert[model];\n\tdelete convert[model].channels;\n\tdelete convert[model].labels;\n\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\tObject.defineProperty(convert[model], 'labels', {value: labels});\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst min = Math.min(r, g, b);\n\tconst max = Math.max(r, g, b);\n\tconst delta = max - min;\n\tlet h;\n\tlet s;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst l = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tlet rdif;\n\tlet gdif;\n\tlet bdif;\n\tlet h;\n\tlet s;\n\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst v = Math.max(r, g, b);\n\tconst diff = v - Math.min(r, g, b);\n\tconst diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tconst r = rgb[0];\n\tconst g = rgb[1];\n\tlet b = rgb[2];\n\tconst h = convert.rgb.hsl(rgb)[0];\n\tconst w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\n\tconst k = Math.min(1 - r, 1 - g, 1 - b);\n\tconst c = (1 - r - k) / (1 - k) || 0;\n\tconst m = (1 - g - k) / (1 - k) || 0;\n\tconst y = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\nfunction comparativeDistance(x, y) {\n\t/*\n\t\tSee https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n\t*/\n\treturn (\n\t\t((x[0] - y[0]) ** 2) +\n\t\t((x[1] - y[1]) ** 2) +\n\t\t((x[2] - y[2]) ** 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tconst reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tlet currentClosestDistance = Infinity;\n\tlet currentClosestKeyword;\n\n\tfor (const keyword of Object.keys(cssKeywords)) {\n\t\tconst value = cssKeywords[keyword];\n\n\t\t// Compute comparative distance\n\t\tconst distance = comparativeDistance(rgb, value);\n\n\t\t// Check if its less, if so set as closest\n\t\tif (distance < currentClosestDistance) {\n\t\t\tcurrentClosestDistance = distance;\n\t\t\tcurrentClosestKeyword = keyword;\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tlet r = rgb[0] / 255;\n\tlet g = rgb[1] / 255;\n\tlet b = rgb[2] / 255;\n\n\t// Assume sRGB\n\tr = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);\n\n\tconst x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tconst y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tconst z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tconst xyz = convert.rgb.xyz(rgb);\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tconst h = hsl[0] / 360;\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\tlet t2;\n\tlet t3;\n\tlet val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tconst t1 = 2 * l - t2;\n\n\tconst rgb = [0, 0, 0];\n\tfor (let i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tconst h = hsl[0];\n\tlet s = hsl[1] / 100;\n\tlet l = hsl[2] / 100;\n\tlet smin = s;\n\tconst lmin = Math.max(l, 0.01);\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tconst v = (l + s) / 2;\n\tconst sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tconst h = hsv[0] / 60;\n\tconst s = hsv[1] / 100;\n\tlet v = hsv[2] / 100;\n\tconst hi = Math.floor(h) % 6;\n\n\tconst f = h - Math.floor(h);\n\tconst p = 255 * v * (1 - s);\n\tconst q = 255 * v * (1 - (s * f));\n\tconst t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tconst h = hsv[0];\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\tconst vmin = Math.max(v, 0.01);\n\tlet sl;\n\tlet l;\n\n\tl = (2 - s) * v;\n\tconst lmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tconst h = hwb[0] / 360;\n\tlet wh = hwb[1] / 100;\n\tlet bl = hwb[2] / 100;\n\tconst ratio = wh + bl;\n\tlet f;\n\n\t// Wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\tconst i = Math.floor(6 * h);\n\tconst v = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tconst n = wh + f * (v - wh); // Linear interpolation\n\n\tlet r;\n\tlet g;\n\tlet b;\n\t/* eslint-disable max-statements-per-line,no-multi-spaces */\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\t/* eslint-enable max-statements-per-line,no-multi-spaces */\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tconst c = cmyk[0] / 100;\n\tconst m = cmyk[1] / 100;\n\tconst y = cmyk[2] / 100;\n\tconst k = cmyk[3] / 100;\n\n\tconst r = 1 - Math.min(1, c * (1 - k) + k);\n\tconst g = 1 - Math.min(1, m * (1 - k) + k);\n\tconst b = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\tlet r;\n\tlet g;\n\tlet b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// Assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet x;\n\tlet y;\n\tlet z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tconst y2 = y ** 3;\n\tconst x2 = x ** 3;\n\tconst z2 = z ** 3;\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet h;\n\n\tconst hr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst c = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tconst l = lch[0];\n\tconst c = lch[1];\n\tconst h = lch[2];\n\n\tconst hr = h / 360 * 2 * Math.PI;\n\tconst a = c * Math.cos(hr);\n\tconst b = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args, saturation = null) {\n\tconst [r, g, b] = args;\n\tlet value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tlet ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// Optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tconst r = args[0];\n\tconst g = args[1];\n\tconst b = args[2];\n\n\t// We use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tconst ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tlet color = args % 10;\n\n\t// Handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tconst mult = (~~(args > 50) + 1) * 0.5;\n\tconst r = ((color & 1) * mult) * 255;\n\tconst g = (((color >> 1) & 1) * mult) * 255;\n\tconst b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// Handle greyscale\n\tif (args >= 232) {\n\t\tconst c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tlet rem;\n\tconst r = Math.floor(args / 36) / 5 * 255;\n\tconst g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tconst b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tconst integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tconst match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tlet colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(char => {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tconst integer = parseInt(colorString, 16);\n\tconst r = (integer >> 16) & 0xFF;\n\tconst g = (integer >> 8) & 0xFF;\n\tconst b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst max = Math.max(Math.max(r, g), b);\n\tconst min = Math.min(Math.min(r, g), b);\n\tconst chroma = (max - min);\n\tlet grayscale;\n\tlet hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\n\tconst c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));\n\n\tlet f = 0;\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\n\tconst c = s * v;\n\tlet f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tconst h = hcg[0] / 360;\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tconst pure = [0, 0, 0];\n\tconst hi = (h % 1) * 6;\n\tconst v = hi % 1;\n\tconst w = 1 - v;\n\tlet mg = 0;\n\n\t/* eslint-disable max-statements-per-line */\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\t/* eslint-enable max-statements-per-line */\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst v = c + g * (1.0 - c);\n\tlet f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst l = g * (1.0 - c) + 0.5 * c;\n\tlet s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\tconst v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tconst w = hwb[1] / 100;\n\tconst b = hwb[2] / 100;\n\tconst v = 1 - b;\n\tconst c = v - w;\n\tlet g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hsv = convert.gray.hsl;\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tconst val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tconst integer = (val << 16) + (val << 8) + val;\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tconst val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n","const conversions = require('./conversions');\nconst route = require('./route');\n\nconst convert = {};\n\nconst models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\tconst result = fn(args);\n\n\t\t// We're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (let len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(fromModel => {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tconst routes = route(fromModel);\n\tconst routeModels = Object.keys(routes);\n\n\trouteModels.forEach(toModel => {\n\t\tconst fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n","const conversions = require('./conversions');\n\n/*\n\tThis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tconst graph = buildGraph();\n\tconst queue = [fromModel]; // Unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tconst current = queue.pop();\n\t\tconst adjacents = Object.keys(conversions[current]);\n\n\t\tfor (let len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tconst adjacent = adjacents[i];\n\t\t\tconst node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tconst path = [graph[toModel].parent, toModel];\n\tlet fn = conversions[graph[toModel].parent][toModel];\n\n\tlet cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tconst graph = deriveBFS(fromModel);\n\tconst conversion = {};\n\n\tconst models = Object.keys(graph);\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tconst toModel = models[i];\n\t\tconst node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// No possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css\"],\"names\":[],\"mappings\":\"AAKA,iBACC,kCAAuC,CAEvC,iBAAkB,CADlB,aAED,CAEA,0CACC,kCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content code {\\n\\tbackground-color: hsla(0, 0%, 78%, 0.3);\\n\\tpadding: .15em;\\n\\tborder-radius: 2px;\\n}\\n\\n.ck.ck-editor__editable .ck-code_selected {\\n\\tbackground-color: hsla(0, 0%, 78%, 0.5);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css\"],\"names\":[],\"mappings\":\"AAKA,uBAWC,0BAAsC,CADtC,iBAAkB,CAFlB,aAAc,CACd,cAAe,CAPf,eAAgB,CAIhB,kBAAmB,CADnB,mBAOD,CAEA,gCACC,aAAc,CACd,2BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content blockquote {\\n\\t/* See #12 */\\n\\toverflow: hidden;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-block-quote/issues/15 */\\n\\tpadding-right: 1.5em;\\n\\tpadding-left: 1.5em;\\n\\n\\tmargin-left: 0;\\n\\tmargin-right: 0;\\n\\tfont-style: italic;\\n\\tborder-left: solid 5px hsl(0, 0%, 80%);\\n}\\n\\n.ck-content[dir=\\\"rtl\\\"] blockquote {\\n\\tborder-left: 0;\\n\\tborder-right: solid 5px hsl(0, 0%, 80%);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:\"\";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}.ck.ck-clipboard-drop-target-line:before{border-style:solid;content:\"\";height:0;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-width)*-.5);width:0}[dir=ltr] .ck.ck-clipboard-drop-target-line:before{border-color:transparent transparent transparent var(--ck-clipboard-drop-target-color);border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height);left:-1px}[dir=rtl] .ck.ck-clipboard-drop-target-line:before{border-color:transparent var(--ck-clipboard-drop-target-color) transparent transparent;border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0;right:-1px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-clipboard/clipboard.css\"],\"names\":[],\"mappings\":\"AASC,8DACC,cAAe,CAEf,mBAAoB,CADpB,iBAOD,CAJC,mEACC,iBAAkB,CAClB,OACD,CAWA,qJACC,YACD,CAIF,kCAEC,mBAAoB,CADpB,iBAED,CC9BA,MACC,yCAA0C,CAC1C,yCAA0C,CAC1C,6DACD,CAOE,mEAIC,gDAAiD,CADjD,sDAAuD,CAFvD,2DAA8D,CAI9D,gBAAiB,CAHjB,wDAqBD,CAfC,yEAWC,sFAAuF,CAEvF,kBAAmB,CADnB,qKAA0K,CAX1K,UAAW,CAIX,aAAc,CAFd,QAAS,CAIT,QAAS,CADT,iBAAkB,CAElB,wDAA2D,CAE3D,0BAA2B,CAR3B,OAYD,CAOF,kEACC,gGACD,CAKA,gDACC,OAAS,CACT,sBACD,CAGD,kCAGC,gDAAiD,CADjD,sDAAuD,CADvD,QAAS,CAGT,eAwBD,CAtBC,yCAMC,kBAAmB,CALnB,UAAW,CAIX,QAAS,CAHT,iBAAkB,CAClB,uDAA0D,CAC1D,OAiBD,CArBA,mDAYE,sFAAuF,CADvF,+JAAoK,CAFpK,SAYF,CArBA,mDAmBE,sFAAuF,CADvF,+JAAmK,CAFnK,UAKF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Vertical drop target (in text).\\n\\t */\\n\\t& .ck.ck-clipboard-drop-target-position {\\n\\t\\tdisplay: inline;\\n\\t\\tposition: relative;\\n\\t\\tpointer-events: none;\\n\\n\\t\\t& span {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\twidth: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget being dragged (its preview).\\n\\t */\\n\\t& .ck-widget:-webkit-drag {\\n\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\n\\t\\t& > .ck-widget__type-around {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-clipboard-drop-target-line {\\n\\tposition: absolute;\\n\\tpointer-events: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n:root {\\n\\t--ck-clipboard-drop-target-dot-width: 12px;\\n\\t--ck-clipboard-drop-target-dot-height: 8px;\\n\\t--ck-clipboard-drop-target-color: var(--ck-color-focus-border);\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Vertical drop target (in text).\\n\\t */\\n\\t& .ck.ck-clipboard-drop-target-position {\\n\\t\\t& span {\\n\\t\\t\\tbottom: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\\n\\t\\t\\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\\n\\t\\t\\tborder: 1px solid var(--ck-clipboard-drop-target-color);\\n\\t\\t\\tbackground: var(--ck-clipboard-drop-target-color);\\n\\t\\t\\tmargin-left: -1px;\\n\\n\\t\\t\\t/* The triangle above the marker */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: '';\\n\\t\\t\\t\\twidth: 0;\\n\\t\\t\\t\\theight: 0;\\n\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\\n\\n\\t\\t\\t\\ttransform: translateX(-50%);\\n\\t\\t\\t\\tborder-color: var(--ck-clipboard-drop-target-color) transparent transparent transparent;\\n\\t\\t\\t\\tborder-width: calc(var(--ck-clipboard-drop-target-dot-height)) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width));\\n\\t\\t\\t\\tborder-style: solid;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget that it a drop target.\\n\\t */\\n\\t& .ck-widget.ck-clipboard-drop-target-range {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color) !important;\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget being dragged (its preview).\\n\\t */\\n\\t& .ck-widget:-webkit-drag {\\n\\t\\tzoom: 0.6;\\n\\t\\toutline: none !important;\\n\\t}\\n}\\n\\n.ck.ck-clipboard-drop-target-line {\\n\\theight: 0;\\n\\tborder: 1px solid var(--ck-clipboard-drop-target-color);\\n\\tbackground: var(--ck-clipboard-drop-target-color);\\n\\tmargin-top: -1px;\\n\\n\\t&::before {\\n\\t\\tcontent: '';\\n\\t\\tposition: absolute;\\n\\t\\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-width));\\n\\t\\twidth: 0;\\n\\t\\theight: 0;\\n\\t\\tborder-style: solid;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tleft: -1px;\\n\\n\\t\\t\\tborder-width: calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width)) var(--ck-clipboard-drop-target-dot-height);\\n\\t\\t\\tborder-color: transparent transparent transparent var(--ck-clipboard-drop-target-color);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tright: -1px;\\n\\n\\t\\t\\tborder-width:calc(.5 * var(--ck-clipboard-drop-target-dot-width)) var(--ck-clipboard-drop-target-dot-height) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0;\\n\\t\\t\\tborder-color: transparent var(--ck-clipboard-drop-target-color) transparent transparent;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}@media (forced-colors:active){.ck .ck-placeholder,.ck.ck-placeholder{forced-color-adjust:preserve-parent-color}}.ck .ck-placeholder:before,.ck.ck-placeholder:before{cursor:text}@media (forced-colors:none){.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text)}}@media (forced-colors:active){.ck .ck-placeholder:before,.ck.ck-placeholder:before{font-style:italic;margin-left:1px}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-engine/placeholder.css\"],\"names\":[],\"mappings\":\"AAMA,uCAEC,iBAWD,CATC,qDAIC,8BAA+B,CAF/B,MAAO,CAKP,mBAAoB,CANpB,iBAAkB,CAElB,OAKD,CAKA,wCACC,YACD,CAQD,iCACC,iBACD,CC7BC,8BACC,uCCOA,yCDLA,CACD,CCOA,qDACC,WAmBD,CDvBA,4BACC,qDCMC,6CDJD,CACD,CAZA,8BACC,qDCsBC,iBAAkB,CAMlB,eD1BD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* See ckeditor/ckeditor5#936. */\\n.ck.ck-placeholder,\\n.ck .ck-placeholder {\\n\\tposition: relative;\\n\\n\\t&::before {\\n\\t\\tposition: absolute;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tcontent: attr(data-placeholder);\\n\\n\\t\\t/* See ckeditor/ckeditor5#469. */\\n\\t\\tpointer-events: none;\\n\\t}\\n}\\n\\n/* See ckeditor/ckeditor5#1987. */\\n.ck.ck-read-only .ck-placeholder {\\n\\t&::before {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\\n/*\\n * Rules for the `ck-placeholder` are loaded before the rules for `ck-reset_all` in the base CKEditor 5 DLL build.\\n * This fix overwrites the incorrectly set `position: static` from `ck-reset_all`.\\n * See https://github.com/ckeditor/ckeditor5/issues/11418.\\n */\\n.ck.ck-reset_all .ck-placeholder {\\n\\tposition: relative;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-forced-colors {\\n\\t@media (forced-colors: active) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\\n@define-mixin ck-media-default-colors {\\n\\t@media (forced-colors: none) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\\\";\\n\\n/* See ckeditor/ckeditor5#936. */\\n.ck.ck-placeholder, .ck .ck-placeholder {\\n\\t@mixin ck-media-forced-colors {\\n\\t\\t/*\\n\\t\\t * This is needed for Edge on Windows to use the right color for the placeholder content (::before).\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/14907.\\n\\t\\t */\\n\\t\\tforced-color-adjust: preserve-parent-color;\\n\\t}\\n\\n\\t&::before {\\n\\t\\tcursor: text;\\n\\n\\t\\t@mixin ck-media-default-colors {\\n\\t\\t\\tcolor: var(--ck-color-engine-placeholder-text);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-media-forced-colors {\\n\\t\\t\\t/*\\n\\t\\t\\t * In the high contrast mode there is no telling between regular and placeholder text. Using\\n\\t\\t\\t * italic text to address that issue. See https://github.com/ckeditor/ckeditor5/issues/14907.\\n\\t\\t\\t */\\n\\t\\t\\tfont-style: italic;\\n\\n\\t\\t\\t/*\\n\\t\\t\\t * Without this margin, the caret will not show up and blink when the user puts the selection\\n\\t\\t\\t * in the placeholder (Edge on Windows). See https://github.com/ckeditor/ckeditor5/issues/14907.\\n\\t\\t\\t */\\n\\t\\t\\tmargin-left: 1px;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css\"],\"names\":[],\"mappings\":\"AAMA,qDACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Elements marked by the Renderer as hidden should be invisible in the editor. */\\n.ck.ck-editor__editable span[data-ck-unsafe-element] {\\n\\tdisplay: none;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-heading_heading1 .ck-button__label{font-size:20px}.ck.ck-heading_heading2 .ck-button__label{font-size:17px}.ck.ck-heading_heading3 .ck-button__label{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-heading/heading.css\"],\"names\":[],\"mappings\":\"AAKA,0CACC,cACD,CAEA,0CACC,cACD,CAEA,0CACC,cACD,CAEA,+BACC,eACD,CCZC,2EACC,SACD,CAEA,uEACC,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-heading_heading1 .ck-button__label {\\n\\tfont-size: 20px;\\n}\\n\\n.ck.ck-heading_heading2 .ck-button__label {\\n\\tfont-size: 17px;\\n}\\n\\n.ck.ck-heading_heading3 .ck-button__label {\\n\\tfont-size: 14px;\\n}\\n\\n.ck[class*=\\\"ck-heading_heading\\\"] {\\n\\tfont-weight: bold;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Resize dropdown's button label. */\\n.ck.ck-dropdown.ck-heading-dropdown {\\n\\t& .ck-dropdown__button .ck-button__label {\\n\\t\\twidth: 8em;\\n\\t}\\n\\n\\t& .ck-dropdown__panel .ck-list__item {\\n\\t\\tmin-width: 18em;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;height:auto;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image{z-index:1}.ck.ck-editor__editable .image.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable .image-inline img{height:auto}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/image.css\"],\"names\":[],\"mappings\":\"AAMC,mBAEC,UAAW,CADX,aAAc,CAOd,gBAAkB,CAGlB,cAAe,CARf,iBA2BD,CAjBC,uBAEC,aAAc,CAad,WAAY,CAVZ,aAAc,CAGd,cAAe,CAGf,cAKD,CAGD,0BAYC,sBAAuB,CANvB,mBAAoB,CAGpB,cAoBD,CAdC,kCACC,YACD,CAGA,gEAGC,WAAY,CACZ,aAAc,CAGd,cACD,CAUD,gEASC,eAAgB,CARhB,oBAAqB,CACrB,qBAAsB,CAQtB,sBAAuB,CAFvB,kBAGD,CAKA,+BACC,SASD,CAHC,kDACC,SACD,CAMD,sCACC,SAkBD,CAZC,yDACC,SAUD,CAHC,qEACC,YACD,CAMF,0CACC,WACD,CAMC,0FACC,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content {\\n\\t& .image {\\n\\t\\tdisplay: table;\\n\\t\\tclear: both;\\n\\t\\ttext-align: center;\\n\\n\\t\\t/* Make sure there is some space between the content and the image. Center image by default. */\\n\\t\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\t \\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\t\\tmargin: 0.9em auto;\\n\\n\\t\\t/* Make sure the caption will be displayed properly (See: https://github.com/ckeditor/ckeditor5/issues/1870). */\\n\\t\\tmin-width: 50px;\\n\\n\\t\\t& img {\\n\\t\\t\\t/* Prevent unnecessary margins caused by line-height (see #44). */\\n\\t\\t\\tdisplay: block;\\n\\n\\t\\t\\t/* Center the image if its width is smaller than the content's width. */\\n\\t\\t\\tmargin: 0 auto;\\n\\n\\t\\t\\t/* Make sure the image never exceeds the size of the parent container (ckeditor/ckeditor5-ui#67). */\\n\\t\\t\\tmax-width: 100%;\\n\\n\\t\\t\\t/* Make sure the image is never smaller than the parent container (See: https://github.com/ckeditor/ckeditor5/issues/9300). */\\n\\t\\t\\tmin-width: 100%;\\n\\n\\t\\t\\t/* Keep proportions of the block image if the height is set and the image is wider than the editor width.\\n\\t\\t\\tSee https://github.com/ckeditor/ckeditor5/issues/14542. */\\n\\t\\t\\theight: auto;\\n\\t\\t}\\n\\t}\\n\\n\\t& .image-inline {\\n\\t\\t/*\\n\\t\\t * Normally, the .image-inline would have \\\"display: inline-block\\\" and \\\"img { width: 100% }\\\" (to follow the wrapper while resizing).\\n\\t\\t * Unfortunately, together with \\\"srcset\\\", it gets automatically stretched up to the width of the editing root.\\n\\t\\t * This strange behavior does not happen with inline-flex.\\n\\t\\t */\\n\\t\\tdisplay: inline-flex;\\n\\n\\t\\t/* While being resized, don't allow the image to exceed the width of the editing root. */\\n\\t\\tmax-width: 100%;\\n\\n\\t\\t/* This is required by Safari to resize images in a sensible way. Without this, the browser breaks the ratio. */\\n\\t\\talign-items: flex-start;\\n\\n\\t\\t/* When the picture is present it must act as a flex container to let the img resize properly */\\n\\t\\t& picture {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t}\\n\\n\\t\\t/* When the picture is present, it must act like a resizable img. */\\n\\t\\t& picture,\\n\\t\\t& img {\\n\\t\\t\\t/* This is necessary for the img to span the entire .image-inline wrapper and to resize properly. */\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t\\tflex-shrink: 1;\\n\\n\\t\\t\\t/* Prevents overflowing the editing root boundaries when an inline image is very wide. */\\n\\t\\t\\tmax-width: 100%;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Inhertit the content styles padding of the <figcaption> in case the integration overrides `text-align: center`\\n\\t * of `.image` (e.g. to the left/right). This ensures the placeholder stays at the padding just like the native\\n\\t * caret does, and not at the edge of <figcaption>.\\n\\t */\\n\\t& .image > figcaption.ck-placeholder::before {\\n\\t\\tpadding-left: inherit;\\n\\t\\tpadding-right: inherit;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the image caption placeholder doesn't overflow the placeholder area.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\\n\\t\\t */\\n\\t\\twhite-space: nowrap;\\n\\t\\toverflow: hidden;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n\\n\\t/*\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/15115.\\n\\t */\\n\\t& .image {\\n\\t\\tz-index: 1;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the selected image always stays on top of its siblings.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9108.\\n\\t\\t */\\n\\t\\t&.ck-widget_selected {\\n\\t\\t\\tz-index: 2;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/15115.\\n\\t */\\n\\t& .image-inline {\\n\\t\\tz-index: 1;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the selected inline image always stays on top of its siblings.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9108.\\n\\t\\t */\\n\\t\\t&.ck-widget_selected {\\n\\t\\t\\tz-index: 2;\\n\\n\\t\\t\\t/*\\n\\t\\t\\t * Make sure the native browser selection style is not displayed.\\n\\t\\t\\t * Inline image widgets have their own styles for the selected state and\\n\\t\\t\\t * leaving this up to the browser is asking for a visual collision.\\n\\t\\t\\t */\\n\\t\\t\\t& ::selection {\\n\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* Keep proportions of the inline image if the height is set and the image is wider than the editor width.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/14542. */\\n\\t& .image-inline img {\\n\\t\\theight: auto;\\n\\t}\\n\\n\\t/* The inline image nested in the table should have its original size if not resized.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\\n\\t& td,\\n\\t& th {\\n\\t\\t& .image-inline img {\\n\\t\\t\\tmax-width: none;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highlighted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-color-image-caption-background);caption-side:bottom;color:var(--ck-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;word-break:break-word}@media (forced-colors:active){.ck-content .image>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:none}}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highlighted-background)}to{background-color:var(--ck-color-image-caption-background)}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\"],\"names\":[],\"mappings\":\"AAOA,MACC,2CAAoD,CACpD,kCAA8C,CAC9C,oDACD,CAGA,8BAKC,yDAA0D,CAH1D,mBAAoB,CAEpB,wCAAyC,CAHzC,qBAAsB,CAMtB,eAAgB,CAChB,mBAAoB,CAFpB,YAAa,CAHb,qBAYD,CAJC,8BAXD,8BAYE,sBAAuB,CACvB,WAEF,CADC,CCdA,4BACC,qEDmBA,iDCjBA,CACD,CDmBA,uCALD,qEAME,cAEF,CADC,CAGD,sCACC,GACC,qEACD,CAEA,GACC,yDACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\\\";\\n\\n:root {\\n\\t--ck-color-image-caption-background: hsl(0, 0%, 97%);\\n\\t--ck-color-image-caption-text: hsl(0, 0%, 20%);\\n\\t--ck-color-image-caption-highlighted-background: hsl(52deg 100% 50%);\\n}\\n\\n/* Content styles */\\n.ck-content .image > figcaption {\\n\\tdisplay: table-caption;\\n\\tcaption-side: bottom;\\n\\tword-break: break-word;\\n\\tcolor: var(--ck-color-image-caption-text);\\n\\tbackground-color: var(--ck-color-image-caption-background);\\n\\tpadding: .6em;\\n\\tfont-size: .75em;\\n\\toutline-offset: -1px;\\n\\n\\t/* Improve placeholder rendering in high-constrast mode (https://github.com/ckeditor/ckeditor5/issues/14907). */\\n\\t@media (forced-colors: active) {\\n\\t\\tbackground-color: unset;\\n\\t\\tcolor: unset;\\n\\t}\\n}\\n\\n/* Editing styles */\\n.ck.ck-editor__editable .image > figcaption.image__caption_highlighted {\\n\\t@mixin ck-media-default-colors {\\n\\t\\tanimation: ck-image-caption-highlight .6s ease-out;\\n\\t}\\n\\n\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\tanimation: none;\\n\\t}\\n}\\n\\n@keyframes ck-image-caption-highlight {\\n\\t0% {\\n\\t\\tbackground-color: var(--ck-color-image-caption-highlighted-background);\\n\\t}\\n\\n\\t100% {\\n\\t\\tbackground-color: var(--ck-color-image-caption-background);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-forced-colors {\\n\\t@media (forced-colors: active) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\\n@define-mixin ck-media-default-colors {\\n\\t@media (forced-colors: none) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-image-custom-resize-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{display:inline-block}.ck.ck-image-custom-resize-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-image-custom-resize-form{flex-wrap:wrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-image-custom-resize-form .ck-button{flex-basis:50%}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagecustomresizeform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAOA,gCAIC,sBAAuB,CAHvB,YAAa,CACb,kBAAmB,CACnB,gBAsBD,CAnBC,uDACC,oBACD,CAEA,0CACC,YACD,CCbA,oCDCD,gCAeE,cAUF,CARE,uDACC,eACD,CAEA,2CACC,cACD,CCtBD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-image-custom-resize-form {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\talign-items: flex-start;\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tdisplay: inline-block;\\n\\t}\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-image-insert-url{padding:var(--ck-spacing-large) var(--ck-spacing-large) 0;width:400px}.ck.ck-image-insert-url .ck-image-insert-url__action-row{display:grid;grid-template-columns:repeat(2,1fr)}:root{--ck-image-insert-insert-by-url-width:250px}.ck.ck-image-insert-url{--ck-input-width:100%}.ck.ck-image-insert-url .ck-image-insert-url__action-row{grid-column-gap:var(--ck-spacing-large);margin-top:var(--ck-spacing-large)}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-cancel,.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-save{justify-content:center;min-width:auto}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}.ck.ck-image-insert-form>.ck.ck-button{display:block;width:100%}[dir=ltr] .ck.ck-image-insert-form>.ck.ck-button{text-align:left}[dir=rtl] .ck.ck-image-insert-form>.ck.ck-button{text-align:right}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:first-child){border-top:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:last-child){border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible,.ck.ck-image-insert-form>.ck.ck-image-insert-url{min-width:var(--ck-image-insert-insert-by-url-width)}.ck.ck-image-insert-form>.ck.ck-image-insert-url{padding:var(--ck-spacing-large)}.ck.ck-image-insert-form:focus{outline:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageinsert.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageinsert.css\"],\"names\":[],\"mappings\":\"AAKA,wBAEC,yDAA0D,CAD1D,WAOD,CAJC,yDACC,YAAa,CACb,mCACD,CCLD,MACC,2CACD,CAEA,wBACC,qBAgBD,CAdC,yDACC,uCAAwC,CACxC,kCAWD,CATC,oJAEC,sBAAuB,CACvB,cACD,CAEA,sFACC,0BACD,CAKD,uCACC,aAAc,CACd,UASD,CAXA,iDAKE,eAMF,CAXA,iDASE,gBAEF,CAGC,8DACC,gDACD,CAEA,6DACC,mDACD,CAMD,6FAJC,oDAOD,CAHA,iDAEC,+BACD,CAEA,+BACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-image-insert-url {\\n\\twidth: 400px;\\n\\tpadding: var(--ck-spacing-large) var(--ck-spacing-large) 0;\\n\\n\\t& .ck-image-insert-url__action-row {\\n\\t\\tdisplay: grid;\\n\\t\\tgrid-template-columns: repeat(2, 1fr);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n:root {\\n\\t--ck-image-insert-insert-by-url-width: 250px;\\n}\\n\\n.ck.ck-image-insert-url {\\n\\t--ck-input-width: 100%;\\n\\n\\t& .ck-image-insert-url__action-row {\\n\\t\\tgrid-column-gap: var(--ck-spacing-large);\\n\\t\\tmargin-top: var(--ck-spacing-large);\\n\\n\\t\\t& .ck-button-save,\\n\\t\\t& .ck-button-cancel {\\n\\t\\t\\tjustify-content: center;\\n\\t\\t\\tmin-width: auto;\\n\\t\\t}\\n\\n\\t\\t& .ck-button .ck-button__label {\\n\\t\\t\\tcolor: var(--ck-color-text);\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-image-insert-form {\\n\\t& > .ck.ck-button {\\n\\t\\tdisplay: block;\\n\\t\\twidth: 100%;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\ttext-align: left;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\ttext-align: right;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck.ck-collapsible {\\n\\t\\t&:not(:first-child) {\\n\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t\\t}\\n\\n\\t\\t&:not(:last-child) {\\n\\t\\t\\tborder-bottom: 1px solid var(--ck-color-base-border);\\n\\t\\t}\\n\\n\\t\\tmin-width: var(--ck-image-insert-insert-by-url-width);\\n\\t}\\n\\n\\t/* This is the case when there are no other integrations configured than insert by URL */\\n\\t& > .ck.ck-image-insert-url {\\n\\t\\tmin-width: var(--ck-image-insert-insert-by-url-width);\\n\\t\\tpadding: var(--ck-spacing-large);\\n\\t}\\n\\n\\t&:focus {\\n\\t\\toutline: none;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-editor__editable img.image_placeholder{background-size:100% 100%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageplaceholder.css\"],\"names\":[],\"mappings\":\"AAMC,8CACC,yBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t& img.image_placeholder {\\n\\t\\tbackground-size: 100% 100%;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-content img.image_resized{height:auto}.ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css\"],\"names\":[],\"mappings\":\"AAMA,8BACC,WACD,CAEA,iCAQC,qBAAsB,CADtB,aAAc,CANd,cAkBD,CATC,qCAEC,UACD,CAEA,4CAEC,aACD,CAQC,sHACC,cACD,CAIF,oFACC,uCACD,CAEA,oFACC,sCACD,CAEA,oEACC,SACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Preserve aspect ratio of the resized image after introducing image height attribute. */\\n.ck-content img.image_resized {\\n\\theight: auto;\\n}\\n\\n.ck-content .image.image_resized {\\n\\tmax-width: 100%;\\n\\t/*\\n\\tThe `<figure>` element for resized images must not use `display:table` as browsers do not support `max-width` for it well.\\n\\tSee https://stackoverflow.com/questions/4019604/chrome-safari-ignoring-max-width-in-table/14420691#14420691 for more.\\n\\tFortunately, since we control the width, there is no risk that the image will look bad.\\n\\t*/\\n\\tdisplay: block;\\n\\tbox-sizing: border-box;\\n\\n\\t& img {\\n\\t\\t/* For resized images it is the `<figure>` element that determines the image width. */\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t& > figcaption {\\n\\t\\t/* The `<figure>` element uses `display:block`, so `<figcaption>` also has to. */\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/* The resized inline image nested in the table should respect its parent size.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\\n\\t& td,\\n\\t& th {\\n\\t\\t& .image-inline.image_resized img {\\n\\t\\t\\tmax-width: 100%;\\n\\t\\t}\\n\\t}\\n}\\n\\n[dir=\\\"ltr\\\"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\\n\\tmargin-right: var(--ck-spacing-standard);\\n}\\n\\n[dir=\\\"rtl\\\"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\\n\\tmargin-left: var(--ck-spacing-standard);\\n}\\n\\n.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label {\\n\\twidth: 4em;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image.image-style-block-align-left,.ck-content .image.image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image.image-style-align-left,.ck-content .image.image-style-align-right{clear:none}.ck-content .image.image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image.image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image.image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image.image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image.image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content p+.image.image-style-align-left,.ck-content p+.image.image-style-align-right,.ck-content p+.image.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-inline-image-style-spacing);margin-top:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,8BAA+B,CAC/B,qEACD,CAQE,iGAEC,oDACD,CAIA,qFAEC,UACD,CAEA,oCACC,WAAY,CACZ,yCAA0C,CAC1C,aACD,CAEA,0CACC,UAAW,CACX,0CACD,CAEA,2CACC,WAAY,CACZ,yCACD,CAEA,iDAEC,gBAAiB,CADjB,cAED,CAEA,gDACC,aAAc,CACd,iBACD,CAGD,sCACC,gBAAiB,CACjB,iBACD,CAEA,oCACC,UAAW,CACX,0CACD,CAEA,qCACC,WAAY,CACZ,yCACD,CAGA,+HAGC,YACD,CAGC,mGAGC,kDAAmD,CADnD,+CAED,CAEA,iDACC,iDACD,CAEA,kDACC,gDACD,CAUC,0lBAGC,qDAKD,CAHC,8nBACC,YACD,CAKD,oVAGC,2DACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-image-style-spacing: 1.5em;\\n\\t--ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2);\\n}\\n\\n.ck-content {\\n\\t/* See: https://github.com/ckeditor/ckeditor5/issues/16317 */\\n\\t& .image {\\n\\t\\t/* Provides a minimal side margin for the left and right aligned images, so that the user has a visual feedback\\n\\t\\tconfirming successful application of the style if image width exceeds the editor's size.\\n\\t\\tSee https://github.com/ckeditor/ckeditor5/issues/9342 */\\n\\t\\t&.image-style-block-align-left,\\n\\t\\t&.image-style-block-align-right {\\n\\t\\t\\tmax-width: calc(100% - var(--ck-image-style-spacing));\\n\\t\\t}\\n\\n\\t\\t/* Allows displaying multiple floating images in the same line.\\n\\t\\tSee https://github.com/ckeditor/ckeditor5/issues/9183#issuecomment-804988132 */\\n\\t\\t&.image-style-align-left,\\n\\t\\t&.image-style-align-right {\\n\\t\\t\\tclear: none;\\n\\t\\t}\\n\\n\\t\\t&.image-style-side {\\n\\t\\t\\tfloat: right;\\n\\t\\t\\tmargin-left: var(--ck-image-style-spacing);\\n\\t\\t\\tmax-width: 50%;\\n\\t\\t}\\n\\n\\t\\t&.image-style-align-left {\\n\\t\\t\\tfloat: left;\\n\\t\\t\\tmargin-right: var(--ck-image-style-spacing);\\n\\t\\t}\\n\\n\\t\\t&.image-style-align-right {\\n\\t\\t\\tfloat: right;\\n\\t\\t\\tmargin-left: var(--ck-image-style-spacing);\\n\\t\\t}\\n\\n\\t\\t&.image-style-block-align-right {\\n\\t\\t\\tmargin-right: 0;\\n\\t\\t\\tmargin-left: auto;\\n\\t\\t}\\n\\n\\t\\t&.image-style-block-align-left {\\n\\t\\t\\tmargin-left: 0;\\n\\t\\t\\tmargin-right: auto;\\n\\t\\t}\\n\\t}\\n\\n\\t& .image-style-align-center {\\n\\t\\tmargin-left: auto;\\n\\t\\tmargin-right: auto;\\n\\t}\\n\\n\\t& .image-style-align-left {\\n\\t\\tfloat: left;\\n\\t\\tmargin-right: var(--ck-image-style-spacing);\\n\\t}\\n\\n\\t& .image-style-align-right {\\n\\t\\tfloat: right;\\n\\t\\tmargin-left: var(--ck-image-style-spacing);\\n\\t}\\n\\n\\t/* Simulates margin collapsing with the preceding paragraph, which does not work for the floating elements. */\\n\\t& p + .image.image-style-align-left,\\n\\t& p + .image.image-style-align-right,\\n\\t& p + .image.image-style-side {\\n\\t\\tmargin-top: 0;\\n\\t}\\n\\n\\t& .image-inline {\\n\\t\\t&.image-style-align-left,\\n\\t\\t&.image-style-align-right {\\n\\t\\t\\tmargin-top: var(--ck-inline-image-style-spacing);\\n\\t\\t\\tmargin-bottom: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\n\\t\\t&.image-style-align-left {\\n\\t\\t\\tmargin-right: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\n\\t\\t&.image-style-align-right {\\n\\t\\t\\tmargin-left: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-splitbutton {\\n\\t/* The button should display as a regular drop-down if the action button\\n\\tis forced to fire the same action as the arrow button. */\\n\\t&.ck-splitbutton_flatten {\\n\\t\\t&:hover,\\n\\t\\t&.ck-splitbutton_open {\\n\\t\\t\\t& > .ck-splitbutton__action:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\\n\\t\\t\\t\\tbackground-color: var(--ck-color-button-on-background);\\n\\n\\t\\t\\t\\t&::after {\\n\\t\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-splitbutton_open:hover {\\n\\t\\t\\t& > .ck-splitbutton__action:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\\n\\t\\t\\t\\tbackground-color: var(--ck-color-button-on-hover-background);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.ck-image-upload-complete-icon:after{content:\"\";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@media (prefers-reduced-motion:reduce){.ck-image-upload-complete-icon{animation-duration:0ms}.ck-image-upload-complete-icon:after{animation:none;height:.45em;opacity:1;width:.3em}}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css\"],\"names\":[],\"mappings\":\"AAKA,+BAUC,iBAAkB,CATlB,aAAc,CACd,iBAAkB,CAOlB,sCAAwC,CADxC,oCAAsC,CAGtC,SAMD,CAJC,qCACC,UAAW,CACX,iBACD,CChBD,MACC,iCAA8C,CAC9C,+CAA4D,CAG5D,8BAA+B,CAC/B,gCAAiC,CACjC,4DACD,CAEA,+BAWC,sBAA4B,CAN5B,0BAAgC,CADhC,qCAAuC,CADvC,wEAA0E,CAD1E,uDAAwD,CAMxD,oDAAuD,CAWvD,oFAAuF,CAlBvF,SAAU,CAgBV,eAAgB,CAChB,mFAqCD,CAjCC,qCAgBC,mBAAsB,CADtB,sBAAyB,CAEzB,4BAA6B,CAH7B,4CAA6C,CAF7C,sFAAuF,CADvF,oFAAqF,CASrF,qBAAsB,CAdtB,QAAS,CAJT,QAAS,CAGT,SAAU,CADV,OAAQ,CAKR,mCAAoC,CACpC,yBAA0B,CAH1B,OAcD,CAEA,uCA7CD,+BA8CE,sBASF,CAPE,qCACC,cAAe,CAGf,YAAc,CAFd,SAAU,CACV,UAED,CACD,CAGD,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,yCACC,GAGC,QAAS,CAFT,SAAU,CACV,OAED,CACA,IAEC,QAAS,CADT,UAED,CACA,GAGC,YAAc,CAFd,SAAU,CACV,UAED,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-image-upload-complete-icon {\\n\\tdisplay: block;\\n\\tposition: absolute;\\n\\n\\t/*\\n\\t * Smaller images should have the icon closer to the border.\\n\\t * Match the icon position with the linked image indicator brought by the link image feature.\\n\\t */\\n\\ttop: min(var(--ck-spacing-medium), 6%);\\n\\tright: min(var(--ck-spacing-medium), 6%);\\n\\tborder-radius: 50%;\\n\\tz-index: 1;\\n\\n\\t&::after {\\n\\t\\tcontent: \\\"\\\";\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-image-upload-icon: hsl(0, 0%, 100%);\\n\\t--ck-color-image-upload-icon-background: hsl(120, 100%, 27%);\\n\\n\\t/* Match the icon size with the linked image indicator brought by the link image feature. */\\n\\t--ck-image-upload-icon-size: 20;\\n\\t--ck-image-upload-icon-width: 2px;\\n\\t--ck-image-upload-icon-is-visible: clamp(0px, 100% - 50px, 1px);\\n}\\n\\n.ck-image-upload-complete-icon {\\n\\topacity: 0;\\n\\tbackground: var(--ck-color-image-upload-icon-background);\\n\\tanimation-name: ck-upload-complete-icon-show, ck-upload-complete-icon-hide;\\n\\tanimation-fill-mode: forwards, forwards;\\n\\tanimation-duration: 500ms, 500ms;\\n\\n\\t/* To make animation scalable. */\\n\\tfont-size: calc(1px * var(--ck-image-upload-icon-size));\\n\\n\\t/* Hide completed upload icon after 3 seconds. */\\n\\tanimation-delay: 0ms, 3000ms;\\n\\n\\t/*\\n\\t * Use CSS math to simulate container queries.\\n\\t * https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\\n\\t */\\n\\toverflow: hidden;\\n\\twidth: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\\n\\theight: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\\n\\n\\t/* This is check icon element made from border-width mixed with animations. */\\n\\t&::after {\\n\\t\\t/* Because of border transformation we need to \\\"hard code\\\" left position. */\\n\\t\\tleft: 25%;\\n\\n\\t\\ttop: 50%;\\n\\t\\topacity: 0;\\n\\t\\theight: 0;\\n\\t\\twidth: 0;\\n\\n\\t\\ttransform: scaleX(-1) rotate(135deg);\\n\\t\\ttransform-origin: left top;\\n\\t\\tborder-top: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\\n\\t\\tborder-right: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\\n\\n\\t\\tanimation-name: ck-upload-complete-icon-check;\\n\\t\\tanimation-duration: 500ms;\\n\\t\\tanimation-delay: 500ms;\\n\\t\\tanimation-fill-mode: forwards;\\n\\n\\t\\t/* #1095. While reset is not providing proper box-sizing for pseudoelements, we need to handle it. */\\n\\t\\tbox-sizing: border-box;\\n\\t}\\n\\n\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\tanimation-duration: 0ms;\\n\\n\\t\\t&::after {\\n\\t\\t\\tanimation: none;\\n\\t\\t\\topacity: 1;\\n\\t\\t\\twidth: 0.3em;\\n\\t\\t\\theight: 0.45em;\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-show {\\n\\tfrom {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\tto {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-hide {\\n\\tfrom {\\n\\t\\topacity: 1;\\n\\t}\\n\\n\\tto {\\n\\t\\topacity: 0;\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-check {\\n\\t0% {\\n\\t\\topacity: 1;\\n\\t\\twidth: 0;\\n\\t\\theight: 0;\\n\\t}\\n\\t33% {\\n\\t\\twidth: 0.3em;\\n\\t\\theight: 0;\\n\\t}\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t\\twidth: 0.3em;\\n\\t\\theight: 0.45em;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:\"\";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadloader.css\"],\"names\":[],\"mappings\":\"AAKA,kCAGC,kBAAmB,CADnB,YAAa,CAEb,sBAAuB,CAEvB,MAAO,CALP,iBAAkB,CAIlB,KAOD,CAJC,yCACC,UAAW,CACX,iBACD,CCXD,MACC,4CAAqD,CACrD,wCAAyC,CACzC,8CACD,CAEA,iCAGC,QAAS,CADT,UAgBD,CAbC,8CACC,sGACD,CAEA,qCAOC,4DACD,CAGD,kCAEC,WAAY,CADZ,UAWD,CARC,yCAMC,yDAA0D,CAH1D,iBAAkB,CAElB,kCAAmC,CADnC,8DAA+D,CAF/D,+CAAgD,CADhD,8CAMD,CAGD,wCACC,GACC,uBACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-upload-placeholder-loader {\\n\\tposition: absolute;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n\\ttop: 0;\\n\\tleft: 0;\\n\\n\\t&::before {\\n\\t\\tcontent: '';\\n\\t\\tposition: relative;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-upload-placeholder-loader: hsl(0, 0%, 70%);\\n\\t--ck-upload-placeholder-loader-size: 32px;\\n\\t--ck-upload-placeholder-image-aspect-ratio: 2.8;\\n}\\n\\n.ck .ck-image-upload-placeholder {\\n\\t/* We need to control the full width of the SVG gray background. */\\n\\twidth: 100%;\\n\\tmargin: 0;\\n\\n\\t&.image-inline {\\n\\t\\twidth: calc( 2 * var(--ck-upload-placeholder-loader-size) * var(--ck-upload-placeholder-image-aspect-ratio) );\\n\\t}\\n\\n\\t& img {\\n\\t\\t/*\\n\\t\\t * This is an arbitrary aspect for a 1x1 px GIF to display to the user. Not too tall, not too short.\\n\\t\\t * There's nothing special about this number except that it should make the image placeholder look like\\n\\t\\t * a real image during this short period after the upload started and before the image was read from the\\n\\t\\t * file system (and a rich preview was loaded).\\n\\t\\t */\\n\\t\\taspect-ratio: var(--ck-upload-placeholder-image-aspect-ratio);\\n\\t}\\n}\\n\\n.ck .ck-upload-placeholder-loader {\\n\\twidth: 100%;\\n\\theight: 100%;\\n\\n\\t&::before {\\n\\t\\twidth: var(--ck-upload-placeholder-loader-size);\\n\\t\\theight: var(--ck-upload-placeholder-loader-size);\\n\\t\\tborder-radius: 50%;\\n\\t\\tborder-top: 3px solid var(--ck-color-upload-placeholder-loader);\\n\\t\\tborder-right: 2px solid transparent;\\n\\t\\tanimation: ck-upload-placeholder-loader 1s linear infinite;\\n\\t}\\n}\\n\\n@keyframes ck-upload-placeholder-loader {\\n\\tto {\\n\\t\\ttransform: rotate( 360deg );\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:none;opacity:1}}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadprogress.css\"],\"names\":[],\"mappings\":\"AAMC,qEAEC,iBACD,CAGA,uGAIC,MAAO,CAFP,iBAAkB,CAClB,KAED,CCRC,yFACC,oBAMD,CAJC,uCAHD,yFAKE,cAAe,CADf,SAGF,CADC,CAKF,uGAIC,gDAAiD,CAFjD,UAAW,CAGX,oBAAuB,CAFvB,OAGD,CAGD,kBACC,GAAO,SAAY,CACnB,GAAO,SAAY,CACpB\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t& .image,\\n\\t& .image-inline {\\n\\t\\tposition: relative;\\n\\t}\\n\\n\\t/* Upload progress bar. */\\n\\t& .image .ck-progress-bar,\\n\\t& .image-inline .ck-progress-bar {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t& .image,\\n\\t& .image-inline {\\n\\t\\t/* Showing animation. */\\n\\t\\t&.ck-appear {\\n\\t\\t\\tanimation: fadeIn 700ms;\\n\\n\\t\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t\\tanimation: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* Upload progress bar. */\\n\\t& .image .ck-progress-bar,\\n\\t& .image-inline .ck-progress-bar {\\n\\t\\theight: 2px;\\n\\t\\twidth: 0;\\n\\t\\tbackground: var(--ck-color-upload-bar-background);\\n\\t\\ttransition: width 100ms;\\n\\t}\\n}\\n\\n@keyframes fadeIn {\\n\\tfrom { opacity: 0; }\\n\\tto { opacity: 1; }\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAOA,6BACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,oDACC,oBACD,CAEA,uCACC,YACD,CCZA,oCDCD,6BAcE,cAUF,CARE,oDACC,eACD,CAEA,wCACC,cACD,CCrBD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-text-alternative-form {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tdisplay: inline-block;\\n\\t}\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/link.css\"],\"names\":[],\"mappings\":\"AAMA,sBACC,mDAMD,CAHC,wCACC,yFACD,CAOD,4BACC,8CACD,CAGA,sCAEC,gDAAiD,CADjD,WAAY,CAEZ,iBAAkB,CAClB,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Class added to span element surrounding currently selected link. */\\n.ck .ck-link_selected {\\n\\tbackground: var(--ck-color-link-selected-background);\\n\\n\\t/* Give linked inline images some outline to let the user know they are also part of the link. */\\n\\t& span.image-inline {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background);\\n\\t}\\n}\\n\\n/*\\n * Classes used by the \\\"fake visual selection\\\" displayed in the content when an input\\n * in the link UI has focus (the browser does not render the native selection in this state).\\n */\\n.ck .ck-fake-link-selection {\\n\\tbackground: var(--ck-color-link-fake-selection);\\n}\\n\\n/* A collapsed fake visual selection. */\\n.ck .ck-fake-link-selection_collapsed {\\n\\theight: 100%;\\n\\tborder-right: 1px solid var(--ck-color-base-text);\\n\\tmargin-right: -1px;\\n\\toutline: solid 1px hsla(0, 0%, 100%, .5);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkactions.css\"],\"names\":[],\"mappings\":\"AAOA,oBACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,8CACC,oBAKD,CAHC,gEACC,eACD,CCXD,oCDCD,oBAcE,cAUF,CARE,8CACC,eACD,CAEA,8DACC,cACD,CCrBD,CCIA,wDACC,cAAe,CACf,eAmCD,CAjCC,0EAEC,kCAAmC,CAEnC,cAAe,CAIf,+BAAgC,CAChC,aAAc,CARd,kCAAmC,CASnC,iBAAkB,CAPlB,sBAYD,CAHC,gFACC,yBACD,CAGD,mPAIC,eACD,CAEA,+DACC,eACD,CAGC,gFACC,yBACD,CAWD,qHACC,sCACD,CDtDD,oCC0DC,wDACC,8DAMD,CAJC,0EAEC,cAAe,CADf,WAED,CAGD,gJAME,aAEF,CDzED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-actions {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\n\\t& .ck-link-actions__preview {\\n\\t\\tdisplay: inline-block;\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\toverflow: hidden;\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-link-actions__preview {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button:not(.ck-link-actions__preview) {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../mixins/_focus.css\\\";\\n@import \\\"../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-actions {\\n\\t& .ck-button.ck-link-actions__preview {\\n\\t\\tpadding-left: 0;\\n\\t\\tpadding-right: 0;\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tpadding: 0 var(--ck-spacing-medium);\\n\\t\\t\\tcolor: var(--ck-color-link-default);\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t\\tcursor: pointer;\\n\\n\\t\\t\\t/* Match the box model of the link editor form's input so the balloon\\n\\t\\t\\tdoes not change width when moving between actions and the form. */\\n\\t\\t\\tmax-width: var(--ck-input-width);\\n\\t\\t\\tmin-width: 3em;\\n\\t\\t\\ttext-align: center;\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\ttext-decoration: underline;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&,\\n\\t\\t&:hover,\\n\\t\\t&:focus,\\n\\t\\t&:active {\\n\\t\\t\\tbackground: none;\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\n\\t\\t&:focus {\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\ttext-decoration: underline;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& .ck-button:not(:first-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& .ck-button:not(:last-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\t& .ck-button.ck-link-actions__preview {\\n\\t\\t\\tmargin: var(--ck-spacing-standard) var(--ck-spacing-standard) 0;\\n\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\tmin-width: 0;\\n\\t\\t\\t\\tmax-width: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .ck-button:not(.ck-link-actions__preview) {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-link-form{align-items:flex-start;display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical>.ck-button{border-radius:0;margin:0;padding:var(--ck-spacing-standard);width:50%}.ck.ck-link-form_layout-vertical>.ck-button:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form_layout-vertical>.ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:0 var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkform.css\"],\"names\":[],\"mappings\":\"AAOA,iBAEC,sBAAuB,CADvB,YAkBD,CAfC,2BACC,YACD,CCPA,oCDCD,iBASE,cAUF,CARE,wCACC,eACD,CAEA,4BACC,cACD,CChBD,CDwBD,iCACC,aAYD,CALE,wHAEC,mCACD,CEhCF,iCAEC,+BAAgC,CADhC,SAgDD,CA7CC,wDACC,8EAMD,CAJC,uEACC,WAAY,CACZ,UACD,CAGD,4CAIC,eAAgB,CAFhB,QAAS,CADT,kCAAmC,CAEnC,SAkBD,CAfC,wDACC,gDACD,CARD,4GAeE,aAMF,CAJE,mEACC,kDACD,CAKF,6CACC,gCAUD,CARC,wEACC,SAAU,CACV,UAKD,CAHC,8EACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-form {\\n\\tdisplay: flex;\\n\\talign-items: flex-start;\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Style link form differently when manual decorators are available.\\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\\n */\\n.ck.ck-link-form_layout-vertical {\\n\\tdisplay: block;\\n\\n\\t/*\\n\\t * Whether the form is in the responsive mode or not, if there are decorator buttons\\n\\t * keep the top margin of action buttons medium.\\n\\t */\\n\\t& .ck-button {\\n\\t\\t&.ck-button-save,\\n\\t\\t&.ck-button-cancel {\\n\\t\\t\\tmargin-top: var(--ck-spacing-medium);\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n/*\\n * Style link form differently when manual decorators are available.\\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\\n */\\n.ck.ck-link-form_layout-vertical {\\n\\tpadding: 0;\\n\\tmin-width: var(--ck-input-width);\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small);\\n\\n\\t\\t& .ck-input-text {\\n\\t\\t\\tmin-width: 0;\\n\\t\\t\\twidth: 100%;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-button {\\n\\t\\tpadding: var(--ck-spacing-standard);\\n\\t\\tmargin: 0;\\n\\t\\twidth: 50%;\\n\\t\\tborder-radius: 0;\\n\\n\\t\\t&:not(:focus) {\\n\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-left: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: 0;\\n\\n\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* Using additional `.ck` class for stronger CSS specificity than `.ck.ck-link-form > :not(:first-child)`. */\\n\\t& .ck.ck-list {\\n\\t\\tmargin: 0 var(--ck-spacing-large);\\n\\n\\t\\t& .ck-button.ck-switchbutton {\\n\\t\\t\\tpadding: 0;\\n\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tbackground: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzUuNzUgMCAwIDEtLjIxNy4yMDYgNS4yNTEgNS4yNTEgMCAwIDEtOC41MDMtNS45NTUuNy43IDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NHptNS40OTQtNS4zMzVhLjc1Ljc1IDAgMCAxLS4xMi4yNzRsLTEuMTQ3IDEuNjM5YS43NS43NSAwIDEgMS0xLjIyOC0uODZsLjg2LTEuMjNhMy43NSAzLjc1IDAgMCAwLTYuMTQ0LTQuMzAxbC0uODYgMS4yMjlhLjc1Ljc1IDAgMCAxLTEuMjI5LS44NmwxLjE0OC0xLjY0YS43NS43NSAwIDAgMSAuMjE3LS4yMDYgNS4yNTEgNS4yNTEgMCAwIDEgOC41MDMgNS45NTVtLTQuNTYzLTIuNTMyYS43NS43NSAwIDAgMSAuMTg0IDEuMDQ1bC0zLjE1NSA0LjUwNWEuNzUuNzUgMCAxIDEtMS4yMjktLjg2bDMuMTU1LTQuNTA2YS43NS43NSAwIDAgMSAxLjA0NS0uMTg0Ii8+PC9zdmc+\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{background-color:rgba(0,0,0,.4);background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___});background-position:50%;background-repeat:no-repeat;background-size:14px;border-radius:100%;content:\"\";height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));overflow:hidden;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkimage.css\"],\"names\":[],\"mappings\":\"AASE,+FACC,aAAc,CACd,iBACD,CCPF,MAEC,sCAAuC,CACvC,oEACD,CAME,+FAUC,+BAAqC,CACrC,wDAA+3B,CAG/3B,uBAA2B,CAD3B,2BAA4B,CAD5B,oBAAqB,CAGrB,kBAAmB,CAdnB,UAAW,CAsBX,oGAAuG,CAFvG,eAAgB,CAbhB,sCAAwC,CADxC,oCAAsC,CAetC,mGAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t/* Linked image indicator */\\n\\t& figure.image > a,\\n\\t& a span.image-inline {\\n\\t\\t&::after {\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tposition: absolute;\\n\\t\\t}\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/* Match the icon size with the upload indicator brought by the image upload feature. */\\n\\t--ck-link-image-indicator-icon-size: 20;\\n\\t--ck-link-image-indicator-icon-is-visible: clamp(0px, 100% - 50px, 1px);\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/* Linked image indicator */\\n\\t& figure.image > a,\\n\\t& a span.image-inline {\\n\\t\\t&::after {\\n\\t\\t\\tcontent: \\\"\\\";\\n\\n\\t\\t\\t/*\\n\\t\\t\\t * Smaller images should have the icon closer to the border.\\n\\t\\t\\t * Match the icon position with the upload indicator brought by the image upload feature.\\n\\t\\t\\t */\\n\\t\\t\\ttop: min(var(--ck-spacing-medium), 6%);\\n\\t\\t\\tright: min(var(--ck-spacing-medium), 6%);\\n\\n\\t\\t\\tbackground-color: hsla(0, 0%, 0%, .4);\\n\\t\\t\\tbackground-image: url(\\\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+\\\");\\n\\t\\t\\tbackground-size: 14px;\\n\\t\\t\\tbackground-repeat: no-repeat;\\n\\t\\t\\tbackground-position: center;\\n\\t\\t\\tborder-radius: 100%;\\n\\n\\t\\t\\t/*\\n\\t\\t\\t* Use CSS math to simulate container queries.\\n\\t\\t\\t* https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\\n\\t\\t\\t*/\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\twidth: calc(var(--ck-link-image-indicator-icon-is-visible) * var(--ck-link-image-indicator-icon-size));\\n\\t\\t\\theight: calc(var(--ck-link-image-indicator-icon-is-visible) * var(--ck-link-image-indicator-icon-size));\\n\\t\\t}\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-editor__editable .ck-list-bogus-paragraph{display:block}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/documentlist.css\"],\"names\":[],\"mappings\":\"AAKA,8CACC,aACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-editor__editable .ck-list-bogus-paragraph {\\n\\tdisplay: block;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/list.css\"],\"names\":[],\"mappings\":\"AAKA,eACC,uBAiBD,CAfC,kBACC,2BAaD,CAXC,qBACC,2BASD,CAPC,wBACC,2BAKD,CAHC,2BACC,2BACD,CAMJ,eACC,oBAaD,CAXC,kBACC,sBASD,CAJE,6CACC,sBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content ol {\\n\\tlist-style-type: decimal;\\n\\n\\t& ol {\\n\\t\\tlist-style-type: lower-latin;\\n\\n\\t\\t& ol {\\n\\t\\t\\tlist-style-type: lower-roman;\\n\\n\\t\\t\\t& ol {\\n\\t\\t\\t\\tlist-style-type: upper-latin;\\n\\n\\t\\t\\t\\t& ol {\\n\\t\\t\\t\\t\\tlist-style-type: upper-roman;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck-content ul {\\n\\tlist-style-type: disc;\\n\\n\\t& ul {\\n\\t\\tlist-style-type: circle;\\n\\n\\t\\t& ul {\\n\\t\\t\\tlist-style-type: square;\\n\\n\\t\\t\\t& ul {\\n\\t\\t\\t\\tlist-style-type: square;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-list/listproperties.css\"],\"names\":[],\"mappings\":\"AAOC,yDACC,+BASD,CAPC,2DACC,cAKD,CAHC,6DACC,qCACD,CASD,wFACC,oCACD,CAGA,mFACC,gDAWD,CARE,+GACC,UAKD,CAHC,iHACC,qCACD,CAMJ,8EACC,cAAe,CACf,UACD,CAEA,uEACC,sBAAuB,CAGvB,6CAAgD,CAFhD,cAAe,CACf,eAQD,CALC,2JAGC,eAAgB,CADhB,wBAAyB,CADzB,eAGD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-list-properties {\\n\\t/* When there are no list styles and there is no collapsible. */\\n\\t&.ck-list-properties_without-styles {\\n\\t\\tpadding: var(--ck-spacing-large);\\n\\n\\t\\t& > * {\\n\\t\\t\\tmin-width: 14em;\\n\\n\\t\\t\\t& + * {\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * When the numbered list property fields (start at, reversed) should be displayed,\\n\\t * more horizontal space is needed. Reconfigure the style grid to create that space.\\n\\t */\\n\\t&.ck-list-properties_with-numbered-properties {\\n\\t\\t& > .ck-list-styles-list {\\n\\t\\t\\tgrid-template-columns: repeat( 4, auto );\\n\\t\\t}\\n\\n\\t\\t/* When list styles are rendered and property fields are in a collapsible. */\\n\\t\\t& > .ck-collapsible {\\n\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\n\\t\\t\\t& > .ck-collapsible__children {\\n\\t\\t\\t\\t& > * {\\n\\t\\t\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t\\t\\t& + * {\\n\\t\\t\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-numbered-list-properties__start-index .ck-input {\\n\\t\\tmin-width: auto;\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t& .ck.ck-numbered-list-properties__reversed-order {\\n\\t\\tbackground: transparent;\\n\\t\\tpadding-left: 0;\\n\\t\\tpadding-right: 0;\\n\\t\\tmargin-bottom: calc(-1 * var(--ck-spacing-tiny));\\n\\n\\t\\t&:active, &:hover {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t\\tborder-color: transparent;\\n\\t\\t\\tbackground: none;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-list-styles-list{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/liststyles.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-list/liststyles.css\"],\"names\":[],\"mappings\":\"AAKA,wBACC,YACD,CCFA,MACC,gCACD,CAEA,wBAGC,mCAAoC,CAFpC,oCAAwC,CAGxC,+BAAgC,CAFhC,gCA4BD,CAxBC,mCAiBC,sBAAuB,CAPvB,QAAS,CANT,SAmBD,CAJC,+EAhBA,uCAAwC,CADxC,sCAoBA\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-list-styles-list {\\n\\tdisplay: grid;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-list-style-button-size: 44px;\\n}\\n\\n.ck.ck-list-styles-list {\\n\\tgrid-template-columns: repeat( 3, auto );\\n\\trow-gap: var(--ck-spacing-medium);\\n\\tcolumn-gap: var(--ck-spacing-medium);\\n\\tpadding: var(--ck-spacing-large);\\n\\n\\t& .ck-button {\\n\\t\\t/* Make the button look like a thumbnail (the icon \\\"takes it all\\\"). */\\n\\t\\twidth: var(--ck-list-style-button-size);\\n\\t\\theight: var(--ck-list-style-button-size);\\n\\t\\tpadding: 0;\\n\\n\\t\\t/*\\n\\t\\t * Buttons are aligned by the grid so disable default button margins to not collide with the\\n\\t\\t * gaps in the grid.\\n\\t\\t */\\n\\t\\tmargin: 0;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the button border (which is displayed on focus, BTW) does not steal pixels\\n\\t\\t * from the button dimensions and, as a result, decrease the size of the icon\\n\\t\\t * (which becomes blurry as it scales down).\\n\\t\\t */\\n\\t\\tbox-sizing: content-box;\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\twidth: var(--ck-list-style-button-size);\\n\\t\\t\\theight: var(--ck-list-style-button-size);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px;position:relative}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:\"\";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-content .todo-list .todo-list__label>input:before{transition:none}}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:\"\";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-editor__editable.ck-content .todo-list .todo-list__label>input,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{cursor:pointer}.ck-editor__editable.ck-content .todo-list .todo-list__label>input:hover:before,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label>span[contenteditable=false]>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:\"\";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{transition:none}}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:\"\";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:after{border-color:#fff}.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/todolist.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,kCACD,CA4EA,uBACC,eAwBD,CAtBC,0BAEC,iBAAkB,CADlB,iBAMD,CAHC,qCACC,cACD,CAIA,+CAtFD,uBAAwB,CAQxB,QAAS,CAPT,oBAAqB,CAGrB,yCAA0C,CAO1C,UAAW,CAGX,aAAc,CAFd,kBAAmB,CAVnB,iBAAkB,CAWlB,OAAQ,CARR,qBAAsB,CAFtB,wCAqFC,CAFA,wDApEA,MAAO,CAGP,iBAAkB,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served.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-todo-list-checkmark-size: 16px;\\n}\\n\\n@define-mixin todo-list-checkbox {\\n\\t-webkit-appearance: none;\\n\\tdisplay: inline-block;\\n\\tposition: relative;\\n\\twidth: var(--ck-todo-list-checkmark-size);\\n\\theight: var(--ck-todo-list-checkmark-size);\\n\\tvertical-align: middle;\\n\\n\\t/* Needed on iOS */\\n\\tborder: 0;\\n\\n\\t/* LTR styles */\\n\\tleft: -25px;\\n\\tmargin-right: -15px;\\n\\tright: 0;\\n\\tmargin-left: 0;\\n\\n\\t/* RTL styles */\\n\\t@nest [dir=rtl]& {\\n\\t\\tleft: 0;\\n\\t\\tmargin-right: 0;\\n\\t\\tright: -25px;\\n\\t\\tmargin-left: -15px;\\n\\t}\\n\\n\\t&::before {\\n\\t\\tdisplay: block;\\n\\t\\tposition: absolute;\\n\\t\\tbox-sizing: border-box;\\n\\t\\tcontent: '';\\n\\t\\twidth: 100%;\\n\\t\\theight: 100%;\\n\\t\\tborder: 1px solid hsl(0, 0%, 20%);\\n\\t\\tborder-radius: 2px;\\n\\t\\ttransition: 250ms ease-in-out box-shadow;\\n\\n\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\ttransition: none;\\n\\t\\t}\\n\\t}\\n\\n\\t&::after {\\n\\t\\tdisplay: block;\\n\\t\\tposition: absolute;\\n\\t\\tbox-sizing: content-box;\\n\\t\\tpointer-events: none;\\n\\t\\tcontent: '';\\n\\n\\t\\t/* Calculate tick position, size and border-width proportional to the checkmark size. */\\n\\t\\tleft: calc( var(--ck-todo-list-checkmark-size) / 3 );\\n\\t\\ttop: calc( var(--ck-todo-list-checkmark-size) / 5.3 );\\n\\t\\twidth: calc( var(--ck-todo-list-checkmark-size) / 5.3 );\\n\\t\\theight: calc( var(--ck-todo-list-checkmark-size) / 2.6 );\\n\\t\\tborder-style: solid;\\n\\t\\tborder-color: transparent;\\n\\t\\tborder-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0;\\n\\t\\ttransform: rotate(45deg);\\n\\t}\\n\\n\\t&[checked] {\\n\\t\\t&::before {\\n\\t\\t\\tbackground: hsl(126, 64%, 41%);\\n\\t\\t\\tborder-color: hsl(126, 64%, 41%);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: hsl(0, 0%, 100%);\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * To-do list content styles.\\n */\\n.ck-content .todo-list {\\n\\tlist-style: none;\\n\\n\\t& li {\\n\\t\\tposition: relative;\\n\\t\\tmargin-bottom: 5px;\\n\\n\\t\\t& .todo-list {\\n\\t\\t\\tmargin-top: 5px;\\n\\t\\t}\\n\\t}\\n\\n\\t& .todo-list__label {\\n\\t\\t& > input {\\n\\t\\t\\t@mixin todo-list-checkbox;\\n\\t\\t}\\n\\n\\t\\t& .todo-list__label__description {\\n\\t\\t\\tvertical-align: middle;\\n\\t\\t}\\n\\n\\t\\t&.todo-list__label_without-description input[type=checkbox] {\\n\\t\\t\\tposition: absolute;\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * To-do list editing view styles.\\n */\\n.ck-editor__editable.ck-content .todo-list .todo-list__label {\\n\\t/*\\n\\t * To-do list should be interactive only during the editing\\n\\t * (https://github.com/ckeditor/ckeditor5/issues/2090).\\n\\t */\\n\\t& > input,\\n\\t& > span[contenteditable=false] > input {\\n\\t\\tcursor: pointer;\\n\\n\\t\\t&:hover::before {\\n\\t\\t\\tbox-shadow: 0 0 0 5px hsla(0, 0%, 0%, 0.1);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Document Lists - editing view has an additional span around checkbox.\\n\\t */\\n\\t& > span[contenteditable=false] > input {\\n\\t\\t@mixin todo-list-checkbox;\\n\\t}\\n\\n\\t&.todo-list__label_without-description {\\n\\t\\t& input[type=checkbox] {\\n\\t\\t\\tposition: absolute;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-color-mention-background:rgba(153,0,48,.1);--ck-color-mention-text:#990030}.ck-content .mention{background:var(--ck-color-mention-background);color:var(--ck-color-mention-text)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-mention/mention.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,+CAAwD,CACxD,+BACD,CAEA,qBACC,6CAA8C,CAC9C,kCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-mention-background: hsla(341, 100%, 30%, 0.1);\\n\\t--ck-color-mention-text: hsl(341, 100%, 30%);\\n}\\n\\n.ck-content .mention {\\n\\tbackground: var(--ck-color-mention-background);\\n\\tcolor: var(--ck-color-mention-text);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-mention-list-max-height:300px}.ck.ck-mentions{max-height:var(--ck-mention-list-max-height);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}.ck.ck-mentions>.ck-list__item{flex-shrink:0;overflow:hidden}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-mention/theme/mentionui.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,kCACD,CAEA,gBACC,4CAA6C,CAM7C,iBAAkB,CAJlB,eAAgB,CAMhB,2BAQD,CAJC,+BAEC,aAAc,CADd,eAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-mention-list-max-height: 300px;\\n}\\n\\n.ck.ck-mentions {\\n\\tmax-height: var(--ck-mention-list-max-height);\\n\\n\\toverflow-y: auto;\\n\\n\\t/* Prevent unnecessary horizontal scrollbar in Safari\\n\\thttps://github.com/ckeditor/ckeditor5-mention/issues/41 */\\n\\toverflow-x: hidden;\\n\\n\\toverscroll-behavior: contain;\\n\\n\\t/* Prevent unnecessary vertical scrollbar in Safari\\n\\thttps://github.com/ckeditor/ckeditor5-mention/issues/41 */\\n\\t& > .ck-list__item {\\n\\t\\toverflow: hidden;\\n\\t\\tflex-shrink: 0;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-content .page-break{align-items:center;clear:both;display:flex;justify-content:center;padding:5px 0;position:relative}.ck-content .page-break:after{border-bottom:2px dashed #c4c4c4;content:\"\";position:absolute;width:100%}.ck-content .page-break__label{background:#fff;border:1px solid #c4c4c4;border-radius:2px;box-shadow:2px 2px 1px rgba(0,0,0,.15);color:#333;display:block;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;padding:.3em .6em;position:relative;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}.ck-content :has(+.page-break){margin-bottom:0}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-page-break/theme/pagebreak.css\"],\"names\":[],\"mappings\":\"AAKA,wBAKC,kBAAmB,CAHnB,UAAW,CAEX,YAAa,CAEb,sBAAuB,CAHvB,aAAc,CAFd,iBAaD,CANC,8BAGC,gCAAyC,CAFzC,UAAW,CACX,iBAAkB,CAElB,UACD,CAGD,+BAYC,eAA4B,CAN5B,wBAAiC,CACjC,iBAAkB,CAMlB,sCAA6C,CAF7C,UAAsB,CAPtB,aAAc,CAId,qDAA0D,CAC1D,eAAiB,CACjB,eAAiB,CAPjB,iBAAkB,CAFlB,iBAAkB,CAIlB,wBAAyB,CAWzB,wBAAyB,CACzB,qBAAsB,CACtB,oBAAqB,CACrB,gBAAiB,CAjBjB,SAkBD,CAGA,aACC,wBACC,SAKD,CAHC,8BACC,YACD,CASD,+BACC,eACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content .page-break {\\n\\tposition: relative;\\n\\tclear: both;\\n\\tpadding: 5px 0;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n\\n\\t&::after {\\n\\t\\tcontent: '';\\n\\t\\tposition: absolute;\\n\\t\\tborder-bottom: 2px dashed hsl(0, 0%, 77%);\\n\\t\\twidth: 100%;\\n\\t}\\n}\\n\\n.ck-content .page-break__label {\\n\\tposition: relative;\\n\\tz-index: 1;\\n\\tpadding: .3em .6em;\\n\\tdisplay: block;\\n\\ttext-transform: uppercase;\\n\\tborder: 1px solid hsl(0, 0%, 77%);\\n\\tborder-radius: 2px;\\n\\tfont-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\\n\\tfont-size: 0.75em;\\n\\tfont-weight: bold;\\n\\tcolor: hsl(0, 0%, 20%);\\n\\tbackground: hsl(0, 0%, 100%);\\n\\tbox-shadow: 2px 2px 1px hsla(0, 0%, 0%, 0.15);\\n\\n\\t/* Disable the possibility to select the label text by the user. */\\n\\t-webkit-user-select: none;\\n\\t-moz-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none;\\n}\\n\\n/* Do not show the page break element inside the print preview window. */\\n@media print {\\n\\t.ck-content .page-break {\\n\\t\\tpadding: 0;\\n\\n\\t\\t&::after {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * From time to time placing page-break directly after a block element with margin causes appending a new blank page in pagination mode.\\n\\t * Removing margin-bottom from the block element fixes that issue and the margin is not being moved to the next blank page.\\n\\t *\\n\\t * Keep this in sync with the pagination plugins.\\n\\t */\\n\\t.ck-content *:has(+ .page-break) {\\n\\t\\tmargin-bottom: 0;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%}.ck.ck-input-color>input.ck.ck-input-text{flex-grow:1;min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button{display:flex}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{overflow:hidden;position:relative}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-input-color>.ck.ck-input-text:focus{z-index:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-left-radius:0;border-top-left-radius:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-left:1px solid transparent}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-right:1px solid transparent}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border-radius:0}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border:1px solid var(--ck-color-input-border);height:20px;width:20px}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{background:red;border-radius:2px;height:150%;left:50%;top:-30%;transform:rotate(45deg);transform-origin:50%;width:8%}.ck.ck-input-color .ck.ck-input-color__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);width:100%}.ck.ck-input-color .ck.ck-input-color__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-input-border)}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard);margin-right:0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/colorinput.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,mBAEC,YAAa,CACb,0BAA2B,CAF3B,UAgCD,CA5BC,0CAEC,WAAY,CADZ,cAED,CAEA,sCACC,cAMD,CAHC,kFACC,YACD,CAGD,8CAEC,YAWD,CATC,kFAEC,eAAgB,CADhB,iBAOD,CAJC,0IAEC,aAAc,CADd,iBAED,CC1BF,+CAGE,4BAA6B,CAD7B,yBAcF,CAhBA,+CAQE,2BAA4B,CAD5B,wBASF,CAHC,2CACC,SACD,CAIA,wEACC,SA0CD,CA3CA,kFAKE,2BAA4B,CAD5B,wBAuCF,CApCE,8FACC,iCACD,CATF,kFAcE,4BAA6B,CAD7B,yBA8BF,CA3BE,8FACC,kCACD,CAGD,oFACC,oDACD,CAEA,4GC1CF,eD2DE,CAjBA,+PCtCD,qCDuDC,CAjBA,4GAKC,6CAA8C,CAD9C,WAAY,CADZ,UAcD,CAVC,oKAKC,cAA6B,CAC7B,iBAAkB,CAHlB,WAAY,CADZ,QAAS,CADT,QAAS,CAMT,uBAAwB,CACxB,oBAAqB,CAJrB,QAKD,CAKH,oDAIC,2BAA4B,CAC5B,4BAA6B,CAH7B,qEAAwE,CADxE,UA0BD,CApBC,gEACC,oDACD,CATD,8DAYE,yBAeF,CA3BA,8DAgBE,wBAWF,CARC,gEACC,uCAMD,CAPA,0EAKE,sCAAuC,CADvC,cAGF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-input-color {\\n\\twidth: 100%;\\n\\tdisplay: flex;\\n\\tflex-direction: row-reverse;\\n\\n\\t& > input.ck.ck-input-text {\\n\\t\\tmin-width: auto;\\n\\t\\tflex-grow: 1;\\n\\t}\\n\\n\\t& > div.ck.ck-dropdown {\\n\\t\\tmin-width: auto;\\n\\n\\t\\t/* This dropdown has no arrow but a color preview instead. */\\n\\t\\t& > .ck-input-color__button .ck-dropdown__arrow {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-input-color__button {\\n\\t\\t/* Resolving issue with misaligned buttons on Safari (see #10589) */\\n\\t\\tdisplay: flex;\\n\\n\\t\\t& .ck.ck-input-color__button__preview {\\n\\t\\t\\tposition: relative;\\n\\t\\t\\toverflow: hidden;\\n\\n\\t\\t\\t& > .ck.ck-input-color__button__preview__no-color-indicator {\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n.ck.ck-input-color {\\n\\t& > .ck.ck-input-text {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* Make sure the focused input is always on top of the dropdown button so its\\n\\t\\t outline and border are never cropped (also when the input is read-only). */\\n\\t\\t&:focus {\\n\\t\\t\\tz-index: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck.ck-dropdown {\\n\\t\\t& > .ck.ck-button.ck-input-color__button {\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\n\\t\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\t\\tborder-left: 1px solid transparent;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\n\\t\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\t\\tborder-right: 1px solid transparent;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t&.ck-disabled {\\n\\t\\t\\t\\tbackground: var(--ck-color-input-disabled-background);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck.ck-input-color__button__preview {\\n\\t\\t\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t\\t\\twidth: 20px;\\n\\t\\t\\t\\theight: 20px;\\n\\t\\t\\t\\tborder: 1px solid var(--ck-color-input-border);\\n\\n\\t\\t\\t\\t& > .ck.ck-input-color__button__preview__no-color-indicator {\\n\\t\\t\\t\\t\\ttop: -30%;\\n\\t\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\t\\theight: 150%;\\n\\t\\t\\t\\t\\twidth: 8%;\\n\\t\\t\\t\\t\\tbackground: hsl(0, 100%, 50%);\\n\\t\\t\\t\\t\\tborder-radius: 2px;\\n\\t\\t\\t\\t\\ttransform: rotate(45deg);\\n\\t\\t\\t\\t\\ttransform-origin: 50%;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-input-color__remove-color {\\n\\t\\twidth: 100%;\\n\\t\\tpadding: calc(var(--ck-spacing-standard) / 2) var(--ck-spacing-standard);\\n\\n\\t\\tborder-bottom-left-radius: 0;\\n\\t\\tborder-bottom-right-radius: 0;\\n\\n\\t\\t&:not(:focus) {\\n\\t\\t\\tborder-bottom: 1px solid var(--ck-color-input-border);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t& .ck.ck-icon {\\n\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-right: 0;\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/form.css\"],\"names\":[],\"mappings\":\"AAKA,YACC,mCAyBD,CAvBC,kBAEC,YACD,CAEA,8BACC,cAAe,CACf,OACD,CAEA,4BACC,cAWD,CARE,6DACC,4CACD,CAEA,mEACC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form {\\n\\tpadding: 0 0 var(--ck-spacing-large);\\n\\n\\t&:focus {\\n\\t\\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t& .ck.ck-input-text {\\n\\t\\tmin-width: 100%;\\n\\t\\twidth: 0;\\n\\t}\\n\\n\\t& .ck.ck-dropdown {\\n\\t\\tmin-width: 100%;\\n\\n\\t\\t& .ck-dropdown__button {\\n\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\tborder: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{min-width:100%;width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/formrow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/formrow.css\"],\"names\":[],\"mappings\":\"AAKA,iBACC,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,6BAaD,CAVC,iCACC,WACD,CAGC,wHAEC,sBACD,CCbF,iBACC,4DA2BD,CAvBE,6CAEE,mCAMF,CARA,6CAME,oCAEF,CAGD,2BAEC,cAAe,CADf,UAED,CAEA,2CACC,kCAKD,CAHC,wEACC,0BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form__row {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\tjustify-content: space-between;\\n\\n\\t/* Ignore labels that work as fieldset legends */\\n\\t& > *:not(.ck-label) {\\n\\t\\tflex-grow: 1;\\n\\t}\\n\\n\\t&.ck-table-form__action-row {\\n\\t\\t& .ck-button-save,\\n\\t\\t& .ck-button-cancel {\\n\\t\\t\\tjustify-content: center;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-form__row {\\n\\tpadding: var(--ck-spacing-standard) var(--ck-spacing-large) 0;\\n\\n\\t/* Ignore labels that work as fieldset legends */\\n\\t& > *:not(.ck-label) {\\n\\t\\t& + * {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-large);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-large);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-label {\\n\\t\\twidth: 100%;\\n\\t\\tmin-width: 100%;\\n\\t}\\n\\n\\t&.ck-table-form__action-row {\\n\\t\\tmargin-top: var(--ck-spacing-large);\\n\\n\\t\\t& .ck-button .ck-button__label {\\n\\t\\t\\tcolor: var(--ck-color-text);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}@media (prefers-reduced-motion:reduce){.ck .ck-insert-table-dropdown-grid-box{transition:none}}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/inserttable.css\"],\"names\":[],\"mappings\":\"AAKA,oCACC,YAAa,CACb,kBAAmB,CACnB,cACD,CCJA,MACC,uCAAwC,CACxC,0CAA2C,CAC3C,yCAA0C,CAC1C,yCACD,CAEA,oCAGC,yFAA0F,CAD1F,oJAED,CAEA,mFAEC,iBACD,CAEA,uCAIC,4CAA6C,CAC7C,iBAAkB,CAFlB,iDAAkD,CADlD,qDAAsD,CADtD,mDAAoD,CAKpD,YAAa,CACb,eAcD,CAZC,uCATD,uCAUE,eAWF,CAVC,CAEA,6CACC,eACD,CAEA,6CAEC,6CAA8C,CAD9C,yCAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-insert-table-dropdown__grid {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: wrap;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-insert-table-dropdown-padding: 10px;\\n\\t--ck-insert-table-dropdown-box-height: 11px;\\n\\t--ck-insert-table-dropdown-box-width: 12px;\\n\\t--ck-insert-table-dropdown-box-margin: 1px;\\n}\\n\\n.ck .ck-insert-table-dropdown__grid {\\n\\t/* The width of a container should match 10 items in a row so there will be a 10x10 grid. */\\n\\twidth: calc(var(--ck-insert-table-dropdown-box-width) * 10 + var(--ck-insert-table-dropdown-box-margin) * 20 + var(--ck-insert-table-dropdown-padding) * 2);\\n\\tpadding: var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;\\n}\\n\\n.ck .ck-insert-table-dropdown__label,\\n.ck[dir=rtl] .ck-insert-table-dropdown__label {\\n\\ttext-align: center;\\n}\\n\\n.ck .ck-insert-table-dropdown-grid-box {\\n\\tmin-width: var(--ck-insert-table-dropdown-box-width);\\n\\tmin-height: var(--ck-insert-table-dropdown-box-height);\\n\\tmargin: var(--ck-insert-table-dropdown-box-margin);\\n\\tborder: 1px solid var(--ck-color-base-border);\\n\\tborder-radius: 1px;\\n\\toutline: none;\\n\\ttransition: none;\\n\\n\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\ttransition: none;\\n\\t}\\n\\n\\t&:focus {\\n\\t\\tbox-shadow: none;\\n\\t}\\n\\n\\t&.ck-on {\\n\\t\\tborder-color: var(--ck-color-focus-border);\\n\\t\\tbackground: var(--ck-color-focus-outer-shadow);\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-content .table{display:table;margin:.9em auto}.ck-content .table table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;height:100%;width:100%}.ck-content .table table td,.ck-content .table table th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}.ck-content .table table th{background:rgba(0,0,0,.05);font-weight:700}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/table.css\"],\"names\":[],\"mappings\":\"AAKA,mBAKC,aAAc,CADd,gBAiCD,CA9BC,yBAYC,yBAAkC,CAVlC,wBAAyB,CACzB,gBAAiB,CAKjB,WAAY,CADZ,UAsBD,CAfC,wDAQC,wBAAiC,CANjC,aAAc,CACd,YAMD,CAEA,4BAEC,0BAA+B,CAD/B,eAED,CAMF,+BACC,gBACD,CAEA,+BACC,eACD,CAEA,+CAKC,oBAAqB,CAMrB,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content .table {\\n\\t/* Give the table widget some air and center it horizontally */\\n\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\tmargin: 0.9em auto;\\n\\tdisplay: table;\\n\\n\\t& table {\\n\\t\\t/* The table cells should have slight borders */\\n\\t\\tborder-collapse: collapse;\\n\\t\\tborder-spacing: 0;\\n\\n\\t\\t/* Table width and height are set on the parent <figure>. Make sure the table inside stretches\\n\\t\\tto the full dimensions of the container (https://github.com/ckeditor/ckeditor5/issues/6186). */\\n\\t\\twidth: 100%;\\n\\t\\theight: 100%;\\n\\n\\t\\t/* The outer border of the table should be slightly darker than the inner lines.\\n\\t\\tAlso see https://github.com/ckeditor/ckeditor5-table/issues/50. */\\n\\t\\tborder: 1px double hsl(0, 0%, 70%);\\n\\n\\t\\t& td,\\n\\t\\t& th {\\n\\t\\t\\tmin-width: 2em;\\n\\t\\t\\tpadding: .4em;\\n\\n\\t\\t\\t/* The border is inherited from .ck-editor__nested-editable styles, so theoretically it's not necessary here.\\n\\t\\t\\tHowever, the border is a content style, so it should use .ck-content (so it works outside the editor).\\n\\t\\t\\tHence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */\\n\\t\\t\\tborder: 1px solid hsl(0, 0%, 75%);\\n\\t\\t}\\n\\n\\t\\t& th {\\n\\t\\t\\tfont-weight: bold;\\n\\t\\t\\tbackground: hsla(0, 0%, 0%, 5%);\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Text alignment of the table header should match the editor settings and override the native browser styling,\\nwhen content is available outside the editor. See https://github.com/ckeditor/ckeditor5/issues/6638 */\\n.ck-content[dir=\\\"rtl\\\"] .table th {\\n\\ttext-align: right;\\n}\\n\\n.ck-content[dir=\\\"ltr\\\"] .table th {\\n\\ttext-align: left;\\n}\\n\\n.ck-editor__editable .ck-table-bogus-paragraph {\\n\\t/*\\n\\t * Use display:inline-block to force Chrome/Safari to limit text mutations to this element.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/6062.\\n\\t */\\n\\tdisplay: inline-block;\\n\\n\\t/*\\n\\t * Inline HTML elements nested in the span should always be dimensioned in relation to the whole cell width.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/9117.\\n\\t */\\n\\twidth: 100%;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-color-selector-caption-background:#f7f7f7;--ck-color-selector-caption-text:#333;--ck-color-selector-caption-highlighted-background:#fd0}.ck-content .table>figcaption{background-color:var(--ck-color-selector-caption-background);caption-side:top;color:var(--ck-color-selector-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;text-align:center;word-break:break-word}@media (forced-colors:active){.ck-content .table>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .table>figcaption.table__caption_highlighted{animation:ck-table-caption-highlight .6s ease-out}}.ck.ck-editor__editable .table>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}@keyframes ck-table-caption-highlight{0%{background-color:var(--ck-color-selector-caption-highlighted-background)}to{background-color:var(--ck-color-selector-caption-background)}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\"],\"names\":[],\"mappings\":\"AAOA,MACC,8CAAuD,CACvD,qCAAiD,CACjD,uDACD,CAGA,8BAMC,4DAA6D,CAJ7D,gBAAiB,CAGjB,2CAA4C,CAJ5C,qBAAsB,CAOtB,eAAgB,CAChB,mBAAoB,CAFpB,YAAa,CAHb,iBAAkB,CADlB,qBAaD,CCxBC,8BACC,8BDoBA,sBAAuB,CACvB,WCnBA,CACD,CAIA,4BDqBC,qEACC,iDACD,CCnBD,CDsBA,gEASC,eAAgB,CARhB,oBAAqB,CACrB,qBAAsB,CAQtB,sBAAuB,CAFvB,kBAGD,CAGD,sCACC,GACC,wEACD,CAEA,GACC,4DACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\\\";\\n\\n:root {\\n\\t--ck-color-selector-caption-background: hsl(0, 0%, 97%);\\n\\t--ck-color-selector-caption-text: hsl(0, 0%, 20%);\\n\\t--ck-color-selector-caption-highlighted-background: hsl(52deg 100% 50%);\\n}\\n\\n/* Content styles */\\n.ck-content .table > figcaption {\\n\\tdisplay: table-caption;\\n\\tcaption-side: top;\\n\\tword-break: break-word;\\n\\ttext-align: center;\\n\\tcolor: var(--ck-color-selector-caption-text);\\n\\tbackground-color: var(--ck-color-selector-caption-background);\\n\\tpadding: .6em;\\n\\tfont-size: .75em;\\n\\toutline-offset: -1px;\\n\\n\\t/* Improve placeholder rendering in high-constrast mode (https://github.com/ckeditor/ckeditor5/issues/14907). */\\n\\t@mixin ck-media-forced-colors {\\n\\t\\tbackground-color: unset;\\n\\t\\tcolor: unset;\\n\\t}\\n}\\n\\n/* Editing styles */\\n.ck.ck-editor__editable .table > figcaption {\\n\\t@mixin ck-media-default-colors {\\n\\t\\t&.table__caption_highlighted {\\n\\t\\t\\tanimation: ck-table-caption-highlight .6s ease-out;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-placeholder::before {\\n\\t\\tpadding-left: inherit;\\n\\t\\tpadding-right: inherit;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the table caption placeholder doesn't overflow the placeholder area.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\\n\\t\\t */\\n\\t\\twhite-space: nowrap;\\n\\t\\toverflow: hidden;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n}\\n\\n@keyframes ck-table-caption-highlight {\\n\\t0% {\\n\\t\\tbackground-color: var(--ck-color-selector-caption-highlighted-background);\\n\\t}\\n\\n\\t100% {\\n\\t\\tbackground-color: var(--ck-color-selector-caption-background);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-forced-colors {\\n\\t@media (forced-colors: active) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\\n@define-mixin ck-media-default-colors {\\n\\t@media (forced-colors: none) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tablecellproperties.css\"],\"names\":[],\"mappings\":\"AAOE,6FACC,cAiBD,CAdE,0HAEC,cACD,CAEA,yHAEC,cACD,CAEA,uHACC,WACD,CClBJ,kCACC,WAkBD,CAfE,2FACC,mBAAoB,CACpB,SAAU,CACV,SACD,CAGC,4GACC,eAAgB,CAGhB,qCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-cell-properties-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-cell-properties-form__alignment-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\t&:first-of-type {\\n\\t\\t\\t\\t\\t/* 4 buttons out of 7 (h-alignment + v-alignment) = 0.57 */\\n\\t\\t\\t\\t\\tflex-grow: 0.57;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\t\\t/* 3 buttons out of 7 (h-alignment + v-alignment) = 0.43 */\\n\\t\\t\\t\\t\\tflex-grow: 0.43;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t& .ck-button {\\n\\t\\t\\t\\t\\tflex-grow: 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-cell-properties-form {\\n\\twidth: 320px;\\n\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-cell-properties-form__padding-row {\\n\\t\\t\\talign-self: flex-end;\\n\\t\\t\\tpadding: 0;\\n\\t\\t\\twidth: 25%;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-cell-properties-form__alignment-row {\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\tbackground: none;\\n\\n\\t\\t\\t\\t/* Compensate for missing input label that would push the margin (toolbar has no inputs). */\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-color-selector-column-resizer-hover:var(--ck-color-base-active);--ck-table-column-resizer-width:7px;--ck-table-column-resizer-position-offset:calc(var(--ck-table-column-resizer-width)*-0.5 - 0.5px)}.ck-content .table .ck-table-resized{table-layout:fixed}.ck-content .table table{overflow:hidden}.ck-content .table td,.ck-content .table th{overflow-wrap:break-word;position:relative}.ck.ck-editor__editable .table .ck-table-column-resizer{bottom:0;cursor:col-resize;position:absolute;right:var(--ck-table-column-resizer-position-offset);top:0;user-select:none;width:var(--ck-table-column-resizer-width);z-index:var(--ck-z-default)}.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer,.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer{display:none}.ck.ck-editor__editable .table .ck-table-column-resizer:hover,.ck.ck-editor__editable .table .ck-table-column-resizer__active{background-color:var(--ck-color-selector-column-resizer-hover);bottom:-999999px;opacity:.25;top:-999999px}.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer{left:var(--ck-table-column-resizer-position-offset);right:unset}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,oEAAqE,CACrE,mCAAoC,CAIpC,iGACD,CAEA,qCACC,kBACD,CAEA,yBACC,eACD,CAEA,4CAIC,wBAAyB,CACzB,iBACD,CAEA,wDAGC,QAAS,CAGT,iBAAkB,CALlB,iBAAkB,CAGlB,oDAAqD,CAFrD,KAAM,CAKN,gBAAiB,CAFjB,0CAA2C,CAG3C,2BACD,CAQA,qJACC,YACD,CAEA,8HAEC,8DAA+D,CAO/D,gBAAiB,CANjB,WAAa,CAKb,aAED,CAEA,iEACC,mDAAoD,CACpD,WACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-selector-column-resizer-hover: var(--ck-color-base-active);\\n\\t--ck-table-column-resizer-width: 7px;\\n\\n\\t/* The offset used for absolute positioning of the resizer element, so that it is placed exactly above the cell border.\\n\\t The value is: minus half the width of the resizer decreased additionaly by the half the width of the border (0.5px). */\\n\\t--ck-table-column-resizer-position-offset: calc(var(--ck-table-column-resizer-width) * -0.5 - 0.5px);\\n}\\n\\n.ck-content .table .ck-table-resized {\\n\\ttable-layout: fixed;\\n}\\n\\n.ck-content .table table {\\n\\toverflow: hidden;\\n}\\n\\n.ck-content .table td,\\n.ck-content .table th {\\n\\t/* To prevent text overflowing beyond its cell when columns are resized by resize handler\\n\\t(https://github.com/ckeditor/ckeditor5/pull/14379#issuecomment-1589460978). */\\n\\toverflow-wrap: break-word;\\n\\tposition: relative;\\n}\\n\\n.ck.ck-editor__editable .table .ck-table-column-resizer {\\n\\tposition: absolute;\\n\\ttop: 0;\\n\\tbottom: 0;\\n\\tright: var(--ck-table-column-resizer-position-offset);\\n\\twidth: var(--ck-table-column-resizer-width);\\n\\tcursor: col-resize;\\n\\tuser-select: none;\\n\\tz-index: var(--ck-z-default);\\n}\\n\\n.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer {\\n\\tdisplay: none;\\n}\\n\\n/* The resizer elements, which are extended to an extremely high height, break the drag & drop feature in Chrome. To make it work again,\\n all resizers must be hidden while the table is dragged. */\\n.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer {\\n\\tdisplay: none;\\n}\\n\\n.ck.ck-editor__editable .table .ck-table-column-resizer:hover,\\n.ck.ck-editor__editable .table .ck-table-column-resizer__active {\\n\\tbackground-color: var(--ck-color-selector-column-resizer-hover);\\n\\topacity: 0.25;\\n\\t/* The resizer element resides in each cell so to occupy the entire height of the table, which is unknown from a CSS point of view,\\n\\t it is extended to an extremely high height. Even for screens with a very high pixel density, the resizer will fulfill its role as\\n\\t it should, i.e. for a screen of 476 ppi the total height of the resizer will take over 350 sheets of A4 format, which is totally\\n\\t unrealistic height for a single table. */\\n\\ttop: -999999px;\\n\\tbottom: -999999px;\\n}\\n\\n.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer {\\n\\tleft: var(--ck-table-column-resizer-position-offset);\\n\\tright: unset;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-color-selector-focused-cell-background:rgba(158,201,250,.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-selector-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableediting.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,gEACD,CAKE,8QAGC,2DAA4D,CAK5D,iBAAkB,CAClB,8CAA+C,CAC/C,mBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-selector-focused-cell-background: hsla(212, 90%, 80%, .3);\\n}\\n\\n.ck-widget.table {\\n\\t& td,\\n\\t& th {\\n\\t\\t&.ck-editor__nested-editable.ck-editor__nested-editable_focused,\\n\\t\\t&.ck-editor__nested-editable:focus {\\n\\t\\t\\t/* A very slight background to highlight the focused cell */\\n\\t\\t\\tbackground: var(--ck-color-selector-focused-cell-background);\\n\\n\\t\\t\\t/* Fixes the problem where surrounding cells cover the focused cell's border.\\n\\t\\t\\tIt does not fix the problem in all places but the UX is improved.\\n\\t\\t\\tSee https://github.com/ckeditor/ckeditor5-table/issues/29. */\\n\\t\\t\\tborder-style: none;\\n\\t\\t\\toutline: 1px solid var(--ck-color-focus-border);\\n\\t\\t\\toutline-offset: -1px; /* progressive enhancement - no IE support */\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:\"\";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{max-width:80px;min-width:80px;width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{border-radius:0}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{background:var(--ck-color-base-error);color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both}@media (prefers-reduced-motion:reduce){.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:none}}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tableform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAWE,wHACC,cACD,CAEA,8DAEC,kBAAmB,CADnB,cAgBD,CAbC,qFAGC,kBAAmB,CAFnB,YAAa,CACb,6BAMD,CAEA,sMACC,WACD,CAIF,4CAEC,iBAoBD,CAlBC,8EAGC,2DAAgE,CADhE,QAAS,CADT,iBAAkB,CAGlB,8BAA+B,CAG/B,SAUD,CAPC,oFACC,UAAW,CAGX,QAAS,CAFT,iBAAkB,CAClB,wDAA6D,CAE7D,0BACD,CChDH,MACC,0CAA2C,CAC3C,2CACD,CAMI,2FACC,kCAAmC,CACnC,iBACD,CAGD,8KAIC,cAAe,CADf,cAAe,CADf,UAGD,CAGD,8DACC,SAcD,CAZC,yMAEC,QACD,CAEA,iGACC,mBAAoB,CACpB,oBAAqB,CACrB,wCAAyC,CACzC,6CAA8C,CAC9C,gCACD,CAIF,4CACC,sCA6BD,CA3BC,8ECxCD,eD6DC,CArBA,mMCpCA,qCDyDA,CArBA,8EAGC,qCAAsC,CACtC,qCAAsC,CAEtC,oDAAqD,CADrD,wDAAyD,CAEzD,iBAcD,CAXC,oFACC,2EAA4E,CAE5E,kBAAmB,CADnB,kJAED,CAdD,8EAgBC,iEAKD,CAHC,uCAlBD,8EAmBE,cAEF,CADC,CAID,6GACC,YACD,CAIF,oDACC,GACC,SACD,CAEA,GACC,SACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-form__border-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__background-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__dimensions-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t\\talign-items: center;\\n\\n\\t\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\t\\tdisplay: flex;\\n\\t\\t\\t\\tflex-direction: column-reverse;\\n\\t\\t\\t\\talign-items: center;\\n\\n\\t\\t\\t\\t& .ck.ck-dropdown {\\n\\t\\t\\t\\t\\tflex-grow: 0;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__dimension-operator {\\n\\t\\t\\t\\tflex-grow: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-labeled-field-view {\\n\\t\\t/* Allow absolute positioning of the status (error) balloons. */\\n\\t\\tposition: relative;\\n\\n\\t\\t& .ck.ck-labeled-field-view__status {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tbottom: calc( -1 * var(--ck-table-properties-error-arrow-size) );\\n\\t\\t\\ttransform: translate(-50%,100%);\\n\\n\\t\\t\\t/* Make sure the balloon status stays on top of other form elements. */\\n\\t\\t\\tz-index: 1;\\n\\n\\t\\t\\t/* The arrow pointing towards the field. */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\ttop: calc( -1 * var(--ck-table-properties-error-arrow-size) );\\n\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\ttransform: translateX( -50% );\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-table-properties-error-arrow-size: 6px;\\n\\t--ck-table-properties-min-error-width: 150px;\\n}\\n\\n.ck.ck-table-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-form__border-row {\\n\\t\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\t\\t& > .ck-label {\\n\\t\\t\\t\\t\\tfont-size: var(--ck-font-size-tiny);\\n\\t\\t\\t\\t\\ttext-align: center;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__border-style,\\n\\t\\t\\t& .ck-table-form__border-width {\\n\\t\\t\\t\\twidth: 80px;\\n\\t\\t\\t\\tmin-width: 80px;\\n\\t\\t\\t\\tmax-width: 80px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__dimensions-row {\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t& .ck-table-form__dimensions-row__width,\\n\\t\\t\\t& .ck-table-form__dimensions-row__height {\\n\\t\\t\\t\\tmargin: 0\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__dimension-operator {\\n\\t\\t\\t\\talign-self: flex-end;\\n\\t\\t\\t\\tdisplay: inline-block;\\n\\t\\t\\t\\theight: var(--ck-ui-component-min-height);\\n\\t\\t\\t\\tline-height: var(--ck-ui-component-min-height);\\n\\t\\t\\t\\tmargin: 0 var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-labeled-field-view {\\n\\t\\tpadding-top: var(--ck-spacing-standard);\\n\\n\\t\\t& .ck.ck-labeled-field-view__status {\\n\\t\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t\\tbackground: var(--ck-color-base-error);\\n\\t\\t\\tcolor: var(--ck-color-base-background);\\n\\t\\t\\tpadding: var(--ck-spacing-small) var(--ck-spacing-medium);\\n\\t\\t\\tmin-width: var(--ck-table-properties-min-error-width);\\n\\t\\t\\ttext-align: center;\\n\\n\\t\\t\\t/* The arrow pointing towards the field. */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tborder-color: transparent transparent var(--ck-color-base-error) transparent;\\n\\t\\t\\t\\tborder-width: 0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size);\\n\\t\\t\\t\\tborder-style: solid;\\n\\t\\t\\t}\\n\\n\\t\\t\\tanimation: ck-table-form-labeled-view-status-appear .15s ease both;\\n\\n\\t\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\t\\tanimation: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* Hide the error balloon when the field is blurred. Makes the experience much more clear. */\\n\\t\\t& .ck-input.ck-error:not(:focus) + .ck.ck-labeled-field-view__status {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes ck-table-form-labeled-view-status-appear {\\n\\t0% {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableproperties.css\"],\"names\":[],\"mappings\":\"AAOE,mFAGC,sBAAuB,CADvB,YAAa,CADb,cAOD,CAHC,qHACC,gBACD,CCTH,6BACC,WAmBD,CAhBE,mFACC,mBAAoB,CACpB,SAYD,CAVC,kGACC,eAAgB,CAGhB,qCAKD,CAHC,uHACC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-properties-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-properties-form__alignment-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t\\tflex-basis: 0;\\n\\t\\t\\talign-content: baseline;\\n\\n\\t\\t\\t& .ck.ck-toolbar .ck-toolbar__items {\\n\\t\\t\\t\\tflex-wrap: nowrap;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-properties-form {\\n\\twidth: 320px;\\n\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-properties-form__alignment-row {\\n\\t\\t\\talign-self: flex-end;\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\tbackground: none;\\n\\n\\t\\t\\t\\t/* Compensate for missing input label that would push the margin (toolbar has no inputs). */\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\n\\t\\t\\t\\t& .ck-toolbar__items > * {\\n\\t\\t\\t\\t\\twidth: 40px;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;outline:unset;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableselection.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,wDACD,CAGC,0IAKC,gBAAiB,CAFjB,uBAAwB,CACxB,aAAc,CAFd,iBAiCD,CA3BC,sJAGC,yDAA0D,CAK1D,QAAS,CAPT,UAAW,CAKX,MAAO,CAJP,mBAAoB,CAEpB,iBAAkB,CAGlB,OAAQ,CAFR,KAID,CAEA,wTAEC,4BACD,CAMA,gKACC,aAKD,CAHC,0NACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-table-selected-cell-background: hsla(208, 90%, 80%, .3);\\n}\\n\\n.ck.ck-editor__editable .table table {\\n\\t& td.ck-editor__editable_selected,\\n\\t& th.ck-editor__editable_selected {\\n\\t\\tposition: relative;\\n\\t\\tcaret-color: transparent;\\n\\t\\toutline: unset;\\n\\t\\tbox-shadow: unset;\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/6446 */\\n\\t\\t&:after {\\n\\t\\t\\tcontent: '';\\n\\t\\t\\tpointer-events: none;\\n\\t\\t\\tbackground-color: var(--ck-table-selected-cell-background);\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 0;\\n\\t\\t\\tleft: 0;\\n\\t\\t\\tright: 0;\\n\\t\\t\\tbottom: 0;\\n\\t\\t}\\n\\n\\t\\t& ::selection,\\n\\t\\t&:focus {\\n\\t\\t\\tbackground-color: transparent;\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * To reduce the amount of noise, all widgets in the table selection have no outline and no selection handle.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9491.\\n\\t\\t */\\n\\t\\t& .ck-widget {\\n\\t\\t\\toutline: unset;\\n\\n\\t\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-aria-live-announcer{left:-10000px;position:absolute;top:-10000px}.ck.ck-aria-live-region-list{list-style-type:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/arialiveannouncer/arialiveannouncer.css\"],\"names\":[],\"mappings\":\"AAKA,2BAEC,aAAc,CADd,iBAAkB,CAElB,YACD,CAEA,6BACC,oBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-aria-live-announcer {\\n\\tposition: absolute;\\n\\tleft: -10000px;\\n\\ttop: -10000px;\\n}\\n\\n.ck.ck-aria-live-region-list {\\n\\tlist-style-type: none;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-autocomplete{position:relative}.ck.ck-autocomplete>.ck-search__results{position:absolute;z-index:var(--ck-z-panel)}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{bottom:100%}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{bottom:auto;top:100%}.ck.ck-autocomplete>.ck-search__results{border-radius:0}.ck-rounded-corners .ck.ck-autocomplete>.ck-search__results,.ck.ck-autocomplete>.ck-search__results.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-autocomplete>.ck-search__results{background:var(--ck-color-base-background);border:1px solid var(--ck-color-dropdown-panel-border);box-shadow:var(--ck-drop-shadow),0 0;max-height:200px;min-width:auto;overflow-y:auto}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{border-bottom-left-radius:0;border-bottom-right-radius:0;margin-bottom:-1px}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{border-top-left-radius:0;border-top-right-radius:0;margin-top:-1px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/autocomplete/autocomplete.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/autocomplete/autocomplete.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,oBACC,iBAeD,CAbC,wCACC,iBAAkB,CAClB,yBAUD,CARC,6DACC,WACD,CAEA,6DAEC,WAAY,CADZ,QAED,CCVD,wCCEA,eDuBA,CAzBA,uHCMC,qCDmBD,CAzBA,wCAMC,0CAA2C,CAC3C,sDAAuD,CEPxD,oCAA8B,CFI7B,gBAAiB,CAIjB,cAAe,CAHf,eAoBD,CAfC,6DACC,2BAA4B,CAC5B,4BAA6B,CAG7B,kBACD,CAEA,6DACC,wBAAyB,CACzB,yBAA0B,CAG1B,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-autocomplete {\\n\\tposition: relative;\\n\\n\\t& > .ck-search__results {\\n\\t\\tposition: absolute;\\n\\t\\tz-index: var(--ck-z-panel);\\n\\n\\t\\t&.ck-search__results_n {\\n\\t\\t\\tbottom: 100%;\\n\\t\\t}\\n\\n\\t\\t&.ck-search__results_s {\\n\\t\\t\\ttop: 100%;\\n\\t\\t\\tbottom: auto;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\\\";\\n@import \\\"@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\\\";\\n\\n.ck.ck-autocomplete {\\n\\t& > .ck-search__results {\\n\\t\\t@mixin ck-rounded-corners;\\n\\t\\t@mixin ck-drop-shadow;\\n\\n\\t\\tmax-height: 200px;\\n\\t\\toverflow-y: auto;\\n\\t\\tbackground: var(--ck-color-base-background);\\n\\t\\tborder: 1px solid var(--ck-color-dropdown-panel-border);\\n\\t\\tmin-width: auto;\\n\\n\\t\\t&.ck-search__results_n {\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\n\\t\\t\\t/* Prevent duplicated borders between the input and the results pane. */\\n\\t\\t\\tmargin-bottom: -1px;\\n\\t\\t}\\n\\n\\t\\t&.ck-search__results_s {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\n\\t\\t\\t/* Prevent duplicated borders between the input and the results pane. */\\n\\t\\t\\tmargin-top: -1px;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}[dir=ltr] .ck.ck-button,[dir=ltr] a.ck.ck-button{justify-content:left}[dir=rtl] .ck.ck-button,[dir=rtl] a.ck.ck-button{justify-content:right}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{-webkit-appearance:none;border:1px solid transparent;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}@media (prefers-reduced-motion:reduce){.ck.ck-button,a.ck.ck-button{transition:none}}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{opacity:.5}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:var(--ck-spacing-medium)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{color:var(--ck-color-button-on-color)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/mixins/_button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\"],\"names\":[],\"mappings\":\"AAQA,6BAMC,kBAAmB,CADnB,mBAAoB,CADpB,iBAAkB,CCHlB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD0BD,CA9BA,iDASE,oBAqBF,CA9BA,iDAaE,qBAiBF,CAdC,iEACC,YACD,CAGC,yGACC,oBACD,CAID,iFACC,sBACD,CEzBD,6BCAC,oDD6ID,CC1IE,6EACC,0DACD,CAEA,+EACC,2DACD,CAID,qDACC,6DACD,CDfD,6BEDC,eF8ID,CA7IA,wIEGE,qCF0IF,CA7IA,6BA6BC,uBAAwB,CANxB,4BAA6B,CAjB7B,cAAe,CAcf,iBAAkB,CAHlB,aAAc,CAJd,4CAA6C,CAD7C,2CAA4C,CAJ5C,8BAA+B,CAC/B,iBAAkB,CAiBlB,4DAA8D,CAnB9D,qBAAsB,CAFtB,kBAwID,CA9GC,uCA/BD,6BAgCE,eA6GF,CA5GC,CAEA,oFGpCA,2BAA2B,CCF3B,2CAA8B,CDC9B,YHyCA,CAIC,kJAEC,aACD,CAGD,iEAIC,aAAc,CACd,cAAe,CAHf,iBAAkB,CAClB,mBAAoB,CAMpB,qBASD,CAlBA,qFAYE,eAMF,CAlBA,qFAgBE,gBAEF,CAEA,yEACC,aAWD,CAZA,6FAIE,mCAQF,CAZA,6FAQE,oCAIF,CAZA,yEAWC,UACD,CAIC,oIIxFD,oDJ4FC,CAOA,gLKnGD,kCLqGC,CAEA,iGACC,UACD,CAGD,qEACC,yDAYD,CATC,2HAEE,qCAMF,CARA,2HAME,oCAEF,CAKA,mHACC,WACD,CAID,yCChIA,+CDoIA,CCjIC,yFACC,qDACD,CAEA,2FACC,sDACD,CAID,iEACC,wDACD,CDiHA,yCAGC,qCACD,CAEA,2DACC,iCACD,CAEA,+DACC,mCACD,CAID,2CChJC,mDDqJD,CClJE,2FACC,yDACD,CAEA,6FACC,0DACD,CAID,mEACC,4DACD,CDiID,2CAIC,wCACD,CAEA,uCAEC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n@import \\\"../../mixins/_dir.css\\\";\\n\\n.ck.ck-button,\\na.ck.ck-button {\\n\\t@mixin ck-unselectable;\\n\\n\\tposition: relative;\\n\\tdisplay: inline-flex;\\n\\talign-items: center;\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\tjustify-content: left;\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\tjustify-content: right;\\n\\t}\\n\\n\\t& .ck-button__label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t&.ck-button_with-text {\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Center the icon horizontally in a button without text. */\\n\\t&:not(.ck-button_with-text) {\\n\\t\\tjustify-content: center;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../mixins/_button.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-button,\\na.ck.ck-button {\\n\\t@mixin ck-button-colors --ck-color-button-default;\\n\\t@mixin ck-rounded-corners;\\n\\n\\twhite-space: nowrap;\\n\\tcursor: default;\\n\\tvertical-align: middle;\\n\\tpadding: var(--ck-spacing-tiny);\\n\\ttext-align: center;\\n\\n\\t/* A very important piece of styling. Go to variable declaration to learn more. */\\n\\tmin-width: var(--ck-ui-component-min-height);\\n\\tmin-height: var(--ck-ui-component-min-height);\\n\\n\\t/* Normalize the height of the line. Removing this will break consistent height\\n\\tamong text and text-less buttons (with icons). */\\n\\tline-height: 1;\\n\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t/* Avoid flickering when the foucs border shows up. */\\n\\tborder: 1px solid transparent;\\n\\n\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\ttransition: box-shadow .2s ease-in-out, border .2s ease-in-out;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/189 */\\n\\t-webkit-appearance: none;\\n\\n\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\ttransition: none;\\n\\t}\\n\\n\\t&:active,\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t}\\n\\n\\t/* Allow icon coloring using the text \\\"color\\\" property. */\\n\\t& .ck-button__icon {\\n\\t\\t& use,\\n\\t\\t& use * {\\n\\t\\t\\tcolor: inherit;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__label {\\n\\t\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\t\\tfont-size: inherit;\\n\\t\\tfont-weight: inherit;\\n\\t\\tcolor: inherit;\\n\\t\\tcursor: inherit;\\n\\n\\t\\t/* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and\\n\\t\\twithout labels (but with icons) have different sizes in Chrome */\\n\\t\\tvertical-align: middle;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\ttext-align: left;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\ttext-align: right;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__keystroke {\\n\\t\\tcolor: inherit;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-left: var(--ck-spacing-large);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-right: var(--ck-spacing-large);\\n\\t\\t}\\n\\n\\t\\topacity: .5;\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\\n\\t&.ck-disabled {\\n\\t\\t&:active,\\n\\t\\t&:focus {\\n\\t\\t\\t/* The disabled button should have a slightly less visible shadow when focused. */\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\\n\\t\\t}\\n\\n\\t\\t& .ck-button__icon {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t& .ck-button__keystroke {\\n\\t\\t\\topacity: .3;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-button_with-text {\\n\\t\\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-standard);\\n\\n\\t\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t\\t& .ck-button__icon {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-medium);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-medium);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-button_with-keystroke {\\n\\t\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t}\\n\\t}\\n\\n\\t/* A style of the button which is currently on, e.g. its feature is active. */\\n\\t&.ck-on {\\n\\t\\t@mixin ck-button-colors --ck-color-button-on;\\n\\n\\t\\tcolor: var(--ck-color-button-on-color);\\n\\t}\\n\\n\\t&.ck-button-save {\\n\\t\\tcolor: var(--ck-color-button-save);\\n\\t}\\n\\n\\t&.ck-button-cancel {\\n\\t\\tcolor: var(--ck-color-button-cancel);\\n\\t}\\n}\\n\\n/* A style of the button which handles the primary action. */\\n.ck.ck-button-action,\\na.ck.ck-button-action {\\n\\t@mixin ck-button-colors --ck-color-button-action;\\n\\n\\tcolor: var(--ck-color-button-action-text);\\n}\\n\\n.ck.ck-button-bold,\\na.ck.ck-button-bold {\\n\\tfont-weight: bold;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements a button of given background color.\\n *\\n * @param {String} $background - Background color of the button.\\n * @param {String} $border - Border color of the button.\\n */\\n@define-mixin ck-button-colors $prefix {\\n\\tbackground: var($(prefix)-background);\\n\\n\\t&:not(.ck-disabled) {\\n\\t\\t&:hover {\\n\\t\\t\\tbackground: var($(prefix)-hover-background);\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbackground: var($(prefix)-active-background);\\n\\t\\t}\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\\n\\t&.ck-disabled {\\n\\t\\tbackground: var($(prefix)-disabled-background);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-list-item-button{border-radius:0;min-height:unset;width:100%}[dir=ltr] .ck.ck-list-item-button{text-align:left}[dir=rtl] .ck.ck-list-item-button{text-align:right}[dir=ltr] .ck.ck-list-item-button.ck-list-item-button_toggleable{padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-list-item-button.ck-list-item-button_toggleable{padding-right:var(--ck-spacing-small)}.ck.ck-list-item-button .ck-list-item-button__check-holder{display:inline-flex;height:.9em;width:.9em}[dir=ltr] .ck.ck-list-item-button .ck-list-item-button__check-holder{margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-list-item-button .ck-list-item-button__check-holder{margin-left:var(--ck-spacing-small)}.ck.ck-list-item-button .ck-list-item-button__check-icon{height:100%}.ck.ck-button.ck-list-item-button{padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2)}.ck.ck-button.ck-list-item-button,.ck.ck-button.ck-list-item-button.ck-on{background:var(--ck-color-list-background);color:var(--ck-color-text)}[dir=ltr] .ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){padding-right:var(--ck-spacing-small)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable):not(.ck-disabled),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled):not(.ck-disabled){color:var(--ck-color-text)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/listitembutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/listitembutton.css\"],\"names\":[],\"mappings\":\"AAOA,wBAGC,eAAgB,CAFhB,gBAAiB,CACjB,UAsCD,CAxCA,kCAME,eAkCF,CAxCA,kCAUE,gBA8BF,CA3BC,iEAEE,oCAMF,CARA,iEAME,qCAEF,CAEA,2DACC,mBAAoB,CAEpB,WAAY,CADZ,UAUD,CAZA,qEAME,oCAMF,CAZA,qEAUE,mCAEF,CAEA,yDACC,WACD,CCvCD,kCACC,iEAiCD,CA/BC,0EAEC,0CAA2C,CAC3C,0BACD,CAEA,oFAEE,oCAMF,CARA,oFAME,qCAEF,CAOA,6OAIC,uDAKD,CAHC,qTACC,0BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_dir.css\\\";\\n\\n.ck.ck-list-item-button {\\n\\tmin-height: unset;\\n\\twidth: 100%;\\n\\tborder-radius: 0;\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\ttext-align: left;\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\ttext-align: right;\\n\\t}\\n\\n\\t&.ck-list-item-button_toggleable {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tpadding-left: var(--ck-spacing-small);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tpadding-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-list-item-button__check-holder {\\n\\t\\tdisplay: inline-flex;\\n\\t\\twidth: .9em;\\n\\t\\theight: .9em;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-list-item-button__check-icon {\\n\\t\\theight: 100%;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-button.ck-list-item-button {\\n\\tpadding: var(--ck-spacing-tiny) calc(2 * var(--ck-spacing-standard));\\n\\n\\t&,\\n\\t&.ck-on {\\n\\t\\tbackground: var(--ck-color-list-background);\\n\\t\\tcolor: var(--ck-color-text);\\n\\t}\\n\\n\\t&:has(.ck-list-item-button__check-holder) {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tpadding-left: var(--ck-spacing-small);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tpadding-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * `.ck-on` class and background styling is overridden for `ck-button` in many places.\\n\\t * This is a workaround to make sure that the background is not overridden and uses similar\\n\\t * selector specificity as the other overrides.\\n\\t */\\n\\t&:hover:not(.ck-disabled),\\n\\t&.ck-button.ck-on:hover,\\n\\t&.ck-on:not(.ck-list-item-button_toggleable),\\n\\t&.ck-on:hover {\\n\\t\\tbackground: var(--ck-color-list-button-hover-background);\\n\\n\\t\\t&:not(.ck-disabled) {\\n\\t\\t\\tcolor: var(--ck-color-text);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}@media (prefers-reduced-motion:reduce){.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{transition:none}}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var( --ck-switch-button-translation ))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var( --ck-switch-button-translation )*-1))}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/switchbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\"],\"names\":[],\"mappings\":\"AASE,4HACC,aACD,CCCF,MAEC,8CAA+C,CAE/C,0DAAgE,CAChE,2HAIC,CACD,0FACD,CAOC,0QAEC,sBAAuB,CADvB,aAED,CAEA,0DAGE,4CAOF,CAVA,0DAQE,2CAEF,CAEA,iDCpCA,eDgFA,CA5CA,yIChCC,qCD4ED,CA5CA,2DAKE,gBAuCF,CA5CA,2DAUE,iBAkCF,CA5CA,iDAkBC,uDAAwD,CAFxD,4BAA6B,CAD7B,iFAAsF,CAEtF,0CA2BD,CAxBC,2ECxDD,eDuEC,CAfA,6LCpDA,qCAAsC,CDsDpC,8CAaF,CAfA,2EAOC,yDAA0D,CAD1D,gDAAiD,CAIjD,uBAA0B,CAL1B,+CAUD,CAHC,uCAZD,2EAaE,eAEF,CADC,CAGD,uDACC,6DAKD,CAHC,iFACC,qDACD,CAIF,6DEpFA,kCFsFA,CAGA,oCACC,wBAAyB,CAEzB,eAAgB,CADhB,YAQD,CALC,uDACC,iGAAmG,CAEnG,4BAA6B,CAD7B,kBAED,CAKA,uDACC,sDAkBD,CAhBC,6DACC,4DACD,CAEA,2FAKE,2DAMF,CAXA,2FASE,oEAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-button.ck-switchbutton {\\n\\t& .ck-button__toggle {\\n\\t\\tdisplay: block;\\n\\n\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n/* Note: To avoid rendering issues (aliasing) but to preserve the responsive nature\\nof the component, floating–point numbers have been used which, for the default font size\\n(see: --ck-font-size-base), will generate simple integers. */\\n:root {\\n\\t/* 34px at 13px font-size */\\n\\t--ck-switch-button-toggle-width: 2.6153846154em;\\n\\t/* 14px at 13px font-size */\\n\\t--ck-switch-button-toggle-inner-size: calc(1.0769230769em + 1px);\\n\\t--ck-switch-button-translation: calc(\\n\\t\\tvar(--ck-switch-button-toggle-width) -\\n\\t\\tvar(--ck-switch-button-toggle-inner-size) -\\n\\t\\t2px /* Border */\\n\\t);\\n\\t--ck-switch-button-inner-hover-shadow: 0 0 0 5px var(--ck-color-switch-button-inner-shadow);\\n}\\n\\n.ck.ck-button.ck-switchbutton {\\n\\t/* Unlike a regular button, the switch button text color and background should never change.\\n\\t * Changing toggle switch (background, outline) is enough to carry the information about the\\n\\t * state of the entire component (https://github.com/ckeditor/ckeditor5/issues/12519)\\n\\t */\\n\\t&, &:hover, &:focus, &:active, &.ck-on:hover, &.ck-on:focus, &.ck-on:active {\\n\\t\\tcolor: inherit;\\n\\t\\tbackground: transparent;\\n\\t}\\n\\n\\t& .ck-button__label {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t/* Separate the label from the switch */\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-spacing-large));\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t/* Separate the label from the switch */\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-spacing-large));\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__toggle {\\n\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t/* Make sure the toggle is always to the right as far as possible. */\\n\\t\\t\\tmargin-left: auto;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t/* Make sure the toggle is always to the left as far as possible. */\\n\\t\\t\\tmargin-right: auto;\\n\\t\\t}\\n\\n\\t\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\t\\t/* Gently animate the background color of the toggle switch */\\n\\t\\ttransition: background 400ms ease, box-shadow .2s ease-in-out, outline .2s ease-in-out;\\n\\t\\tborder: 1px solid transparent;\\n\\t\\twidth: var(--ck-switch-button-toggle-width);\\n\\t\\tbackground: var(--ck-color-switch-button-off-background);\\n\\n\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-radius: calc(.5 * var(--ck-border-radius));\\n\\t\\t\\t}\\n\\n\\t\\t\\twidth: var(--ck-switch-button-toggle-inner-size);\\n\\t\\t\\theight: var(--ck-switch-button-toggle-inner-size);\\n\\t\\t\\tbackground: var(--ck-color-switch-button-inner-background);\\n\\n\\t\\t\\t/* Gently animate the inner part of the toggle switch */\\n\\t\\t\\ttransition: all 300ms ease;\\n\\n\\t\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\t\\ttransition: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\tbackground: var(--ck-color-switch-button-off-hover-background);\\n\\n\\t\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t\\tbox-shadow: var(--ck-switch-button-inner-hover-shadow);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-disabled .ck-button__toggle {\\n\\t\\t@mixin ck-disabled;\\n\\t}\\n\\n\\t/* Overriding default .ck-button:focus styles + an outline around the toogle */\\n\\t&:focus {\\n\\t\\tborder-color: transparent;\\n\\t\\toutline: none;\\n\\t\\tbox-shadow: none;\\n\\n\\t\\t& .ck-button__toggle {\\n\\t\\t\\tbox-shadow: 0 0 0 1px var(--ck-color-base-background), 0 0 0 5px var(--ck-color-focus-outer-shadow);\\n\\t\\t\\toutline-offset: 1px;\\n\\t\\t\\toutline: var(--ck-focus-ring);\\n\\t\\t}\\n\\t}\\n\\n\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t&.ck-on {\\n\\t\\t& .ck-button__toggle {\\n\\t\\t\\tbackground: var(--ck-color-switch-button-on-background);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tbackground: var(--ck-color-switch-button-on-hover-background);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t\\t/*\\n\\t\\t\\t\\t* Move the toggle switch to the right. It will be animated.\\n\\t\\t\\t\\t*/\\n\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\ttransform: translateX( var( --ck-switch-button-translation ) );\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\ttransform: translateX( calc( -1 * var( --ck-switch-button-translation ) ) );\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-collapsible.ck-collapsible_collapsed>.ck-collapsible__children{display:none}:root{--ck-collapsible-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-collapsible>.ck.ck-button{border-radius:0;color:inherit;font-weight:700;width:100%}.ck.ck-collapsible>.ck.ck-button:focus{background:transparent}.ck.ck-collapsible>.ck.ck-button:active,.ck.ck-collapsible>.ck.ck-button:hover:not(:focus),.ck.ck-collapsible>.ck.ck-button:not(:focus){background:transparent;border-color:transparent;box-shadow:none}.ck.ck-collapsible>.ck.ck-button>.ck-icon{margin-right:var(--ck-spacing-medium);width:var(--ck-collapsible-arrow-size)}.ck.ck-collapsible>.ck-collapsible__children{padding:var(--ck-spacing-medium) var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/collapsible/collapsible.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/collapsible/collapsible.css\"],\"names\":[],\"mappings\":\"AAMC,sEACC,YACD,CCHD,MACC,yDACD,CAGC,iCAGC,eAAgB,CAChB,aAAc,CAFd,eAAiB,CADjB,UAmBD,CAdC,uCACC,sBACD,CAEA,wIACC,sBAAuB,CACvB,wBAAyB,CACzB,eACD,CAEA,0CACC,qCAAsC,CACtC,sCACD,CAGD,6CACC,gFACD,CAGC,mEACC,wBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-collapsible.ck-collapsible_collapsed {\\n\\t& > .ck-collapsible__children {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-collapsible-arrow-size: calc(0.5 * var(--ck-icon-size));\\n}\\n\\n.ck.ck-collapsible {\\n\\t& > .ck.ck-button {\\n\\t\\twidth: 100%;\\n\\t\\tfont-weight: bold;\\n\\t\\tborder-radius: 0;\\n\\t\\tcolor: inherit;\\n\\n\\t\\t&:focus {\\n\\t\\t\\tbackground: transparent;\\n\\t\\t}\\n\\n\\t\\t&:active, &:not(:focus), &:hover:not(:focus) {\\n\\t\\t\\tbackground: transparent;\\n\\t\\t\\tborder-color: transparent;\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\n\\t\\t& > .ck-icon {\\n\\t\\t\\tmargin-right: var(--ck-spacing-medium);\\n\\t\\t\\twidth: var(--ck-collapsible-arrow-size);\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-collapsible__children {\\n\\t\\tpadding: var(--ck-spacing-medium) var(--ck-spacing-large) var(--ck-spacing-large);\\n\\t}\\n\\n\\t&.ck-collapsible_collapsed {\\n\\t\\t& > .ck.ck-button .ck-icon {\\n\\t\\t\\ttransform: rotate(-90deg);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{transition:box-shadow .2s ease}@media (forced-colors:none){.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;width:var(--ck-color-grid-tile-size)}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile.ck-color-selector__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}}@media (forced-colors:active){.ck.ck-color-grid__tile{height:unset;min-height:unset;min-width:unset;padding:0 var(--ck-spacing-small);width:unset}.ck.ck-color-grid__tile .ck-button__label{display:inline-block}}@media (prefers-reduced-motion:reduce){.ck.ck-color-grid__tile{transition:none}}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorgrid/colorgrid.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\"],\"names\":[],\"mappings\":\"AAKA,kBACC,YACD,CCCA,MACC,8BAA+B,CAK/B,wCACD,CAEA,kBACC,YAAa,CACb,WACD,CAEA,wBACC,8BAkED,CC3EC,4BACC,wBDgBA,QAAS,CAJT,qCAAsC,CAEtC,yCAA0C,CAD1C,wCAAyC,CAEzC,SAAU,CAJV,oCCTA,CDgBA,8HAIC,QACD,CAEA,+DACC,gDACD,CAEA,8BACC,8FACD,CAEA,gGAEC,iGACD,CCjCD,CAZA,8BACC,wBDqDA,YAAa,CAEb,gBAAiB,CADjB,eAAgB,CAEhB,iCAAkC,CAJlC,WClDA,CDwDA,0CACC,oBACD,CCzDD,CD4DA,uCAhDD,wBAiDE,eAkBF,CAjBC,CAEA,oCACC,YAAa,CACb,gBACD,CAEA,oCAEC,2CAA4C,CAD5C,YAED,CAGC,0CACC,aACD,CAIF,yBACC,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-color-grid {\\n\\tdisplay: grid;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\\\";\\n\\n:root {\\n\\t--ck-color-grid-tile-size: 24px;\\n\\n\\t/* Not using global colors here because these may change but some colors in a pallette\\n\\t * require special treatment. For instance, this ensures no matter what the UI text color is,\\n\\t * the check icon will look good on the black color tile. */\\n\\t--ck-color-color-grid-check-icon: hsl(212, 81%, 46%);\\n}\\n\\n.ck.ck-color-grid {\\n\\tgrid-gap: 5px;\\n\\tpadding: 8px;\\n}\\n\\n.ck.ck-color-grid__tile {\\n\\ttransition: .2s ease box-shadow;\\n\\n\\t@mixin ck-media-default-colors {\\n\\t\\twidth: var(--ck-color-grid-tile-size);\\n\\t\\theight: var(--ck-color-grid-tile-size);\\n\\t\\tmin-width: var(--ck-color-grid-tile-size);\\n\\t\\tmin-height: var(--ck-color-grid-tile-size);\\n\\t\\tpadding: 0;\\n\\t\\tborder: 0;\\n\\n\\t\\t&.ck-on,\\n\\t\\t&:focus:not( .ck-disabled ),\\n\\t\\t&:hover:not( .ck-disabled ) {\\n\\t\\t\\t/* Disable the default .ck-button's border ring. */\\n\\t\\t\\tborder: 0;\\n\\t\\t}\\n\\n\\t\\t&.ck-color-selector__color-tile_bordered {\\n\\t\\t\\tbox-shadow: 0 0 0 1px var(--ck-color-base-border);\\n\\t\\t}\\n\\n\\t\\t&.ck-on {\\n\\t\\t\\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-base-text);\\n\\t\\t}\\n\\n\\t\\t&:focus:not( .ck-disabled ),\\n\\t\\t&:hover:not( .ck-disabled ) {\\n\\t\\t\\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-focus-border);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * In high contrast mode, the colors are replaced with text labels.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/14907.\\n\\t */\\n\\t@mixin ck-media-forced-colors {\\n\\t\\twidth: unset;\\n\\t\\theight: unset;\\n\\t\\tmin-width: unset;\\n\\t\\tmin-height: unset;\\n\\t\\tpadding: 0 var(--ck-spacing-small);\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t}\\n\\t}\\n\\n\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\ttransition: none;\\n\\t}\\n\\n\\t&.ck-disabled {\\n\\t\\tcursor: unset;\\n\\t\\ttransition: unset;\\n\\t}\\n\\n\\t& .ck.ck-icon {\\n\\t\\tdisplay: none;\\n\\t\\tcolor: var(--ck-color-color-grid-check-icon);\\n\\t}\\n\\n\\t&.ck-on {\\n\\t\\t& .ck.ck-icon {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-color-grid__label {\\n\\tpadding: 0 var(--ck-spacing-standard);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-forced-colors {\\n\\t@media (forced-colors: active) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\\n@define-mixin ck-media-default-colors {\\n\\t@media (forced-colors: none) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.color-picker-hex-input{width:max-content}.color-picker-hex-input .ck.ck-input{min-width:unset}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;margin:var(--ck-spacing-large) 0 0;width:unset}.ck.ck-color-picker__row .ck.ck-labeled-field-view{padding-top:unset}.ck.ck-color-picker__row .ck.ck-input-text{width:unset}.ck.ck-color-picker__row .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css\"],\"names\":[],\"mappings\":\"AAKA,wBACC,iBAKD,CAHC,qCACC,eACD,CAGD,yBACC,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,6BAA8B,CAC9B,kCAAmC,CACnC,WAcD,CAZC,mDACC,iBACD,CAEA,2CACC,WACD,CAEA,qDAEC,sCAAuC,CADvC,kCAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.color-picker-hex-input {\\n\\twidth: max-content;\\n\\n\\t& .ck.ck-input {\\n\\t\\tmin-width: unset;\\n\\t}\\n}\\n\\n.ck.ck-color-picker__row {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\tjustify-content: space-between;\\n\\tmargin: var(--ck-spacing-large) 0 0;\\n\\twidth: unset;\\n\\n\\t& .ck.ck-labeled-field-view {\\n\\t\\tpadding-top: unset;\\n\\t}\\n\\n\\t& .ck.ck-input-text {\\n\\t\\twidth: unset;\\n\\t}\\n\\n\\t& .ck-color-picker__hash-view {\\n\\t\\tpadding-top: var(--ck-spacing-tiny);\\n\\t\\tpadding-right: var(--ck-spacing-medium);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{align-items:center;display:flex}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{justify-content:flex-start}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{display:flex;flex-direction:row;justify-content:space-around}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-cancel,.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-save{flex:1}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{width:100%}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-left:var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment label.ck.ck-color-grid__label{font-weight:unset}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker{padding:8px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker{height:100px;min-width:180px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation){border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue){border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius)}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue-pointer),.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation-pointer){height:15px;width:15px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{padding:0 8px 8px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorselector/colorselector.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorselector/colorselector.css\"],\"names\":[],\"mappings\":\"AAUE,oLAGC,kBAAmB,CADnB,YAMD,CARA,wMAME,0BAEF,CAKA,iFACC,YAAa,CACb,kBAAmB,CACnB,4BAMD,CAJC,oMAEC,MACD,CCrBD,oLAEC,UACD,CAEA,0FAEC,2BAA4B,CAC5B,4BAA6B,CAF7B,qEAiBD,CAbC,sGACC,gDACD,CAEA,gHAEE,uCAMF,CARA,gHAME,sCAEF,CAGD,6EACC,iBACD,CAKA,oEACC,WAoBD,CAlBC,sFACC,YAAa,CACb,eAeD,CAbC,wGACC,iEACD,CAEA,iGACC,iEACD,CAEA,yNAGC,WAAY,CADZ,UAED,CAIF,iFACC,iBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-color-selector {\\n\\t/* View fragment with color grids. */\\n\\t& .ck-color-grids-fragment {\\n\\t\\t& .ck-button.ck-color-selector__remove-color,\\n\\t\\t& .ck-button.ck-color-selector__color-picker {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\talign-items: center;\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tjustify-content: flex-start;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* View fragment with a color picker. */\\n\\t& .ck-color-picker-fragment {\\n\\t\\t& .ck.ck-color-selector_action-bar {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tflex-direction: row;\\n\\t\\t\\tjustify-content: space-around;\\n\\n\\t\\t\\t& .ck-button-save,\\n\\t\\t\\t& .ck-button-cancel {\\n\\t\\t\\t\\tflex: 1\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-color-selector {\\n\\t/* View fragment with color grids. */\\n\\t& .ck-color-grids-fragment {\\n\\t\\t& .ck-button.ck-color-selector__remove-color,\\n\\t\\t& .ck-button.ck-color-selector__color-picker {\\n\\t\\t\\twidth: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button.ck-color-selector__color-picker {\\n\\t\\t\\tpadding: calc(var(--ck-spacing-standard) / 2) var(--ck-spacing-standard);\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\n\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck.ck-icon {\\n\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& label.ck.ck-color-grid__label {\\n\\t\\t\\tfont-weight: unset;\\n\\t\\t}\\n\\t}\\n\\n\\t/* View fragment with a color picker. */\\n\\t& .ck-color-picker-fragment {\\n\\t\\t& .ck.ck-color-picker {\\n\\t\\t\\tpadding: 8px;\\n\\n\\t\\t\\t& .hex-color-picker {\\n\\t\\t\\t\\theight: 100px;\\n\\t\\t\\t\\tmin-width: 180px;\\n\\n\\t\\t\\t\\t&::part(saturation) {\\n\\t\\t\\t\\t\\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t&::part(hue) {\\n\\t\\t\\t\\t\\tborder-radius: 0 0 var(--ck-border-radius) var(--ck-border-radius);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t&::part(saturation-pointer),\\n\\t\\t\\t\\t&::part(hue-pointer) {\\n\\t\\t\\t\\t\\twidth: 15px;\\n\\t\\t\\t\\t\\theight: 15px;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .ck.ck-color-selector_action-bar {\\n\\t\\t\\tpadding: 0 8px 8px;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-dialog-overlay{bottom:0;left:0;overscroll-behavior:none;position:fixed;right:0;top:0;user-select:none}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent{animation:none;background:none;pointer-events:none}.ck.ck-dialog{overscroll-behavior:none;position:absolute;width:fit-content}.ck.ck-dialog .ck.ck-form__header{flex-shrink:0}.ck.ck-dialog .ck.ck-form__header .ck-form__header__label{cursor:grab}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent .ck.ck-dialog{pointer-events:all}:root{--ck-dialog-overlay-background-color:rgba(0,0,0,.5);--ck-dialog-drop-shadow:0px 0px 6px 2px rgba(0,0,0,.15);--ck-dialog-max-width:100vw;--ck-dialog-max-height:90vh;--ck-color-dialog-background:var(--ck-color-base-background);--ck-color-dialog-form-header-border:var(--ck-color-base-border)}.ck.ck-dialog-overlay{animation:ck-dialog-fade-in .3s;background:var(--ck-dialog-overlay-background-color);z-index:var(--ck-z-dialog)}.ck.ck-dialog{border-radius:0}.ck-rounded-corners .ck.ck-dialog,.ck.ck-dialog.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dialog{box-shadow:var(--ck-drop-shadow),0 0;--ck-drop-shadow:var(--ck-dialog-drop-shadow);background:var(--ck-color-dialog-background);border:1px solid var(--ck-color-base-border);max-height:var(--ck-dialog-max-height);max-width:var(--ck-dialog-max-width)}.ck.ck-dialog .ck.ck-form__header{border-bottom:1px solid var(--ck-color-dialog-form-header-border)}@keyframes ck-dialog-fade-in{0%{background:transparent}to{background:var(--ck-dialog-overlay-background-color)}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dialog/dialog.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dialog/dialog.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,sBAKC,QAAS,CACT,MAAO,CAJP,wBAAyB,CAEzB,cAAe,CAGf,OAAQ,CACR,KAAM,CAPN,gBAcD,CALC,qDAEC,cAAe,CACf,eAAgB,CAFhB,mBAGD,CAGD,cACC,wBAAyB,CAEzB,iBAAkB,CADlB,iBAcD,CAXC,kCACC,aAKD,CAHC,0DACC,WACD,CAVF,mEAcE,kBAEF,CC7BA,MACC,mDAA2D,CAC3D,uDAA8D,CAC9D,2BAA4B,CAC5B,2BAA4B,CAC5B,4DAA6D,CAC7D,gEACD,CAEA,sBACC,+BAAgC,CAChC,oDAAqD,CACrD,0BACD,CAEA,cCbC,eD2BD,CAdA,mECTE,qCDuBF,CAdA,cEfC,oCAA8B,CFmB9B,6CAA8C,CAE9C,4CAA6C,CAG7C,4CAA6C,CAF7C,sCAAuC,CACvC,oCAMD,CAHC,kCACC,iEACD,CAGD,6BACC,GACC,sBACD,CAEA,GACC,oDACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-dialog-overlay {\\n\\tuser-select: none;\\n\\toverscroll-behavior: none;\\n\\n\\tposition: fixed;\\n\\tbottom: 0;\\n\\tleft: 0;\\n\\tright: 0;\\n\\ttop: 0;\\n\\n\\t&.ck-dialog-overlay__transparent {\\n\\t\\tpointer-events: none;\\n\\t\\tanimation: none;\\n\\t\\tbackground: none;\\n\\t}\\n}\\n\\n.ck.ck-dialog {\\n\\toverscroll-behavior: none;\\n\\twidth: fit-content;\\n\\tposition: absolute;\\n\\n\\t& .ck.ck-form__header {\\n\\t\\tflex-shrink: 0;\\n\\n\\t\\t& .ck-form__header__label {\\n\\t\\t\\tcursor: grab;\\n\\t\\t}\\n\\t}\\n\\n\\t@nest .ck.ck-dialog-overlay.ck-dialog-overlay__transparent & {\\n\\t\\tpointer-events: all;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n:root {\\n\\t--ck-dialog-overlay-background-color: hsla( 0, 0%, 0%, .5 );\\n\\t--ck-dialog-drop-shadow: 0px 0px 6px 2px hsl(0deg 0% 0% / 15%);\\n\\t--ck-dialog-max-width: 100vw;\\n\\t--ck-dialog-max-height: 90vh;\\n\\t--ck-color-dialog-background: var(--ck-color-base-background);\\n\\t--ck-color-dialog-form-header-border: var(--ck-color-base-border);\\n}\\n\\n.ck.ck-dialog-overlay {\\n\\tanimation: ck-dialog-fade-in .3s;\\n\\tbackground: var(--ck-dialog-overlay-background-color);\\n\\tz-index: var(--ck-z-dialog);\\n}\\n\\n.ck.ck-dialog {\\n\\t@mixin ck-rounded-corners;\\n\\t@mixin ck-drop-shadow;\\n\\n\\t--ck-drop-shadow: var(--ck-dialog-drop-shadow);\\n\\n\\tbackground: var(--ck-color-dialog-background);\\n\\tmax-height: var(--ck-dialog-max-height);\\n\\tmax-width: var(--ck-dialog-max-width);\\n\\tborder: 1px solid var(--ck-color-base-border);\\n\\n\\t& .ck.ck-form__header {\\n\\t\\tborder-bottom: 1px solid var(--ck-color-dialog-form-header-border);\\n\\t}\\n}\\n\\n@keyframes ck-dialog-fade-in {\\n\\t0% {\\n\\t\\tbackground: hsla( 0, 0%, 0%, 0 );\\n\\t}\\n\\n\\t100% {\\n\\t\\tbackground: var(--ck-dialog-overlay-background-color);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-dialog .ck.ck-dialog__actions{display:flex;justify-content:flex-end;padding:var(--ck-spacing-large)}.ck.ck-dialog .ck.ck-dialog__actions>*+*{margin-left:var(--ck-spacing-large)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dialog/dialogactions.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dialog/dialogactions.css\"],\"names\":[],\"mappings\":\"AAMC,qCACC,YAAa,CACb,wBAAyB,CCDzB,+BDED,CCAC,yCACC,mCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-dialog {\\n\\t& .ck.ck-dialog__actions {\\n\\t\\tdisplay: flex;\\n\\t\\tjustify-content: flex-end;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-dialog {\\n\\t& .ck.ck-dialog__actions {\\n\\t\\tpadding: var(--ck-spacing-large);\\n\\n\\t\\t& > * + * {\\n\\t\\t\\tmargin-left: var(--ck-spacing-large);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-panel) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{overflow:hidden;text-overflow:ellipsis;width:7em}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}.ck.ck-dropdown__panel:focus{outline:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/dropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,4BACD,CAEA,gBACC,oBAAqB,CACrB,iBA2ED,CAzEC,oCACC,mBAAoB,CACpB,2BACD,CAGA,+CACC,UACD,CAEA,oCACC,YAAa,CAEb,sCAAuC,CAEvC,iBAAkB,CAHlB,yBA4DD,CAvDC,+DACC,oBACD,CAEA,mSAKC,WACD,CAEA,mSAUC,WAAY,CADZ,QAED,CAEA,oHAEC,MACD,CAEA,oHAEC,OACD,CAEA,kHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAQF,mCACC,mCACD,CCpFA,MACC,sDACD,CAEA,gBAEC,iBA2ED,CAzEC,oCACC,mCACD,CAGC,8CAIC,sCAAuC,CAHvC,gCAID,CAIA,8CACC,+BAAgC,CAGhC,oCACD,CAGD,gDC/BA,kCDiCA,CAIE,mFAEC,oCACD,CAIA,mFAEC,qCACD,CAID,iEAEC,eAAgB,CAChB,sBAAuB,CAFvB,SAGD,CAGA,6EC1DD,kCD4DC,CAGA,qDACC,2BAA4B,CAC5B,4BACD,CAEA,sGACC,UACD,CAGA,yHAEC,eAKD,CAHC,qIE7EF,2CF+EE,CAKH,uBGlFC,eHkHD,CAhCA,qFG9EE,qCH8GF,CAhCA,uBAIC,oDAAqD,CACrD,sDAAuD,CACvD,QAAS,CE1FT,oCAA8B,CF6F9B,cAuBD,CAnBC,6CACC,wBACD,CAEA,6CACC,yBACD,CAEA,6CACC,2BACD,CAEA,6CACC,4BACD,CAEA,6BACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-dropdown-max-width: 75vw;\\n}\\n\\n.ck.ck-dropdown {\\n\\tdisplay: inline-block;\\n\\tposition: relative;\\n\\n\\t& .ck-dropdown__arrow {\\n\\t\\tpointer-events: none;\\n\\t\\tz-index: var(--ck-z-default);\\n\\t}\\n\\n\\t/* Dropdown button should span horizontally, e.g. in vertical toolbars */\\n\\t& .ck-button.ck-dropdown__button {\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t& .ck-dropdown__panel {\\n\\t\\tdisplay: none;\\n\\t\\tz-index: var(--ck-z-panel);\\n\\t\\tmax-width: var(--ck-dropdown-max-width);\\n\\n\\t\\tposition: absolute;\\n\\n\\t\\t&.ck-dropdown__panel-visible {\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_ne,\\n\\t\\t&.ck-dropdown__panel_nw,\\n\\t\\t&.ck-dropdown__panel_n,\\n\\t\\t&.ck-dropdown__panel_nmw,\\n\\t\\t&.ck-dropdown__panel_nme {\\n\\t\\t\\tbottom: 100%;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_se,\\n\\t\\t&.ck-dropdown__panel_sw,\\n\\t\\t&.ck-dropdown__panel_smw,\\n\\t\\t&.ck-dropdown__panel_sme,\\n\\t\\t&.ck-dropdown__panel_s {\\n\\t\\t\\t/*\\n\\t\\t\\t * Using transform: translate3d( 0, 100%, 0 ) causes blurry dropdown on Chrome 67-78+ on non-retina displays.\\n\\t\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/1053.\\n\\t\\t\\t */\\n\\t\\t\\ttop: 100%;\\n\\t\\t\\tbottom: auto;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_ne,\\n\\t\\t&.ck-dropdown__panel_se {\\n\\t\\t\\tleft: 0px;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nw,\\n\\t\\t&.ck-dropdown__panel_sw {\\n\\t\\t\\tright: 0px;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_s,\\n\\t\\t&.ck-dropdown__panel_n {\\n\\t\\t\\t/* Positioning panels relative to the center of the button */\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\ttransform: translateX(-50%);\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nmw,\\n\\t\\t&.ck-dropdown__panel_smw {\\n\\t\\t\\t/* Positioning panels relative to the middle-west of the button */\\n\\t\\t\\tleft: 75%;\\n\\t\\t\\ttransform: translateX(-75%);\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nme,\\n\\t\\t&.ck-dropdown__panel_sme {\\n\\t\\t\\t/* Positioning panels relative to the middle-east of the button */\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\ttransform: translateX(-25%);\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Toolbar dropdown panels should be always above the UI (eg. other dropdown panels) from the editor's content.\\n * See https://github.com/ckeditor/ckeditor5/issues/7874\\n */\\n.ck.ck-toolbar .ck-dropdown__panel {\\n\\tz-index: calc( var(--ck-z-panel) + 1 );\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n:root {\\n\\t--ck-dropdown-arrow-size: calc(0.5 * var(--ck-icon-size));\\n}\\n\\n.ck.ck-dropdown {\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t& .ck-dropdown__arrow {\\n\\t\\twidth: var(--ck-dropdown-arrow-size);\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& .ck-dropdown__arrow {\\n\\t\\t\\tright: var(--ck-spacing-standard);\\n\\n\\t\\t\\t/* A space to accommodate the triangle. */\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& .ck-dropdown__arrow {\\n\\t\\t\\tleft: var(--ck-spacing-standard);\\n\\n\\t\\t\\t/* A space to accommodate the triangle. */\\n\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-disabled .ck-dropdown__arrow {\\n\\t\\t@mixin ck-disabled;\\n\\t}\\n\\n\\t& .ck-button.ck-dropdown__button {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t&:not(.ck-button_with-text) {\\n\\t\\t\\t\\t/* Make sure dropdowns with just an icon have the right inner spacing */\\n\\t\\t\\t\\tpadding-left: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t&:not(.ck-button_with-text) {\\n\\t\\t\\t\\t/* Make sure dropdowns with just an icon have the right inner spacing */\\n\\t\\t\\t\\tpadding-right: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* #23 */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\twidth: 7em;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\\n\\t\\t&.ck-disabled .ck-button__label {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t\\t&.ck-on {\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__button_label-width_auto .ck-button__label {\\n\\t\\t\\twidth: auto;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/8699 */\\n\\t\\t&.ck-off:active,\\n\\t\\t&.ck-on:active {\\n\\t\\t\\tbox-shadow: none;\\n\\n\\t\\t\\t&:focus {\\n\\t\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-dropdown__panel {\\n\\t@mixin ck-rounded-corners;\\n\\t@mixin ck-drop-shadow;\\n\\n\\tbackground: var(--ck-color-dropdown-panel-background);\\n\\tborder: 1px solid var(--ck-color-dropdown-panel-border);\\n\\tbottom: 0;\\n\\n\\t/* Make sure the panel is at least as wide as the drop-down's button. */\\n\\tmin-width: 100%;\\n\\n\\t/* Disabled corner border radius to be consistent with the .dropdown__button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t&.ck-dropdown__panel_se {\\n\\t\\tborder-top-left-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_sw {\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_ne {\\n\\t\\tborder-bottom-left-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_nw {\\n\\t\\tborder-bottom-right-radius: 0;\\n\\t}\\n\\n\\t&:focus {\\n\\t\\toutline: none;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-dropdown>.ck-dropdown__panel>.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/listdropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,6CCIC,eDqBD,CAzBA,iICQE,qCAAsC,CDJtC,wBAqBF,CAfE,mFCND,eDYC,CANA,6MCFA,qCAAsC,CDKpC,2BAA4B,CAC5B,4BAA6B,CAF7B,wBAIF,CAEA,kFCdD,eDmBC,CALA,2MCVA,qCAAsC,CDYpC,wBAAyB,CACzB,yBAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n.ck.ck-dropdown > .ck-dropdown__panel > .ck-list {\\n\\t/* Disabled radius of top-left border to be consistent with .dropdown__button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t@mixin ck-rounded-corners {\\n\\t\\tborder-top-left-radius: 0;\\n\\t}\\n\\n\\t/* Make sure the button belonging to the first/last child of the list goes well with the\\n\\tborder radius of the entire panel. */\\n\\t& .ck-list__item {\\n\\t\\t&:first-child > .ck-button {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:last-child > .ck-button {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:\"\";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/splitbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,mBAEC,iBAKD,CAHC,iDACC,qCACD,CCJD,MACC,gDAAyD,CACzD,4CACD,CAMC,oIAKE,gCAAiC,CADjC,6BASF,CAbA,oIAWE,+BAAgC,CADhC,4BAGF,CAEA,0CAGC,eAiBD,CApBA,oDAQE,+BAAgC,CADhC,4BAaF,CApBA,oDAcE,gCAAiC,CADjC,6BAOF,CAHC,8CACC,mCACD,CAKD,sDAEC,qBAAwB,CADxB,kBAED,CAQC,0KACC,wDACD,CAIA,8JAKC,0DAA2D,CAJ3D,UAAW,CAGX,WAAY,CAFZ,iBAAkB,CAClB,SAGD,CAGA,sIACC,iEACD,CAGC,kLACC,SACD,CAIA,kLACC,UACD,CAMF,uCCzFA,eDmGA,CAVA,qHCrFC,qCD+FD,CARE,qKACC,2BACD,CAEA,mKACC,4BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-splitbutton {\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t& .ck-splitbutton__action:focus {\\n\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-color-split-button-hover-background: hsl(0, 0%, 92%);\\n\\t--ck-color-split-button-hover-border: hsl(0, 0%, 70%);\\n}\\n\\n.ck.ck-splitbutton {\\n\\t/*\\n\\t * Note: ck-rounded and ck-dir mixins don't go together (because they both use @nest).\\n\\t */\\n\\t&:hover > .ck-splitbutton__action,\\n\\t&.ck-splitbutton_open > .ck-splitbutton__action {\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t/* Don't round the action button on the right side */\\n\\t\\t\\tborder-top-right-radius: unset;\\n\\t\\t\\tborder-bottom-right-radius: unset;\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t/* Don't round the action button on the left side */\\n\\t\\t\\tborder-top-left-radius: unset;\\n\\t\\t\\tborder-bottom-left-radius: unset;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-splitbutton__arrow {\\n\\t\\t/* It's a text-less button and since the icon is positioned absolutely in such situation,\\n\\t\\tit must get some arbitrary min-width. */\\n\\t\\tmin-width: unset;\\n\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t/* Don't round the arrow button on the left side */\\n\\t\\t\\tborder-top-left-radius: unset;\\n\\t\\t\\tborder-bottom-left-radius: unset;\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t/* Don't round the arrow button on the right side */\\n\\t\\t\\tborder-top-right-radius: unset;\\n\\t\\t\\tborder-bottom-right-radius: unset;\\n\\t\\t}\\n\\n\\t\\t& svg {\\n\\t\\t\\twidth: var(--ck-dropdown-arrow-size);\\n\\t\\t}\\n\\t}\\n\\n\\t/* Make sure the divider stretches 100% height of the button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/10936 */\\n\\t& > .ck-splitbutton__arrow:not(:focus) {\\n\\t\\tborder-top-width: 0px;\\n\\t\\tborder-bottom-width: 0px;\\n\\t}\\n\\n\\t/* When the split button is \\\"open\\\" (the arrow is on) or being hovered, it should get some styling\\n\\tas a whole. The background of both buttons should stand out and there should be a visual\\n\\tseparation between both buttons. */\\n\\t&.ck-splitbutton_open,\\n\\t&:hover {\\n\\t\\t/* When the split button hovered as a whole, not as individual buttons. */\\n\\t\\t& > .ck-button:not(.ck-on):not(.ck-disabled):not(:hover) {\\n\\t\\t\\tbackground: var(--ck-color-split-button-hover-background);\\n\\t\\t}\\n\\n\\t\\t/* Splitbutton separator needs to be set with the ::after pseudoselector\\n\\t\\tto display properly the borders on focus */\\n\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\tcontent: '';\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\twidth: 1px;\\n\\t\\t\\theight: 100%;\\n\\t\\t\\tbackground-color: var(--ck-color-split-button-hover-border);\\n\\t\\t}\\n\\n\\t\\t/* Make sure the divider between the buttons looks fine when the button is focused */\\n\\t\\t& > .ck-splitbutton__arrow:focus::after {\\n\\t\\t\\t--ck-color-split-button-hover-border: var(--ck-color-focus-border);\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\t\\tleft: -1px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\t\\tright: -1px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* Don't round the bottom left and right corners of the buttons when \\\"open\\\"\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t&.ck-splitbutton_open {\\n\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t& > .ck-splitbutton__action {\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck-splitbutton__arrow {\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/toolbardropdown.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,oCACD,CAEA,4CAGC,8CAA+C,CAD/C,iBAQD,CAJE,6DACC,qCACD,CCZF,oCACC,QACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-toolbar-dropdown-max-width: 60vw;\\n}\\n\\n.ck.ck-toolbar-dropdown > .ck-dropdown__panel {\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/5586 */\\n\\twidth: max-content;\\n\\tmax-width: var(--ck-toolbar-dropdown-max-width);\\n\\n\\t& .ck-button {\\n\\t\\t&:focus {\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-toolbar-dropdown .ck-toolbar {\\n\\tborder: 0;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-accessibility-help-dialog-max-width:600px;--ck-accessibility-help-dialog-max-height:400px;--ck-accessibility-help-dialog-border-color:#ccced1;--ck-accessibility-help-dialog-code-background-color:#ededed;--ck-accessibility-help-dialog-kbd-shadow-color:#9c9c9c}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{border:1px solid transparent;max-height:var(--ck-accessibility-help-dialog-max-height);max-width:var(--ck-accessibility-help-dialog-max-width);overflow:auto;padding:var(--ck-spacing-large);user-select:text}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{*{white-space:normal}}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content .ck-label{display:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3{font-size:1.2em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4{font-size:1em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content p,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content table{margin:1em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl{border-bottom:none;border-top:1px solid var(--ck-accessibility-help-dialog-border-color);display:grid;grid-template-columns:2fr 1fr}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{border-bottom:1px solid var(--ck-accessibility-help-dialog-border-color);padding:.4em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{grid-column-start:1}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd{grid-column-start:2;text-align:right}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{background:var(--ck-accessibility-help-dialog-code-background-color);border-radius:2px;display:inline-block;font-size:.9em;line-height:1;padding:.4em;text-align:center;vertical-align:middle}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code{font-family:monospace}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{box-shadow:0 1px 1px var(--ck-accessibility-help-dialog-kbd-shadow-color);margin:0 1px;min-width:1.8em}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd+kbd{margin-left:2px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/editorui/accessibilityhelp.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAQA,MACC,8CAA+C,CAC/C,+CAAgD,CAChD,mDAA8D,CAC9D,4DAAyE,CACzE,uDACD,CAEA,wEAOC,4BAA6B,CAJ7B,yDAA0D,CAD1D,uDAAwD,CAExD,aAAc,CAHd,+BAAgC,CAIhC,gBAgFD,CA5EC,8ECdA,2BAA2B,CCF3B,2CAA8B,CDC9B,YDkBA,CAZD,wEAcC,EACC,kBACD,CAqED,CAlEC,kFACC,YACD,CAEA,2EAEC,eAAgB,CADhB,eAED,CAEA,2EAEC,aAAc,CADd,eAED,CAEA,8SAIC,YACD,CAEA,2EAIC,kBAAmB,CADnB,qEAAsE,CAFtE,YAAa,CACb,6BAiBD,CAbC,4JACC,wEAAyE,CACzE,cACD,CAEA,8EACC,mBACD,CAEA,8EACC,mBAAoB,CACpB,gBACD,CAGD,yJAEC,oEAAqE,CAIrE,iBAAkB,CALlB,oBAAqB,CAOrB,cAAe,CAHf,aAAc,CAFd,YAAa,CAIb,iBAAkB,CAHlB,qBAKD,CAEA,6EACC,qBACD,CAEA,4EAEC,yEAA4E,CAC5E,YAAa,CAFb,eAOD,CAHC,gFACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-accessibility-help-dialog-max-width: 600px;\\n\\t--ck-accessibility-help-dialog-max-height: 400px;\\n\\t--ck-accessibility-help-dialog-border-color: hsl(220, 6%, 81%);\\n\\t--ck-accessibility-help-dialog-code-background-color: hsl(0deg 0% 92.94%);\\n\\t--ck-accessibility-help-dialog-kbd-shadow-color: hsl(0deg 0% 61%);\\n}\\n\\n.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content {\\n\\tpadding: var(--ck-spacing-large);\\n\\tmax-width: var(--ck-accessibility-help-dialog-max-width);\\n\\tmax-height: var(--ck-accessibility-help-dialog-max-height);\\n\\toverflow: auto;\\n\\tuser-select: text;\\n\\n\\tborder: 1px solid transparent;\\n\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t}\\n\\n\\t* {\\n\\t\\twhite-space: normal;\\n\\t}\\n\\n\\t/* Hide the main label of the content container. */\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t& h3 {\\n\\t\\tfont-weight: bold;\\n\\t\\tfont-size: 1.2em;\\n\\t}\\n\\n\\t& h4 {\\n\\t\\tfont-weight: bold;\\n\\t\\tfont-size: 1em;\\n\\t}\\n\\n\\t& p,\\n\\t& h3,\\n\\t& h4,\\n\\t& table {\\n\\t\\tmargin: 1em 0;\\n\\t}\\n\\n\\t& dl {\\n\\t\\tdisplay: grid;\\n\\t\\tgrid-template-columns: 2fr 1fr;\\n\\t\\tborder-top: 1px solid var(--ck-accessibility-help-dialog-border-color);\\n\\t\\tborder-bottom: none;\\n\\n\\t\\t& dt, & dd {\\n\\t\\t\\tborder-bottom: 1px solid var(--ck-accessibility-help-dialog-border-color);\\n\\t\\t\\tpadding: .4em 0;\\n\\t\\t}\\n\\n\\t\\t& dt {\\n\\t\\t\\tgrid-column-start: 1;\\n\\t\\t}\\n\\n\\t\\t& dd {\\n\\t\\t\\tgrid-column-start: 2;\\n\\t\\t\\ttext-align: right;\\n\\t\\t}\\n\\t}\\n\\n\\t& kbd, & code {\\n\\t\\tdisplay: inline-block;\\n\\t\\tbackground: var(--ck-accessibility-help-dialog-code-background-color);\\n\\t\\tpadding: .4em;\\n\\t\\tvertical-align: middle;\\n\\t\\tline-height: 1;\\n\\t\\tborder-radius: 2px;\\n\\t\\ttext-align: center;\\n\\t\\tfont-size: .9em;\\n\\t}\\n\\n\\t& code {\\n\\t\\tfont-family: monospace;\\n\\t}\\n\\n\\t& kbd {\\n\\t\\tmin-width: 1.8em;\\n\\t\\tbox-shadow: 0px 1px 1px var(--ck-accessibility-help-dialog-kbd-shadow-color);\\n\\t\\tmargin: 0 1px;\\n\\n\\t\\t& + kbd {\\n\\t\\t\\tmargin-left: 2px;\\n\\t\\t}\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable.ck-rounded-corners:not(.ck-editor__nested-editable){border-radius:var(--ck-border-radius)}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/editorui/editorui.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAWA,MACC,0CACD,CAEA,yDCJC,eDWD,CAPA,yJCAE,qCDOF,CAJC,oEEPA,2BAA2B,CCF3B,qCAA8B,CDC9B,YFWA,CAGD,+BAGC,4BAA6B,CAF7B,aAAc,CACd,oCA6BD,CA1BC,wCACC,eACD,CAEA,wCACC,gBACD,CAGA,4CACC,kCACD,CAGA,2CAKC,qCACD,CAGA,sDACC,kDACD,CAKA,gEACC,oDACD,CAIA,gEACC,iDACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../mixins/_button.css\\\";\\n\\n:root {\\n\\t--ck-color-editable-blur-selection: hsl(0, 0%, 85%);\\n}\\n\\n.ck.ck-editor__editable:not(.ck-editor__nested-editable) {\\n\\t@mixin ck-rounded-corners;\\n\\n\\t&.ck-focused {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-inner-shadow);\\n\\t}\\n}\\n\\n.ck.ck-editor__editable_inline {\\n\\toverflow: auto;\\n\\tpadding: 0 var(--ck-spacing-standard);\\n\\tborder: 1px solid transparent;\\n\\n\\t&[dir=\\\"ltr\\\"] {\\n\\t\\ttext-align: left;\\n\\t}\\n\\n\\t&[dir=\\\"rtl\\\"] {\\n\\t\\ttext-align: right;\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/116 */\\n\\t& > *:first-child {\\n\\t\\tmargin-top: var(--ck-spacing-large);\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/847 */\\n\\t& > *:last-child {\\n\\t\\t/*\\n\\t\\t * This value should match with the default margins of the block elements (like .media or .image)\\n\\t\\t * to avoid a content jumping when the fake selection container shows up (See https://github.com/ckeditor/ckeditor5/issues/9825).\\n\\t\\t */\\n\\t\\tmargin-bottom: var(--ck-spacing-large);\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/6517 */\\n\\t&.ck-blurred ::selection {\\n\\t\\tbackground: var(--ck-color-editable-blur-selection);\\n\\t}\\n}\\n\\n/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/111 */\\n.ck.ck-balloon-panel.ck-toolbar-container[class*=\\\"arrow_n\\\"] {\\n\\t&::after {\\n\\t\\tborder-bottom-color: var(--ck-color-panel-background);\\n\\t}\\n}\\n\\n.ck.ck-balloon-panel.ck-toolbar-container[class*=\\\"arrow_s\\\"] {\\n\\t&::after {\\n\\t\\tborder-top-color: var(--ck-color-panel-background);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__header h2.ck-form__header__label{flex-grow:1}:root{--ck-form-header-height:44px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}[dir=ltr] .ck.ck-form__header>.ck-icon{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-form__header>.ck-icon{margin-left:var(--ck-spacing-medium)}.ck.ck-form__header .ck-form__header__label{--ck-font-size-base:15px;font-weight:700}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/formheader/formheader.css\"],\"names\":[],\"mappings\":\"AAKA,oBAIC,kBAAmB,CAHnB,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CAEjB,6BAKD,CAHC,8CACC,WACD,CCPD,MACC,4BACD,CAEA,oBAIC,mDAAoD,CAFpD,mCAAoC,CACpC,wCAAyC,CAFzC,uDAmBD,CAdC,uCAEE,qCAMF,CARA,uCAME,oCAEF,CAEA,4CACC,wBAAyB,CACzB,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form__header {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\talign-items: center;\\n\\tjustify-content: space-between;\\n\\n\\t& h2.ck-form__header__label {\\n\\t\\tflex-grow: 1;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n:root {\\n\\t--ck-form-header-height: 44px;\\n}\\n\\n.ck.ck-form__header {\\n\\tpadding: var(--ck-spacing-small) var(--ck-spacing-large);\\n\\theight: var(--ck-form-header-height);\\n\\tline-height: var(--ck-form-header-height);\\n\\tborder-bottom: 1px solid var(--ck-color-base-border);\\n\\n\\t& > .ck-icon {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-right: var(--ck-spacing-medium);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: var(--ck-spacing-medium);\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-form__header__label {\\n\\t\\t--ck-font-size-base: 15px;\\n\\t\\tfont-weight: bold;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-highlighted-text mark{background:var(--ck-color-highlight-background);font-size:inherit;font-weight:inherit;line-height:inherit;vertical-align:initial}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/highlightedtext/highlightedtext.css\"],\"names\":[],\"mappings\":\"AAKA,6BACC,+CAAgD,CAIhD,iBAAkB,CAFlB,mBAAoB,CACpB,mBAAoB,CAFpB,sBAID\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-highlighted-text mark {\\n\\tbackground: var(--ck-color-highlight-background);\\n\\tvertical-align: initial;\\n\\tfont-weight: inherit;\\n\\tline-height: inherit;\\n\\tfont-size: inherit;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal));--ck-icon-font-size:.8333350694em}.ck.ck-icon{font-size:var(--ck-icon-font-size);height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/icon/icon.css\"],\"names\":[],\"mappings\":\"AAKA,YACC,qBACD,CCFA,MACC,0EAA6E,CAC7E,iCACD,CAEA,YAKC,kCAAmC,CAHnC,0BAA2B,CAD3B,yBAA0B,CAU1B,qBAoBD,CAlBC,0BALA,cAQA,CAMC,sEACC,aAMD,CAJC,+CAEC,iBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-icon {\\n\\tvertical-align: middle;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-icon-size: calc(var(--ck-line-height-base) * var(--ck-font-size-normal));\\n\\t--ck-icon-font-size: .8333350694em;\\n}\\n\\n.ck.ck-icon {\\n\\twidth: var(--ck-icon-size);\\n\\theight: var(--ck-icon-size);\\n\\n\\t/* Multiplied by the height of the line in \\\"px\\\" should give SVG \\\"viewport\\\" dimensions */\\n\\tfont-size: var(--ck-icon-font-size);\\n\\n\\t/* Inherit cursor style (#5). */\\n\\tcursor: inherit;\\n\\n\\t/* This will prevent blurry icons on Firefox. See #340. */\\n\\twill-change: transform;\\n\\n\\t& * {\\n\\t\\t/* Inherit cursor style (#5). */\\n\\t\\tcursor: inherit;\\n\\t}\\n\\n\\t/* Allows dynamic coloring of an icon by inheriting its color from the parent. */\\n\\t&.ck-icon_inherit-color {\\n\\t\\tcolor: inherit;\\n\\n\\t\\t& * {\\n\\t\\t\\tcolor: inherit;\\n\\n\\t\\t\\t&:not([fill]) {\\n\\t\\t\\t\\t/* Needed by FF. */\\n\\t\\t\\t\\tfill: currentColor;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{border-radius:0}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}@media (prefers-reduced-motion:reduce){.ck.ck-input{transition:none}}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}@media (prefers-reduced-motion:reduce){.ck.ck-input.ck-error{animation:none}}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/input/input.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AASA,MACC,qBAAsB,CAGtB,2CACD,CAEA,aCLC,eDmDD,CA9CA,iECDE,qCD+CF,CA9CA,aAGC,2CAA4C,CAC5C,6CAA8C,CAK9C,4CAA6C,CAH7C,+BAAgC,CADhC,6DAA8D,CAO9D,4DAkCD,CAhCC,uCAdD,aAeE,eA+BF,CA9BC,CAEA,mBEvBA,2BAA2B,CCF3B,2CAA8B,CDC9B,YF2BA,CAEA,uBAEC,oDAAqD,CADrD,sDAAuD,CAEvD,yCAMD,CAJC,6BGnCD,oDHsCC,CAGD,sBAEC,sCAAuC,CADvC,+CAUD,CAPC,uCAJD,sBAKE,cAMF,CALC,CAEA,4BGjDD,iDHmDC,CAIF,0BACC,IACC,0BACD,CAEA,IACC,yBACD,CAEA,IACC,0BACD,CAEA,IACC,yBACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-input-width: 18em;\\n\\n\\t/* Backward compatibility. */\\n\\t--ck-input-text-width: var(--ck-input-width);\\n}\\n\\n.ck.ck-input {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tbackground: var(--ck-color-input-background);\\n\\tborder: 1px solid var(--ck-color-input-border);\\n\\tpadding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);\\n\\tmin-width: var(--ck-input-width);\\n\\n\\t/* This is important to stay of the same height as surrounding buttons */\\n\\tmin-height: var(--ck-ui-component-min-height);\\n\\n\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\ttransition: box-shadow .1s ease-in-out, border .1s ease-in-out;\\n\\n\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\ttransition: none;\\n\\t}\\n\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t}\\n\\n\\t&[readonly] {\\n\\t\\tborder: 1px solid var(--ck-color-input-disabled-border);\\n\\t\\tbackground: var(--ck-color-input-disabled-background);\\n\\t\\tcolor: var(--ck-color-input-disabled-text);\\n\\n\\t\\t&:focus {\\n\\t\\t\\t/* The read-only input should have a slightly less visible shadow when focused. */\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-error {\\n\\t\\tborder-color: var(--ck-color-input-error-border);\\n\\t\\tanimation: ck-input-shake .3s ease both;\\n\\n\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\tanimation: none;\\n\\t\\t}\\n\\n\\t\\t&:focus {\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-error-outer-shadow);\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes ck-input-shake {\\n\\t20% {\\n\\t\\ttransform: translateX(-2px);\\n\\t}\\n\\n\\t40% {\\n\\t\\ttransform: translateX(2px);\\n\\t}\\n\\n\\t60% {\\n\\t\\ttransform: translateX(-1px);\\n\\t}\\n\\n\\t80% {\\n\\t\\ttransform: translateX(1px);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/label/label.css\"],\"names\":[],\"mappings\":\"AAKA,aACC,aACD,CAEA,mBACC,YACD,CCNA,aACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-label {\\n\\tdisplay: block;\\n}\\n\\n.ck.ck-voice-label {\\n\\tdisplay: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-label {\\n\\tfont-weight: bold;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0;transform:translate(calc(var(--ck-spacing-medium)*-1),-6px) scale(.75);transform-origin:100% 0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}@media (prefers-reduced-motion:reduce){.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transition:none}}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/labeledfield/labeledfieldview.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAMC,mEACC,YAAa,CACb,iBACD,CAEA,uCACC,aAAc,CACd,iBACD,CCND,MACC,kEAAsE,CACtE,gFAAiF,CACjF,oEAAqE,CACrE,8EAAiF,CACjF,yEACD,CAEA,0BCLC,eDmHD,CA9GA,2FCDE,qCD+GF,CA3GC,mEACC,UAwCD,CAtCC,gFACC,KAoCD,CArCA,0FAIE,MAAS,CAGT,6DAA+D,CAF/D,oBAgCF,CArCA,0FAWE,OAAU,CAEV,sEAA0E,CAD1E,uBAyBF,CArCA,gFAkBC,yDAA0D,CAG1D,eAAmB,CADnB,kBAAoB,CAOpB,cAAe,CAFf,eAAgB,CANhB,2CAA8C,CAH9C,mBAAoB,CAQpB,sBAAuB,CAKvB,+JAQD,CAHC,uCAlCD,gFAmCE,eAEF,CADC,CASD,mKACC,gCACD,CAGD,yDACC,mCAAoC,CACpC,kCAAmC,CAInC,kBAKD,CAHC,6FACC,gCACD,CAID,4OAEC,yCACD,CAIA,2XAGE,+HAYF,CAfA,2XAOE,wIAQF,CAfA,uWAaC,sBAAuB,CAFvB,iEAAkE,CAGlE,SACD,CAKA,8FACC,sBACD,CAGA,yIACC,SACD,CAGA,kMACC,8HACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-labeled-field-view {\\n\\t& > .ck.ck-labeled-field-view__input-wrapper {\\n\\t\\tdisplay: flex;\\n\\t\\tposition: relative;\\n\\t}\\n\\n\\t& .ck.ck-label {\\n\\t\\tdisplay: block;\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-labeled-field-view-transition: .1s cubic-bezier(0, 0, 0.24, 0.95);\\n\\t--ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-spacing-medium);\\n\\t--ck-labeled-field-label-default-position-x: var(--ck-spacing-medium);\\n\\t--ck-labeled-field-label-default-position-y: calc(0.6 * var(--ck-font-size-base));\\n\\t--ck-color-labeled-field-label-background: var(--ck-color-base-background);\\n}\\n\\n.ck.ck-labeled-field-view {\\n\\t@mixin ck-rounded-corners;\\n\\n\\t& > .ck.ck-labeled-field-view__input-wrapper {\\n\\t\\twidth: 100%;\\n\\n\\t\\t& > .ck.ck-label {\\n\\t\\t\\ttop: 0px;\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tleft: 0px;\\n\\t\\t\\t\\ttransform-origin: 0 0;\\n\\t\\t\\t\\t/* By default, display the label scaled down above the field. */\\n\\t\\t\\t\\ttransform: translate(var(--ck-spacing-medium), -6px) scale(.75);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tright: 0px;\\n\\t\\t\\t\\ttransform-origin: 100% 0;\\n\\t\\t\\t\\ttransform: translate(calc(-1 * var(--ck-spacing-medium)), -6px) scale(.75);\\n\\t\\t\\t}\\n\\n\\t\\t\\tpointer-events: none;\\n\\n\\t\\t\\tbackground: var(--ck-color-labeled-field-label-background);\\n\\t\\t\\tpadding: 0 calc(.5 * var(--ck-font-size-tiny));\\n\\t\\t\\tline-height: initial;\\n\\t\\t\\tfont-weight: normal;\\n\\n\\t\\t\\t/* Prevent overflow when the label is longer than the input */\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t\\toverflow: hidden;\\n\\n\\t\\t\\tmax-width: 100%;\\n\\n\\t\\t\\ttransition:\\n\\t\\t\\t\\ttransform var(--ck-labeled-field-view-transition),\\n\\t\\t\\t\\tpadding var(--ck-labeled-field-view-transition),\\n\\t\\t\\t\\tbackground var(--ck-labeled-field-view-transition);\\n\\n\\t\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\t\\ttransition: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-error {\\n\\t\\t& > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\n\\t\\t& .ck-input:not([readonly]) + .ck.ck-label {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-labeled-field-view__status {\\n\\t\\tfont-size: var(--ck-font-size-small);\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\n\\t\\t/* Let the info wrap to the next line to avoid stretching the layout horizontally.\\n\\t\\tThe status could be very long. */\\n\\t\\twhite-space: normal;\\n\\n\\t\\t&.ck-labeled-field-view__status_error {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\t}\\n\\n\\t/* Disabled fields and fields that have no focus should fade out. */\\n\\t&.ck-disabled > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\tcolor: var(--ck-color-input-disabled-text);\\n\\t}\\n\\n\\t/* Fields that are disabled or not focused and without a placeholder should have full-sized labels. */\\n\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t&.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\ttransform: translate(var(--ck-labeled-field-label-default-position-x), var(--ck-labeled-field-label-default-position-y)) scale(1);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\ttransform: translate(calc(-1 * var(--ck-labeled-field-label-default-position-x)), var(--ck-labeled-field-label-default-position-y)) scale(1);\\n\\t\\t}\\n\\n\\t\\t/* Compensate for the default translate position. */\\n\\t\\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width));\\n\\n\\t\\tbackground: transparent;\\n\\t\\tpadding: 0;\\n\\t}\\n\\n\\t/*------ DropdownView integration ----------------------------------------------------------------------------------- */\\n\\n\\t/* Make sure dropdown' background color in any of dropdown's state does not collide with labeled field. */\\n\\t& > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck.ck-button {\\n\\t\\tbackground: transparent;\\n\\t}\\n\\n\\t/* When the dropdown is \\\"empty\\\", the labeled field label replaces its label. */\\n\\t&.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck-button > .ck-button__label {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\t/* Make sure the label of the empty, unfocused input does not cover the dropdown arrow. */\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown + .ck-label {\\n\\t\\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard));\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{background:var(--ck-color-list-background);list-style-type:none;padding:var(--ck-spacing-small) 0}.ck.ck-list__item{cursor:default;min-width:15em}.ck.ck-list__item>.ck-button:not(.ck-list-item-button){border-radius:0;min-height:unset;padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2);width:100%}[dir=ltr] .ck.ck-list__item>.ck-button:not(.ck-list-item-button){text-align:left}[dir=rtl] .ck.ck-list__item>.ck-button:not(.ck-list-item-button){text-align:right}.ck.ck-list__item>.ck-button:not(.ck-list-item-button) .ck-button__label{line-height:calc(var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button){background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck-list .ck-list__group{padding-top:var(--ck-spacing-medium)}.ck-list .ck-list__group:first-child{padding-top:0}.ck-list .ck-list__group{:not(.ck-hidden)~&{border-top:1px solid var(--ck-color-base-border)}}.ck-list .ck-list__group>.ck-label{font-size:11px;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-large) 0}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;margin:var(--ck-spacing-small) 0;width:100%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/list/list.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,YAGC,YAAa,CACb,qBAAsB,CCFtB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBDaD,CAZC,2DAEC,aACD,CAKA,kCACC,iBAAkB,CAClB,2BACD,CEdD,YCCC,eDOD,CARA,+DCKE,qCDGF,CARA,YAIC,0CAA2C,CAD3C,oBAAqB,CAIrB,iCACD,CAEA,kBACC,cAAe,CAGf,cA4DD,CA1DC,uDAIC,eAAgB,CAFhB,gBAAiB,CADjB,iEAAoE,CAEpE,UAwCD,CA3CA,iEAOE,eAoCF,CA3CA,iEAWE,gBAgCF,CA7BC,yEAEC,qEACD,CAEA,8DACC,eACD,CAEA,6DACC,oDAAqD,CACrD,yCAaD,CAXC,oEACC,eACD,CAEA,qFACC,0DACD,CAEA,qFACC,4CACD,CAGD,+EACC,uDACD,CAMA,mDACC,0CAA2C,CAC3C,aAMD,CAJC,2EACC,uDAAwD,CACxD,aACD,CAKH,yBACC,oCAiBD,CAdC,qCACC,aACD,CAND,yBASC,mBACC,gDACD,CAOD,CALC,mCACC,cAAe,CACf,eAAiB,CACjB,0DACD,CAGD,uBAGC,sCAAuC,CAFvC,UAAW,CAKX,gCAAiC,CAJjC,UAKD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-list {\\n\\t@mixin ck-unselectable;\\n\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n\\n\\t& .ck-list__item,\\n\\t& .ck-list__separator {\\n\\t\\tdisplay: block;\\n\\t}\\n\\n\\t/* Make sure that whatever child of the list item gets focus, it remains on the\\n\\ttop. Thanks to that, styles like box-shadow, outline, etc. are not masked by\\n\\tadjacent list items. */\\n\\t& .ck-list__item > *:focus {\\n\\t\\tposition: relative;\\n\\t\\tz-index: var(--ck-z-default);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-list {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tlist-style-type: none;\\n\\tbackground: var(--ck-color-list-background);\\n\\n\\t/* A spacing at the beginning and end of the list */\\n\\tpadding: var(--ck-spacing-small) 0;\\n}\\n\\n.ck.ck-list__item {\\n\\tcursor: default;\\n\\n\\t/* Almost as wide as menu bar items. */\\n\\tmin-width: 15em;\\n\\n\\t& > .ck-button:not(.ck-list-item-button) {\\n\\t\\tpadding: var(--ck-spacing-tiny) calc(2 * var(--ck-spacing-standard));\\n\\t\\tmin-height: unset;\\n\\t\\twidth: 100%;\\n\\t\\tborder-radius: 0;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\ttext-align: left;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\ttext-align: right;\\n\\t\\t}\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\t/* https://github.com/ckeditor/ckeditor5-heading/issues/63 */\\n\\t\\t\\tline-height: calc(var(--ck-line-height-base) * var(--ck-font-size-base));\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\n\\t\\t&.ck-on {\\n\\t\\t\\tbackground: var(--ck-color-list-button-on-background);\\n\\t\\t\\tcolor: var(--ck-color-list-button-on-text);\\n\\n\\t\\t\\t&:active {\\n\\t\\t\\t\\tbox-shadow: none;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\t\\tbackground: var(--ck-color-list-button-on-background-focus);\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:focus:not(.ck-disabled) {\\n\\t\\t\\t\\tborder-color: var(--ck-color-base-background);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\tbackground: var(--ck-color-list-button-hover-background);\\n\\t\\t}\\n\\t}\\n\\n\\t/* It's unnecessary to change the background/text of a switch toggle; it has different ways\\n\\tof conveying its state (like the switcher) */\\n\\t& > .ck-button.ck-switchbutton {\\n\\t\\t&.ck-on {\\n\\t\\t\\tbackground: var(--ck-color-list-background);\\n\\t\\t\\tcolor: inherit;\\n\\n\\t\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\t\\tbackground: var(--ck-color-list-button-hover-background);\\n\\t\\t\\t\\tcolor: inherit;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck-list .ck-list__group {\\n\\tpadding-top: var(--ck-spacing-medium);\\n\\n\\t/* Lists come with an inner vertical padding. Don't duplicate it. */\\n\\t&:first-child {\\n\\t\\tpadding-top: 0;\\n\\t}\\n\\n\\t/* The group should have a border when it's not the first item. */\\n\\t*:not(.ck-hidden) ~ & {\\n\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t}\\n\\n\\t& > .ck-label {\\n\\t\\tfont-size: 11px;\\n\\t\\tfont-weight: bold;\\n\\t\\tpadding: var(--ck-spacing-medium) var(--ck-spacing-large) 0;\\n\\t}\\n}\\n\\n.ck.ck-list__separator {\\n\\theight: 1px;\\n\\twidth: 100%;\\n\\tbackground: var(--ck-color-base-border);\\n\\n\\t/* Give the separator some air */\\n\\tmargin: var(--ck-spacing-small) 0;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-menu-bar{background:var(--ck-color-base-background);border:1px solid var(--ck-color-toolbar-border);display:flex;flex-wrap:wrap;gap:var(--ck-spacing-small);justify-content:flex-start;padding:var(--ck-spacing-small);width:100%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/menubar/menubar.css\"],\"names\":[],\"mappings\":\"AAKA,gBAIC,0CAA2C,CAG3C,+CAAgD,CANhD,YAAa,CACb,cAAe,CAIf,2BAA4B,CAH5B,0BAA2B,CAE3B,+BAAgC,CAGhC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-menu-bar {\\n\\tdisplay: flex;\\n\\tflex-wrap: wrap;\\n\\tjustify-content: flex-start;\\n\\tbackground: var(--ck-color-base-background);\\n\\tpadding: var(--ck-spacing-small);\\n\\tgap: var(--ck-spacing-small);\\n\\tborder: 1px solid var(--ck-color-toolbar-border);\\n\\twidth: 100%;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-menu-bar__menu{display:block;font-size:inherit;position:relative}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level{max-width:100%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenu.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/menubar/menubarmenu.css\"],\"names\":[],\"mappings\":\"AAKA,sBACC,aAAc,CCCd,iBAAkB,CDAlB,iBACD,CCCC,kDACC,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-menu-bar__menu {\\n\\tdisplay: block;\\n\\tposition: relative;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-menu-bar__menu {\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t&.ck-menu-bar__menu_top-level {\\n\\t\\tmax-width: 100%;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button{width:100%}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button{min-height:unset;padding:var(--ck-spacing-small) var(--ck-spacing-medium)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-button__label{line-height:unset;width:unset}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-icon{display:none}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button{border-radius:0}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{margin-left:var(--ck-spacing-standard);margin-right:calc(var(--ck-spacing-small)*-1);transform:rotate(-90deg)}[dir=rtl] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{left:var(--ck-spacing-standard);margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small);transform:rotate(90deg)}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button.ck-disabled>.ck-menu-bar__menu__button__arrow{opacity:var(--ck-disabled-opacity)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenubutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/menubar/menubarmenubutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\"],\"names\":[],\"mappings\":\"AAMC,mFACC,mBAAoB,CACpB,2BACD,CCIA,iDACC,UAuBD,CArBC,mEACC,WAAY,CACZ,eAAgB,CAChB,sBACD,CAEA,+ECbD,kCDeC,CAGC,qFACC,oCACD,CAIA,qFACC,qCACD,CAOF,6EAEC,gBAAiB,CADjB,wDAgBD,CAbC,+FAEC,iBAAkB,CADlB,WAED,CAEA,mFACC,2BAA4B,CAC5B,4BACD,CAEA,sFACC,YACD,CAMD,mFACC,eA+BD,CA7BC,qHACC,mCAuBD,CAxBA,+HAOE,sCAAuC,CAGvC,6CAAgD,CANhD,wBAoBF,CAxBA,+HAgBE,+BAAgC,CAMhC,4CAA+C,CAH/C,oCAAqC,CALrC,uBAUF,CAEA,iICpFD,kCDsFC\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-menu-bar__menu {\\n\\t& > .ck-menu-bar__menu__button > .ck-menu-bar__menu__button__arrow {\\n\\t\\tpointer-events: none;\\n\\t\\tz-index: var(--ck-z-default);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../mixins/_button.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-menu-bar__menu {\\n\\t/*\\n\\t * All menu buttons.\\n\\t */\\n\\t& > .ck-menu-bar__menu__button {\\n\\t\\twidth: 100%;\\n\\n\\t\\t& > .ck-button__label {\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t}\\n\\n\\t\\t&.ck-disabled > .ck-button__label {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t&:not(.ck-button_with-text) {\\n\\t\\t\\t\\tpadding-left: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t&:not(.ck-button_with-text) {\\n\\t\\t\\t\\tpadding-right: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Top-level menu buttons only.\\n\\t */\\n\\t&.ck-menu-bar__menu_top-level > .ck-menu-bar__menu__button {\\n\\t\\tpadding: var(--ck-spacing-small) var(--ck-spacing-medium);\\n\\t\\tmin-height: unset;\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\twidth: unset;\\n\\t\\t\\tline-height: unset;\\n\\t\\t}\\n\\n\\t\\t&.ck-on {\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Sub-menu buttons.\\n\\t */\\n\\t&:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button {\\n\\t\\tborder-radius: 0;\\n\\n\\t\\t& > .ck-menu-bar__menu__button__arrow {\\n\\t\\t\\twidth: var(--ck-dropdown-arrow-size);\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\ttransform: rotate(-90deg);\\n\\n\\t\\t\\t\\t/* A space to accommodate the triangle. */\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\n\\t\\t\\t\\t/* Nudge the arrow gently to the right because its center of gravity is to the left */\\n\\t\\t\\t\\tmargin-right: calc(-1 * var(--ck-spacing-small));\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\ttransform: rotate(90deg);\\n\\n\\t\\t\\t\\tleft: var(--ck-spacing-standard);\\n\\n\\t\\t\\t\\t/* A space to accommodate the triangle. */\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\n\\t\\t\\t\\t/* Nudge the arrow gently to the left because its center of gravity is to the right (after rotation). */\\n\\t\\t\\t\\tmargin-left: calc(-1 * var(--ck-spacing-small));\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-disabled > .ck-menu-bar__menu__button__arrow {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-menu-bar-menu-item-min-width:18em}.ck.ck-menu-bar__menu .ck.ck-menu-bar__menu__item{min-width:var(--ck-menu-bar-menu-item-min-width)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/menubar/menubarmenulistitem.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,sCACD,CAEA,kDACC,gDACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-menu-bar-menu-item-min-width: 18em;\\n}\\n\\n.ck.ck-menu-bar__menu .ck.ck-menu-bar__menu__item {\\n\\tmin-width: var(--ck-menu-bar-menu-item-min-width);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button{border-radius:0}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container,.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{font-size:var(--ck-icon-font-size)}[dir=ltr] .ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-left:var(--ck-spacing-medium)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/menubar/menubarmenulistitembutton.css\"],\"names\":[],\"mappings\":\"AAWC,iEACC,eAoBD,CAlBC,0LAGC,8BACD,CAEA,uFAEC,kCASD,CAXA,iGAKE,qCAMF,CAXA,iGASE,oCAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-menu-bar__menu {\\n\\t/*\\n\\t * List item buttons.\\n\\t */\\n\\t& .ck-button.ck-menu-bar__menu__item__button {\\n\\t\\tborder-radius: 0;\\n\\n\\t\\t& > .ck-spinner-container,\\n\\t\\t& > .ck-spinner-container .ck-spinner {\\n\\t\\t\\t/* These styles correspond to .ck-icon so that the spinner seamlessly replaces the icon. */\\n\\t\\t\\t--ck-toolbar-spinner-size: 20px;\\n\\t\\t}\\n\\n\\t\\t& > .ck-spinner-container {\\n\\t\\t\\t/* This ensures margins corresponding to the .ck-icon. */\\n\\t\\t\\tfont-size: var(--ck-icon-font-size);\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-medium);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-medium);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-menu-bar-menu-max-width:75vw;--ck-menu-bar-nested-menu-horizontal-offset:5px}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{max-width:var(--ck-menu-bar-menu-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw{bottom:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{bottom:auto;top:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{left:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{right:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{left:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en{bottom:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{right:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{bottom:0}:root{--ck-menu-bar-menu-panel-max-width:75vw}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{border-radius:0}.ck-rounded-corners .ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;height:fit-content;max-width:var(--ck-menu-bar-menu-panel-max-width)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{border-top-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{border-top-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne{border-bottom-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{border-bottom-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel:focus{outline:none}.ck.ck-menu-bar .ck-list-item-button:active,.ck.ck-menu-bar .ck-list-item-button:focus{border-color:transparent;box-shadow:none}.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:active,.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none;position:relative;z-index:2}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/menubar/menubarmenupanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/menubar/menubarmenupanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,iCAAkC,CAClC,+CACD,CAEA,mDAEC,2CAA4C,CAC5C,iBAAkB,CAFlB,yBAkDD,CA9CC,gLAEC,WACD,CAEA,gLAGC,WAAY,CADZ,QAED,CAEA,gLAEC,MACD,CAEA,gLAEC,OACD,CAEA,gLAEC,kEACD,CAEA,wFACC,KACD,CAEA,wFACC,QACD,CAEA,gLAEC,mEACD,CAEA,wFACC,KACD,CAEA,wFACC,QACD,CCnDD,MACC,uCACD,CAEA,mDCFC,eDoCD,CAlCA,6ICEE,qCDgCF,CAlCA,mDAIC,oDAAqD,CACrD,sDAAuD,CACvD,QAAS,CEVT,oCAA8B,CFW9B,kBAAmB,CACnB,iDA0BD,CAvBC,gLAEC,wBACD,CAEA,gLAEC,yBACD,CAEA,gLAEC,2BACD,CAEA,gLAEC,4BACD,CAEA,yDACC,YACD,CAKC,uFAEC,wBAAyB,CACzB,eACD,CAIA,yJGhDD,2BAA2B,CDF3B,2CAA8B,CCC9B,YAAa,CHoDX,iBAAkB,CAClB,SAID\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-menu-bar-menu-max-width: 75vw;\\n\\t--ck-menu-bar-nested-menu-horizontal-offset: 5px;\\n}\\n\\n.ck.ck-menu-bar__menu > .ck.ck-menu-bar__menu__panel {\\n\\tz-index: var(--ck-z-panel);\\n\\tmax-width: var(--ck-menu-bar-menu-max-width);\\n\\tposition: absolute;\\n\\n\\t&.ck-menu-bar__menu__panel_position_ne,\\n\\t&.ck-menu-bar__menu__panel_position_nw {\\n\\t\\tbottom: 100%;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_se,\\n\\t&.ck-menu-bar__menu__panel_position_sw {\\n\\t\\ttop: 100%;\\n\\t\\tbottom: auto;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_ne,\\n\\t&.ck-menu-bar__menu__panel_position_se {\\n\\t\\tleft: 0px;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_nw,\\n\\t&.ck-menu-bar__menu__panel_position_sw {\\n\\t\\tright: 0px;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_es,\\n\\t&.ck-menu-bar__menu__panel_position_en {\\n\\t\\tleft: calc( 100% - var(--ck-menu-bar-nested-menu-horizontal-offset) );\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_es {\\n\\t\\ttop: 0px;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_en {\\n\\t\\tbottom: 0px;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_ws,\\n\\t&.ck-menu-bar__menu__panel_position_wn {\\n\\t\\tright: calc( 100% - var(--ck-menu-bar-nested-menu-horizontal-offset) );\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_ws {\\n\\t\\ttop: 0px;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_wn {\\n\\t\\tbottom: 0px;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"../../../mixins/_focus.css\\\";\\n\\n:root {\\n\\t--ck-menu-bar-menu-panel-max-width: 75vw;\\n}\\n\\n.ck.ck-menu-bar__menu > .ck.ck-menu-bar__menu__panel {\\n\\t@mixin ck-rounded-corners;\\n\\t@mixin ck-drop-shadow;\\n\\n\\tbackground: var(--ck-color-dropdown-panel-background);\\n\\tborder: 1px solid var(--ck-color-dropdown-panel-border);\\n\\tbottom: 0;\\n\\theight: fit-content;\\n\\tmax-width: var(--ck-menu-bar-menu-panel-max-width);\\n\\n\\t/* Corner border radius consistent with the button. */\\n\\t&.ck-menu-bar__menu__panel_position_es,\\n\\t&.ck-menu-bar__menu__panel_position_se {\\n\\t\\tborder-top-left-radius: 0;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_ws,\\n\\t&.ck-menu-bar__menu__panel_position_sw {\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_en,\\n\\t&.ck-menu-bar__menu__panel_position_ne {\\n\\t\\tborder-bottom-left-radius: 0;\\n\\t}\\n\\n\\t&.ck-menu-bar__menu__panel_position_wn,\\n\\t&.ck-menu-bar__menu__panel_position_nw {\\n\\t\\tborder-bottom-right-radius: 0;\\n\\t}\\n\\n\\t&:focus {\\n\\t\\toutline: none;\\n\\t}\\n}\\n\\n.ck.ck-menu-bar {\\n\\t& .ck-list-item-button {\\n\\t\\t&:focus,\\n\\t\\t&:active {\\n\\t\\t\\tborder-color: transparent;\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-menu-bar_focus-border-enabled .ck-list-item-button {\\n\\t\\t&:focus,\\n\\t\\t&:active {\\n\\t\\t\\t/* Fix truncated shadows due to rendering order. */\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 2;\\n\\n\\t\\t\\t@mixin ck-focus-ring;\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-panel)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:\"\";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-border-width:1px;--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);box-shadow:var(--ck-drop-shadow),0 0;min-height:15px}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonpanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,MAEC,8DACD,CAEA,qBACC,YAAa,CACb,iBAAkB,CAElB,yBAyCD,CAtCE,+GAEC,UAAW,CACX,iBACD,CAEA,wDACC,6CACD,CAEA,uDACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAGD,8CACC,aACD,CC9CD,MACC,6BAA8B,CAC9B,6BAA8B,CAC9B,8BAA+B,CAC/B,iCAAkC,CAClC,oEACD,CAEA,qBCLC,eDmMD,CA9LA,iFCDE,qCD+LF,CA9LA,qBAMC,2CAA4C,CAC5C,wEAAyE,CEdzE,oCAA8B,CFW9B,eA0LD,CApLE,+GAIC,kBAAmB,CADnB,QAAS,CADT,OAGD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,kDACD,CAEA,2CACC,iFAAkF,CAClF,gFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,iEAAkE,CAClE,uDAAwD,CACxD,qDACD,CAEA,2CACC,iFAAkF,CAClF,mFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,oDACD,CAEA,2CACC,iFAAkF,CAClF,kFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,mDACD,CAEA,2CACC,iFAAkF,CAClF,iFACD,CAIA,yGAEC,QAAS,CACT,uDAA0D,CAC1D,2CACD,CAIA,2GAEC,+CAAkD,CAClD,2CACD,CAIA,2GAEC,gDAAmD,CACnD,2CACD,CAIA,yGAIC,8CAAiD,CAFjD,QAAS,CACT,uDAED,CAIA,2GAGC,8CAAiD,CADjD,+CAED,CAIA,2GAGC,8CAAiD,CADjD,gDAED,CAIA,6GAIC,8CAAiD,CADjD,uDAA0D,CAD1D,SAGD,CAIA,6GAIC,8CAAiD,CAFjD,QAAS,CACT,sDAED,CAIA,6GAGC,uDAA0D,CAD1D,SAAU,CAEV,2CACD,CAIA,6GAEC,QAAS,CACT,sDAAyD,CACzD,2CACD,CAIA,yGAGC,sDAAyD,CADzD,6CAAgD,CAEhD,OACD,CAIA,yGAEC,4CAA+C,CAC/C,sDAAyD,CACzD,OACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/* Make sure the balloon arrow does not float over its children. */\\n\\t--ck-balloon-panel-arrow-z-index: calc(var(--ck-z-default) - 3);\\n}\\n\\n.ck.ck-balloon-panel {\\n\\tdisplay: none;\\n\\tposition: absolute;\\n\\n\\tz-index: var(--ck-z-panel);\\n\\n\\t&.ck-balloon-panel_with-arrow {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\tposition: absolute;\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_n\\\"] {\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_s\\\"] {\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_visible {\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-balloon-border-width: 1px;\\n\\t--ck-balloon-arrow-offset: 2px;\\n\\t--ck-balloon-arrow-height: 10px;\\n\\t--ck-balloon-arrow-half-width: 8px;\\n\\t--ck-balloon-arrow-drop-shadow: 0 2px 2px var(--ck-color-shadow-drop);\\n}\\n\\n.ck.ck-balloon-panel {\\n\\t@mixin ck-rounded-corners;\\n\\t@mixin ck-drop-shadow;\\n\\n\\tmin-height: 15px;\\n\\n\\tbackground: var(--ck-color-panel-background);\\n\\tborder: var(--ck-balloon-border-width) solid var(--ck-color-panel-border);\\n\\n\\t&.ck-balloon-panel_with-arrow {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\twidth: 0;\\n\\t\\t\\theight: 0;\\n\\t\\t\\tborder-style: solid;\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_n\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent transparent var(--ck-color-panel-border) transparent;\\n\\t\\t\\tmargin-top: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent transparent var(--ck-color-panel-background) transparent;\\n\\t\\t\\tmargin-top: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_s\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: var(--ck-color-panel-border) transparent transparent;\\n\\t\\t\\tfilter: drop-shadow(var(--ck-balloon-arrow-drop-shadow));\\n\\t\\t\\tmargin-bottom: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: var(--ck-color-panel-background) transparent transparent transparent;\\n\\t\\t\\tmargin-bottom: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_e\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent transparent transparent var(--ck-color-panel-border);\\n\\t\\t\\tmargin-right: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent transparent transparent var(--ck-color-panel-background);\\n\\t\\t\\tmargin-right: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_w\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0;\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent var(--ck-color-panel-border) transparent transparent;\\n\\t\\t\\tmargin-left: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent var(--ck-color-panel-background) transparent transparent;\\n\\t\\t\\tmargin-left: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_n {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_ne {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_s {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_sw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_se {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_sme {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: 25%;\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_smw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nme {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: 25%;\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nmw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_e {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t\\tmargin-top: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: 50%;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_w {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t\\tmargin-top: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck .ck-balloon-rotator__navigation{align-items:center;display:flex;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonrotator.css\"],\"names\":[],\"mappings\":\"AAKA,oCAEC,kBAAmB,CADnB,YAAa,CAEb,sBACD,CAKA,6CACC,sBACD,CCXA,oCACC,6CAA8C,CAC9C,sDAAuD,CACvD,iCAgBD,CAbC,sCAGC,qCAAsC,CAFtC,oCAAqC,CACrC,kCAED,CAGA,iEAIC,mCAAoC,CAHpC,uCAID,CAMA,2DACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-balloon-rotator__navigation {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n}\\n\\n/* Buttons inside a toolbar should be centered when rotator bar is wider.\\n * See: https://github.com/ckeditor/ckeditor5-ui/issues/495\\n */\\n.ck .ck-balloon-rotator__content .ck-toolbar {\\n\\tjustify-content: center;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-balloon-rotator__navigation {\\n\\tbackground: var(--ck-color-toolbar-background);\\n\\tborder-bottom: 1px solid var(--ck-color-toolbar-border);\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\n\\t/* Let's keep similar appearance to `ck-toolbar`. */\\n\\t& > * {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Gives counter more breath than buttons. */\\n\\t& .ck-balloon-rotator__counter {\\n\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\n\\t\\t/* We need to use smaller margin because of previous button's right margin. */\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n.ck .ck-balloon-rotator__content {\\n\\n\\t/* Disable default annotation shadow inside rotator with fake panels. */\\n\\t& .ck.ck-annotation-wrapper {\\n\\t\\tbox-shadow: none;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-panel) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/fakepanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,mBACC,iBAAkB,CAGlB,mCACD,CAEA,uBACC,iBACD,CAEA,mCACC,SACD,CAEA,oCACC,SACD,CCfA,MACC,6CAA8C,CAC9C,2CACD,CAGA,uBAKC,2CAA4C,CAC5C,6CAA8C,CAC9C,qCAAsC,CCXtC,oCAA8B,CDc9B,WAAY,CAPZ,eAAgB,CAMhB,UAED,CAEA,mCACC,0DAA2D,CAC3D,uDACD,CAEA,oCACC,kEAAqE,CACrE,+DACD,CACA,oCACC,kEAAqE,CACrE,+DACD,CAGA,yIAGC,4CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-fake-panel {\\n\\tposition: absolute;\\n\\n\\t/* Fake panels should be placed under main balloon content. */\\n\\tz-index: calc(var(--ck-z-panel) - 1);\\n}\\n\\n.ck .ck-fake-panel div {\\n\\tposition: absolute;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 1 ) {\\n\\tz-index: 2;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 2 ) {\\n\\tz-index: 1;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-balloon-fake-panel-offset-horizontal: 6px;\\n\\t--ck-balloon-fake-panel-offset-vertical: 6px;\\n}\\n\\n/* Let's use `.ck-balloon-panel` appearance. See: balloonpanel.css. */\\n.ck .ck-fake-panel div {\\n\\t@mixin ck-drop-shadow;\\n\\n\\tmin-height: 15px;\\n\\n\\tbackground: var(--ck-color-panel-background);\\n\\tborder: 1px solid var(--ck-color-panel-border);\\n\\tborder-radius: var(--ck-border-radius);\\n\\n\\twidth: 100%;\\n\\theight: 100%;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 1 ) {\\n\\tmargin-left: var(--ck-balloon-fake-panel-offset-horizontal);\\n\\tmargin-top: var(--ck-balloon-fake-panel-offset-vertical);\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 2 ) {\\n\\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 2);\\n\\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 2);\\n}\\n.ck .ck-fake-panel div:nth-child( 3 ) {\\n\\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 3);\\n\\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 3);\\n}\\n\\n/* If balloon is positioned above element, we need to move fake panel to the top. */\\n.ck .ck-balloon-panel_arrow_s + .ck-fake-panel,\\n.ck .ck-balloon-panel_arrow_se + .ck-fake-panel,\\n.ck .ck-balloon-panel_arrow_sw + .ck-fake-panel {\\n\\t--ck-balloon-fake-panel-offset-vertical: -6px;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/stickypanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAMC,qDAEC,cAAe,CACf,KAAM,CAFN,yBAGD,CAEA,kEAEC,iBAAkB,CADlB,QAED,CCPA,qDAIC,wBAAyB,CACzB,yBAA0B,CAF1B,sBAAuB,CCFxB,oCDKA\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-sticky-panel {\\n\\t& .ck-sticky-panel__content_sticky {\\n\\t\\tz-index: var(--ck-z-panel); /* #315 */\\n\\t\\tposition: fixed;\\n\\t\\ttop: 0;\\n\\t}\\n\\n\\t& .ck-sticky-panel__content_sticky_bottom-limit {\\n\\t\\ttop: auto;\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n.ck.ck-sticky-panel {\\n\\t& .ck-sticky-panel__content_sticky {\\n\\t\\t@mixin ck-drop-shadow;\\n\\n\\t\\tborder-width: 0 1px 1px;\\n\\t\\tborder-top-left-radius: 0;\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-vertical-form .ck-button:after{bottom:-1px;content:\"\";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:\"\";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-number,.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/responsive-form/responsiveform.css\"],\"names\":[],\"mappings\":\"AAQC,mCAMC,WAAY,CALZ,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,QAAS,CAHT,OAAQ,CAKR,SACD,CAEA,yCACC,YACD,CCdA,oCDoBE,wCAMC,WAAY,CALZ,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,QAAS,CAHT,OAAQ,CAKR,SACD,CAEA,8CACC,YACD,CC9BF,CCAD,qDACC,kDACD,CAEA,uBACC,+BAoED,CAlEC,6BAEC,YACD,CASC,uGACC,sCACD,CDvBD,oCCMD,uBAqBE,SAAU,CACV,oCA+CF,CA7CE,8CACC,wDAYD,CAVC,4HAEC,WAAY,CACZ,UACD,CAGA,4EACC,kBACD,CAKA,0DACC,kDACD,CAGD,iGAIC,eAAgB,CADhB,kCAAmC,CADnC,kCAmBD,CAfC,yHACC,gDACD,CARD,0OAeE,aAMF,CAJE,+IACC,kDACD,CDrEH\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck-vertical-form .ck-button {\\n\\t&::after {\\n\\t\\tcontent: \\\"\\\";\\n\\t\\twidth: 0;\\n\\t\\tposition: absolute;\\n\\t\\tright: -1px;\\n\\t\\ttop: -1px;\\n\\t\\tbottom: -1px;\\n\\t\\tz-index: 1;\\n\\t}\\n\\n\\t&:focus::after {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\\n.ck.ck-responsive-form {\\n\\t@mixin ck-media-phone {\\n\\t\\t& .ck-button {\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\t\\twidth: 0;\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tright: -1px;\\n\\t\\t\\t\\ttop: -1px;\\n\\t\\t\\t\\tbottom: -1px;\\n\\t\\t\\t\\tz-index: 1;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:focus::after {\\n\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck-vertical-form > .ck-button:nth-last-child(2)::after {\\n\\tborder-right: 1px solid var(--ck-color-base-border);\\n}\\n\\n.ck.ck-responsive-form {\\n\\tpadding: var(--ck-spacing-large);\\n\\n\\t&:focus {\\n\\t\\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& > :not(:first-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& > :not(:last-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tpadding: 0;\\n\\t\\twidth: calc(.8 * var(--ck-input-width));\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) 0;\\n\\n\\t\\t\\t& .ck-input-text,\\n\\t\\t\\t& .ck-input-number {\\n\\t\\t\\t\\tmin-width: 0;\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t}\\n\\n\\t\\t\\t/* Let the long error messages wrap in the narrow form. */\\n\\t\\t\\t& .ck-labeled-field-view__error {\\n\\t\\t\\t\\twhite-space: normal;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* Styles for two last buttons in the form (save&cancel, edit&unlink, etc.). */\\n\\t\\t& > .ck-button:nth-last-child(2) {\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& > .ck-button:nth-last-child(1),\\n\\t\\t& > .ck-button:nth-last-child(2) {\\n\\t\\t\\tpadding: var(--ck-spacing-standard);\\n\\t\\t\\tmargin-top: var(--ck-spacing-large);\\n\\t\\t\\tborder-radius: 0;\\n\\n\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\n\\t\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{position:absolute;top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{left:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{right:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view .ck-search__reset{position:absolute;top:50%;transform:translateY(-50%)}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{display:block}.ck.ck-search>.ck-search__results>.ck-search__info:not(.ck-hidden)~*{display:none}:root{--ck-search-field-view-horizontal-spacing:calc(var(--ck-icon-size) + var(--ck-spacing-medium))}.ck.ck-search>.ck-labeled-field-view .ck-input{width:100%}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon{--ck-labeled-field-label-default-position-x:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon>.ck-labeled-field-view__input-wrapper>.ck-icon{opacity:.5;pointer-events:none}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input,[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input:not(.ck-input-text_empty){padding-left:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset{--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset.ck-labeled-field-view_empty{--ck-labeled-field-empty-unfocused-max-width:100% - var(--ck-search-field-view-horizontal-spacing) - var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{background:none;min-height:auto;min-width:auto;opacity:.5;padding:0}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{left:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset:hover{opacity:1}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input:not(.ck-input-text_empty),[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{padding-right:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-search__results{min-width:100%}.ck.ck-search>.ck-search__results>.ck-search__info{padding:var(--ck-spacing-medium) var(--ck-spacing-large);width:100%}.ck.ck-search>.ck-search__results>.ck-search__info *{white-space:normal}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{font-weight:700}.ck.ck-search>.ck-search__results>.ck-search__info>span:last-child{margin-top:var(--ck-spacing-medium)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/search/search.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/search/search.css\"],\"names\":[],\"mappings\":\"AASE,oFACC,iBAAkB,CAClB,OAAQ,CACR,0BASD,CAZA,8FAME,6BAMF,CAZA,8FAUE,8BAEF,CAEA,uDACC,iBAAkB,CAClB,OAAQ,CACR,0BACD,CAKC,oEACC,aACD,CAGA,qEACC,YACD,CChCH,MACC,8FACD,CAIE,+CACC,UACD,CAEA,gEACC,0FAoBD,CAlBC,+GACC,UAAW,CACX,mBACD,CAEA,0EACC,UAWD,CAJE,kMACC,2DACD,CAKH,iEACC,sGAwCD,CAtCC,6FACC,6HACD,CAEA,mFAIC,eAAgB,CAFhB,eAAgB,CADhB,cAAe,CAIf,UAAW,CACX,SAaD,CAnBA,6FASE,8BAUF,CAnBA,6FAaE,6BAMF,CAHC,yFACC,SACD,CAGD,2EACC,UAWD,CAZA,oMAUE,4DAEF,CAIF,kCACC,cAkBD,CAhBC,mDAEC,wDAAyD,CADzD,UAcD,CAXC,qDACC,kBACD,CAEA,oEACC,eACD,CAEA,mEACC,mCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-search {\\n\\t& > .ck-labeled-field-view {\\n\\t\\t& > .ck-labeled-field-view__input-wrapper > .ck-icon {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 50%;\\n\\t\\t\\ttransform: translateY(-50%);\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tleft: var(--ck-spacing-medium);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tright: var(--ck-spacing-medium);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .ck-search__reset {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 50%;\\n\\t\\t\\ttransform: translateY(-50%);\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-search__results {\\n\\t\\t& > .ck-search__info {\\n\\t\\t\\t& > span:first-child {\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t}\\n\\n\\t\\t\\t/* Hide the filtered view when nothing was found */\\n\\t\\t\\t&:not(.ck-hidden) ~ * {\\n\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n:root {\\n\\t--ck-search-field-view-horizontal-spacing: calc(var(--ck-icon-size) + var(--ck-spacing-medium));\\n}\\n\\n.ck.ck-search {\\n\\t& > .ck-labeled-field-view {\\n\\t\\t& .ck-input {\\n\\t\\t\\twidth: 100%;\\n\\t\\t}\\n\\n\\t\\t&.ck-search__query_with-icon {\\n\\t\\t\\t--ck-labeled-field-label-default-position-x: var(--ck-search-field-view-horizontal-spacing);\\n\\n\\t\\t\\t& > .ck-labeled-field-view__input-wrapper > .ck-icon {\\n\\t\\t\\t\\topacity: .5;\\n\\t\\t\\t\\tpointer-events: none;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-input {\\n\\t\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\tpadding-left: var(--ck-search-field-view-horizontal-spacing);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\t&:not(.ck-input-text_empty) {\\n\\t\\t\\t\\t\\t\\tpadding-left: var(--ck-search-field-view-horizontal-spacing);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-search__query_with-reset {\\n\\t\\t\\t--ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-search-field-view-horizontal-spacing);\\n\\n\\t\\t\\t&.ck-labeled-field-view_empty {\\n\\t\\t\\t\\t--ck-labeled-field-empty-unfocused-max-width: 100% - var(--ck-search-field-view-horizontal-spacing) - var(--ck-spacing-medium);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-search__reset {\\n\\t\\t\\t\\tmin-width: auto;\\n\\t\\t\\t\\tmin-height: auto;\\n\\n\\t\\t\\t\\tbackground: none;\\n\\t\\t\\t\\topacity: .5;\\n\\t\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\tright: var(--ck-spacing-medium);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\tleft: var(--ck-spacing-medium);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t&:hover {\\n\\t\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-input {\\n\\t\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\t&:not(.ck-input-text_empty) {\\n\\t\\t\\t\\t\\t\\tpadding-right: var(--ck-search-field-view-horizontal-spacing);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\tpadding-right: var(--ck-search-field-view-horizontal-spacing);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-search__results {\\n\\t\\tmin-width: 100%;\\n\\n\\t\\t& > .ck-search__info {\\n\\t\\t\\twidth: 100%;\\n\\t\\t\\tpadding: var(--ck-spacing-medium) var(--ck-spacing-large);\\n\\n\\t\\t\\t& * {\\n\\t\\t\\t\\twhite-space: normal;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > span:first-child {\\n\\t\\t\\t\\tfont-weight: bold;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > span:last-child {\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-medium);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-spinner-container{display:block;position:relative}.ck.ck-spinner{left:0;margin:0 auto;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:1}:root{--ck-toolbar-spinner-size:18px}.ck.ck-spinner-container{animation:ck-spinner-rotate 1.5s linear infinite;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@media (prefers-reduced-motion:reduce){.ck.ck-spinner-container{animation-duration:3s}}.ck.ck-spinner{border:2px solid var(--ck-color-text);border-radius:50%;border-top:2px solid transparent;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@keyframes ck-spinner-rotate{to{transform:rotate(1turn)}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/spinner/spinner.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/spinner/spinner.css\"],\"names\":[],\"mappings\":\"AASA,yBACC,aAAc,CACd,iBACD,CAEA,eAGC,MAAO,CAEP,aAAc,CAJd,iBAAkB,CAGlB,OAAQ,CAFR,OAAQ,CAIR,0BAA2B,CAC3B,SACD,CCjBA,MACC,8BACD,CAEA,yBAGC,gDAAiD,CADjD,qCAAsC,CADtC,oCAOD,CAHC,uCALD,yBAME,qBAEF,CADC,CAGD,eAKC,qCAA6B,CAF7B,iBAAkB,CAElB,gCAA6B,CAH7B,qCAAsC,CADtC,oCAKD,CAEA,6BACC,GACC,uBACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-toolbar-spinner-size: 18px;\\n}\\n\\n.ck.ck-spinner-container {\\n\\tdisplay: block;\\n\\tposition: relative;\\n}\\n\\n.ck.ck-spinner {\\n\\tposition: absolute;\\n\\ttop: 50%;\\n\\tleft: 0;\\n\\tright: 0;\\n\\tmargin: 0 auto;\\n\\ttransform: translateY(-50%);\\n\\tz-index: 1;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-toolbar-spinner-size: 18px;\\n}\\n\\n.ck.ck-spinner-container {\\n\\twidth: var(--ck-toolbar-spinner-size);\\n\\theight: var(--ck-toolbar-spinner-size);\\n\\tanimation: 1.5s infinite ck-spinner-rotate linear;\\n\\n\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\tanimation-duration: 3s;\\n\\t}\\n}\\n\\n.ck.ck-spinner {\\n\\twidth: var(--ck-toolbar-spinner-size);\\n\\theight: var(--ck-toolbar-spinner-size);\\n\\tborder-radius: 50%;\\n\\tborder: 2px solid var(--ck-color-text);\\n\\tborder-top-color: transparent;\\n}\\n\\n@keyframes ck-spinner-rotate {\\n\\tto {\\n\\t\\ttransform: rotate(360deg)\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-textarea{overflow-x:hidden}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/textarea/textarea.css\"],\"names\":[],\"mappings\":\"AASA,aACC,iBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/*\\n * This fixes a problem in Firefox when the initial height of the complement does not match the number of rows.\\n * This bug is especially visible when rows=1.\\n */\\n.ck-textarea {\\n\\toverflow-x: hidden\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/blocktoolbar.css\"],\"names\":[],\"mappings\":\"AAKA,4BACC,iBAAkB,CAClB,2BACD,CCHA,MACC,oDAAqD,CACrD,yDACD,CAEA,4BACC,0CAA2C,CAC3C,sCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-block-toolbar-button {\\n\\tposition: absolute;\\n\\tz-index: var(--ck-z-default);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-block-toolbar-button: var(--ck-color-text);\\n\\t--ck-block-toolbar-button-size: var(--ck-font-size-normal);\\n}\\n\\n.ck.ck-block-toolbar-button {\\n\\tcolor: var(--ck-color-block-toolbar-button);\\n\\tfont-size: var(--ck-block-toolbar-size);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck.ck-toolbar .ck.ck-toolbar__separator{background:var(--ck-color-toolbar-border);height:var(--ck-icon-size);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.ck.ck-toolbar:focus{outline:none}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/toolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,eAKC,kBAAmB,CAFnB,YAAa,CACb,oBAAqB,CCFrB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD6CD,CA3CC,kCAGC,kBAAmB,CAFnB,YAAa,CACb,kBAAmB,CAEnB,WAED,CAEA,yCACC,oBAWD,CAJC,yGAEC,YACD,CAGD,uCACC,eACD,CAEA,sDACC,gBACD,CAEA,sDACC,qBACD,CAEA,sDACC,gBACD,CAGC,yFACC,YACD,CE/CF,eCGC,eDwGD,CA3GA,qECOE,qCDoGF,CA3GA,eAGC,6CAA8C,CAE9C,+CAAgD,CADhD,iCAuGD,CApGC,yCAIC,yCAA0C,CAH1C,0BAA2B,CAU3B,qCAAsC,CADtC,kCAAmC,CAPnC,aAAc,CADd,SAUD,CAEA,uCACC,QACD,CAGC,gEAEC,oCACD,CAIA,kEACC,YACD,CAGD,gHAIC,qCAAsC,CADtC,kCAED,CAEA,mCAEC,SAaD,CAVC,0DAQC,eAAgB,CAHhB,QAAS,CAHT,UAOD,CAGD,kCAEC,SAWD,CATC,uDAEC,QAMD,CAHC,yFACC,eACD,CASD,kFACC,mCACD,CAMA,wEACC,cACD,CAEA,iFACC,aAAc,CACd,UACD,CAGD,qBACC,YACD,CAtGD,qCAyGE,QAEF,CAYC,+FACC,cACD,CAEA,iJAEC,mCACD,CAEA,qHACC,aACD,CAIC,6JAEC,2BAA4B,CAD5B,wBAED,CAGA,2JAEC,4BAA6B,CAD7B,yBAED,CASD,8RACC,mCACD,CAWA,qHACC,cACD,CAIC,6JAEC,4BAA6B,CAD7B,yBAED,CAGA,2JAEC,2BAA4B,CAD5B,wBAED,CASD,8RACC,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-toolbar {\\n\\t@mixin ck-unselectable;\\n\\n\\tdisplay: flex;\\n\\tflex-flow: row nowrap;\\n\\talign-items: center;\\n\\n\\t& > .ck-toolbar__items {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-flow: row wrap;\\n\\t\\talign-items: center;\\n\\t\\tflex-grow: 1;\\n\\n\\t}\\n\\n\\t& .ck.ck-toolbar__separator {\\n\\t\\tdisplay: inline-block;\\n\\n\\t\\t/*\\n\\t\\t * A leading or trailing separator makes no sense (separates from nothing on one side).\\n\\t\\t * For instance, it can happen when toolbar items (also separators) are getting grouped one by one and\\n\\t\\t * moved to another toolbar in the dropdown.\\n\\t\\t */\\n\\t\\t&:first-child,\\n\\t\\t&:last-child {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-toolbar__line-break {\\n\\t\\tflex-basis: 100%;\\n\\t}\\n\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items {\\n\\t\\tflex-wrap: nowrap;\\n\\t}\\n\\n\\t&.ck-toolbar_vertical > .ck-toolbar__items {\\n\\t\\tflex-direction: column;\\n\\t}\\n\\n\\t&.ck-toolbar_floating > .ck-toolbar__items {\\n\\t\\tflex-wrap: nowrap;\\n\\t}\\n\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t& > .ck-dropdown__button .ck-dropdown__arrow {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-toolbar {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tbackground: var(--ck-color-toolbar-background);\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\tborder: 1px solid var(--ck-color-toolbar-border);\\n\\n\\t& .ck.ck-toolbar__separator {\\n\\t\\theight: var(--ck-icon-size);\\n\\t\\twidth: 1px;\\n\\t\\tmin-width: 1px;\\n\\t\\tbackground: var(--ck-color-toolbar-border);\\n\\n\\t\\t/*\\n\\t\\t * These margins make the separators look better in balloon toolbars (when aligned with the \\\"tip\\\").\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/7493.\\n\\t\\t */\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t& .ck-toolbar__line-break {\\n\\t\\theight: 0;\\n\\t}\\n\\n\\t& > .ck-toolbar__items {\\n\\t\\t& > *:not(.ck-toolbar__line-break) {\\n\\t\\t\\t/* (#11) Separate toolbar items. */\\n\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\n\\t\\t/* Don't display a separator after an empty items container, for instance,\\n\\t\\twhen all items were grouped */\\n\\t\\t&:empty + .ck.ck-toolbar__separator {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-toolbar__items > *:not(.ck-toolbar__line-break),\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t/* Make sure items wrapped to the next line have v-spacing */\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t&.ck-toolbar_vertical {\\n\\t\\t/* Items in a vertical toolbar span the entire width. */\\n\\t\\tpadding: 0;\\n\\n\\t\\t/* Specificity matters here. See https://github.com/ckeditor/ckeditor5-theme-lark/issues/168. */\\n\\t\\t& > .ck-toolbar__items > .ck {\\n\\t\\t\\t/* Items in a vertical toolbar should span the horizontal space. */\\n\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t/* Items in a vertical toolbar should have no margin. */\\n\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t/* Items in a vertical toolbar span the entire width so rounded corners are pointless. */\\n\\t\\t\\tborder-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-toolbar_compact {\\n\\t\\t/* No spacing around items. */\\n\\t\\tpadding: 0;\\n\\n\\t\\t& > .ck-toolbar__items > * {\\n\\t\\t\\t/* Compact toolbar items have no spacing between them. */\\n\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t/* \\\"Middle\\\" children should have no rounded corners. */\\n\\t\\t\\t&:not(:first-child):not(:last-child) {\\n\\t\\t\\t\\tborder-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t/*\\n\\t\\t * Dropdown button has asymmetric padding to fit the arrow.\\n\\t\\t * This button has no arrow so let's revert that padding back to normal.\\n\\t\\t */\\n\\t\\t& > .ck.ck-button.ck-dropdown__button {\\n\\t\\t\\tpadding-left: var(--ck-spacing-tiny);\\n\\t\\t}\\n\\t}\\n\\n\\t/* A drop-down containing the nested toolbar with configured items. */\\n\\t& .ck-toolbar__nested-toolbar-dropdown {\\n\\t\\t/* Prevent empty space in the panel when the dropdown label is visible and long but the toolbar has few items. */\\n\\t\\t& > .ck-dropdown__panel {\\n\\t\\t\\tmin-width: auto;\\n\\t\\t}\\n\\n\\t\\t& > .ck-button > .ck-button__label {\\n\\t\\t\\tmax-width: 7em;\\n\\t\\t\\twidth: auto;\\n\\t\\t}\\n\\t}\\n\\n\\t&:focus {\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t@nest .ck-toolbar-container & {\\n\\t\\tborder: 0;\\n\\t}\\n}\\n\\n/* stylelint-disable */\\n\\n/*\\n * Styles for RTL toolbars.\\n *\\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own \\\"dir\\\"\\n * because its parent is not controlled by the editor framework.\\n */\\n[dir=\\\"rtl\\\"] .ck.ck-toolbar,\\n.ck.ck-toolbar[dir=\\\"rtl\\\"] {\\n\\t& > .ck-toolbar__items > .ck {\\n\\t\\tmargin-right: 0;\\n\\t}\\n\\n\\t&:not(.ck-toolbar_compact) > .ck-toolbar__items > .ck {\\n\\t\\t/* (#11) Separate toolbar items. */\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n\\n\\t& > .ck-toolbar__items > .ck:last-child {\\n\\t\\tmargin-left: 0;\\n\\t}\\n\\n\\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\\n\\t\\t/* No rounded corners on the right side of the first child. */\\n\\t\\t&:first-child {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* No rounded corners on the left side of the last child. */\\n\\t\\t&:last-child {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\\n\\t& > .ck.ck-toolbar__separator {\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Some spacing between the items and the separator before the grouped items dropdown. */\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n/*\\n * Styles for LTR toolbars.\\n *\\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own \\\"dir\\\"\\n * because its parent is not controlled by the editor framework.\\n */\\n[dir=\\\"ltr\\\"] .ck.ck-toolbar,\\n.ck.ck-toolbar[dir=\\\"ltr\\\"] {\\n\\t& > .ck-toolbar__items > .ck:last-child {\\n\\t\\tmargin-right: 0;\\n\\t}\\n\\n\\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\\n\\t\\t/* No rounded corners on the right side of the first child. */\\n\\t\\t&:first-child {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* No rounded corners on the left side of the last child. */\\n\\t\\t&:last-child {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\\n\\t& > .ck.ck-toolbar__separator {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Some spacing between the items and the separator before the grouped items dropdown. */\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n/* stylelint-enable */\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:calc(var(--ck-z-dialog) + 100);--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-tooltip-text-padding:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);padding:0 var(--ck-spacing-medium)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip.ck-tooltip_multi-line .ck-tooltip__text{display:inline-block;max-width:200px;padding:var(--ck-tooltip-text-padding) 0;white-space:break-spaces}.ck.ck-balloon-panel.ck-tooltip{box-shadow:none}.ck.ck-balloon-panel.ck-tooltip:before{display:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/tooltip/tooltip.css\"],\"names\":[],\"mappings\":\"AAOA,gCCEC,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBAAgB,CDFhB,sCAAyC,CEFzC,6BAA8B,CAC9B,6BAA8B,CAC9B,iCAAkC,CAClC,6BAA8B,CAC9B,6BAA8B,CAC9B,8DAA+D,CAE/D,kCFJD,CEMC,kDAGC,kCAAmC,CAFnC,cAAe,CACf,eAED,CAEA,wEAEC,oBAAqB,CAErB,eAAgB,CADhB,wCAAyC,CAFzC,wBAID,CArBD,gCAwBC,eAMD,CAHC,uCACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-balloon-panel.ck-tooltip {\\n\\t@mixin ck-unselectable;\\n\\n\\tz-index: calc( var(--ck-z-dialog) + 100 );\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n.ck.ck-balloon-panel.ck-tooltip {\\n\\t--ck-balloon-border-width: 0px;\\n\\t--ck-balloon-arrow-offset: 0px;\\n\\t--ck-balloon-arrow-half-width: 4px;\\n\\t--ck-balloon-arrow-height: 4px;\\n\\t--ck-tooltip-text-padding: 4px;\\n\\t--ck-color-panel-background: var(--ck-color-tooltip-background);\\n\\n\\tpadding: 0 var(--ck-spacing-medium);\\n\\n\\t& .ck-tooltip__text {\\n\\t\\tfont-size: .9em;\\n\\t\\tline-height: 1.5;\\n\\t\\tcolor: var(--ck-color-tooltip-text);\\n\\t}\\n\\n\\t&.ck-tooltip_multi-line .ck-tooltip__text {\\n\\t\\twhite-space: break-spaces;\\n\\t\\tdisplay: inline-block;\\n\\t\\tpadding: var(--ck-tooltip-text-padding) 0;\\n\\t\\tmax-width: 200px;\\n\\t}\\n\\n\\t/* Reset balloon panel styles */\\n\\tbox-shadow: none;\\n\\n\\t/* Hide the default shadow of the .ck-balloon-panel tip */\\n\\t&::before {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck-hidden{display:none!important}:root{--ck-z-default:1;--ck-z-panel:calc(var(--ck-z-default) + 999);--ck-z-dialog:9999}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-powered-by-line-height:10px;--ck-powered-by-padding-vertical:2px;--ck-powered-by-padding-horizontal:4px;--ck-powered-by-text-color:#4f4f4f;--ck-powered-by-border-radius:var(--ck-border-radius);--ck-powered-by-background:#fff;--ck-powered-by-border-color:var(--ck-color-focus-border)}.ck.ck-balloon-panel.ck-powered-by-balloon{--ck-border-radius:var(--ck-powered-by-border-radius);background:var(--ck-powered-by-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by{line-height:var(--ck-powered-by-line-height)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by a{align-items:center;cursor:pointer;display:flex;filter:grayscale(80%);line-height:var(--ck-powered-by-line-height);opacity:.66;padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{color:var(--ck-powered-by-text-color);cursor:pointer;font-size:7.5px;font-weight:700;letter-spacing:-.2px;line-height:normal;margin-right:4px;padding-left:2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{cursor:pointer;display:block}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{filter:grayscale(0);opacity:1}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-powered-by-border-color)}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-dialog-background:var(--ck-custom-background);--ck-color-dialog-form-header-border:var(--ck-custom-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-color-light-red:#fcc;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{background:transparent;border:0;box-sizing:border-box;height:auto;margin:0;padding:0;position:static;text-decoration:none;transition:none;vertical-align:middle;width:auto;word-wrap:break-word}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_hidden.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_zindex.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_transition.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_poweredby.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_colors.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_disabled.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_fonts.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_reset.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5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CAK3D,wEAAyE,CCbzE,uBAA8B,CAC9B,mDAA2D,CAC3D,4CAAkD,CAClD,oDAA4D,CAC5D,mDAA2D,CAC3D,kDAA2D,CAC3D,yDFFD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which hides an element in DOM.\\n */\\n.ck-hidden {\\n\\t/* Override selector specificity. Otherwise, all elements with some display\\n\\tstyle defined will override this one, which is not a desired result. */\\n\\tdisplay: none !important;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-z-default: 1;\\n\\t--ck-z-panel: calc( var(--ck-z-default) + 999 );\\n\\t--ck-z-dialog: 9999;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class that disables all transitions of the element and its children.\\n */\\n.ck-transitions-disabled,\\n.ck-transitions-disabled * {\\n\\ttransition: none !important;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-powered-by-line-height: 10px;\\n\\t--ck-powered-by-padding-vertical: 2px;\\n\\t--ck-powered-by-padding-horizontal: 4px;\\n\\t--ck-powered-by-text-color: hsl(0, 0%, 31%);\\n\\t--ck-powered-by-border-radius: var(--ck-border-radius);\\n\\t--ck-powered-by-background: hsl(0, 0%, 100%);\\n\\t--ck-powered-by-border-color: var(--ck-color-focus-border);\\n}\\n\\n.ck.ck-balloon-panel.ck-powered-by-balloon {\\n\\t--ck-border-radius: var(--ck-powered-by-border-radius);\\n\\n\\tbox-shadow: none;\\n\\tbackground: var(--ck-powered-by-background);\\n\\tmin-height: unset;\\n\\tz-index: calc( var(--ck-z-panel) - 1 );\\n\\n\\t& .ck.ck-powered-by {\\n\\t\\tline-height: var(--ck-powered-by-line-height);\\n\\n\\t\\t& a {\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\talign-items: center;\\n\\t\\t\\topacity: .66;\\n\\t\\t\\tfilter: grayscale(80%);\\n\\t\\t\\tline-height: var(--ck-powered-by-line-height);\\n\\t\\t\\tpadding: var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal);\\n\\t\\t}\\n\\n\\t\\t& .ck-powered-by__label {\\n\\t\\t\\tfont-size: 7.5px;\\n\\t\\t\\tletter-spacing: -.2px;\\n\\t\\t\\tpadding-left: 2px;\\n\\t\\t\\ttext-transform: uppercase;\\n\\t\\t\\tfont-weight: bold;\\n\\t\\t\\tmargin-right: 4px;\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tline-height: normal;\\n\\t\\t\\tcolor: var(--ck-powered-by-text-color);\\n\\n\\t\\t}\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tcursor: pointer;\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\t& a {\\n\\t\\t\\t\\tfilter: grayscale(0%);\\n\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"position_inside\\\"] {\\n\\t\\tborder-color: transparent;\\n\\t}\\n\\n\\t&[class*=\\\"position_border\\\"] {\\n\\t\\tborder: var(--ck-focus-ring);\\n\\t\\tborder-color: var(--ck-powered-by-border-color);\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-base-foreground: \\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 98%);\\n\\t--ck-color-base-background: \\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 100%);\\n\\t--ck-color-base-border: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(220, 6%, 81%);\\n\\t--ck-color-base-action: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(104, 50.2%, 42.5%);\\n\\t--ck-color-base-focus: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(209, 92%, 70%);\\n\\t--ck-color-base-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 20%);\\n\\t--ck-color-base-active: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(218.1, 100%, 58%);\\n\\t--ck-color-base-active-focus:\\t\\t\\t\\t\\t\\t\\t\\thsl(218.2, 100%, 52.5%);\\n\\t--ck-color-base-error:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(15, 100%, 43%);\\n\\n\\t/* -- Generic colors ------------------------------------------------------------------------ */\\n\\n\\t--ck-color-focus-border-coordinates: \\t\\t\\t\\t\\t\\t218, 81.8%, 56.9%;\\n\\t--ck-color-focus-border: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(var(--ck-color-focus-border-coordinates));\\n\\t--ck-color-focus-outer-shadow:\\t\\t\\t\\t\\t\\t\\t\\thsl(212.4, 89.3%, 89%);\\n\\t--ck-color-focus-disabled-shadow:\\t\\t\\t\\t\\t\\t\\thsla(209, 90%, 72%,.3);\\n\\t--ck-color-focus-error-shadow:\\t\\t\\t\\t\\t\\t\\t\\thsla(9,100%,56%,.3);\\n\\t--ck-color-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-shadow-drop: \\t\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.15);\\n\\t--ck-color-shadow-drop-active:\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.2);\\n\\t--ck-color-shadow-inner: \\t\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.1);\\n\\n\\t/* -- Buttons ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-button-default-background: \\t\\t\\t\\t\\t\\ttransparent;\\n\\t--ck-color-button-default-hover-background: \\t\\t\\t\\thsl(0, 0%, 94.1%);\\n\\t--ck-color-button-default-active-background: \\t\\t\\t\\thsl(0, 0%, 94.1%);\\n\\t--ck-color-button-default-disabled-background: \\t\\t\\t\\ttransparent;\\n\\n\\t--ck-color-button-on-background: \\t\\t\\t\\t\\t\\t\\thsl(212, 100%, 97.1%);\\n\\t--ck-color-button-on-hover-background: \\t\\t\\t\\t\\t\\thsl(211.7, 100%, 92.9%);\\n\\t--ck-color-button-on-active-background: \\t\\t\\t\\t\\thsl(211.7, 100%, 92.9%);\\n\\t--ck-color-button-on-disabled-background: \\t\\t\\t\\t\\thsl(211, 15%, 95%);\\n\\t--ck-color-button-on-color:\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(218.1, 100%, 58%);\\n\\n\\n\\t--ck-color-button-action-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-base-action);\\n\\t--ck-color-button-action-hover-background: \\t\\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-button-action-active-background: \\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-button-action-disabled-background: \\t\\t\\t\\thsl(104, 44%, 58%);\\n\\t--ck-color-button-action-text: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t--ck-color-button-save: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(120, 100%, 27%);\\n\\t--ck-color-button-cancel: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(15, 100%, 43%);\\n\\n\\t--ck-color-switch-button-off-background:\\t\\t\\t\\t\\thsl(0, 0%, 57.6%);\\n\\t--ck-color-switch-button-off-hover-background:\\t\\t\\t\\thsl(0, 0%, 49%);\\n\\t--ck-color-switch-button-on-background:\\t\\t\\t\\t\\t\\tvar(--ck-color-button-action-background);\\n\\t--ck-color-switch-button-on-hover-background:\\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-switch-button-inner-background:\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-switch-button-inner-shadow:\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.1);\\n\\n\\t/* -- Dropdown ------------------------------------------------------------------------------ */\\n\\n\\t--ck-color-dropdown-panel-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-dropdown-panel-border: \\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Dialog -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-dialog-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-custom-background);\\n\\t--ck-color-dialog-form-header-border: \\t\\t\\t\\t\\t\\tvar(--ck-custom-border);\\n\\n\\t/* -- Input --------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-input-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-input-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\t--ck-color-input-error-border:\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-error);\\n\\t--ck-color-input-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-input-disabled-background: \\t\\t\\t\\t\\t\\thsl(0, 0%, 95%);\\n\\t--ck-color-input-disabled-border: \\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\t--ck-color-input-disabled-text: \\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 46%);\\n\\n\\t/* -- List ---------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-list-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-list-button-hover-background: \\t\\t\\t\\t\\tvar(--ck-color-button-default-hover-background);\\n\\t--ck-color-list-button-on-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-button-on-color);\\n\\t--ck-color-list-button-on-background-focus: \\t\\t\\t\\tvar(--ck-color-button-on-color);\\n\\t--ck-color-list-button-on-text:\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t/* -- Panel --------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-panel-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-panel-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Toolbar ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-toolbar-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-toolbar-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Tooltip ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-tooltip-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-tooltip-text: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t/* -- Engine -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-engine-placeholder-text: \\t\\t\\t\\t\\t\\thsl(0, 0%, 44%);\\n\\n\\t/* -- Upload -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-upload-bar-background:\\t\\t \\t\\t\\t\\t\\thsl(209, 92%, 70%);\\n\\n\\t/* -- Link -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-link-default:\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(240, 100%, 47%);\\n\\t--ck-color-link-selected-background:\\t\\t\\t\\t\\t\\thsla(201, 100%, 56%, 0.1);\\n\\t--ck-color-link-fake-selection:\\t\\t\\t\\t\\t\\t\\t\\thsla(201, 100%, 56%, 0.3);\\n\\n\\t/* -- Search result highlight ---------------------------------------------------------------- */\\n\\n\\t--ck-color-highlight-background:\\t\\t\\t\\t\\t\\t\\thsl(60, 100%, 50%);\\n\\n\\t/* -- Generic colors ------------------------------------------------------------------------- */\\n\\n\\t--ck-color-light-red:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(0, 100%, 90%);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * An opacity value of disabled UI item.\\n\\t */\\n\\t--ck-disabled-opacity: .5;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * The geometry of the of focused element's outer shadow.\\n\\t */\\n\\t--ck-focus-outer-shadow-geometry: 0 0 0 3px;\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow.\\n\\t */\\n\\t--ck-focus-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow (when disabled).\\n\\t */\\n\\t--ck-focus-disabled-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow (when has errors).\\n\\t */\\n\\t--ck-focus-error-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's border or outline.\\n\\t */\\n\\t--ck-focus-ring: 1px solid var(--ck-color-focus-border);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-font-size-base: 13px;\\n\\t--ck-line-height-base: 1.84615;\\n\\t--ck-font-face: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\\n\\n\\t--ck-font-size-tiny: 0.7em;\\n\\t--ck-font-size-small: 0.75em;\\n\\t--ck-font-size-normal: 1em;\\n\\t--ck-font-size-big: 1.4em;\\n\\t--ck-font-size-large: 1.8em;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/* This is super-important. This is **manually** adjusted so a button without an icon\\n\\tis never smaller than a button with icon, additionally making sure that text-less buttons\\n\\tare perfect squares. The value is also shared by other components which should stay \\\"in-line\\\"\\n\\twith buttons. */\\n\\t--ck-ui-component-min-height: 2.3em;\\n}\\n\\n/**\\n * Resets an element, ignoring its children.\\n */\\n.ck.ck-reset,\\n.ck.ck-reset_all,\\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\\n\\tbox-sizing: border-box;\\n\\twidth: auto;\\n\\theight: auto;\\n\\tposition: static;\\n\\n\\t/* Do not include inheritable rules here. */\\n\\tmargin: 0;\\n\\tpadding: 0;\\n\\tborder: 0;\\n\\tbackground: transparent;\\n\\ttext-decoration: none;\\n\\tvertical-align: middle;\\n\\ttransition: none;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/105 */\\n\\tword-wrap: break-word;\\n}\\n\\n/**\\n * Resets an element AND its children.\\n */\\n.ck.ck-reset_all,\\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\\n\\t/* These are rule inherited by all children elements. */\\n\\tborder-collapse: collapse;\\n\\tfont: normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);\\n\\tcolor: var(--ck-color-text);\\n\\ttext-align: left;\\n\\twhite-space: nowrap;\\n\\tcursor: auto;\\n\\tfloat: none;\\n}\\n\\n.ck-reset_all {\\n\\t& .ck-rtl *:not(.ck-reset_all-excluded *) {\\n\\t\\ttext-align: right;\\n\\t}\\n\\n\\t& iframe:not(.ck-reset_all-excluded *) {\\n\\t\\t/* For IE */\\n\\t\\tvertical-align: inherit;\\n\\t}\\n\\n\\t& textarea:not(.ck-reset_all-excluded *) {\\n\\t\\twhite-space: pre-wrap;\\n\\t}\\n\\n\\t& textarea:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"text\\\"]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"password\\\"]:not(.ck-reset_all-excluded *) {\\n\\t\\tcursor: text;\\n\\t}\\n\\n\\t& textarea[disabled]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"text\\\"][disabled]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"password\\\"][disabled]:not(.ck-reset_all-excluded *) {\\n\\t\\tcursor: default;\\n\\t}\\n\\n\\t& fieldset:not(.ck-reset_all-excluded *) {\\n\\t\\tpadding: 10px;\\n\\t\\tborder: 2px groove hsl(255, 7%, 88%);\\n\\t}\\n\\n\\t& button:not(.ck-reset_all-excluded *)::-moz-focus-inner {\\n\\t\\t/* See http://stackoverflow.com/questions/5517744/remove-extra-button-spacing-padding-in-firefox */\\n\\t\\tpadding: 0;\\n\\t\\tborder: 0\\n\\t}\\n}\\n\\n/**\\n * Default UI rules for RTL languages.\\n */\\n.ck[dir=\\\"rtl\\\"],\\n.ck[dir=\\\"rtl\\\"] .ck {\\n\\ttext-align: right;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Default border-radius value.\\n */\\n:root{\\n\\t--ck-border-radius: 2px;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * A visual style of element's inner shadow (i.e. input).\\n\\t */\\n\\t--ck-inner-shadow: 2px 2px 3px var(--ck-color-shadow-inner) inset;\\n\\n\\t/**\\n\\t * A visual style of element's drop shadow (i.e. panel).\\n\\t */\\n\\t--ck-drop-shadow: 0 1px 2px 1px var(--ck-color-shadow-drop);\\n\\n\\t/**\\n\\t * A visual style of element's active shadow (i.e. comment or suggestion).\\n\\t */\\n\\t--ck-drop-shadow-active: 0 3px 6px 1px var(--ck-color-shadow-drop-active);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-spacing-unit: \\t\\t\\t\\t\\t\\t0.6em;\\n\\t--ck-spacing-large: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 1.5);\\n\\t--ck-spacing-standard: \\t\\t\\t\\t\\tvar(--ck-spacing-unit);\\n\\t--ck-spacing-medium: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.8);\\n\\t--ck-spacing-small: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.5);\\n\\t--ck-spacing-tiny: \\t\\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.3);\\n\\t--ck-spacing-extra-tiny: \\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.16);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget{transition:none}}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}@media (forced-colors:none){.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background)}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{transition:none}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{transition:none}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widget.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,+CAAgD,CAChD,6CAAsD,CACtD,uCAAgD,CAEhD,kDAAmD,CACnD,gCAAiC,CACjC,kEACD,CAOA,8DAEC,iBAqBD,CAnBC,4EACC,iBAOD,CALC,qFAGC,aACD,CASD,iLACC,kBACD,CAGD,kBACC,qDAAsD,CAEtD,qDAAsD,CACtD,6CAA8C,CAF9C,0CAA2C,CAI3C,aAAc,CADd,kCAAmC,CAGnC,uCAAwC,CACxC,4CAA6C,CAF7C,iCAsCD,CAlCC,8NAKC,iBACD,CAEA,0CAEC,qCAAsC,CADtC,oCAED,CAEA,2CAEC,sCAAuC,CADvC,oCAED,CAEA,8CACC,uCAAwC,CACxC,sCACD,CAEA,6CACC,uCAAwC,CACxC,qCACD,CAGA,8CAEC,QAAS,CADT,6CAAgD,CAEhD,yBACD,CChFD,MACC,iCAAkC,CAClC,kCAAmC,CACnC,4CAA6C,CAC7C,wCAAyC,CAEzC,wCAAiD,CACjD,sCAAkD,CAClD,2EAA4E,CAC5E,yEACD,CAEA,eAGC,yBAA0B,CAD1B,mBAAoB,CADpB,gDAAiD,CAGjD,6GAcD,CAZC,uCAND,eAOE,eAWF,CAVC,CAEA,0EAEC,6EACD,CAEA,qBACC,iDACD,CAGD,gCACC,4BAYD,CARC,yGCnCA,2BAA2B,CCF3B,qCAA8B,CDC9B,YD2CA,CGvCA,4BACC,yGHoCC,iEGlCD,CACD,CHuCA,4EAKC,4BAA6B,CAa7B,iEAAkE,CAhBlE,qBAAsB,CAoBtB,mDAAoD,CAhBpD,SAAU,CALV,WAAY,CAsBZ,KAAM,CAFN,2BAA4B,CAT5B,6SAwCD,CA3BC,uCAzBD,4EA0BE,eA0BF,CAzBC,CAEA,qFAIC,oDAAqD,CADrD,yCAA0C,CAD1C,wCAeD,CAVC,kHACC,SAAU,CAGV,+DAKD,CAHC,uCAND,kHAOE,eAEF,CADC,CAKF,wHACC,SACD,CAID,kFAEC,oDAAqD,CADrD,SAED,CAKC,oMAEC,6CAA8C,CAD9C,SAOD,CAHC,gRACC,SACD,CAOH,qFACC,SAAU,CACV,oDACD,CAGA,gDAEC,eAkBD,CAhBC,yEAOC,iCACD,CAGC,gOAEC,gDACD,CAOD,wIAEC,mDAQD,CALE,ghBAEC,gDACD,CAKH,yKAOC,yDACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-resizer: var(--ck-color-focus-border);\\n\\t--ck-color-resizer-tooltip-background: hsl(0, 0%, 15%);\\n\\t--ck-color-resizer-tooltip-text: hsl(0, 0%, 95%);\\n\\n\\t--ck-resizer-border-radius: var(--ck-border-radius);\\n\\t--ck-resizer-tooltip-offset: 10px;\\n\\t--ck-resizer-tooltip-height: calc(var(--ck-spacing-small) * 2 + 10px);\\n}\\n\\n.ck .ck-widget {\\n\\t/* This is neccessary for type around UI to be positioned properly. */\\n\\tposition: relative;\\n}\\n\\n.ck .ck-widget.ck-widget_with-selection-handle {\\n\\t/* Make the widget wrapper a relative positioning container for the drag handle. */\\n\\tposition: relative;\\n\\n\\t& .ck-widget__selection-handle {\\n\\t\\tposition: absolute;\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\t/* Make sure the icon in not a subject to font-size or line-height to avoid\\n\\t\\t\\tunnecessary spacing around it. */\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Show the selection handle on mouse hover over the widget, but not for nested widgets. */\\n\\t&:hover > .ck-widget__selection-handle {\\n\\t\\tvisibility: visible;\\n\\t}\\n\\n\\t/* Show the selection handle when the widget is selected, but not for nested widgets. */\\n\\t&.ck-widget_selected > .ck-widget__selection-handle {\\n\\t\\tvisibility: visible;\\n\\t}\\n}\\n\\n.ck .ck-size-view {\\n\\tbackground: var(--ck-color-resizer-tooltip-background);\\n\\tcolor: var(--ck-color-resizer-tooltip-text);\\n\\tborder: 1px solid var(--ck-color-resizer-tooltip-text);\\n\\tborder-radius: var(--ck-resizer-border-radius);\\n\\tfont-size: var(--ck-font-size-tiny);\\n\\tdisplay: block;\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\theight: var(--ck-resizer-tooltip-height);\\n\\tline-height: var(--ck-resizer-tooltip-height);\\n\\n\\t&.ck-orientation-top-left,\\n\\t&.ck-orientation-top-right,\\n\\t&.ck-orientation-bottom-right,\\n\\t&.ck-orientation-bottom-left,\\n\\t&.ck-orientation-above-center {\\n\\t\\tposition: absolute;\\n\\t}\\n\\n\\t&.ck-orientation-top-left {\\n\\t\\ttop: var(--ck-resizer-tooltip-offset);\\n\\t\\tleft: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-top-right {\\n\\t\\ttop: var(--ck-resizer-tooltip-offset);\\n\\t\\tright: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-bottom-right {\\n\\t\\tbottom: var(--ck-resizer-tooltip-offset);\\n\\t\\tright: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-bottom-left {\\n\\t\\tbottom: var(--ck-resizer-tooltip-offset);\\n\\t\\tleft: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t/* Class applied if the widget is too small to contain the size label */\\n\\t&.ck-orientation-above-center {\\n\\t\\ttop: calc(var(--ck-resizer-tooltip-height) * -1);\\n\\t\\tleft: 50%;\\n\\t\\ttransform: translate(-50%);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../mixins/_focus.css\\\";\\n@import \\\"../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\\\";\\n\\n:root {\\n\\t--ck-widget-outline-thickness: 3px;\\n\\t--ck-widget-handler-icon-size: 16px;\\n\\t--ck-widget-handler-animation-duration: 200ms;\\n\\t--ck-widget-handler-animation-curve: ease;\\n\\n\\t--ck-color-widget-blurred-border: hsl(0, 0%, 87%);\\n\\t--ck-color-widget-hover-border: hsl(43, 100%, 62%);\\n\\t--ck-color-widget-editable-focus-background: var(--ck-color-base-background);\\n\\t--ck-color-widget-drag-handler-icon-color: var(--ck-color-base-background);\\n}\\n\\n.ck .ck-widget {\\n\\toutline-width: var(--ck-widget-outline-thickness);\\n\\toutline-style: solid;\\n\\toutline-color: transparent;\\n\\ttransition: outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\ttransition: none;\\n\\t}\\n\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border);\\n\\t}\\n\\n\\t&:hover {\\n\\t\\toutline-color: var(--ck-color-widget-hover-border);\\n\\t}\\n}\\n\\n.ck .ck-editor__nested-editable {\\n\\tborder: 1px solid transparent;\\n\\n\\t/* The :focus style is applied before .ck-editor__nested-editable_focused class is rendered in the view.\\n\\tThese styles show a different border for a blink of an eye, so `:focus` need to have same styles applied. */\\n\\t&.ck-editor__nested-editable_focused,\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-inner-shadow);\\n\\t\\t@mixin ck-media-default-colors {\\n\\t\\t\\tbackground-color: var(--ck-color-widget-editable-focus-background);\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck .ck-widget.ck-widget_with-selection-handle {\\n\\t& .ck-widget__selection-handle {\\n\\t\\tpadding: 4px;\\n\\t\\tbox-sizing: border-box;\\n\\n\\t\\t/* Background and opacity will be animated as the handler shows up or the widget gets selected. */\\n\\t\\tbackground-color: transparent;\\n\\t\\topacity: 0;\\n\\n\\t\\t/* Transition:\\n\\t\\t * background-color for the .ck-widget_selected state change,\\n\\t\\t * visibility for hiding the handler,\\n\\t\\t * opacity for the proper look of the icon when the handler disappears. */\\n\\t\\ttransition:\\n\\t\\t\\tbackground-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\\n\\t\\t\\tvisibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\\n\\t\\t\\topacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t\\t/* Make only top corners round. */\\n\\t\\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\\n\\n\\t\\t/* Place the drag handler outside the widget wrapper. */\\n\\t\\ttransform: translateY(-100%);\\n\\t\\tleft: calc(0px - var(--ck-widget-outline-thickness));\\n\\t\\ttop: 0;\\n\\n\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\ttransition: none;\\n\\t\\t}\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\t/* Make sure the dimensions of the icon are independent of the fon-size of the content. */\\n\\t\\t\\twidth: var(--ck-widget-handler-icon-size);\\n\\t\\t\\theight: var(--ck-widget-handler-icon-size);\\n\\t\\t\\tcolor: var(--ck-color-widget-drag-handler-icon-color);\\n\\n\\t\\t\\t/* The \\\"selected\\\" part of the icon is invisible by default */\\n\\t\\t\\t& .ck-icon__selected-indicator {\\n\\t\\t\\t\\topacity: 0;\\n\\n\\t\\t\\t\\t/* Note: The animation is longer on purpose. Simply feels better. */\\n\\t\\t\\t\\ttransition: opacity 300ms var(--ck-widget-handler-animation-curve);\\n\\n\\t\\t\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\t\\t\\ttransition: none;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* Advertise using the look of the icon that once clicked the handler, the widget will be selected. */\\n\\t\\t&:hover .ck-icon .ck-icon__selected-indicator {\\n\\t\\t\\topacity: 1;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Show the selection handler on mouse hover over the widget, but not for nested widgets. */\\n\\t&:hover > .ck-widget__selection-handle {\\n\\t\\topacity: 1;\\n\\t\\tbackground-color: var(--ck-color-widget-hover-border);\\n\\t}\\n\\n\\t/* Show the selection handler when the widget is selected, but not for nested widgets. */\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\topacity: 1;\\n\\t\\t\\tbackground-color: var(--ck-color-focus-border);\\n\\n\\t\\t\\t/* When the widget is selected, notify the user using the proper look of the icon. */\\n\\t\\t\\t& .ck-icon .ck-icon__selected-indicator {\\n\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n/* In a RTL environment, align the selection handler to the right side of the widget */\\n/* stylelint-disable-next-line no-descending-specificity */\\n.ck[dir=\\\"rtl\\\"] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle {\\n\\tleft: auto;\\n\\tright: calc(0px - var(--ck-widget-outline-thickness));\\n}\\n\\n/* https://github.com/ckeditor/ckeditor5/issues/6415 */\\n.ck.ck-editor__editable.ck-read-only .ck-widget {\\n\\t/* Prevent the :hover outline from showing up because of the used outline-color transition. */\\n\\ttransition: none;\\n\\n\\t&:not(.ck-widget_selected) {\\n\\t\\t/* Disable visual effects of hover/active widget when CKEditor is in readOnly mode.\\n\\t\\t * See: https://github.com/ckeditor/ckeditor5/issues/1261\\n\\t\\t *\\n\\t\\t * Leave the unit because this custom property is used in calc() by other features.\\n\\t\\t * See: https://github.com/ckeditor/ckeditor5/issues/6775\\n\\t\\t */\\n\\t\\t--ck-widget-outline-thickness: 0px;\\n\\t}\\n\\n\\t&.ck-widget_with-selection-handle {\\n\\t\\t& .ck-widget__selection-handle,\\n\\t\\t& .ck-widget__selection-handle:hover {\\n\\t\\t\\tbackground: var(--ck-color-widget-blurred-border);\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Style the widget when it's selected but the editable it belongs to lost focus. */\\n/* stylelint-disable-next-line no-descending-specificity */\\n.ck.ck-editor__editable.ck-blurred .ck-widget {\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\toutline-color: var(--ck-color-widget-blurred-border);\\n\\n\\t\\t&.ck-widget_with-selection-handle {\\n\\t\\t\\t& > .ck-widget__selection-handle,\\n\\t\\t\\t& > .ck-widget__selection-handle:hover {\\n\\t\\t\\t\\tbackground: var(--ck-color-widget-blurred-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-editor__editable > .ck-widget.ck-widget_with-selection-handle:first-child,\\n.ck.ck-editor__editable blockquote > .ck-widget.ck-widget_with-selection-handle:first-child {\\n\\t/* Do not crop selection handler if a widget is a first-child in the blockquote or in the root editable.\\n\\tIn fact, anything with overflow: hidden.\\n\\thttps://github.com/ckeditor/ckeditor5-block-quote/issues/28\\n\\thttps://github.com/ckeditor/ckeditor5-widget/issues/44\\n\\thttps://github.com/ckeditor/ckeditor5-widget/issues/66 */\\n\\tmargin-top: calc(1em + var(--ck-widget-handler-icon-size));\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-forced-colors {\\n\\t@media (forced-colors: active) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\\n@define-mixin ck-media-default-colors {\\n\\t@media (forced-colors: none) {\\n\\t\\t& {\\n\\t\\t\\t@mixin-content;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgetresize.css\"],\"names\":[],\"mappings\":\"AAKA,4BAEC,iBACD,CAEA,wBACC,YAAa,CAMb,MAAO,CAFP,mBAAoB,CAHpB,iBAAkB,CAMlB,KACD,CAGC,2EACC,aACD,CAGD,gCAIC,kBAAmB,CAHnB,iBAcD,CATC,4IAEC,kBACD,CAEA,4IAEC,kBACD,CCpCD,MACC,sBAAuB,CAGvB,yDAAiE,CACjE,6BACD,CAEA,wBACC,yCACD,CAEA,gCAGC,uCAAwC,CACxC,gDAA6D,CAC7D,6CAA8C,CAH9C,6BAA8B,CAD9B,4BAyBD,CAnBC,oEAEC,6BAA8B,CAD9B,4BAED,CAEA,qEAEC,8BAA+B,CAD/B,4BAED,CAEA,wEACC,+BAAgC,CAChC,8BACD,CAEA,uEACC,+BAAgC,CAChC,6BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-widget_with-resizer {\\n\\t/* Make the widget wrapper a relative positioning container for the drag handle. */\\n\\tposition: relative;\\n}\\n\\n.ck .ck-widget__resizer {\\n\\tdisplay: none;\\n\\tposition: absolute;\\n\\n\\t/* The wrapper itself should not interfere with the pointer device, only the handles should. */\\n\\tpointer-events: none;\\n\\n\\tleft: 0;\\n\\ttop: 0;\\n}\\n\\n.ck-focused .ck-widget_with-resizer.ck-widget_selected {\\n\\t& > .ck-widget__resizer {\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\\n.ck .ck-widget__resizer__handle {\\n\\tposition: absolute;\\n\\n\\t/* Resizers are the only UI elements that should interfere with a pointer device. */\\n\\tpointer-events: all;\\n\\n\\t&.ck-widget__resizer__handle-top-left,\\n\\t&.ck-widget__resizer__handle-bottom-right {\\n\\t\\tcursor: nwse-resize;\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-top-right,\\n\\t&.ck-widget__resizer__handle-bottom-left {\\n\\t\\tcursor: nesw-resize;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-resizer-size: 10px;\\n\\n\\t/* Set the resizer with a 50% offset. */\\n\\t--ck-resizer-offset: calc( ( var(--ck-resizer-size) / -2 ) - 2px);\\n\\t--ck-resizer-border-width: 1px;\\n}\\n\\n.ck .ck-widget__resizer {\\n\\toutline: 1px solid var(--ck-color-resizer);\\n}\\n\\n.ck .ck-widget__resizer__handle {\\n\\twidth: var(--ck-resizer-size);\\n\\theight: var(--ck-resizer-size);\\n\\tbackground: var(--ck-color-focus-border);\\n\\tborder: var(--ck-resizer-border-width) solid hsl(0, 0%, 100%);\\n\\tborder-radius: var(--ck-resizer-border-radius);\\n\\n\\t&.ck-widget__resizer__handle-top-left {\\n\\t\\ttop: var(--ck-resizer-offset);\\n\\t\\tleft: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-top-right {\\n\\t\\ttop: var(--ck-resizer-offset);\\n\\t\\tright: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-bottom-right {\\n\\t\\tbottom: var(--ck-resizer-offset);\\n\\t\\tright: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-bottom-left {\\n\\t\\tbottom: var(--ck-resizer-offset);\\n\\t\\tleft: var(--ck-resizer-offset);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:\"\";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);width:var(--ck-widget-type-around-button-size)}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button svg{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button:hover,.ck .ck-widget .ck-widget__type-around__button:hover svg line,.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:none}}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgettypearound.css\"],\"names\":[],\"mappings\":\"AASC,+CACC,aAAc,CAEd,eAAgB,CADhB,iBAAkB,CAElB,2B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UA,yKACC,iDACD,CAMA,uOAxKD,SAAU,CACV,mBAyKC,CAoBA,6yBACC,SACD,CASF,uHACC,aAAc,CACd,iBACD,CAYG,iRAxNF,SAAU,CACV,mBAyNE,CAQH,kIACC,qEAKD,CAHC,wIACC,WACD,CAGD,4CACC,GACC,oBACD,CACA,OACC,mBACD,CACD,CAEA,gDACC,OACC,mBACD,CACA,OACC,mBACD,CACD,CAEA,8CACC,GACC,6HACD,CACA,IACC,6HACD,CACA,GACC,+HACD,CACD,CAEA,kDACC,GACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,GACC,SACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-widget {\\n\\t/*\\n\\t * Styles of the type around buttons\\n\\t */\\n\\t& .ck-widget__type-around__button {\\n\\t\\tdisplay: block;\\n\\t\\tposition: absolute;\\n\\t\\toverflow: hidden;\\n\\t\\tz-index: var(--ck-z-default);\\n\\n\\t\\t& svg {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 50%;\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 2);\\n\\t\\t}\\n\\n\\t\\t&.ck-widget__type-around__button_before {\\n\\t\\t\\t/* Place it in the middle of the outline */\\n\\t\\t\\ttop: calc(-0.5 * var(--ck-widget-outline-thickness));\\n\\t\\t\\tleft: min(10%, 30px);\\n\\n\\t\\t\\ttransform: translateY(-50%);\\n\\t\\t}\\n\\n\\t\\t&.ck-widget__type-around__button_after {\\n\\t\\t\\t/* Place it in the middle of the outline */\\n\\t\\t\\tbottom: calc(-0.5 * var(--ck-widget-outline-thickness));\\n\\t\\t\\tright: min(10%, 30px);\\n\\n\\t\\t\\ttransform: translateY(50%);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when:\\n\\t * - the widget is selected,\\n\\t * - or the button is being hovered (regardless of the widget state).\\n\\t */\\n\\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\\n\\t\\t&::after {\\n\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 1px;\\n\\t\\t\\tleft: 1px;\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" which is displayed when the user navigates using the keyboard.\\n\\t */\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tdisplay: none;\\n\\t\\tposition: absolute;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t}\\n\\n\\t/*\\n\\t * When the widget is hovered the \\\"fake caret\\\" would normally be narrower than the\\n\\t * extra outline displayed around the widget. Let's extend the \\\"fake caret\\\" to match\\n\\t * the full width of the widget.\\n\\t */\\n\\t&:hover > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tleft: calc( -1 * var(--ck-widget-outline-thickness) );\\n\\t\\tright: calc( -1 * var(--ck-widget-outline-thickness) );\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" when it should be displayed before the widget (backward keyboard navigation).\\n\\t */\\n\\t&.ck-widget_type-around_show-fake-caret_before > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\ttop: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\\n\\t\\tdisplay: block;\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" when it should be displayed after the widget (forward keyboard navigation).\\n\\t */\\n\\t&.ck-widget_type-around_show-fake-caret_after > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tbottom: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\\n/*\\n * Integration with the read-only mode of the editor.\\n */\\n.ck.ck-editor__editable.ck-read-only .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\\n/*\\n * Integration with the restricted editing mode (feature) of the editor.\\n */\\n.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\\n/*\\n * Integration with the #isEnabled property of the WidgetTypeAround plugin.\\n */\\n.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-widget-type-around-button-size: 20px;\\n\\t--ck-color-widget-type-around-button-active: var(--ck-color-focus-border);\\n\\t--ck-color-widget-type-around-button-hover: var(--ck-color-widget-hover-border);\\n\\t--ck-color-widget-type-around-button-blurred-editable: var(--ck-color-widget-blurred-border);\\n\\t--ck-color-widget-type-around-button-radar-start-alpha: 0;\\n\\t--ck-color-widget-type-around-button-radar-end-alpha: .3;\\n\\t--ck-color-widget-type-around-button-icon: var(--ck-color-base-background);\\n}\\n\\n@define-mixin ck-widget-type-around-button-visible {\\n\\topacity: 1;\\n\\tpointer-events: auto;\\n}\\n\\n@define-mixin ck-widget-type-around-button-hidden {\\n\\topacity: 0;\\n\\tpointer-events: none;\\n}\\n\\n.ck .ck-widget {\\n\\t/*\\n\\t * Styles of the type around buttons\\n\\t */\\n\\t& .ck-widget__type-around__button {\\n\\t\\twidth: var(--ck-widget-type-around-button-size);\\n\\t\\theight: var(--ck-widget-type-around-button-size);\\n\\t\\tbackground: var(--ck-color-widget-type-around-button);\\n\\t\\tborder-radius: 100px;\\n\\t\\ttransition: opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve), background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\n\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\ttransition: none;\\n\\t\\t}\\n\\n\\t\\t& svg {\\n\\t\\t\\twidth: 10px;\\n\\t\\t\\theight: 8px;\\n\\t\\t\\ttransform: translate(-50%,-50%);\\n\\t\\t\\ttransition: transform .5s ease;\\n\\t\\t\\tmargin-top: 1px;\\n\\n\\t\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\t\\ttransition: none;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& * {\\n\\t\\t\\t\\tstroke-dasharray: 10;\\n\\t\\t\\t\\tstroke-dashoffset: 0;\\n\\n\\t\\t\\t\\tfill: none;\\n\\t\\t\\t\\tstroke: var(--ck-color-widget-type-around-button-icon);\\n\\t\\t\\t\\tstroke-width: 1.5px;\\n\\t\\t\\t\\tstroke-linecap: round;\\n\\t\\t\\t\\tstroke-linejoin: round;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& line {\\n\\t\\t\\t\\tstroke-dasharray: 7;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\t/*\\n\\t\\t\\t * Display the \\\"sonar\\\" around the button when hovered.\\n\\t\\t\\t */\\n\\t\\t\\tanimation: ck-widget-type-around-button-sonar 1s ease infinite;\\n\\n\\t\\t\\t/*\\n\\t\\t\\t * Animate active button's icon.\\n\\t\\t\\t */\\n\\t\\t\\t& svg {\\n\\t\\t\\t\\t& polyline {\\n\\t\\t\\t\\t\\tanimation: ck-widget-type-around-arrow-dash 2s linear;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t& line {\\n\\t\\t\\t\\t\\tanimation: ck-widget-type-around-arrow-tip-dash 2s linear;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t@media (prefers-reduced-motion: reduce) {\\n\\t\\t\\t\\tanimation: none;\\n\\n\\t\\t\\t\\t& svg {\\n\\t\\t\\t\\t\\t& polyline {\\n\\t\\t\\t\\t\\t\\tanimation: none;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t& line {\\n\\t\\t\\t\\t\\t\\tanimation: none;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Show type around buttons when the widget gets selected or being hovered.\\n\\t */\\n\\t&.ck-widget_selected,\\n\\t&:hover {\\n\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t@mixin ck-widget-type-around-button-visible;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when the widget is NOT selected (but the buttons are visible\\n\\t * and still can be hovered).\\n\\t */\\n\\t&:not(.ck-widget_selected) > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\tbackground: var(--ck-color-widget-type-around-button-hover);\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when:\\n\\t * - the widget is selected,\\n\\t * - or the button is being hovered (regardless of the widget state).\\n\\t */\\n\\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\\n\\t\\tbackground: var(--ck-color-widget-type-around-button-active);\\n\\n\\t\\t&::after {\\n\\t\\t\\twidth: calc(var(--ck-widget-type-around-button-size) - 2px);\\n\\t\\t\\theight: calc(var(--ck-widget-type-around-button-size) - 2px);\\n\\t\\t\\tborder-radius: 100px;\\n\\t\\t\\tbackground: linear-gradient(135deg, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,.3) 100%);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the \\\"before\\\" button when the widget has a selection handle. Because some space\\n\\t * is consumed by the handle, the button must be moved slightly to the right to let it breathe.\\n\\t */\\n\\t&.ck-widget_with-selection-handle > .ck-widget__type-around > .ck-widget__type-around__button_before {\\n\\t\\tmargin-left: 20px;\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" which is displayed when the user navigates using the keyboard.\\n\\t */\\n\\t& .ck-widget__type-around__fake-caret {\\n\\t\\tpointer-events: none;\\n\\t\\theight: 1px;\\n\\t\\tanimation: ck-widget-type-around-fake-caret-pulse linear 1s infinite normal forwards;\\n\\n\\t\\t/*\\n\\t\\t * The semi-transparent-outline+background combo improves the contrast\\n\\t\\t * when the background underneath the fake caret is dark.\\n\\t\\t */\\n\\t\\toutline: solid 1px hsla(0, 0%, 100%, .5);\\n\\t\\tbackground: var(--ck-color-base-text);\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget when the \\\"fake caret\\\" is blinking (e.g. upon keyboard navigation).\\n\\t * Despite the widget being physically selected in the model, its outline should disappear.\\n\\t */\\n\\t&.ck-widget_selected {\\n\\t\\t&.ck-widget_type-around_show-fake-caret_before,\\n\\t\\t&.ck-widget_type-around_show-fake-caret_after {\\n\\t\\t\\toutline-color: transparent;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-widget_type-around_show-fake-caret_before,\\n\\t&.ck-widget_type-around_show-fake-caret_after {\\n\\t\\t/*\\n\\t\\t * When the \\\"fake caret\\\" is visible we simulate that the widget is not selected\\n\\t\\t * (despite being physically selected), so the outline color should be for the\\n\\t\\t * unselected widget.\\n\\t\\t */\\n\\t\\t&.ck-widget_selected:hover {\\n\\t\\t\\toutline-color: var(--ck-color-widget-hover-border);\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Styles of the type around buttons when the \\\"fake caret\\\" is blinking (e.g. upon keyboard navigation).\\n\\t\\t * In this state, the type around buttons would collide with the fake carets so they should disappear.\\n\\t\\t */\\n\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Fake horizontal caret integration with the selection handle. When the caret is visible, simply\\n\\t\\t * hide the handle because it intersects with the caret (and does not make much sense anyway).\\n\\t\\t */\\n\\t\\t&.ck-widget_with-selection-handle {\\n\\t\\t\\t&.ck-widget_selected,\\n\\t\\t\\t&.ck-widget_selected:hover {\\n\\t\\t\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\t\\t\\topacity: 0\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Fake horizontal caret integration with the resize UI. When the caret is visible, simply\\n\\t\\t * hide the resize UI because it creates too much noise. It can be visible when the user\\n\\t\\t * hovers the widget, though.\\n\\t\\t */\\n\\t\\t&.ck-widget_selected.ck-widget_with-resizer > .ck-widget__resizer {\\n\\t\\t\\topacity: 0\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Styles for the \\\"before\\\" button when the widget has a selection handle in an RTL environment.\\n * The selection handler is aligned to the right side of the widget so there is no need to create\\n * additional space for it next to the \\\"before\\\" button.\\n */\\n.ck[dir=\\\"rtl\\\"] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around > .ck-widget__type-around__button_before {\\n\\tmargin-left: 0;\\n\\tmargin-right: 20px;\\n}\\n\\n/*\\n * Hide type around buttons when the widget is selected as a child of a selected\\n * nested editable (e.g. mulit-cell table selection).\\n *\\n * See https://github.com/ckeditor/ckeditor5/issues/7263.\\n */\\n.ck-editor__nested-editable.ck-editor__editable_selected {\\n\\t& .ck-widget {\\n\\t\\t&.ck-widget_selected,\\n\\t\\t&:hover {\\n\\t\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Styles for the buttons when the widget is selected but the user clicked outside of the editor (blurred the editor).\\n */\\n.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button:not(:hover) {\\n\\tbackground: var(--ck-color-widget-type-around-button-blurred-editable);\\n\\n\\t& svg * {\\n\\t\\tstroke: hsl(0,0%,60%);\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-arrow-dash {\\n\\t0% {\\n\\t\\tstroke-dashoffset: 10;\\n\\t}\\n\\t20%, 100% {\\n\\t\\tstroke-dashoffset: 0;\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-arrow-tip-dash {\\n\\t0%, 20% {\\n\\t\\tstroke-dashoffset: 7;\\n\\t}\\n\\t40%, 100% {\\n\\t\\tstroke-dashoffset: 0;\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-button-sonar {\\n\\t0% {\\n\\t\\tbox-shadow: 0 0 0 0 hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\\n\\t}\\n\\t50% {\\n\\t\\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-end-alpha));\\n\\t}\\n\\t100% {\\n\\t\\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-fake-caret-pulse {\\n\\t0% {\\n\\t\\topacity: 1;\\n\\t}\\n\\t49% {\\n\\t\\topacity: 1;\\n\\t}\\n\\t50% {\\n\\t\\topacity: 0;\\n\\t}\\n\\t99% {\\n\\t\\topacity: 0;\\n\\t}\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\nmodule.exports = function (url, options) {\n if (!options) {\n options = {};\n }\n if (!url) {\n return url;\n }\n url = String(url.__esModule ? url.default : url);\n\n // If url is already wrapped in quotes, remove them\n if (/^['\"].*['\"]$/.test(url)) {\n url = url.slice(1, -1);\n }\n if (options.hash) {\n url += options.hash;\n }\n\n // Should url be wrapped?\n // See https://drafts.csswg.org/css-values-3/#urls\n if (/[\"'() \\t\\n]|(%20)/.test(url) || options.needQuotes) {\n return \"\\\"\".concat(url.replace(/\"/g, '\\\\\"').replace(/\\n/g, \"\\\\n\"), \"\\\"\");\n }\n return url;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>\n// This work is free. You can redistribute it and/or modify it\n// under the terms of the WTFPL, Version 2\n// For more information see LICENSE.txt or http://www.wtfpl.net/\n//\n// For more information, the home page:\n// http://pieroxy.net/blog/pages/lz-string/testing.html\n//\n// LZ-based compression algorithm, version 1.4.5\nvar LZString = (function() {\n\n// private property\nvar f = String.fromCharCode;\nvar keyStrBase64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar keyStrUriSafe = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\";\nvar baseReverseDic = {};\n\nfunction getBaseValue(alphabet, character) {\n if (!baseReverseDic[alphabet]) {\n baseReverseDic[alphabet] = {};\n for (var i=0 ; i<alphabet.length ; i++) {\n baseReverseDic[alphabet][alphabet.charAt(i)] = i;\n }\n }\n return baseReverseDic[alphabet][character];\n}\n\nvar LZString = {\n compressToBase64 : function (input) {\n if (input == null) return \"\";\n var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});\n switch (res.length % 4) { // To produce valid Base64\n default: // When could this happen ?\n case 0 : return res;\n case 1 : return res+\"===\";\n case 2 : return res+\"==\";\n case 3 : return res+\"=\";\n }\n },\n\n decompressFromBase64 : function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });\n },\n\n compressToUTF16 : function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 15, function(a){return f(a+32);}) + \" \";\n },\n\n decompressFromUTF16: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });\n },\n\n //compress into uint8array (UCS-2 big endian format)\n compressToUint8Array: function (uncompressed) {\n var compressed = LZString.compress(uncompressed);\n var buf=new Uint8Array(compressed.length*2); // 2 bytes per character\n\n for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {\n var current_value = compressed.charCodeAt(i);\n buf[i*2] = current_value >>> 8;\n buf[i*2+1] = current_value % 256;\n }\n return buf;\n },\n\n //decompress from uint8array (UCS-2 big endian format)\n decompressFromUint8Array:function (compressed) {\n if (compressed===null || compressed===undefined){\n return LZString.decompress(compressed);\n } else {\n var buf=new Array(compressed.length/2); // 2 bytes per character\n for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {\n buf[i]=compressed[i*2]*256+compressed[i*2+1];\n }\n\n var result = [];\n buf.forEach(function (c) {\n result.push(f(c));\n });\n return LZString.decompress(result.join(''));\n\n }\n\n },\n\n\n //compress into a string that is already URI encoded\n compressToEncodedURIComponent: function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});\n },\n\n //decompress from an output of compressToEncodedURIComponent\n decompressFromEncodedURIComponent:function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n input = input.replace(/ /g, \"+\");\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });\n },\n\n compress: function (uncompressed) {\n return LZString._compress(uncompressed, 16, function(a){return f(a);});\n },\n _compress: function (uncompressed, bitsPerChar, getCharFromInt) {\n if (uncompressed == null) return \"\";\n var i, value,\n context_dictionary= {},\n context_dictionaryToCreate= {},\n context_c=\"\",\n context_wc=\"\",\n context_w=\"\",\n context_enlargeIn= 2, // Compensate for the first entry which should not count\n context_dictSize= 3,\n context_numBits= 2,\n context_data=[],\n context_data_val=0,\n context_data_position=0,\n ii;\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii);\n if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {\n context_dictionary[context_c] = context_dictSize++;\n context_dictionaryToCreate[context_c] = true;\n }\n\n context_wc = context_w + context_c;\n if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {\n context_w = context_wc;\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position ==bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++;\n context_w = String(context_c);\n }\n }\n\n // Output the code for w.\n if (context_w !== \"\") {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n }\n\n // Mark the end of the stream\n value = 2;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data.push(getCharFromInt(context_data_val));\n break;\n }\n else context_data_position++;\n }\n return context_data.join('');\n },\n\n decompress: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });\n },\n\n _decompress: function (length, resetValue, getNextValue) {\n var dictionary = [],\n next,\n enlargeIn = 4,\n dictSize = 4,\n numBits = 3,\n entry = \"\",\n result = [],\n i,\n w,\n bits, resb, maxpower, power,\n c,\n data = {val:getNextValue(0), position:resetValue, index:1};\n\n for (i = 0; i < 3; i += 1) {\n dictionary[i] = i;\n }\n\n bits = 0;\n maxpower = Math.pow(2,2);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (next = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 2:\n return \"\";\n }\n dictionary[3] = c;\n w = c;\n result.push(c);\n while (true) {\n if (data.index > length) {\n return \"\";\n }\n\n bits = 0;\n maxpower = Math.pow(2,numBits);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (c = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 2:\n return result.join('');\n }\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n if (dictionary[c]) {\n entry = dictionary[c];\n } else {\n if (c === dictSize) {\n entry = w + w.charAt(0);\n } else {\n return null;\n }\n }\n result.push(entry);\n\n // Add w+entry[0] to the dictionary.\n dictionary[dictSize++] = w + entry.charAt(0);\n enlargeIn--;\n\n w = entry;\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n }\n }\n};\n return LZString;\n})();\n\nif (typeof define === 'function' && define.amd) {\n define(function () { return LZString; });\n} else if( typeof module !== 'undefined' && module != null ) {\n module.exports = LZString\n} else if( typeof angular !== 'undefined' && angular != null ) {\n angular.module('LZString', [])\n .factory('LZString', function () {\n return LZString;\n });\n}\n","// Markdown-it plugin to render GitHub-style task lists; see\n//\n// https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments\n// https://github.com/blog/1825-task-lists-in-all-markdown-documents\n\nvar disableCheckboxes = true;\nvar useLabelWrapper = false;\nvar useLabelAfter = false;\n\nmodule.exports = function(md, options) {\n\tif (options) {\n\t\tdisableCheckboxes = !options.enabled;\n\t\tuseLabelWrapper = !!options.label;\n\t\tuseLabelAfter = !!options.labelAfter;\n\t}\n\n\tmd.core.ruler.after('inline', 'github-task-lists', function(state) {\n\t\tvar tokens = state.tokens;\n\t\tfor (var i = 2; i < tokens.length; i++) {\n\t\t\tif (isTodoItem(tokens, i)) {\n\t\t\t\ttodoify(tokens[i], state.Token);\n\t\t\t\tattrSet(tokens[i-2], 'class', 'task-list-item' + (!disableCheckboxes ? ' enabled' : ''));\n\t\t\t\tattrSet(tokens[parentToken(tokens, i-2)], 'class', 'contains-task-list');\n\t\t\t}\n\t\t}\n\t});\n};\n\nfunction attrSet(token, name, value) {\n\tvar index = token.attrIndex(name);\n\tvar attr = [name, value];\n\n\tif (index < 0) {\n\t\ttoken.attrPush(attr);\n\t} else {\n\t\ttoken.attrs[index] = attr;\n\t}\n}\n\nfunction parentToken(tokens, index) {\n\tvar targetLevel = tokens[index].level - 1;\n\tfor (var i = index - 1; i >= 0; i--) {\n\t\tif (tokens[i].level === targetLevel) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction isTodoItem(tokens, index) {\n\treturn isInline(tokens[index]) &&\n\t isParagraph(tokens[index - 1]) &&\n\t isListItem(tokens[index - 2]) &&\n\t startsWithTodoMarkdown(tokens[index]);\n}\n\nfunction todoify(token, TokenConstructor) {\n\ttoken.children.unshift(makeCheckbox(token, TokenConstructor));\n\ttoken.children[1].content = token.children[1].content.slice(3);\n\ttoken.content = token.content.slice(3);\n\n\tif (useLabelWrapper) {\n\t\tif (useLabelAfter) {\n\t\t\ttoken.children.pop();\n\n\t\t\t// Use large random number as id property of the checkbox.\n\t\t\tvar id = 'task-item-' + Math.ceil(Math.random() * (10000 * 1000) - 1000);\n\t\t\ttoken.children[0].content = token.children[0].content.slice(0, -1) + ' id=\"' + id + '\">';\n\t\t\ttoken.children.push(afterLabel(token.content, id, TokenConstructor));\n\t\t} else {\n\t\t\ttoken.children.unshift(beginLabel(TokenConstructor));\n\t\t\ttoken.children.push(endLabel(TokenConstructor));\n\t\t}\n\t}\n}\n\nfunction makeCheckbox(token, TokenConstructor) {\n\tvar checkbox = new TokenConstructor('html_inline', '', 0);\n\tvar disabledAttr = disableCheckboxes ? ' disabled=\"\" ' : '';\n\tif (token.content.indexOf('[ ] ') === 0) {\n\t\tcheckbox.content = '<input class=\"task-list-item-checkbox\"' + disabledAttr + 'type=\"checkbox\">';\n\t} else if (token.content.indexOf('[x] ') === 0 || token.content.indexOf('[X] ') === 0) {\n\t\tcheckbox.content = '<input class=\"task-list-item-checkbox\" checked=\"\"' + disabledAttr + 'type=\"checkbox\">';\n\t}\n\treturn checkbox;\n}\n\n// these next two functions are kind of hacky; probably should really be a\n// true block-level token with .tag=='label'\nfunction beginLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '<label>';\n\treturn token;\n}\n\nfunction endLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '</label>';\n\treturn token;\n}\n\nfunction afterLabel(content, id, TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '<label class=\"task-list-item-label\" for=\"' + id + '\">' + content + '</label>';\n\ttoken.attrs = [{for: id}];\n\treturn token;\n}\n\nfunction isInline(token) { return token.type === 'inline'; }\nfunction isParagraph(token) { return token.type === 'paragraph_open'; }\nfunction isListItem(token) { return token.type === 'list_item_open'; }\n\nfunction startsWithTodoMarkdown(token) {\n\t// leading whitespace in a list item is already trimmed off by markdown-it\n\treturn token.content.indexOf('[ ] ') === 0 || token.content.indexOf('[x] ') === 0 || token.content.indexOf('[X] ') === 0;\n}\n","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement, attributes) {\n Object.keys(attributes).forEach(function (key) {\n styleElement.setAttribute(key, attributes[key]);\n });\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\n/* istanbul ignore next */\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join(\"\\n\");\n };\n}();\n\n/* istanbul ignore next */\nfunction apply(styleElement, index, remove, obj) {\n var css;\n if (remove) {\n css = \"\";\n } else {\n css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n }\n\n // For old IE\n /* istanbul ignore if */\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = styleElement.childNodes;\n if (childNodes[index]) {\n styleElement.removeChild(childNodes[index]);\n }\n if (childNodes.length) {\n styleElement.insertBefore(cssNode, childNodes[index]);\n } else {\n styleElement.appendChild(cssNode);\n }\n }\n}\nvar singletonData = {\n singleton: null,\n singletonCounter: 0\n};\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") return {\n update: function update() {},\n remove: function remove() {}\n };\n\n // eslint-disable-next-line no-undef,no-use-before-define\n var styleIndex = singletonData.singletonCounter++;\n var styleElement =\n // eslint-disable-next-line no-undef,no-use-before-define\n singletonData.singleton || (\n // eslint-disable-next-line no-undef,no-use-before-define\n singletonData.singleton = options.insertStyleElement(options));\n return {\n update: function update(obj) {\n apply(styleElement, styleIndex, false, obj);\n },\n remove: function remove(obj) {\n apply(styleElement, styleIndex, true, obj);\n }\n };\n}\nmodule.exports = domAPI;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// no jsonp function","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A helper (module) giving an access to the global DOM objects such as `window` and\n * `document`. Accessing these objects using this helper allows easy and bulletproof\n * testing, i.e. stubbing native properties:\n *\n * ```ts\n * import { global } from 'ckeditor5/utils';\n *\n * // This stub will work for any code using global module.\n * testUtils.sinon.stub( global, 'window', {\n * \tinnerWidth: 10000\n * } );\n *\n * console.log( global.window.innerWidth );\n * ```\n */\nlet globalVar; // named globalVar instead of global: https://github.com/ckeditor/ckeditor5/issues/12971\n// In some environments window and document API might not be available.\ntry {\n globalVar = { window, document };\n}\ncatch (e) {\n // It's not possible to mock a window object to simulate lack of a window object without writing extremely convoluted code.\n /* istanbul ignore next -- @preserve */\n // Let's cast it to not change module's API.\n // We only handle this so loading editor in environments without window and document doesn't fail.\n // For better DX we shouldn't introduce mixed types and require developers to check the type manually.\n // This module should not be used on purpose in any environment outside browser.\n globalVar = { window: {}, document: {} };\n}\nexport default globalVar;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals navigator:false */\n/**\n * @module utils/env\n */\nimport global from './dom/global.js';\n/**\n * Safely returns `userAgent` from browser's navigator API in a lower case.\n * If navigator API is not available it will return an empty string.\n */\nexport function getUserAgent() {\n // In some environments navigator API might not be available.\n try {\n return navigator.userAgent.toLowerCase();\n }\n catch (e) {\n return '';\n }\n}\nconst userAgent = /* #__PURE__ */ getUserAgent();\n/**\n * A namespace containing environment and browser information.\n */\nconst env = {\n isMac: /* #__PURE__ */ isMac(userAgent),\n isWindows: /* #__PURE__ */ isWindows(userAgent),\n isGecko: /* #__PURE__ */ isGecko(userAgent),\n isSafari: /* #__PURE__ */ isSafari(userAgent),\n isiOS: /* #__PURE__ */ isiOS(userAgent),\n isAndroid: /* #__PURE__ */ isAndroid(userAgent),\n isBlink: /* #__PURE__ */ isBlink(userAgent),\n get isMediaForcedColors() {\n return isMediaForcedColors();\n },\n get isMotionReduced() {\n return isMotionReduced();\n },\n features: {\n isRegExpUnicodePropertySupported: /* #__PURE__ */ isRegExpUnicodePropertySupported()\n }\n};\nexport default env;\n/**\n * Checks if User Agent represented by the string is running on Macintosh.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running on Macintosh or not.\n */\nexport function isMac(userAgent) {\n return userAgent.indexOf('macintosh') > -1;\n}\n/**\n * Checks if User Agent represented by the string is running on Windows.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running on Windows or not.\n */\nexport function isWindows(userAgent) {\n return userAgent.indexOf('windows') > -1;\n}\n/**\n * Checks if User Agent represented by the string is Firefox (Gecko).\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Firefox or not.\n */\nexport function isGecko(userAgent) {\n return !!userAgent.match(/gecko\\/\\d+/);\n}\n/**\n * Checks if User Agent represented by the string is Safari.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Safari or not.\n */\nexport function isSafari(userAgent) {\n return userAgent.indexOf(' applewebkit/') > -1 && userAgent.indexOf('chrome') === -1;\n}\n/**\n * Checks if User Agent represented by the string is running in iOS.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running in iOS or not.\n */\nexport function isiOS(userAgent) {\n // \"Request mobile site\" || \"Request desktop site\".\n return !!userAgent.match(/iphone|ipad/i) || (isMac(userAgent) && navigator.maxTouchPoints > 0);\n}\n/**\n * Checks if User Agent represented by the string is Android mobile device.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Safari or not.\n */\nexport function isAndroid(userAgent) {\n return userAgent.indexOf('android') > -1;\n}\n/**\n * Checks if User Agent represented by the string is Blink engine.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Blink engine or not.\n */\nexport function isBlink(userAgent) {\n // The Edge browser before switching to the Blink engine used to report itself as Chrome (and \"Edge/\")\n // but after switching to the Blink it replaced \"Edge/\" with \"Edg/\".\n return userAgent.indexOf('chrome/') > -1 && userAgent.indexOf('edge/') < 0;\n}\n/**\n * Checks if the current environment supports ES2018 Unicode properties like `\\p{P}` or `\\p{L}`.\n * More information about unicode properties might be found\n * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).\n */\nexport function isRegExpUnicodePropertySupported() {\n let isSupported = false;\n // Feature detection for Unicode properties. Added in ES2018. Currently Firefox does not support it.\n // See https://github.com/ckeditor/ckeditor5-mention/issues/44#issuecomment-487002174.\n try {\n // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).\n isSupported = 'ć'.search(new RegExp('[\\\\p{L}]', 'u')) === 0;\n }\n catch (error) {\n // Firefox throws a SyntaxError when the group is unsupported.\n }\n return isSupported;\n}\n/**\n * Checks if the user agent has enabled a forced colors mode (e.g. Windows High Contrast mode).\n *\n * Returns `false` in environments where `window` global object is not available.\n */\nexport function isMediaForcedColors() {\n return global.window.matchMedia ? global.window.matchMedia('(forced-colors: active)').matches : false;\n}\n/**\n * Checks if the user enabled \"prefers reduced motion\" setting in browser.\n *\n * Returns `false` in environments where `window` global object is not available.\n */\nexport function isMotionReduced() {\n return global.window.matchMedia ? global.window.matchMedia('(prefers-reduced-motion)').matches : false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/fastdiff\n */\n/**\n * Finds positions of the first and last change in the given string/array and generates a set of changes:\n *\n * ```ts\n * fastDiff( '12a', '12xyza' );\n * // [ { index: 2, type: 'insert', values: [ 'x', 'y', 'z' ] } ]\n *\n * fastDiff( '12a', '12aa' );\n * // [ { index: 3, type: 'insert', values: [ 'a' ] } ]\n *\n * fastDiff( '12xyza', '12a' );\n * // [ { index: 2, type: 'delete', howMany: 3 } ]\n *\n * fastDiff( [ '1', '2', 'a', 'a' ], [ '1', '2', 'a' ] );\n * // [ { index: 3, type: 'delete', howMany: 1 } ]\n *\n * fastDiff( [ '1', '2', 'a', 'b', 'c', '3' ], [ '2', 'a', 'b' ] );\n * // [ { index: 0, type: 'insert', values: [ '2', 'a', 'b' ] }, { index: 3, type: 'delete', howMany: 6 } ]\n * ```\n *\n * Passed arrays can contain any type of data, however to compare them correctly custom comparator function\n * should be passed as a third parameter:\n *\n * ```ts\n * fastDiff( [ { value: 1 }, { value: 2 } ], [ { value: 1 }, { value: 3 } ], ( a, b ) => {\n * \treturn a.value === b.value;\n * } );\n * // [ { index: 1, type: 'insert', values: [ { value: 3 } ] }, { index: 2, type: 'delete', howMany: 1 } ]\n * ```\n *\n * The resulted set of changes can be applied to the input in order to transform it into the output, for example:\n *\n * ```ts\n * let input = '12abc3';\n * const output = '2ab';\n * const changes = fastDiff( input, output );\n *\n * changes.forEach( change => {\n * \tif ( change.type == 'insert' ) {\n * \t\tinput = input.substring( 0, change.index ) + change.values.join( '' ) + input.substring( change.index );\n * \t} else if ( change.type == 'delete' ) {\n * \t\tinput = input.substring( 0, change.index ) + input.substring( change.index + change.howMany );\n * \t}\n * } );\n *\n * // input equals output now\n * ```\n *\n * or in case of arrays:\n *\n * ```ts\n * let input = [ '1', '2', 'a', 'b', 'c', '3' ];\n * const output = [ '2', 'a', 'b' ];\n * const changes = fastDiff( input, output );\n *\n * changes.forEach( change => {\n * \tif ( change.type == 'insert' ) {\n * \t\tinput = input.slice( 0, change.index ).concat( change.values, input.slice( change.index ) );\n * \t} else if ( change.type == 'delete' ) {\n * \t\tinput = input.slice( 0, change.index ).concat( input.slice( change.index + change.howMany ) );\n * \t}\n * } );\n *\n * // input equals output now\n * ```\n *\n * By passing `true` as the fourth parameter (`atomicChanges`) the output of this function will become compatible with\n * the {@link module:utils/diff~diff `diff()`} function:\n *\n * ```ts\n * fastDiff( '12a', '12xyza', undefined, true );\n * // [ 'equal', 'equal', 'insert', 'insert', 'insert', 'equal' ]\n * ```\n *\n * The default output format of this function is compatible with the output format of\n * {@link module:utils/difftochanges~diffToChanges `diffToChanges()`}. The `diffToChanges()` input format is, in turn,\n * compatible with the output of {@link module:utils/diff~diff `diff()`}:\n *\n * ```ts\n * const a = '1234';\n * const b = '12xyz34';\n *\n * // Both calls will return the same results (grouped changes format).\n * fastDiff( a, b );\n * diffToChanges( diff( a, b ) );\n *\n * // Again, both calls will return the same results (atomic changes format).\n * fastDiff( a, b, undefined, true );\n * diff( a, b );\n * ```\n *\n * @typeParam T The type of array elements.\n * @typeParam AtomicChanges The type of `atomicChanges` parameter (selects the result type).\n * @param a Input array or string.\n * @param b Input array or string.\n * @param cmp Optional function used to compare array values, by default `===` (strict equal operator) is used.\n * @param atomicChanges Whether an array of `inset|delete|equal` operations should\n * be returned instead of changes set. This makes this function compatible with {@link module:utils/diff~diff `diff()`}.\n * Defaults to `false`.\n * @returns Array of changes. The elements are either {@link module:utils/diff~DiffResult} or {@link module:utils/difftochanges~Change},\n * depending on `atomicChanges` parameter.\n */\nexport default function fastDiff(a, b, cmp, atomicChanges) {\n // Set the comparator function.\n cmp = cmp || function (a, b) {\n return a === b;\n };\n // Convert the string (or any array-like object - eg. NodeList) to an array by using the slice() method because,\n // unlike Array.from(), it returns array of UTF-16 code units instead of the code points of a string.\n // One code point might be a surrogate pair of two code units. All text offsets are expected to be in code units.\n // See ckeditor/ckeditor5#3147.\n //\n // We need to make sure here that fastDiff() works identical to diff().\n const arrayA = Array.isArray(a) ? a : Array.prototype.slice.call(a);\n const arrayB = Array.isArray(b) ? b : Array.prototype.slice.call(b);\n // Find first and last change.\n const changeIndexes = findChangeBoundaryIndexes(arrayA, arrayB, cmp);\n // Transform into changes array.\n const result = atomicChanges ?\n changeIndexesToAtomicChanges(changeIndexes, arrayB.length) :\n changeIndexesToChanges(arrayB, changeIndexes);\n return result;\n}\n/**\n * Finds position of the first and last change in the given arrays. For example:\n *\n * ```ts\n * const indexes = findChangeBoundaryIndexes( [ '1', '2', '3', '4' ], [ '1', '3', '4', '2', '4' ] );\n * console.log( indexes ); // { firstIndex: 1, lastIndexOld: 3, lastIndexNew: 4 }\n * ```\n *\n * The above indexes means that in the first array the modified part is `1[23]4` and in the second array it is `1[342]4`.\n * Based on such indexes, array with `insert`/`delete` operations which allows transforming first value into the second one\n * can be generated.\n */\nfunction findChangeBoundaryIndexes(arr1, arr2, cmp) {\n // Find the first difference between passed values.\n const firstIndex = findFirstDifferenceIndex(arr1, arr2, cmp);\n // If arrays are equal return -1 indexes object.\n if (firstIndex === -1) {\n return { firstIndex: -1, lastIndexOld: -1, lastIndexNew: -1 };\n }\n // Remove the common part of each value and reverse them to make it simpler to find the last difference between them.\n const oldArrayReversed = cutAndReverse(arr1, firstIndex);\n const newArrayReversed = cutAndReverse(arr2, firstIndex);\n // Find the first difference between reversed values.\n // It should be treated as \"how many elements from the end the last difference occurred\".\n //\n // For example:\n //\n // \t\t\t\tinitial\t->\tafter cut\t-> reversed:\n // oldValue:\t'321ba'\t->\t'21ba'\t\t-> 'ab12'\n // newValue:\t'31xba'\t->\t'1xba'\t\t-> 'abx1'\n // lastIndex:\t\t\t\t\t\t\t-> 2\n //\n // So the last change occurred two characters from the end of the arrays.\n const lastIndex = findFirstDifferenceIndex(oldArrayReversed, newArrayReversed, cmp);\n // Use `lastIndex` to calculate proper offset, starting from the beginning (`lastIndex` kind of starts from the end).\n const lastIndexOld = arr1.length - lastIndex;\n const lastIndexNew = arr2.length - lastIndex;\n return { firstIndex, lastIndexOld, lastIndexNew };\n}\n/**\n * Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.\n */\nfunction findFirstDifferenceIndex(arr1, arr2, cmp) {\n for (let i = 0; i < Math.max(arr1.length, arr2.length); i++) {\n if (arr1[i] === undefined || arr2[i] === undefined || !cmp(arr1[i], arr2[i])) {\n return i;\n }\n }\n return -1; // Return -1 if arrays are equal.\n}\n/**\n * Returns a copy of the given array with `howMany` elements removed starting from the beginning and in reversed order.\n *\n * @param arr Array to be processed.\n * @param howMany How many elements from array beginning to remove.\n * @returns Shortened and reversed array.\n */\nfunction cutAndReverse(arr, howMany) {\n return arr.slice(howMany).reverse();\n}\n/**\n * Generates changes array based on change indexes from `findChangeBoundaryIndexes` function. This function will\n * generate array with 0 (no changes), 1 (deletion or insertion) or 2 records (insertion and deletion).\n *\n * @param newArray New array for which change indexes were calculated.\n * @param changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.\n * @returns Array of changes compatible with {@link module:utils/difftochanges~diffToChanges} format.\n */\nfunction changeIndexesToChanges(newArray, changeIndexes) {\n const result = [];\n const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;\n // Order operations as 'insert', 'delete' array to keep compatibility with {@link module:utils/difftochanges~diffToChanges}\n // in most cases. However, 'diffToChanges' does not stick to any order so in some cases\n // (for example replacing '12345' with 'abcd') it will generate 'delete', 'insert' order.\n if (lastIndexNew - firstIndex > 0) {\n result.push({\n index: firstIndex,\n type: 'insert',\n values: newArray.slice(firstIndex, lastIndexNew)\n });\n }\n if (lastIndexOld - firstIndex > 0) {\n result.push({\n index: firstIndex + (lastIndexNew - firstIndex),\n type: 'delete',\n howMany: lastIndexOld - firstIndex\n });\n }\n return result;\n}\n/**\n * Generates array with set `equal|insert|delete` operations based on change indexes from `findChangeBoundaryIndexes` function.\n *\n * @param changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.\n * @param newLength Length of the new array on which `findChangeBoundaryIndexes` calculated change indexes.\n * @returns Array of changes compatible with {@link module:utils/diff~diff} format.\n */\nfunction changeIndexesToAtomicChanges(changeIndexes, newLength) {\n const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;\n // No changes.\n if (firstIndex === -1) {\n return Array(newLength).fill('equal');\n }\n let result = [];\n if (firstIndex > 0) {\n result = result.concat(Array(firstIndex).fill('equal'));\n }\n if (lastIndexNew - firstIndex > 0) {\n result = result.concat(Array(lastIndexNew - firstIndex).fill('insert'));\n }\n if (lastIndexOld - firstIndex > 0) {\n result = result.concat(Array(lastIndexOld - firstIndex).fill('delete'));\n }\n if (lastIndexNew < newLength) {\n result = result.concat(Array(newLength - lastIndexNew).fill('equal'));\n }\n return result;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/diff\n */\nimport fastDiff from './fastdiff.js';\n// The following code is based on the \"O(NP) Sequence Comparison Algorithm\"\n// by Sun Wu, Udi Manber, Gene Myers, Webb Miller.\n/**\n * Calculates the difference between two arrays or strings producing an array containing a list of changes\n * necessary to transform input into output.\n *\n * ```ts\n * diff( 'aba', 'acca' ); // [ 'equal', 'insert', 'insert', 'delete', 'equal' ]\n * ```\n *\n * This function is based on the \"O(NP) Sequence Comparison Algorithm\" by Sun Wu, Udi Manber, Gene Myers, Webb Miller.\n * Unfortunately, while it gives the most precise results, its to complex for longer strings/arrow (above 200 items).\n * Therefore, `diff()` automatically switches to {@link module:utils/fastdiff~fastDiff `fastDiff()`} when detecting\n * such a scenario. The return formats of both functions are identical.\n *\n * @param a Input array or string.\n * @param b Output array or string.\n * @param cmp Optional function used to compare array values, by default === is used.\n * @returns Array of changes.\n */\nexport default function diff(a, b, cmp) {\n // Set the comparator function.\n cmp = cmp || function (a, b) {\n return a === b;\n };\n const aLength = a.length;\n const bLength = b.length;\n // Perform `fastDiff` for longer strings/arrays (see #269).\n if (aLength > 200 || bLength > 200 || aLength + bLength > 300) {\n return diff.fastDiff(a, b, cmp, true);\n }\n // Temporary action type statics.\n let _insert, _delete;\n // Swapped the arrays to use the shorter one as the first one.\n if (bLength < aLength) {\n const tmp = a;\n a = b;\n b = tmp;\n // We swap the action types as well.\n _insert = 'delete';\n _delete = 'insert';\n }\n else {\n _insert = 'insert';\n _delete = 'delete';\n }\n const m = a.length;\n const n = b.length;\n const delta = n - m;\n // Edit scripts, for each diagonal.\n const es = {};\n // Furthest points, the furthest y we can get on each diagonal.\n const fp = {};\n function snake(k) {\n // We use -1 as an alternative below to handle initial values ( instead of filling the fp with -1 first ).\n // Furthest points (y) on the diagonal below k.\n const y1 = (fp[k - 1] !== undefined ? fp[k - 1] : -1) + 1;\n // Furthest points (y) on the diagonal above k.\n const y2 = fp[k + 1] !== undefined ? fp[k + 1] : -1;\n // The way we should go to get further.\n const dir = y1 > y2 ? -1 : 1;\n // Clone previous changes array (if any).\n if (es[k + dir]) {\n es[k] = es[k + dir].slice(0);\n }\n // Create changes array.\n if (!es[k]) {\n es[k] = [];\n }\n // Push the action.\n es[k].push(y1 > y2 ? _insert : _delete);\n // Set the beginning coordinates.\n let y = Math.max(y1, y2);\n let x = y - k;\n // Traverse the diagonal as long as the values match.\n while (x < m && y < n && cmp(a[x], b[y])) {\n x++;\n y++;\n // Push no change action.\n es[k].push('equal');\n }\n return y;\n }\n let p = 0;\n let k;\n // Traverse the graph until we reach the end of the longer string.\n do {\n // Updates furthest points and edit scripts for diagonals below delta.\n for (k = -p; k < delta; k++) {\n fp[k] = snake(k);\n }\n // Updates furthest points and edit scripts for diagonals above delta.\n for (k = delta + p; k > delta; k--) {\n fp[k] = snake(k);\n }\n // Updates furthest point and edit script for the delta diagonal.\n // note that the delta diagonal is the one which goes through the sink (m, n).\n fp[delta] = snake(delta);\n p++;\n } while (fp[delta] !== n);\n // Return the final list of edit changes.\n // We remove the first item that represents the action for the injected nulls.\n return es[delta].slice(1);\n}\n// Store the API in static property to easily overwrite it in tests.\n// Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.\ndiff.fastDiff = fastDiff;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/eventinfo\n */\nimport spy from './spy.js';\n/**\n * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to\n * manipulate it.\n */\nexport default class EventInfo {\n /**\n * @param source The emitter.\n * @param name The event name.\n */\n constructor(source, name) {\n this.source = source;\n this.name = name;\n this.path = [];\n // The following methods are defined in the constructor because they must be re-created per instance.\n this.stop = spy();\n this.off = spy();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/spy\n */\n/**\n * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.\n *\n * The following are the present features:\n *\n * * spy.called: property set to `true` if the function has been called at least once.\n *\n * @returns The spy function.\n */\nfunction spy() {\n return function spy() {\n spy.called = true;\n };\n}\nexport default spy;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/uid\n */\n/**\n * A hash table of hex numbers to avoid using toString() in uid() which is costly.\n * [ '00', '01', '02', ..., 'fe', 'ff' ]\n */\nconst HEX_NUMBERS = new Array(256).fill('')\n .map((_, index) => ('0' + (index).toString(16)).slice(-2));\n/**\n * Returns a unique id. The id starts with an \"e\" character and a randomly generated string of\n * 32 alphanumeric characters.\n *\n * **Note**: The characters the unique id is built from correspond to the hex number notation\n * (from \"0\" to \"9\", from \"a\" to \"f\"). In other words, each id corresponds to an \"e\" followed\n * by 16 8-bit numbers next to each other.\n *\n * @returns An unique id string.\n */\nexport default function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n const r1 = Math.random() * 0x100000000 >>> 0;\n const r2 = Math.random() * 0x100000000 >>> 0;\n const r3 = Math.random() * 0x100000000 >>> 0;\n const r4 = Math.random() * 0x100000000 >>> 0;\n // Make sure that id does not start with number.\n return 'e' +\n HEX_NUMBERS[r1 >> 0 & 0xFF] +\n HEX_NUMBERS[r1 >> 8 & 0xFF] +\n HEX_NUMBERS[r1 >> 16 & 0xFF] +\n HEX_NUMBERS[r1 >> 24 & 0xFF] +\n HEX_NUMBERS[r2 >> 0 & 0xFF] +\n HEX_NUMBERS[r2 >> 8 & 0xFF] +\n HEX_NUMBERS[r2 >> 16 & 0xFF] +\n HEX_NUMBERS[r2 >> 24 & 0xFF] +\n HEX_NUMBERS[r3 >> 0 & 0xFF] +\n HEX_NUMBERS[r3 >> 8 & 0xFF] +\n HEX_NUMBERS[r3 >> 16 & 0xFF] +\n HEX_NUMBERS[r3 >> 24 & 0xFF] +\n HEX_NUMBERS[r4 >> 0 & 0xFF] +\n HEX_NUMBERS[r4 >> 8 & 0xFF] +\n HEX_NUMBERS[r4 >> 16 & 0xFF] +\n HEX_NUMBERS[r4 >> 24 & 0xFF];\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Provides group of constants to use instead of hardcoding numeric priority values.\n */\nconst priorities = {\n get(priority = 'normal') {\n if (typeof priority != 'number') {\n return this[priority] || this.normal;\n }\n else {\n return priority;\n }\n },\n highest: 100000,\n high: 1000,\n normal: 0,\n low: -1000,\n lowest: -100000\n};\nexport default priorities;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport priorities from './priorities.js';\n/**\n * Inserts any object with priority at correct index by priority so registered objects are always sorted from highest to lowest priority.\n *\n * @param objects Array of objects with priority to insert object to.\n * @param objectToInsert Object with `priority` property.\n */\nexport default function insertToPriorityArray(objects, objectToInsert) {\n const priority = priorities.get(objectToInsert.priority);\n for (let i = 0; i < objects.length; i++) {\n if (priorities.get(objects[i].priority) < priority) {\n objects.splice(i, 0, objectToInsert);\n return;\n }\n }\n objects.push(objectToInsert);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/ckeditorerror\n */\n/* globals console */\n/**\n * URL to the documentation with error codes.\n */\nexport const DOCUMENTATION_URL = 'https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html';\n/**\n * The CKEditor error class.\n *\n * You should throw `CKEditorError` when:\n *\n * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled\n * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),\n * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give\n * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not\n * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use\n * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and\n * {@link module:utils/ckeditorerror~logError `logError()`}\n * to improve developers experience and let them see the a working editor as soon as possible.\n *\n * ```ts\n * /**\n * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.\n * *\n * * @error plugin-load\n * * @param pluginName The name of the plugin that could not be loaded.\n * * @param moduleName The name of the module which tried to load this plugin.\n * *\\/\n * throw new CKEditorError( 'plugin-load', {\n * \tpluginName: 'foo',\n * \tmoduleName: 'bar'\n * } );\n * ```\n */\nexport default class CKEditorError extends Error {\n /**\n * Creates an instance of the CKEditorError class.\n *\n * @param errorName The error id in an `error-name` format. A link to this error documentation page will be added\n * to the thrown error's `message`.\n * @param context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}\n * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also\n * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).\n * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility\n * to check if the object works as the context.\n * @param data Additional data describing the error. A stringified version of this object\n * will be appended to the error message, so the data are quickly visible in the console. The original\n * data object will also be later available under the {@link #data} property.\n */\n constructor(errorName, context, data) {\n super(getErrorMessage(errorName, data));\n this.name = 'CKEditorError';\n this.context = context;\n this.data = data;\n }\n /**\n * Checks if the error is of the `CKEditorError` type.\n */\n is(type) {\n return type === 'CKEditorError';\n }\n /**\n * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.\n * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case\n * of a {@link module:utils/ckeditorerror~CKEditorError} error.\n *\n * @param err The error to rethrow.\n * @param context An object connected through properties with the editor instance. This context will be used\n * by the watchdog to verify which editor should be restarted.\n */\n static rethrowUnexpectedError(err, context) {\n if (err.is && err.is('CKEditorError')) {\n throw err;\n }\n /**\n * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one\n * to make the debugging easier.\n *\n * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.\n * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.\n *\n * @error unexpected-error\n */\n const error = new CKEditorError(err.message, context);\n // Restore the original stack trace to make the error look like the original one.\n // See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.\n error.stack = err.stack;\n throw error;\n }\n}\n/**\n * Logs a warning to the console with a properly formatted message and adds a link to the documentation.\n * Use whenever you want to log a warning to the console.\n *\n * ```ts\n * /**\n * * There was a problem processing the configuration of the toolbar. The item with the given\n * * name does not exist, so it was omitted when rendering the toolbar.\n * *\n * * @error toolbarview-item-unavailable\n * * @param {String} name The name of the component.\n * *\\/\n * logWarning( 'toolbarview-item-unavailable', { name } );\n * ```\n *\n * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log\n * a warning or an error to the console.\n *\n * @param errorName The error name to be logged.\n * @param data Additional data to be logged.\n */\nexport function logWarning(errorName, data) {\n console.warn(...formatConsoleArguments(errorName, data));\n}\n/**\n * Logs an error to the console with a properly formatted message and adds a link to the documentation.\n * Use whenever you want to log an error to the console.\n *\n * ```ts\n * /**\n * * There was a problem processing the configuration of the toolbar. The item with the given\n * * name does not exist, so it was omitted when rendering the toolbar.\n * *\n * * @error toolbarview-item-unavailable\n * * @param {String} name The name of the component.\n * *\\/\n * logError( 'toolbarview-item-unavailable', { name } );\n * ```\n *\n * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.\n *\n * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.\n *\n * @param errorName The error name to be logged.\n * @param data Additional data to be logged.\n */\nexport function logError(errorName, data) {\n console.error(...formatConsoleArguments(errorName, data));\n}\n/**\n * Returns formatted link to documentation message.\n */\nfunction getLinkToDocumentationMessage(errorName) {\n return `\\nRead more: ${DOCUMENTATION_URL}#error-${errorName}`;\n}\n/**\n * Returns formatted error message.\n */\nfunction getErrorMessage(errorName, data) {\n const processedObjects = new WeakSet();\n const circularReferencesReplacer = (key, value) => {\n if (typeof value === 'object' && value !== null) {\n if (processedObjects.has(value)) {\n return `[object ${value.constructor.name}]`;\n }\n processedObjects.add(value);\n }\n return value;\n };\n const stringifiedData = data ? ` ${JSON.stringify(data, circularReferencesReplacer)}` : '';\n const documentationLink = getLinkToDocumentationMessage(errorName);\n return errorName + stringifiedData + documentationLink;\n}\n/**\n * Returns formatted console error arguments.\n */\nfunction formatConsoleArguments(errorName, data) {\n const documentationMessage = getLinkToDocumentationMessage(errorName);\n return data ? [errorName, data, documentationMessage] : [errorName, documentationMessage];\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/version\n */\nimport CKEditorError from './ckeditorerror.js';\nconst version = '43.0.0';\nexport default version;\n// The second argument is not a month. It is `monthIndex` and starts from `0`.\nexport const releaseDate = new Date(2024, 7, 7);\n/* istanbul ignore next -- @preserve */\nif (globalThis.CKEDITOR_VERSION) {\n /**\n * The best solution to avoid this error is migrating your CKEditor 5 instance to\n * {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}.\n *\n * Mentioned below are predefined builds, which are a deprecated installation method. The solutions\n * provided are kept here for legacy support only.\n *\n * This error is thrown when due to a mistake in how CKEditor 5 was installed or initialized, some\n * of its modules were duplicated (evaluated and executed twice). Module duplication leads to inevitable runtime\n * errors.\n *\n * There are many situations in which some modules can be loaded twice. In the worst case scenario,\n * you may need to check your project for each of these issues and fix them all.\n *\n * # Trying to add a plugin to an existing build\n *\n * If you import an existing CKEditor 5 build and a plugin like this:\n *\n * ```ts\n * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';\n * import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';\n * ```\n *\n * Then your project loads some CKEditor 5 packages twice. How does it happen?\n *\n * The build package contains a file which is already compiled with webpack. This means\n * that it contains all the necessary code from e.g. `@ckeditor/ckeditor5-engine` and `@ckeditor/ckeditor5-utils`.\n *\n * However, the `Highlight` plugin imports some of the modules from these packages, too. If you ask webpack to\n * build such a project, you will end up with the modules being included (and run) twice – first, because they are\n * included inside the build package, and second, because they are required by the `Highlight` plugin.\n *\n * Therefore, **you must never add plugins to an existing build** unless your plugin has no dependencies.\n *\n * Adding plugins to a build is done by taking the source version of this build (so, before it was built with webpack)\n * and adding plugins there. In this situation, webpack will know that it only needs to load each plugin once.\n *\n * # Confused an editor build with an editor implementation\n *\n * This scenario is very similar to the previous one, but has a different origin.\n *\n * Let's assume that you wanted to use CKEditor 5 from source.\n *\n * The correct way to do so is to import an editor and plugins and run them together like this:\n *\n * ```ts\n * import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';\n * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';\n * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';\n * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';\n * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';\n *\n * ClassicEditor\n * \t.create( document.querySelector( '#editor' ), {\n * \t\tplugins: [ Essentials, Paragraph, Bold, Italic ],\n * \t\ttoolbar: [ 'bold', 'italic' ]\n * \t} )\n * \t.then( editor => {\n * \t\tconsole.log( 'Editor was initialized', editor );\n * \t} )\n * \t.catch( error => {\n * \t\tconsole.error( error.stack );\n * \t} );\n * ```\n *\n * However, you might have mistakenly imported a build instead of the source `ClassicEditor`. In this case\n * your imports will look like this:\n *\n * ```ts\n * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';\n * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';\n * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';\n * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';\n * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';\n * ```\n *\n * This creates the same situation as in the previous section because you use a build together with source plugins.\n *\n * Remember: `@ckeditor/ckeditor5-build-*` packages contain editor builds and `@ckeditor/ckeditor5-editor-*` contain source editors.\n *\n * # Loading two or more builds on one page\n *\n * If you use CKEditor 5 builds, you might have loaded two (or more) `ckeditor.js` files on one web page.\n * Check your web page for duplicated `<script>` elements or make sure your page builder/bundler includes CKEditor only once.\n *\n * If you want to use two different types of editors at once, see the\n * {@glink getting-started/legacy/advanced/using-two-editors \"Using two different editors\"}\n * section.\n *\n * # Using outdated packages\n *\n * Building CKEditor 5 from source requires using multiple npm packages. These packages have their dependencies\n * to other packages. If you use the latest version of, for example, `@ckeditor/ckeditor5-editor-classic` with\n * an outdated version of `@ckeditor/ckeditor5-image`, npm or yarn will need to install two different versions of\n * `@ckeditor/ckeditor5-core` because `@ckeditor/ckeditor5-editor-classic` and `@ckeditor/ckeditor5-image` may require\n * different versions of the core package.\n *\n * The solution to this issue is to update all packages to their latest version. We recommend\n * using tools like [`npm-check-updates`](https://www.npmjs.com/package/npm-check-updates) which simplify this process.\n *\n * # Conflicting version of dependencies\n *\n * This is a special case of the previous scenario. If you use CKEditor 5 with some third-party plugins,\n * it may happen that even if you use the latest versions of the official packages and the latest version of\n * these third-party packages, there will be a conflict between some of their dependencies.\n *\n * Such a problem can be resolved by either downgrading CKEditor 5 packages (which we do not recommend) or\n * asking the author of the third-party package to upgrade its depdendencies (or forking their project and doing this yourself).\n *\n * **Note:** All official CKEditor 5 packages (excluding integrations and `ckeditor5-dev-*` packages) are released in the\n * same major version. This means that in the `x.y.z` version, the `x` is the same for all packages. This is the simplest way to check\n * whether you use packages coming from the same CKEditor 5 version. You can read more about versioning in the\n * {@glink updating/versioning-policy Versioning policy} guide.\n *\n * # Packages were duplicated in `node_modules`\n *\n * In some situations, especially when calling `npm install` multiple times, it may happen\n * that npm will not correctly \"deduplicate\" packages.\n *\n * Normally, npm deduplicates all packages so, for example, `@ckeditor/ckeditor5-core` is installed only once in `node_modules/`.\n * However, it is known to fail to do so from time to time.\n *\n * We recommend checking if any of the steps listed below help:\n *\n * * `rm -rf node_modules && npm install` to make sure you have a clean `node_modules/` directory. This step\n * is known to help in most cases.\n * * If you use `yarn.lock` or `package-lock.json`, remove it before `npm install`.\n * * Check whether all CKEditor 5 packages are up to date and reinstall them\n * if you changed anything (`rm -rf node_modules && npm install`).\n *\n * If all packages are correct and compatible with each other, the steps above are known to help. If not, you may\n * try to check with `npm ls` how many times packages like `@ckeditor/ckeditor5-core`, `@ckeditor/ckeditor5-engine` and\n *`@ckeditor/ckeditor5-utils` are installed. If more than once, verify which package causes that.\n *\n * @error ckeditor-duplicated-modules\n */\n throw new CKEditorError('ckeditor-duplicated-modules', null);\n}\nelse {\n globalThis.CKEDITOR_VERSION = version;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/emittermixin\n */\nimport EventInfo from './eventinfo.js';\nimport uid from './uid.js';\nimport priorities from './priorities.js';\nimport insertToPriorityArray from './inserttopriorityarray.js';\n// To check if component is loaded more than once.\nimport './version.js';\nimport CKEditorError from './ckeditorerror.js';\nconst _listeningTo = Symbol('listeningTo');\nconst _emitterId = Symbol('emitterId');\nconst _delegations = Symbol('delegations');\nconst defaultEmitterClass = /* #__PURE__ */ EmitterMixin(Object);\nexport default function EmitterMixin(base) {\n if (!base) {\n return defaultEmitterClass;\n }\n class Mixin extends base {\n on(event, callback, options) {\n this.listenTo(this, event, callback, options);\n }\n once(event, callback, options) {\n let wasFired = false;\n const onceCallback = (event, ...args) => {\n // Ensure the callback is called only once even if the callback itself leads to re-firing the event\n // (which would call the callback again).\n if (!wasFired) {\n wasFired = true;\n // Go off() at the first call.\n event.off();\n // Go with the original callback.\n callback.call(this, event, ...args);\n }\n };\n // Make a similar on() call, simply replacing the callback.\n this.listenTo(this, event, onceCallback, options);\n }\n off(event, callback) {\n this.stopListening(this, event, callback);\n }\n listenTo(emitter, event, callback, options = {}) {\n let emitterInfo, eventCallbacks;\n // _listeningTo contains a list of emitters that this object is listening to.\n // This list has the following format:\n //\n // _listeningTo: {\n // emitterId: {\n // emitter: emitter,\n // callbacks: {\n // event1: [ callback1, callback2, ... ]\n // ....\n // }\n // },\n // ...\n // }\n if (!this[_listeningTo]) {\n this[_listeningTo] = {};\n }\n const emitters = this[_listeningTo];\n if (!_getEmitterId(emitter)) {\n _setEmitterId(emitter);\n }\n const emitterId = _getEmitterId(emitter);\n if (!(emitterInfo = emitters[emitterId])) {\n emitterInfo = emitters[emitterId] = {\n emitter,\n callbacks: {}\n };\n }\n if (!(eventCallbacks = emitterInfo.callbacks[event])) {\n eventCallbacks = emitterInfo.callbacks[event] = [];\n }\n eventCallbacks.push(callback);\n // Finally register the callback to the event.\n addEventListener(this, emitter, event, callback, options);\n }\n stopListening(emitter, event, callback) {\n const emitters = this[_listeningTo];\n let emitterId = emitter && _getEmitterId(emitter);\n const emitterInfo = (emitters && emitterId) ? emitters[emitterId] : undefined;\n const eventCallbacks = (emitterInfo && event) ? emitterInfo.callbacks[event] : undefined;\n // Stop if nothing has been listened.\n if (!emitters || (emitter && !emitterInfo) || (event && !eventCallbacks)) {\n return;\n }\n // All params provided. off() that single callback.\n if (callback) {\n removeEventListener(this, emitter, event, callback);\n // We must remove callbacks as well in order to prevent memory leaks.\n // See https://github.com/ckeditor/ckeditor5/pull/8480\n const index = eventCallbacks.indexOf(callback);\n if (index !== -1) {\n if (eventCallbacks.length === 1) {\n delete emitterInfo.callbacks[event];\n }\n else {\n removeEventListener(this, emitter, event, callback);\n }\n }\n }\n // Only `emitter` and `event` provided. off() all callbacks for that event.\n else if (eventCallbacks) {\n while ((callback = eventCallbacks.pop())) {\n removeEventListener(this, emitter, event, callback);\n }\n delete emitterInfo.callbacks[event];\n }\n // Only `emitter` provided. off() all events for that emitter.\n else if (emitterInfo) {\n for (event in emitterInfo.callbacks) {\n this.stopListening(emitter, event);\n }\n delete emitters[emitterId];\n }\n // No params provided. off() all emitters.\n else {\n for (emitterId in emitters) {\n this.stopListening(emitters[emitterId].emitter);\n }\n delete this[_listeningTo];\n }\n }\n fire(eventOrInfo, ...args) {\n try {\n const eventInfo = eventOrInfo instanceof EventInfo ? eventOrInfo : new EventInfo(this, eventOrInfo);\n const event = eventInfo.name;\n let callbacks = getCallbacksForEvent(this, event);\n // Record that the event passed this emitter on its path.\n eventInfo.path.push(this);\n // Handle event listener callbacks first.\n if (callbacks) {\n // Arguments passed to each callback.\n const callbackArgs = [eventInfo, ...args];\n // Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks\n // are added while processing other callbacks. Previous solution involved adding counters (unique ids) but\n // failed if callbacks were added to the queue before currently processed callback.\n // If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same\n // event is currently processed. Then, `.fire()` at the end, would have to add all stored events.\n callbacks = Array.from(callbacks);\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i].callback.apply(this, callbackArgs);\n // Remove the callback from future requests if off() has been called.\n if (eventInfo.off.called) {\n // Remove the called mark for the next calls.\n delete eventInfo.off.called;\n this._removeEventListener(event, callbacks[i].callback);\n }\n // Do not execute next callbacks if stop() was called.\n if (eventInfo.stop.called) {\n break;\n }\n }\n }\n // Delegate event to other emitters if needed.\n const delegations = this[_delegations];\n if (delegations) {\n const destinations = delegations.get(event);\n const passAllDestinations = delegations.get('*');\n if (destinations) {\n fireDelegatedEvents(destinations, eventInfo, args);\n }\n if (passAllDestinations) {\n fireDelegatedEvents(passAllDestinations, eventInfo, args);\n }\n }\n return eventInfo.return;\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n delegate(...events) {\n return {\n to: (emitter, nameOrFunction) => {\n if (!this[_delegations]) {\n this[_delegations] = new Map();\n }\n // Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow\n // build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40.\n events.forEach(eventName => {\n const destinations = this[_delegations].get(eventName);\n if (!destinations) {\n this[_delegations].set(eventName, new Map([[emitter, nameOrFunction]]));\n }\n else {\n destinations.set(emitter, nameOrFunction);\n }\n });\n }\n };\n }\n stopDelegating(event, emitter) {\n if (!this[_delegations]) {\n return;\n }\n if (!event) {\n this[_delegations].clear();\n }\n else if (!emitter) {\n this[_delegations].delete(event);\n }\n else {\n const destinations = this[_delegations].get(event);\n if (destinations) {\n destinations.delete(emitter);\n }\n }\n }\n _addEventListener(event, callback, options) {\n createEventNamespace(this, event);\n const lists = getCallbacksListsForNamespace(this, event);\n const priority = priorities.get(options.priority);\n const callbackDefinition = {\n callback,\n priority\n };\n // Add the callback to all callbacks list.\n for (const callbacks of lists) {\n // Add the callback to the list in the right priority position.\n insertToPriorityArray(callbacks, callbackDefinition);\n }\n }\n _removeEventListener(event, callback) {\n const lists = getCallbacksListsForNamespace(this, event);\n for (const callbacks of lists) {\n for (let i = 0; i < callbacks.length; i++) {\n if (callbacks[i].callback == callback) {\n // Remove the callback from the list (fixing the next index).\n callbacks.splice(i, 1);\n i--;\n }\n }\n }\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`\n([\n 'on', 'once', 'off', 'listenTo',\n 'stopListening', 'fire', 'delegate', 'stopDelegating',\n '_addEventListener', '_removeEventListener'\n]).forEach(key => {\n EmitterMixin[key] = defaultEmitterClass.prototype[key];\n});\n/**\n * Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.\n * If not, returns `null`.\n *\n * @internal\n * @param listeningEmitter An emitter that listens.\n * @param listenedToEmitterId Unique emitter id of emitter listened to.\n */\nexport function _getEmitterListenedTo(listeningEmitter, listenedToEmitterId) {\n const listeningTo = listeningEmitter[_listeningTo];\n if (listeningTo && listeningTo[listenedToEmitterId]) {\n return listeningTo[listenedToEmitterId].emitter;\n }\n return null;\n}\n/**\n * Sets emitter's unique id.\n *\n * **Note:** `_emitterId` can be set only once.\n *\n * @internal\n * @param emitter An emitter for which id will be set.\n * @param id Unique id to set. If not passed, random unique id will be set.\n */\nexport function _setEmitterId(emitter, id) {\n if (!emitter[_emitterId]) {\n emitter[_emitterId] = id || uid();\n }\n}\n/**\n * Returns emitter's unique id.\n *\n * @internal\n * @param emitter An emitter which id will be returned.\n */\nexport function _getEmitterId(emitter) {\n return emitter[_emitterId];\n}\n/**\n * Gets the internal `_events` property of the given object.\n * `_events` property store all lists with callbacks for registered event names.\n * If there were no events registered on the object, empty `_events` object is created.\n */\nfunction getEvents(source) {\n if (!source._events) {\n Object.defineProperty(source, '_events', {\n value: {}\n });\n }\n return source._events;\n}\n/**\n * Creates event node for generic-specific events relation architecture.\n */\nfunction makeEventNode() {\n return {\n callbacks: [],\n childEvents: []\n };\n}\n/**\n * Creates an architecture for generic-specific events relation.\n * If needed, creates all events for given eventName, i.e. if the first registered event\n * is foo:bar:abc, it will create foo:bar:abc, foo:bar and foo event and tie them together.\n * It also copies callbacks from more generic events to more specific events when\n * specific events are created.\n */\nfunction createEventNamespace(source, eventName) {\n const events = getEvents(source);\n // First, check if the event we want to add to the structure already exists.\n if (events[eventName]) {\n // If it exists, we don't have to do anything.\n return;\n }\n // In other case, we have to create the structure for the event.\n // Note, that we might need to create intermediate events too.\n // I.e. if foo:bar:abc is being registered and we only have foo in the structure,\n // we need to also register foo:bar.\n // Currently processed event name.\n let name = eventName;\n // Name of the event that is a child event for currently processed event.\n let childEventName = null;\n // Array containing all newly created specific events.\n const newEventNodes = [];\n // While loop can't check for ':' index because we have to handle generic events too.\n // In each loop, we truncate event name, going from the most specific name to the generic one.\n // I.e. foo:bar:abc -> foo:bar -> foo.\n while (name !== '') {\n if (events[name]) {\n // If the currently processed event name is already registered, we can be sure\n // that it already has all the structure created, so we can break the loop here\n // as no more events need to be registered.\n break;\n }\n // If this event is not yet registered, create a new object for it.\n events[name] = makeEventNode();\n // Add it to the array with newly created events.\n newEventNodes.push(events[name]);\n // Add previously processed event name as a child of this event.\n if (childEventName) {\n events[name].childEvents.push(childEventName);\n }\n childEventName = name;\n // If `.lastIndexOf()` returns -1, `.substr()` will return '' which will break the loop.\n name = name.substr(0, name.lastIndexOf(':'));\n }\n if (name !== '') {\n // If name is not empty, we found an already registered event that was a parent of the\n // event we wanted to register.\n // Copy that event's callbacks to newly registered events.\n for (const node of newEventNodes) {\n node.callbacks = events[name].callbacks.slice();\n }\n // Add last newly created event to the already registered event.\n events[name].childEvents.push(childEventName);\n }\n}\n/**\n * Gets an array containing callbacks list for a given event and it's more specific events.\n * I.e. if given event is foo:bar and there is also foo:bar:abc event registered, this will\n * return callback list of foo:bar and foo:bar:abc (but not foo).\n */\nfunction getCallbacksListsForNamespace(source, eventName) {\n const eventNode = getEvents(source)[eventName];\n if (!eventNode) {\n return [];\n }\n let callbacksLists = [eventNode.callbacks];\n for (let i = 0; i < eventNode.childEvents.length; i++) {\n const childCallbacksLists = getCallbacksListsForNamespace(source, eventNode.childEvents[i]);\n callbacksLists = callbacksLists.concat(childCallbacksLists);\n }\n return callbacksLists;\n}\n/**\n * Get the list of callbacks for a given event, but only if there any callbacks have been registered.\n * If there are no callbacks registered for given event, it checks if this is a specific event and looks\n * for callbacks for it's more generic version.\n */\nfunction getCallbacksForEvent(source, eventName) {\n let event;\n if (!source._events || !(event = source._events[eventName]) || !event.callbacks.length) {\n // There are no callbacks registered for specified eventName.\n // But this could be a specific-type event that is in a namespace.\n if (eventName.indexOf(':') > -1) {\n // If the eventName is specific, try to find callback lists for more generic event.\n return getCallbacksForEvent(source, eventName.substr(0, eventName.lastIndexOf(':')));\n }\n else {\n // If this is a top-level generic event, return null;\n return null;\n }\n }\n return event.callbacks;\n}\n/**\n * Fires delegated events for given map of destinations.\n *\n * @param destinations A map containing `[ {@link module:utils/emittermixin~Emitter}, \"event name\" ]` pair destinations.\n * @param eventInfo The original event info object.\n * @param fireArgs Arguments the original event was fired with.\n */\nfunction fireDelegatedEvents(destinations, eventInfo, fireArgs) {\n for (let [emitter, name] of destinations) {\n if (!name) {\n name = eventInfo.name;\n }\n else if (typeof name == 'function') {\n name = name(eventInfo.name);\n }\n const delegatedInfo = new EventInfo(eventInfo.source, name);\n delegatedInfo.path = [...eventInfo.path];\n emitter.fire(delegatedInfo, ...fireArgs);\n }\n}\n/**\n * Helper for registering event callback on the emitter.\n */\nfunction addEventListener(listener, emitter, event, callback, options) {\n if (emitter._addEventListener) {\n emitter._addEventListener(event, callback, options);\n }\n else {\n // Allow listening on objects that do not implement Emitter interface.\n // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.\n (listener._addEventListener).call(emitter, event, callback, options);\n }\n}\n/**\n * Helper for removing event callback from the emitter.\n */\nfunction removeEventListener(listener, emitter, event, callback) {\n if (emitter._removeEventListener) {\n emitter._removeEventListener(event, callback);\n }\n else {\n // Allow listening on objects that do not implement Emitter interface.\n // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.\n listener._removeEventListener.call(emitter, event, callback);\n }\n}\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable @typescript-eslint/unified-signatures */\n/**\n * @module utils/observablemixin\n */\nimport EmitterMixin from './emittermixin.js';\nimport CKEditorError from './ckeditorerror.js';\nimport { isObject } from 'lodash-es';\nconst observablePropertiesSymbol = Symbol('observableProperties');\nconst boundObservablesSymbol = Symbol('boundObservables');\nconst boundPropertiesSymbol = Symbol('boundProperties');\nconst decoratedMethods = Symbol('decoratedMethods');\nconst decoratedOriginal = Symbol('decoratedOriginal');\nconst defaultObservableClass = /* #__PURE__ */ ObservableMixin(/* #__PURE__ */ EmitterMixin());\nexport default function ObservableMixin(base) {\n if (!base) {\n return defaultObservableClass;\n }\n class Mixin extends base {\n set(name, value) {\n // If the first parameter is an Object, iterate over its properties.\n if (isObject(name)) {\n Object.keys(name).forEach(property => {\n this.set(property, name[property]);\n }, this);\n return;\n }\n initObservable(this);\n const properties = this[observablePropertiesSymbol];\n if ((name in this) && !properties.has(name)) {\n /**\n * Cannot override an existing property.\n *\n * This error is thrown when trying to {@link module:utils/observablemixin~Observable#set set} a property with\n * a name of an already existing property. For example:\n *\n * ```ts\n * let observable = new Model();\n * observable.property = 1;\n * observable.set( 'property', 2 );\t\t\t// throws\n *\n * observable.set( 'property', 1 );\n * observable.set( 'property', 2 );\t\t\t// ok, because this is an existing property.\n * ```\n *\n * @error observable-set-cannot-override\n */\n throw new CKEditorError('observable-set-cannot-override', this);\n }\n Object.defineProperty(this, name, {\n enumerable: true,\n configurable: true,\n get() {\n return properties.get(name);\n },\n set(value) {\n const oldValue = properties.get(name);\n // Fire `set` event before the new value will be set to make it possible\n // to override observable property without affecting `change` event.\n // See https://github.com/ckeditor/ckeditor5-utils/issues/171.\n let newValue = this.fire(`set:${name}`, name, value, oldValue);\n if (newValue === undefined) {\n newValue = value;\n }\n // Allow undefined as an initial value like A.define( 'x', undefined ) (#132).\n // Note: When properties map has no such own property, then its value is undefined.\n if (oldValue !== newValue || !properties.has(name)) {\n properties.set(name, newValue);\n this.fire(`change:${name}`, name, newValue, oldValue);\n }\n }\n });\n this[name] = value;\n }\n bind(...bindProperties) {\n if (!bindProperties.length || !isStringArray(bindProperties)) {\n /**\n * All properties must be strings.\n *\n * @error observable-bind-wrong-properties\n */\n throw new CKEditorError('observable-bind-wrong-properties', this);\n }\n if ((new Set(bindProperties)).size !== bindProperties.length) {\n /**\n * Properties must be unique.\n *\n * @error observable-bind-duplicate-properties\n */\n throw new CKEditorError('observable-bind-duplicate-properties', this);\n }\n initObservable(this);\n const boundProperties = this[boundPropertiesSymbol];\n bindProperties.forEach(propertyName => {\n if (boundProperties.has(propertyName)) {\n /**\n * Cannot bind the same property more than once.\n *\n * @error observable-bind-rebind\n */\n throw new CKEditorError('observable-bind-rebind', this);\n }\n });\n const bindings = new Map();\n bindProperties.forEach(a => {\n const binding = { property: a, to: [] };\n boundProperties.set(a, binding);\n bindings.set(a, binding);\n });\n return {\n to: bindTo,\n toMany: bindToMany,\n _observable: this,\n _bindProperties: bindProperties,\n _to: [],\n _bindings: bindings\n };\n }\n unbind(...unbindProperties) {\n // Nothing to do here if not inited yet.\n if (!(this[observablePropertiesSymbol])) {\n return;\n }\n const boundProperties = this[boundPropertiesSymbol];\n const boundObservables = this[boundObservablesSymbol];\n if (unbindProperties.length) {\n if (!isStringArray(unbindProperties)) {\n /**\n * Properties must be strings.\n *\n * @error observable-unbind-wrong-properties\n */\n throw new CKEditorError('observable-unbind-wrong-properties', this);\n }\n unbindProperties.forEach(propertyName => {\n const binding = boundProperties.get(propertyName);\n // Nothing to do if the binding is not defined\n if (!binding) {\n return;\n }\n binding.to.forEach(([toObservable, toProperty]) => {\n const toProperties = boundObservables.get(toObservable);\n const toPropertyBindings = toProperties[toProperty];\n toPropertyBindings.delete(binding);\n if (!toPropertyBindings.size) {\n delete toProperties[toProperty];\n }\n if (!Object.keys(toProperties).length) {\n boundObservables.delete(toObservable);\n this.stopListening(toObservable, 'change');\n }\n });\n boundProperties.delete(propertyName);\n });\n }\n else {\n boundObservables.forEach((bindings, boundObservable) => {\n this.stopListening(boundObservable, 'change');\n });\n boundObservables.clear();\n boundProperties.clear();\n }\n }\n decorate(methodName) {\n initObservable(this);\n const originalMethod = this[methodName];\n if (!originalMethod) {\n /**\n * Cannot decorate an undefined method.\n *\n * @error observablemixin-cannot-decorate-undefined\n * @param {Object} object The object which method should be decorated.\n * @param {String} methodName Name of the method which does not exist.\n */\n throw new CKEditorError('observablemixin-cannot-decorate-undefined', this, { object: this, methodName });\n }\n this.on(methodName, (evt, args) => {\n evt.return = originalMethod.apply(this, args);\n });\n this[methodName] = function (...args) {\n return this.fire(methodName, args);\n };\n this[methodName][decoratedOriginal] = originalMethod;\n if (!this[decoratedMethods]) {\n this[decoratedMethods] = [];\n }\n this[decoratedMethods].push(methodName);\n }\n // Override the EmitterMixin stopListening method to be able to clean (and restore) decorated methods.\n // This is needed in case of:\n // 1. Have x.foo() decorated.\n // 2. Call x.stopListening()\n // 3. Call x.foo(). Problem: nothing happens (the original foo() method is not executed)\n stopListening(emitter, event, callback) {\n // Removing all listeners so let's clean the decorated methods to the original state.\n if (!emitter && this[decoratedMethods]) {\n for (const methodName of this[decoratedMethods]) {\n this[methodName] = this[methodName][decoratedOriginal];\n }\n delete this[decoratedMethods];\n }\n super.stopListening(emitter, event, callback);\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`\n([\n 'set', 'bind', 'unbind', 'decorate',\n 'on', 'once', 'off', 'listenTo',\n 'stopListening', 'fire', 'delegate', 'stopDelegating',\n '_addEventListener', '_removeEventListener'\n]).forEach(key => {\n ObservableMixin[key] = defaultObservableClass.prototype[key];\n});\n// Init symbol properties needed for the observable mechanism to work.\nfunction initObservable(observable) {\n // Do nothing if already inited.\n if (observable[observablePropertiesSymbol]) {\n return;\n }\n // The internal hash containing the observable's state.\n Object.defineProperty(observable, observablePropertiesSymbol, {\n value: new Map()\n });\n // Map containing bindings to external observables. It shares the binding objects\n // (`{ observable: A, property: 'a', to: ... }`) with {@link module:utils/observablemixin~Observable#_boundProperties} and\n // it is used to observe external observables to update own properties accordingly.\n // See {@link module:utils/observablemixin~Observable#bind}.\n //\n //\t\tA.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );\n //\t\tconsole.log( A._boundObservables );\n //\n //\t\t\tMap( {\n //\t\t\t\tB: {\n //\t\t\t\t\tx: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\t\t\t{ observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t\t\t] ),\n //\t\t\t\t\ty: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\t\t] )\n //\t\t\t\t}\n //\t\t\t} )\n //\n //\t\tA.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );\n //\t\tconsole.log( A._boundObservables );\n //\n //\t\t\tMap( {\n //\t\t\t\tB: {\n //\t\t\t\t\tx: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\t\t\t{ observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t\t\t] ),\n //\t\t\t\t\ty: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\t\t] ),\n //\t\t\t\t\tz: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t\t\t] )\n //\t\t\t\t},\n //\t\t\t\tC: {\n //\t\t\t\t\tw: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t\t\t] )\n //\t\t\t\t}\n //\t\t\t} )\n //\n Object.defineProperty(observable, boundObservablesSymbol, {\n value: new Map()\n });\n // Object that stores which properties of this observable are bound and how. It shares\n // the binding objects (`{ observable: A, property: 'a', to: ... }`) with\n // {@link module:utils/observablemixin~Observable#_boundObservables}. This data structure is\n // a reverse of {@link module:utils/observablemixin~Observable#_boundObservables} and it is helpful for\n // {@link module:utils/observablemixin~Observable#unbind}.\n //\n // See {@link module:utils/observablemixin~Observable#bind}.\n //\n //\t\tA.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );\n //\t\tconsole.log( A._boundProperties );\n //\n //\t\t\tMap( {\n //\t\t\t\ta: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\tb: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\tc: { observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t} )\n //\n //\t\tA.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );\n //\t\tconsole.log( A._boundProperties );\n //\n //\t\t\tMap( {\n //\t\t\t\ta: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\tb: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\tc: { observable: A, property: 'c', to: [ [ B, 'x' ] ] },\n //\t\t\t\td: { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t} )\n Object.defineProperty(observable, boundPropertiesSymbol, {\n value: new Map()\n });\n}\n/**\n * A chaining for {@link module:utils/observablemixin~Observable#bind} providing `.to()` interface.\n *\n * @param args Arguments of the `.to( args )` binding.\n */\nfunction bindTo(...args) {\n const parsedArgs = parseBindToArgs(...args);\n const bindingsKeys = Array.from(this._bindings.keys());\n const numberOfBindings = bindingsKeys.length;\n // Eliminate A.bind( 'x' ).to( B, C )\n if (!parsedArgs.callback && parsedArgs.to.length > 1) {\n /**\n * Binding multiple observables only possible with callback.\n *\n * @error observable-bind-to-no-callback\n */\n throw new CKEditorError('observable-bind-to-no-callback', this);\n }\n // Eliminate A.bind( 'x', 'y' ).to( B, callback )\n if (numberOfBindings > 1 && parsedArgs.callback) {\n /**\n * Cannot bind multiple properties and use a callback in one binding.\n *\n * @error observable-bind-to-extra-callback\n */\n throw new CKEditorError('observable-bind-to-extra-callback', this);\n }\n parsedArgs.to.forEach(to => {\n // Eliminate A.bind( 'x', 'y' ).to( B, 'a' )\n if (to.properties.length && to.properties.length !== numberOfBindings) {\n /**\n * The number of properties must match.\n *\n * @error observable-bind-to-properties-length\n */\n throw new CKEditorError('observable-bind-to-properties-length', this);\n }\n // When no to.properties specified, observing source properties instead i.e.\n // A.bind( 'x', 'y' ).to( B ) -> Observe B.x and B.y\n if (!to.properties.length) {\n to.properties = this._bindProperties;\n }\n });\n this._to = parsedArgs.to;\n // Fill {@link BindChain#_bindings} with callback. When the callback is set there's only one binding.\n if (parsedArgs.callback) {\n this._bindings.get(bindingsKeys[0]).callback = parsedArgs.callback;\n }\n attachBindToListeners(this._observable, this._to);\n // Update observable._boundProperties and observable._boundObservables.\n updateBindToBound(this);\n // Set initial values of bound properties.\n this._bindProperties.forEach(propertyName => {\n updateBoundObservableProperty(this._observable, propertyName);\n });\n}\n/**\n * Binds to an attribute in a set of iterable observables.\n */\nfunction bindToMany(observables, attribute, callback) {\n if (this._bindings.size > 1) {\n /**\n * Binding one attribute to many observables only possible with one attribute.\n *\n * @error observable-bind-to-many-not-one-binding\n */\n throw new CKEditorError('observable-bind-to-many-not-one-binding', this);\n }\n this.to(\n // Bind to #attribute of each observable...\n ...getBindingTargets(observables, attribute), \n // ...using given callback to parse attribute values.\n callback);\n}\n/**\n * Returns an array of binding components for\n * {@link Observable#bind} from a set of iterable observables.\n */\nfunction getBindingTargets(observables, attribute) {\n const observableAndAttributePairs = observables.map(observable => [observable, attribute]);\n // Merge pairs to one-dimension array of observables and attributes.\n return Array.prototype.concat.apply([], observableAndAttributePairs);\n}\n/**\n * Check if all entries of the array are of `String` type.\n */\nfunction isStringArray(arr) {\n return arr.every(a => typeof a == 'string');\n}\n/**\n * Parses and validates {@link Observable#bind}`.to( args )` arguments and returns\n * an object with a parsed structure. For example\n *\n * ```ts\n * A.bind( 'x' ).to( B, 'a', C, 'b', call );\n * ```\n *\n * becomes\n *\n * ```ts\n * {\n * \tto: [\n * \t\t{ observable: B, properties: [ 'a' ] },\n * \t\t{ observable: C, properties: [ 'b' ] },\n * \t],\n * \tcallback: call\n * }\n *\n * @param args Arguments of {@link Observable#bind}`.to( args )`.\n */\nfunction parseBindToArgs(...args) {\n // Eliminate A.bind( 'x' ).to()\n if (!args.length) {\n /**\n * Invalid argument syntax in `to()`.\n *\n * @error observable-bind-to-parse-error\n */\n throw new CKEditorError('observable-bind-to-parse-error', null);\n }\n const parsed = { to: [] };\n let lastObservable;\n if (typeof args[args.length - 1] == 'function') {\n parsed.callback = args.pop();\n }\n args.forEach(a => {\n if (typeof a == 'string') {\n lastObservable.properties.push(a);\n }\n else if (typeof a == 'object') {\n lastObservable = { observable: a, properties: [] };\n parsed.to.push(lastObservable);\n }\n else {\n throw new CKEditorError('observable-bind-to-parse-error', null);\n }\n });\n return parsed;\n}\n/**\n * Synchronizes {@link module:utils/observable#_boundObservables} with {@link Binding}.\n *\n * @param binding A binding to store in {@link Observable#_boundObservables}.\n * @param toObservable A observable, which is a new component of `binding`.\n * @param toPropertyName A name of `toObservable`'s property, a new component of the `binding`.\n */\nfunction updateBoundObservables(observable, binding, toObservable, toPropertyName) {\n const boundObservables = observable[boundObservablesSymbol];\n const bindingsToObservable = boundObservables.get(toObservable);\n const bindings = bindingsToObservable || {};\n if (!bindings[toPropertyName]) {\n bindings[toPropertyName] = new Set();\n }\n // Pass the binding to a corresponding Set in `observable._boundObservables`.\n bindings[toPropertyName].add(binding);\n if (!bindingsToObservable) {\n boundObservables.set(toObservable, bindings);\n }\n}\n/**\n * Synchronizes {@link Observable#_boundProperties} and {@link Observable#_boundObservables}\n * with {@link BindChain}.\n *\n * Assuming the following binding being created\n *\n * ```ts\n * A.bind( 'a', 'b' ).to( B, 'x', 'y' );\n * ```\n *\n * the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:\n *\n * ```ts\n * {\n * \ta: { observable: A, property: 'a', to: [] },\n * \tb: { observable: A, property: 'b', to: [] },\n * }\n * ```\n *\n * Iterate over all bindings in this chain and fill their `to` properties with\n * corresponding to( ... ) arguments (components of the binding), so\n *\n * ```ts\n * {\n * \ta: { observable: A, property: 'a', to: [ B, 'x' ] },\n * \tb: { observable: A, property: 'b', to: [ B, 'y' ] },\n * }\n * ```\n *\n * Then update the structure of {@link Observable#_boundObservables} with updated\n * binding, so it becomes:\n *\n * ```ts\n * Map( {\n * \tB: {\n * \t\tx: Set( [\n * \t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] }\n * \t\t] ),\n * \t\ty: Set( [\n * \t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n * \t\t] )\n * \t}\n * } )\n * ```\n *\n * @param chain The binding initialized by {@link Observable#bind}.\n */\nfunction updateBindToBound(chain) {\n let toProperty;\n chain._bindings.forEach((binding, propertyName) => {\n // Note: For a binding without a callback, this will run only once\n // like in A.bind( 'x', 'y' ).to( B, 'a', 'b' )\n // TODO: ES6 destructuring.\n chain._to.forEach(to => {\n toProperty = to.properties[binding.callback ? 0 : chain._bindProperties.indexOf(propertyName)];\n binding.to.push([to.observable, toProperty]);\n updateBoundObservables(chain._observable, binding, to.observable, toProperty);\n });\n });\n}\n/**\n * Updates an property of a {@link Observable} with a value\n * determined by an entry in {@link Observable#_boundProperties}.\n *\n * @param observable A observable which property is to be updated.\n * @param propertyName An property to be updated.\n */\nfunction updateBoundObservableProperty(observable, propertyName) {\n const boundProperties = observable[boundPropertiesSymbol];\n const binding = boundProperties.get(propertyName);\n let propertyValue;\n // When a binding with callback is created like\n //\n // \t\tA.bind( 'a' ).to( B, 'b', C, 'c', callback );\n //\n // collect B.b and C.c, then pass them to callback to set A.a.\n if (binding.callback) {\n propertyValue = binding.callback.apply(observable, binding.to.map(to => to[0][to[1]]));\n }\n else {\n propertyValue = binding.to[0];\n propertyValue = propertyValue[0][propertyValue[1]];\n }\n if (Object.prototype.hasOwnProperty.call(observable, propertyName)) {\n observable[propertyName] = propertyValue;\n }\n else {\n observable.set(propertyName, propertyValue);\n }\n}\n/**\n * Starts listening to changes in {@link BindChain._to} observables to update\n * {@link BindChain._observable} {@link BindChain._bindProperties}. Also sets the\n * initial state of {@link BindChain._observable}.\n *\n * @param chain The chain initialized by {@link Observable#bind}.\n */\nfunction attachBindToListeners(observable, toBindings) {\n toBindings.forEach(to => {\n const boundObservables = observable[boundObservablesSymbol];\n let bindings;\n // If there's already a chain between the observables (`observable` listens to\n // `to.observable`), there's no need to create another `change` event listener.\n if (!boundObservables.get(to.observable)) {\n observable.listenTo(to.observable, 'change', (evt, propertyName) => {\n bindings = boundObservables.get(to.observable)[propertyName];\n // Note: to.observable will fire for any property change, react\n // to changes of properties which are bound only.\n if (bindings) {\n bindings.forEach(binding => {\n updateBoundObservableProperty(observable, binding.property);\n });\n }\n });\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/count\n */\n/**\n * Returns the number of items return by the iterator.\n *\n * ```ts\n * count( [ 1, 2, 3, 4, 5 ] ); // 5;\n * ```\n *\n * @param iterable Any iterable.\n * @returns Number of items returned by that iterable.\n */\nexport default function count(iterable) {\n let count = 0;\n for (const _ of iterable) { // eslint-disable-line no-unused-vars\n count++;\n }\n return count;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/comparearrays\n */\n/**\n * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array\n * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,\n * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned\n * it means that arrays differ.\n *\n * ```ts\n * compareArrays( [ 0, 2 ], [ 0, 2 ] );\t\t// 'same'\n * compareArrays( [ 0, 2 ], [ 0, 2, 1 ] );\t\t// 'prefix'\n * compareArrays( [ 0, 2 ], [ 0 ] );\t\t\t// 'extension'\n * compareArrays( [ 0, 2 ], [ 1, 2 ] );\t\t// 0\n * compareArrays( [ 0, 2 ], [ 0, 1 ] );\t\t// 1\n * ```\n *\n * @param a Array that is compared.\n * @param b Array to compare with.\n * @returns How array `a` is related to `b`.\n */\nexport default function compareArrays(a, b) {\n const minLen = Math.min(a.length, b.length);\n for (let i = 0; i < minLen; i++) {\n if (a[i] != b[i]) {\n // The arrays are different.\n return i;\n }\n }\n // Both arrays were same at all points.\n if (a.length == b.length) {\n // If their length is also same, they are the same.\n return 'same';\n }\n else if (a.length < b.length) {\n // Compared array is shorter so it is a prefix of the other array.\n return 'prefix';\n }\n else {\n // Compared array is longer so it is an extension of the other array.\n return 'extension';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/isiterable\n */\n/**\n * Checks if value implements iterator interface.\n *\n * @param value The value to check.\n * @returns True if value implements iterator interface.\n */\nexport default function isIterable(value) {\n return !!(value && value[Symbol.iterator]);\n}\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isArray from './isArray.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nexport default isString;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/createelement\n */\nimport isIterable from '../isiterable.js';\nimport { isString } from 'lodash-es';\n/**\n * Creates an HTML or SVG element with attributes and children elements.\n *\n * ```ts\n * createElement( document, 'p' ); // <p>\n * createElement( document, 'mask', { xmlns: 'http://www.w3.org/2000/svg' } ); // <mask>\n * ```\n *\n * @param doc Document used to create the element.\n * @param name Name of the element.\n * @param attributes Object where keys represent attribute keys and values represent attribute values.\n * @param children Child or any iterable of children. Strings will be automatically turned into Text nodes.\n * @returns HTML or SVG element.\n */\nexport default function createElement(doc, name, attributes = {}, children = []) {\n const namespace = attributes && attributes.xmlns;\n const element = namespace ? doc.createElementNS(namespace, name) : doc.createElement(name);\n for (const key in attributes) {\n element.setAttribute(key, attributes[key]);\n }\n if (isString(children) || !isIterable(children)) {\n children = [children];\n }\n for (let child of children) {\n if (isString(child)) {\n child = doc.createTextNode(child);\n }\n element.appendChild(child);\n }\n return element;\n}\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\nfunction cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n}\n\nexport default cloneDeepWith;\n","import isObjectLike from './isObjectLike.js';\nimport isPlainObject from './isPlainObject.js';\n\n/**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('<body>');\n * // => false\n */\nfunction isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n}\n\nexport default isElement;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/config\n */\nimport { isPlainObject, isElement, cloneDeepWith } from 'lodash-es';\n/**\n * Handles a configuration dictionary.\n *\n * @typeParam Cfg A type of the configuration dictionary.\n */\nexport default class Config {\n /**\n * Creates an instance of the {@link ~Config} class.\n *\n * @param configurations The initial configurations to be set. Usually, provided by the user.\n * @param defaultConfigurations The default configurations. Usually, provided by the system.\n */\n constructor(configurations, defaultConfigurations) {\n this._config = {};\n // Set default configuration.\n if (defaultConfigurations) {\n // Clone the configuration to make sure that the properties will not be shared\n // between editors and make the watchdog feature work correctly.\n this.define(cloneConfig(defaultConfigurations));\n }\n // Set initial configuration.\n if (configurations) {\n this._setObjectToTarget(this._config, configurations);\n }\n }\n set(name, value) {\n this._setToTarget(this._config, name, value);\n }\n define(name, value) {\n const isDefine = true;\n this._setToTarget(this._config, name, value, isDefine);\n }\n /**\n * Gets the value for a configuration entry.\n *\n * ```ts\n * config.get( 'name' );\n * ```\n *\n * Deep configurations can be retrieved by separating each part with a dot.\n *\n * ```ts\n * config.get( 'toolbar.collapsed' );\n * ```\n *\n * @param name The configuration name. Configuration names are case-sensitive.\n * @returns The configuration value or `undefined` if the configuration entry was not found.\n */\n get(name) {\n return this._getFromSource(this._config, name);\n }\n /**\n * Iterates over all top level configuration names.\n */\n *names() {\n for (const name of Object.keys(this._config)) {\n yield name;\n }\n }\n /**\n * Saves passed configuration to the specified target (nested object).\n *\n * @param target Nested config object.\n * @param name The configuration name or an object from which take properties as\n * configuration entries. Configuration names are case-sensitive.\n * @param value The configuration value. Used if a name is passed.\n * @param isDefine Define if passed configuration should overwrite existing one.\n */\n _setToTarget(target, name, value, isDefine = false) {\n // In case of an object, iterate through it and call `_setToTarget` again for each property.\n if (isPlainObject(name)) {\n this._setObjectToTarget(target, name, isDefine);\n return;\n }\n // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].\n const parts = name.split('.');\n // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.\n name = parts.pop();\n // Iterate over parts to check if currently stored configuration has proper structure.\n for (const part of parts) {\n // If there is no object for specified part then create one.\n if (!isPlainObject(target[part])) {\n target[part] = {};\n }\n // Nested object becomes a target.\n target = target[part];\n }\n // In case of value is an object.\n if (isPlainObject(value)) {\n // We take care of proper config structure.\n if (!isPlainObject(target[name])) {\n target[name] = {};\n }\n target = target[name];\n // And iterate through this object calling `_setToTarget` again for each property.\n this._setObjectToTarget(target, value, isDefine);\n return;\n }\n // Do nothing if we are defining configuration for non empty name.\n if (isDefine && typeof target[name] != 'undefined') {\n return;\n }\n target[name] = value;\n }\n /**\n * Get specified configuration from specified source (nested object).\n *\n * @param source level of nested object.\n * @param name The configuration name. Configuration names are case-sensitive.\n * @returns The configuration value or `undefined` if the configuration entry was not found.\n */\n _getFromSource(source, name) {\n // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].\n const parts = name.split('.');\n // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.\n name = parts.pop();\n // Iterate over parts to check if currently stored configuration has proper structure.\n for (const part of parts) {\n if (!isPlainObject(source[part])) {\n source = null;\n break;\n }\n // Nested object becomes a source.\n source = source[part];\n }\n // Always returns undefined for non existing configuration.\n return source ? cloneConfig(source[name]) : undefined;\n }\n /**\n * Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.\n *\n * @param target Nested config object.\n * @param configuration Configuration data set\n * @param isDefine Defines if passed configuration is default configuration or not.\n */\n _setObjectToTarget(target, configuration, isDefine) {\n Object.keys(configuration).forEach(key => {\n this._setToTarget(target, key, configuration[key], isDefine);\n });\n }\n}\n/**\n * Clones configuration object or value.\n */\nfunction cloneConfig(source) {\n return cloneDeepWith(source, leaveItemReferences);\n}\n/**\n * A customized function for cloneDeepWith.\n * In case if it's a DOM Element it will leave references to DOM Elements instead of cloning them.\n * If it's a function it will leave reference to actuall function.\n */\nfunction leaveItemReferences(value) {\n return isElement(value) || typeof value === 'function' ? value : undefined;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/isnode\n */\n/**\n * Checks if the object is a native DOM Node.\n */\nexport default function isNode(obj) {\n if (obj) {\n if (obj.defaultView) {\n return obj instanceof obj.defaultView.Document;\n }\n else if (obj.ownerDocument && obj.ownerDocument.defaultView) {\n return obj instanceof obj.ownerDocument.defaultView.Node;\n }\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/iswindow\n */\n/**\n * Checks if the object is a native DOM Window.\n */\nexport default function isWindow(obj) {\n const stringifiedObject = Object.prototype.toString.apply(obj);\n // Returns `true` for the `window` object in browser environments.\n if (stringifiedObject == '[object Window]') {\n return true;\n }\n // Returns `true` for the `window` object in the Electron environment.\n if (stringifiedObject == '[object global]') {\n return true;\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/emittermixin\n */\nimport EmitterMixin, { _getEmitterListenedTo, _setEmitterId } from '../emittermixin.js';\nimport uid from '../uid.js';\nimport isNode from './isnode.js';\nimport isWindow from './iswindow.js';\nconst defaultEmitterClass = /* #__PURE__ */ DomEmitterMixin(/* #__PURE__ */ EmitterMixin());\nexport default function DomEmitterMixin(base) {\n if (!base) {\n return defaultEmitterClass;\n }\n class Mixin extends base {\n listenTo(emitter, event, callback, options = {}) {\n // Check if emitter is an instance of DOM Node. If so, use corresponding ProxyEmitter (or create one if not existing).\n if (isNode(emitter) || isWindow(emitter)) {\n const proxyOptions = {\n capture: !!options.useCapture,\n passive: !!options.usePassive\n };\n const proxyEmitter = this._getProxyEmitter(emitter, proxyOptions) || new ProxyEmitter(emitter, proxyOptions);\n this.listenTo(proxyEmitter, event, callback, options);\n }\n else {\n // Execute parent class method with Emitter (or ProxyEmitter) instance.\n super.listenTo(emitter, event, callback, options);\n }\n }\n stopListening(emitter, event, callback) {\n // Check if the emitter is an instance of DOM Node. If so, forward the call to the corresponding ProxyEmitters.\n if (isNode(emitter) || isWindow(emitter)) {\n const proxyEmitters = this._getAllProxyEmitters(emitter);\n for (const proxy of proxyEmitters) {\n this.stopListening(proxy, event, callback);\n }\n }\n else {\n // Execute parent class method with Emitter (or ProxyEmitter) instance.\n super.stopListening(emitter, event, callback);\n }\n }\n /**\n * Retrieves ProxyEmitter instance for given DOM Node residing in this Host and given options.\n *\n * @param node DOM Node of the ProxyEmitter.\n * @param options Additional options.\n * @param options.useCapture Indicates that events of this type will be dispatched to the registered\n * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n * @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n * and prevents blocking browser's main thread by this event handler.\n * @returns ProxyEmitter instance bound to the DOM Node.\n */\n _getProxyEmitter(node, options) {\n return _getEmitterListenedTo(this, getProxyEmitterId(node, options));\n }\n /**\n * Retrieves all the ProxyEmitter instances for given DOM Node residing in this Host.\n *\n * @param node DOM Node of the ProxyEmitter.\n */\n _getAllProxyEmitters(node) {\n return [\n { capture: false, passive: false },\n { capture: false, passive: true },\n { capture: true, passive: false },\n { capture: true, passive: true }\n ].map(options => this._getProxyEmitter(node, options)).filter(proxy => !!proxy);\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`\n([\n '_getProxyEmitter', '_getAllProxyEmitters',\n 'on', 'once', 'off', 'listenTo',\n 'stopListening', 'fire', 'delegate', 'stopDelegating',\n '_addEventListener', '_removeEventListener'\n]).forEach(key => {\n DomEmitterMixin[key] = defaultEmitterClass.prototype[key];\n});\n/**\n * Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events\n * and any Host listening to them. It is backwards compatible with {@link module:utils/emittermixin~Emitter#on}.\n * There is a separate instance for each combination of modes (useCapture & usePassive). The mode is concatenated with\n * UID stored in HTMLElement to give each instance unique identifier.\n *\n * listenTo( click, ... )\n * +-----------------------------------------+\n * | stopListening( ... ) |\n * +----------------------------+ | addEventListener( click, ... )\n * | Host | | +---------------------------------------------+\n * +----------------------------+ | | removeEventListener( click, ... ) |\n * | _listeningTo: { | +----------v-------------+ |\n * | UID+mode: { | | ProxyEmitter | |\n * | emitter: ProxyEmitter, | +------------------------+ +------------v----------+\n * | callbacks: { | | events: { | | Node (HTMLElement) |\n * | click: [ callbacks ] | | click: [ callbacks ] | +-----------------------+\n * | } | | }, | | data-ck-expando: UID |\n * | } | | _domNode: Node, | +-----------------------+\n * | } | | _domListeners: {}, | |\n * | +------------------------+ | | _emitterId: UID+mode | |\n * | | DomEmitterMixin | | +--------------^---------+ |\n * | +------------------------+ | | | |\n * +--------------^-------------+ | +---------------------------------------------+\n * | | click (DOM Event)\n * +-----------------------------------------+\n * fire( click, DOM Event )\n */\nclass ProxyEmitter extends /* #__PURE__ */ EmitterMixin() {\n /**\n * @param node DOM Node that fires events.\n * @param options Additional options.\n * @param options.useCapture Indicates that events of this type will be dispatched to the registered\n * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n * @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n * and prevents blocking browser's main thread by this event handler.\n */\n constructor(node, options) {\n super();\n // Set emitter ID to match DOM Node \"expando\" property.\n _setEmitterId(this, getProxyEmitterId(node, options));\n // Remember the DOM Node this ProxyEmitter is bound to.\n this._domNode = node;\n // And given options.\n this._options = options;\n }\n /**\n * Registers a callback function to be executed when an event is fired.\n *\n * It attaches a native DOM listener to the DOM Node. When fired,\n * a corresponding Emitter event will also fire with DOM Event object as an argument.\n *\n * **Note**: This is automatically called by the\n * {@link module:utils/emittermixin~Emitter#listenTo `Emitter#listenTo()`}.\n *\n * @param event The name of the event.\n */\n attach(event) {\n // If the DOM Listener for given event already exist it is pointless\n // to attach another one.\n if (this._domListeners && this._domListeners[event]) {\n return;\n }\n const domListener = this._createDomListener(event);\n // Attach the native DOM listener to DOM Node.\n this._domNode.addEventListener(event, domListener, this._options);\n if (!this._domListeners) {\n this._domListeners = {};\n }\n // Store the native DOM listener in this ProxyEmitter. It will be helpful\n // when stopping listening to the event.\n this._domListeners[event] = domListener;\n }\n /**\n * Stops executing the callback on the given event.\n *\n * **Note**: This is automatically called by the\n * {@link module:utils/emittermixin~Emitter#stopListening `Emitter#stopListening()`}.\n *\n * @param event The name of the event.\n */\n detach(event) {\n let events;\n // Remove native DOM listeners which are orphans. If no callbacks\n // are awaiting given event, detach native DOM listener from DOM Node.\n // See: {@link attach}.\n if (this._domListeners[event] && (!(events = this._events[event]) || !events.callbacks.length)) {\n this._domListeners[event].removeListener();\n }\n }\n /**\n * Adds callback to emitter for given event.\n *\n * @internal\n * @param event The name of the event.\n * @param callback The function to be called on event.\n * @param options Additional options.\n */\n _addEventListener(event, callback, options) {\n this.attach(event);\n EmitterMixin().prototype._addEventListener.call(this, event, callback, options);\n }\n /**\n * Removes callback from emitter for given event.\n *\n * @internal\n * @param event The name of the event.\n * @param callback The function to stop being called.\n */\n _removeEventListener(event, callback) {\n EmitterMixin().prototype._removeEventListener.call(this, event, callback);\n this.detach(event);\n }\n /**\n * Creates a native DOM listener callback. When the native DOM event\n * is fired it will fire corresponding event on this ProxyEmitter.\n * Note: A native DOM Event is passed as an argument.\n *\n * @param event The name of the event.\n * @returns The DOM listener callback.\n */\n _createDomListener(event) {\n const domListener = (domEvt) => {\n this.fire(event, domEvt);\n };\n // Supply the DOM listener callback with a function that will help\n // detach it from the DOM Node, when it is no longer necessary.\n // See: {@link detach}.\n domListener.removeListener = () => {\n this._domNode.removeEventListener(event, domListener, this._options);\n delete this._domListeners[event];\n };\n return domListener;\n }\n}\n/**\n * Gets an unique DOM Node identifier. The identifier will be set if not defined.\n *\n * @returns UID for given DOM Node.\n */\nfunction getNodeUID(node) {\n return node['data-ck-expando'] || (node['data-ck-expando'] = uid());\n}\n/**\n * Gets id of the ProxyEmitter for the given node.\n */\nfunction getProxyEmitterId(node, options) {\n let id = getNodeUID(node);\n for (const option of Object.keys(options).sort()) {\n if (options[option]) {\n id += '-' + option;\n }\n }\n return id;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/getborderwidths\n */\n/**\n * Returns an object containing CSS border widths of a specified HTML element.\n *\n * @param element An element which has CSS borders.\n * @returns An object containing `top`, `left`, `right` and `bottom` properties\n * with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.\n */\nexport default function getBorderWidths(element) {\n // Call getComputedStyle on the window the element document belongs to.\n const style = element.ownerDocument.defaultView.getComputedStyle(element);\n return {\n top: parseInt(style.borderTopWidth, 10),\n right: parseInt(style.borderRightWidth, 10),\n bottom: parseInt(style.borderBottomWidth, 10),\n left: parseInt(style.borderLeftWidth, 10)\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/istext\n */\n/**\n * Checks if the object is a native DOM Text node.\n */\nexport default function isText(obj) {\n return Object.prototype.toString.call(obj) == '[object Text]';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/isrange\n */\n/**\n * Checks if the object is a native DOM Range.\n */\nexport default function isRange(obj) {\n return Object.prototype.toString.apply(obj) == '[object Range]';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/getpositionedancestor\n */\nimport global from './global.js';\n/**\n * For a given element, returns the nearest ancestor element which CSS position is not \"static\".\n *\n * @param element The native DOM element to be checked.\n */\nexport default function getPositionedAncestor(element) {\n if (!element || !element.parentNode) {\n return null;\n }\n if (element.offsetParent === global.document.body) {\n return null;\n }\n return element.offsetParent;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/rect\n */\nimport isRange from './isrange.js';\nimport isWindow from './iswindow.js';\nimport getBorderWidths from './getborderwidths.js';\nimport isText from './istext.js';\nimport getPositionedAncestor from './getpositionedancestor.js';\nimport global from './global.js';\nconst rectProperties = ['top', 'right', 'bottom', 'left', 'width', 'height'];\n/**\n * A helper class representing a `ClientRect` object, e.g. value returned by\n * the native `object.getBoundingClientRect()` method. Provides a set of methods\n * to manipulate the rect and compare it against other rect instances.\n */\nexport default class Rect {\n /**\n * Creates an instance of rect.\n *\n * ```ts\n * // Rect of an HTMLElement.\n * const rectA = new Rect( document.body );\n *\n * // Rect of a DOM Range.\n * const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );\n *\n * // Rect of a window (web browser viewport).\n * const rectC = new Rect( window );\n *\n * // Rect out of an object.\n * const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );\n *\n * // Rect out of another Rect instance.\n * const rectE = new Rect( rectD );\n *\n * // Rect out of a ClientRect.\n * const rectF = new Rect( document.body.getClientRects().item( 0 ) );\n * ```\n *\n * **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)\n * ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}\n * to get the inner part of the rect.\n *\n * @param source A source object to create the rect.\n */\n constructor(source) {\n const isSourceRange = isRange(source);\n Object.defineProperty(this, '_source', {\n // If the source is a Rect instance, copy it's #_source.\n value: source._source || source,\n writable: true,\n enumerable: false\n });\n if (isDomElement(source) || isSourceRange) {\n // The `Rect` class depends on `getBoundingClientRect` and `getClientRects` DOM methods. If the source\n // of a rect in an HTML element or a DOM range but it does not belong to any rendered DOM tree, these methods\n // will fail to obtain the geometry and the rect instance makes little sense to the features using it.\n // To get rid of this warning make sure the source passed to the constructor is a descendant of `window.document.body`.\n // @if CK_DEBUG // const sourceNode = isSourceRange ? source.startContainer : source;\n // @if CK_DEBUG // if ( !sourceNode.ownerDocument || !sourceNode.ownerDocument.body.contains( sourceNode ) ) {\n // @if CK_DEBUG // \tconsole.warn(\n // @if CK_DEBUG // \t\t'rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',\n // @if CK_DEBUG // \t\t{ source } );\n // @if CK_DEBUG // }\n if (isSourceRange) {\n const rangeRects = Rect.getDomRangeRects(source);\n copyRectProperties(this, Rect.getBoundingRect(rangeRects));\n }\n else {\n copyRectProperties(this, source.getBoundingClientRect());\n }\n }\n else if (isWindow(source)) {\n const { innerWidth, innerHeight } = source;\n copyRectProperties(this, {\n top: 0,\n right: innerWidth,\n bottom: innerHeight,\n left: 0,\n width: innerWidth,\n height: innerHeight\n });\n }\n else {\n copyRectProperties(this, source);\n }\n }\n /**\n * Returns a clone of the rect.\n *\n * @returns A cloned rect.\n */\n clone() {\n return new Rect(this);\n }\n /**\n * Moves the rect so that its upper–left corner lands in desired `[ x, y ]` location.\n *\n * @param x Desired horizontal location.\n * @param y Desired vertical location.\n * @returns A rect which has been moved.\n */\n moveTo(x, y) {\n this.top = y;\n this.right = x + this.width;\n this.bottom = y + this.height;\n this.left = x;\n return this;\n }\n /**\n * Moves the rect in–place by a dedicated offset.\n *\n * @param x A horizontal offset.\n * @param y A vertical offset\n * @returns A rect which has been moved.\n */\n moveBy(x, y) {\n this.top += y;\n this.right += x;\n this.left += x;\n this.bottom += y;\n return this;\n }\n /**\n * Returns a new rect a a result of intersection with another rect.\n */\n getIntersection(anotherRect) {\n const rect = {\n top: Math.max(this.top, anotherRect.top),\n right: Math.min(this.right, anotherRect.right),\n bottom: Math.min(this.bottom, anotherRect.bottom),\n left: Math.max(this.left, anotherRect.left),\n width: 0,\n height: 0\n };\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n if (rect.width < 0 || rect.height < 0) {\n return null;\n }\n else {\n const newRect = new Rect(rect);\n newRect._source = this._source;\n return newRect;\n }\n }\n /**\n * Returns the area of intersection with another rect.\n *\n * @returns Area of intersection.\n */\n getIntersectionArea(anotherRect) {\n const rect = this.getIntersection(anotherRect);\n if (rect) {\n return rect.getArea();\n }\n else {\n return 0;\n }\n }\n /**\n * Returns the area of the rect.\n */\n getArea() {\n return this.width * this.height;\n }\n /**\n * Returns a new rect, a part of the original rect, which is actually visible to the user and is relative to the,`body`,\n * e.g. an original rect cropped by parent element rects which have `overflow` set in CSS\n * other than `\"visible\"`.\n *\n * If there's no such visible rect, which is when the rect is limited by one or many of\n * the ancestors, `null` is returned.\n *\n * **Note**: This method does not consider the boundaries of the viewport (window).\n * To get a rect cropped by all ancestors and the viewport, use an intersection such as:\n *\n * ```ts\n * const visibleInViewportRect = new Rect( window ).getIntersection( new Rect( source ).getVisible() );\n * ```\n *\n * @returns A visible rect instance or `null`, if there's none.\n */\n getVisible() {\n const source = this._source;\n let visibleRect = this.clone();\n // There's no ancestor to crop <body> with the overflow.\n if (isBody(source)) {\n return visibleRect;\n }\n let child = source;\n let parent = source.parentNode || source.commonAncestorContainer;\n let absolutelyPositionedChildElement;\n // Check the ancestors all the way up to the <body>.\n while (parent && !isBody(parent)) {\n const isParentOverflowVisible = getElementOverflow(parent) === 'visible';\n if (child instanceof HTMLElement && getElementPosition(child) === 'absolute') {\n absolutelyPositionedChildElement = child;\n }\n const parentElementPosition = getElementPosition(parent);\n // The child will be cropped only if it has `position: absolute` and the parent has `position: relative` + some overflow.\n // Otherwise there's no chance of visual clipping and the parent can be skipped\n // https://github.com/ckeditor/ckeditor5/issues/14107.\n //\n // condition: isParentOverflowVisible\n // \t\t+---------------------------+\n //\t\t| #parent\t\t\t\t\t|\n //\t\t| (overflow: visible)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t|\t\t\t\t| child\t\t\t\t\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t+---------------------------+\n //\n // condition: absolutelyPositionedChildElement && parentElementPosition === 'relative' && isParentOverflowVisible\n // \t\t+---------------------------+\n //\t\t| parent\t\t\t\t\t|\n //\t\t| (position: relative;)\t\t|\n //\t\t| (overflow: visible;)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t|\t\t\t\t| child \t\t\t\t\t|\n //\t\t|\t\t\t\t| (position: absolute;)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t+---------------------------+\n //\n // condition: absolutelyPositionedChildElement && parentElementPosition !== 'relative'\n // \t\t+---------------------------+\n //\t\t| parent\t\t\t\t\t|\n //\t\t| (position: static;)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t|\t\t\t\t| child \t\t\t\t\t|\n //\t\t|\t\t\t\t| (position: absolute;)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t+---------------------------+\n if (isParentOverflowVisible ||\n absolutelyPositionedChildElement && ((parentElementPosition === 'relative' && isParentOverflowVisible) ||\n parentElementPosition !== 'relative')) {\n child = parent;\n parent = parent.parentNode;\n continue;\n }\n const parentRect = new Rect(parent);\n const intersectionRect = visibleRect.getIntersection(parentRect);\n if (intersectionRect) {\n if (intersectionRect.getArea() < visibleRect.getArea()) {\n // Reduce the visible rect to the intersection.\n visibleRect = intersectionRect;\n }\n }\n else {\n // There's no intersection, the rect is completely invisible.\n return null;\n }\n child = parent;\n parent = parent.parentNode;\n }\n return visibleRect;\n }\n /**\n * Checks if all property values ({@link #top}, {@link #left}, {@link #right},\n * {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect\n * instances.\n *\n * @param anotherRect A rect instance to compare with.\n * @returns `true` when Rects are equal. `false` otherwise.\n */\n isEqual(anotherRect) {\n for (const prop of rectProperties) {\n if (this[prop] !== anotherRect[prop]) {\n return false;\n }\n }\n return true;\n }\n /**\n * Checks whether a rect fully contains another rect instance.\n *\n * @param anotherRect\n * @returns `true` if contains, `false` otherwise.\n */\n contains(anotherRect) {\n const intersectRect = this.getIntersection(anotherRect);\n return !!(intersectRect && intersectRect.isEqual(anotherRect));\n }\n /**\n * Recalculates screen coordinates to coordinates relative to the positioned ancestor offset.\n */\n toAbsoluteRect() {\n const { scrollX, scrollY } = global.window;\n const absoluteRect = this.clone().moveBy(scrollX, scrollY);\n if (isDomElement(absoluteRect._source)) {\n const positionedAncestor = getPositionedAncestor(absoluteRect._source);\n if (positionedAncestor) {\n shiftRectToCompensatePositionedAncestor(absoluteRect, positionedAncestor);\n }\n }\n return absoluteRect;\n }\n /**\n * Excludes scrollbars and CSS borders from the rect.\n *\n * * Borders are removed when {@link #_source} is an HTML element.\n * * Scrollbars are excluded from HTML elements and the `window`.\n *\n * @returns A rect which has been updated.\n */\n excludeScrollbarsAndBorders() {\n const source = this._source;\n let scrollBarWidth, scrollBarHeight, direction;\n if (isWindow(source)) {\n scrollBarWidth = source.innerWidth - source.document.documentElement.clientWidth;\n scrollBarHeight = source.innerHeight - source.document.documentElement.clientHeight;\n direction = source.getComputedStyle(source.document.documentElement).direction;\n }\n else {\n const borderWidths = getBorderWidths(source);\n scrollBarWidth = source.offsetWidth - source.clientWidth - borderWidths.left - borderWidths.right;\n scrollBarHeight = source.offsetHeight - source.clientHeight - borderWidths.top - borderWidths.bottom;\n direction = source.ownerDocument.defaultView.getComputedStyle(source).direction;\n this.left += borderWidths.left;\n this.top += borderWidths.top;\n this.right -= borderWidths.right;\n this.bottom -= borderWidths.bottom;\n this.width = this.right - this.left;\n this.height = this.bottom - this.top;\n }\n this.width -= scrollBarWidth;\n if (direction === 'ltr') {\n this.right -= scrollBarWidth;\n }\n else {\n this.left += scrollBarWidth;\n }\n this.height -= scrollBarHeight;\n this.bottom -= scrollBarHeight;\n return this;\n }\n /**\n * Returns an array of rects of the given native DOM Range.\n *\n * @param range A native DOM range.\n * @returns DOM Range rects.\n */\n static getDomRangeRects(range) {\n const rects = [];\n // Safari does not iterate over ClientRectList using for...of loop.\n const clientRects = Array.from(range.getClientRects());\n if (clientRects.length) {\n for (const rect of clientRects) {\n rects.push(new Rect(rect));\n }\n }\n // If there's no client rects for the Range, use parent container's bounding rect\n // instead and adjust rect's width to simulate the actual geometry of such range.\n // https://github.com/ckeditor/ckeditor5-utils/issues/153\n // https://github.com/ckeditor/ckeditor5-ui/issues/317\n else {\n let startContainer = range.startContainer;\n if (isText(startContainer)) {\n startContainer = startContainer.parentNode;\n }\n const rect = new Rect(startContainer.getBoundingClientRect());\n rect.right = rect.left;\n rect.width = 0;\n rects.push(rect);\n }\n return rects;\n }\n /**\n * Returns a bounding rectangle that contains all the given `rects`.\n *\n * @param rects A list of rectangles that should be contained in the result rectangle.\n * @returns Bounding rectangle or `null` if no `rects` were given.\n */\n static getBoundingRect(rects) {\n const boundingRectData = {\n left: Number.POSITIVE_INFINITY,\n top: Number.POSITIVE_INFINITY,\n right: Number.NEGATIVE_INFINITY,\n bottom: Number.NEGATIVE_INFINITY,\n width: 0,\n height: 0\n };\n let rectangleCount = 0;\n for (const rect of rects) {\n rectangleCount++;\n boundingRectData.left = Math.min(boundingRectData.left, rect.left);\n boundingRectData.top = Math.min(boundingRectData.top, rect.top);\n boundingRectData.right = Math.max(boundingRectData.right, rect.right);\n boundingRectData.bottom = Math.max(boundingRectData.bottom, rect.bottom);\n }\n if (rectangleCount == 0) {\n return null;\n }\n boundingRectData.width = boundingRectData.right - boundingRectData.left;\n boundingRectData.height = boundingRectData.bottom - boundingRectData.top;\n return new Rect(boundingRectData);\n }\n}\n/**\n * Acquires all the rect properties from the passed source.\n */\nfunction copyRectProperties(rect, source) {\n for (const p of rectProperties) {\n rect[p] = source[p];\n }\n}\n/**\n * Checks if provided object is a <body> HTML element.\n */\nfunction isBody(value) {\n if (!isDomElement(value)) {\n return false;\n }\n return value === value.ownerDocument.body;\n}\n/**\n * Checks if provided object \"looks like\" a DOM Element and has API required by `Rect` class.\n */\nfunction isDomElement(value) {\n // Note: earlier we used `isElement()` from lodash library, however that function is less performant because\n // it makes complicated checks to make sure that given value is a DOM element.\n return value !== null && typeof value === 'object' && value.nodeType === 1 && typeof value.getBoundingClientRect === 'function';\n}\n/**\n * Returns the value of the `position` style of an `HTMLElement`.\n */\nfunction getElementPosition(element) {\n return element instanceof HTMLElement ? element.ownerDocument.defaultView.getComputedStyle(element).position : 'static';\n}\n/**\n * Returns the value of the `overflow` style of an `HTMLElement` or a `Range`.\n */\nfunction getElementOverflow(element) {\n return element instanceof HTMLElement ? element.ownerDocument.defaultView.getComputedStyle(element).overflow : 'visible';\n}\n/**\n * For a given absolute Rect coordinates object and a positioned element ancestor, it updates its\n * coordinates that make up for the position and the scroll of the ancestor.\n *\n * This is necessary because while Rects (and DOMRects) are relative to the browser's viewport, their coordinates\n * are used in real–life to position elements with `position: absolute`, which are scoped by any positioned\n * (and scrollable) ancestors.\n */\nfunction shiftRectToCompensatePositionedAncestor(rect, positionedElementAncestor) {\n const ancestorPosition = new Rect(positionedElementAncestor);\n const ancestorBorderWidths = getBorderWidths(positionedElementAncestor);\n let moveX = 0;\n let moveY = 0;\n // (https://github.com/ckeditor/ckeditor5-ui-default/issues/126)\n // If there's some positioned ancestor of the panel, then its `Rect` must be taken into\n // consideration. `Rect` is always relative to the viewport while `position: absolute` works\n // with respect to that positioned ancestor.\n moveX -= ancestorPosition.left;\n moveY -= ancestorPosition.top;\n // (https://github.com/ckeditor/ckeditor5-utils/issues/139)\n // If there's some positioned ancestor of the panel, not only its position must be taken into\n // consideration (see above) but also its internal scrolls. Scroll have an impact here because `Rect`\n // is relative to the viewport (it doesn't care about scrolling), while `position: absolute`\n // must compensate that scrolling.\n moveX += positionedElementAncestor.scrollLeft;\n moveY += positionedElementAncestor.scrollTop;\n // (https://github.com/ckeditor/ckeditor5-utils/issues/139)\n // If there's some positioned ancestor of the panel, then its `Rect` includes its CSS `borderWidth`\n // while `position: absolute` positioning does not consider it.\n // E.g. `{ position: absolute, top: 0, left: 0 }` means upper left corner of the element,\n // not upper-left corner of its border.\n moveX -= ancestorBorderWidths.left;\n moveY -= ancestorBorderWidths.top;\n rect.moveBy(moveX, moveY);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/resizeobserver\n */\nimport global from './global.js';\n/**\n * A helper class which instances allow performing custom actions when native DOM elements are resized.\n *\n * ```ts\n * const editableElement = editor.editing.view.getDomRoot();\n *\n * const observer = new ResizeObserver( editableElement, entry => {\n * \tconsole.log( 'The editable element has been resized in DOM.' );\n * \tconsole.log( entry.target ); // -> editableElement\n * \tconsole.log( entry.contentRect.width ); // -> e.g. '423px'\n * } );\n * ```\n *\n * It uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)\n * under the hood.\n */\nclass ResizeObserver {\n /**\n * Creates an instance of the `ResizeObserver` class.\n *\n * @param element A DOM element that is to be observed for resizing. Note that\n * the element must be visible (i.e. not detached from DOM) for the observer to work.\n * @param callback A function called when the observed element was resized. It passes\n * the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)\n * object with information about the resize event.\n */\n constructor(element, callback) {\n // **Note**: For the maximum performance, this class ensures only a single instance of the native\n // observer is used no matter how many instances of this class were created.\n if (!ResizeObserver._observerInstance) {\n ResizeObserver._createObserver();\n }\n this._element = element;\n this._callback = callback;\n ResizeObserver._addElementCallback(element, callback);\n ResizeObserver._observerInstance.observe(element);\n }\n /**\n * The element observed by this observer.\n */\n get element() {\n return this._element;\n }\n /**\n * Destroys the observer which disables the `callback` passed to the {@link #constructor}.\n */\n destroy() {\n ResizeObserver._deleteElementCallback(this._element, this._callback);\n }\n /**\n * Registers a new resize callback for the DOM element.\n */\n static _addElementCallback(element, callback) {\n if (!ResizeObserver._elementCallbacks) {\n ResizeObserver._elementCallbacks = new Map();\n }\n let callbacks = ResizeObserver._elementCallbacks.get(element);\n if (!callbacks) {\n callbacks = new Set();\n ResizeObserver._elementCallbacks.set(element, callbacks);\n }\n callbacks.add(callback);\n }\n /**\n * Removes a resize callback from the DOM element. If no callbacks are left\n * for the element, it removes the element from the native observer.\n */\n static _deleteElementCallback(element, callback) {\n const callbacks = ResizeObserver._getElementCallbacks(element);\n // Remove the element callback. Check if exist first in case someone\n // called destroy() twice.\n if (callbacks) {\n callbacks.delete(callback);\n // If no callbacks left for the element, also remove the element.\n if (!callbacks.size) {\n ResizeObserver._elementCallbacks.delete(element);\n ResizeObserver._observerInstance.unobserve(element);\n }\n }\n if (ResizeObserver._elementCallbacks && !ResizeObserver._elementCallbacks.size) {\n ResizeObserver._observerInstance = null;\n ResizeObserver._elementCallbacks = null;\n }\n }\n /**\n * Returns are registered resize callbacks for the DOM element.\n */\n static _getElementCallbacks(element) {\n if (!ResizeObserver._elementCallbacks) {\n return null;\n }\n return ResizeObserver._elementCallbacks.get(element);\n }\n /**\n * Creates the single native observer shared across all `ResizeObserver` instances.\n */\n static _createObserver() {\n ResizeObserver._observerInstance = new global.window.ResizeObserver(entries => {\n for (const entry of entries) {\n const callbacks = ResizeObserver._getElementCallbacks(entry.target);\n if (callbacks) {\n for (const callback of callbacks) {\n callback(entry);\n }\n }\n }\n });\n }\n}\n/**\n * The single native observer instance shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n */\nResizeObserver._observerInstance = null;\n/**\n * A mapping of native DOM elements and their callbacks shared across all\n * {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n */\nResizeObserver._elementCallbacks = null;\nexport default ResizeObserver;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/setdatainelement\n */\n/* globals HTMLTextAreaElement */\n/**\n * Sets data in a given element.\n *\n * @param el The element in which the data will be set.\n * @param data The data string.\n */\nexport default function setDataInElement(el, data) {\n if (el instanceof HTMLTextAreaElement) {\n el.value = data;\n }\n el.innerHTML = data;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/tounit\n */\n/**\n * Returns a helper function, which adds a desired trailing\n * `unit` to the passed value.\n *\n * @param unit An unit like \"px\" or \"em\".\n */\nexport default function toUnit(unit) {\n return value => value + unit;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/indexof\n */\n/**\n * Returns index of the node in the parent element.\n *\n * @param node Node which index is tested.\n * @returns Index of the node in the parent element. Returns 0 if node has no parent.\n */\nexport default function indexOf(node) {\n let index = 0;\n while (node.previousSibling) {\n node = node.previousSibling;\n index++;\n }\n return index;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/insertat\n */\n/**\n * Inserts node to the parent at given index.\n *\n * @param parentElement Parent element.\n * @param index Insertions index.\n * @param nodeToInsert Node to insert.\n */\nexport default function insertAt(parentElement, index, nodeToInsert) {\n parentElement.insertBefore(nodeToInsert, parentElement.childNodes[index] || null);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals Node */\n/**\n * @module utils/dom/iscomment\n */\n/**\n * Checks whether the object is a native DOM Comment node.\n */\nexport default function isComment(obj) {\n return obj && obj.nodeType === Node.COMMENT_NODE;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/isvisible\n */\n/**\n * Checks whether the element is visible to the user in DOM:\n *\n * * connected to the root of the document,\n * * has no `display: none`,\n * * has no ancestors with `display: none`.\n *\n * **Note**: This helper does not check whether the element is hidden by cropping, overflow, etc..\n * To check that, use {@link module:utils/dom/rect~Rect} instead.\n */\nexport default function isVisible(element) {\n return !!(element && element.getClientRects && element.getClientRects().length);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/position\n */\nimport global from './global.js';\nimport Rect from './rect.js';\nimport getPositionedAncestor from './getpositionedancestor.js';\nimport { isFunction } from 'lodash-es';\n// @if CK_DEBUG_POSITION // const {\n// @if CK_DEBUG_POSITION // \tdefault: RectDrawer,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesBlack,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesGreen,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesRed\n// @if CK_DEBUG_POSITION // } = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' );\n// @if CK_DEBUG_POSITION // const TARGET_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px', outlineStyle: 'dashed', outlineColor: 'blue', outlineOffset: '2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VISIBLE_TARGET_RECT_STYLE = {\n// @if CK_DEBUG_POSITION //\t\t...diagonalStylesBlack,\n// @if CK_DEBUG_POSITION //\t\topacity: '1',\n// @if CK_DEBUG_POSITION //\t\tbackgroundColor: '#00000033',\n// @if CK_DEBUG_POSITION //\t\toutlineWidth: '2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VIEWPORT_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px',\n// @if CK_DEBUG_POSITION // \toutlineOffset: '-2px',\n// @if CK_DEBUG_POSITION // \toutlineStyle: 'solid',\n// @if CK_DEBUG_POSITION // \toutlineColor: 'red'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VISIBLE_LIMITER_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \t...diagonalStylesGreen,\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px',\n// @if CK_DEBUG_POSITION // \toutlineOffset: '-2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const ELEMENT_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px', outlineColor: 'orange', outlineOffset: '-2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const CHOSEN_POSITION_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \topacity: .5, outlineColor: 'magenta', backgroundColor: 'magenta'\n// @if CK_DEBUG_POSITION // };\n/**\n * Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the\n * target in the visually most efficient way, taking various restrictions like viewport or limiter geometry\n * into consideration.\n *\n * **Note**: If there are no position coordinates found that meet the requirements (arguments of this helper),\n * `null` is returned.\n *\n * ```ts\n * // The element which is to be positioned.\n * const element = document.body.querySelector( '#toolbar' );\n *\n * // A target to which the element is positioned relatively.\n * const target = document.body.querySelector( '#container' );\n *\n * // Finding the optimal coordinates for the positioning.\n * const { left, top, name } = getOptimalPosition( {\n * \telement: element,\n * \ttarget: target,\n *\n * \t// The algorithm will chose among these positions to meet the requirements such\n * \t// as \"limiter\" element or \"fitInViewport\", set below. The positions are considered\n * \t// in the order of the array.\n * \tpositions: [\n * \t\t//\n * \t \t//\t[ Target ]\n * \t\t//\t+-----------------+\n * \t\t//\t| Element |\n * \t\t//\t+-----------------+\n * \t\t//\n * \t\ttargetRect => ( {\n * \t\t\ttop: targetRect.bottom,\n * \t\t\tleft: targetRect.left,\n * \t\t\tname: 'mySouthEastPosition'\n * \t\t} ),\n *\n * \t\t//\n * \t\t//\t+-----------------+\n * \t\t//\t| Element |\n * \t\t//\t+-----------------+\n * \t\t//\t[ Target ]\n * \t\t//\n * \t\t( targetRect, elementRect ) => ( {\n * \t\t\ttop: targetRect.top - elementRect.height,\n * \t\t\tleft: targetRect.left,\n * \t\t\tname: 'myNorthEastPosition'\n * \t\t} )\n * \t],\n *\n * \t// Find a position such guarantees the element remains within visible boundaries of <body>.\n * \tlimiter: document.body,\n *\n * \t// Find a position such guarantees the element remains within visible boundaries of the browser viewport.\n * \tfitInViewport: true\n * } );\n *\n * // The best position which fits into document.body and the viewport. May be useful\n * // to set proper class on the `element`.\n * console.log( name ); // -> \"myNorthEastPosition\"\n *\n * // Using the absolute coordinates which has been found to position the element\n * // as in the diagram depicting the \"myNorthEastPosition\" position.\n * element.style.top = top;\n * element.style.left = left;\n * ```\n *\n * @param options The input data and configuration of the helper.\n */\nexport function getOptimalPosition({ element, target, positions, limiter, fitInViewport, viewportOffsetConfig }) {\n // If the {@link module:utils/dom/position~Options#target} is a function, use what it returns.\n // https://github.com/ckeditor/ckeditor5-utils/issues/157\n if (isFunction(target)) {\n target = target();\n }\n // If the {@link module:utils/dom/position~Options#limiter} is a function, use what it returns.\n // https://github.com/ckeditor/ckeditor5-ui/issues/260\n if (isFunction(limiter)) {\n limiter = limiter();\n }\n const positionedElementAncestor = getPositionedAncestor(element);\n const constrainedViewportRect = getConstrainedViewportRect(viewportOffsetConfig);\n const elementRect = new Rect(element);\n const visibleTargetRect = getVisibleViewportIntersectionRect(target, constrainedViewportRect);\n let bestPosition;\n // @if CK_DEBUG_POSITION // const targetRect = new Rect( target );\n // @if CK_DEBUG_POSITION // RectDrawer.clear();\n // @if CK_DEBUG_POSITION // RectDrawer.draw( targetRect, TARGET_RECT_STYLE, 'Target' );\n // @if CK_DEBUG_POSITION // if ( constrainedViewportRect ) {\n // @if CK_DEBUG_POSITION //\t\tRectDrawer.draw( constrainedViewportRect, VIEWPORT_RECT_STYLE, 'Viewport' );\n // @if CK_DEBUG_POSITION // }\n // If the target got cropped by ancestors or went off the screen, positioning does not make any sense.\n if (!visibleTargetRect || !constrainedViewportRect.getIntersection(visibleTargetRect)) {\n return null;\n }\n // @if CK_DEBUG_POSITION //\tRectDrawer.draw( visibleTargetRect, VISIBLE_TARGET_RECT_STYLE, 'VisTgt' );\n const positionOptions = {\n targetRect: visibleTargetRect,\n elementRect,\n positionedElementAncestor,\n viewportRect: constrainedViewportRect\n };\n // If there are no limits, just grab the very first position and be done with that drama.\n if (!limiter && !fitInViewport) {\n bestPosition = new PositionObject(positions[0], positionOptions);\n }\n else {\n if (limiter) {\n const visibleLimiterRect = getVisibleViewportIntersectionRect(limiter, constrainedViewportRect);\n if (visibleLimiterRect) {\n positionOptions.limiterRect = visibleLimiterRect;\n // @if CK_DEBUG_POSITION // RectDrawer.draw( visibleLimiterRect, VISIBLE_LIMITER_RECT_STYLE, 'VisLim' );\n }\n }\n // If there's no best position found, i.e. when all intersections have no area because\n // rects have no width or height, then just return `null`\n bestPosition = getBestPosition(positions, positionOptions);\n }\n return bestPosition;\n}\n/**\n * Returns intersection of visible source `Rect` with Viewport `Rect`. In case when source `Rect` is not visible\n * or there is no intersection between source `Rect` and Viewport `Rect`, `null` will be returned.\n */\nfunction getVisibleViewportIntersectionRect(source, viewportRect) {\n const visibleSourceRect = new Rect(source).getVisible();\n if (!visibleSourceRect) {\n return null;\n }\n return visibleSourceRect.getIntersection(viewportRect);\n}\n/**\n * Returns a viewport `Rect` shrunk by the viewport offset config from all sides.\n */\nfunction getConstrainedViewportRect(viewportOffsetConfig) {\n viewportOffsetConfig = Object.assign({ top: 0, bottom: 0, left: 0, right: 0 }, viewportOffsetConfig);\n const viewportRect = new Rect(global.window);\n viewportRect.top += viewportOffsetConfig.top;\n viewportRect.height -= viewportOffsetConfig.top;\n viewportRect.bottom -= viewportOffsetConfig.bottom;\n viewportRect.height -= viewportOffsetConfig.bottom;\n return viewportRect;\n}\n/**\n * For a given array of positioning functions, returns such that provides the best\n * fit of the `elementRect` into the `limiterRect` and `viewportRect`.\n */\nfunction getBestPosition(positions, options) {\n const { elementRect } = options;\n // This is when element is fully visible.\n const elementRectArea = elementRect.getArea();\n const positionInstances = positions\n .map(positioningFunction => new PositionObject(positioningFunction, options))\n // Some positioning functions may return `null` if they don't want to participate.\n .filter(position => !!position.name);\n let maxFitFactor = 0;\n let bestPosition = null;\n for (const position of positionInstances) {\n const { limiterIntersectionArea, viewportIntersectionArea } = position;\n // If a such position is found that element is fully contained by the limiter then, obviously,\n // there will be no better one, so finishing.\n if (limiterIntersectionArea === elementRectArea) {\n // @if CK_DEBUG_POSITION //\tRectDrawer.draw( position._rect, CHOSEN_POSITION_RECT_STYLE, [\n // @if CK_DEBUG_POSITION //\t\tposition.name,\n // @if CK_DEBUG_POSITION //\t\t'100% fit',\n // @if CK_DEBUG_POSITION //\t].join( '\\n' ) );\n return position;\n }\n // To maximize both viewport and limiter intersection areas we use distance on _viewportIntersectionArea\n // and _limiterIntersectionArea plane (without sqrt because we are looking for max value).\n const fitFactor = viewportIntersectionArea ** 2 + limiterIntersectionArea ** 2;\n // @if CK_DEBUG_POSITION //\tRectDrawer.draw( position._rect, { opacity: .4 }, [\n // @if CK_DEBUG_POSITION //\t\tposition.name,\n // @if CK_DEBUG_POSITION //\t\t'Vi=' + Math.round( viewportIntersectionArea ),\n // @if CK_DEBUG_POSITION //\t\t'Li=' + Math.round( limiterIntersectionArea )\n // @if CK_DEBUG_POSITION //\t].join( '\\n' ) );\n if (fitFactor > maxFitFactor) {\n maxFitFactor = fitFactor;\n bestPosition = position;\n }\n }\n // @if CK_DEBUG_POSITION // if ( bestPosition ) {\n // @if CK_DEBUG_POSITION // \tRectDrawer.draw( bestPosition._rect, CHOSEN_POSITION_RECT_STYLE );\n // @if CK_DEBUG_POSITION // }\n return bestPosition;\n}\n/**\n * A position class which instances are created and used by the {@link module:utils/dom/position~getOptimalPosition} helper.\n *\n * {@link module:utils/dom/position~Position#top} and {@link module:utils/dom/position~Position#left} properties of the position instance\n * translate directly to the `top` and `left` properties in CSS \"`position: absolute` coordinate system\". If set on the positioned element\n * in DOM, they will make it display it in the right place in the viewport.\n */\nclass PositionObject {\n /**\n * Creates an instance of the {@link module:utils/dom/position~PositionObject} class.\n *\n * @param positioningFunction function The function that defines the expected\n * coordinates the positioned element should move to.\n * @param options options object.\n * @param options.elementRect The positioned element rect.\n * @param options.targetRect The target element rect.\n * @param options.viewportRect The viewport rect.\n * @param options.limiterRect The limiter rect.\n * @param options.positionedElementAncestor Nearest element ancestor element which CSS position is not \"static\".\n */\n constructor(positioningFunction, options) {\n const positioningFunctionOutput = positioningFunction(options.targetRect, options.elementRect, options.viewportRect, options.limiterRect);\n // Nameless position for a function that didn't participate.\n if (!positioningFunctionOutput) {\n return;\n }\n const { left, top, name, config } = positioningFunctionOutput;\n this.name = name;\n this.config = config;\n this._positioningFunctionCoordinates = { left, top };\n this._options = options;\n }\n /**\n * The left value in pixels in the CSS `position: absolute` coordinate system.\n * Set it on the positioned element in DOM to move it to the position.\n */\n get left() {\n return this._absoluteRect.left;\n }\n /**\n * The top value in pixels in the CSS `position: absolute` coordinate system.\n * Set it on the positioned element in DOM to move it to the position.\n */\n get top() {\n return this._absoluteRect.top;\n }\n /**\n * An intersection area between positioned element and limiter within viewport constraints.\n */\n get limiterIntersectionArea() {\n const limiterRect = this._options.limiterRect;\n if (limiterRect) {\n return limiterRect.getIntersectionArea(this._rect);\n }\n return 0;\n }\n /**\n * An intersection area between positioned element and viewport.\n */\n get viewportIntersectionArea() {\n const viewportRect = this._options.viewportRect;\n return viewportRect.getIntersectionArea(this._rect);\n }\n /**\n * An already positioned element rect. A clone of the element rect passed to the constructor\n * but placed in the viewport according to the positioning function.\n */\n get _rect() {\n if (this._cachedRect) {\n return this._cachedRect;\n }\n this._cachedRect = this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left, this._positioningFunctionCoordinates.top);\n return this._cachedRect;\n }\n /**\n * An already absolutely positioned element rect. See ({@link #_rect}).\n */\n get _absoluteRect() {\n if (this._cachedAbsoluteRect) {\n return this._cachedAbsoluteRect;\n }\n this._cachedAbsoluteRect = this._rect.toAbsoluteRect();\n return this._cachedAbsoluteRect;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/remove\n */\n/**\n * Removes given node from parent.\n *\n * @param node Node to remove.\n */\nexport default function remove(node) {\n const parent = node.parentNode;\n if (parent) {\n parent.removeChild(node);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/scroll\n */\nimport isRange from './isrange.js';\nimport Rect from './rect.js';\nimport isText from './istext.js';\n/**\n * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.\n * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to\n * the user. If the `target` is already visible, nothing will happen.\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.target A target, which supposed to become visible to the user.\n * @param options.viewportOffset An offset from the edge of the viewport (in pixels)\n * the `target` will be moved by if the viewport is scrolled. It enhances the user experience\n * by keeping the `target` some distance from the edge of the viewport and thus making it easier to\n * read or edit by the user.\n * @param options.ancestorOffset An offset from the boundary of scrollable ancestors (if any)\n * the `target` will be moved by if the viewport is scrolled. It enhances the user experience\n * by keeping the `target` some distance from the edge of the ancestors and thus making it easier to\n * read or edit by the user.\n * @param options.alignToTop When set `true`, the helper will make sure the `target` is scrolled up\n * to the top boundary of the viewport and/or scrollable ancestors if scrolled up. When not set\n * (default), the `target` will be revealed by scrolling as little as possible. This option will\n * not affect `targets` that must be scrolled down because they will appear at the top of the boundary\n * anyway.\n *\n * ```\n * scrollViewportToShowTarget() with scrollViewportToShowTarget() with\n * Initial state alignToTop unset (default) alignToTop = true\n *\n * ┌────────────────────────────────┬─┠┌────────────────────────────────┬─┠┌────────────────────────────────┬─â”\n * │ │▲│ │ │▲│ │ [ Target to be revealed ] │▲│\n * │ │ │ │ │ │ │ │ │\n * │ │█│ │ │ │ │ │ │\n * │ │█│ │ │ │ │ │ │\n * │ │ │ │ │█│ │ │ │\n * │ │ │ │ │█│ │ │█│\n * │ │ │ │ │ │ │ │█│\n * │ │▼│ │ [ Target to be revealed ] │▼│ │ │▼│\n * └────────────────────────────────┴─┘ └────────────────────────────────┴─┘ └────────────────────────────────┴─┘\n *\n *\n * [ Target to be revealed ]\n *```\n *\n * @param options.forceScroll When set `true`, the `target` will be aligned to the top of the viewport\n * and scrollable ancestors whether it is already visible or not. This option will only work when `alignToTop`\n * is `true`\n */\nexport function scrollViewportToShowTarget({ target, viewportOffset = 0, ancestorOffset = 0, alignToTop, forceScroll }) {\n const targetWindow = getWindow(target);\n let currentWindow = targetWindow;\n let currentFrame = null;\n viewportOffset = normalizeViewportOffset(viewportOffset);\n // Iterate over all windows, starting from target's parent window up to window#top.\n while (currentWindow) {\n let firstAncestorToScroll;\n // Let's scroll target's ancestors first to reveal it. Then, once the ancestor scrolls\n // settled down, the algorithm can eventually scroll the viewport of the current window.\n //\n // Note: If the current window is target's **original** window (e.g. the first one),\n // start scrolling the closest parent of the target. If not, scroll the closest parent\n // of an iframe that resides in the current window.\n if (currentWindow == targetWindow) {\n firstAncestorToScroll = getParentElement(target);\n }\n else {\n firstAncestorToScroll = getParentElement(currentFrame);\n }\n // Scroll the target's ancestors first. Once done, scrolling the viewport is easy.\n scrollAncestorsToShowRect({\n parent: firstAncestorToScroll,\n getRect: () => {\n // Note: If the target does not belong to the current window **directly**,\n // i.e. it resides in an iframe belonging to the window, obtain the target's rect\n // in the coordinates of the current window. By default, a Rect returns geometry\n // relative to the current window's viewport. To make it work in a parent window,\n // it must be shifted.\n return getRectRelativeToWindow(target, currentWindow);\n },\n alignToTop,\n ancestorOffset,\n forceScroll\n });\n // Obtain the rect of the target after it has been scrolled within its ancestors.\n // It's time to scroll the viewport.\n const targetRect = getRectRelativeToWindow(target, currentWindow);\n scrollWindowToShowRect({\n window: currentWindow,\n rect: targetRect,\n viewportOffset,\n alignToTop,\n forceScroll\n });\n if (currentWindow.parent != currentWindow) {\n // Keep the reference to the <iframe> element the \"previous current window\" was\n // rendered within. It will be useful to re–calculate the rect of the target\n // in the parent window's relative geometry. The target's rect must be shifted\n // by it's iframe's position.\n currentFrame = currentWindow.frameElement;\n currentWindow = currentWindow.parent;\n // If the current window has some parent but frameElement is inaccessible, then they have\n // different domains/ports and, due to security reasons, accessing and scrolling\n // the parent window won't be possible.\n // See https://github.com/ckeditor/ckeditor5/issues/930.\n if (!currentFrame) {\n return;\n }\n }\n else {\n currentWindow = null;\n }\n }\n}\n/**\n * Makes any page `HTMLElement` or `Range` (target) visible within its scrollable ancestors,\n * e.g. if they have `overflow: scroll` CSS style.\n *\n * @param target A target, which supposed to become visible to the user.\n * @param ancestorOffset An offset between the target and the boundary of scrollable ancestors\n * to be maintained while scrolling.\n * @param limiterElement The outermost ancestor that should be scrolled. If specified, it can prevent\n * scrolling the whole page.\n */\nexport function scrollAncestorsToShowTarget(target, ancestorOffset, limiterElement) {\n const targetParent = getParentElement(target);\n scrollAncestorsToShowRect({\n parent: targetParent,\n getRect: () => new Rect(target),\n ancestorOffset,\n limiterElement\n });\n}\n/**\n * Makes a given rect visible within its parent window.\n *\n * Note: Avoid the situation where the caret is still in the viewport, but totally\n * at the edge of it. In such situation, if it moved beyond the viewport in the next\n * action e.g. after paste, the scrolling would move it to the viewportOffset level\n * and it all would look like the caret visually moved up/down:\n *\n * 1.\n * ```\n * | foo[]\n * | <--- N px of space below the caret\n * +---------------------------------...\n * ```\n *\n * 2. *paste*\n * 3.\n * ```\n * |\n * |\n * +-foo-----------------------------...\n * bar[] <--- caret below viewport, scrolling...\n * ```\n *\n * 4. *scrolling*\n * 5.\n * ```\n * |\n * | foo\n * | bar[] <--- caret precisely at the edge\n * +---------------------------------...\n * ```\n *\n * To prevent this, this method checks the rects moved by the viewportOffset to cover\n * the upper/lower edge of the viewport. It makes sure if the action repeats, there's\n * no twitching – it's a purely visual improvement:\n *\n * 5. (after fix)\n * ```\n * |\n * | foo\n * | bar[]\n * | <--- N px of space below the caret\n * +---------------------------------...\n * ```\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.window A window which is scrolled to reveal the rect.\n * @param options.rect A rect which is to be revealed.\n * @param options.viewportOffset An offset from the edge of the viewport (in pixels) the `rect` will be\n * moved by if the viewport is scrolled.\n * @param options.alignToTop When set `true`, the helper will make sure the `rect` is scrolled up\n * to the top boundary of the viewport if scrolled up. When not set (default), the `rect` will be\n * revealed by scrolling as little as possible. This option will not affect rects that must be scrolled\n * down because they will appear at the top of the boundary anyway.\n * @param options.forceScroll When set `true`, the `rect` will be aligned to the top of the viewport\n * whether it is already visible or not. This option will only work when `alignToTop` is `true`\n */\nfunction scrollWindowToShowRect({ window, rect, alignToTop, forceScroll, viewportOffset }) {\n const targetShiftedDownRect = rect.clone().moveBy(0, viewportOffset.bottom);\n const targetShiftedUpRect = rect.clone().moveBy(0, -viewportOffset.top);\n const viewportRect = new Rect(window).excludeScrollbarsAndBorders();\n const rects = [targetShiftedUpRect, targetShiftedDownRect];\n const forceScrollToTop = alignToTop && forceScroll;\n const allRectsFitInViewport = rects.every(rect => viewportRect.contains(rect));\n let { scrollX, scrollY } = window;\n const initialScrollX = scrollX;\n const initialScrollY = scrollY;\n if (forceScrollToTop) {\n scrollY -= (viewportRect.top - rect.top) + viewportOffset.top;\n }\n else if (!allRectsFitInViewport) {\n if (isAbove(targetShiftedUpRect, viewportRect)) {\n scrollY -= viewportRect.top - rect.top + viewportOffset.top;\n }\n else if (isBelow(targetShiftedDownRect, viewportRect)) {\n if (alignToTop) {\n scrollY += rect.top - viewportRect.top - viewportOffset.top;\n }\n else {\n scrollY += rect.bottom - viewportRect.bottom + viewportOffset.bottom;\n }\n }\n }\n if (!allRectsFitInViewport) {\n // TODO: Web browsers scroll natively to place the target in the middle\n // of the viewport. It's not a very popular case, though.\n if (isLeftOf(rect, viewportRect)) {\n scrollX -= viewportRect.left - rect.left + viewportOffset.left;\n }\n else if (isRightOf(rect, viewportRect)) {\n scrollX += rect.right - viewportRect.right + viewportOffset.right;\n }\n }\n if (scrollX != initialScrollX || scrollY !== initialScrollY) {\n window.scrollTo(scrollX, scrollY);\n }\n}\n/**\n * Recursively scrolls element ancestors to visually reveal a rect.\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.parent The first parent ancestor to start scrolling.\n * @param options.getRect A function which returns the Rect, which is to be revealed.\n * @param options.ancestorOffset An offset from the boundary of scrollable ancestors (if any)\n * the `Rect` instance will be moved by if the viewport is scrolled.\n * @param options.alignToTop When set `true`, the helper will make sure the `Rect` instance is scrolled up\n * to the top boundary of the scrollable ancestors if scrolled up. When not set (default), the `rect`\n * will be revealed by scrolling as little as possible. This option will not affect rects that must be\n * scrolled down because they will appear at the top of the boundary\n * anyway.\n * @param options.forceScroll When set `true`, the `rect` will be aligned to the top of scrollable ancestors\n * whether it is already visible or not. This option will only work when `alignToTop` is `true`\n * @param options.limiterElement The outermost ancestor that should be scrolled. Defaults to the `<body>` element.\n */\nfunction scrollAncestorsToShowRect({ parent, getRect, alignToTop, forceScroll, ancestorOffset = 0, limiterElement }) {\n const parentWindow = getWindow(parent);\n const forceScrollToTop = alignToTop && forceScroll;\n let parentRect, targetRect, targetFitsInTarget;\n const limiter = limiterElement || parentWindow.document.body;\n while (parent != limiter) {\n targetRect = getRect();\n parentRect = new Rect(parent).excludeScrollbarsAndBorders();\n targetFitsInTarget = parentRect.contains(targetRect);\n if (forceScrollToTop) {\n parent.scrollTop -= (parentRect.top - targetRect.top) + ancestorOffset;\n }\n else if (!targetFitsInTarget) {\n if (isAbove(targetRect, parentRect)) {\n parent.scrollTop -= parentRect.top - targetRect.top + ancestorOffset;\n }\n else if (isBelow(targetRect, parentRect)) {\n if (alignToTop) {\n parent.scrollTop += targetRect.top - parentRect.top - ancestorOffset;\n }\n else {\n parent.scrollTop += targetRect.bottom - parentRect.bottom + ancestorOffset;\n }\n }\n }\n if (!targetFitsInTarget) {\n if (isLeftOf(targetRect, parentRect)) {\n parent.scrollLeft -= parentRect.left - targetRect.left + ancestorOffset;\n }\n else if (isRightOf(targetRect, parentRect)) {\n parent.scrollLeft += targetRect.right - parentRect.right + ancestorOffset;\n }\n }\n parent = parent.parentNode;\n }\n}\n/**\n * Determines if a given `Rect` extends beyond the bottom edge of the second `Rect`.\n */\nfunction isBelow(firstRect, secondRect) {\n return firstRect.bottom > secondRect.bottom;\n}\n/**\n * Determines if a given `Rect` extends beyond the top edge of the second `Rect`.\n */\nfunction isAbove(firstRect, secondRect) {\n return firstRect.top < secondRect.top;\n}\n/**\n * Determines if a given `Rect` extends beyond the left edge of the second `Rect`.\n */\nfunction isLeftOf(firstRect, secondRect) {\n return firstRect.left < secondRect.left;\n}\n/**\n * Determines if a given `Rect` extends beyond the right edge of the second `Rect`.\n */\nfunction isRightOf(firstRect, secondRect) {\n return firstRect.right > secondRect.right;\n}\n/**\n * Returns the closest window of an element or range.\n */\nfunction getWindow(elementOrRange) {\n if (isRange(elementOrRange)) {\n return elementOrRange.startContainer.ownerDocument.defaultView;\n }\n else {\n return elementOrRange.ownerDocument.defaultView;\n }\n}\n/**\n * Returns the closest parent of an element or DOM range.\n */\nfunction getParentElement(elementOrRange) {\n if (isRange(elementOrRange)) {\n let parent = elementOrRange.commonAncestorContainer;\n // If a Range is attached to the Text, use the closest element ancestor.\n if (isText(parent)) {\n parent = parent.parentNode;\n }\n return parent;\n }\n else {\n return elementOrRange.parentNode;\n }\n}\n/**\n * Returns the rect of an element or range residing in an iframe.\n * The result rect is relative to the geometry of the passed window instance.\n *\n * @param target Element or range which rect should be returned.\n * @param relativeWindow A window the rect should be relative to.\n */\nfunction getRectRelativeToWindow(target, relativeWindow) {\n const targetWindow = getWindow(target);\n const rect = new Rect(target);\n if (targetWindow === relativeWindow) {\n return rect;\n }\n else {\n let currentWindow = targetWindow;\n while (currentWindow != relativeWindow) {\n const frame = currentWindow.frameElement;\n const frameRect = new Rect(frame).excludeScrollbarsAndBorders();\n rect.moveBy(frameRect.left, frameRect.top);\n currentWindow = currentWindow.parent;\n }\n }\n return rect;\n}\n/**\n * A helper that explodes the `viewportOffset` configuration if defined as a plain number into an object\n * with `top`, `bottom`, `left`, and `right` properties.\n *\n * If an object value is passed, this helper will pass it through.\n *\n * @param viewportOffset Viewport offset to be normalized.\n */\nfunction normalizeViewportOffset(viewportOffset) {\n if (typeof viewportOffset === 'number') {\n return {\n top: viewportOffset,\n bottom: viewportOffset,\n left: viewportOffset,\n right: viewportOffset\n };\n }\n return viewportOffset;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport CKEditorError from './ckeditorerror.js';\nimport env from './env.js';\nconst modifiersToGlyphsMac = {\n ctrl: '⌃',\n cmd: '⌘',\n alt: '⌥',\n shift: '⇧'\n};\nconst modifiersToGlyphsNonMac = {\n ctrl: 'Ctrl+',\n alt: 'Alt+',\n shift: 'Shift+'\n};\nconst keyCodesToGlyphs = {\n 37: 'â†',\n 38: '↑',\n 39: '→',\n 40: '↓',\n 9: '⇥',\n 33: 'Page Up',\n 34: 'Page Down'\n};\n/**\n * An object with `keyName => keyCode` pairs for a set of known keys.\n *\n * Contains:\n *\n * * `a-z`,\n * * `0-9`,\n * * `f1-f12`,\n * * `` ` ``, `-`, `=`, `[`, `]`, `;`, `'`, `,`, `.`, `/`, `\\`,\n * * `arrow(left|up|right|bottom)`,\n * * `backspace`, `delete`, `enter`, `esc`, `tab`,\n * * `ctrl`, `cmd`, `shift`, `alt`.\n */\nexport const keyCodes = /* #__PURE__ */ generateKnownKeyCodes();\nconst keyCodeNames = /* #__PURE__ */ Object.fromEntries(\n/* #__PURE__ */ Object.entries(keyCodes).map(([name, code]) => {\n let prettyKeyName;\n if (code in keyCodesToGlyphs) {\n prettyKeyName = keyCodesToGlyphs[code];\n }\n else {\n prettyKeyName = name.charAt(0).toUpperCase() + name.slice(1);\n }\n return [code, prettyKeyName];\n}));\n/**\n * Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.\n *\n * Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.\n *\n * @param key A key name (see {@link module:utils/keyboard#keyCodes}) or a keystroke data object.\n * @returns Key or keystroke code.\n */\nexport function getCode(key) {\n let keyCode;\n if (typeof key == 'string') {\n keyCode = keyCodes[key.toLowerCase()];\n if (!keyCode) {\n /**\n * Unknown key name. Only key names included in the {@link module:utils/keyboard#keyCodes} can be used.\n *\n * @error keyboard-unknown-key\n * @param {String} key\n */\n throw new CKEditorError('keyboard-unknown-key', null, { key });\n }\n }\n else {\n keyCode = key.keyCode +\n (key.altKey ? keyCodes.alt : 0) +\n (key.ctrlKey ? keyCodes.ctrl : 0) +\n (key.shiftKey ? keyCodes.shift : 0) +\n (key.metaKey ? keyCodes.cmd : 0);\n }\n return keyCode;\n}\n/**\n * Parses the keystroke and returns a keystroke code that will match the code returned by\n * {@link module:utils/keyboard~getCode} for the corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.\n *\n * The keystroke can be passed in two formats:\n *\n * * as a single string – e.g. `ctrl + A`,\n * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:\n * * `[ 'ctrl', 32 ]` (ctrl + space),\n * * `[ 'ctrl', 'a' ]` (ctrl + A).\n *\n * Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.\n *\n * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).\n *\n * Note: On macOS, keystroke handling is translating the `Ctrl` key to the `Cmd` key and handling only that keystroke.\n * For example, a registered keystroke `Ctrl+A` will be translated to `Cmd+A` on macOS. To disable the translation of some keystroke,\n * use the forced modifier: `Ctrl!+A` (note the exclamation mark).\n *\n * @param keystroke The keystroke definition.\n * @returns Keystroke code.\n */\nexport function parseKeystroke(keystroke) {\n if (typeof keystroke == 'string') {\n keystroke = splitKeystrokeText(keystroke);\n }\n return keystroke\n .map(key => (typeof key == 'string') ? getEnvKeyCode(key) : key)\n .reduce((key, sum) => sum + key, 0);\n}\n/**\n * Translates any keystroke string text like `\"Ctrl+A\"` to an\n * environment–specific keystroke, i.e. `\"⌘A\"` on macOS.\n *\n * @param keystroke The keystroke text.\n * @returns The keystroke text specific for the environment.\n */\nexport function getEnvKeystrokeText(keystroke) {\n let keystrokeCode = parseKeystroke(keystroke);\n const modifiersToGlyphs = Object.entries((env.isMac || env.isiOS) ? modifiersToGlyphsMac : modifiersToGlyphsNonMac);\n const modifiers = modifiersToGlyphs.reduce((modifiers, [name, glyph]) => {\n // Modifier keys are stored as a bit mask so extract those from the keystroke code.\n if ((keystrokeCode & keyCodes[name]) != 0) {\n keystrokeCode &= ~keyCodes[name];\n modifiers += glyph;\n }\n return modifiers;\n }, '');\n return modifiers + (keystrokeCode ? keyCodeNames[keystrokeCode] : '');\n}\n/**\n * Returns `true` if the provided key code represents one of the arrow keys.\n *\n * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.\n */\nexport function isArrowKeyCode(keyCode) {\n return keyCode == keyCodes.arrowright ||\n keyCode == keyCodes.arrowleft ||\n keyCode == keyCodes.arrowup ||\n keyCode == keyCodes.arrowdown;\n}\n/**\n * Returns the direction in which the {@link module:engine/model/documentselection~DocumentSelection selection}\n * will move when the provided arrow key code is pressed considering the language direction of the editor content.\n *\n * For instance, in right–to–left (RTL) content languages, pressing the left arrow means moving the selection right (forward)\n * in the model structure. Similarly, pressing the right arrow moves the selection left (backward).\n *\n * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.\n * @param contentLanguageDirection The content language direction, corresponding to\n * {@link module:utils/locale~Locale#contentLanguageDirection}.\n * @returns Localized arrow direction or `undefined` for non-arrow key codes.\n */\nexport function getLocalizedArrowKeyCodeDirection(keyCode, contentLanguageDirection) {\n const isLtrContent = contentLanguageDirection === 'ltr';\n switch (keyCode) {\n case keyCodes.arrowleft:\n return isLtrContent ? 'left' : 'right';\n case keyCodes.arrowright:\n return isLtrContent ? 'right' : 'left';\n case keyCodes.arrowup:\n return 'up';\n case keyCodes.arrowdown:\n return 'down';\n }\n}\n/**\n * Converts a key name to the key code with mapping based on the env.\n *\n * See: {@link module:utils/keyboard~getCode}.\n *\n * @param key The key name (see {@link module:utils/keyboard#keyCodes}).\n * @returns Key code.\n */\nfunction getEnvKeyCode(key) {\n // Don't remap modifier key for forced modifiers.\n if (key.endsWith('!')) {\n return getCode(key.slice(0, -1));\n }\n const code = getCode(key);\n return (env.isMac || env.isiOS) && code == keyCodes.ctrl ? keyCodes.cmd : code;\n}\n/**\n * Determines if the provided key code moves the {@link module:engine/model/documentselection~DocumentSelection selection}\n * forward or backward considering the language direction of the editor content.\n *\n * For instance, in right–to–left (RTL) languages, pressing the left arrow means moving forward\n * in the model structure. Similarly, pressing the right arrow moves the selection backward.\n *\n * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.\n * @param contentLanguageDirection The content language direction, corresponding to\n * {@link module:utils/locale~Locale#contentLanguageDirection}.\n */\nexport function isForwardArrowKeyCode(keyCode, contentLanguageDirection) {\n const localizedKeyCodeDirection = getLocalizedArrowKeyCodeDirection(keyCode, contentLanguageDirection);\n return localizedKeyCodeDirection === 'down' || localizedKeyCodeDirection === 'right';\n}\nfunction generateKnownKeyCodes() {\n const keyCodes = {\n pageup: 33,\n pagedown: 34,\n arrowleft: 37,\n arrowup: 38,\n arrowright: 39,\n arrowdown: 40,\n backspace: 8,\n delete: 46,\n enter: 13,\n space: 32,\n esc: 27,\n tab: 9,\n // The idea about these numbers is that they do not collide with any real key codes, so we can use them\n // like bit masks.\n ctrl: 0x110000,\n shift: 0x220000,\n alt: 0x440000,\n cmd: 0x880000\n };\n // a-z\n for (let code = 65; code <= 90; code++) {\n const letter = String.fromCharCode(code);\n keyCodes[letter.toLowerCase()] = code;\n }\n // 0-9\n for (let code = 48; code <= 57; code++) {\n keyCodes[code - 48] = code;\n }\n // F1-F12\n for (let code = 112; code <= 123; code++) {\n keyCodes['f' + (code - 111)] = code;\n }\n // other characters\n Object.assign(keyCodes, {\n '\\'': 222,\n ',': 108,\n '-': 109,\n '.': 110,\n '/': 111,\n ';': 186,\n '=': 187,\n '[': 219,\n '\\\\': 220,\n ']': 221,\n '`': 223\n });\n return keyCodes;\n}\nfunction splitKeystrokeText(keystroke) {\n return keystroke.split('+').map(key => key.trim());\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nexport default function toArray(data) {\n return Array.isArray(data) ? data : [data];\n}\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport CKEditorError from './ckeditorerror.js';\nimport global from './dom/global.js';\nimport { merge } from 'lodash-es';\n/* istanbul ignore else -- @preserve */\nif (!global.window.CKEDITOR_TRANSLATIONS) {\n global.window.CKEDITOR_TRANSLATIONS = {};\n}\n/**\n * Adds translations to existing ones or overrides the existing translations. These translations will later\n * be available for the {@link module:utils/locale~Locale#t `t()`} function.\n *\n * The `translations` is an object which consists of `messageId: translation` pairs. Note that the message ID can be\n * either constructed from the message string or from the message ID if it was passed\n * (this happens rarely and mostly for short messages or messages with placeholders).\n * Since the editor displays only the message string, the message ID can be found either in the source code or in the\n * built translations for another language.\n *\n * ```ts\n * add( 'pl', {\n * \t'Cancel': 'Anuluj',\n * \t'IMAGE': 'obraz', // Note that the `IMAGE` comes from the message ID, while the string can be `image`.\n * } );\n * ```\n *\n * If the message is supposed to support various plural forms, make sure to provide an array with the singular form and all plural forms:\n *\n * ```ts\n * add( 'pl', {\n * \t'Add space': [ 'Dodaj spacjÄ™', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]\n * } );\n * ```\n *\n * You should also specify the third argument (the `getPluralForm()` function) that will be used to determine the plural form if no\n * language file was loaded for that language. All language files coming from CKEditor 5 sources will have this option set, so\n * these plural form rules will be reused by other translations added to the registered languages. The `getPluralForm()` function\n * can return either a Boolean or a number.\n *\n * ```ts\n * add( 'en', {\n * \t// ... Translations.\n * }, n => n !== 1 );\n * add( 'pl', {\n * \t// ... Translations.\n * }, n => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && ( n % 100 < 10 || n % 100 >= 20 ) ? 1 : 2 );\n * ```\n *\n * All translations extend the global `window.CKEDITOR_TRANSLATIONS` object. An example of this object can be found below:\n *\n * ```ts\n * {\n * \tpl: {\n * \t\tdictionary: {\n * \t\t\t'Cancel': 'Anuluj',\n * \t\t\t'Add space': [ 'Dodaj spacjÄ™', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]\n * \t\t},\n * \t\t// A function that returns the plural form index.\n * \t\tgetPluralForm: n => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && ( n % 100 < 10 || n % 100 >= 20 ) ? 1 : 2 );\n * \t}\n * \t// Other languages.\n * \t}\n * ```\n *\n * If you cannot import this function from this module (e.g. because you use a CKEditor 5 build), you can\n * still add translations by extending the global `window.CKEDITOR_TRANSLATIONS` object by using a function like\n * the one below:\n *\n * ```ts\n * function addTranslations( language, translations, getPluralForm ) {\n * \tif ( !global.window.CKEDITOR_TRANSLATIONS ) {\n * \t\tglobal.window.CKEDITOR_TRANSLATIONS = {};\n * \t}\n\n * \tif ( !global.window.CKEDITOR_TRANSLATIONS[ language ] ) {\n * \t\tglobal.window.CKEDITOR_TRANSLATIONS[ language ] = {};\n * \t}\n *\n * \tconst languageTranslations = global.window.CKEDITOR_TRANSLATIONS[ language ];\n *\n * \tlanguageTranslations.dictionary = languageTranslations.dictionary || {};\n * \tlanguageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;\n *\n * \t// Extend the dictionary for the given language.\n * \tObject.assign( languageTranslations.dictionary, translations );\n * }\n * ```\n *\n * @param language Target language.\n * @param translations An object with translations which will be added to the dictionary.\n * For each message ID the value should be either a translation or an array of translations if the message\n * should support plural forms.\n * @param getPluralForm A function that returns the plural form index (a number).\n */\nexport function add(language, translations, getPluralForm) {\n if (!global.window.CKEDITOR_TRANSLATIONS[language]) {\n global.window.CKEDITOR_TRANSLATIONS[language] = {};\n }\n const languageTranslations = global.window.CKEDITOR_TRANSLATIONS[language];\n languageTranslations.dictionary = languageTranslations.dictionary || {};\n languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;\n Object.assign(languageTranslations.dictionary, translations);\n}\n/**\n * **Note:** This method is internal, use {@link module:utils/locale~Locale#t the `t()` function} instead to translate\n * the editor UI parts.\n *\n * This function is responsible for translating messages to the specified language. It uses translations added perviously\n * by {@link module:utils/translation-service~add} (a translations dictionary and the `getPluralForm()` function\n * to provide accurate translations of plural forms).\n *\n * When no translation is defined in the dictionary or the dictionary does not exist, this function returns\n * the original message string or the message plural depending on the number of elements.\n *\n * ```ts\n * translate( 'pl', { string: 'Cancel' } ); // 'Cancel'\n * ```\n *\n * The third optional argument is the number of elements, based on which the single form or one of the plural forms\n * should be picked when the message is supposed to support various plural forms.\n *\n * ```ts\n * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space'\n * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 3 ); // 'Add %0 spaces'\n * ```\n *\n * The message should provide an ID using the `id` property when the message strings are not unique and their\n * translations should be different.\n *\n * ```ts\n * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );\n * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );\n * ```\n *\n * @internal\n * @param language Target language.\n * @param message A message that will be translated.\n * @param quantity The number of elements for which a plural form should be picked from the target language dictionary.\n * @param translations Translations passed in editor config, if not provided use the global `window.CKEDITOR_TRANSLATIONS`.\n * @returns Translated sentence.\n */\nexport function _translate(language, message, quantity = 1, translations) {\n if (typeof quantity !== 'number') {\n /**\n * An incorrect value was passed to the translation function. This was probably caused\n * by an incorrect message interpolation of a plural form. Note that for messages supporting plural forms\n * the second argument of the `t()` function should always be a number or an array with a number as the first element.\n *\n * @error translation-service-quantity-not-a-number\n */\n throw new CKEditorError('translation-service-quantity-not-a-number', null, { quantity });\n }\n const normalizedTranslations = translations || global.window.CKEDITOR_TRANSLATIONS;\n const numberOfLanguages = getNumberOfLanguages(normalizedTranslations);\n if (numberOfLanguages === 1) {\n // Override the language to the only supported one.\n // This can't be done in the `Locale` class, because the translations comes after the `Locale` class initialization.\n language = Object.keys(normalizedTranslations)[0];\n }\n const messageId = message.id || message.string;\n if (numberOfLanguages === 0 || !hasTranslation(language, messageId, normalizedTranslations)) {\n if (quantity !== 1) {\n // Return the default plural form that was passed in the `message.plural` parameter.\n return message.plural;\n }\n return message.string;\n }\n const dictionary = normalizedTranslations[language].dictionary;\n const getPluralForm = normalizedTranslations[language].getPluralForm || (n => n === 1 ? 0 : 1);\n const translation = dictionary[messageId];\n if (typeof translation === 'string') {\n return translation;\n }\n const pluralFormIndex = Number(getPluralForm(quantity));\n // Note: The `translate` function is not responsible for replacing `%0, %1, ...` with values.\n return translation[pluralFormIndex];\n}\n/**\n * Clears dictionaries for test purposes.\n *\n * @internal\n */\nexport function _clear() {\n if (global.window.CKEDITOR_TRANSLATIONS) {\n global.window.CKEDITOR_TRANSLATIONS = {};\n }\n}\n/**\n * If array then merge objects which are inside otherwise return given object.\n *\n * @internal\n * @param translations Translations passed in editor config.\n */\nexport function _unifyTranslations(translations) {\n return Array.isArray(translations) ?\n translations.reduce((acc, translation) => merge(acc, translation)) :\n translations;\n}\n/**\n * Checks whether the dictionary exists and translation in that dictionary exists.\n */\nfunction hasTranslation(language, messageId, translations) {\n return !!translations[language] && !!translations[language].dictionary[messageId];\n}\nfunction getNumberOfLanguages(translations) {\n return Object.keys(translations).length;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nconst RTL_LANGUAGE_CODES = [\n 'ar', 'ara',\n 'dv', 'div',\n 'fa', 'per', 'fas',\n 'he', 'heb',\n 'ku', 'kur',\n 'ug', 'uig' // Uighur, Uyghur\n];\n/**\n * Helps determine whether a language text direction is LTR or RTL.\n *\n * @param languageCode The ISO 639-1 or ISO 639-2 language code.\n */\nexport function getLanguageDirection(languageCode) {\n return RTL_LANGUAGE_CODES.includes(languageCode) ? 'rtl' : 'ltr';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/locale\n */\n/* globals console */\nimport toArray from './toarray.js';\nimport { _translate, _unifyTranslations } from './translation-service.js';\nimport { getLanguageDirection } from './language.js';\n/**\n * Represents the localization services.\n */\nexport default class Locale {\n /**\n * Creates a new instance of the locale class. Learn more about\n * {@glink getting-started/setup/ui-language configuring the language of the editor}.\n *\n * @param options Locale configuration.\n * @param options.uiLanguage The editor UI language code in the\n * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. See {@link #uiLanguage}.\n * @param options.contentLanguage The editor content language code in the\n * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. If not specified, the same as `options.language`.\n * See {@link #contentLanguage}.\n * @param translations Translations passed as a editor config parameter.\n */\n constructor({ uiLanguage = 'en', contentLanguage, translations } = {}) {\n this.uiLanguage = uiLanguage;\n this.contentLanguage = contentLanguage || this.uiLanguage;\n this.uiLanguageDirection = getLanguageDirection(this.uiLanguage);\n this.contentLanguageDirection = getLanguageDirection(this.contentLanguage);\n this.translations = _unifyTranslations(translations);\n this.t = (message, values) => this._t(message, values);\n }\n /**\n * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.\n *\n * **Note**: This property was deprecated. Please use {@link #uiLanguage} and {@link #contentLanguage}\n * properties instead.\n *\n * @deprecated\n */\n get language() {\n /**\n * The {@link module:utils/locale~Locale#language `Locale#language`} property was deprecated and will\n * be removed in the near future. Please use the {@link module:utils/locale~Locale#uiLanguage `Locale#uiLanguage`} and\n * {@link module:utils/locale~Locale#contentLanguage `Locale#contentLanguage`} properties instead.\n *\n * @error locale-deprecated-language-property\n */\n console.warn('locale-deprecated-language-property: ' +\n 'The Locale#language property has been deprecated and will be removed in the near future. ' +\n 'Please use #uiLanguage and #contentLanguage properties instead.');\n return this.uiLanguage;\n }\n /**\n * An unbound version of the {@link #t} method.\n */\n _t(message, values = []) {\n values = toArray(values);\n if (typeof message === 'string') {\n message = { string: message };\n }\n const hasPluralForm = !!message.plural;\n const quantity = hasPluralForm ? values[0] : 1;\n const translatedString = _translate(this.uiLanguage, message, quantity, this.translations);\n return interpolateString(translatedString, values);\n }\n}\n/**\n * Fills the `%0, %1, ...` string placeholders with values.\n */\nfunction interpolateString(string, values) {\n return string.replace(/%(\\d+)/g, (match, index) => {\n return (index < values.length) ? values[index] : match;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/collection\n */\nimport EmitterMixin from './emittermixin.js';\nimport CKEditorError from './ckeditorerror.js';\nimport uid from './uid.js';\nimport isIterable from './isiterable.js';\n/**\n * Collections are ordered sets of objects. Items in the collection can be retrieved by their indexes\n * in the collection (like in an array) or by their ids.\n *\n * If an object without an `id` property is being added to the collection, the `id` property will be generated\n * automatically. Note that the automatically generated id is unique only within this single collection instance.\n *\n * By default an item in the collection is identified by its `id` property. The name of the identifier can be\n * configured through the constructor of the collection.\n *\n * @typeParam T The type of the collection element.\n */\nexport default class Collection extends /* #__PURE__ */ EmitterMixin() {\n constructor(initialItemsOrOptions = {}, options = {}) {\n super();\n const hasInitialItems = isIterable(initialItemsOrOptions);\n if (!hasInitialItems) {\n options = initialItemsOrOptions;\n }\n this._items = [];\n this._itemMap = new Map();\n this._idProperty = options.idProperty || 'id';\n this._bindToExternalToInternalMap = new WeakMap();\n this._bindToInternalToExternalMap = new WeakMap();\n this._skippedIndexesFromExternal = [];\n // Set the initial content of the collection (if provided in the constructor).\n if (hasInitialItems) {\n for (const item of initialItemsOrOptions) {\n this._items.push(item);\n this._itemMap.set(this._getItemIdBeforeAdding(item), item);\n }\n }\n }\n /**\n * The number of items available in the collection.\n */\n get length() {\n return this._items.length;\n }\n /**\n * Returns the first item from the collection or null when collection is empty.\n */\n get first() {\n return this._items[0] || null;\n }\n /**\n * Returns the last item from the collection or null when collection is empty.\n */\n get last() {\n return this._items[this.length - 1] || null;\n }\n /**\n * Adds an item into the collection.\n *\n * If the item does not have an id, then it will be automatically generated and set on the item.\n *\n * @param item\n * @param index The position of the item in the collection. The item\n * is pushed to the collection when `index` not specified.\n * @fires add\n * @fires change\n */\n add(item, index) {\n return this.addMany([item], index);\n }\n /**\n * Adds multiple items into the collection.\n *\n * Any item not containing an id will get an automatically generated one.\n *\n * @param items\n * @param index The position of the insertion. Items will be appended if no `index` is specified.\n * @fires add\n * @fires change\n */\n addMany(items, index) {\n if (index === undefined) {\n index = this._items.length;\n }\n else if (index > this._items.length || index < 0) {\n /**\n * The `index` passed to {@link module:utils/collection~Collection#addMany `Collection#addMany()`}\n * is invalid. It must be a number between 0 and the collection's length.\n *\n * @error collection-add-item-invalid-index\n */\n throw new CKEditorError('collection-add-item-invalid-index', this);\n }\n let offset = 0;\n for (const item of items) {\n const itemId = this._getItemIdBeforeAdding(item);\n const currentItemIndex = index + offset;\n this._items.splice(currentItemIndex, 0, item);\n this._itemMap.set(itemId, item);\n this.fire('add', item, currentItemIndex);\n offset++;\n }\n this.fire('change', {\n added: items,\n removed: [],\n index\n });\n return this;\n }\n /**\n * Gets an item by its ID or index.\n *\n * @param idOrIndex The item ID or index in the collection.\n * @returns The requested item or `null` if such item does not exist.\n */\n get(idOrIndex) {\n let item;\n if (typeof idOrIndex == 'string') {\n item = this._itemMap.get(idOrIndex);\n }\n else if (typeof idOrIndex == 'number') {\n item = this._items[idOrIndex];\n }\n else {\n /**\n * An index or ID must be given.\n *\n * @error collection-get-invalid-arg\n */\n throw new CKEditorError('collection-get-invalid-arg', this);\n }\n return item || null;\n }\n /**\n * Returns a Boolean indicating whether the collection contains an item.\n *\n * @param itemOrId The item or its ID in the collection.\n * @returns `true` if the collection contains the item, `false` otherwise.\n */\n has(itemOrId) {\n if (typeof itemOrId == 'string') {\n return this._itemMap.has(itemOrId);\n }\n else { // Object\n const idProperty = this._idProperty;\n const id = itemOrId[idProperty];\n return id && this._itemMap.has(id);\n }\n }\n /**\n * Gets an index of an item in the collection.\n * When an item is not defined in the collection, the index will equal -1.\n *\n * @param itemOrId The item or its ID in the collection.\n * @returns The index of a given item.\n */\n getIndex(itemOrId) {\n let item;\n if (typeof itemOrId == 'string') {\n item = this._itemMap.get(itemOrId);\n }\n else {\n item = itemOrId;\n }\n return item ? this._items.indexOf(item) : -1;\n }\n /**\n * Removes an item from the collection.\n *\n * @param subject The item to remove, its ID or index in the collection.\n * @returns The removed item.\n * @fires remove\n * @fires change\n */\n remove(subject) {\n const [item, index] = this._remove(subject);\n this.fire('change', {\n added: [],\n removed: [item],\n index\n });\n return item;\n }\n /**\n * Executes the callback for each item in the collection and composes an array or values returned by this callback.\n *\n * @typeParam U The result type of the callback.\n * @param callback\n * @param ctx Context in which the `callback` will be called.\n * @returns The result of mapping.\n */\n map(callback, ctx) {\n return this._items.map(callback, ctx);\n }\n /**\n * Performs the specified action for each item in the collection.\n *\n * @param ctx Context in which the `callback` will be called.\n */\n forEach(callback, ctx) {\n this._items.forEach(callback, ctx);\n }\n /**\n * Finds the first item in the collection for which the `callback` returns a true value.\n *\n * @param callback\n * @param ctx Context in which the `callback` will be called.\n * @returns The item for which `callback` returned a true value.\n */\n find(callback, ctx) {\n return this._items.find(callback, ctx);\n }\n /**\n * Returns an array with items for which the `callback` returned a true value.\n *\n * @param callback\n * @param ctx Context in which the `callback` will be called.\n * @returns The array with matching items.\n */\n filter(callback, ctx) {\n return this._items.filter(callback, ctx);\n }\n /**\n * Removes all items from the collection and destroys the binding created using\n * {@link #bindTo}.\n *\n * @fires remove\n * @fires change\n */\n clear() {\n if (this._bindToCollection) {\n this.stopListening(this._bindToCollection);\n this._bindToCollection = null;\n }\n const removedItems = Array.from(this._items);\n while (this.length) {\n this._remove(0);\n }\n this.fire('change', {\n added: [],\n removed: removedItems,\n index: 0\n });\n }\n /**\n * Binds and synchronizes the collection with another one.\n *\n * The binding can be a simple factory:\n *\n * ```ts\n * class FactoryClass {\n * \tpublic label: string;\n *\n * \tconstructor( data: { label: string } ) {\n * \t\tthis.label = data.label;\n * \t}\n * }\n *\n * const source = new Collection<{ label: string }>( { idProperty: 'label' } );\n * const target = new Collection<FactoryClass>();\n *\n * target.bindTo( source ).as( FactoryClass );\n *\n * source.add( { label: 'foo' } );\n * source.add( { label: 'bar' } );\n *\n * console.log( target.length ); // 2\n * console.log( target.get( 1 ).label ); // 'bar'\n *\n * source.remove( 0 );\n * console.log( target.length ); // 1\n * console.log( target.get( 0 ).label ); // 'bar'\n * ```\n *\n * or the factory driven by a custom callback:\n *\n * ```ts\n * class FooClass {\n * \tpublic label: string;\n *\n * \tconstructor( data: { label: string } ) {\n * \t\tthis.label = data.label;\n * \t}\n * }\n *\n * class BarClass {\n * \tpublic label: string;\n *\n * \tconstructor( data: { label: string } ) {\n * \t\tthis.label = data.label;\n * \t}\n * }\n *\n * const source = new Collection<{ label: string }>( { idProperty: 'label' } );\n * const target = new Collection<FooClass | BarClass>();\n *\n * target.bindTo( source ).using( ( item ) => {\n * \tif ( item.label == 'foo' ) {\n * \t\treturn new FooClass( item );\n * \t} else {\n * \t\treturn new BarClass( item );\n * \t}\n * } );\n *\n * source.add( { label: 'foo' } );\n * source.add( { label: 'bar' } );\n *\n * console.log( target.length ); // 2\n * console.log( target.get( 0 ) instanceof FooClass ); // true\n * console.log( target.get( 1 ) instanceof BarClass ); // true\n * ```\n *\n * or the factory out of property name:\n *\n * ```ts\n * const source = new Collection<{ nested: { value: string } }>();\n * const target = new Collection<{ value: string }>();\n *\n * target.bindTo( source ).using( 'nested' );\n *\n * source.add( { nested: { value: 'foo' } } );\n * source.add( { nested: { value: 'bar' } } );\n *\n * console.log( target.length ); // 2\n * console.log( target.get( 0 ).value ); // 'foo'\n * console.log( target.get( 1 ).value ); // 'bar'\n * ```\n *\n * It's possible to skip specified items by returning null value:\n *\n * ```ts\n * const source = new Collection<{ hidden: boolean }>();\n * const target = new Collection<{ hidden: boolean }>();\n *\n * target.bindTo( source ).using( item => {\n * \tif ( item.hidden ) {\n * \t\treturn null;\n * \t}\n *\n * \treturn item;\n * } );\n *\n * source.add( { hidden: true } );\n * source.add( { hidden: false } );\n *\n * console.log( source.length ); // 2\n * console.log( target.length ); // 1\n * ```\n *\n * **Note**: {@link #clear} can be used to break the binding.\n *\n * @typeParam S The type of `externalCollection` element.\n * @param externalCollection A collection to be bound.\n * @returns The binding chain object.\n */\n bindTo(externalCollection) {\n if (this._bindToCollection) {\n /**\n * The collection cannot be bound more than once.\n *\n * @error collection-bind-to-rebind\n */\n throw new CKEditorError('collection-bind-to-rebind', this);\n }\n this._bindToCollection = externalCollection;\n return {\n as: Class => {\n this._setUpBindToBinding(item => new Class(item));\n },\n using: callbackOrProperty => {\n if (typeof callbackOrProperty == 'function') {\n this._setUpBindToBinding(callbackOrProperty);\n }\n else {\n this._setUpBindToBinding(item => item[callbackOrProperty]);\n }\n }\n };\n }\n /**\n * Finalizes and activates a binding initiated by {@link #bindTo}.\n *\n * @param factory A function which produces collection items.\n */\n _setUpBindToBinding(factory) {\n const externalCollection = this._bindToCollection;\n // Adds the item to the collection once a change has been done to the external collection.\n const addItem = (evt, externalItem, index) => {\n const isExternalBoundToThis = externalCollection._bindToCollection == this;\n const externalItemBound = externalCollection._bindToInternalToExternalMap.get(externalItem);\n // If an external collection is bound to this collection, which makes it a 2–way binding,\n // and the particular external collection item is already bound, don't add it here.\n // The external item has been created **out of this collection's item** and (re)adding it will\n // cause a loop.\n if (isExternalBoundToThis && externalItemBound) {\n this._bindToExternalToInternalMap.set(externalItem, externalItemBound);\n this._bindToInternalToExternalMap.set(externalItemBound, externalItem);\n }\n else {\n const item = factory(externalItem);\n // When there is no item we need to remember skipped index first and then we can skip this item.\n if (!item) {\n this._skippedIndexesFromExternal.push(index);\n return;\n }\n // Lets try to put item at the same index as index in external collection\n // but when there are a skipped items in one or both collections we need to recalculate this index.\n let finalIndex = index;\n // When we try to insert item after some skipped items from external collection we need\n // to include this skipped items and decrease index.\n //\n // For the following example:\n // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal' ]\n // internal -> [ A ]\n //\n // Another item is been added at the end of external collection:\n // external.add( 'D' )\n // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal', 'D' ]\n //\n // We can't just add 'D' to internal at the same index as index in external because\n // this will produce empty indexes what is invalid:\n // internal -> [ 'A', empty, empty, 'D' ]\n //\n // So we need to include skipped items and decrease index\n // internal -> [ 'A', 'D' ]\n for (const skipped of this._skippedIndexesFromExternal) {\n if (index > skipped) {\n finalIndex--;\n }\n }\n // We need to take into consideration that external collection could skip some items from\n // internal collection.\n //\n // For the following example:\n // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external' ]\n // external -> [ A ]\n //\n // Another item is been added at the end of external collection:\n // external.add( 'D' )\n // external -> [ 'A', 'D' ]\n //\n // We need to include skipped items and place new item after them:\n // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external', 'D' ]\n for (const skipped of externalCollection._skippedIndexesFromExternal) {\n if (finalIndex >= skipped) {\n finalIndex++;\n }\n }\n this._bindToExternalToInternalMap.set(externalItem, item);\n this._bindToInternalToExternalMap.set(item, externalItem);\n this.add(item, finalIndex);\n // After adding new element to internal collection we need update indexes\n // of skipped items in external collection.\n for (let i = 0; i < externalCollection._skippedIndexesFromExternal.length; i++) {\n if (finalIndex <= externalCollection._skippedIndexesFromExternal[i]) {\n externalCollection._skippedIndexesFromExternal[i]++;\n }\n }\n }\n };\n // Load the initial content of the collection.\n for (const externalItem of externalCollection) {\n addItem(null, externalItem, externalCollection.getIndex(externalItem));\n }\n // Synchronize the with collection as new items are added.\n this.listenTo(externalCollection, 'add', addItem);\n // Synchronize the with collection as new items are removed.\n this.listenTo(externalCollection, 'remove', (evt, externalItem, index) => {\n const item = this._bindToExternalToInternalMap.get(externalItem);\n if (item) {\n this.remove(item);\n }\n // After removing element from external collection we need update/remove indexes\n // of skipped items in internal collection.\n this._skippedIndexesFromExternal = this._skippedIndexesFromExternal.reduce((result, skipped) => {\n if (index < skipped) {\n result.push(skipped - 1);\n }\n if (index > skipped) {\n result.push(skipped);\n }\n return result;\n }, []);\n });\n }\n /**\n * Returns an unique id property for a given `item`.\n *\n * The method will generate new id and assign it to the `item` if it doesn't have any.\n *\n * @param item Item to be added.\n */\n _getItemIdBeforeAdding(item) {\n const idProperty = this._idProperty;\n let itemId;\n if ((idProperty in item)) {\n itemId = item[idProperty];\n if (typeof itemId != 'string') {\n /**\n * This item's ID should be a string.\n *\n * @error collection-add-invalid-id\n */\n throw new CKEditorError('collection-add-invalid-id', this);\n }\n if (this.get(itemId)) {\n /**\n * This item already exists in the collection.\n *\n * @error collection-add-item-already-exists\n */\n throw new CKEditorError('collection-add-item-already-exists', this);\n }\n }\n else {\n item[idProperty] = itemId = uid();\n }\n return itemId;\n }\n /**\n * Core {@link #remove} method implementation shared in other functions.\n *\n * In contrast this method **does not** fire the {@link #event:change} event.\n *\n * @param subject The item to remove, its id or index in the collection.\n * @returns Returns an array with the removed item and its index.\n * @fires remove\n */\n _remove(subject) {\n let index, id, item;\n let itemDoesNotExist = false;\n const idProperty = this._idProperty;\n if (typeof subject == 'string') {\n id = subject;\n item = this._itemMap.get(id);\n itemDoesNotExist = !item;\n if (item) {\n index = this._items.indexOf(item);\n }\n }\n else if (typeof subject == 'number') {\n index = subject;\n item = this._items[index];\n itemDoesNotExist = !item;\n if (item) {\n id = item[idProperty];\n }\n }\n else {\n item = subject;\n id = item[idProperty];\n index = this._items.indexOf(item);\n itemDoesNotExist = (index == -1 || !this._itemMap.get(id));\n }\n if (itemDoesNotExist) {\n /**\n * Item not found.\n *\n * @error collection-remove-404\n */\n throw new CKEditorError('collection-remove-404', this);\n }\n this._items.splice(index, 1);\n this._itemMap.delete(id);\n const externalItem = this._bindToInternalToExternalMap.get(item);\n this._bindToInternalToExternalMap.delete(item);\n this._bindToExternalToInternalMap.delete(externalItem);\n this.fire('remove', item, index);\n return [item, index];\n }\n /**\n * Iterable interface.\n */\n [Symbol.iterator]() {\n return this._items[Symbol.iterator]();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/first\n */\n/**\n * Returns first item of the given `iterator`.\n */\nexport default function first(iterator) {\n const iteratorItem = iterator.next();\n if (iteratorItem.done) {\n return null;\n }\n return iteratorItem.value;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* global setTimeout, clearTimeout */\n/**\n * @module utils/focustracker\n */\nimport DomEmitterMixin from './dom/emittermixin.js';\nimport ObservableMixin from './observablemixin.js';\nimport CKEditorError from './ckeditorerror.js';\n/**\n * Allows observing a group of `Element`s whether at least one of them is focused.\n *\n * Used by the {@link module:core/editor/editor~Editor} in order to track whether the focus is still within the application,\n * or were used outside of its UI.\n *\n * **Note** `focus` and `blur` listeners use event capturing, so it is only needed to register wrapper `Element`\n * which contain other `focusable` elements. But note that this wrapper element has to be focusable too\n * (have e.g. `tabindex=\"-1\"`).\n *\n * Check out the {@glink framework/deep-dive/ui/focus-tracking \"Deep dive into focus tracking\"} guide to learn more.\n */\nexport default class FocusTracker extends /* #__PURE__ */ DomEmitterMixin(/* #__PURE__ */ ObservableMixin()) {\n constructor() {\n super();\n /**\n * List of registered elements.\n *\n * @internal\n */\n this._elements = new Set();\n /**\n * Event loop timeout.\n */\n this._nextEventLoopTimeout = null;\n this.set('isFocused', false);\n this.set('focusedElement', null);\n }\n /**\n * Starts tracking the specified element.\n */\n add(element) {\n if (this._elements.has(element)) {\n /**\n * This element is already tracked by {@link module:utils/focustracker~FocusTracker}.\n *\n * @error focustracker-add-element-already-exist\n */\n throw new CKEditorError('focustracker-add-element-already-exist', this);\n }\n this.listenTo(element, 'focus', () => this._focus(element), { useCapture: true });\n this.listenTo(element, 'blur', () => this._blur(), { useCapture: true });\n this._elements.add(element);\n }\n /**\n * Stops tracking the specified element and stops listening on this element.\n */\n remove(element) {\n if (element === this.focusedElement) {\n this._blur();\n }\n if (this._elements.has(element)) {\n this.stopListening(element);\n this._elements.delete(element);\n }\n }\n /**\n * Destroys the focus tracker by:\n * - Disabling all event listeners attached to tracked elements.\n * - Removing all tracked elements that were previously added.\n */\n destroy() {\n this.stopListening();\n }\n /**\n * Stores currently focused element and set {@link #isFocused} as `true`.\n */\n _focus(element) {\n clearTimeout(this._nextEventLoopTimeout);\n this.focusedElement = element;\n this.isFocused = true;\n }\n /**\n * Clears currently focused element and set {@link #isFocused} as `false`.\n * This method uses `setTimeout` to change order of fires `blur` and `focus` events.\n */\n _blur() {\n clearTimeout(this._nextEventLoopTimeout);\n this._nextEventLoopTimeout = setTimeout(() => {\n this.focusedElement = null;\n this.isFocused = false;\n }, 0);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/keystrokehandler\n */\nimport DomEmitterMixin from './dom/emittermixin.js';\nimport { getCode, parseKeystroke } from './keyboard.js';\n/**\n * Keystroke handler allows registering callbacks for given keystrokes.\n *\n * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}\n * property. It allows listening to keystrokes executed in the editing view:\n *\n * ```ts\n * editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {\n * \tconsole.log( 'Ctrl+A has been pressed' );\n * \tcancel();\n * } );\n * ```\n *\n * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}\n * can use it like this:\n *\n * ```ts\n * class MyView extends View {\n * \tconstructor() {\n * \t\tthis.keystrokes = new KeystrokeHandler();\n *\n * \t\tthis.keystrokes.set( 'tab', handleTabKey );\n * \t}\n *\n * \trender() {\n * \t\tsuper.render();\n *\n * \t\tthis.keystrokes.listenTo( this.element );\n * \t}\n * }\n * ```\n *\n * That keystroke handler will listen to `keydown` events fired in this view's main element.\n *\n */\nexport default class KeystrokeHandler {\n /**\n * Creates an instance of the keystroke handler.\n */\n constructor() {\n this._listener = new (DomEmitterMixin())();\n }\n /**\n * Starts listening for `keydown` events from a given emitter.\n */\n listenTo(emitter) {\n // The #_listener works here as a kind of dispatcher. It groups the events coming from the same\n // keystroke so the listeners can be attached to them with different priorities.\n //\n // E.g. all the keystrokes with the `keyCode` of 42 coming from the `emitter` are propagated\n // as a `_keydown:42` event by the `_listener`. If there's a callback created by the `set`\n // method for this 42 keystroke, it listens to the `_listener#_keydown:42` event only and interacts\n // only with other listeners of this particular event, thus making it possible to prioritize\n // the listeners and safely cancel execution, when needed. Instead of duplicating the Emitter logic,\n // the KeystrokeHandler re–uses it to do its job.\n this._listener.listenTo(emitter, 'keydown', (evt, keyEvtData) => {\n this._listener.fire('_keydown:' + getCode(keyEvtData), keyEvtData);\n });\n }\n /**\n * Registers a handler for the specified keystroke.\n *\n * @param keystroke Keystroke defined in a format accepted by\n * the {@link module:utils/keyboard~parseKeystroke} function.\n * @param callback A function called with the\n * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and\n * a helper function to call both `preventDefault()` and `stopPropagation()` on the underlying event.\n * @param options Additional options.\n */\n set(keystroke, callback, options = {}) {\n const keyCode = parseKeystroke(keystroke);\n const priority = options.priority;\n // Execute the passed callback on KeystrokeHandler#_keydown.\n // TODO: https://github.com/ckeditor/ckeditor5-utils/issues/144\n this._listener.listenTo(this._listener, '_keydown:' + keyCode, (evt, keyEvtData) => {\n if (options.filter && !options.filter(keyEvtData)) {\n return;\n }\n callback(keyEvtData, () => {\n // Stop the event in the DOM: no listener in the web page\n // will be triggered by this event.\n keyEvtData.preventDefault();\n keyEvtData.stopPropagation();\n // Stop the event in the KeystrokeHandler: no more callbacks\n // will be executed for this keystroke.\n evt.stop();\n });\n // Mark this keystroke as handled by the callback. See: #press.\n evt.return = true;\n }, { priority });\n }\n /**\n * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.\n *\n * @param keyEvtData Key event data.\n * @returns Whether the keystroke was handled.\n */\n press(keyEvtData) {\n return !!this._listener.fire('_keydown:' + getCode(keyEvtData), keyEvtData);\n }\n /**\n * Stops listening to `keydown` events from the given emitter.\n */\n stopListening(emitter) {\n this._listener.stopListening(emitter);\n }\n /**\n * Destroys the keystroke handler.\n */\n destroy() {\n this.stopListening();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/tomap\n */\nimport objectToMap from './objecttomap.js';\nimport isIterable from './isiterable.js';\n/**\n * Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.\n *\n * ```ts\n * map = toMap( { 'foo': 1, 'bar': 2 } );\n * map = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );\n * map = toMap( anotherMap );\n * ```\n *\n * @param data Object or iterable to transform.\n * @returns Map created from data.\n */\nexport default function toMap(data) {\n if (isIterable(data)) {\n return new Map(data);\n }\n else {\n return objectToMap(data);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/objecttomap\n */\n/**\n * Transforms object to map.\n *\n * ```ts\n * const map = objectToMap( { 'foo': 1, 'bar': 2 } );\n * map.get( 'foo' ); // 1\n * ```\n *\n * **Note**: For mixed data (`Object` or `Iterable`) there's a dedicated {@link module:utils/tomap~toMap} function.\n *\n * @param obj Object to transform.\n * @returns Map created from object.\n */\nexport default function objectToMap(obj) {\n const map = new Map();\n for (const key in obj) {\n map.set(key, obj[key]);\n }\n return map;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/delay\n */\n/* globals setTimeout, clearTimeout */\n/**\n * Returns a function wrapper that will trigger a function after a specified wait time.\n * The timeout can be canceled by calling the cancel function on the returned wrapped function.\n *\n * @param func The function to wrap.\n * @param wait The timeout in ms.\n */\nexport default function delay(func, wait) {\n let timer;\n function delayed(...args) {\n delayed.cancel();\n timer = setTimeout(() => func(...args), wait);\n }\n delayed.cancel = () => {\n clearTimeout(timer);\n };\n return delayed;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Set of utils to handle unicode characters.\n *\n * @module utils/unicode\n */\n/**\n * Checks whether given `character` is a combining mark.\n *\n * @param character Character to check.\n */\nexport function isCombiningMark(character) {\n // eslint-disable-next-line no-misleading-character-class\n return !!character && character.length == 1 && /[\\u0300-\\u036f\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\u20d0-\\u20ff\\ufe20-\\ufe2f]/.test(character);\n}\n/**\n * Checks whether given `character` is a high half of surrogate pair.\n *\n * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair\n * consist of high surrogate pair character followed by low surrogate pair character.\n *\n * @param character Character to check.\n */\nexport function isHighSurrogateHalf(character) {\n return !!character && character.length == 1 && /[\\ud800-\\udbff]/.test(character);\n}\n/**\n * Checks whether given `character` is a low half of surrogate pair.\n *\n * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair\n * consist of high surrogate pair character followed by low surrogate pair character.\n *\n * @param character Character to check.\n */\nexport function isLowSurrogateHalf(character) {\n return !!character && character.length == 1 && /[\\udc00-\\udfff]/.test(character);\n}\n/**\n * Checks whether given offset in a string is inside a surrogate pair (between two surrogate halves).\n *\n * @param string String to check.\n * @param offset Offset to check.\n */\nexport function isInsideSurrogatePair(string, offset) {\n return isHighSurrogateHalf(string.charAt(offset - 1)) && isLowSurrogateHalf(string.charAt(offset));\n}\n/**\n * Checks whether given offset in a string is between base character and combining mark or between two combining marks.\n *\n * @param string String to check.\n * @param offset Offset to check.\n */\nexport function isInsideCombinedSymbol(string, offset) {\n return isCombiningMark(string.charAt(offset));\n}\nconst EMOJI_PATTERN = /* #__PURE__ */ buildEmojiRegexp();\n/**\n * Checks whether given offset in a string is inside multi-character emoji sequence.\n *\n * @param string String to check.\n * @param offset Offset to check.\n */\nexport function isInsideEmojiSequence(string, offset) {\n const matches = String(string).matchAll(EMOJI_PATTERN);\n return Array.from(matches).some(match => match.index < offset && offset < match.index + match[0].length);\n}\nfunction buildEmojiRegexp() {\n const parts = [\n // Emoji Tag Sequence (ETS)\n /\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}/u,\n // Emoji Keycap Sequence\n /\\p{Emoji}\\u{FE0F}?\\u{20E3}/u,\n // Emoji Presentation Sequence\n /\\p{Emoji}\\u{FE0F}/u,\n // Single-Character Emoji / Emoji Modifier Sequence\n /(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*/u\n ];\n const flagSequence = /\\p{Regional_Indicator}{2}/u.source;\n const emoji = '(?:' + parts.map(part => part.source).join('|') + ')';\n const sequence = `${flagSequence}|${emoji}(?:\\u{200D}${emoji})*`;\n return new RegExp(sequence, 'ug');\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/plugin\n */\n/* eslint-disable @typescript-eslint/no-invalid-void-type */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The base class for CKEditor plugin classes.\n */\nexport default class Plugin extends /* #__PURE__ */ ObservableMixin() {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super();\n /**\n * Holds identifiers for {@link #forceDisabled} mechanism.\n */\n this._disableStack = new Set();\n this.editor = editor;\n this.set('isEnabled', true);\n }\n /**\n * Disables the plugin.\n *\n * Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed\n * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the plugin.\n * The plugin becomes enabled only after all features {@link #clearForceDisabled enabled it back}.\n *\n * Disabling and enabling a plugin:\n *\n * ```ts\n * plugin.isEnabled; // -> true\n * plugin.forceDisabled( 'MyFeature' );\n * plugin.isEnabled; // -> false\n * plugin.clearForceDisabled( 'MyFeature' );\n * plugin.isEnabled; // -> true\n * ```\n *\n * Plugin disabled by multiple features:\n *\n * ```ts\n * plugin.forceDisabled( 'MyFeature' );\n * plugin.forceDisabled( 'OtherFeature' );\n * plugin.clearForceDisabled( 'MyFeature' );\n * plugin.isEnabled; // -> false\n * plugin.clearForceDisabled( 'OtherFeature' );\n * plugin.isEnabled; // -> true\n * ```\n *\n * Multiple disabling with the same identifier is redundant:\n *\n * ```ts\n * plugin.forceDisabled( 'MyFeature' );\n * plugin.forceDisabled( 'MyFeature' );\n * plugin.clearForceDisabled( 'MyFeature' );\n * plugin.isEnabled; // -> true\n * ```\n *\n * **Note:** some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins,\n * so the plugin might be still disabled after {@link #clearForceDisabled} was used.\n *\n * @param id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the plugin.\n */\n forceDisabled(id) {\n this._disableStack.add(id);\n if (this._disableStack.size == 1) {\n this.on('set:isEnabled', forceDisable, { priority: 'highest' });\n this.isEnabled = false;\n }\n }\n /**\n * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.\n *\n * @param id Unique identifier, equal to the one passed in {@link #forceDisabled} call.\n */\n clearForceDisabled(id) {\n this._disableStack.delete(id);\n if (this._disableStack.size == 0) {\n this.off('set:isEnabled', forceDisable);\n this.isEnabled = true;\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.stopListening();\n }\n /**\n * @inheritDoc\n */\n static get isContextPlugin() {\n return false;\n }\n}\n/**\n * Helper function that forces plugin to be disabled.\n */\nfunction forceDisable(evt) {\n evt.return = false;\n evt.stop();\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/command\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Base class for the CKEditor commands.\n *\n * Commands are the main way to manipulate the editor contents and state. They are mostly used by UI elements (or by other\n * commands) to make changes in the model. Commands are available in every part of the code that has access to\n * the {@link module:core/editor/editor~Editor editor} instance.\n *\n * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands `editor.commands`}.\n * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute `editor.execute()`}.\n *\n * By default, commands are disabled when the editor is in the {@link module:core/editor/editor~Editor#isReadOnly read-only} mode\n * but commands with the {@link module:core/command~Command#affectsData `affectsData`} flag set to `false` will not be disabled.\n */\nexport default class Command extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a new `Command` instance.\n *\n * @param editor The editor on which this command will be used.\n */\n constructor(editor) {\n super();\n this.editor = editor;\n this.set('value', undefined);\n this.set('isEnabled', false);\n this._affectsData = true;\n this._isEnabledBasedOnSelection = true;\n this._disableStack = new Set();\n this.decorate('execute');\n // By default, every command is refreshed when changes are applied to the model.\n this.listenTo(this.editor.model.document, 'change', () => {\n this.refresh();\n });\n this.listenTo(editor, 'change:isReadOnly', () => {\n this.refresh();\n });\n // By default, commands are disabled if the selection is in non-editable place or editor is in read-only mode.\n this.on('set:isEnabled', evt => {\n if (!this.affectsData) {\n return;\n }\n const selection = editor.model.document.selection;\n const selectionInGraveyard = selection.getFirstPosition().root.rootName == '$graveyard';\n const canEditAtSelection = !selectionInGraveyard && editor.model.canEditAt(selection);\n // Disable if editor is read only, or when selection is in a place which cannot be edited.\n //\n // Checking `editor.isReadOnly` is needed for all commands that have `_isEnabledBasedOnSelection == false`.\n // E.g. undo does not base on selection, but affects data and should be disabled when the editor is in read-only mode.\n if (editor.isReadOnly || this._isEnabledBasedOnSelection && !canEditAtSelection) {\n evt.return = false;\n evt.stop();\n }\n }, { priority: 'highest' });\n this.on('execute', evt => {\n if (!this.isEnabled) {\n evt.stop();\n }\n }, { priority: 'high' });\n }\n /**\n * A flag indicating whether a command execution changes the editor data or not.\n *\n * Commands with `affectsData` set to `false` will not be automatically disabled in\n * the {@link module:core/editor/editor~Editor#isReadOnly read-only mode} and\n * {@glink features/read-only#related-features other editor modes} with restricted user write permissions.\n *\n * **Note:** You do not have to set it for your every command. It is `true` by default.\n *\n * @default true\n */\n get affectsData() {\n return this._affectsData;\n }\n set affectsData(affectsData) {\n this._affectsData = affectsData;\n }\n /**\n * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties\n * in this method.\n *\n * This method is automatically called when\n * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.\n */\n refresh() {\n this.isEnabled = true;\n }\n /**\n * Disables the command.\n *\n * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed\n * (e.g. the feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.\n * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.\n *\n * Disabling and enabling a command:\n *\n * ```ts\n * command.isEnabled; // -> true\n * command.forceDisabled( 'MyFeature' );\n * command.isEnabled; // -> false\n * command.clearForceDisabled( 'MyFeature' );\n * command.isEnabled; // -> true\n * ```\n *\n * Command disabled by multiple features:\n *\n * ```ts\n * command.forceDisabled( 'MyFeature' );\n * command.forceDisabled( 'OtherFeature' );\n * command.clearForceDisabled( 'MyFeature' );\n * command.isEnabled; // -> false\n * command.clearForceDisabled( 'OtherFeature' );\n * command.isEnabled; // -> true\n * ```\n *\n * Multiple disabling with the same identifier is redundant:\n *\n * ```ts\n * command.forceDisabled( 'MyFeature' );\n * command.forceDisabled( 'MyFeature' );\n * command.clearForceDisabled( 'MyFeature' );\n * command.isEnabled; // -> true\n * ```\n *\n * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,\n * so the command might be still disabled after {@link #clearForceDisabled} was used.\n *\n * @param id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.\n */\n forceDisabled(id) {\n this._disableStack.add(id);\n if (this._disableStack.size == 1) {\n this.on('set:isEnabled', forceDisable, { priority: 'highest' });\n this.isEnabled = false;\n }\n }\n /**\n * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.\n *\n * @param id Unique identifier, equal to the one passed in {@link #forceDisabled} call.\n */\n clearForceDisabled(id) {\n this._disableStack.delete(id);\n if (this._disableStack.size == 0) {\n this.off('set:isEnabled', forceDisable);\n this.refresh();\n }\n }\n /**\n * Executes the command.\n *\n * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}\n * to the command.\n *\n * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).\n * This behavior is implemented by a high priority listener to the {@link #event:execute} event.\n *\n * In order to see how to disable a command from \"outside\" see the {@link #isEnabled} documentation.\n *\n * This method may return a value, which would be forwarded all the way down to the\n * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.\n *\n * @fires execute\n */\n execute(...args) { return undefined; } // eslint-disable-line @typescript-eslint/no-unused-vars\n /**\n * Destroys the command.\n */\n destroy() {\n this.stopListening();\n }\n}\n/**\n * Helper function that forces command to be disabled.\n */\nfunction forceDisable(evt) {\n evt.return = false;\n evt.stop();\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/plugincollection\n */\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.\n */\nexport default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {\n /**\n * Creates an instance of the plugin collection class.\n * Allows loading and initializing plugins and their dependencies.\n * Allows providing a list of already loaded plugins. These plugins will not be destroyed along with this collection.\n *\n * @param availablePlugins Plugins (constructors) which the collection will be able to use\n * when {@link module:core/plugincollection~PluginCollection#init} is used with the plugin names (strings, instead of constructors).\n * Usually, the editor will pass its built-in plugins to the collection so they can later be\n * used in `config.plugins` or `config.removePlugins` by names.\n * @param contextPlugins A list of already initialized plugins represented by a `[ PluginConstructor, pluginInstance ]` pair.\n */\n constructor(context, availablePlugins = [], contextPlugins = []) {\n super();\n this._plugins = new Map();\n this._context = context;\n this._availablePlugins = new Map();\n for (const PluginConstructor of availablePlugins) {\n if (PluginConstructor.pluginName) {\n this._availablePlugins.set(PluginConstructor.pluginName, PluginConstructor);\n }\n }\n this._contextPlugins = new Map();\n for (const [PluginConstructor, pluginInstance] of contextPlugins) {\n this._contextPlugins.set(PluginConstructor, pluginInstance);\n this._contextPlugins.set(pluginInstance, PluginConstructor);\n // To make it possible to require a plugin by its name.\n if (PluginConstructor.pluginName) {\n this._availablePlugins.set(PluginConstructor.pluginName, PluginConstructor);\n }\n }\n }\n /**\n * Iterable interface.\n *\n * Returns `[ PluginConstructor, pluginInstance ]` pairs.\n */\n *[Symbol.iterator]() {\n for (const entry of this._plugins) {\n if (typeof entry[0] == 'function') {\n yield entry;\n }\n }\n }\n /**\n * Gets the plugin instance by its constructor or name.\n *\n * ```ts\n * // Check if 'Clipboard' plugin was loaded.\n * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {\n * \t// Get clipboard plugin instance\n * \tconst clipboard = editor.plugins.get( 'ClipboardPipeline' );\n *\n * \tthis.listenTo( clipboard, 'inputTransformation', ( evt, data ) => {\n * \t\t// Do something on clipboard input.\n * \t} );\n * }\n * ```\n *\n * **Note**: This method will throw an error if a plugin is not loaded. Use `{@link #has editor.plugins.has()}`\n * to check if a plugin is available.\n *\n * @param key The plugin constructor or {@link module:core/plugin~PluginStaticMembers#pluginName name}.\n */\n get(key) {\n const plugin = this._plugins.get(key);\n if (!plugin) {\n let pluginName = key;\n if (typeof key == 'function') {\n pluginName = key.pluginName || key.name;\n }\n /**\n * The plugin is not loaded and could not be obtained.\n *\n * Plugin classes (constructors) need to be provided to the editor and must be loaded before they can be obtained from\n * the plugin collection.\n *\n * **Note**: You can use `{@link module:core/plugincollection~PluginCollection#has editor.plugins.has()}`\n * to check if a plugin was loaded.\n *\n * @error plugincollection-plugin-not-loaded\n * @param plugin The name of the plugin which is not loaded.\n */\n throw new CKEditorError('plugincollection-plugin-not-loaded', this._context, { plugin: pluginName });\n }\n return plugin;\n }\n /**\n * Checks if a plugin is loaded.\n *\n * ```ts\n * // Check if the 'Clipboard' plugin was loaded.\n * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {\n * \t// Now use the clipboard plugin instance:\n * \tconst clipboard = editor.plugins.get( 'ClipboardPipeline' );\n *\n * \t// ...\n * }\n * ```\n *\n * @param key The plugin constructor or {@link module:core/plugin~PluginStaticMembers#pluginName name}.\n */\n has(key) {\n return this._plugins.has(key);\n }\n /**\n * Initializes a set of plugins and adds them to the collection.\n *\n * @param plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}\n * or {@link module:core/plugin~PluginStaticMembers#pluginName plugin names}.\n * @param pluginsToRemove Names of the plugins or plugin constructors\n * that should not be loaded (despite being specified in the `plugins` array).\n * @param pluginsSubstitutions An array of {@link module:core/plugin~PluginInterface plugin constructors}\n * that will be used to replace plugins of the same names that were passed in `plugins` or that are in their dependency tree.\n * A useful option for replacing built-in plugins while creating tests (for mocking their APIs). Plugins that will be replaced\n * must follow these rules:\n * * The new plugin must be a class.\n * * The new plugin must be named.\n * * Both plugins must not depend on other plugins.\n * @returns A promise which gets resolved once all plugins are loaded and available in the collection.\n */\n init(plugins, pluginsToRemove = [], pluginsSubstitutions = []) {\n // Plugin initialization procedure consists of 2 main steps:\n // 1) collecting all available plugin constructors,\n // 2) verification whether all required plugins can be instantiated.\n //\n // In the first step, all plugin constructors, available in the provided `plugins` array and inside\n // plugin's dependencies (from the `Plugin.requires` array), are recursively collected and added to the existing\n // `this._availablePlugins` map, but without any verification at the given moment. Performing the verification\n // at this point (during the plugin constructor searching) would cause false errors to occur, that some plugin\n // is missing but in fact it may be defined further in the array as the dependency of other plugin. After\n // traversing the entire dependency tree, it will be checked if all required \"top level\" plugins are available.\n //\n // In the second step, the list of plugins that have not been explicitly removed is traversed to get all the\n // plugin constructors to be instantiated in the correct order and to validate against some rules. Finally, if\n // no plugin is missing and no other error has been found, they all will be instantiated.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n const context = this._context;\n findAvailablePluginConstructors(plugins);\n validatePlugins(plugins);\n const pluginsToLoad = plugins.filter(plugin => !isPluginRemoved(plugin, pluginsToRemove));\n const pluginConstructors = [...getPluginConstructors(pluginsToLoad)];\n substitutePlugins(pluginConstructors, pluginsSubstitutions);\n const pluginInstances = loadPlugins(pluginConstructors);\n return initPlugins(pluginInstances, 'init')\n .then(() => initPlugins(pluginInstances, 'afterInit'))\n .then(() => pluginInstances);\n function isPluginConstructor(plugin) {\n return typeof plugin === 'function';\n }\n function isContextPlugin(plugin) {\n return isPluginConstructor(plugin) && !!plugin.isContextPlugin;\n }\n function isPluginRemoved(plugin, pluginsToRemove) {\n return pluginsToRemove.some(removedPlugin => {\n if (removedPlugin === plugin) {\n return true;\n }\n if (getPluginName(plugin) === removedPlugin) {\n return true;\n }\n if (getPluginName(removedPlugin) === plugin) {\n return true;\n }\n return false;\n });\n }\n function getPluginName(plugin) {\n return isPluginConstructor(plugin) ?\n plugin.pluginName || plugin.name :\n plugin;\n }\n function findAvailablePluginConstructors(plugins, processed = new Set()) {\n plugins.forEach(plugin => {\n if (!isPluginConstructor(plugin)) {\n return;\n }\n if (processed.has(plugin)) {\n return;\n }\n processed.add(plugin);\n if (plugin.pluginName && !that._availablePlugins.has(plugin.pluginName)) {\n that._availablePlugins.set(plugin.pluginName, plugin);\n }\n if (plugin.requires) {\n findAvailablePluginConstructors(plugin.requires, processed);\n }\n });\n }\n function getPluginConstructors(plugins, processed = new Set()) {\n return plugins\n .map(plugin => {\n return isPluginConstructor(plugin) ?\n plugin :\n that._availablePlugins.get(plugin);\n })\n .reduce((result, plugin) => {\n if (processed.has(plugin)) {\n return result;\n }\n processed.add(plugin);\n if (plugin.requires) {\n validatePlugins(plugin.requires, plugin);\n getPluginConstructors(plugin.requires, processed).forEach(plugin => result.add(plugin));\n }\n return result.add(plugin);\n }, new Set());\n }\n function validatePlugins(plugins, parentPluginConstructor = null) {\n plugins\n .map(plugin => {\n return isPluginConstructor(plugin) ?\n plugin :\n that._availablePlugins.get(plugin) || plugin;\n })\n .forEach(plugin => {\n checkMissingPlugin(plugin, parentPluginConstructor);\n checkContextPlugin(plugin, parentPluginConstructor);\n checkRemovedPlugin(plugin, parentPluginConstructor);\n });\n }\n function checkMissingPlugin(plugin, parentPluginConstructor) {\n if (isPluginConstructor(plugin)) {\n return;\n }\n if (parentPluginConstructor) {\n /**\n * A required \"soft\" dependency was not found on the plugin list.\n *\n * When configuring the editor, either prior to building (via\n * {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}) or when\n * creating a new instance of the editor (e.g. via\n * {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`}), you need to provide\n * some of the dependencies for other plugins that you used.\n *\n * This error is thrown when one of these dependencies was not provided. The name of the missing plugin\n * can be found in `missingPlugin` and the plugin that required it in `requiredBy`.\n *\n * In order to resolve it, you need to import the missing plugin and add it to the\n * current list of plugins (`Editor.builtinPlugins` or `config.plugins`/`config.extraPlugins`).\n *\n * Soft requirements were introduced in version 26.0.0. If you happen to stumble upon this error\n * when upgrading to version 26.0.0, read also the\n * {@glink updating/guides/update-to-26 Migration to 26.0.0} guide.\n *\n * @error plugincollection-soft-required\n * @param missingPlugin The name of the required plugin.\n * @param requiredBy The name of the plugin that requires the other plugin.\n */\n throw new CKEditorError('plugincollection-soft-required', context, { missingPlugin: plugin, requiredBy: getPluginName(parentPluginConstructor) });\n }\n /**\n * A plugin is not available and could not be loaded.\n *\n * Plugin classes (constructors) need to be provided to the editor before they can be loaded by name.\n * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}\n * property.\n *\n * **If you see this warning when using one of the CKEditor 5 Builds},\n * it means that you try to enable a plugin which was not included in that build. This may be due to a typo\n * in the plugin name or simply because that plugin is not a part of this build.\n *\n * Predefined builds are a deprecated solution and we strongly advise\n * {@glink updating/nim-migration/migration-to-new-installation-methods migrating to new installation methods}.\n *\n * **If you see this warning when using one of the editor creators directly** (not a build), then it means\n * that you tried loading plugins by name. However, unlike CKEditor 4, CKEditor 5 does not implement a \"plugin loader\".\n * This means that CKEditor 5 does not know where to load the plugin modules from. Therefore, you need to\n * provide each plugin through a reference (as a constructor function). Check out the examples in the\n * {@glink getting-started/installation/quick-start Quick start} guide.\n *\n * @error plugincollection-plugin-not-found\n * @param plugin The name of the plugin which could not be loaded.\n */\n throw new CKEditorError('plugincollection-plugin-not-found', context, { plugin });\n }\n function checkContextPlugin(plugin, parentPluginConstructor) {\n if (!isContextPlugin(parentPluginConstructor)) {\n return;\n }\n if (isContextPlugin(plugin)) {\n return;\n }\n /**\n * If a plugin is a context plugin, all plugins it requires should also be context plugins\n * instead of plugins. In other words, if one plugin can be used in the context,\n * all its requirements should also be ready to be used in the context. Note that the context\n * provides only a part of the API provided by the editor. If one plugin needs a full\n * editor API, all plugins which require it are considered as plugins that need a full\n * editor API.\n *\n * @error plugincollection-context-required\n * @param plugin The name of the required plugin.\n * @param requiredBy The name of the parent plugin.\n */\n throw new CKEditorError('plugincollection-context-required', context, { plugin: getPluginName(plugin), requiredBy: getPluginName(parentPluginConstructor) });\n }\n function checkRemovedPlugin(plugin, parentPluginConstructor) {\n if (!parentPluginConstructor) {\n return;\n }\n if (!isPluginRemoved(plugin, pluginsToRemove)) {\n return;\n }\n /**\n * Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.\n *\n * @error plugincollection-required\n * @param plugin The name of the required plugin.\n * @param requiredBy The name of the parent plugin.\n */\n throw new CKEditorError('plugincollection-required', context, { plugin: getPluginName(plugin), requiredBy: getPluginName(parentPluginConstructor) });\n }\n function loadPlugins(pluginConstructors) {\n return pluginConstructors.map(PluginConstructor => {\n let pluginInstance = that._contextPlugins.get(PluginConstructor);\n pluginInstance = pluginInstance || new PluginConstructor(context);\n that._add(PluginConstructor, pluginInstance);\n return pluginInstance;\n });\n }\n function initPlugins(pluginInstances, method) {\n return pluginInstances.reduce((promise, plugin) => {\n if (!plugin[method]) {\n return promise;\n }\n if (that._contextPlugins.has(plugin)) {\n return promise;\n }\n return promise.then(plugin[method].bind(plugin));\n }, Promise.resolve());\n }\n /**\n * Replaces plugin constructors with the specified set of plugins.\n */\n function substitutePlugins(pluginConstructors, pluginsSubstitutions) {\n for (const pluginItem of pluginsSubstitutions) {\n if (typeof pluginItem != 'function') {\n /**\n * The plugin replacing an existing plugin must be a function.\n *\n * @error plugincollection-replace-plugin-invalid-type\n */\n throw new CKEditorError('plugincollection-replace-plugin-invalid-type', null, { pluginItem });\n }\n const pluginName = pluginItem.pluginName;\n if (!pluginName) {\n /**\n * The plugin replacing an existing plugin must have a name.\n *\n * @error plugincollection-replace-plugin-missing-name\n */\n throw new CKEditorError('plugincollection-replace-plugin-missing-name', null, { pluginItem });\n }\n if (pluginItem.requires && pluginItem.requires.length) {\n /**\n * The plugin replacing an existing plugin cannot depend on other plugins.\n *\n * @error plugincollection-plugin-for-replacing-cannot-have-dependencies\n */\n throw new CKEditorError('plugincollection-plugin-for-replacing-cannot-have-dependencies', null, { pluginName });\n }\n const pluginToReplace = that._availablePlugins.get(pluginName);\n if (!pluginToReplace) {\n /**\n * The replaced plugin does not exist in the\n * {@link module:core/plugincollection~PluginCollection available plugins} collection.\n *\n * @error plugincollection-plugin-for-replacing-not-exist\n */\n throw new CKEditorError('plugincollection-plugin-for-replacing-not-exist', null, { pluginName });\n }\n const indexInPluginConstructors = pluginConstructors.indexOf(pluginToReplace);\n if (indexInPluginConstructors === -1) {\n // The Context feature can substitute plugins as well.\n // It may happen that the editor will be created with the given context, where the plugin for substitute\n // was already replaced. In such a case, we don't want to do it again.\n if (that._contextPlugins.has(pluginToReplace)) {\n return;\n }\n /**\n * The replaced plugin will not be loaded so it cannot be replaced.\n *\n * @error plugincollection-plugin-for-replacing-not-loaded\n */\n throw new CKEditorError('plugincollection-plugin-for-replacing-not-loaded', null, { pluginName });\n }\n if (pluginToReplace.requires && pluginToReplace.requires.length) {\n /**\n * The replaced plugin cannot depend on other plugins.\n *\n * @error plugincollection-replaced-plugin-cannot-have-dependencies\n */\n throw new CKEditorError('plugincollection-replaced-plugin-cannot-have-dependencies', null, { pluginName });\n }\n pluginConstructors.splice(indexInPluginConstructors, 1, pluginItem);\n that._availablePlugins.set(pluginName, pluginItem);\n }\n }\n }\n /**\n * Destroys all loaded plugins.\n */\n destroy() {\n const promises = [];\n for (const [, pluginInstance] of this) {\n if (typeof pluginInstance.destroy == 'function' && !this._contextPlugins.has(pluginInstance)) {\n promises.push(pluginInstance.destroy());\n }\n }\n return Promise.all(promises);\n }\n /**\n * Adds the plugin to the collection. Exposed mainly for testing purposes.\n *\n * @param PluginConstructor The plugin constructor.\n * @param plugin The instance of the plugin.\n */\n _add(PluginConstructor, plugin) {\n this._plugins.set(PluginConstructor, plugin);\n const pluginName = PluginConstructor.pluginName;\n if (!pluginName) {\n return;\n }\n if (this._plugins.has(pluginName)) {\n /**\n * Two plugins with the same {@link module:core/plugin~PluginStaticMembers#pluginName} were loaded.\n * This will lead to runtime conflicts between these plugins.\n *\n * In practice, this warning usually means that new plugins were added to an existing CKEditor 5 build.\n * Plugins should always be added to a source version of the editor (`@ckeditor/ckeditor5-editor-*`),\n * not to an editor imported from one of the `@ckeditor/ckeditor5-build-*` packages.\n *\n * Check your import paths and the list of plugins passed to\n * {@link module:core/editor/editor~Editor.create `Editor.create()`}\n * or specified in {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.\n *\n * Predefined builds are a deprecated solution and we strongly advise\n * {@glink updating/nim-migration/migration-to-new-installation-methods migrating to new installation methods}.\n *\n * The second option is that your `node_modules/` directory contains duplicated versions of the same\n * CKEditor 5 packages. Normally, on clean installations, npm deduplicates packages in `node_modules/`, so\n * it may be enough to call `rm -rf node_modules && npm i`. However, if you installed conflicting versions\n * of some packages, their dependencies may need to be installed in more than one version which may lead to this\n * warning.\n *\n * Technically speaking, this error occurs because after adding a plugin to an existing editor build\n * the dependencies of this plugin are being duplicated.\n * They are already built into that editor build and now get added for the second time as dependencies\n * of the plugin you are installing.\n *\n * @error plugincollection-plugin-name-conflict\n * @param pluginName The duplicated plugin name.\n * @param plugin1 The first plugin constructor.\n * @param plugin2 The second plugin constructor.\n */\n throw new CKEditorError('plugincollection-plugin-name-conflict', null, { pluginName, plugin1: this._plugins.get(pluginName).constructor, plugin2: PluginConstructor });\n }\n this._plugins.set(pluginName, plugin);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/context\n */\nimport { Config, Collection, CKEditorError, Locale } from '@ckeditor/ckeditor5-utils';\nimport PluginCollection from './plugincollection.js';\n/**\n * Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}\n * or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}\n * in advanced application integrations.\n *\n * All configuration options passed to a context will be used as default options for the editor instances initialized in that context.\n *\n * {@link module:core/contextplugin~ContextPlugin Context plugins} passed to a context instance will be shared among all\n * editor instances initialized in this context. These will be the same plugin instances for all the editors.\n *\n * **Note:** The context can only be initialized with {@link module:core/contextplugin~ContextPlugin context plugins}\n * (e.g. [comments](https://ckeditor.com/collaboration/comments/)). Regular {@link module:core/plugin~Plugin plugins} require an\n * editor instance to work and cannot be added to a context.\n *\n * **Note:** You can add a context plugin to an editor instance, though.\n *\n * If you are using multiple editor instances on one page and use any context plugins, create a context to share the configuration and\n * plugins among these editors. Some plugins will use the information about all existing editors to better integrate between them.\n *\n * If you are using plugins that do not require an editor to work (e.g. [comments](https://ckeditor.com/collaboration/comments/)),\n * enable and configure them using the context.\n *\n * If you are using only a single editor on each page, use {@link module:core/editor/editor~Editor.create `Editor.create()`} instead.\n * In such a case, a context instance will be created by the editor instance in a transparent way.\n *\n * See {@link ~Context.create `Context.create()`} for usage examples.\n */\nexport default class Context {\n /**\n * Creates a context instance with a given configuration.\n *\n * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.\n *\n * @param config The context configuration.\n */\n constructor(config) {\n /**\n * Reference to the editor which created the context.\n * Null when the context was created outside of the editor.\n *\n * It is used to destroy the context when removing the editor that has created the context.\n */\n this._contextOwner = null;\n // We don't pass translations to the config, because its behavior of splitting keys\n // with dots (e.g. `resize.width` => `resize: { width }`) breaks the translations.\n const { translations, ...rest } = config || {};\n this.config = new Config(rest, this.constructor.defaultConfig);\n const availablePlugins = this.constructor.builtinPlugins;\n this.config.define('plugins', availablePlugins);\n this.plugins = new PluginCollection(this, availablePlugins);\n const languageConfig = this.config.get('language') || {};\n this.locale = new Locale({\n uiLanguage: typeof languageConfig === 'string' ? languageConfig : languageConfig.ui,\n contentLanguage: this.config.get('language.content'),\n translations\n });\n this.t = this.locale.t;\n this.editors = new Collection();\n }\n /**\n * Loads and initializes plugins specified in the configuration.\n *\n * @returns A promise which resolves once the initialization is completed, providing an array of loaded plugins.\n */\n initPlugins() {\n const plugins = this.config.get('plugins') || [];\n const substitutePlugins = this.config.get('substitutePlugins') || [];\n // Plugins for substitution should be checked as well.\n for (const Plugin of plugins.concat(substitutePlugins)) {\n if (typeof Plugin != 'function') {\n /**\n * Only a constructor function is allowed as a {@link module:core/contextplugin~ContextPlugin context plugin}.\n *\n * @error context-initplugins-constructor-only\n */\n throw new CKEditorError('context-initplugins-constructor-only', null, { Plugin });\n }\n if (Plugin.isContextPlugin !== true) {\n /**\n * Only a plugin marked as a {@link module:core/contextplugin~ContextPlugin.isContextPlugin context plugin}\n * is allowed to be used with a context.\n *\n * @error context-initplugins-invalid-plugin\n */\n throw new CKEditorError('context-initplugins-invalid-plugin', null, { Plugin });\n }\n }\n return this.plugins.init(plugins, [], substitutePlugins);\n }\n /**\n * Destroys the context instance and all editors used with the context,\n * releasing all resources used by the context.\n *\n * @returns A promise that resolves once the context instance is fully destroyed.\n */\n destroy() {\n return Promise.all(Array.from(this.editors, editor => editor.destroy()))\n .then(() => this.plugins.destroy());\n }\n /**\n * Adds a reference to the editor which is used with this context.\n *\n * When the given editor has created the context, the reference to this editor will be stored\n * as a {@link ~Context#_contextOwner}.\n *\n * This method should only be used by the editor.\n *\n * @internal\n * @param isContextOwner Stores the given editor as a context owner.\n */\n _addEditor(editor, isContextOwner) {\n if (this._contextOwner) {\n /**\n * Cannot add multiple editors to the context which is created by the editor.\n *\n * @error context-addeditor-private-context\n */\n throw new CKEditorError('context-addeditor-private-context');\n }\n this.editors.add(editor);\n if (isContextOwner) {\n this._contextOwner = editor;\n }\n }\n /**\n * Removes a reference to the editor which was used with this context.\n * When the context was created by the given editor, the context will be destroyed.\n *\n * This method should only be used by the editor.\n *\n * @internal\n * @return A promise that resolves once the editor is removed from the context or when the context was destroyed.\n */\n _removeEditor(editor) {\n if (this.editors.has(editor)) {\n this.editors.remove(editor);\n }\n if (this._contextOwner === editor) {\n return this.destroy();\n }\n return Promise.resolve();\n }\n /**\n * Returns the context configuration which will be copied to the editors created using this context.\n *\n * The configuration returned by this method has the plugins configuration removed – plugins are shared with all editors\n * through another mechanism.\n *\n * This method should only be used by the editor.\n *\n * @internal\n * @returns Configuration as a plain object.\n */\n _getEditorConfig() {\n const result = {};\n for (const name of this.config.names()) {\n if (!['plugins', 'removePlugins', 'extraPlugins'].includes(name)) {\n result[name] = this.config.get(name);\n }\n }\n return result;\n }\n /**\n * Creates and initializes a new context instance.\n *\n * ```ts\n * const commonConfig = { ... }; // Configuration for all the plugins and editors.\n * const editorPlugins = [ ... ]; // Regular plugins here.\n *\n * Context\n * \t.create( {\n * \t\t// Only context plugins here.\n * \t\tplugins: [ ... ],\n *\n * \t\t// Configure the language for all the editors (it cannot be overwritten).\n * \t\tlanguage: { ... },\n *\n * \t\t// Configuration for context plugins.\n * \t\tcomments: { ... },\n * \t\t...\n *\n * \t\t// Default configuration for editor plugins.\n * \t\ttoolbar: { ... },\n * \t\timage: { ... },\n * \t\t...\n * \t} )\n * \t.then( context => {\n * \t\tconst promises = [];\n *\n * \t\tpromises.push( ClassicEditor.create(\n * \t\t\tdocument.getElementById( 'editor1' ),\n * \t\t\t{\n * \t\t\t\teditorPlugins,\n * \t\t\t\tcontext\n * \t\t\t}\n * \t\t) );\n *\n * \t\tpromises.push( ClassicEditor.create(\n * \t\t\tdocument.getElementById( 'editor2' ),\n * \t\t\t{\n * \t\t\t\teditorPlugins,\n * \t\t\t\tcontext,\n * \t\t\t\ttoolbar: { ... } // You can overwrite the configuration of the context.\n * \t\t\t}\n * \t\t) );\n *\n * \t\treturn Promise.all( promises );\n * \t} );\n * ```\n *\n * @param config The context configuration.\n * @returns A promise resolved once the context is ready. The promise resolves with the created context instance.\n */\n static create(config) {\n return new Promise(resolve => {\n const context = new this(config);\n resolve(context.initPlugins().then(() => context));\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/contextplugin\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The base class for {@link module:core/context~Context} plugin classes.\n *\n * A context plugin can either be initialized for an {@link module:core/editor/editor~Editor editor} or for\n * a {@link module:core/context~Context context}. In other words, it can either\n * work within one editor instance or with one or more editor instances that use a single context.\n * It is the context plugin's role to implement handling for both modes.\n *\n * There are a few rules for interaction between the editor plugins and context plugins:\n *\n * * A context plugin can require another context plugin.\n * * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.\n * * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.\n */\nexport default class ContextPlugin extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a new plugin instance.\n */\n constructor(context) {\n super();\n this.context = context;\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.stopListening();\n }\n /**\n * @inheritDoc\n */\n static get isContextPlugin() {\n return true;\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./placeholder.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./placeholder.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/placeholder\n */\nimport '../../theme/placeholder.css';\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\n// Each document stores information about its placeholder elements and check functions.\nconst documentPlaceholders = new WeakMap();\nlet hasDisplayedPlaceholderDeprecationWarning = false;\n/**\n * A helper that enables a placeholder on the provided view element (also updates its visibility).\n * The placeholder is a CSS pseudo–element (with a text content) attached to the element.\n *\n * To change the placeholder text, change value of the `placeholder` property in the provided `element`.\n *\n * To disable the placeholder, use {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} helper.\n *\n * @param options Configuration options of the placeholder.\n * @param options.view Editing view instance.\n * @param options.element Element that will gain a placeholder. See `options.isDirectHost` to learn more.\n * @param options.isDirectHost If set `false`, the placeholder will not be enabled directly\n * in the passed `element` but in one of its children (selected automatically, i.e. a first empty child element).\n * Useful when attaching placeholders to elements that can host other elements (not just text), for instance,\n * editable root elements.\n * @param options.text Placeholder text. It's **deprecated** and will be removed soon. Use\n * {@link module:engine/view/placeholder~PlaceholderableElement#placeholder `options.element.placeholder`} instead.\n * @param options.keepOnFocus If set `true`, the placeholder stay visible when the host element is focused.\n */\nexport function enablePlaceholder({ view, element, text, isDirectHost = true, keepOnFocus = false }) {\n const doc = view.document;\n // Use a single a single post fixer per—document to update all placeholders.\n if (!documentPlaceholders.has(doc)) {\n documentPlaceholders.set(doc, new Map());\n // If a post-fixer callback makes a change, it should return `true` so other post–fixers\n // can re–evaluate the document again.\n doc.registerPostFixer(writer => updateDocumentPlaceholders(doc, writer));\n // Update placeholders on isComposing state change since rendering is disabled while in composition mode.\n doc.on('change:isComposing', () => {\n view.change(writer => updateDocumentPlaceholders(doc, writer));\n }, { priority: 'high' });\n }\n if (element.is('editableElement')) {\n element.on('change:placeholder', (evtInfo, evt, text) => {\n setPlaceholder(text);\n });\n }\n if (element.placeholder) {\n setPlaceholder(element.placeholder);\n }\n else if (text) {\n setPlaceholder(text);\n }\n if (text) {\n showPlaceholderTextDeprecationWarning();\n }\n function setPlaceholder(text) {\n // Store information about the element placeholder under its document.\n documentPlaceholders.get(doc).set(element, {\n text,\n isDirectHost,\n keepOnFocus,\n hostElement: isDirectHost ? element : null\n });\n // Update the placeholders right away.\n view.change(writer => updateDocumentPlaceholders(doc, writer));\n }\n}\n/**\n * Disables the placeholder functionality from a given element.\n *\n * See {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} to learn more.\n */\nexport function disablePlaceholder(view, element) {\n const doc = element.document;\n if (!documentPlaceholders.has(doc)) {\n return;\n }\n view.change(writer => {\n const placeholders = documentPlaceholders.get(doc);\n const config = placeholders.get(element);\n writer.removeAttribute('data-placeholder', config.hostElement);\n hidePlaceholder(writer, config.hostElement);\n placeholders.delete(element);\n });\n}\n/**\n * Shows a placeholder in the provided element by changing related attributes and CSS classes.\n *\n * **Note**: This helper will not update the placeholder visibility nor manage the\n * it in any way in the future. What it does is a one–time state change of an element. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and\n * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full\n * placeholder functionality.\n *\n * **Note**: This helper will blindly show the placeholder directly in the root editable element if\n * one is passed, which could result in a visual clash if the editable element has some children\n * (for instance, an empty paragraph). Use {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`}\n * in that case or make sure the correct element is passed to the helper.\n *\n * @returns `true`, if any changes were made to the `element`.\n */\nexport function showPlaceholder(writer, element) {\n if (!element.hasClass('ck-placeholder')) {\n writer.addClass('ck-placeholder', element);\n return true;\n }\n return false;\n}\n/**\n * Hides a placeholder in the element by changing related attributes and CSS classes.\n *\n * **Note**: This helper will not update the placeholder visibility nor manage the\n * it in any way in the future. What it does is a one–time state change of an element. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and\n * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full\n * placeholder functionality.\n *\n * @returns `true`, if any changes were made to the `element`.\n */\nexport function hidePlaceholder(writer, element) {\n if (element.hasClass('ck-placeholder')) {\n writer.removeClass('ck-placeholder', element);\n return true;\n }\n return false;\n}\n/**\n * Checks if a placeholder should be displayed in the element.\n *\n * **Note**: This helper will blindly check the possibility of showing a placeholder directly in the\n * root editable element if one is passed, which may not be the expected result. If an element can\n * host other elements (not just text), most likely one of its children should be checked instead\n * because it will be the final host for the placeholder. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} in that case or make\n * sure the correct element is passed to the helper.\n *\n * @param element Element that holds the placeholder.\n * @param keepOnFocus Focusing the element will keep the placeholder visible.\n */\nexport function needsPlaceholder(element, keepOnFocus) {\n if (!element.isAttached()) {\n return false;\n }\n // Anything but uiElement(s) counts as content.\n const hasContent = Array.from(element.getChildren())\n .some(element => !element.is('uiElement'));\n if (hasContent) {\n return false;\n }\n const doc = element.document;\n const viewSelection = doc.selection;\n const selectionAnchor = viewSelection.anchor;\n if (doc.isComposing && selectionAnchor && selectionAnchor.parent === element) {\n return false;\n }\n // Skip the focus check and make the placeholder visible already regardless of document focus state.\n if (keepOnFocus) {\n return true;\n }\n // If the document is blurred.\n if (!doc.isFocused) {\n return true;\n }\n // If document is focused and the element is empty but the selection is not anchored inside it.\n return !!selectionAnchor && selectionAnchor.parent !== element;\n}\n/**\n * Updates all placeholders associated with a document in a post–fixer callback.\n *\n * @returns True if any changes were made to the view document.\n */\nfunction updateDocumentPlaceholders(doc, writer) {\n const placeholders = documentPlaceholders.get(doc);\n const directHostElements = [];\n let wasViewModified = false;\n // First set placeholders on the direct hosts.\n for (const [element, config] of placeholders) {\n if (config.isDirectHost) {\n directHostElements.push(element);\n if (updatePlaceholder(writer, element, config)) {\n wasViewModified = true;\n }\n }\n }\n // Then set placeholders on the indirect hosts but only on those that does not already have an direct host placeholder.\n for (const [element, config] of placeholders) {\n if (config.isDirectHost) {\n continue;\n }\n const hostElement = getChildPlaceholderHostSubstitute(element);\n // When not a direct host, it could happen that there is no child element\n // capable of displaying a placeholder.\n if (!hostElement) {\n continue;\n }\n // Don't override placeholder if the host element already has some direct placeholder.\n if (directHostElements.includes(hostElement)) {\n continue;\n }\n // Update the host element (used for setting and removing the placeholder).\n config.hostElement = hostElement;\n if (updatePlaceholder(writer, element, config)) {\n wasViewModified = true;\n }\n }\n return wasViewModified;\n}\n/**\n * Updates a single placeholder in a post–fixer callback.\n *\n * @returns True if any changes were made to the view document.\n */\nfunction updatePlaceholder(writer, element, config) {\n const { text, isDirectHost, hostElement } = config;\n let wasViewModified = false;\n // This may be necessary when updating the placeholder text to something else.\n if (hostElement.getAttribute('data-placeholder') !== text) {\n writer.setAttribute('data-placeholder', text, hostElement);\n wasViewModified = true;\n }\n // If the host element is not a direct host then placeholder is needed only when there is only one element.\n const isOnlyChild = isDirectHost || element.childCount == 1;\n if (isOnlyChild && needsPlaceholder(hostElement, config.keepOnFocus)) {\n if (showPlaceholder(writer, hostElement)) {\n wasViewModified = true;\n }\n }\n else if (hidePlaceholder(writer, hostElement)) {\n wasViewModified = true;\n }\n return wasViewModified;\n}\n/**\n * Gets a child element capable of displaying a placeholder if a parent element can host more\n * than just text (for instance, when it is a root editable element). The child element\n * can then be used in other placeholder helpers as a substitute of its parent.\n */\nfunction getChildPlaceholderHostSubstitute(parent) {\n if (parent.childCount) {\n const firstChild = parent.getChild(0);\n if (firstChild.is('element') && !firstChild.is('uiElement') && !firstChild.is('attributeElement')) {\n return firstChild;\n }\n }\n return null;\n}\n/**\n * Displays a deprecation warning message in the console, but only once per page load.\n */\nfunction showPlaceholderTextDeprecationWarning() {\n if (!hasDisplayedPlaceholderDeprecationWarning) {\n /**\n * The \"text\" option in the {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`}\n * function is deprecated and will be removed soon.\n *\n * See the {@glink updating/guides/update-to-39#view-element-placeholder Migration to v39} guide for\n * more information on how to apply this change.\n *\n * @error enableplaceholder-deprecated-text-option\n */\n logWarning('enableplaceholder-deprecated-text-option');\n }\n hasDisplayedPlaceholderDeprecationWarning = true;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/typecheckable\n */\nexport default class TypeCheckable {\n /* istanbul ignore next -- @preserve */\n is() {\n // There are a lot of overloads above.\n // Overriding method in derived classes remove them and only `is( type: string ): boolean` is visible which we don't want.\n // One option would be to copy them all to all classes, but that's ugly.\n // It's best when TypeScript compiler doesn't see those overloads, except the one in the top base class.\n // To overload a method, but not let the compiler see it, do after class definition:\n // `MyClass.prototype.is = function( type: string ) {...}`\n throw new Error('is() method is abstract');\n }\n}\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/node\n */\nimport TypeCheckable from './typecheckable.js';\nimport { CKEditorError, EmitterMixin, compareArrays } from '@ckeditor/ckeditor5-utils';\nimport { clone } from 'lodash-es';\n/**\n * Abstract view node class.\n *\n * This is an abstract class. Its constructor should not be used directly.\n * Use the {@link module:engine/view/downcastwriter~DowncastWriter} or {@link module:engine/view/upcastwriter~UpcastWriter}\n * to create new instances of view nodes.\n */\nexport default class Node extends /* #__PURE__ */ EmitterMixin(TypeCheckable) {\n /**\n * Creates a tree view node.\n *\n * @param document The document instance to which this node belongs.\n */\n constructor(document) {\n super();\n this.document = document;\n this.parent = null;\n }\n /**\n * Index of the node in the parent element or null if the node has no parent.\n *\n * Accessing this property throws an error if this node's parent element does not contain it.\n * This means that view tree got broken.\n */\n get index() {\n let pos;\n if (!this.parent) {\n return null;\n }\n // No parent or child doesn't exist in parent's children.\n if ((pos = this.parent.getChildIndex(this)) == -1) {\n /**\n * The node's parent does not contain this node. It means that the document tree is corrupted.\n *\n * @error view-node-not-found-in-parent\n */\n throw new CKEditorError('view-node-not-found-in-parent', this);\n }\n return pos;\n }\n /**\n * Node's next sibling, or `null` if it is the last child.\n */\n get nextSibling() {\n const index = this.index;\n return (index !== null && this.parent.getChild(index + 1)) || null;\n }\n /**\n * Node's previous sibling, or `null` if it is the first child.\n */\n get previousSibling() {\n const index = this.index;\n return (index !== null && this.parent.getChild(index - 1)) || null;\n }\n /**\n * Top-most ancestor of the node. If the node has no parent it is the root itself.\n */\n get root() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let root = this;\n while (root.parent) {\n root = root.parent;\n }\n return root;\n }\n /**\n * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).\n */\n isAttached() {\n return this.root.is('rootElement');\n }\n /**\n * Gets a path to the node. The path is an array containing indices of consecutive ancestors of this node,\n * beginning from {@link module:engine/view/node~Node#root root}, down to this node's index.\n *\n * ```ts\n * const abc = downcastWriter.createText( 'abc' );\n * const foo = downcastWriter.createText( 'foo' );\n * const h1 = downcastWriter.createElement( 'h1', null, downcastWriter.createText( 'header' ) );\n * const p = downcastWriter.createElement( 'p', null, [ abc, foo ] );\n * const div = downcastWriter.createElement( 'div', null, [ h1, p ] );\n * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.\n * h1.getPath(); // Returns [ 0 ].\n * div.getPath(); // Returns [].\n * ```\n *\n * @returns The path.\n */\n getPath() {\n const path = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let node = this;\n while (node.parent) {\n path.unshift(node.index);\n node = node.parent;\n }\n return path;\n }\n /**\n * Returns ancestors array of this node.\n *\n * @param options Options object.\n * @param options.includeSelf When set to `true` this node will be also included in parent's array.\n * @param options.parentFirst When set to `true`, array will be sorted from node's parent to root element,\n * otherwise root element will be the first item in the array.\n * @returns Array with ancestors.\n */\n getAncestors(options = {}) {\n const ancestors = [];\n let parent = options.includeSelf ? this : this.parent;\n while (parent) {\n ancestors[options.parentFirst ? 'push' : 'unshift'](parent);\n parent = parent.parent;\n }\n return ancestors;\n }\n /**\n * Returns a {@link module:engine/view/element~Element} or {@link module:engine/view/documentfragment~DocumentFragment}\n * which is a common ancestor of both nodes.\n *\n * @param node The second node.\n * @param options Options object.\n * @param options.includeSelf When set to `true` both nodes will be considered \"ancestors\" too.\n * Which means that if e.g. node A is inside B, then their common ancestor will be B.\n */\n getCommonAncestor(node, options = {}) {\n const ancestorsA = this.getAncestors(options);\n const ancestorsB = node.getAncestors(options);\n let i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n /**\n * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,\n * in different {@link module:engine/view/documentfragment~DocumentFragment}s).\n *\n * @param node Node to compare with.\n */\n isBefore(node) {\n // Given node is not before this node if they are same.\n if (this == node) {\n return false;\n }\n // Return `false` if it is impossible to compare nodes.\n if (this.root !== node.root) {\n return false;\n }\n const thisPath = this.getPath();\n const nodePath = node.getPath();\n const result = compareArrays(thisPath, nodePath);\n switch (result) {\n case 'prefix':\n return true;\n case 'extension':\n return false;\n default:\n return thisPath[result] < nodePath[result];\n }\n }\n /**\n * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,\n * in different {@link module:engine/view/documentfragment~DocumentFragment}s).\n *\n * @param node Node to compare with.\n */\n isAfter(node) {\n // Given node is not before this node if they are same.\n if (this == node) {\n return false;\n }\n // Return `false` if it is impossible to compare nodes.\n if (this.root !== node.root) {\n return false;\n }\n // In other cases, just check if the `node` is before, and return the opposite.\n return !this.isBefore(node);\n }\n /**\n * Removes node from parent.\n *\n * @internal\n */\n _remove() {\n this.parent._removeChildren(this.index);\n }\n /**\n * @internal\n * @param type Type of the change.\n * @param node Changed node.\n * @fires change\n */\n _fireChange(type, node) {\n this.fire(`change:${type}`, node);\n if (this.parent) {\n this.parent._fireChange(type, node);\n }\n }\n /**\n * Custom toJSON method to solve child-parent circular dependencies.\n *\n * @returns Clone of this object with the parent property removed.\n */\n toJSON() {\n const json = clone(this);\n // Due to circular references we need to remove parent reference.\n delete json.parent;\n return json;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nNode.prototype.is = function (type) {\n return type === 'node' || type === 'view:node';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/text\n */\nimport Node from './node.js';\n/**\n * Tree view text node.\n *\n * The constructor of this class should not be used directly. To create a new text node instance\n * use the {@link module:engine/view/downcastwriter~DowncastWriter#createText `DowncastWriter#createText()`}\n * method when working on data downcasted from the model or the\n * {@link module:engine/view/upcastwriter~UpcastWriter#createText `UpcastWriter#createText()`}\n * method when working on non-semantic views.\n */\nexport default class Text extends Node {\n /**\n * Creates a tree view text node.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createText\n * @internal\n * @param document The document instance to which this text node belongs.\n * @param data The text's data.\n */\n constructor(document, data) {\n super(document);\n this._textData = data;\n }\n /**\n * The text content.\n */\n get data() {\n return this._textData;\n }\n /**\n * The `_data` property is controlled by a getter and a setter.\n *\n * The getter is required when using the addition assignment operator on protected property:\n *\n * ```ts\n * const foo = downcastWriter.createText( 'foo' );\n * const bar = downcastWriter.createText( 'bar' );\n *\n * foo._data += bar.data; // executes: `foo._data = foo._data + bar.data`\n * console.log( foo.data ); // prints: 'foobar'\n * ```\n *\n * If the protected getter didn't exist, `foo._data` will return `undefined` and result of the merge will be invalid.\n *\n * The setter sets data and fires the {@link module:engine/view/node~Node#event:change:text change event}.\n *\n * @internal\n */\n get _data() {\n return this.data;\n }\n set _data(data) {\n this._fireChange('text', this);\n this._textData = data;\n }\n /**\n * Checks if this text node is similar to other text node.\n * Both nodes should have the same data to be considered as similar.\n *\n * @param otherNode Node to check if it is same as this node.\n */\n isSimilar(otherNode) {\n if (!(otherNode instanceof Text)) {\n return false;\n }\n return this === otherNode || this.data === otherNode.data;\n }\n /**\n * Clones this node.\n *\n * @internal\n * @returns Text node that is a clone of this node.\n */\n _clone() {\n return new Text(this.document, this.data);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nText.prototype.is = function (type) {\n return type === '$text' || type === 'view:$text' ||\n // This are legacy values kept for backward compatibility.\n type === 'text' || type === 'view:text' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'node' || type === 'view:node';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/textproxy\n */\nimport TypeCheckable from './typecheckable.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * TextProxy is a wrapper for substring of {@link module:engine/view/text~Text}. Instance of this class is created by\n * {@link module:engine/view/treewalker~TreeWalker} when only a part of {@link module:engine/view/text~Text} needs to be returned.\n *\n * `TextProxy` has an API similar to {@link module:engine/view/text~Text Text} and allows to do most of the common tasks performed\n * on view nodes.\n *\n * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.\n * See {@link module:engine/view/textproxy~TextProxy#isPartial}.\n *\n * **Note:** `TextProxy` is a readonly interface.\n *\n * **Note:** `TextProxy` instances are created on the fly basing on the current state of parent {@link module:engine/view/text~Text}.\n * Because of this it is highly unrecommended to store references to `TextProxy instances because they might get\n * invalidated due to operations on Document. Also TextProxy is not a {@link module:engine/view/node~Node} so it can not be\n * inserted as a child of {@link module:engine/view/element~Element}.\n *\n * `TextProxy` instances are created by {@link module:engine/view/treewalker~TreeWalker view tree walker}. You should not need to create\n * an instance of this class by your own.\n */\nexport default class TextProxy extends TypeCheckable {\n /**\n * Creates a text proxy.\n *\n * @internal\n * @param textNode Text node which part is represented by this text proxy.\n * @param offsetInText Offset in {@link module:engine/view/textproxy~TextProxy#textNode text node}\n * from which the text proxy starts.\n * @param length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.\n * @constructor\n */\n constructor(textNode, offsetInText, length) {\n super();\n this.textNode = textNode;\n if (offsetInText < 0 || offsetInText > textNode.data.length) {\n /**\n * Given offsetInText value is incorrect.\n *\n * @error view-textproxy-wrong-offsetintext\n */\n throw new CKEditorError('view-textproxy-wrong-offsetintext', this);\n }\n if (length < 0 || offsetInText + length > textNode.data.length) {\n /**\n * Given length value is incorrect.\n *\n * @error view-textproxy-wrong-length\n */\n throw new CKEditorError('view-textproxy-wrong-length', this);\n }\n this.data = textNode.data.substring(offsetInText, offsetInText + length);\n this.offsetInText = offsetInText;\n }\n /**\n * Offset size of this node.\n */\n get offsetSize() {\n return this.data.length;\n }\n /**\n * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/view/text~Text text node}\n * (`true`) or the whole text node (`false`).\n *\n * This is `false` when text proxy starts at the very beginning of {@link module:engine/view/textproxy~TextProxy#textNode textNode}\n * ({@link module:engine/view/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to\n * text node size.\n */\n get isPartial() {\n return this.data.length !== this.textNode.data.length;\n }\n /**\n * Parent of this text proxy, which is same as parent of text node represented by this text proxy.\n */\n get parent() {\n return this.textNode.parent;\n }\n /**\n * Root of this text proxy, which is same as root of text node represented by this text proxy.\n */\n get root() {\n return this.textNode.root;\n }\n /**\n * {@link module:engine/view/document~Document View document} that owns this text proxy, or `null` if the text proxy is inside\n * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n */\n get document() {\n return this.textNode.document;\n }\n /**\n * Returns ancestors array of this text proxy.\n *\n * @param options Options object.\n * @param options.includeSelf When set to `true`, textNode will be also included in parent's array.\n * @param options.parentFirst When set to `true`, array will be sorted from text proxy parent to\n * root element, otherwise root element will be the first item in the array.\n * @returns Array with ancestors.\n */\n getAncestors(options = {}) {\n const ancestors = [];\n let parent = options.includeSelf ? this.textNode : this.parent;\n while (parent !== null) {\n ancestors[options.parentFirst ? 'push' : 'unshift'](parent);\n parent = parent.parent;\n }\n return ancestors;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nTextProxy.prototype.is = function (type) {\n return type === '$textProxy' || type === 'view:$textProxy' ||\n // This are legacy values kept for backward compatibility.\n type === 'textProxy' || type === 'view:textProxy';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isPlainObject } from 'lodash-es';\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\n/**\n * View matcher class.\n * Instance of this class can be used to find {@link module:engine/view/element~Element elements} that match given pattern.\n */\nexport default class Matcher {\n /**\n * Creates new instance of Matcher.\n *\n * @param pattern Match patterns. See {@link module:engine/view/matcher~Matcher#add add method} for more information.\n */\n constructor(...pattern) {\n this._patterns = [];\n this.add(...pattern);\n }\n /**\n * Adds pattern or patterns to matcher instance.\n *\n * ```ts\n * // String.\n * matcher.add( 'div' );\n *\n * // Regular expression.\n * matcher.add( /^\\w/ );\n *\n * // Single class.\n * matcher.add( {\n * \tclasses: 'foobar'\n * } );\n * ```\n *\n * See {@link module:engine/view/matcher~MatcherPattern} for more examples.\n *\n * Multiple patterns can be added in one call:\n *\n * ```ts\n * matcher.add( 'div', { classes: 'foobar' } );\n * ```\n *\n * @param pattern Object describing pattern details. If string or regular expression\n * is provided it will be used to match element's name. Pattern can be also provided in a form\n * of a function - then this function will be called with each {@link module:engine/view/element~Element element} as a parameter.\n * Function's return value will be stored under `match` key of the object returned from\n * {@link module:engine/view/matcher~Matcher#match match} or {@link module:engine/view/matcher~Matcher#matchAll matchAll} methods.\n */\n add(...pattern) {\n for (let item of pattern) {\n // String or RegExp pattern is used as element's name.\n if (typeof item == 'string' || item instanceof RegExp) {\n item = { name: item };\n }\n this._patterns.push(item);\n }\n }\n /**\n * Matches elements for currently stored patterns. Returns match information about first found\n * {@link module:engine/view/element~Element element}, otherwise returns `null`.\n *\n * Example of returned object:\n *\n * ```ts\n * {\n * \telement: <instance of found element>,\n * \tpattern: <pattern used to match found element>,\n * \tmatch: {\n * \t\tname: true,\n * \t\tattributes: [ 'title', 'href' ],\n * \t\tclasses: [ 'foo' ],\n * \t\tstyles: [ 'color', 'position' ]\n * \t}\n * }\n * ```\n *\n * @see module:engine/view/matcher~Matcher#add\n * @see module:engine/view/matcher~Matcher#matchAll\n * @param element View element to match against stored patterns.\n */\n match(...element) {\n for (const singleElement of element) {\n for (const pattern of this._patterns) {\n const match = isElementMatching(singleElement, pattern);\n if (match) {\n return {\n element: singleElement,\n pattern,\n match\n };\n }\n }\n }\n return null;\n }\n /**\n * Matches elements for currently stored patterns. Returns array of match information with all found\n * {@link module:engine/view/element~Element elements}. If no element is found - returns `null`.\n *\n * @see module:engine/view/matcher~Matcher#add\n * @see module:engine/view/matcher~Matcher#match\n * @param element View element to match against stored patterns.\n * @returns Array with match information about found elements or `null`. For more information\n * see {@link module:engine/view/matcher~Matcher#match match method} description.\n */\n matchAll(...element) {\n const results = [];\n for (const singleElement of element) {\n for (const pattern of this._patterns) {\n const match = isElementMatching(singleElement, pattern);\n if (match) {\n results.push({\n element: singleElement,\n pattern,\n match\n });\n }\n }\n }\n return results.length > 0 ? results : null;\n }\n /**\n * Returns the name of the element to match if there is exactly one pattern added to the matcher instance\n * and it matches element name defined by `string` (not `RegExp`). Otherwise, returns `null`.\n *\n * @returns Element name trying to match.\n */\n getElementName() {\n if (this._patterns.length !== 1) {\n return null;\n }\n const pattern = this._patterns[0];\n const name = pattern.name;\n return (typeof pattern != 'function' && name && !(name instanceof RegExp)) ? name : null;\n }\n}\n/**\n * Returns match information if {@link module:engine/view/element~Element element} is matching provided pattern.\n * If element cannot be matched to provided pattern - returns `null`.\n *\n * @returns Returns object with match information or null if element is not matching.\n */\nfunction isElementMatching(element, pattern) {\n // If pattern is provided as function - return result of that function;\n if (typeof pattern == 'function') {\n return pattern(element);\n }\n const match = {};\n // Check element's name.\n if (pattern.name) {\n match.name = matchName(pattern.name, element.name);\n if (!match.name) {\n return null;\n }\n }\n // Check element's attributes.\n if (pattern.attributes) {\n match.attributes = matchAttributes(pattern.attributes, element);\n if (!match.attributes) {\n return null;\n }\n }\n // Check element's classes.\n if (pattern.classes) {\n match.classes = matchClasses(pattern.classes, element);\n if (!match.classes) {\n return null;\n }\n }\n // Check element's styles.\n if (pattern.styles) {\n match.styles = matchStyles(pattern.styles, element);\n if (!match.styles) {\n return null;\n }\n }\n return match;\n}\n/**\n * Checks if name can be matched by provided pattern.\n *\n * @returns Returns `true` if name can be matched, `false` otherwise.\n */\nfunction matchName(pattern, name) {\n // If pattern is provided as RegExp - test against this regexp.\n if (pattern instanceof RegExp) {\n return !!name.match(pattern);\n }\n return pattern === name;\n}\n/**\n * Checks if an array of key/value pairs can be matched against provided patterns.\n *\n * Patterns can be provided in a following ways:\n * - a boolean value matches any attribute with any value (or no value):\n *\n * ```ts\n * pattern: true\n * ```\n *\n * - a RegExp expression or object matches any attribute name:\n *\n * ```ts\n * pattern: /h[1-6]/\n * ```\n *\n * - an object matches any attribute that has the same name as the object item's key, where object item's value is:\n * \t- equal to `true`, which matches any attribute value:\n *\n * ```ts\n * pattern: {\n * \trequired: true\n * }\n * ```\n *\n * \t- a string that is equal to attribute value:\n *\n * ```ts\n * pattern: {\n * \trel: 'nofollow'\n * }\n * ```\n *\n * \t- a regular expression that matches attribute value,\n *\n * ```ts\n * pattern: {\n * \tsrc: /^https/\n * }\n * ```\n *\n * - an array with items, where the item is:\n * \t- a string that is equal to attribute value:\n *\n * ```ts\n * pattern: [ 'data-property-1', 'data-property-2' ],\n * ```\n *\n * \t- an object with `key` and `value` property, where `key` is a regular expression matching attribute name and\n * \t\t`value` is either regular expression matching attribute value or a string equal to attribute value:\n *\n * ```ts\n * pattern: [\n * \t{ key: /^data-property-/, value: true },\n * \t// or:\n * \t{ key: /^data-property-/, value: 'foobar' },\n * \t// or:\n * \t{ key: /^data-property-/, value: /^foo/ }\n * ]\n * ```\n *\n * @param patterns Object with information about attributes to match.\n * @param keys Attribute, style or class keys.\n * @param valueGetter A function providing value for a given item key.\n * @returns Returns array with matched attribute names or `null` if no attributes were matched.\n */\nfunction matchPatterns(patterns, keys, valueGetter) {\n const normalizedPatterns = normalizePatterns(patterns);\n const normalizedItems = Array.from(keys);\n const match = [];\n normalizedPatterns.forEach(([patternKey, patternValue]) => {\n normalizedItems.forEach(itemKey => {\n if (isKeyMatched(patternKey, itemKey) &&\n isValueMatched(patternValue, itemKey, valueGetter)) {\n match.push(itemKey);\n }\n });\n });\n // Return matches only if there are at least as many of them as there are patterns.\n // The RegExp pattern can match more than one item.\n if (!normalizedPatterns.length || match.length < normalizedPatterns.length) {\n return undefined;\n }\n return match;\n}\n/**\n * Bring all the possible pattern forms to an array of arrays where first item is a key and second is a value.\n *\n * Examples:\n *\n * Boolean pattern value:\n *\n * ```ts\n * true\n * ```\n *\n * to\n *\n * ```ts\n * [ [ true, true ] ]\n * ```\n *\n * Textual pattern value:\n *\n * ```ts\n * 'attribute-name-or-class-or-style'\n * ```\n *\n * to\n *\n * ```ts\n * [ [ 'attribute-name-or-class-or-style', true ] ]\n * ```\n *\n * Regular expression:\n *\n * ```ts\n * /^data-.*$/\n * ```\n *\n * to\n *\n * ```ts\n * [ [ /^data-.*$/, true ] ]\n * ```\n *\n * Objects (plain or with `key` and `value` specified explicitly):\n *\n * ```ts\n * {\n * \tsrc: /^https:.*$/\n * }\n * ```\n *\n * or\n *\n * ```ts\n * [ {\n * \tkey: 'src',\n * \tvalue: /^https:.*$/\n * } ]\n * ```\n *\n * to:\n *\n * ```ts\n * [ [ 'src', /^https:.*$/ ] ]\n * ```\n *\n * @returns Returns an array of objects or null if provided patterns were not in an expected form.\n */\nfunction normalizePatterns(patterns) {\n if (Array.isArray(patterns)) {\n return patterns.map((pattern) => {\n if (isPlainObject(pattern)) {\n if (pattern.key === undefined || pattern.value === undefined) {\n // Documented at the end of matcher.js.\n logWarning('matcher-pattern-missing-key-or-value', pattern);\n }\n return [pattern.key, pattern.value];\n }\n // Assume the pattern is either String or RegExp.\n return [pattern, true];\n });\n }\n if (isPlainObject(patterns)) {\n return Object.entries(patterns);\n }\n // Other cases (true, string or regexp).\n return [[patterns, true]];\n}\n/**\n * @param patternKey A pattern representing a key we want to match.\n * @param itemKey An actual item key (e.g. `'src'`, `'background-color'`, `'ck-widget'`) we're testing against pattern.\n */\nfunction isKeyMatched(patternKey, itemKey) {\n return patternKey === true ||\n patternKey === itemKey ||\n patternKey instanceof RegExp && itemKey.match(patternKey);\n}\n/**\n * @param patternValue A pattern representing a value we want to match.\n * @param itemKey An item key, e.g. `background`, `href`, 'rel', etc.\n * @param valueGetter A function used to provide a value for a given `itemKey`.\n */\nfunction isValueMatched(patternValue, itemKey, valueGetter) {\n if (patternValue === true) {\n return true;\n }\n const itemValue = valueGetter(itemKey);\n // For now, the reducers are not returning the full tree of properties.\n // Casting to string preserves the old behavior until the root cause is fixed.\n // More can be found in https://github.com/ckeditor/ckeditor5/issues/10399.\n return patternValue === itemValue ||\n patternValue instanceof RegExp && !!String(itemValue).match(patternValue);\n}\n/**\n * Checks if attributes of provided element can be matched against provided patterns.\n *\n * @param patterns Object with information about attributes to match. Each key of the object will be\n * used as attribute name. Value of each key can be a string or regular expression to match against attribute value.\n * @param element Element which attributes will be tested.\n * @returns Returns array with matched attribute names or `null` if no attributes were matched.\n */\nfunction matchAttributes(patterns, element) {\n const attributeKeys = new Set(element.getAttributeKeys());\n // `style` and `class` attribute keys are deprecated. Only allow them in object pattern\n // for backward compatibility.\n if (isPlainObject(patterns)) {\n if (patterns.style !== undefined) {\n // Documented at the end of matcher.js.\n logWarning('matcher-pattern-deprecated-attributes-style-key', patterns);\n }\n if (patterns.class !== undefined) {\n // Documented at the end of matcher.js.\n logWarning('matcher-pattern-deprecated-attributes-class-key', patterns);\n }\n }\n else {\n attributeKeys.delete('style');\n attributeKeys.delete('class');\n }\n return matchPatterns(patterns, attributeKeys, key => element.getAttribute(key));\n}\n/**\n * Checks if classes of provided element can be matched against provided patterns.\n *\n * @param patterns Array of strings or regular expressions to match against element's classes.\n * @param element Element which classes will be tested.\n * @returns Returns array with matched class names or `null` if no classes were matched.\n */\nfunction matchClasses(patterns, element) {\n // We don't need `getter` here because patterns for classes are always normalized to `[ className, true ]`.\n return matchPatterns(patterns, element.getClassNames(), /* istanbul ignore next -- @preserve */ () => { });\n}\n/**\n * Checks if styles of provided element can be matched against provided patterns.\n *\n * @param patterns Object with information about styles to match. Each key of the object will be\n * used as style name. Value of each key can be a string or regular expression to match against style value.\n * @param element Element which styles will be tested.\n * @returns Returns array with matched style names or `null` if no styles were matched.\n */\nfunction matchStyles(patterns, element) {\n return matchPatterns(patterns, element.getStyleNames(true), key => element.getStyle(key));\n}\n/**\n * The key-value matcher pattern is missing key or value. Both must be present.\n * Refer the documentation: {@link module:engine/view/matcher~MatcherPattern}.\n *\n * @param pattern Pattern with missing properties.\n * @error matcher-pattern-missing-key-or-value\n */\n/**\n * The key-value matcher pattern for `attributes` option is using deprecated `style` key.\n *\n * Use `styles` matcher pattern option instead:\n *\n * ```ts\n * // Instead of:\n * const pattern = {\n * \tattributes: {\n * \t\tkey1: 'value1',\n * \t\tkey2: 'value2',\n * \t\tstyle: /^border.*$/\n * \t}\n * }\n *\n * // Use:\n * const pattern = {\n * \tattributes: {\n * \t\tkey1: 'value1',\n * \t\tkey2: 'value2'\n * \t},\n * \tstyles: /^border.*$/\n * }\n * ```\n *\n * Refer to the {@glink updating/guides/update-to-29##update-to-ckeditor-5-v2910 Migration to v29.1.0} guide\n * and {@link module:engine/view/matcher~MatcherPattern} documentation.\n *\n * @param pattern Pattern with missing properties.\n * @error matcher-pattern-deprecated-attributes-style-key\n */\n/**\n * The key-value matcher pattern for `attributes` option is using deprecated `class` key.\n *\n * Use `classes` matcher pattern option instead:\n *\n * ```ts\n * // Instead of:\n * const pattern = {\n * \tattributes: {\n * \t\tkey1: 'value1',\n * \t\tkey2: 'value2',\n * \t\tclass: 'foobar'\n * \t}\n * }\n *\n * // Use:\n * const pattern = {\n * \tattributes: {\n * \t\tkey1: 'value1',\n * \t\tkey2: 'value2'\n * \t},\n * \tclasses: 'foobar'\n * }\n * ```\n *\n * Refer to the {@glink updating/guides/update-to-29##update-to-ckeditor-5-v2910 Migration to v29.1.0} guide\n * and the {@link module:engine/view/matcher~MatcherPattern} documentation.\n *\n * @param pattern Pattern with missing properties.\n * @error matcher-pattern-deprecated-attributes-class-key\n */\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nexport default baseSlice;\n","import castPath from './_castPath.js';\nimport last from './last.js';\nimport parent from './_parent.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nexport default baseUnset;\n","import baseGet from './_baseGet.js';\nimport baseSlice from './_baseSlice.js';\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nexport default parent;\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nexport default last;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","import baseSet from './_baseSet.js';\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nexport default set;\n","import assignValue from './_assignValue.js';\nimport castPath from './_castPath.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nexport default baseSet;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/stylesmap\n */\nimport { get, isObject, merge, set, unset } from 'lodash-es';\n/**\n * Styles map. Allows handling (adding, removing, retrieving) a set of style rules (usually, of an element).\n */\nexport default class StylesMap {\n /**\n * Creates Styles instance.\n */\n constructor(styleProcessor) {\n this._styles = {};\n this._styleProcessor = styleProcessor;\n }\n /**\n * Returns true if style map has no styles set.\n */\n get isEmpty() {\n const entries = Object.entries(this._styles);\n return !entries.length;\n }\n /**\n * Number of styles defined.\n */\n get size() {\n if (this.isEmpty) {\n return 0;\n }\n return this.getStyleNames().length;\n }\n /**\n * Set styles map to a new value.\n *\n * ```ts\n * styles.setTo( 'border:1px solid blue;margin-top:1px;' );\n * ```\n */\n setTo(inlineStyle) {\n this.clear();\n const parsedStyles = parseInlineStyles(inlineStyle);\n for (const [key, value] of parsedStyles) {\n this._styleProcessor.toNormalizedForm(key, value, this._styles);\n }\n }\n /**\n * Checks if a given style is set.\n *\n * ```ts\n * styles.setTo( 'margin-left:1px;' );\n *\n * styles.has( 'margin-left' ); // -> true\n * styles.has( 'padding' ); // -> false\n * ```\n *\n * **Note**: This check supports normalized style names.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * styles.setTo( 'margin:2px;' );\n *\n * styles.has( 'margin' ); // -> true\n * styles.has( 'margin-top' ); // -> true\n * styles.has( 'margin-left' ); // -> true\n *\n * styles.remove( 'margin-top' );\n *\n * styles.has( 'margin' ); // -> false\n * styles.has( 'margin-top' ); // -> false\n * styles.has( 'margin-left' ); // -> true\n * ```\n *\n * @param name Style name.\n */\n has(name) {\n if (this.isEmpty) {\n return false;\n }\n const styles = this._styleProcessor.getReducedForm(name, this._styles);\n const propertyDescriptor = styles.find(([property]) => property === name);\n // Only return a value if it is set;\n return Array.isArray(propertyDescriptor);\n }\n set(nameOrObject, valueOrObject) {\n if (isObject(nameOrObject)) {\n for (const [key, value] of Object.entries(nameOrObject)) {\n this._styleProcessor.toNormalizedForm(key, value, this._styles);\n }\n }\n else {\n this._styleProcessor.toNormalizedForm(nameOrObject, valueOrObject, this._styles);\n }\n }\n /**\n * Removes given style.\n *\n * ```ts\n * styles.setTo( 'background:#f00;margin-right:2px;' );\n *\n * styles.remove( 'background' );\n *\n * styles.toString(); // -> 'margin-right:2px;'\n * ```\n *\n * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules\n * enabled style processor rules} to normalize passed values.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * styles.setTo( 'margin:1px' );\n *\n * styles.remove( 'margin-top' );\n * styles.remove( 'margin-right' );\n *\n * styles.toString(); // -> 'margin-bottom:1px;margin-left:1px;'\n * ```\n *\n * @param name Style name.\n */\n remove(name) {\n const path = toPath(name);\n unset(this._styles, path);\n delete this._styles[name];\n this._cleanEmptyObjectsOnPath(path);\n }\n /**\n * Returns a normalized style object or a single value.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * const styles = new Styles();\n * styles.setTo( 'margin:1px 2px 3em;' );\n *\n * styles.getNormalized( 'margin' );\n * // will log:\n * // {\n * // top: '1px',\n * // right: '2px',\n * // bottom: '3em',\n * // left: '2px' // normalized value from margin shorthand\n * // }\n *\n * styles.getNormalized( 'margin-left' ); // -> '2px'\n * ```\n *\n * **Note**: This method will only return normalized styles if a style processor was defined.\n *\n * @param name Style name.\n */\n getNormalized(name) {\n return this._styleProcessor.getNormalized(name, this._styles);\n }\n /**\n * Returns a normalized style string. Styles are sorted by name.\n *\n * ```ts\n * styles.set( 'margin' , '1px' );\n * styles.set( 'background', '#f00' );\n *\n * styles.toString(); // -> 'background:#f00;margin:1px;'\n * ```\n *\n * **Note**: This method supports normalized styles if defined.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * styles.set( 'margin' , '1px' );\n * styles.set( 'background', '#f00' );\n * styles.remove( 'margin-top' );\n * styles.remove( 'margin-right' );\n *\n * styles.toString(); // -> 'background:#f00;margin-bottom:1px;margin-left:1px;'\n * ```\n */\n toString() {\n if (this.isEmpty) {\n return '';\n }\n return this.getStylesEntries()\n .map(arr => arr.join(':'))\n .sort()\n .join(';') + ';';\n }\n /**\n * Returns property as a value string or undefined if property is not set.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * const styles = new Styles();\n * styles.setTo( 'margin:1px;' );\n * styles.set( 'margin-bottom', '3em' );\n *\n * styles.getAsString( 'margin' ); // -> 'margin: 1px 1px 3em;'\n * ```\n *\n * Note, however, that all sub-values must be set for the longhand property name to return a value:\n *\n * ```ts\n * const styles = new Styles();\n * styles.setTo( 'margin:1px;' );\n * styles.remove( 'margin-bottom' );\n *\n * styles.getAsString( 'margin' ); // -> undefined\n * ```\n *\n * In the above scenario, it is not possible to return a `margin` value, so `undefined` is returned.\n * Instead, you should use:\n *\n * ```ts\n * const styles = new Styles();\n * styles.setTo( 'margin:1px;' );\n * styles.remove( 'margin-bottom' );\n *\n * for ( const styleName of styles.getStyleNames() ) {\n * \tconsole.log( styleName, styles.getAsString( styleName ) );\n * }\n * // 'margin-top', '1px'\n * // 'margin-right', '1px'\n * // 'margin-left', '1px'\n * ```\n *\n * In general, it is recommend to iterate over style names like in the example above. This way, you will always get all\n * the currently set style values. So, if all the 4 margin values would be set\n * the for-of loop above would yield only `'margin'`, `'1px'`:\n *\n * ```ts\n * const styles = new Styles();\n * styles.setTo( 'margin:1px;' );\n *\n * for ( const styleName of styles.getStyleNames() ) {\n * \tconsole.log( styleName, styles.getAsString( styleName ) );\n * }\n * // 'margin', '1px'\n * ```\n *\n * **Note**: To get a normalized version of a longhand property use the {@link #getNormalized `#getNormalized()`} method.\n */\n getAsString(propertyName) {\n if (this.isEmpty) {\n return;\n }\n if (this._styles[propertyName] && !isObject(this._styles[propertyName])) {\n // Try return styles set directly - values that are not parsed.\n return this._styles[propertyName];\n }\n const styles = this._styleProcessor.getReducedForm(propertyName, this._styles);\n const propertyDescriptor = styles.find(([property]) => property === propertyName);\n // Only return a value if it is set;\n if (Array.isArray(propertyDescriptor)) {\n return propertyDescriptor[1];\n }\n }\n /**\n * Returns all style properties names as they would appear when using {@link #toString `#toString()`}.\n *\n * When `expand` is set to true and there's a shorthand style property set, it will also return all equivalent styles:\n *\n * ```ts\n * stylesMap.setTo( 'margin: 1em' )\n * ```\n *\n * will be expanded to:\n *\n * ```ts\n * [ 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ]\n * ```\n *\n * @param expand Expand shorthand style properties and all return equivalent style representations.\n */\n getStyleNames(expand = false) {\n if (this.isEmpty) {\n return [];\n }\n if (expand) {\n return this._styleProcessor.getStyleNames(this._styles);\n }\n const entries = this.getStylesEntries();\n return entries.map(([key]) => key);\n }\n /**\n * Removes all styles.\n */\n clear() {\n this._styles = {};\n }\n /**\n * Returns normalized styles entries for further processing.\n */\n getStylesEntries() {\n const parsed = [];\n const keys = Object.keys(this._styles);\n for (const key of keys) {\n parsed.push(...this._styleProcessor.getReducedForm(key, this._styles));\n }\n return parsed;\n }\n /**\n * Removes empty objects upon removing an entry from internal object.\n */\n _cleanEmptyObjectsOnPath(path) {\n const pathParts = path.split('.');\n const isChildPath = pathParts.length > 1;\n if (!isChildPath) {\n return;\n }\n const parentPath = pathParts.splice(0, pathParts.length - 1).join('.');\n const parentObject = get(this._styles, parentPath);\n if (!parentObject) {\n return;\n }\n const isParentEmpty = !Object.keys(parentObject).length;\n if (isParentEmpty) {\n this.remove(parentPath);\n }\n }\n}\n/**\n * Style processor is responsible for writing and reading a normalized styles object.\n */\nexport class StylesProcessor {\n /**\n * Creates StylesProcessor instance.\n *\n * @internal\n */\n constructor() {\n this._normalizers = new Map();\n this._extractors = new Map();\n this._reducers = new Map();\n this._consumables = new Map();\n }\n /**\n * Parse style string value to a normalized object and appends it to styles object.\n *\n * ```ts\n * const styles = {};\n *\n * stylesProcessor.toNormalizedForm( 'margin', '1px', styles );\n *\n * // styles will consist: { margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; } }\n * ```\n *\n * **Note**: To define normalizer callbacks use {@link #setNormalizer}.\n *\n * @param name Name of style property.\n * @param propertyValue Value of style property.\n * @param styles Object holding normalized styles.\n */\n toNormalizedForm(name, propertyValue, styles) {\n if (isObject(propertyValue)) {\n appendStyleValue(styles, toPath(name), propertyValue);\n return;\n }\n if (this._normalizers.has(name)) {\n const normalizer = this._normalizers.get(name);\n const { path, value } = normalizer(propertyValue);\n appendStyleValue(styles, path, value);\n }\n else {\n appendStyleValue(styles, name, propertyValue);\n }\n }\n /**\n * Returns a normalized version of a style property.\n *\n * ```ts\n * const styles = {\n * \tmargin: { top: '1px', right: '1px', bottom: '1px', left: '1px; },\n * \tbackground: { color: '#f00' }\n * };\n *\n * stylesProcessor.getNormalized( 'background' );\n * // will return: { color: '#f00' }\n *\n * stylesProcessor.getNormalized( 'margin-top' );\n * // will return: '1px'\n * ```\n *\n * **Note**: In some cases extracting single value requires defining an extractor callback {@link #setExtractor}.\n *\n * @param name Name of style property.\n * @param styles Object holding normalized styles.\n */\n getNormalized(name, styles) {\n if (!name) {\n return merge({}, styles);\n }\n // Might be empty string.\n if (styles[name] !== undefined) {\n return styles[name];\n }\n if (this._extractors.has(name)) {\n const extractor = this._extractors.get(name);\n if (typeof extractor === 'string') {\n return get(styles, extractor);\n }\n const value = extractor(name, styles);\n if (value) {\n return value;\n }\n }\n return get(styles, toPath(name));\n }\n /**\n * Returns a reduced form of style property form normalized object.\n *\n * For default margin reducer, the below code:\n *\n * ```ts\n * stylesProcessor.getReducedForm( 'margin', {\n * \tmargin: { top: '1px', right: '1px', bottom: '2px', left: '1px; }\n * } );\n * ```\n *\n * will return:\n *\n * ```ts\n * [\n * \t[ 'margin', '1px 1px 2px' ]\n * ]\n * ```\n *\n * because it might be represented as a shorthand 'margin' value. However if one of margin long hand values is missing it should return:\n *\n * ```ts\n * [\n * \t[ 'margin-top', '1px' ],\n * \t[ 'margin-right', '1px' ],\n * \t[ 'margin-bottom', '2px' ]\n * \t// the 'left' value is missing - cannot use 'margin' shorthand.\n * ]\n * ```\n *\n * **Note**: To define reducer callbacks use {@link #setReducer}.\n *\n * @param name Name of style property.\n */\n getReducedForm(name, styles) {\n const normalizedValue = this.getNormalized(name, styles);\n // Might be empty string.\n if (normalizedValue === undefined) {\n return [];\n }\n if (this._reducers.has(name)) {\n const reducer = this._reducers.get(name);\n return reducer(normalizedValue);\n }\n return [[name, normalizedValue]];\n }\n /**\n * Return all style properties. Also expand shorthand properties (e.g. `margin`, `background`) if respective extractor is available.\n *\n * @param styles Object holding normalized styles.\n */\n getStyleNames(styles) {\n // Find all extractable styles that have a value.\n const expandedStyleNames = Array.from(this._consumables.keys()).filter(name => {\n const style = this.getNormalized(name, styles);\n if (style && typeof style == 'object') {\n return Object.keys(style).length;\n }\n return style;\n });\n // For simple styles (for example `color`) we don't have a map of those styles\n // but they are 1 to 1 with normalized object keys.\n const styleNamesKeysSet = new Set([\n ...expandedStyleNames,\n ...Object.keys(styles)\n ]);\n return Array.from(styleNamesKeysSet);\n }\n /**\n * Returns related style names.\n *\n * ```ts\n * stylesProcessor.getRelatedStyles( 'margin' );\n * // will return: [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ];\n *\n * stylesProcessor.getRelatedStyles( 'margin-top' );\n * // will return: [ 'margin' ];\n * ```\n *\n * **Note**: To define new style relations load an existing style processor or use\n * {@link module:engine/view/stylesmap~StylesProcessor#setStyleRelation `StylesProcessor.setStyleRelation()`}.\n */\n getRelatedStyles(name) {\n return this._consumables.get(name) || [];\n }\n /**\n * Adds a normalizer method for a style property.\n *\n * A normalizer returns describing how the value should be normalized.\n *\n * For instance 'margin' style is a shorthand for four margin values:\n *\n * - 'margin-top'\n * - 'margin-right'\n * - 'margin-bottom'\n * - 'margin-left'\n *\n * and can be written in various ways if some values are equal to others. For instance `'margin: 1px 2em;'` is a shorthand for\n * `'margin-top: 1px;margin-right: 2em;margin-bottom: 1px;margin-left: 2em'`.\n *\n * A normalizer should parse various margin notations as a single object:\n *\n * ```ts\n * const styles = {\n * \tmargin: {\n * \t\ttop: '1px',\n * \t\tright: '2em',\n * \t\tbottom: '1px',\n * \t\tleft: '2em'\n * \t}\n * };\n * ```\n *\n * Thus a normalizer for 'margin' style should return an object defining style path and value to store:\n *\n * ```ts\n * const returnValue = {\n * \tpath: 'margin',\n * \tvalue: {\n * \t\ttop: '1px',\n * \t\tright: '2em',\n * \t\tbottom: '1px',\n * \t\tleft: '2em'\n * \t}\n * };\n * ```\n *\n * Additionally to fully support all margin notations there should be also defined 4 normalizers for longhand margin notations. Below\n * is an example for 'margin-top' style property normalizer:\n *\n * ```ts\n * stylesProcessor.setNormalizer( 'margin-top', valueString => {\n * \treturn {\n * \t\tpath: 'margin.top',\n * \t\tvalue: valueString\n * \t}\n * } );\n * ```\n */\n setNormalizer(name, callback) {\n this._normalizers.set(name, callback);\n }\n /**\n * Adds a extractor callback for a style property.\n *\n * Most normalized style values are stored as one level objects. It is assumed that `'margin-top'` style will be stored as:\n *\n * ```ts\n * const styles = {\n * \tmargin: {\n * \t\ttop: 'value'\n * \t}\n * }\n * ```\n *\n * However, some styles can have conflicting notations and thus it might be harder to extract a style value from shorthand. For instance\n * the 'border-top-style' can be defined using `'border-top:solid'`, `'border-style:solid none none none'` or by `'border:solid'`\n * shorthands. The default border styles processors stores styles as:\n *\n * ```ts\n * const styles = {\n * \tborder: {\n * \t\tstyle: {\n * \t\t\ttop: 'solid'\n * \t\t}\n * \t}\n * }\n * ```\n *\n * as it is better to modify border style independently from other values. On the other part the output of the border might be\n * desired as `border-top`, `border-left`, etc notation.\n *\n * In the above example an extractor should return a side border value that combines style, color and width:\n *\n * ```ts\n * styleProcessor.setExtractor( 'border-top', styles => {\n * \treturn {\n * \t\tcolor: styles.border.color.top,\n * \t\tstyle: styles.border.style.top,\n * \t\twidth: styles.border.width.top\n * \t}\n * } );\n * ```\n *\n * @param callbackOrPath Callback that return a requested value or path string for single values.\n */\n setExtractor(name, callbackOrPath) {\n this._extractors.set(name, callbackOrPath);\n }\n /**\n * Adds a reducer callback for a style property.\n *\n * Reducer returns a minimal notation for given style name. For longhand properties it is not required to write a reducer as\n * by default the direct value from style path is taken.\n *\n * For shorthand styles a reducer should return minimal style notation either by returning single name-value tuple or multiple tuples\n * if a shorthand cannot be used. For instance for a margin shorthand a reducer might return:\n *\n * ```ts\n * const marginShortHandTuple = [\n * \t[ 'margin', '1px 1px 2px' ]\n * ];\n * ```\n *\n * or a longhand tuples for defined values:\n *\n * ```ts\n * // Considering margin.bottom and margin.left are undefined.\n * const marginLonghandsTuples = [\n * \t[ 'margin-top', '1px' ],\n * \t[ 'margin-right', '1px' ]\n * ];\n * ```\n *\n * A reducer obtains a normalized style value:\n *\n * ```ts\n * // Simplified reducer that always outputs 4 values which are always present:\n * stylesProcessor.setReducer( 'margin', margin => {\n * \treturn [\n * \t\t[ 'margin', `${ margin.top } ${ margin.right } ${ margin.bottom } ${ margin.left }` ]\n * \t]\n * } );\n * ```\n */\n setReducer(name, callback) {\n this._reducers.set(name, callback);\n }\n /**\n * Defines a style shorthand relation to other style notations.\n *\n * ```ts\n * stylesProcessor.setStyleRelation( 'margin', [\n * \t'margin-top',\n * \t'margin-right',\n * \t'margin-bottom',\n * \t'margin-left'\n * ] );\n * ```\n *\n * This enables expanding of style names for shorthands. For instance, if defined,\n * {@link module:engine/conversion/viewconsumable~ViewConsumable view consumable} items are automatically created\n * for long-hand margin style notation alongside the `'margin'` item.\n *\n * This means that when an element being converted has a style `margin`, a converter for `margin-left` will work just\n * fine since the view consumable will contain a consumable `margin-left` item (thanks to the relation) and\n * `element.getStyle( 'margin-left' )` will work as well assuming that the style processor was correctly configured.\n * However, once `margin-left` is consumed, `margin` will not be consumable anymore.\n */\n setStyleRelation(shorthandName, styleNames) {\n this._mapStyleNames(shorthandName, styleNames);\n for (const alsoName of styleNames) {\n this._mapStyleNames(alsoName, [shorthandName]);\n }\n }\n /**\n * Set two-way binding of style names.\n */\n _mapStyleNames(name, styleNames) {\n if (!this._consumables.has(name)) {\n this._consumables.set(name, []);\n }\n this._consumables.get(name).push(...styleNames);\n }\n}\n/**\n * Parses inline styles and puts property - value pairs into styles map.\n *\n * @param stylesString Styles to parse.\n * @returns Map of parsed properties and values.\n */\nfunction parseInlineStyles(stylesString) {\n // `null` if no quote was found in input string or last found quote was a closing quote. See below.\n let quoteType = null;\n let propertyNameStart = 0;\n let propertyValueStart = 0;\n let propertyName = null;\n const stylesMap = new Map();\n // Do not set anything if input string is empty.\n if (stylesString === '') {\n return stylesMap;\n }\n // Fix inline styles that do not end with `;` so they are compatible with algorithm below.\n if (stylesString.charAt(stylesString.length - 1) != ';') {\n stylesString = stylesString + ';';\n }\n // Seek the whole string for \"special characters\".\n for (let i = 0; i < stylesString.length; i++) {\n const char = stylesString.charAt(i);\n if (quoteType === null) {\n // No quote found yet or last found quote was a closing quote.\n switch (char) {\n case ':':\n // Most of time colon means that property name just ended.\n // Sometimes however `:` is found inside property value (for example in background image url).\n if (!propertyName) {\n // Treat this as end of property only if property name is not already saved.\n // Save property name.\n propertyName = stylesString.substr(propertyNameStart, i - propertyNameStart);\n // Save this point as the start of property value.\n propertyValueStart = i + 1;\n }\n break;\n case '\"':\n case '\\'':\n // Opening quote found (this is an opening quote, because `quoteType` is `null`).\n quoteType = char;\n break;\n case ';': {\n // Property value just ended.\n // Use previously stored property value start to obtain property value.\n const propertyValue = stylesString.substr(propertyValueStart, i - propertyValueStart);\n if (propertyName) {\n // Save parsed part.\n stylesMap.set(propertyName.trim(), propertyValue.trim());\n }\n propertyName = null;\n // Save this point as property name start. Property name starts immediately after previous property value ends.\n propertyNameStart = i + 1;\n break;\n }\n }\n }\n else if (char === quoteType) {\n // If a quote char is found and it is a closing quote, mark this fact by `null`-ing `quoteType`.\n quoteType = null;\n }\n }\n return stylesMap;\n}\n/**\n * Return lodash compatible path from style name.\n */\nfunction toPath(name) {\n return name.replace('-', '.');\n}\n/**\n * Appends style definition to the styles object.\n */\nfunction appendStyleValue(stylesObject, nameOrPath, valueOrObject) {\n let valueToSet = valueOrObject;\n if (isObject(valueOrObject)) {\n valueToSet = merge({}, get(stylesObject, nameOrPath), valueOrObject);\n }\n set(stylesObject, nameOrPath, valueToSet);\n}\n","import baseUnset from './_baseUnset.js';\n\n/**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\nfunction unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n}\n\nexport default unset;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/element\n */\nimport Node from './node.js';\nimport Text from './text.js';\nimport TextProxy from './textproxy.js';\nimport { isIterable, toArray, toMap } from '@ckeditor/ckeditor5-utils';\nimport { default as Matcher } from './matcher.js';\nimport { default as StylesMap } from './stylesmap.js';\n// @if CK_DEBUG_ENGINE // const { convertMapToTags } = require( '../dev-utils/utils' );\n/**\n * View element.\n *\n * The editing engine does not define a fixed semantics of its elements (it is \"DTD-free\").\n * This is why the type of the {@link module:engine/view/element~Element} need to\n * be defined by the feature developer. When creating an element you should use one of the following methods:\n *\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `downcastWriter#createContainerElement()`}\n * in order to create a {@link module:engine/view/containerelement~ContainerElement},\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `downcastWriter#createAttributeElement()`}\n * in order to create a {@link module:engine/view/attributeelement~AttributeElement},\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`}\n * in order to create a {@link module:engine/view/emptyelement~EmptyElement}.\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}\n * in order to create a {@link module:engine/view/uielement~UIElement}.\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`}\n * in order to create a {@link module:engine/view/editableelement~EditableElement}.\n *\n * Note that for view elements which are not created from the model, like elements from mutations, paste or\n * {@link module:engine/controller/datacontroller~DataController#set data.set} it is not possible to define the type of the element.\n * In such cases the {@link module:engine/view/upcastwriter~UpcastWriter#createElement `UpcastWriter#createElement()`} method\n * should be used to create generic view elements.\n */\nexport default class Element extends Node {\n /**\n * Creates a view element.\n *\n * Attributes can be passed in various formats:\n *\n * ```ts\n * new Element( viewDocument, 'div', { class: 'editor', contentEditable: 'true' } ); // object\n * new Element( viewDocument, 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator\n * new Element( viewDocument, 'div', mapOfAttributes ); // map\n * ```\n *\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document);\n /**\n * A list of attribute names that should be rendered in the editing pipeline even though filtering mechanisms\n * implemented in the {@link module:engine/view/domconverter~DomConverter} (for instance,\n * {@link module:engine/view/domconverter~DomConverter#shouldRenderAttribute}) would filter them out.\n *\n * These attributes can be specified as an option when the element is created by\n * the {@link module:engine/view/downcastwriter~DowncastWriter}. To check whether an unsafe an attribute should\n * be permitted, use the {@link #shouldRenderUnsafeAttribute} method.\n *\n * @internal\n */\n this._unsafeAttributesToRender = [];\n /**\n * Map of custom properties.\n * Custom properties can be added to element instance, will be cloned but not rendered into DOM.\n */\n this._customProperties = new Map();\n this.name = name;\n this._attrs = parseAttributes(attrs);\n this._children = [];\n if (children) {\n this._insertChild(0, children);\n }\n this._classes = new Set();\n if (this._attrs.has('class')) {\n // Remove class attribute and handle it by class set.\n const classString = this._attrs.get('class');\n parseClasses(this._classes, classString);\n this._attrs.delete('class');\n }\n this._styles = new StylesMap(this.document.stylesProcessor);\n if (this._attrs.has('style')) {\n // Remove style attribute and handle it by styles map.\n this._styles.setTo(this._attrs.get('style'));\n this._attrs.delete('style');\n }\n }\n /**\n * Number of element's children.\n */\n get childCount() {\n return this._children.length;\n }\n /**\n * Is `true` if there are no nodes inside this element, `false` otherwise.\n */\n get isEmpty() {\n return this._children.length === 0;\n }\n /**\n * Gets child at the given index.\n *\n * @param index Index of child.\n * @returns Child node.\n */\n getChild(index) {\n return this._children[index];\n }\n /**\n * Gets index of the given child node. Returns `-1` if child node is not found.\n *\n * @param node Child node.\n * @returns Index of the child node.\n */\n getChildIndex(node) {\n return this._children.indexOf(node);\n }\n /**\n * Gets child nodes iterator.\n *\n * @returns Child nodes iterator.\n */\n getChildren() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Returns an iterator that contains the keys for attributes. Order of inserting attributes is not preserved.\n *\n * @returns Keys for attributes.\n */\n *getAttributeKeys() {\n if (this._classes.size > 0) {\n yield 'class';\n }\n if (!this._styles.isEmpty) {\n yield 'style';\n }\n yield* this._attrs.keys();\n }\n /**\n * Returns iterator that iterates over this element's attributes.\n *\n * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n *getAttributes() {\n yield* this._attrs.entries();\n if (this._classes.size > 0) {\n yield ['class', this.getAttribute('class')];\n }\n if (!this._styles.isEmpty) {\n yield ['style', this.getAttribute('style')];\n }\n }\n /**\n * Gets attribute by key. If attribute is not present - returns undefined.\n *\n * @param key Attribute key.\n * @returns Attribute value.\n */\n getAttribute(key) {\n if (key == 'class') {\n if (this._classes.size > 0) {\n return [...this._classes].join(' ');\n }\n return undefined;\n }\n if (key == 'style') {\n const inlineStyle = this._styles.toString();\n return inlineStyle == '' ? undefined : inlineStyle;\n }\n return this._attrs.get(key);\n }\n /**\n * Returns a boolean indicating whether an attribute with the specified key exists in the element.\n *\n * @param key Attribute key.\n * @returns `true` if attribute with the specified key exists in the element, `false` otherwise.\n */\n hasAttribute(key) {\n if (key == 'class') {\n return this._classes.size > 0;\n }\n if (key == 'style') {\n return !this._styles.isEmpty;\n }\n return this._attrs.has(key);\n }\n /**\n * Checks if this element is similar to other element.\n * Both elements should have the same name and attributes to be considered as similar. Two similar elements\n * can contain different set of children nodes.\n */\n isSimilar(otherElement) {\n if (!(otherElement instanceof Element)) {\n return false;\n }\n // If exactly the same Element is provided - return true immediately.\n if (this === otherElement) {\n return true;\n }\n // Check element name.\n if (this.name != otherElement.name) {\n return false;\n }\n // Check number of attributes, classes and styles.\n if (this._attrs.size !== otherElement._attrs.size || this._classes.size !== otherElement._classes.size ||\n this._styles.size !== otherElement._styles.size) {\n return false;\n }\n // Check if attributes are the same.\n for (const [key, value] of this._attrs) {\n if (!otherElement._attrs.has(key) || otherElement._attrs.get(key) !== value) {\n return false;\n }\n }\n // Check if classes are the same.\n for (const className of this._classes) {\n if (!otherElement._classes.has(className)) {\n return false;\n }\n }\n // Check if styles are the same.\n for (const property of this._styles.getStyleNames()) {\n if (!otherElement._styles.has(property) ||\n otherElement._styles.getAsString(property) !== this._styles.getAsString(property)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns true if class is present.\n * If more then one class is provided - returns true only when all classes are present.\n *\n * ```ts\n * element.hasClass( 'foo' ); // Returns true if 'foo' class is present.\n * element.hasClass( 'foo', 'bar' ); // Returns true if 'foo' and 'bar' classes are both present.\n * ```\n */\n hasClass(...className) {\n for (const name of className) {\n if (!this._classes.has(name)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns iterator that contains all class names.\n */\n getClassNames() {\n return this._classes.keys();\n }\n /**\n * Returns style value for the given property mae.\n * If the style does not exist `undefined` is returned.\n *\n * **Note**: This method can work with normalized style names if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#getAsString `StylesMap#getAsString()`} for details.\n *\n * For an element with style set to `'margin:1px'`:\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * const element = view.change( writer => {\n * \tconst element = writer.createElement();\n * \twriter.setStyle( 'margin', '1px' );\n * \twriter.setStyle( 'margin-bottom', '3em' );\n *\n * \treturn element;\n * } );\n *\n * element.getStyle( 'margin' ); // -> 'margin: 1px 1px 3em;'\n * ```\n */\n getStyle(property) {\n return this._styles.getAsString(property);\n }\n /**\n * Returns a normalized style object or single style value.\n *\n * For an element with style set to: margin:1px 2px 3em;\n *\n * ```ts\n * element.getNormalizedStyle( 'margin' ) );\n * ```\n *\n * will return:\n *\n * ```ts\n * {\n * \ttop: '1px',\n * \tright: '2px',\n * \tbottom: '3em',\n * \tleft: '2px' // a normalized value from margin shorthand\n * }\n * ```\n *\n * and reading for single style value:\n *\n * ```ts\n * styles.getNormalizedStyle( 'margin-left' );\n * ```\n *\n * Will return a `2px` string.\n *\n * **Note**: This method will return normalized values only if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#getNormalized `StylesMap#getNormalized()`} for details.\n *\n * @param property Name of CSS property\n */\n getNormalizedStyle(property) {\n return this._styles.getNormalized(property);\n }\n /**\n * Returns iterator that contains all style names.\n *\n * @param expand Expand shorthand style properties and return all equivalent style representations.\n */\n getStyleNames(expand) {\n return this._styles.getStyleNames(expand);\n }\n /**\n * Returns true if style keys are present.\n * If more then one style property is provided - returns true only when all properties are present.\n *\n * ```ts\n * element.hasStyle( 'color' ); // Returns true if 'border-top' style is present.\n * element.hasStyle( 'color', 'border-top' ); // Returns true if 'color' and 'border-top' styles are both present.\n * ```\n */\n hasStyle(...property) {\n for (const name of property) {\n if (!this._styles.has(name)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns ancestor element that match specified pattern.\n * Provided patterns should be compatible with {@link module:engine/view/matcher~Matcher Matcher} as it is used internally.\n *\n * @see module:engine/view/matcher~Matcher\n * @param patterns Patterns used to match correct ancestor. See {@link module:engine/view/matcher~Matcher}.\n * @returns Found element or `null` if no matching ancestor was found.\n */\n findAncestor(...patterns) {\n const matcher = new Matcher(...patterns);\n let parent = this.parent;\n while (parent && !parent.is('documentFragment')) {\n if (matcher.match(parent)) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n /**\n * Returns the custom property value for the given key.\n */\n getCustomProperty(key) {\n return this._customProperties.get(key);\n }\n /**\n * Returns an iterator which iterates over this element's custom properties.\n * Iterator provides `[ key, value ]` pairs for each stored property.\n */\n *getCustomProperties() {\n yield* this._customProperties.entries();\n }\n /**\n * Returns identity string based on element's name, styles, classes and other attributes.\n * Two elements that {@link #isSimilar are similar} will have same identity string.\n * It has the following format:\n *\n * ```ts\n * 'name class=\"class1,class2\" style=\"style1:value1;style2:value2\" attr1=\"val1\" attr2=\"val2\"'\n * ```\n *\n * For example:\n *\n * ```ts\n * const element = writer.createContainerElement( 'foo', {\n * \tbanana: '10',\n * \tapple: '20',\n * \tstyle: 'color: red; border-color: white;',\n * \tclass: 'baz'\n * } );\n *\n * // returns 'foo class=\"baz\" style=\"border-color:white;color:red\" apple=\"20\" banana=\"10\"'\n * element.getIdentity();\n * ```\n *\n * **Note**: Classes, styles and other attributes are sorted alphabetically.\n */\n getIdentity() {\n const classes = Array.from(this._classes).sort().join(',');\n const styles = this._styles.toString();\n const attributes = Array.from(this._attrs).map(i => `${i[0]}=\"${i[1]}\"`).sort().join(' ');\n return this.name +\n (classes == '' ? '' : ` class=\"${classes}\"`) +\n (!styles ? '' : ` style=\"${styles}\"`) +\n (attributes == '' ? '' : ` ${attributes}`);\n }\n /**\n * Decides whether an unsafe attribute is whitelisted and should be rendered in the editing pipeline even though filtering mechanisms\n * like {@link module:engine/view/domconverter~DomConverter#shouldRenderAttribute} say it should not.\n *\n * Unsafe attribute names can be specified when creating an element via {@link module:engine/view/downcastwriter~DowncastWriter}.\n *\n * @param attributeName The name of the attribute to be checked.\n */\n shouldRenderUnsafeAttribute(attributeName) {\n return this._unsafeAttributesToRender.includes(attributeName);\n }\n /**\n * Clones provided element.\n *\n * @internal\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any children.\n * @returns Clone of this element.\n */\n _clone(deep = false) {\n const childrenClone = [];\n if (deep) {\n for (const child of this.getChildren()) {\n childrenClone.push(child._clone(deep));\n }\n }\n // ContainerElement and AttributeElement should be also cloned properly.\n const cloned = new this.constructor(this.document, this.name, this._attrs, childrenClone);\n // Classes and styles are cloned separately - this solution is faster than adding them back to attributes and\n // parse once again in constructor.\n cloned._classes = new Set(this._classes);\n cloned._styles.set(this._styles.getNormalized());\n // Clone custom properties.\n cloned._customProperties = new Map(this._customProperties);\n // Clone filler offset method.\n // We can't define this method in a prototype because it's behavior which\n // is changed by e.g. toWidget() function from ckeditor5-widget. Perhaps this should be one of custom props.\n cloned.getFillerOffset = this.getFillerOffset;\n // Clone unsafe attributes list.\n cloned._unsafeAttributesToRender = this._unsafeAttributesToRender;\n return cloned;\n }\n /**\n * {@link module:engine/view/element~Element#_insertChild Insert} a child node or a list of child nodes at the end of this node\n * and sets the parent of these nodes to this element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#insert\n * @internal\n * @param items Items to be inserted.\n * @fires change\n * @returns Number of appended nodes.\n */\n _appendChild(items) {\n return this._insertChild(this.childCount, items);\n }\n /**\n * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to\n * this element.\n *\n * @internal\n * @see module:engine/view/downcastwriter~DowncastWriter#insert\n * @param index Position where nodes should be inserted.\n * @param items Items to be inserted.\n * @fires change\n * @returns Number of inserted nodes.\n */\n _insertChild(index, items) {\n this._fireChange('children', this);\n let count = 0;\n const nodes = normalize(this.document, items);\n for (const node of nodes) {\n // If node that is being added to this element is already inside another element, first remove it from the old parent.\n if (node.parent !== null) {\n node._remove();\n }\n node.parent = this;\n node.document = this.document;\n this._children.splice(index, 0, node);\n index++;\n count++;\n }\n return count;\n }\n /**\n * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#remove\n * @internal\n * @param index Number of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @fires change\n * @returns The array of removed nodes.\n */\n _removeChildren(index, howMany = 1) {\n this._fireChange('children', this);\n for (let i = index; i < index + howMany; i++) {\n this._children[i].parent = null;\n }\n return this._children.splice(index, howMany);\n }\n /**\n * Adds or overwrite attribute with a specified key and value.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#setAttribute\n * @internal\n * @param key Attribute key.\n * @param value Attribute value.\n * @fires change\n */\n _setAttribute(key, value) {\n const stringValue = String(value);\n this._fireChange('attributes', this);\n if (key == 'class') {\n parseClasses(this._classes, stringValue);\n }\n else if (key == 'style') {\n this._styles.setTo(stringValue);\n }\n else {\n this._attrs.set(key, stringValue);\n }\n }\n /**\n * Removes attribute from the element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeAttribute\n * @internal\n * @param key Attribute key.\n * @returns Returns true if an attribute existed and has been removed.\n * @fires change\n */\n _removeAttribute(key) {\n this._fireChange('attributes', this);\n // Remove class attribute.\n if (key == 'class') {\n if (this._classes.size > 0) {\n this._classes.clear();\n return true;\n }\n return false;\n }\n // Remove style attribute.\n if (key == 'style') {\n if (!this._styles.isEmpty) {\n this._styles.clear();\n return true;\n }\n return false;\n }\n // Remove other attributes.\n return this._attrs.delete(key);\n }\n /**\n * Adds specified class.\n *\n * ```ts\n * element._addClass( 'foo' ); // Adds 'foo' class.\n * element._addClass( [ 'foo', 'bar' ] ); // Adds 'foo' and 'bar' classes.\n * ```\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#addClass\n * @internal\n * @fires change\n */\n _addClass(className) {\n this._fireChange('attributes', this);\n for (const name of toArray(className)) {\n this._classes.add(name);\n }\n }\n /**\n * Removes specified class.\n *\n * ```ts\n * element._removeClass( 'foo' ); // Removes 'foo' class.\n * element._removeClass( [ 'foo', 'bar' ] ); // Removes both 'foo' and 'bar' classes.\n * ```\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeClass\n * @internal\n * @fires change\n */\n _removeClass(className) {\n this._fireChange('attributes', this);\n for (const name of toArray(className)) {\n this._classes.delete(name);\n }\n }\n _setStyle(property, value) {\n this._fireChange('attributes', this);\n if (typeof property != 'string') {\n this._styles.set(property);\n }\n else {\n this._styles.set(property, value);\n }\n }\n /**\n * Removes specified style.\n *\n * ```ts\n * element._removeStyle( 'color' ); // Removes 'color' style.\n * element._removeStyle( [ 'color', 'border-top' ] ); // Removes both 'color' and 'border-top' styles.\n * ```\n *\n * **Note**: This method can work with normalized style names if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeStyle\n * @internal\n * @fires change\n */\n _removeStyle(property) {\n this._fireChange('attributes', this);\n for (const name of toArray(property)) {\n this._styles.remove(name);\n }\n }\n /**\n * Sets a custom property. Unlike attributes, custom properties are not rendered to the DOM,\n * so they can be used to add special data to elements.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty\n * @internal\n */\n _setCustomProperty(key, value) {\n this._customProperties.set(key, value);\n }\n /**\n * Removes the custom property stored under the given key.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty\n * @internal\n * @returns Returns true if property was removed.\n */\n _removeCustomProperty(key) {\n return this._customProperties.delete(key);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'element' || type === 'view:element' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'element' || type === 'view:element');\n }\n};\n/**\n * Parses attributes provided to the element constructor before they are applied to an element. If attributes are passed\n * as an object (instead of `Iterable`), the object is transformed to the map. Attributes with `null` value are removed.\n * Attributes with non-`String` value are converted to `String`.\n *\n * @param attrs Attributes to parse.\n * @returns Parsed attributes.\n */\nfunction parseAttributes(attrs) {\n const attrsMap = toMap(attrs);\n for (const [key, value] of attrsMap) {\n if (value === null) {\n attrsMap.delete(key);\n }\n else if (typeof value != 'string') {\n attrsMap.set(key, String(value));\n }\n }\n return attrsMap;\n}\n/**\n * Parses class attribute and puts all classes into classes set.\n * Classes set s cleared before insertion.\n *\n * @param classesSet Set to insert parsed classes.\n * @param classesString String with classes to parse.\n */\nfunction parseClasses(classesSet, classesString) {\n const classArray = classesString.split(/\\s+/);\n classesSet.clear();\n classArray.forEach(name => classesSet.add(name));\n}\n/**\n * Converts strings to Text and non-iterables to arrays.\n */\nfunction normalize(document, nodes) {\n // Separate condition because string is iterable.\n if (typeof nodes == 'string') {\n return [new Text(document, nodes)];\n }\n if (!isIterable(nodes)) {\n nodes = [nodes];\n }\n // Array.from to enable .map() on non-arrays.\n return Array.from(nodes)\n .map(node => {\n if (typeof node == 'string') {\n return new Text(document, node);\n }\n if (node instanceof TextProxy) {\n return new Text(document, node.data);\n }\n return node;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/containerelement\n */\nimport Element from './element.js';\n/**\n * Containers are elements which define document structure. They define boundaries for\n * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.\n *\n * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various\n * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},\n * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.\n *\n * The container element should be your default choice when writing a converter, unless:\n *\n * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),\n * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),\n * * this is a root element,\n * * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).\n *\n * To create a new container element instance use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}\n * method.\n */\nexport default class ContainerElement extends Element {\n /**\n * Creates a container element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement\n * @see module:engine/view/element~Element\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document, name, attrs, children);\n this.getFillerOffset = getFillerOffset;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nContainerElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'containerElement' || type === 'view:containerElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'containerElement' || type === 'view:containerElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.\n *\n * @returns Block filler offset or `null` if block filler is not needed.\n */\nexport function getFillerOffset() {\n const children = [...this.getChildren()];\n const lastChild = children[this.childCount - 1];\n // Block filler is required after a `<br>` if it's the last element in its container. See #1422.\n if (lastChild && lastChild.is('element', 'br')) {\n return this.childCount;\n }\n for (const child of children) {\n // If there's any non-UI element – don't render the bogus.\n if (!child.is('uiElement')) {\n return null;\n }\n }\n // If there are only UI elements – render the bogus at the end of the element.\n return this.childCount;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/editableelement\n */\nimport ContainerElement from './containerelement.js';\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Editable element which can be a {@link module:engine/view/rooteditableelement~RootEditableElement root}\n * or nested editable area in the editor.\n *\n * Editable is automatically read-only when its {@link module:engine/view/document~Document Document} is read-only.\n *\n * The constructor of this class shouldn't be used directly. To create new `EditableElement` use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`} method.\n */\nexport default class EditableElement extends /* #__PURE__ */ ObservableMixin(ContainerElement) {\n /**\n * Creates an editable element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createEditableElement\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attributes, children) {\n super(document, name, attributes, children);\n this.set('isReadOnly', false);\n this.set('isFocused', false);\n this.set('placeholder', undefined);\n this.bind('isReadOnly').to(document);\n this.bind('isFocused').to(document, 'isFocused', isFocused => isFocused && document.selection.editableElement == this);\n // Update focus state based on selection changes.\n this.listenTo(document.selection, 'change', () => {\n this.isFocused = document.isFocused && document.selection.editableElement == this;\n });\n }\n destroy() {\n this.stopListening();\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nEditableElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'editableElement' || type === 'view:editableElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'containerElement' || type === 'view:containerElement' ||\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'editableElement' || type === 'view:editableElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'containerElement' || type === 'view:containerElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/rooteditableelement\n */\nimport EditableElement from './editableelement.js';\nconst rootNameSymbol = Symbol('rootName');\n/**\n * Class representing a single root in the data view. A root can be either {@link ~RootEditableElement#isReadOnly editable or read-only},\n * but in both cases it is called \"an editable\". Roots can contain other {@link module:engine/view/editableelement~EditableElement\n * editable elements} making them \"nested editables\".\n */\nexport default class RootEditableElement extends EditableElement {\n /**\n * Creates root editable element.\n *\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n */\n constructor(document, name) {\n super(document, name);\n this.rootName = 'main';\n }\n /**\n * Name of this root inside {@link module:engine/view/document~Document} that is an owner of this root. If no\n * other name is set, `main` name is used.\n *\n * @readonly\n */\n get rootName() {\n return this.getCustomProperty(rootNameSymbol);\n }\n set rootName(rootName) {\n this._setCustomProperty(rootNameSymbol, rootName);\n }\n /**\n * Overrides old element name and sets new one.\n * This is needed because view roots are created before they are attached to the DOM.\n * The name of the root element is temporary at this stage. It has to be changed when the\n * view root element is attached to the DOM element.\n *\n * @internal\n * @param name The new name of element.\n */\n set _name(name) {\n this.name = name;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRootEditableElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'rootElement' || type === 'view:rootElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'editableElement' || type === 'view:editableElement' ||\n type === 'containerElement' || type === 'view:containerElement' ||\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'rootElement' || type === 'view:rootElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'editableElement' || type === 'view:editableElement' ||\n type === 'containerElement' || type === 'view:containerElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/treewalker\n */\nimport Element from './element.js';\nimport Text from './text.js';\nimport TextProxy from './textproxy.js';\nimport Position from './position.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Position iterator class. It allows to iterate forward and backward over the document.\n */\nexport default class TreeWalker {\n /**\n * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.\n *\n * @param options Object with configuration.\n */\n constructor(options = {}) {\n if (!options.boundaries && !options.startPosition) {\n /**\n * Neither boundaries nor starting position have been defined.\n *\n * @error view-tree-walker-no-start-position\n */\n throw new CKEditorError('view-tree-walker-no-start-position', null);\n }\n if (options.direction && options.direction != 'forward' && options.direction != 'backward') {\n /**\n * Only `backward` and `forward` direction allowed.\n *\n * @error view-tree-walker-unknown-direction\n */\n throw new CKEditorError('view-tree-walker-unknown-direction', options.startPosition, { direction: options.direction });\n }\n this.boundaries = options.boundaries || null;\n if (options.startPosition) {\n this._position = Position._createAt(options.startPosition);\n }\n else {\n this._position = Position._createAt(options.boundaries[options.direction == 'backward' ? 'end' : 'start']);\n }\n this.direction = options.direction || 'forward';\n this.singleCharacters = !!options.singleCharacters;\n this.shallow = !!options.shallow;\n this.ignoreElementEnd = !!options.ignoreElementEnd;\n this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;\n this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;\n }\n /**\n * Iterable interface.\n */\n [Symbol.iterator]() {\n return this;\n }\n /**\n * Iterator position. If start position is not defined then position depends on {@link #direction}. If direction is\n * `'forward'` position starts form the beginning, when direction is `'backward'` position starts from the end.\n */\n get position() {\n return this._position;\n }\n /**\n * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.\n *\n * For example:\n *\n * ```ts\n * walker.skip( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>\n * walker.skip( value => true ); // Move the position to the end: <p>{}foo</p> -> <p>foo</p>[]\n * walker.skip( value => false ); // Do not move the position.\n * ```\n *\n * @param skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n */\n skip(skip) {\n let nextResult;\n let prevPosition;\n do {\n prevPosition = this.position;\n nextResult = this.next();\n } while (!nextResult.done && skip(nextResult.value));\n if (!nextResult.done) {\n this._position = prevPosition;\n }\n }\n /**\n * Gets the next tree walker's value.\n *\n * @returns Object implementing iterator interface, returning\n * information about taken step.\n */\n next() {\n if (this.direction == 'forward') {\n return this._next();\n }\n else {\n return this._previous();\n }\n }\n /**\n * Makes a step forward in view. Moves the {@link #position} to the next position and returns the encountered value.\n */\n _next() {\n let position = this.position.clone();\n const previousPosition = this.position;\n const parent = position.parent;\n // We are at the end of the root.\n if (parent.parent === null && position.offset === parent.childCount) {\n return { done: true, value: undefined };\n }\n // We reached the walker boundary.\n if (parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset) {\n return { done: true, value: undefined };\n }\n // Get node just after current position.\n let node;\n // Text is a specific parent because it contains string instead of child nodes.\n if (parent instanceof Text) {\n if (position.isAtEnd) {\n // Prevent returning \"elementEnd\" for Text node. Skip that value and return the next walker step.\n this._position = Position._createAfter(parent);\n return this._next();\n }\n node = parent.data[position.offset];\n }\n else {\n node = parent.getChild(position.offset);\n }\n if (node instanceof Element) {\n if (!this.shallow) {\n position = new Position(node, 0);\n }\n else {\n // We are past the walker boundaries.\n if (this.boundaries && this.boundaries.end.isBefore(position)) {\n return { done: true, value: undefined };\n }\n position.offset++;\n }\n this._position = position;\n return this._formatReturnValue('elementStart', node, previousPosition, position, 1);\n }\n if (node instanceof Text) {\n if (this.singleCharacters) {\n position = new Position(node, 0);\n this._position = position;\n return this._next();\n }\n let charactersCount = node.data.length;\n let item;\n // If text stick out of walker range, we need to cut it and wrap in TextProxy.\n if (node == this._boundaryEndParent) {\n charactersCount = this.boundaries.end.offset;\n item = new TextProxy(node, 0, charactersCount);\n position = Position._createAfter(item);\n }\n else {\n item = new TextProxy(node, 0, node.data.length);\n // If not just keep moving forward.\n position.offset++;\n }\n this._position = position;\n return this._formatReturnValue('text', item, previousPosition, position, charactersCount);\n }\n if (typeof node == 'string') {\n let textLength;\n if (this.singleCharacters) {\n textLength = 1;\n }\n else {\n // Check if text stick out of walker range.\n const endOffset = parent === this._boundaryEndParent ? this.boundaries.end.offset : parent.data.length;\n textLength = endOffset - position.offset;\n }\n const textProxy = new TextProxy(parent, position.offset, textLength);\n position.offset += textLength;\n this._position = position;\n return this._formatReturnValue('text', textProxy, previousPosition, position, textLength);\n }\n // `node` is not set, we reached the end of current `parent`.\n position = Position._createAfter(parent);\n this._position = position;\n if (this.ignoreElementEnd) {\n return this._next();\n }\n return this._formatReturnValue('elementEnd', parent, previousPosition, position);\n }\n /**\n * Makes a step backward in view. Moves the {@link #position} to the previous position and returns the encountered value.\n */\n _previous() {\n let position = this.position.clone();\n const previousPosition = this.position;\n const parent = position.parent;\n // We are at the beginning of the root.\n if (parent.parent === null && position.offset === 0) {\n return { done: true, value: undefined };\n }\n // We reached the walker boundary.\n if (parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset) {\n return { done: true, value: undefined };\n }\n // Get node just before current position.\n let node;\n // Text {@link module:engine/view/text~Text} element is a specific parent because contains string instead of child nodes.\n if (parent instanceof Text) {\n if (position.isAtStart) {\n // Prevent returning \"elementStart\" for Text node. Skip that value and return the next walker step.\n this._position = Position._createBefore(parent);\n return this._previous();\n }\n node = parent.data[position.offset - 1];\n }\n else {\n node = parent.getChild(position.offset - 1);\n }\n if (node instanceof Element) {\n if (this.shallow) {\n position.offset--;\n this._position = position;\n return this._formatReturnValue('elementStart', node, previousPosition, position, 1);\n }\n position = new Position(node, node.childCount);\n this._position = position;\n if (this.ignoreElementEnd) {\n return this._previous();\n }\n return this._formatReturnValue('elementEnd', node, previousPosition, position);\n }\n if (node instanceof Text) {\n if (this.singleCharacters) {\n position = new Position(node, node.data.length);\n this._position = position;\n return this._previous();\n }\n let charactersCount = node.data.length;\n let item;\n // If text stick out of walker range, we need to cut it and wrap in TextProxy.\n if (node == this._boundaryStartParent) {\n const offset = this.boundaries.start.offset;\n item = new TextProxy(node, offset, node.data.length - offset);\n charactersCount = item.data.length;\n position = Position._createBefore(item);\n }\n else {\n item = new TextProxy(node, 0, node.data.length);\n // If not just keep moving backward.\n position.offset--;\n }\n this._position = position;\n return this._formatReturnValue('text', item, previousPosition, position, charactersCount);\n }\n if (typeof node == 'string') {\n let textLength;\n if (!this.singleCharacters) {\n // Check if text stick out of walker range.\n const startOffset = parent === this._boundaryStartParent ? this.boundaries.start.offset : 0;\n textLength = position.offset - startOffset;\n }\n else {\n textLength = 1;\n }\n position.offset -= textLength;\n const textProxy = new TextProxy(parent, position.offset, textLength);\n this._position = position;\n return this._formatReturnValue('text', textProxy, previousPosition, position, textLength);\n }\n // `node` is not set, we reached the beginning of current `parent`.\n position = Position._createBefore(parent);\n this._position = position;\n return this._formatReturnValue('elementStart', parent, previousPosition, position, 1);\n }\n /**\n * Format returned data and adjust `previousPosition` and `nextPosition` if reach the bound of the {@link module:engine/view/text~Text}.\n *\n * @param type Type of step.\n * @param item Item between old and new position.\n * @param previousPosition Previous position of iterator.\n * @param nextPosition Next position of iterator.\n * @param length Length of the item.\n */\n _formatReturnValue(type, item, previousPosition, nextPosition, length) {\n // Text is a specific parent, because contains string instead of children.\n // Walker doesn't enter to the Text except situations when walker is iterating over every single character,\n // or the bound starts/ends inside the Text. So when the position is at the beginning or at the end of the Text\n // we move it just before or just after Text.\n if (item instanceof TextProxy) {\n // Position is at the end of Text.\n if (item.offsetInText + item.data.length == item.textNode.data.length) {\n if (this.direction == 'forward' && !(this.boundaries && this.boundaries.end.isEqual(this.position))) {\n nextPosition = Position._createAfter(item.textNode);\n // When we change nextPosition of returned value we need also update walker current position.\n this._position = nextPosition;\n }\n else {\n previousPosition = Position._createAfter(item.textNode);\n }\n }\n // Position is at the begining ot the text.\n if (item.offsetInText === 0) {\n if (this.direction == 'backward' && !(this.boundaries && this.boundaries.start.isEqual(this.position))) {\n nextPosition = Position._createBefore(item.textNode);\n // When we change nextPosition of returned value we need also update walker current position.\n this._position = nextPosition;\n }\n else {\n previousPosition = Position._createBefore(item.textNode);\n }\n }\n }\n return {\n done: false,\n value: {\n type,\n item,\n previousPosition,\n nextPosition,\n length\n }\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/position\n */\nimport TypeCheckable from './typecheckable.js';\nimport { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';\nimport EditableElement from './editableelement.js';\nimport { default as TreeWalker } from './treewalker.js';\n/**\n * Position in the view tree. Position is represented by its parent node and an offset in this parent.\n *\n * In order to create a new position instance use the `createPosition*()` factory methods available in:\n *\n * * {@link module:engine/view/view~View}\n * * {@link module:engine/view/downcastwriter~DowncastWriter}\n * * {@link module:engine/view/upcastwriter~UpcastWriter}\n */\nexport default class Position extends TypeCheckable {\n /**\n * Creates a position.\n *\n * @param parent Position parent.\n * @param offset Position offset.\n */\n constructor(parent, offset) {\n super();\n this.parent = parent;\n this.offset = offset;\n }\n /**\n * Node directly after the position. Equals `null` when there is no node after position or position is located\n * inside text node.\n */\n get nodeAfter() {\n if (this.parent.is('$text')) {\n return null;\n }\n return this.parent.getChild(this.offset) || null;\n }\n /**\n * Node directly before the position. Equals `null` when there is no node before position or position is located\n * inside text node.\n */\n get nodeBefore() {\n if (this.parent.is('$text')) {\n return null;\n }\n return this.parent.getChild(this.offset - 1) || null;\n }\n /**\n * Is `true` if position is at the beginning of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.\n */\n get isAtStart() {\n return this.offset === 0;\n }\n /**\n * Is `true` if position is at the end of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.\n */\n get isAtEnd() {\n const endOffset = this.parent.is('$text') ? this.parent.data.length : this.parent.childCount;\n return this.offset === endOffset;\n }\n /**\n * Position's root, that is the root of the position's parent element.\n */\n get root() {\n return this.parent.root;\n }\n /**\n * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this position, or `null` if\n * position is not inside an editable element.\n */\n get editableElement() {\n let editable = this.parent;\n while (!(editable instanceof EditableElement)) {\n if (editable.parent) {\n editable = editable.parent;\n }\n else {\n return null;\n }\n }\n return editable;\n }\n /**\n * Returns a new instance of Position with offset incremented by `shift` value.\n *\n * @param shift How position offset should get changed. Accepts negative values.\n * @returns Shifted position.\n */\n getShiftedBy(shift) {\n const shifted = Position._createAt(this);\n const offset = shifted.offset + shift;\n shifted.offset = offset < 0 ? 0 : offset;\n return shifted;\n }\n /**\n * Gets the farthest position which matches the callback using\n * {@link module:engine/view/treewalker~TreeWalker TreeWalker}.\n *\n * For example:\n *\n * ```ts\n * getLastMatchingPosition( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>\n * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } ); // <p>foo[]</p> -> <p>{}foo</p>\n * getLastMatchingPosition( value => false ); // Do not move the position.\n * ```\n *\n * @param skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n * @returns The position after the last item which matches the `skip` callback test.\n */\n getLastMatchingPosition(skip, options = {}) {\n options.startPosition = this;\n const treeWalker = new TreeWalker(options);\n treeWalker.skip(skip);\n return treeWalker.position;\n }\n /**\n * Returns ancestors array of this position, that is this position's parent and it's ancestors.\n *\n * @returns Array with ancestors.\n */\n getAncestors() {\n if (this.parent.is('documentFragment')) {\n return [this.parent];\n }\n else {\n return this.parent.getAncestors({ includeSelf: true });\n }\n }\n /**\n * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}\n * which is a common ancestor of both positions.\n */\n getCommonAncestor(position) {\n const ancestorsA = this.getAncestors();\n const ancestorsB = position.getAncestors();\n let i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n /**\n * Checks whether this position equals given position.\n *\n * @param otherPosition Position to compare with.\n * @returns True if positions are same.\n */\n isEqual(otherPosition) {\n return (this.parent == otherPosition.parent && this.offset == otherPosition.offset);\n }\n /**\n * Checks whether this position is located before given position. When method returns `false` it does not mean that\n * this position is after give one. Two positions may be located inside separate roots and in that situation this\n * method will still return `false`.\n *\n * @see module:engine/view/position~Position#isAfter\n * @see module:engine/view/position~Position#compareWith\n * @param otherPosition Position to compare with.\n * @returns Returns `true` if this position is before given position.\n */\n isBefore(otherPosition) {\n return this.compareWith(otherPosition) == 'before';\n }\n /**\n * Checks whether this position is located after given position. When method returns `false` it does not mean that\n * this position is before give one. Two positions may be located inside separate roots and in that situation this\n * method will still return `false`.\n *\n * @see module:engine/view/position~Position#isBefore\n * @see module:engine/view/position~Position#compareWith\n * @param otherPosition Position to compare with.\n * @returns Returns `true` if this position is after given position.\n */\n isAfter(otherPosition) {\n return this.compareWith(otherPosition) == 'after';\n }\n /**\n * Checks whether this position is before, after or in same position that other position. Two positions may be also\n * different when they are located in separate roots.\n *\n * @param otherPosition Position to compare with.\n */\n compareWith(otherPosition) {\n if (this.root !== otherPosition.root) {\n return 'different';\n }\n if (this.isEqual(otherPosition)) {\n return 'same';\n }\n // Get path from root to position's parent element.\n const thisPath = this.parent.is('node') ? this.parent.getPath() : [];\n const otherPath = otherPosition.parent.is('node') ? otherPosition.parent.getPath() : [];\n // Add the positions' offsets to the parents offsets.\n thisPath.push(this.offset);\n otherPath.push(otherPosition.offset);\n // Compare both path arrays to find common ancestor.\n const result = compareArrays(thisPath, otherPath);\n switch (result) {\n case 'prefix':\n return 'before';\n case 'extension':\n return 'after';\n default:\n // Cast to number to avoid having 'same' as a type of `result`.\n return thisPath[result] < otherPath[result] ? 'before' : 'after';\n }\n }\n /**\n * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this positions as a start position.\n *\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}\n */\n getWalker(options = {}) {\n options.startPosition = this;\n return new TreeWalker(options);\n }\n /**\n * Clones this position.\n */\n clone() {\n return new Position(this.parent, this.offset);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link module:engine/view/position~Position._createBefore},\n * * {@link module:engine/view/position~Position._createAfter}.\n *\n * @internal\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n static _createAt(itemOrPosition, offset) {\n if (itemOrPosition instanceof Position) {\n return new this(itemOrPosition.parent, itemOrPosition.offset);\n }\n else {\n const node = itemOrPosition;\n if (offset == 'end') {\n offset = node.is('$text') ? node.data.length : node.childCount;\n }\n else if (offset == 'before') {\n return this._createBefore(node);\n }\n else if (offset == 'after') {\n return this._createAfter(node);\n }\n else if (offset !== 0 && !offset) {\n /**\n * {@link module:engine/view/view~View#createPositionAt `View#createPositionAt()`}\n * requires the offset to be specified when the first parameter is a view item.\n *\n * @error view-createpositionat-offset-required\n */\n throw new CKEditorError('view-createpositionat-offset-required', node);\n }\n return new Position(node, offset);\n }\n }\n /**\n * Creates a new position after given view item.\n *\n * @internal\n * @param item View item after which the position should be located.\n */\n static _createAfter(item) {\n // TextProxy is not a instance of Node so we need do handle it in specific way.\n if (item.is('$textProxy')) {\n return new Position(item.textNode, item.offsetInText + item.data.length);\n }\n if (!item.parent) {\n /**\n * You can not make a position after a root.\n *\n * @error view-position-after-root\n * @param {module:engine/view/node~Node} root\n */\n throw new CKEditorError('view-position-after-root', item, { root: item });\n }\n return new Position(item.parent, item.index + 1);\n }\n /**\n * Creates a new position before given view item.\n *\n * @internal\n * @param item View item before which the position should be located.\n */\n static _createBefore(item) {\n // TextProxy is not a instance of Node so we need do handle it in specific way.\n if (item.is('$textProxy')) {\n return new Position(item.textNode, item.offsetInText);\n }\n if (!item.parent) {\n /**\n * You cannot make a position before a root.\n *\n * @error view-position-before-root\n * @param {module:engine/view/node~Node} root\n */\n throw new CKEditorError('view-position-before-root', item, { root: item });\n }\n return new Position(item.parent, item.index);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nPosition.prototype.is = function (type) {\n return type === 'position' || type === 'view:position';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/range\n */\nimport TypeCheckable from './typecheckable.js';\nimport Position from './position.js';\nimport { default as TreeWalker } from './treewalker.js';\n/**\n * Range in the view tree. A range is represented by its start and end {@link module:engine/view/position~Position positions}.\n *\n * In order to create a new position instance use the `createPosition*()` factory methods available in:\n *\n * * {@link module:engine/view/view~View}\n * * {@link module:engine/view/downcastwriter~DowncastWriter}\n * * {@link module:engine/view/upcastwriter~UpcastWriter}\n */\nexport default class Range extends TypeCheckable {\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * **Note:** Constructor creates it's own {@link module:engine/view/position~Position} instances basing on passed values.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at the `start` position.\n */\n constructor(start, end = null) {\n super();\n this.start = start.clone();\n this.end = end ? end.clone() : start.clone();\n }\n /**\n * Iterable interface.\n *\n * Iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns\n * them together with additional information like length or {@link module:engine/view/position~Position positions},\n * grouped as {@link module:engine/view/treewalker~TreeWalkerValue}.\n *\n * This iterator uses {@link module:engine/view/treewalker~TreeWalker TreeWalker} with `boundaries` set to this range and\n * `ignoreElementEnd` option\n * set to `true`.\n */\n *[Symbol.iterator]() {\n yield* new TreeWalker({ boundaries: this, ignoreElementEnd: true });\n }\n /**\n * Returns whether the range is collapsed, that is it start and end positions are equal.\n */\n get isCollapsed() {\n return this.start.isEqual(this.end);\n }\n /**\n * Returns whether this range is flat, that is if {@link module:engine/view/range~Range#start start} position and\n * {@link module:engine/view/range~Range#end end} position are in the same {@link module:engine/view/position~Position#parent parent}.\n */\n get isFlat() {\n return this.start.parent === this.end.parent;\n }\n /**\n * Range root element.\n */\n get root() {\n return this.start.root;\n }\n /**\n * Creates a maximal range that has the same content as this range but is expanded in both ways (at the beginning\n * and at the end).\n *\n * For example:\n *\n * ```html\n * <p>Foo</p><p><b>{Bar}</b></p> -> <p>Foo</p>[<p><b>Bar</b>]</p>\n * <p><b>foo</b>{bar}<span></span></p> -> <p><b>foo[</b>bar<span></span>]</p>\n * ```\n *\n * Note that in the sample above:\n *\n * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},\n * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},\n * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.\n *\n * @returns Enlarged range.\n */\n getEnlarged() {\n let start = this.start.getLastMatchingPosition(enlargeTrimSkip, { direction: 'backward' });\n let end = this.end.getLastMatchingPosition(enlargeTrimSkip);\n // Fix positions, in case if they are in Text node.\n if (start.parent.is('$text') && start.isAtStart) {\n start = Position._createBefore(start.parent);\n }\n if (end.parent.is('$text') && end.isAtEnd) {\n end = Position._createAfter(end.parent);\n }\n return new Range(start, end);\n }\n /**\n * Creates a minimum range that has the same content as this range but is trimmed in both ways (at the beginning\n * and at the end).\n *\n * For example:\n *\n * ```html\n * <p>Foo</p>[<p><b>Bar</b>]</p> -> <p>Foo</p><p><b>{Bar}</b></p>\n * <p><b>foo[</b>bar<span></span>]</p> -> <p><b>foo</b>{bar}<span></span></p>\n * ```\n *\n * Note that in the sample above:\n *\n * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},\n * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},\n * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.\n *\n * @returns Shrunk range.\n */\n getTrimmed() {\n let start = this.start.getLastMatchingPosition(enlargeTrimSkip);\n if (start.isAfter(this.end) || start.isEqual(this.end)) {\n return new Range(start, start);\n }\n let end = this.end.getLastMatchingPosition(enlargeTrimSkip, { direction: 'backward' });\n const nodeAfterStart = start.nodeAfter;\n const nodeBeforeEnd = end.nodeBefore;\n // Because TreeWalker prefers positions next to text node, we need to move them manually into these text nodes.\n if (nodeAfterStart && nodeAfterStart.is('$text')) {\n start = new Position(nodeAfterStart, 0);\n }\n if (nodeBeforeEnd && nodeBeforeEnd.is('$text')) {\n end = new Position(nodeBeforeEnd, nodeBeforeEnd.data.length);\n }\n return new Range(start, end);\n }\n /**\n * Two ranges are equal if their start and end positions are equal.\n *\n * @param otherRange Range to compare with.\n * @returns `true` if ranges are equal, `false` otherwise\n */\n isEqual(otherRange) {\n return this == otherRange || (this.start.isEqual(otherRange.start) && this.end.isEqual(otherRange.end));\n }\n /**\n * Checks whether this range contains given {@link module:engine/view/position~Position position}.\n *\n * @param position Position to check.\n * @returns `true` if given {@link module:engine/view/position~Position position} is contained in this range, `false` otherwise.\n */\n containsPosition(position) {\n return position.isAfter(this.start) && position.isBefore(this.end);\n }\n /**\n * Checks whether this range contains given {@link module:engine/view/range~Range range}.\n *\n * @param otherRange Range to check.\n * @param loose Whether the check is loose or strict. If the check is strict (`false`), compared range cannot\n * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or\n * even be equal to this range. Note that collapsed ranges are always compared in strict mode.\n * @returns `true` if given {@link module:engine/view/range~Range range} boundaries are contained by this range, `false`\n * otherwise.\n */\n containsRange(otherRange, loose = false) {\n if (otherRange.isCollapsed) {\n loose = false;\n }\n const containsStart = this.containsPosition(otherRange.start) || (loose && this.start.isEqual(otherRange.start));\n const containsEnd = this.containsPosition(otherRange.end) || (loose && this.end.isEqual(otherRange.end));\n return containsStart && containsEnd;\n }\n /**\n * Computes which part(s) of this {@link module:engine/view/range~Range range} is not a part of given\n * {@link module:engine/view/range~Range range}.\n * Returned array contains zero, one or two {@link module:engine/view/range~Range ranges}.\n *\n * Examples:\n *\n * ```ts\n * let foo = downcastWriter.createText( 'foo' );\n * let img = downcastWriter.createContainerElement( 'img' );\n * let bar = downcastWriter.createText( 'bar' );\n * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );\n *\n * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // \"o\", img, \"b\" are in range.\n * let otherRange = view.createRange( // \"oo\", img, \"ba\" are in range.\n * \tview.createPositionAt( foo, 1 ),\n * \tview.createPositionAt( bar, 2 )\n * );\n * let transformed = range.getDifference( otherRange );\n * // transformed array has no ranges because `otherRange` contains `range`\n *\n * otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // \"oo\", img are in range.\n * transformed = range.getDifference( otherRange );\n * // transformed array has one range: from ( p, 2 ) to ( bar, 1 )\n *\n * otherRange = view.createRange( view.createPositionAt( p, 1 ), view.createPositionAt( p, 2 ) ); // img is in range.\n * transformed = range.getDifference( otherRange );\n * // transformed array has two ranges: from ( foo, 1 ) to ( p, 1 ) and from ( p, 2 ) to ( bar, 1 )\n * ```\n *\n * @param otherRange Range to differentiate against.\n * @returns The difference between ranges.\n */\n getDifference(otherRange) {\n const ranges = [];\n if (this.isIntersecting(otherRange)) {\n // Ranges intersect.\n if (this.containsPosition(otherRange.start)) {\n // Given range start is inside this range. This means that we have to\n // add shrunken range - from the start to the middle of this range.\n ranges.push(new Range(this.start, otherRange.start));\n }\n if (this.containsPosition(otherRange.end)) {\n // Given range end is inside this range. This means that we have to\n // add shrunken range - from the middle of this range to the end.\n ranges.push(new Range(otherRange.end, this.end));\n }\n }\n else {\n // Ranges do not intersect, return the original range.\n ranges.push(this.clone());\n }\n return ranges;\n }\n /**\n * Returns an intersection of this {@link module:engine/view/range~Range range} and given {@link module:engine/view/range~Range range}.\n * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.\n *\n * Examples:\n *\n * ```ts\n * let foo = downcastWriter.createText( 'foo' );\n * let img = downcastWriter.createContainerElement( 'img' );\n * let bar = downcastWriter.createText( 'bar' );\n * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );\n *\n * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // \"o\", img, \"b\" are in range.\n * let otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // \"oo\", img are in range.\n * let transformed = range.getIntersection( otherRange ); // range from ( foo, 1 ) to ( p, 2 ).\n *\n * otherRange = view.createRange( view.createPositionAt( bar, 1 ), view.createPositionAt( bar, 3 ); \"ar\" is in range.\n * transformed = range.getIntersection( otherRange ); // null - no common part.\n * ```\n *\n * @param otherRange Range to check for intersection.\n * @returns A common part of given ranges or `null` if ranges have no common part.\n */\n getIntersection(otherRange) {\n if (this.isIntersecting(otherRange)) {\n // Ranges intersect, so a common range will be returned.\n // At most, it will be same as this range.\n let commonRangeStart = this.start;\n let commonRangeEnd = this.end;\n if (this.containsPosition(otherRange.start)) {\n // Given range start is inside this range. This means thaNt we have to\n // shrink common range to the given range start.\n commonRangeStart = otherRange.start;\n }\n if (this.containsPosition(otherRange.end)) {\n // Given range end is inside this range. This means that we have to\n // shrink common range to the given range end.\n commonRangeEnd = otherRange.end;\n }\n return new Range(commonRangeStart, commonRangeEnd);\n }\n // Ranges do not intersect, so they do not have common part.\n return null;\n }\n /**\n * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.\n *\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n */\n getWalker(options = {}) {\n options.boundaries = this;\n return new TreeWalker(options);\n }\n /**\n * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}\n * which is a common ancestor of range's both ends (in which the entire range is contained).\n */\n getCommonAncestor() {\n return this.start.getCommonAncestor(this.end);\n }\n /**\n * Returns an {@link module:engine/view/element~Element Element} contained by the range.\n * The element will be returned when it is the **only** node within the range and **fully–contained**\n * at the same time.\n */\n getContainedElement() {\n if (this.isCollapsed) {\n return null;\n }\n let nodeAfterStart = this.start.nodeAfter;\n let nodeBeforeEnd = this.end.nodeBefore;\n // Handle the situation when the range position is at the beginning / at the end of a text node.\n // In such situation `.nodeAfter` and `.nodeBefore` are `null` but the range still might be spanning\n // over one element.\n //\n // <p>Foo{<span class=\"widget\"></span>}bar</p> vs <p>Foo[<span class=\"widget\"></span>]bar</p>\n //\n // These are basically the same range, only the difference is if the range position is at\n // at the end/at the beginning of a text node or just before/just after the text node.\n //\n if (this.start.parent.is('$text') && this.start.isAtEnd && this.start.parent.nextSibling) {\n nodeAfterStart = this.start.parent.nextSibling;\n }\n if (this.end.parent.is('$text') && this.end.isAtStart && this.end.parent.previousSibling) {\n nodeBeforeEnd = this.end.parent.previousSibling;\n }\n if (nodeAfterStart && nodeAfterStart.is('element') && nodeAfterStart === nodeBeforeEnd) {\n return nodeAfterStart;\n }\n return null;\n }\n /**\n * Clones this range.\n */\n clone() {\n return new Range(this.start, this.end);\n }\n /**\n * Returns an iterator that iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns\n * them.\n *\n * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option\n * set to `true`. However it returns only {@link module:engine/view/item~Item items},\n * not {@link module:engine/view/treewalker~TreeWalkerValue}.\n *\n * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for\n * a full list of available options.\n *\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n */\n *getItems(options = {}) {\n options.boundaries = this;\n options.ignoreElementEnd = true;\n const treeWalker = new TreeWalker(options);\n for (const value of treeWalker) {\n yield value.item;\n }\n }\n /**\n * Returns an iterator that iterates over all {@link module:engine/view/position~Position positions} that are boundaries or\n * contained in this range.\n *\n * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only\n * {@link module:engine/view/position~Position positions}, not {@link module:engine/view/treewalker~TreeWalkerValue}.\n *\n * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for\n * a full list of available options.\n *\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n */\n *getPositions(options = {}) {\n options.boundaries = this;\n const treeWalker = new TreeWalker(options);\n yield treeWalker.position;\n for (const value of treeWalker) {\n yield value.nextPosition;\n }\n }\n /**\n * Checks and returns whether this range intersects with the given range.\n *\n * @param otherRange Range to compare with.\n * @returns True if ranges intersect.\n */\n isIntersecting(otherRange) {\n return this.start.isBefore(otherRange.end) && this.end.isAfter(otherRange.start);\n }\n /**\n * Creates a range from the given parents and offsets.\n *\n * @internal\n * @param startElement Start position parent element.\n * @param startOffset Start position offset.\n * @param endElement End position parent element.\n * @param endOffset End position offset.\n * @returns Created range.\n */\n static _createFromParentsAndOffsets(startElement, startOffset, endElement, endOffset) {\n return new this(new Position(startElement, startOffset), new Position(endElement, endOffset));\n }\n /**\n * Creates a new range, spreading from specified {@link module:engine/view/position~Position position} to a position moved by\n * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.\n *\n * @internal\n * @param position Beginning of the range.\n * @param shift How long the range should be.\n */\n static _createFromPositionAndShift(position, shift) {\n const start = position;\n const end = position.getShiftedBy(shift);\n return shift > 0 ? new this(start, end) : new this(end, start);\n }\n /**\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @internal\n * @param element Element which is a parent for the range.\n */\n static _createIn(element) {\n return this._createFromParentsAndOffsets(element, 0, element, element.childCount);\n }\n /**\n * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n *\n * @internal\n */\n static _createOn(item) {\n const size = item.is('$textProxy') ? item.offsetSize : 1;\n return this._createFromPositionAndShift(Position._createBefore(item), size);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRange.prototype.is = function (type) {\n return type === 'range' || type === 'view:range';\n};\n/**\n * Function used by getEnlarged and getTrimmed methods.\n */\nfunction enlargeTrimSkip(value) {\n if (value.item.is('attributeElement') || value.item.is('uiElement')) {\n return true;\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/selection\n */\nimport TypeCheckable from './typecheckable.js';\nimport Range from './range.js';\nimport Position from './position.js';\nimport Node from './node.js';\nimport DocumentSelection from './documentselection.js';\nimport { CKEditorError, EmitterMixin, count, isIterable } from '@ckeditor/ckeditor5-utils';\n/**\n * Class representing an arbirtary selection in the view.\n * See also {@link module:engine/view/documentselection~DocumentSelection}.\n *\n * New selection instances can be created via the constructor or one these methods:\n *\n * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},\n * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.\n *\n * A selection can consist of {@link module:engine/view/range~Range ranges} that can be set by using\n * the {@link module:engine/view/selection~Selection#setTo `Selection#setTo()`} method.\n */\nexport default class Selection extends /* #__PURE__ */ EmitterMixin(TypeCheckable) {\n /**\n * Creates new selection instance.\n *\n * **Note**: The selection constructor is available as a factory method:\n *\n * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},\n * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.\n *\n * ```ts\n * // Creates empty selection without ranges.\n * const selection = writer.createSelection();\n *\n * // Creates selection at the given range.\n * const range = writer.createRange( start, end );\n * const selection = writer.createSelection( range );\n *\n * // Creates selection at the given ranges\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n * const selection = writer.createSelection( ranges );\n *\n * // Creates selection from the other selection.\n * const otherSelection = writer.createSelection();\n * const selection = writer.createSelection( otherSelection );\n *\n * // Creates selection from the document selection.\n * const selection = writer.createSelection( editor.editing.view.document.selection );\n *\n * // Creates selection at the given position.\n * const position = writer.createPositionFromPath( root, path );\n * const selection = writer.createSelection( position );\n *\n * // Creates collapsed selection at the position of given item and offset.\n * const paragraph = writer.createContainerElement( 'paragraph' );\n * const selection = writer.createSelection( paragraph, offset );\n *\n * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the\n * // first child of that element and ends after the last child of that element.\n * const selection = writer.createSelection( paragraph, 'in' );\n *\n * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends\n * // just after the item.\n * const selection = writer.createSelection( paragraph, 'on' );\n * ```\n *\n * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.\n *\n * ```ts\n * // Creates backward selection.\n * const selection = writer.createSelection( range, { backward: true } );\n * ```\n *\n * Fake selection does not render as browser native selection over selected elements and is hidden to the user.\n * This way, no native selection UI artifacts are displayed to the user and selection over elements can be\n * represented in other way, for example by applying proper CSS class.\n *\n * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM\n * (and be properly handled by screen readers).\n *\n * ```ts\n * // Creates fake selection with label.\n * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );\n * ```\n *\n * @internal\n */\n constructor(...args) {\n super();\n this._ranges = [];\n this._lastRangeBackward = false;\n this._isFake = false;\n this._fakeSelectionLabel = '';\n if (args.length) {\n this.setTo(...args);\n }\n }\n /**\n * Returns true if selection instance is marked as `fake`.\n *\n * @see #setTo\n */\n get isFake() {\n return this._isFake;\n }\n /**\n * Returns fake selection label.\n *\n * @see #setTo\n */\n get fakeSelectionLabel() {\n return this._fakeSelectionLabel;\n }\n /**\n * Selection anchor. Anchor may be described as a position where the selection starts. Together with\n * {@link #focus focus} they define the direction of selection, which is important\n * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.\n * It may be a bit unintuitive when there are multiple ranges in selection.\n *\n * @see #focus\n */\n get anchor() {\n if (!this._ranges.length) {\n return null;\n }\n const range = this._ranges[this._ranges.length - 1];\n const anchor = this._lastRangeBackward ? range.end : range.start;\n return anchor.clone();\n }\n /**\n * Selection focus. Focus is a position where the selection ends.\n *\n * @see #anchor\n */\n get focus() {\n if (!this._ranges.length) {\n return null;\n }\n const range = this._ranges[this._ranges.length - 1];\n const focus = this._lastRangeBackward ? range.start : range.end;\n return focus.clone();\n }\n /**\n * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n * collapsed.\n */\n get isCollapsed() {\n return this.rangeCount === 1 && this._ranges[0].isCollapsed;\n }\n /**\n * Returns number of ranges in selection.\n */\n get rangeCount() {\n return this._ranges.length;\n }\n /**\n * Specifies whether the {@link #focus} precedes {@link #anchor}.\n */\n get isBackward() {\n return !this.isCollapsed && this._lastRangeBackward;\n }\n /**\n * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`\n * if the selection is not inside an editable element.\n */\n get editableElement() {\n if (this.anchor) {\n return this.anchor.editableElement;\n }\n return null;\n }\n /**\n * Returns an iterable that contains copies of all ranges added to the selection.\n */\n *getRanges() {\n for (const range of this._ranges) {\n yield range.clone();\n }\n }\n /**\n * Returns copy of the first range in the selection. First range is the one which\n * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start\n * position of all other ranges (not to confuse with the first range added to the selection).\n * Returns `null` if no ranges are added to selection.\n */\n getFirstRange() {\n let first = null;\n for (const range of this._ranges) {\n if (!first || range.start.isBefore(first.start)) {\n first = range;\n }\n }\n return first ? first.clone() : null;\n }\n /**\n * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}\n * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse\n * with the last range added to the selection). Returns `null` if no ranges are added to selection.\n */\n getLastRange() {\n let last = null;\n for (const range of this._ranges) {\n if (!last || range.end.isAfter(last.end)) {\n last = range;\n }\n }\n return last ? last.clone() : null;\n }\n /**\n * Returns copy of the first position in the selection. First position is the position that\n * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.\n * Returns `null` if no ranges are added to selection.\n */\n getFirstPosition() {\n const firstRange = this.getFirstRange();\n return firstRange ? firstRange.start.clone() : null;\n }\n /**\n * Returns copy of the last position in the selection. Last position is the position that\n * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.\n * Returns `null` if no ranges are added to selection.\n */\n getLastPosition() {\n const lastRange = this.getLastRange();\n return lastRange ? lastRange.end.clone() : null;\n }\n /**\n * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,\n * same number of ranges and all ranges from one selection equal to a range from other selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are equal, `false` otherwise.\n */\n isEqual(otherSelection) {\n if (this.isFake != otherSelection.isFake) {\n return false;\n }\n if (this.isFake && this.fakeSelectionLabel != otherSelection.fakeSelectionLabel) {\n return false;\n }\n if (this.rangeCount != otherSelection.rangeCount) {\n return false;\n }\n else if (this.rangeCount === 0) {\n return true;\n }\n if (!this.anchor.isEqual(otherSelection.anchor) || !this.focus.isEqual(otherSelection.focus)) {\n return false;\n }\n for (const thisRange of this._ranges) {\n let found = false;\n for (const otherRange of otherSelection._ranges) {\n if (thisRange.isEqual(otherRange)) {\n found = true;\n break;\n }\n }\n if (!found) {\n return false;\n }\n }\n return true;\n }\n /**\n * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same\n * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are\n * equal to any trimmed range from other selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are similar, `false` otherwise.\n */\n isSimilar(otherSelection) {\n if (this.isBackward != otherSelection.isBackward) {\n return false;\n }\n const numOfRangesA = count(this.getRanges());\n const numOfRangesB = count(otherSelection.getRanges());\n // If selections have different number of ranges, they cannot be similar.\n if (numOfRangesA != numOfRangesB) {\n return false;\n }\n // If both selections have no ranges, they are similar.\n if (numOfRangesA == 0) {\n return true;\n }\n // Check if each range in one selection has a similar range in other selection.\n for (let rangeA of this.getRanges()) {\n rangeA = rangeA.getTrimmed();\n let found = false;\n for (let rangeB of otherSelection.getRanges()) {\n rangeB = rangeB.getTrimmed();\n if (rangeA.start.isEqual(rangeB.start) && rangeA.end.isEqual(rangeB.end)) {\n found = true;\n break;\n }\n }\n // For `rangeA`, neither range in `otherSelection` was similar. So selections are not similar.\n if (!found) {\n return false;\n }\n }\n // There were no ranges that weren't matched. Selections are similar.\n return true;\n }\n /**\n * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only\n * one range in the selection, and that range contains exactly one element.\n * Returns `null` if there is no selected element.\n */\n getSelectedElement() {\n if (this.rangeCount !== 1) {\n return null;\n }\n return this.getFirstRange().getContainedElement();\n }\n /**\n * Sets this selection's ranges and direction to the specified location based on the given\n * {@link module:engine/view/selection~Selectable selectable}.\n *\n * ```ts\n * // Sets selection to the given range.\n * const range = writer.createRange( start, end );\n * selection.setTo( range );\n *\n * // Sets selection to given ranges.\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n * selection.setTo( range );\n *\n * // Sets selection to the other selection.\n * const otherSelection = writer.createSelection();\n * selection.setTo( otherSelection );\n *\n * // Sets selection to contents of DocumentSelection.\n * selection.setTo( editor.editing.view.document.selection );\n *\n * // Sets collapsed selection at the given position.\n * const position = writer.createPositionAt( root, path );\n * selection.setTo( position );\n *\n * // Sets collapsed selection at the position of given item and offset.\n * selection.setTo( paragraph, offset );\n * ```\n *\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * ```ts\n * selection.setTo( paragraph, 'in' );\n * ```\n *\n * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.\n *\n * ```ts\n * selection.setTo( paragraph, 'on' );\n *\n * // Clears selection. Removes all ranges.\n * selection.setTo( null );\n * ```\n *\n * `Selection#setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.\n *\n * ```ts\n * // Sets selection as backward.\n * selection.setTo( range, { backward: true } );\n * ```\n *\n * Fake selection does not render as browser native selection over selected elements and is hidden to the user.\n * This way, no native selection UI artifacts are displayed to the user and selection over elements can be\n * represented in other way, for example by applying proper CSS class.\n *\n * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM\n * (and be properly handled by screen readers).\n *\n * ```ts\n * // Creates fake selection with label.\n * selection.setTo( range, { fake: true, label: 'foo' } );\n * ```\n *\n * @fires change\n */\n setTo(...args) {\n let [selectable, placeOrOffset, options] = args;\n if (typeof placeOrOffset == 'object') {\n options = placeOrOffset;\n placeOrOffset = undefined;\n }\n if (selectable === null) {\n this._setRanges([]);\n this._setFakeOptions(options);\n }\n else if (selectable instanceof Selection || selectable instanceof DocumentSelection) {\n this._setRanges(selectable.getRanges(), selectable.isBackward);\n this._setFakeOptions({ fake: selectable.isFake, label: selectable.fakeSelectionLabel });\n }\n else if (selectable instanceof Range) {\n this._setRanges([selectable], options && options.backward);\n this._setFakeOptions(options);\n }\n else if (selectable instanceof Position) {\n this._setRanges([new Range(selectable)]);\n this._setFakeOptions(options);\n }\n else if (selectable instanceof Node) {\n const backward = !!options && !!options.backward;\n let range;\n if (placeOrOffset === undefined) {\n /**\n * selection.setTo requires the second parameter when the first parameter is a node.\n *\n * @error view-selection-setto-required-second-parameter\n */\n throw new CKEditorError('view-selection-setto-required-second-parameter', this);\n }\n else if (placeOrOffset == 'in') {\n range = Range._createIn(selectable);\n }\n else if (placeOrOffset == 'on') {\n range = Range._createOn(selectable);\n }\n else {\n range = new Range(Position._createAt(selectable, placeOrOffset));\n }\n this._setRanges([range], backward);\n this._setFakeOptions(options);\n }\n else if (isIterable(selectable)) {\n // We assume that the selectable is an iterable of ranges.\n // Array.from() is used to prevent setting ranges to the old iterable\n this._setRanges(selectable, options && options.backward);\n this._setFakeOptions(options);\n }\n else {\n /**\n * Cannot set selection to given place.\n *\n * @error view-selection-setto-not-selectable\n */\n throw new CKEditorError('view-selection-setto-not-selectable', this);\n }\n this.fire('change');\n }\n /**\n * Moves {@link #focus} to the specified location.\n *\n * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}\n * parameters.\n *\n * @fires change\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n setFocus(itemOrPosition, offset) {\n if (this.anchor === null) {\n /**\n * Cannot set selection focus if there are no ranges in selection.\n *\n * @error view-selection-setfocus-no-ranges\n */\n throw new CKEditorError('view-selection-setfocus-no-ranges', this);\n }\n const newFocus = Position._createAt(itemOrPosition, offset);\n if (newFocus.compareWith(this.focus) == 'same') {\n return;\n }\n const anchor = this.anchor;\n this._ranges.pop();\n if (newFocus.compareWith(anchor) == 'before') {\n this._addRange(new Range(newFocus, anchor), true);\n }\n else {\n this._addRange(new Range(anchor, newFocus));\n }\n this.fire('change');\n }\n /**\n * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array\n * is treated like the last added range and is used to set {@link #anchor anchor} and {@link #focus focus}.\n * Accepts a flag describing in which way the selection is made.\n *\n * @param newRanges Iterable object of ranges to set.\n * @param isLastBackward Flag describing if last added range was selected forward - from start to end\n * (`false`) or backward - from end to start (`true`). Defaults to `false`.\n */\n _setRanges(newRanges, isLastBackward = false) {\n // New ranges should be copied to prevent removing them by setting them to `[]` first.\n // Only applies to situations when selection is set to the same selection or same selection's ranges.\n newRanges = Array.from(newRanges);\n this._ranges = [];\n for (const range of newRanges) {\n this._addRange(range);\n }\n this._lastRangeBackward = !!isLastBackward;\n }\n /**\n * Sets this selection instance to be marked as `fake`. A fake selection does not render as browser native selection\n * over selected elements and is hidden to the user. This way, no native selection UI artifacts are displayed to\n * the user and selection over elements can be represented in other way, for example by applying proper CSS class.\n *\n * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM (and be\n * properly handled by screen readers).\n */\n _setFakeOptions(options = {}) {\n this._isFake = !!options.fake;\n this._fakeSelectionLabel = options.fake ? options.label || '' : '';\n }\n /**\n * Adds a range to the selection. Added range is copied. This means that passed range is not saved in the\n * selection instance and you can safely operate on it.\n *\n * Accepts a flag describing in which way the selection is made - passed range might be selected from\n * {@link module:engine/view/range~Range#start start} to {@link module:engine/view/range~Range#end end}\n * or from {@link module:engine/view/range~Range#end end} to {@link module:engine/view/range~Range#start start}.\n * The flag is used to set {@link #anchor anchor} and {@link #focus focus} properties.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects\n * with ranges already stored in Selection instance.\n */\n _addRange(range, isBackward = false) {\n if (!(range instanceof Range)) {\n /**\n * Selection range set to an object that is not an instance of {@link module:engine/view/range~Range}.\n *\n * @error view-selection-add-range-not-range\n */\n throw new CKEditorError('view-selection-add-range-not-range', this);\n }\n this._pushRange(range);\n this._lastRangeBackward = !!isBackward;\n }\n /**\n * Adds range to selection - creates copy of given range so it can be safely used and modified.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects\n * with ranges already stored in selection instance.\n */\n _pushRange(range) {\n for (const storedRange of this._ranges) {\n if (range.isIntersecting(storedRange)) {\n /**\n * Trying to add a range that intersects with another range from selection.\n *\n * @error view-selection-range-intersects\n * @param {module:engine/view/range~Range} addedRange Range that was added to the selection.\n * @param {module:engine/view/range~Range} intersectingRange Range from selection that intersects with `addedRange`.\n */\n throw new CKEditorError('view-selection-range-intersects', this, { addedRange: range, intersectingRange: storedRange });\n }\n }\n this._ranges.push(new Range(range.start, range.end));\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nSelection.prototype.is = function (type) {\n return type === 'selection' || type === 'view:selection';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/documentselection\n */\nimport TypeCheckable from './typecheckable.js';\nimport Selection from './selection.js';\nimport { EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Class representing the document selection in the view.\n *\n * Its instance is available in {@link module:engine/view/document~Document#selection `Document#selection`}.\n *\n * It is similar to {@link module:engine/view/selection~Selection} but\n * it has a read-only API and can be modified only by the writer available in\n * the {@link module:engine/view/view~View#change `View#change()`} block\n * (so via {@link module:engine/view/downcastwriter~DowncastWriter#setSelection `DowncastWriter#setSelection()`}).\n */\nexport default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(TypeCheckable) {\n constructor(...args) {\n super();\n this._selection = new Selection();\n // Delegate change event to be fired on DocumentSelection instance.\n this._selection.delegate('change').to(this);\n // Set selection data.\n if (args.length) {\n this._selection.setTo(...args);\n }\n }\n /**\n * Returns true if selection instance is marked as `fake`.\n *\n * @see #_setTo\n */\n get isFake() {\n return this._selection.isFake;\n }\n /**\n * Returns fake selection label.\n *\n * @see #_setTo\n */\n get fakeSelectionLabel() {\n return this._selection.fakeSelectionLabel;\n }\n /**\n * Selection anchor. Anchor may be described as a position where the selection starts. Together with\n * {@link #focus focus} they define the direction of selection, which is important\n * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.\n * It may be a bit unintuitive when there are multiple ranges in selection.\n *\n * @see #focus\n */\n get anchor() {\n return this._selection.anchor;\n }\n /**\n * Selection focus. Focus is a position where the selection ends.\n *\n * @see #anchor\n */\n get focus() {\n return this._selection.focus;\n }\n /**\n * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n * collapsed.\n */\n get isCollapsed() {\n return this._selection.isCollapsed;\n }\n /**\n * Returns number of ranges in selection.\n */\n get rangeCount() {\n return this._selection.rangeCount;\n }\n /**\n * Specifies whether the {@link #focus} precedes {@link #anchor}.\n */\n get isBackward() {\n return this._selection.isBackward;\n }\n /**\n * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`\n * if the selection is not inside an editable element.\n */\n get editableElement() {\n return this._selection.editableElement;\n }\n /**\n * Used for the compatibility with the {@link module:engine/view/selection~Selection#isEqual} method.\n *\n * @internal\n */\n get _ranges() {\n return this._selection._ranges;\n }\n /**\n * Returns an iterable that contains copies of all ranges added to the selection.\n */\n *getRanges() {\n yield* this._selection.getRanges();\n }\n /**\n * Returns copy of the first range in the selection. First range is the one which\n * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start\n * position of all other ranges (not to confuse with the first range added to the selection).\n * Returns `null` if no ranges are added to selection.\n */\n getFirstRange() {\n return this._selection.getFirstRange();\n }\n /**\n * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}\n * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse\n * with the last range added to the selection). Returns `null` if no ranges are added to selection.\n */\n getLastRange() {\n return this._selection.getLastRange();\n }\n /**\n * Returns copy of the first position in the selection. First position is the position that\n * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.\n * Returns `null` if no ranges are added to selection.\n */\n getFirstPosition() {\n return this._selection.getFirstPosition();\n }\n /**\n * Returns copy of the last position in the selection. Last position is the position that\n * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.\n * Returns `null` if no ranges are added to selection.\n */\n getLastPosition() {\n return this._selection.getLastPosition();\n }\n /**\n * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only\n * one range in the selection, and that range contains exactly one element.\n * Returns `null` if there is no selected element.\n */\n getSelectedElement() {\n return this._selection.getSelectedElement();\n }\n /**\n * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,\n * same number of ranges and all ranges from one selection equal to a range from other selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are equal, `false` otherwise.\n */\n isEqual(otherSelection) {\n return this._selection.isEqual(otherSelection);\n }\n /**\n * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same\n * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are\n * equal to any trimmed range from other selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are similar, `false` otherwise.\n */\n isSimilar(otherSelection) {\n return this._selection.isSimilar(otherSelection);\n }\n /**\n * Sets this selection's ranges and direction to the specified location based on the given\n * {@link module:engine/view/selection~Selectable selectable}.\n *\n * ```ts\n * // Sets selection to the given range.\n * const range = writer.createRange( start, end );\n * documentSelection._setTo( range );\n *\n * // Sets selection to given ranges.\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];\n * documentSelection._setTo( range );\n *\n * // Sets selection to the other selection.\n * const otherSelection = writer.createSelection();\n * documentSelection._setTo( otherSelection );\n *\n * // Sets collapsed selection at the given position.\n * const position = writer.createPositionAt( root, offset );\n * documentSelection._setTo( position );\n *\n * // Sets collapsed selection at the position of given item and offset.\n * documentSelection._setTo( paragraph, offset );\n * ```\n *\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * ```ts\n * documentSelection._setTo( paragraph, 'in' );\n * ```\n *\n * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.\n *\n * ```ts\n * documentSelection._setTo( paragraph, 'on' );\n *\n * // Clears selection. Removes all ranges.\n * documentSelection._setTo( null );\n * ```\n *\n * `Selection#_setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.\n *\n * ```ts\n * // Sets selection as backward.\n * documentSelection._setTo( range, { backward: true } );\n * ```\n *\n * Fake selection does not render as browser native selection over selected elements and is hidden to the user.\n * This way, no native selection UI artifacts are displayed to the user and selection over elements can be\n * represented in other way, for example by applying proper CSS class.\n *\n * Additionally fake's selection label can be provided. It will be used to des cribe fake selection in DOM\n * (and be properly handled by screen readers).\n *\n * ```ts\n * // Creates fake selection with label.\n * documentSelection._setTo( range, { fake: true, label: 'foo' } );\n * ```\n *\n * @internal\n * @fires change\n */\n _setTo(...args) {\n this._selection.setTo(...args);\n }\n /**\n * Moves {@link #focus} to the specified location.\n *\n * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}\n * parameters.\n *\n * @internal\n * @fires change\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n _setFocus(itemOrPosition, offset) {\n this._selection.setFocus(itemOrPosition, offset);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nDocumentSelection.prototype.is = function (type) {\n return type === 'selection' ||\n type == 'documentSelection' ||\n type == 'view:selection' ||\n type == 'view:documentSelection';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/bubblingeventinfo\n */\nimport { EventInfo } from '@ckeditor/ckeditor5-utils';\n/**\n * The event object passed to bubbling event callbacks. It is used to provide information about the event as well as a tool to\n * manipulate it.\n */\nexport default class BubblingEventInfo extends EventInfo {\n /**\n * @param source The emitter.\n * @param name The event name.\n * @param startRange The view range that the bubbling should start from.\n */\n constructor(source, name, startRange) {\n super(source, name);\n this.startRange = startRange;\n this._eventPhase = 'none';\n this._currentTarget = null;\n }\n /**\n * The current event phase.\n */\n get eventPhase() {\n return this._eventPhase;\n }\n /**\n * The current bubbling target.\n */\n get currentTarget() {\n return this._currentTarget;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/bubblingemittermixin\n */\nimport { CKEditorError, EmitterMixin, EventInfo, toArray } from '@ckeditor/ckeditor5-utils';\nimport BubblingEventInfo from './bubblingeventinfo.js';\nconst contextsSymbol = Symbol('bubbling contexts');\n/**\n * Bubbling emitter mixin for the view document as described in the {@link ~BubblingEmitter} interface.\n *\n * This function creates a class that inherits from the provided `base` and implements `Emitter` interface.\n * The base class must implement {@link module:utils/emittermixin~Emitter} interface.\n *\n * ```ts\n * class BaseClass extends EmitterMixin() {\n * \t// ...\n * }\n *\n * class MyClass extends BubblingEmitterMixin( BaseClass ) {\n * \t// This class derives from `BaseClass` and implements the `BubblingEmitter` interface.\n * }\n * ```\n */\nexport default function BubblingEmitterMixin(base) {\n class Mixin extends base {\n fire(eventOrInfo, ...eventArgs) {\n try {\n const eventInfo = eventOrInfo instanceof EventInfo ? eventOrInfo : new EventInfo(this, eventOrInfo);\n const eventContexts = getBubblingContexts(this);\n if (!eventContexts.size) {\n return;\n }\n updateEventInfo(eventInfo, 'capturing', this);\n // The capture phase of the event.\n if (fireListenerFor(eventContexts, '$capture', eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n const startRange = eventInfo.startRange || this.selection.getFirstRange();\n const selectedElement = startRange ? startRange.getContainedElement() : null;\n const isCustomContext = selectedElement ? Boolean(getCustomContext(eventContexts, selectedElement)) : false;\n let node = selectedElement || getDeeperRangeParent(startRange);\n updateEventInfo(eventInfo, 'atTarget', node);\n // For the not yet bubbling event trigger for $text node if selection can be there and it's not a custom context selected.\n if (!isCustomContext) {\n if (fireListenerFor(eventContexts, '$text', eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n updateEventInfo(eventInfo, 'bubbling', node);\n }\n while (node) {\n // Root node handling.\n if (node.is('rootElement')) {\n if (fireListenerFor(eventContexts, '$root', eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n }\n // Element node handling.\n else if (node.is('element')) {\n if (fireListenerFor(eventContexts, node.name, eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n }\n // Check custom contexts (i.e., a widget).\n if (fireListenerFor(eventContexts, node, eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n node = node.parent;\n updateEventInfo(eventInfo, 'bubbling', node);\n }\n updateEventInfo(eventInfo, 'bubbling', this);\n // Document context.\n fireListenerFor(eventContexts, '$document', eventInfo, ...eventArgs);\n return eventInfo.return;\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n _addEventListener(event, callback, options) {\n const contexts = toArray(options.context || '$document');\n const eventContexts = getBubblingContexts(this);\n for (const context of contexts) {\n let emitter = eventContexts.get(context);\n if (!emitter) {\n emitter = new (EmitterMixin())();\n eventContexts.set(context, emitter);\n }\n this.listenTo(emitter, event, callback, options);\n }\n }\n _removeEventListener(event, callback) {\n const eventContexts = getBubblingContexts(this);\n for (const emitter of eventContexts.values()) {\n this.stopListening(emitter, event, callback);\n }\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`.\n{\n const mixin = BubblingEmitterMixin(Object);\n ['fire', '_addEventListener', '_removeEventListener'].forEach(key => {\n BubblingEmitterMixin[key] = mixin.prototype[key];\n });\n}\n/**\n * Update the event info bubbling fields.\n *\n * @param eventInfo The event info object to update.\n * @param eventPhase The current event phase.\n * @param currentTarget The current bubbling target.\n */\nfunction updateEventInfo(eventInfo, eventPhase, currentTarget) {\n if (eventInfo instanceof BubblingEventInfo) {\n eventInfo._eventPhase = eventPhase;\n eventInfo._currentTarget = currentTarget;\n }\n}\n/**\n * Fires the listener for the specified context. Returns `true` if event was stopped.\n *\n * @param eventInfo The `EventInfo` object.\n * @param eventArgs Additional arguments to be passed to the callbacks.\n * @returns True if event stop was called.\n */\nfunction fireListenerFor(eventContexts, context, eventInfo, ...eventArgs) {\n const emitter = typeof context == 'string' ? eventContexts.get(context) : getCustomContext(eventContexts, context);\n if (!emitter) {\n return false;\n }\n emitter.fire(eventInfo, ...eventArgs);\n return eventInfo.stop.called;\n}\n/**\n * Returns an emitter for a specified view node.\n */\nfunction getCustomContext(eventContexts, node) {\n for (const [context, emitter] of eventContexts) {\n if (typeof context == 'function' && context(node)) {\n return emitter;\n }\n }\n return null;\n}\n/**\n * Returns bubbling contexts map for the source (emitter).\n */\nfunction getBubblingContexts(source) {\n if (!source[contextsSymbol]) {\n source[contextsSymbol] = new Map();\n }\n return source[contextsSymbol];\n}\n/**\n * Returns the deeper parent element for the range.\n */\nfunction getDeeperRangeParent(range) {\n if (!range) {\n return null;\n }\n const startParent = range.start.parent;\n const endParent = range.end.parent;\n const startPath = startParent.getPath();\n const endPath = endParent.getPath();\n return startPath.length > endPath.length ? startParent : endParent;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/document\n */\nimport DocumentSelection from './documentselection.js';\nimport BubblingEmitterMixin from './observer/bubblingemittermixin.js';\nimport { Collection, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );\n/**\n * Document class creates an abstract layer over the content editable area, contains a tree of view elements and\n * {@link module:engine/view/documentselection~DocumentSelection view selection} associated with this document.\n */\nexport default class Document extends /* #__PURE__ */ BubblingEmitterMixin(/* #__PURE__ */ ObservableMixin()) {\n /**\n * Creates a Document instance.\n *\n * @param stylesProcessor The styles processor instance.\n */\n constructor(stylesProcessor) {\n super();\n /**\n * Post-fixer callbacks registered to the view document.\n */\n this._postFixers = new Set();\n this.selection = new DocumentSelection();\n this.roots = new Collection({ idProperty: 'rootName' });\n this.stylesProcessor = stylesProcessor;\n this.set('isReadOnly', false);\n this.set('isFocused', false);\n this.set('isSelecting', false);\n this.set('isComposing', false);\n }\n /**\n * Gets a {@link module:engine/view/document~Document#roots view root element} with the specified name. If the name is not\n * specific \"main\" root is returned.\n *\n * @param name Name of the root.\n * @returns The view root element with the specified name or null when there is no root of given name.\n */\n getRoot(name = 'main') {\n return this.roots.get(name);\n }\n /**\n * Allows registering post-fixer callbacks. A post-fixers mechanism allows to update the view tree just before it is rendered\n * to the DOM.\n *\n * Post-fixers are executed right after all changes from the outermost change block were applied but\n * before the {@link module:engine/view/view~View#event:render render event} is fired. If a post-fixer callback made\n * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should\n * not be fixed in the new document tree state.\n *\n * View post-fixers are useful when you want to apply some fixes whenever the view structure changes. Keep in mind that\n * changes executed in a view post-fixer should not break model-view mapping.\n *\n * The types of changes which should be safe:\n *\n * * adding or removing attribute from elements,\n * * changes inside of {@link module:engine/view/uielement~UIElement UI elements},\n * * {@link module:engine/controller/editingcontroller~EditingController#reconvertItem marking some of the model elements to be\n * re-converted}.\n *\n * Try to avoid changes which touch view structure:\n *\n * * you should not add or remove nor wrap or unwrap any view elements,\n * * you should not change the editor data model in a view post-fixer.\n *\n * As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.\n *\n * Typically, a post-fixer will look like this:\n *\n * ```ts\n * editor.editing.view.document.registerPostFixer( writer => {\n * \tif ( checkSomeCondition() ) {\n * \t\twriter.doSomething();\n *\n * \t\t// Let other post-fixers know that something changed.\n * \t\treturn true;\n * \t}\n *\n * \treturn false;\n * } );\n * ```\n *\n * Note that nothing happens right after you register a post-fixer (e.g. execute such a code in the console).\n * That is because adding a post-fixer does not execute it.\n * The post-fixer will be executed as soon as any change in the document needs to cause its rendering.\n * If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling\n * {@link module:engine/view/view~View#forceRender `view.forceRender()`}.\n *\n * If you need to register a callback which is executed when DOM elements are already updated,\n * use {@link module:engine/view/view~View#event:render render event}.\n */\n registerPostFixer(postFixer) {\n this._postFixers.add(postFixer);\n }\n /**\n * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.\n */\n destroy() {\n this.roots.forEach(root => root.destroy());\n this.stopListening();\n }\n /**\n * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.\n *\n * @internal\n */\n _callPostFixers(writer) {\n let wasFixed = false;\n do {\n for (const callback of this._postFixers) {\n wasFixed = callback(writer);\n if (wasFixed) {\n break;\n }\n }\n } while (wasFixed);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/attributeelement\n */\nimport Element from './element.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n// Default attribute priority.\nconst DEFAULT_PRIORITY = 10;\n/**\n * Attribute elements are used to represent formatting elements in the view (think – `<b>`, `<span style=\"font-size: 2em\">`, etc.).\n * Most often they are created when downcasting model text attributes.\n *\n * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various\n * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},\n * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.\n *\n * To create a new attribute element instance use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.\n */\nclass AttributeElement extends Element {\n /**\n * Creates an attribute element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement\n * @see module:engine/view/element~Element\n * @protected\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document, name, attrs, children);\n /**\n * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.\n *\n * @internal\n * @readonly\n */\n this._priority = DEFAULT_PRIORITY;\n /**\n * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},\n * and then two elements are considered similar if, and only if they have the same `_id`.\n *\n * @internal\n * @readonly\n */\n this._id = null;\n /**\n * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}\n * and still exist in the view tree.\n *\n * This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.\n */\n this._clonesGroup = null;\n this.getFillerOffset = getFillerOffset;\n }\n /**\n * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.\n */\n get priority() {\n return this._priority;\n }\n /**\n * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},\n * and then two elements are considered similar if, and only if they have the same `id`.\n */\n get id() {\n return this._id;\n }\n /**\n * Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the\n * same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).\n *\n * Note: If this element has been removed from the tree, returned set will not include it.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError attribute-element-get-elements-with-same-id-no-id}\n * if this element has no `id`.\n *\n * @returns Set containing all the attribute elements\n * with the same `id` that were added and not removed from the view tree.\n */\n getElementsWithSameId() {\n if (this.id === null) {\n /**\n * Cannot get elements with the same id for an attribute element without id.\n *\n * @error attribute-element-get-elements-with-same-id-no-id\n */\n throw new CKEditorError('attribute-element-get-elements-with-same-id-no-id', this);\n }\n return new Set(this._clonesGroup);\n }\n /**\n * Checks if this element is similar to other element.\n *\n * If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements\n * should have the same name, attributes and priority to be considered as similar. Two similar elements can contain\n * different set of children nodes.\n *\n * If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both\n * elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be\n * considered similar.\n *\n * Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:\n *\n * * two following similar elements can be merged together into one, longer element,\n * * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to\n * decide whether processed element should be unwrapped,\n * * etc.\n */\n isSimilar(otherElement) {\n // If any element has an `id` set, just compare the ids.\n if (this.id !== null || otherElement.id !== null) {\n return this.id === otherElement.id;\n }\n return super.isSimilar(otherElement) && this.priority == otherElement.priority;\n }\n /**\n * Clones provided element with priority.\n *\n * @internal\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any children.\n * @returns Clone of this element.\n */\n _clone(deep = false) {\n const cloned = super._clone(deep);\n // Clone priority too.\n cloned._priority = this._priority;\n // And id too.\n cloned._id = this._id;\n return cloned;\n }\n}\nAttributeElement.DEFAULT_PRIORITY = DEFAULT_PRIORITY;\nexport default AttributeElement;\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nAttributeElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'attributeElement' || type === 'view:attributeElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'attributeElement' || type === 'view:attributeElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * Returns block {@link module:engine/view/filler~Filler filler} offset or `null` if block filler is not needed.\n *\n * @returns Block filler offset or `null` if block filler is not needed.\n */\nfunction getFillerOffset() {\n // <b>foo</b> does not need filler.\n if (nonUiChildrenCount(this)) {\n return null;\n }\n let element = this.parent;\n // <p><b></b></p> needs filler -> <p><b><br></b></p>\n while (element && element.is('attributeElement')) {\n if (nonUiChildrenCount(element) > 1) {\n return null;\n }\n element = element.parent;\n }\n if (!element || nonUiChildrenCount(element) > 1) {\n return null;\n }\n // Render block filler at the end of element (after all ui elements).\n return this.childCount;\n}\n/**\n * Returns total count of children that are not {@link module:engine/view/uielement~UIElement UIElements}.\n */\nfunction nonUiChildrenCount(element) {\n return Array.from(element.getChildren()).filter(element => !element.is('uiElement')).length;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/emptyelement\n */\nimport Element from './element.js';\nimport Node from './node.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Empty element class. It is used to represent elements that cannot contain any child nodes (for example `<img>` elements).\n *\n * To create a new empty element use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`} method.\n */\nexport default class EmptyElement extends Element {\n /**\n * Creates new instance of EmptyElement.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` when third parameter is passed,\n * to inform that usage of EmptyElement is incorrect (adding child nodes to EmptyElement is forbidden).\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createEmptyElement\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attributes, children) {\n super(document, name, attributes, children);\n this.getFillerOffset = getFillerOffset;\n }\n /**\n * Overrides {@link module:engine/view/element~Element#_insertChild} method.\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` to prevent\n * adding any child nodes to EmptyElement.\n *\n * @internal\n */\n _insertChild(index, items) {\n if (items && (items instanceof Node || Array.from(items).length > 0)) {\n /**\n * Cannot add children to {@link module:engine/view/emptyelement~EmptyElement}.\n *\n * @error view-emptyelement-cannot-add\n */\n throw new CKEditorError('view-emptyelement-cannot-add', [this, items]);\n }\n return 0;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nEmptyElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'emptyElement' || type === 'view:emptyElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'emptyElement' || type === 'view:emptyElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * Returns `null` because block filler is not needed for EmptyElements.\n */\nfunction getFillerOffset() {\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/uielement\n */\nimport Element from './element.js';\nimport Node from './node.js';\nimport { CKEditorError, keyCodes } from '@ckeditor/ckeditor5-utils';\n/**\n * UI element class. It should be used to represent editing UI which needs to be injected into the editing view\n * If possible, you should keep your UI outside the editing view. However, if that is not possible,\n * UI elements can be used.\n *\n * How a UI element is rendered is in your control (you pass a callback to\n * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}).\n * The editor will ignore your UI element – the selection cannot be placed in it, it is skipped (invisible) when\n * the user modifies the selection by using arrow keys and the editor does not listen to any mutations which\n * happen inside your UI elements.\n *\n * The limitation is that you cannot convert a model element to a UI element. UI elements need to be\n * created for {@link module:engine/model/markercollection~Marker markers} or as additinal elements\n * inside normal {@link module:engine/view/containerelement~ContainerElement container elements}.\n *\n * To create a new UI element use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`} method.\n */\nexport default class UIElement extends Element {\n /**\n * Creates new instance of UIElement.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` when third parameter is passed,\n * to inform that usage of UIElement is incorrect (adding child nodes to UIElement is forbidden).\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createUIElement\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document, name, attrs, children);\n this.getFillerOffset = getFillerOffset;\n }\n /**\n * Overrides {@link module:engine/view/element~Element#_insertChild} method.\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` to prevent adding any child nodes\n * to UIElement.\n *\n * @internal\n */\n _insertChild(index, items) {\n if (items && (items instanceof Node || Array.from(items).length > 0)) {\n /**\n * Cannot add children to {@link module:engine/view/uielement~UIElement}.\n *\n * @error view-uielement-cannot-add\n */\n throw new CKEditorError('view-uielement-cannot-add', [this, items]);\n }\n return 0;\n }\n /**\n * Renders this {@link module:engine/view/uielement~UIElement} to DOM. This method is called by\n * {@link module:engine/view/domconverter~DomConverter}.\n * Do not use inheritance to create custom rendering method, replace `render()` method instead:\n *\n * ```ts\n * const myUIElement = downcastWriter.createUIElement( 'span' );\n * myUIElement.render = function( domDocument, domConverter ) {\n * \tconst domElement = this.toDomElement( domDocument );\n *\n * \tdomConverter.setContentOf( domElement, '<b>this is ui element</b>' );\n *\n * \treturn domElement;\n * };\n * ```\n *\n * If changes in your UI element should trigger some editor UI update you should call\n * the {@link module:ui/editorui/editorui~EditorUI#update `editor.ui.update()`} method\n * after rendering your UI element.\n *\n * @param domConverter Instance of the DomConverter used to optimize the output.\n */\n render(domDocument, domConverter // eslint-disable-line @typescript-eslint/no-unused-vars\n ) {\n // Provide basic, default output.\n return this.toDomElement(domDocument);\n }\n /**\n * Creates DOM element based on this view UIElement.\n * Note that each time this method is called new DOM element is created.\n */\n toDomElement(domDocument) {\n const domElement = domDocument.createElement(this.name);\n for (const key of this.getAttributeKeys()) {\n domElement.setAttribute(key, this.getAttribute(key));\n }\n return domElement;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nUIElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'uiElement' || type === 'view:uiElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'uiElement' || type === 'view:uiElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * This function injects UI element handling to the given {@link module:engine/view/document~Document document}.\n *\n * A callback is added to {@link module:engine/view/document~Document#event:keydown document keydown event}.\n * The callback handles the situation when right arrow key is pressed and selection is collapsed before a UI element.\n * Without this handler, it would be impossible to \"jump over\" UI element using right arrow key.\n *\n * @param view View controller to which the quirks handling will be injected.\n */\nexport function injectUiElementHandling(view) {\n view.document.on('arrowKey', (evt, data) => jumpOverUiElement(evt, data, view.domConverter), { priority: 'low' });\n}\n/**\n * Returns `null` because block filler is not needed for UIElements.\n */\nfunction getFillerOffset() {\n return null;\n}\n/**\n * Selection cannot be placed in a `UIElement`. Whenever it is placed there, it is moved before it. This\n * causes a situation when it is impossible to jump over `UIElement` using right arrow key, because the selection\n * ends up in ui element (in DOM) and is moved back to the left. This handler fixes this situation.\n */\nfunction jumpOverUiElement(evt, data, domConverter) {\n if (data.keyCode == keyCodes.arrowright) {\n const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();\n const domSelectionCollapsed = domSelection.rangeCount == 1 && domSelection.getRangeAt(0).collapsed;\n // Jump over UI element if selection is collapsed or shift key is pressed. These are the cases when selection would extend.\n if (domSelectionCollapsed || data.shiftKey) {\n const domParent = domSelection.focusNode;\n const domOffset = domSelection.focusOffset;\n const viewPosition = domConverter.domPositionToView(domParent, domOffset);\n // In case if dom element is not converted to view or is not mapped or something. Happens for example in some tests.\n if (viewPosition === null) {\n return;\n }\n // Skip all following ui elements.\n let jumpedOverAnyUiElement = false;\n const nextViewPosition = viewPosition.getLastMatchingPosition(value => {\n if (value.item.is('uiElement')) {\n // Remember that there was at least one ui element.\n jumpedOverAnyUiElement = true;\n }\n // Jump over ui elements, jump over empty attribute elements, move up from inside of attribute element.\n if (value.item.is('uiElement') || value.item.is('attributeElement')) {\n return true;\n }\n // Don't jump over text or don't get out of container element.\n return false;\n });\n // If anything has been skipped, fix position.\n // This `if` could be possibly omitted but maybe it is better not to mess with DOM selection if not needed.\n if (jumpedOverAnyUiElement) {\n const newDomPosition = domConverter.viewPositionToDom(nextViewPosition);\n if (domSelectionCollapsed) {\n // Selection was collapsed, so collapse it at further position.\n domSelection.collapse(newDomPosition.parent, newDomPosition.offset);\n }\n else {\n // Selection was not collapse, so extend it instead of collapsing.\n domSelection.extend(newDomPosition.parent, newDomPosition.offset);\n }\n }\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n * @module engine/view/rawelement\n */\nimport Element from './element.js';\nimport Node from './node.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * The raw element class.\n *\n * The raw elements work as data containers (\"wrappers\", \"sandboxes\") but their children are not managed or\n * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures\n * in the editor content without, for instance, worrying about compatibility with other editor features.\n * Raw elements are a perfect tool for integration with external frameworks and data sources.\n *\n * Unlike {@link module:engine/view/uielement~UIElement UI elements}, raw elements act like real editor\n * content (similar to {@link module:engine/view/containerelement~ContainerElement} or\n * {@link module:engine/view/emptyelement~EmptyElement}), they are considered by the editor selection and\n * {@link module:widget/utils~toWidget they can work as widgets}.\n *\n * To create a new raw element, use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement `downcastWriter#createRawElement()`} method.\n */\nexport default class RawElement extends Element {\n /**\n * Creates a new instance of a raw element.\n *\n * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} when the `children`\n * parameter is passed to inform that the usage of `RawElement` is incorrect (adding child nodes to `RawElement` is forbidden).\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createRawElement\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document, name, attrs, children);\n // Returns `null` because filler is not needed for raw elements.\n this.getFillerOffset = getFillerOffset;\n }\n /**\n * Overrides the {@link module:engine/view/element~Element#_insertChild} method.\n * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} to prevent\n * adding any child nodes to a raw element.\n *\n * @internal\n */\n _insertChild(index, items) {\n if (items && (items instanceof Node || Array.from(items).length > 0)) {\n /**\n * Cannot add children to a {@link module:engine/view/rawelement~RawElement} instance.\n *\n * @error view-rawelement-cannot-add\n */\n throw new CKEditorError('view-rawelement-cannot-add', [this, items]);\n }\n return 0;\n }\n /**\n * This allows rendering the children of a {@link module:engine/view/rawelement~RawElement} on the DOM level.\n * This method is called by the {@link module:engine/view/domconverter~DomConverter} with the raw DOM element\n * passed as an argument, leaving the number and shape of the children up to the integrator.\n *\n * This method **must be defined** for the raw element to work:\n *\n * ```ts\n * const myRawElement = downcastWriter.createRawElement( 'div' );\n *\n * myRawElement.render = function( domElement, domConverter ) {\n * \tdomConverter.setContentOf( domElement, '<b>This is the raw content of myRawElement.</b>' );\n * };\n * ```\n *\n * @param domElement The native DOM element representing the raw view element.\n * @param domConverter Instance of the DomConverter used to optimize the output.\n */\n render(domElement, domConverter) { }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRawElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'rawElement' || type === 'view:rawElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === this.name || type === 'view:' + this.name ||\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'rawElement' || type === 'view:rawElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * Returns `null` because block filler is not needed for raw elements.\n */\nfunction getFillerOffset() {\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/documentfragment\n */\nimport TypeCheckable from './typecheckable.js';\nimport Text from './text.js';\nimport TextProxy from './textproxy.js';\nimport { EmitterMixin, isIterable } from '@ckeditor/ckeditor5-utils';\n/**\n * Document fragment.\n *\n * To create a new document fragment instance use the\n * {@link module:engine/view/upcastwriter~UpcastWriter#createDocumentFragment `UpcastWriter#createDocumentFragment()`}\n * method.\n */\nexport default class DocumentFragment extends /* #__PURE__ */ EmitterMixin(TypeCheckable) {\n /**\n * Creates new DocumentFragment instance.\n *\n * @internal\n * @param document The document to which this document fragment belongs.\n * @param children A list of nodes to be inserted into the created document fragment.\n */\n constructor(document, children) {\n super();\n /**\n * Array of child nodes.\n */\n this._children = [];\n /**\n * Map of custom properties.\n * Custom properties can be added to document fragment instance.\n */\n this._customProperties = new Map();\n this.document = document;\n if (children) {\n this._insertChild(0, children);\n }\n }\n /**\n * Iterable interface.\n *\n * Iterates over nodes added to this document fragment.\n */\n [Symbol.iterator]() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Number of child nodes in this document fragment.\n */\n get childCount() {\n return this._children.length;\n }\n /**\n * Is `true` if there are no nodes inside this document fragment, `false` otherwise.\n */\n get isEmpty() {\n return this.childCount === 0;\n }\n /**\n * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.\n */\n get root() {\n return this;\n }\n /**\n * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n */\n get parent() {\n return null;\n }\n /**\n * Artificial element name. Returns `undefined`. Added for compatibility reasons.\n */\n get name() {\n return undefined;\n }\n /**\n * Artificial element getFillerOffset. Returns `undefined`. Added for compatibility reasons.\n */\n get getFillerOffset() {\n return undefined;\n }\n /**\n * Returns the custom property value for the given key.\n */\n getCustomProperty(key) {\n return this._customProperties.get(key);\n }\n /**\n * Returns an iterator which iterates over this document fragment's custom properties.\n * Iterator provides `[ key, value ]` pairs for each stored property.\n */\n *getCustomProperties() {\n yield* this._customProperties.entries();\n }\n /**\n * {@link module:engine/view/documentfragment~DocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end\n * and sets the parent of these nodes to this fragment.\n *\n * @internal\n * @param items Items to be inserted.\n * @returns Number of appended nodes.\n */\n _appendChild(items) {\n return this._insertChild(this.childCount, items);\n }\n /**\n * Gets child at the given index.\n *\n * @param index Index of child.\n * @returns Child node.\n */\n getChild(index) {\n return this._children[index];\n }\n /**\n * Gets index of the given child node. Returns `-1` if child node is not found.\n *\n * @param node Child node.\n * @returns Index of the child node.\n */\n getChildIndex(node) {\n return this._children.indexOf(node);\n }\n /**\n * Gets child nodes iterator.\n *\n * @returns Child nodes iterator.\n */\n getChildren() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to\n * this fragment.\n *\n * @internal\n * @param index Position where nodes should be inserted.\n * @param items Items to be inserted.\n * @returns Number of inserted nodes.\n */\n _insertChild(index, items) {\n this._fireChange('children', this);\n let count = 0;\n const nodes = normalize(this.document, items);\n for (const node of nodes) {\n // If node that is being added to this element is already inside another element, first remove it from the old parent.\n if (node.parent !== null) {\n node._remove();\n }\n node.parent = this;\n this._children.splice(index, 0, node);\n index++;\n count++;\n }\n return count;\n }\n /**\n * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.\n *\n * @internal\n * @param index Number of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @returns The array of removed nodes.\n */\n _removeChildren(index, howMany = 1) {\n this._fireChange('children', this);\n for (let i = index; i < index + howMany; i++) {\n this._children[i].parent = null;\n }\n return this._children.splice(index, howMany);\n }\n /**\n * Fires `change` event with given type of the change.\n *\n * @internal\n * @param type Type of the change.\n * @param node Changed node.\n */\n _fireChange(type, node) {\n this.fire('change:' + type, node);\n }\n /**\n * Sets a custom property. They can be used to add special data to elements.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty\n * @internal\n */\n _setCustomProperty(key, value) {\n this._customProperties.set(key, value);\n }\n /**\n * Removes the custom property stored under the given key.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty\n * @internal\n * @returns Returns true if property was removed.\n */\n _removeCustomProperty(key) {\n return this._customProperties.delete(key);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nDocumentFragment.prototype.is = function (type) {\n return type === 'documentFragment' || type === 'view:documentFragment';\n};\n/**\n * Converts strings to Text and non-iterables to arrays.\n */\nfunction normalize(document, nodes) {\n // Separate condition because string is iterable.\n if (typeof nodes == 'string') {\n return [new Text(document, nodes)];\n }\n if (!isIterable(nodes)) {\n nodes = [nodes];\n }\n // Array.from to enable .map() on non-arrays.\n return Array.from(nodes)\n .map(node => {\n if (typeof node == 'string') {\n return new Text(document, node);\n }\n if (node instanceof TextProxy) {\n return new Text(document, node.data);\n }\n return node;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/downcastwriter\n */\nimport Position from './position.js';\nimport Range from './range.js';\nimport Selection from './selection.js';\nimport ContainerElement from './containerelement.js';\nimport AttributeElement from './attributeelement.js';\nimport EmptyElement from './emptyelement.js';\nimport UIElement from './uielement.js';\nimport RawElement from './rawelement.js';\nimport { CKEditorError, isIterable } from '@ckeditor/ckeditor5-utils';\nimport DocumentFragment from './documentfragment.js';\nimport Text from './text.js';\nimport EditableElement from './editableelement.js';\nimport { isPlainObject } from 'lodash-es';\n/**\n * View downcast writer.\n *\n * It provides a set of methods used to manipulate view nodes.\n *\n * Do not create an instance of this writer manually. To modify a view structure, use\n * the {@link module:engine/view/view~View#change `View#change()`} block.\n *\n * The `DowncastWriter` is designed to work with semantic views which are the views that were/are being downcasted from the model.\n * To work with ordinary views (e.g. parsed from a pasted content) use the\n * {@link module:engine/view/upcastwriter~UpcastWriter upcast writer}.\n *\n * Read more about changing the view in the {@glink framework/architecture/editing-engine#changing-the-view Changing the view}\n * section of the {@glink framework/architecture/editing-engine Editing engine architecture} guide.\n */\nexport default class DowncastWriter {\n /**\n * @param document The view document instance.\n */\n constructor(document) {\n /**\n * Holds references to the attribute groups that share the same {@link module:engine/view/attributeelement~AttributeElement#id id}.\n * The keys are `id`s, the values are `Set`s holding {@link module:engine/view/attributeelement~AttributeElement}s.\n */\n this._cloneGroups = new Map();\n /**\n * The slot factory used by the `elementToStructure` downcast helper.\n */\n this._slotFactory = null;\n this.document = document;\n }\n setSelection(...args) {\n this.document.selection._setTo(...args);\n }\n /**\n * Moves {@link module:engine/view/documentselection~DocumentSelection#focus selection's focus} to the specified location.\n *\n * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}\n * parameters.\n *\n * @param Offset or one of the flags. Used only when the first parameter is a {@link module:engine/view/item~Item view item}.\n */\n setSelectionFocus(itemOrPosition, offset) {\n this.document.selection._setFocus(itemOrPosition, offset);\n }\n /**\n * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.\n *\n * @param children A list of nodes to be inserted into the created document fragment.\n * @returns The created document fragment.\n */\n createDocumentFragment(children) {\n return new DocumentFragment(this.document, children);\n }\n /**\n * Creates a new {@link module:engine/view/text~Text text node}.\n *\n * ```ts\n * writer.createText( 'foo' );\n * ```\n *\n * @param data The text's data.\n * @returns The created text node.\n */\n createText(data) {\n return new Text(this.document, data);\n }\n /**\n * Creates a new {@link module:engine/view/attributeelement~AttributeElement}.\n *\n * ```ts\n * writer.createAttributeElement( 'strong' );\n * writer.createAttributeElement( 'a', { href: 'foo.bar' } );\n *\n * // Make `<a>` element contain other attributes element so the `<a>` element is not broken.\n * writer.createAttributeElement( 'a', { href: 'foo.bar' }, { priority: 5 } );\n *\n * // Set `id` of a marker element so it is not joined or merged with \"normal\" elements.\n * writer.createAttributeElement( 'span', { class: 'my-marker' }, { id: 'marker:my' } );\n * ```\n *\n * @param name Name of the element.\n * @param attributes Element's attributes.\n * @param options Element's options.\n * @param options.priority Element's {@link module:engine/view/attributeelement~AttributeElement#priority priority}.\n * @param options.id Element's {@link module:engine/view/attributeelement~AttributeElement#id id}.\n * @param options.renderUnsafeAttributes A list of attribute names that should be rendered in the editing\n * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.\n * @returns Created element.\n */\n createAttributeElement(name, attributes, options = {}) {\n const attributeElement = new AttributeElement(this.document, name, attributes);\n if (typeof options.priority === 'number') {\n attributeElement._priority = options.priority;\n }\n if (options.id) {\n attributeElement._id = options.id;\n }\n if (options.renderUnsafeAttributes) {\n attributeElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return attributeElement;\n }\n createContainerElement(name, attributes, childrenOrOptions = {}, options = {}) {\n let children = null;\n if (isPlainObject(childrenOrOptions)) {\n options = childrenOrOptions;\n }\n else {\n children = childrenOrOptions;\n }\n const containerElement = new ContainerElement(this.document, name, attributes, children);\n if (options.renderUnsafeAttributes) {\n containerElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return containerElement;\n }\n /**\n * Creates a new {@link module:engine/view/editableelement~EditableElement}.\n *\n * ```ts\n * writer.createEditableElement( 'div' );\n * writer.createEditableElement( 'div', { id: 'foo-1234' } );\n * ```\n *\n * Note: The editable element is to be used in the editing pipeline. Usually, together with\n * {@link module:widget/utils~toWidgetEditable `toWidgetEditable()`}.\n *\n * @param name Name of the element.\n * @param attributes Elements attributes.\n * @param options Element's options.\n * @param options.renderUnsafeAttributes A list of attribute names that should be rendered in the editing\n * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.\n * @returns Created element.\n */\n createEditableElement(name, attributes, options = {}) {\n const editableElement = new EditableElement(this.document, name, attributes);\n if (options.renderUnsafeAttributes) {\n editableElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return editableElement;\n }\n /**\n * Creates a new {@link module:engine/view/emptyelement~EmptyElement}.\n *\n * ```ts\n * writer.createEmptyElement( 'img' );\n * writer.createEmptyElement( 'img', { id: 'foo-1234' } );\n * ```\n *\n * @param name Name of the element.\n * @param attributes Elements attributes.\n * @param options Element's options.\n * @param options.renderUnsafeAttributes A list of attribute names that should be rendered in the editing\n * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.\n * @returns Created element.\n */\n createEmptyElement(name, attributes, options = {}) {\n const emptyElement = new EmptyElement(this.document, name, attributes);\n if (options.renderUnsafeAttributes) {\n emptyElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return emptyElement;\n }\n /**\n * Creates a new {@link module:engine/view/uielement~UIElement}.\n *\n * ```ts\n * writer.createUIElement( 'span' );\n * writer.createUIElement( 'span', { id: 'foo-1234' } );\n * ```\n *\n * A custom render function can be provided as the third parameter:\n *\n * ```ts\n * writer.createUIElement( 'span', null, function( domDocument ) {\n * \tconst domElement = this.toDomElement( domDocument );\n * \tdomElement.innerHTML = '<b>this is ui element</b>';\n *\n * \treturn domElement;\n * } );\n * ```\n *\n * Unlike {@link #createRawElement raw elements}, UI elements are by no means editor content, for instance,\n * they are ignored by the editor selection system.\n *\n * You should not use UI elements as data containers. Check out {@link #createRawElement} instead.\n *\n * @param name The name of the element.\n * @param attributes Element attributes.\n * @param renderFunction A custom render function.\n * @returns The created element.\n */\n createUIElement(name, attributes, renderFunction) {\n const uiElement = new UIElement(this.document, name, attributes);\n if (renderFunction) {\n uiElement.render = renderFunction;\n }\n return uiElement;\n }\n /**\n * Creates a new {@link module:engine/view/rawelement~RawElement}.\n *\n * ```ts\n * writer.createRawElement( 'span', { id: 'foo-1234' }, function( domElement ) {\n * \tdomElement.innerHTML = '<b>This is the raw content of the raw element.</b>';\n * } );\n * ```\n *\n * Raw elements work as data containers (\"wrappers\", \"sandboxes\") but their children are not managed or\n * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures\n * in the editor content without, for instance, worrying about compatibility with other editor features.\n * Raw elements are a perfect tool for integration with external frameworks and data sources.\n *\n * Unlike {@link #createUIElement UI elements}, raw elements act like \"real\" editor content (similar to\n * {@link module:engine/view/containerelement~ContainerElement} or {@link module:engine/view/emptyelement~EmptyElement}),\n * and they are considered by the editor selection.\n *\n * You should not use raw elements to render the UI in the editor content. Check out {@link #createUIElement `#createUIElement()`}\n * instead.\n *\n * @param name The name of the element.\n * @param attributes Element attributes.\n * @param renderFunction A custom render function.\n * @param options Element's options.\n * @param options.renderUnsafeAttributes A list of attribute names that should be rendered in the editing\n * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.\n * @returns The created element.\n */\n createRawElement(name, attributes, renderFunction, options = {}) {\n const rawElement = new RawElement(this.document, name, attributes);\n if (renderFunction) {\n rawElement.render = renderFunction;\n }\n if (options.renderUnsafeAttributes) {\n rawElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return rawElement;\n }\n /**\n * Adds or overwrites the element's attribute with a specified key and value.\n *\n * ```ts\n * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );\n * ```\n *\n * @param key The attribute key.\n * @param value The attribute value.\n */\n setAttribute(key, value, element) {\n element._setAttribute(key, value);\n }\n /**\n * Removes attribute from the element.\n *\n * ```ts\n * writer.removeAttribute( 'href', linkElement );\n * ```\n *\n * @param key Attribute key.\n */\n removeAttribute(key, element) {\n element._removeAttribute(key);\n }\n /**\n * Adds specified class to the element.\n *\n * ```ts\n * writer.addClass( 'foo', linkElement );\n * writer.addClass( [ 'foo', 'bar' ], linkElement );\n * ```\n */\n addClass(className, element) {\n element._addClass(className);\n }\n /**\n * Removes specified class from the element.\n *\n * ```ts\n * writer.removeClass( 'foo', linkElement );\n * writer.removeClass( [ 'foo', 'bar' ], linkElement );\n * ```\n */\n removeClass(className, element) {\n element._removeClass(className);\n }\n setStyle(property, value, element) {\n if (isPlainObject(property) && element === undefined) {\n value._setStyle(property);\n }\n else {\n element._setStyle(property, value);\n }\n }\n /**\n * Removes specified style from the element.\n *\n * ```ts\n * writer.removeStyle( 'color', element ); // Removes 'color' style.\n * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.\n * ```\n *\n * **Note**: This method can work with normalized style names if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.\n */\n removeStyle(property, element) {\n element._removeStyle(property);\n }\n /**\n * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,\n * so they can be used to add special data to elements.\n */\n setCustomProperty(key, value, element) {\n element._setCustomProperty(key, value);\n }\n /**\n * Removes a custom property stored under the given key.\n *\n * @returns Returns true if property was removed.\n */\n removeCustomProperty(key, element) {\n return element._removeCustomProperty(key);\n }\n /**\n * Breaks attribute elements at the provided position or at the boundaries of a provided range. It breaks attribute elements\n * up to their first ancestor that is a container element.\n *\n * In following examples `<p>` is a container, `<b>` and `<u>` are attribute elements:\n *\n * ```html\n * <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>\n * <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>\n * <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>\n * <p><b>fo{o</b><u>ba}r</u></p> -> <p><b>fo</b><b>o</b><u>ba</u><u>r</u></b></p>\n * ```\n *\n * **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.\n *\n * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,\n * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.\n * `breakContainer()` assumes that a given `position` is directly in the container element and breaks that container element.\n *\n * Throws the `view-writer-invalid-range-container` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * when the {@link module:engine/view/range~Range#start start}\n * and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.\n *\n * Throws the `view-writer-cannot-break-empty-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * when trying to break attributes inside an {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.\n *\n * Throws the `view-writer-cannot-break-ui-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * when trying to break attributes inside a {@link module:engine/view/uielement~UIElement UIElement}.\n *\n * @see module:engine/view/attributeelement~AttributeElement\n * @see module:engine/view/containerelement~ContainerElement\n * @see module:engine/view/downcastwriter~DowncastWriter#breakContainer\n * @param positionOrRange The position where to break attribute elements.\n * @returns The new position or range, after breaking the attribute elements.\n */\n breakAttributes(positionOrRange) {\n if (positionOrRange instanceof Position) {\n return this._breakAttributes(positionOrRange);\n }\n else {\n return this._breakAttributesRange(positionOrRange);\n }\n }\n /**\n * Breaks a {@link module:engine/view/containerelement~ContainerElement container view element} into two, at the given position.\n * The position has to be directly inside the container element and cannot be in the root. It does not break the conrainer view element\n * if the position is at the beginning or at the end of its parent element.\n *\n * ```html\n * <p>foo^bar</p> -> <p>foo</p><p>bar</p>\n * <div><p>foo</p>^<p>bar</p></div> -> <div><p>foo</p></div><div><p>bar</p></div>\n * <p>^foobar</p> -> ^<p>foobar</p>\n * <p>foobar^</p> -> <p>foobar</p>^\n * ```\n *\n * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,\n * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.\n * `breakContainer()` assumes that the given `position` is directly in the container element and breaks that container element.\n *\n * @see module:engine/view/attributeelement~AttributeElement\n * @see module:engine/view/containerelement~ContainerElement\n * @see module:engine/view/downcastwriter~DowncastWriter#breakAttributes\n * @param position The position where to break the element.\n * @returns The position between broken elements. If an element has not been broken,\n * the returned position is placed either before or after it.\n */\n breakContainer(position) {\n const element = position.parent;\n if (!(element.is('containerElement'))) {\n /**\n * Trying to break an element which is not a container element.\n *\n * @error view-writer-break-non-container-element\n */\n throw new CKEditorError('view-writer-break-non-container-element', this.document);\n }\n if (!element.parent) {\n /**\n * Trying to break root element.\n *\n * @error view-writer-break-root\n */\n throw new CKEditorError('view-writer-break-root', this.document);\n }\n if (position.isAtStart) {\n return Position._createBefore(element);\n }\n else if (!position.isAtEnd) {\n const newElement = element._clone(false);\n this.insert(Position._createAfter(element), newElement);\n const sourceRange = new Range(position, Position._createAt(element, 'end'));\n const targetPosition = new Position(newElement, 0);\n this.move(sourceRange, targetPosition);\n }\n return Position._createAfter(element);\n }\n /**\n * Merges {@link module:engine/view/attributeelement~AttributeElement attribute elements}. It also merges text nodes if needed.\n * Only {@link module:engine/view/attributeelement~AttributeElement#isSimilar similar} attribute elements can be merged.\n *\n * In following examples `<p>` is a container and `<b>` is an attribute element:\n *\n * ```html\n * <p>foo[]bar</p> -> <p>foo{}bar</p>\n * <p><b>foo</b>[]<b>bar</b></p> -> <p><b>foo{}bar</b></p>\n * <p><b foo=\"bar\">a</b>[]<b foo=\"baz\">b</b></p> -> <p><b foo=\"bar\">a</b>[]<b foo=\"baz\">b</b></p>\n * ```\n *\n * It will also take care about empty attributes when merging:\n *\n * ```html\n * <p><b>[]</b></p> -> <p>[]</p>\n * <p><b>foo</b><i>[]</i><b>bar</b></p> -> <p><b>foo{}bar</b></p>\n * ```\n *\n * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and\n * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}\n * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.\n *\n * @see module:engine/view/attributeelement~AttributeElement\n * @see module:engine/view/containerelement~ContainerElement\n * @see module:engine/view/downcastwriter~DowncastWriter#mergeContainers\n * @param position Merge position.\n * @returns Position after merge.\n */\n mergeAttributes(position) {\n const positionOffset = position.offset;\n const positionParent = position.parent;\n // When inside text node - nothing to merge.\n if (positionParent.is('$text')) {\n return position;\n }\n // When inside empty attribute - remove it.\n if (positionParent.is('attributeElement') && positionParent.childCount === 0) {\n const parent = positionParent.parent;\n const offset = positionParent.index;\n positionParent._remove();\n this._removeFromClonedElementsGroup(positionParent);\n return this.mergeAttributes(new Position(parent, offset));\n }\n const nodeBefore = positionParent.getChild(positionOffset - 1);\n const nodeAfter = positionParent.getChild(positionOffset);\n // Position should be placed between two nodes.\n if (!nodeBefore || !nodeAfter) {\n return position;\n }\n // When position is between two text nodes.\n if (nodeBefore.is('$text') && nodeAfter.is('$text')) {\n return mergeTextNodes(nodeBefore, nodeAfter);\n }\n // When position is between two same attribute elements.\n else if (nodeBefore.is('attributeElement') && nodeAfter.is('attributeElement') && nodeBefore.isSimilar(nodeAfter)) {\n // Move all children nodes from node placed after selection and remove that node.\n const count = nodeBefore.childCount;\n nodeBefore._appendChild(nodeAfter.getChildren());\n nodeAfter._remove();\n this._removeFromClonedElementsGroup(nodeAfter);\n // New position is located inside the first node, before new nodes.\n // Call this method recursively to merge again if needed.\n return this.mergeAttributes(new Position(nodeBefore, count));\n }\n return position;\n }\n /**\n * Merges two {@link module:engine/view/containerelement~ContainerElement container elements} that are before and after given position.\n * Precisely, the element after the position is removed and it's contents are moved to element before the position.\n *\n * ```html\n * <p>foo</p>^<p>bar</p> -> <p>foo^bar</p>\n * <div>foo</div>^<p>bar</p> -> <div>foo^bar</div>\n * ```\n *\n * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and\n * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}\n * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.\n *\n * @see module:engine/view/attributeelement~AttributeElement\n * @see module:engine/view/containerelement~ContainerElement\n * @see module:engine/view/downcastwriter~DowncastWriter#mergeAttributes\n * @param position Merge position.\n * @returns Position after merge.\n */\n mergeContainers(position) {\n const prev = position.nodeBefore;\n const next = position.nodeAfter;\n if (!prev || !next || !prev.is('containerElement') || !next.is('containerElement')) {\n /**\n * Element before and after given position cannot be merged.\n *\n * @error view-writer-merge-containers-invalid-position\n */\n throw new CKEditorError('view-writer-merge-containers-invalid-position', this.document);\n }\n const lastChild = prev.getChild(prev.childCount - 1);\n const newPosition = lastChild instanceof Text ? Position._createAt(lastChild, 'end') : Position._createAt(prev, 'end');\n this.move(Range._createIn(next), Position._createAt(prev, 'end'));\n this.remove(Range._createOn(next));\n return newPosition;\n }\n /**\n * Inserts a node or nodes at specified position. Takes care about breaking attributes before insertion\n * and merging them afterwards.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert\n * contains instances that are not {@link module:engine/view/text~Text Texts},\n * {@link module:engine/view/attributeelement~AttributeElement AttributeElements},\n * {@link module:engine/view/containerelement~ContainerElement ContainerElements},\n * {@link module:engine/view/emptyelement~EmptyElement EmptyElements},\n * {@link module:engine/view/rawelement~RawElement RawElements} or\n * {@link module:engine/view/uielement~UIElement UIElements}.\n *\n * @param position Insertion position.\n * @param nodes Node or nodes to insert.\n * @returns Range around inserted nodes.\n */\n insert(position, nodes) {\n nodes = isIterable(nodes) ? [...nodes] : [nodes];\n // Check if nodes to insert are instances of AttributeElements, ContainerElements, EmptyElements, UIElements or Text.\n validateNodesToInsert(nodes, this.document);\n // Group nodes in batches of nodes that require or do not require breaking an AttributeElements.\n const nodeGroups = nodes.reduce((groups, node) => {\n const lastGroup = groups[groups.length - 1];\n // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements\n // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.\n const breakAttributes = !node.is('uiElement');\n if (!lastGroup || lastGroup.breakAttributes != breakAttributes) {\n groups.push({\n breakAttributes,\n nodes: [node]\n });\n }\n else {\n lastGroup.nodes.push(node);\n }\n return groups;\n }, []);\n // Insert nodes in batches.\n let start = null;\n let end = position;\n for (const { nodes, breakAttributes } of nodeGroups) {\n const range = this._insertNodes(end, nodes, breakAttributes);\n if (!start) {\n start = range.start;\n }\n end = range.end;\n }\n // When no nodes were inserted - return collapsed range.\n if (!start) {\n return new Range(position);\n }\n return new Range(start, end);\n }\n /**\n * Removes provided range from the container.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside\n * same parent container.\n *\n * @param rangeOrItem Range to remove from container\n * or an {@link module:engine/view/item~Item item} to remove. If range is provided, after removing, it will be updated\n * to a collapsed range showing the new position.\n * @returns Document fragment containing removed nodes.\n */\n remove(rangeOrItem) {\n const range = rangeOrItem instanceof Range ? rangeOrItem : Range._createOn(rangeOrItem);\n validateRangeContainer(range, this.document);\n // If range is collapsed - nothing to remove.\n if (range.isCollapsed) {\n return new DocumentFragment(this.document);\n }\n // Break attributes at range start and end.\n const { start: breakStart, end: breakEnd } = this._breakAttributesRange(range, true);\n const parentContainer = breakStart.parent;\n const count = breakEnd.offset - breakStart.offset;\n // Remove nodes in range.\n const removed = parentContainer._removeChildren(breakStart.offset, count);\n for (const node of removed) {\n this._removeFromClonedElementsGroup(node);\n }\n // Merge after removing.\n const mergePosition = this.mergeAttributes(breakStart);\n range.start = mergePosition;\n range.end = mergePosition.clone();\n // Return removed nodes.\n return new DocumentFragment(this.document, removed);\n }\n /**\n * Removes matching elements from given range.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside\n * same parent container.\n *\n * @param range Range to clear.\n * @param element Element to remove.\n */\n clear(range, element) {\n validateRangeContainer(range, this.document);\n // Create walker on given range.\n // We walk backward because when we remove element during walk it modifies range end position.\n const walker = range.getWalker({\n direction: 'backward',\n ignoreElementEnd: true\n });\n // Let's walk.\n for (const current of walker) {\n const item = current.item;\n let rangeToRemove;\n // When current item matches to the given element.\n if (item.is('element') && element.isSimilar(item)) {\n // Create range on this element.\n rangeToRemove = Range._createOn(item);\n // When range starts inside Text or TextProxy element.\n }\n else if (!current.nextPosition.isAfter(range.start) && item.is('$textProxy')) {\n // We need to check if parent of this text matches to given element.\n const parentElement = item.getAncestors().find(ancestor => {\n return ancestor.is('element') && element.isSimilar(ancestor);\n });\n // If it is then create range inside this element.\n if (parentElement) {\n rangeToRemove = Range._createIn(parentElement);\n }\n }\n // If we have found element to remove.\n if (rangeToRemove) {\n // We need to check if element range stick out of the given range and truncate if it is.\n if (rangeToRemove.end.isAfter(range.end)) {\n rangeToRemove.end = range.end;\n }\n if (rangeToRemove.start.isBefore(range.start)) {\n rangeToRemove.start = range.start;\n }\n // At the end we remove range with found element.\n this.remove(rangeToRemove);\n }\n }\n }\n /**\n * Moves nodes from provided range to target position.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside\n * same parent container.\n *\n * @param sourceRange Range containing nodes to move.\n * @param targetPosition Position to insert.\n * @returns Range in target container. Inserted nodes are placed between\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions.\n */\n move(sourceRange, targetPosition) {\n let nodes;\n if (targetPosition.isAfter(sourceRange.end)) {\n targetPosition = this._breakAttributes(targetPosition, true);\n const parent = targetPosition.parent;\n const countBefore = parent.childCount;\n sourceRange = this._breakAttributesRange(sourceRange, true);\n nodes = this.remove(sourceRange);\n targetPosition.offset += (parent.childCount - countBefore);\n }\n else {\n nodes = this.remove(sourceRange);\n }\n return this.insert(targetPosition, nodes);\n }\n /**\n * Wraps elements within range with provided {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n * If a collapsed range is provided, it will be wrapped only if it is equal to view selection.\n *\n * If a collapsed range was passed and is same as selection, the selection\n * will be moved to the inside of the wrapped attribute element.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-invalid-range-container`\n * when {@link module:engine/view/range~Range#start}\n * and {@link module:engine/view/range~Range#end} positions are not placed inside same parent container.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not\n * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-nonselection-collapsed-range` when passed range\n * is collapsed and different than view selection.\n *\n * @param range Range to wrap.\n * @param attribute Attribute element to use as wrapper.\n * @returns range Range after wrapping, spanning over wrapping attribute element.\n */\n wrap(range, attribute) {\n if (!(attribute instanceof AttributeElement)) {\n throw new CKEditorError('view-writer-wrap-invalid-attribute', this.document);\n }\n validateRangeContainer(range, this.document);\n if (!range.isCollapsed) {\n // Non-collapsed range. Wrap it with the attribute element.\n return this._wrapRange(range, attribute);\n }\n else {\n // Collapsed range. Wrap position.\n let position = range.start;\n if (position.parent.is('element') && !_hasNonUiChildren(position.parent)) {\n position = position.getLastMatchingPosition(value => value.item.is('uiElement'));\n }\n position = this._wrapPosition(position, attribute);\n const viewSelection = this.document.selection;\n // If wrapping position is equal to view selection, move view selection inside wrapping attribute element.\n if (viewSelection.isCollapsed && viewSelection.getFirstPosition().isEqual(range.start)) {\n this.setSelection(position);\n }\n return new Range(position);\n }\n }\n /**\n * Unwraps nodes within provided range from attribute element.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when\n * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside\n * same parent container.\n */\n unwrap(range, attribute) {\n if (!(attribute instanceof AttributeElement)) {\n /**\n * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#unwrap `DowncastWriter#unwrap()`}\n * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.\n *\n * @error view-writer-unwrap-invalid-attribute\n */\n throw new CKEditorError('view-writer-unwrap-invalid-attribute', this.document);\n }\n validateRangeContainer(range, this.document);\n // If range is collapsed - nothing to unwrap.\n if (range.isCollapsed) {\n return range;\n }\n // Break attributes at range start and end.\n const { start: breakStart, end: breakEnd } = this._breakAttributesRange(range, true);\n const parentContainer = breakStart.parent;\n // Unwrap children located between break points.\n const newRange = this._unwrapChildren(parentContainer, breakStart.offset, breakEnd.offset, attribute);\n // Merge attributes at the both ends and return a new range.\n const start = this.mergeAttributes(newRange.start);\n // If start position was merged - move end position back.\n if (!start.isEqual(newRange.start)) {\n newRange.end.offset--;\n }\n const end = this.mergeAttributes(newRange.end);\n return new Range(start, end);\n }\n /**\n * Renames element by creating a copy of renamed element but with changed name and then moving contents of the\n * old element to the new one. Keep in mind that this will invalidate all {@link module:engine/view/position~Position positions} which\n * has renamed element as {@link module:engine/view/position~Position#parent a parent}.\n *\n * New element has to be created because `Element#tagName` property in DOM is readonly.\n *\n * Since this function creates a new element and removes the given one, the new element is returned to keep reference.\n *\n * @param newName New name for element.\n * @param viewElement Element to be renamed.\n * @returns Element created due to rename.\n */\n rename(newName, viewElement) {\n const newElement = new ContainerElement(this.document, newName, viewElement.getAttributes());\n this.insert(Position._createAfter(viewElement), newElement);\n this.move(Range._createIn(viewElement), Position._createAt(newElement, 0));\n this.remove(Range._createOn(viewElement));\n return newElement;\n }\n /**\n * Cleans up memory by removing obsolete cloned elements group from the writer.\n *\n * Should be used whenever all {@link module:engine/view/attributeelement~AttributeElement attribute elements}\n * with the same {@link module:engine/view/attributeelement~AttributeElement#id id} are going to be removed from the view and\n * the group will no longer be needed.\n *\n * Cloned elements group are not removed automatically in case if the group is still needed after all its elements\n * were removed from the view.\n *\n * Keep in mind that group names are equal to the `id` property of the attribute element.\n *\n * @param groupName Name of the group to clear.\n */\n clearClonedElementsGroup(groupName) {\n this._cloneGroups.delete(groupName);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link #createPositionBefore},\n * * {@link #createPositionAfter},\n *\n * @param offset Offset or one of the flags. Used only when the first parameter is a {@link module:engine/view/item~Item view item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return Position._createAt(itemOrPosition, offset);\n }\n /**\n * Creates a new position after given view item.\n *\n * @param item View item after which the position should be located.\n */\n createPositionAfter(item) {\n return Position._createAfter(item);\n }\n /**\n * Creates a new position before given view item.\n *\n * @param item View item before which the position should be located.\n */\n createPositionBefore(item) {\n return Position._createBefore(item);\n }\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * **Note:** This factory method creates its own {@link module:engine/view/position~Position} instances basing on passed values.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at `start` position.\n */\n createRange(start, end) {\n return new Range(start, end);\n }\n /**\n * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n */\n createRangeOn(item) {\n return Range._createOn(item);\n }\n /**\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return Range._createIn(element);\n }\n createSelection(...args) {\n return new Selection(...args);\n }\n /**\n * Creates placeholders for child elements of the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure\n * `elementToStructure()`} conversion helper.\n *\n * ```ts\n * const viewSlot = conversionApi.writer.createSlot();\n * const viewPosition = conversionApi.writer.createPositionAt( viewElement, 0 );\n *\n * conversionApi.writer.insert( viewPosition, viewSlot );\n * ```\n *\n * It could be filtered down to a specific subset of children (only `<foo>` model elements in this case):\n *\n * ```ts\n * const viewSlot = conversionApi.writer.createSlot( node => node.is( 'element', 'foo' ) );\n * const viewPosition = conversionApi.writer.createPositionAt( viewElement, 0 );\n *\n * conversionApi.writer.insert( viewPosition, viewSlot );\n * ```\n *\n * While providing a filtered slot, make sure to provide slots for all child nodes. A single node can not be downcasted into\n * multiple slots.\n *\n * **Note**: You should not change the order of nodes. View elements should be in the same order as model nodes.\n *\n * @param modeOrFilter The filter for child nodes.\n * @returns The slot element to be placed in to the view structure while processing\n * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure `elementToStructure()`}.\n */\n createSlot(modeOrFilter = 'children') {\n if (!this._slotFactory) {\n /**\n * The `createSlot()` method is only allowed inside the `elementToStructure` downcast helper callback.\n *\n * @error view-writer-invalid-create-slot-context\n */\n throw new CKEditorError('view-writer-invalid-create-slot-context', this.document);\n }\n return this._slotFactory(this, modeOrFilter);\n }\n /**\n * Registers a slot factory.\n *\n * @internal\n * @param slotFactory The slot factory.\n */\n _registerSlotFactory(slotFactory) {\n this._slotFactory = slotFactory;\n }\n /**\n * Clears the registered slot factory.\n *\n * @internal\n */\n _clearSlotFactory() {\n this._slotFactory = null;\n }\n /**\n * Inserts a node or nodes at the specified position. Takes care of breaking attributes before insertion\n * and merging them afterwards if requested by the breakAttributes param.\n *\n * @param position Insertion position.\n * @param nodes Node or nodes to insert.\n * @param breakAttributes Whether attributes should be broken.\n * @returns Range around inserted nodes.\n */\n _insertNodes(position, nodes, breakAttributes) {\n let parentElement;\n // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements\n // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.\n if (breakAttributes) {\n parentElement = getParentContainer(position);\n }\n else {\n parentElement = position.parent.is('$text') ? position.parent.parent : position.parent;\n }\n if (!parentElement) {\n /**\n * Position's parent container cannot be found.\n *\n * @error view-writer-invalid-position-container\n */\n throw new CKEditorError('view-writer-invalid-position-container', this.document);\n }\n let insertionPosition;\n if (breakAttributes) {\n insertionPosition = this._breakAttributes(position, true);\n }\n else {\n insertionPosition = position.parent.is('$text') ? breakTextNode(position) : position;\n }\n const length = parentElement._insertChild(insertionPosition.offset, nodes);\n for (const node of nodes) {\n this._addToClonedElementsGroup(node);\n }\n const endPosition = insertionPosition.getShiftedBy(length);\n const start = this.mergeAttributes(insertionPosition);\n // If start position was merged - move end position.\n if (!start.isEqual(insertionPosition)) {\n endPosition.offset--;\n }\n const end = this.mergeAttributes(endPosition);\n return new Range(start, end);\n }\n /**\n * Wraps children with provided `wrapElement`. Only children contained in `parent` element between\n * `startOffset` and `endOffset` will be wrapped.\n */\n _wrapChildren(parent, startOffset, endOffset, wrapElement) {\n let i = startOffset;\n const wrapPositions = [];\n while (i < endOffset) {\n const child = parent.getChild(i);\n const isText = child.is('$text');\n const isAttribute = child.is('attributeElement');\n //\n // (In all examples, assume that `wrapElement` is `<span class=\"foo\">` element.)\n //\n // Check if `wrapElement` can be joined with the wrapped element. One of requirements is having same name.\n // If possible, join elements.\n //\n // <p><span class=\"bar\">abc</span></p> --> <p><span class=\"foo bar\">abc</span></p>\n //\n if (isAttribute && this._wrapAttributeElement(wrapElement, child)) {\n wrapPositions.push(new Position(parent, i));\n }\n //\n // Wrap the child if it is not an attribute element or if it is an attribute element that should be inside\n // `wrapElement` (due to priority).\n //\n // <p>abc</p> --> <p><span class=\"foo\">abc</span></p>\n // <p><strong>abc</strong></p> --> <p><span class=\"foo\"><strong>abc</strong></span></p>\n else if (isText || !isAttribute || shouldABeOutsideB(wrapElement, child)) {\n // Clone attribute.\n const newAttribute = wrapElement._clone();\n // Wrap current node with new attribute.\n child._remove();\n newAttribute._appendChild(child);\n parent._insertChild(i, newAttribute);\n this._addToClonedElementsGroup(newAttribute);\n wrapPositions.push(new Position(parent, i));\n }\n //\n // If other nested attribute is found and it wasn't wrapped (see above), continue wrapping inside it.\n //\n // <p><a href=\"foo.html\">abc</a></p> --> <p><a href=\"foo.html\"><span class=\"foo\">abc</span></a></p>\n //\n else /* if ( isAttribute ) */ {\n this._wrapChildren(child, 0, child.childCount, wrapElement);\n }\n i++;\n }\n // Merge at each wrap.\n let offsetChange = 0;\n for (const position of wrapPositions) {\n position.offset -= offsetChange;\n // Do not merge with elements outside selected children.\n if (position.offset == startOffset) {\n continue;\n }\n const newPosition = this.mergeAttributes(position);\n // If nodes were merged - other merge offsets will change.\n if (!newPosition.isEqual(position)) {\n offsetChange++;\n endOffset--;\n }\n }\n return Range._createFromParentsAndOffsets(parent, startOffset, parent, endOffset);\n }\n /**\n * Unwraps children from provided `unwrapElement`. Only children contained in `parent` element between\n * `startOffset` and `endOffset` will be unwrapped.\n */\n _unwrapChildren(parent, startOffset, endOffset, unwrapElement) {\n let i = startOffset;\n const unwrapPositions = [];\n // Iterate over each element between provided offsets inside parent.\n // We don't use tree walker or range iterator because we will be removing and merging potentially multiple nodes,\n // so it could get messy. It is safer to it manually in this case.\n while (i < endOffset) {\n const child = parent.getChild(i);\n // Skip all text nodes. There should be no container element's here either.\n if (!child.is('attributeElement')) {\n i++;\n continue;\n }\n //\n // (In all examples, assume that `unwrapElement` is `<span class=\"foo\">` element.)\n //\n // If the child is similar to the given attribute element, unwrap it - it will be completely removed.\n //\n // <p><span class=\"foo\">abc</span>xyz</p> --> <p>abcxyz</p>\n //\n if (child.isSimilar(unwrapElement)) {\n const unwrapped = child.getChildren();\n const count = child.childCount;\n // Replace wrapper element with its children\n child._remove();\n parent._insertChild(i, unwrapped);\n this._removeFromClonedElementsGroup(child);\n // Save start and end position of moved items.\n unwrapPositions.push(new Position(parent, i), new Position(parent, i + count));\n // Skip elements that were unwrapped. Assuming there won't be another element to unwrap in child elements.\n i += count;\n endOffset += count - 1;\n continue;\n }\n //\n // If the child is not similar but is an attribute element, try partial unwrapping - remove the same attributes/styles/classes.\n // Partial unwrapping will happen only if the elements have the same name.\n //\n // <p><span class=\"foo bar\">abc</span>xyz</p> --> <p><span class=\"bar\">abc</span>xyz</p>\n // <p><i class=\"foo\">abc</i>xyz</p> --> <p><i class=\"foo\">abc</i>xyz</p>\n //\n if (this._unwrapAttributeElement(unwrapElement, child)) {\n unwrapPositions.push(new Position(parent, i), new Position(parent, i + 1));\n i++;\n continue;\n }\n //\n // If other nested attribute is found, look through it's children for elements to unwrap.\n //\n // <p><i><span class=\"foo\">abc</span></i><p> --> <p><i>abc</i><p>\n //\n this._unwrapChildren(child, 0, child.childCount, unwrapElement);\n i++;\n }\n // Merge at each unwrap.\n let offsetChange = 0;\n for (const position of unwrapPositions) {\n position.offset -= offsetChange;\n // Do not merge with elements outside selected children.\n if (position.offset == startOffset || position.offset == endOffset) {\n continue;\n }\n const newPosition = this.mergeAttributes(position);\n // If nodes were merged - other merge offsets will change.\n if (!newPosition.isEqual(position)) {\n offsetChange++;\n endOffset--;\n }\n }\n return Range._createFromParentsAndOffsets(parent, startOffset, parent, endOffset);\n }\n /**\n * Helper function for `view.writer.wrap`. Wraps range with provided attribute element.\n * This method will also merge newly added attribute element with its siblings whenever possible.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not\n * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * @returns New range after wrapping, spanning over wrapping attribute element.\n */\n _wrapRange(range, attribute) {\n // Break attributes at range start and end.\n const { start: breakStart, end: breakEnd } = this._breakAttributesRange(range, true);\n const parentContainer = breakStart.parent;\n // Wrap all children with attribute.\n const newRange = this._wrapChildren(parentContainer, breakStart.offset, breakEnd.offset, attribute);\n // Merge attributes at the both ends and return a new range.\n const start = this.mergeAttributes(newRange.start);\n // If start position was merged - move end position back.\n if (!start.isEqual(newRange.start)) {\n newRange.end.offset--;\n }\n const end = this.mergeAttributes(newRange.end);\n return new Range(start, end);\n }\n /**\n * Helper function for {@link #wrap}. Wraps position with provided attribute element.\n * This method will also merge newly added attribute element with its siblings whenever possible.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not\n * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * @returns New position after wrapping.\n */\n _wrapPosition(position, attribute) {\n // Return same position when trying to wrap with attribute similar to position parent.\n if (attribute.isSimilar(position.parent)) {\n return movePositionToTextNode(position.clone());\n }\n // When position is inside text node - break it and place new position between two text nodes.\n if (position.parent.is('$text')) {\n position = breakTextNode(position);\n }\n // Create fake element that will represent position, and will not be merged with other attributes.\n const fakeElement = this.createAttributeElement('_wrapPosition-fake-element');\n fakeElement._priority = Number.POSITIVE_INFINITY;\n fakeElement.isSimilar = () => false;\n // Insert fake element in position location.\n position.parent._insertChild(position.offset, fakeElement);\n // Range around inserted fake attribute element.\n const wrapRange = new Range(position, position.getShiftedBy(1));\n // Wrap fake element with attribute (it will also merge if possible).\n this.wrap(wrapRange, attribute);\n // Remove fake element and place new position there.\n const newPosition = new Position(fakeElement.parent, fakeElement.index);\n fakeElement._remove();\n // If position is placed between text nodes - merge them and return position inside.\n const nodeBefore = newPosition.nodeBefore;\n const nodeAfter = newPosition.nodeAfter;\n if (nodeBefore instanceof Text && nodeAfter instanceof Text) {\n return mergeTextNodes(nodeBefore, nodeAfter);\n }\n // If position is next to text node - move position inside.\n return movePositionToTextNode(newPosition);\n }\n /**\n * Wraps one {@link module:engine/view/attributeelement~AttributeElement AttributeElement} into another by\n * merging them if possible. When merging is possible - all attributes, styles and classes are moved from wrapper\n * element to element being wrapped.\n *\n * @param wrapper Wrapper AttributeElement.\n * @param toWrap AttributeElement to wrap using wrapper element.\n * @returns Returns `true` if elements are merged.\n */\n _wrapAttributeElement(wrapper, toWrap) {\n if (!canBeJoined(wrapper, toWrap)) {\n return false;\n }\n // Can't merge if name or priority differs.\n if (wrapper.name !== toWrap.name || wrapper.priority !== toWrap.priority) {\n return false;\n }\n // Check if attributes can be merged.\n for (const key of wrapper.getAttributeKeys()) {\n // Classes and styles should be checked separately.\n if (key === 'class' || key === 'style') {\n continue;\n }\n // If some attributes are different we cannot wrap.\n if (toWrap.hasAttribute(key) && toWrap.getAttribute(key) !== wrapper.getAttribute(key)) {\n return false;\n }\n }\n // Check if styles can be merged.\n for (const key of wrapper.getStyleNames()) {\n if (toWrap.hasStyle(key) && toWrap.getStyle(key) !== wrapper.getStyle(key)) {\n return false;\n }\n }\n // Move all attributes/classes/styles from wrapper to wrapped AttributeElement.\n for (const key of wrapper.getAttributeKeys()) {\n // Classes and styles should be checked separately.\n if (key === 'class' || key === 'style') {\n continue;\n }\n // Move only these attributes that are not present - other are similar.\n if (!toWrap.hasAttribute(key)) {\n this.setAttribute(key, wrapper.getAttribute(key), toWrap);\n }\n }\n for (const key of wrapper.getStyleNames()) {\n if (!toWrap.hasStyle(key)) {\n this.setStyle(key, wrapper.getStyle(key), toWrap);\n }\n }\n for (const key of wrapper.getClassNames()) {\n if (!toWrap.hasClass(key)) {\n this.addClass(key, toWrap);\n }\n }\n return true;\n }\n /**\n * Unwraps {@link module:engine/view/attributeelement~AttributeElement AttributeElement} from another by removing\n * corresponding attributes, classes and styles. All attributes, classes and styles from wrapper should be present\n * inside element being unwrapped.\n *\n * @param wrapper Wrapper AttributeElement.\n * @param toUnwrap AttributeElement to unwrap using wrapper element.\n * @returns Returns `true` if elements are unwrapped.\n **/\n _unwrapAttributeElement(wrapper, toUnwrap) {\n if (!canBeJoined(wrapper, toUnwrap)) {\n return false;\n }\n // Can't unwrap if name or priority differs.\n if (wrapper.name !== toUnwrap.name || wrapper.priority !== toUnwrap.priority) {\n return false;\n }\n // Check if AttributeElement has all wrapper attributes.\n for (const key of wrapper.getAttributeKeys()) {\n // Classes and styles should be checked separately.\n if (key === 'class' || key === 'style') {\n continue;\n }\n // If some attributes are missing or different we cannot unwrap.\n if (!toUnwrap.hasAttribute(key) || toUnwrap.getAttribute(key) !== wrapper.getAttribute(key)) {\n return false;\n }\n }\n // Check if AttributeElement has all wrapper classes.\n if (!toUnwrap.hasClass(...wrapper.getClassNames())) {\n return false;\n }\n // Check if AttributeElement has all wrapper styles.\n for (const key of wrapper.getStyleNames()) {\n // If some styles are missing or different we cannot unwrap.\n if (!toUnwrap.hasStyle(key) || toUnwrap.getStyle(key) !== wrapper.getStyle(key)) {\n return false;\n }\n }\n // Remove all wrapper's attributes from unwrapped element.\n for (const key of wrapper.getAttributeKeys()) {\n // Classes and styles should be checked separately.\n if (key === 'class' || key === 'style') {\n continue;\n }\n this.removeAttribute(key, toUnwrap);\n }\n // Remove all wrapper's classes from unwrapped element.\n this.removeClass(Array.from(wrapper.getClassNames()), toUnwrap);\n // Remove all wrapper's styles from unwrapped element.\n this.removeStyle(Array.from(wrapper.getStyleNames()), toUnwrap);\n return true;\n }\n /**\n * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at the boundaries of given range.\n *\n * @param range Range which `start` and `end` positions will be used to break attributes.\n * @param forceSplitText If set to `true`, will break text nodes even if they are directly in container element.\n * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.\n * @returns New range with located at break positions.\n */\n _breakAttributesRange(range, forceSplitText = false) {\n const rangeStart = range.start;\n const rangeEnd = range.end;\n validateRangeContainer(range, this.document);\n // Break at the collapsed position. Return new collapsed range.\n if (range.isCollapsed) {\n const position = this._breakAttributes(range.start, forceSplitText);\n return new Range(position, position);\n }\n const breakEnd = this._breakAttributes(rangeEnd, forceSplitText);\n const count = breakEnd.parent.childCount;\n const breakStart = this._breakAttributes(rangeStart, forceSplitText);\n // Calculate new break end offset.\n breakEnd.offset += breakEnd.parent.childCount - count;\n return new Range(breakStart, breakEnd);\n }\n /**\n * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at given position.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element` when break position\n * is placed inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element` when break position\n * is placed inside {@link module:engine/view/uielement~UIElement UIElement}.\n *\n * @param position Position where to break attributes.\n * @param forceSplitText If set to `true`, will break text nodes even if they are directly in container element.\n * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.\n * @returns New position after breaking the attributes.\n */\n _breakAttributes(position, forceSplitText = false) {\n const positionOffset = position.offset;\n const positionParent = position.parent;\n // If position is placed inside EmptyElement - throw an exception as we cannot break inside.\n if (position.parent.is('emptyElement')) {\n /**\n * Cannot break an `EmptyElement` instance.\n *\n * This error is thrown if\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}\n * was executed in an incorrect position.\n *\n * @error view-writer-cannot-break-empty-element\n */\n throw new CKEditorError('view-writer-cannot-break-empty-element', this.document);\n }\n // If position is placed inside UIElement - throw an exception as we cannot break inside.\n if (position.parent.is('uiElement')) {\n /**\n * Cannot break a `UIElement` instance.\n *\n * This error is thrown if\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}\n * was executed in an incorrect position.\n *\n * @error view-writer-cannot-break-ui-element\n */\n throw new CKEditorError('view-writer-cannot-break-ui-element', this.document);\n }\n // If position is placed inside RawElement - throw an exception as we cannot break inside.\n if (position.parent.is('rawElement')) {\n /**\n * Cannot break a `RawElement` instance.\n *\n * This error is thrown if\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}\n * was executed in an incorrect position.\n *\n * @error view-writer-cannot-break-raw-element\n */\n throw new CKEditorError('view-writer-cannot-break-raw-element', this.document);\n }\n // There are no attributes to break and text nodes breaking is not forced.\n if (!forceSplitText && positionParent.is('$text') && isContainerOrFragment(positionParent.parent)) {\n return position.clone();\n }\n // Position's parent is container, so no attributes to break.\n if (isContainerOrFragment(positionParent)) {\n return position.clone();\n }\n // Break text and start again in new position.\n if (positionParent.is('$text')) {\n return this._breakAttributes(breakTextNode(position), forceSplitText);\n }\n const length = positionParent.childCount;\n // <p>foo<b><u>bar{}</u></b></p>\n // <p>foo<b><u>bar</u>[]</b></p>\n // <p>foo<b><u>bar</u></b>[]</p>\n if (positionOffset == length) {\n const newPosition = new Position(positionParent.parent, positionParent.index + 1);\n return this._breakAttributes(newPosition, forceSplitText);\n }\n else {\n // <p>foo<b><u>{}bar</u></b></p>\n // <p>foo<b>[]<u>bar</u></b></p>\n // <p>foo{}<b><u>bar</u></b></p>\n if (positionOffset === 0) {\n const newPosition = new Position(positionParent.parent, positionParent.index);\n return this._breakAttributes(newPosition, forceSplitText);\n }\n // <p>foo<b><u>b{}ar</u></b></p>\n // <p>foo<b><u>b[]ar</u></b></p>\n // <p>foo<b><u>b</u>[]<u>ar</u></b></p>\n // <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>\n else {\n const offsetAfter = positionParent.index + 1;\n // Break element.\n const clonedNode = positionParent._clone();\n // Insert cloned node to position's parent node.\n positionParent.parent._insertChild(offsetAfter, clonedNode);\n this._addToClonedElementsGroup(clonedNode);\n // Get nodes to move.\n const count = positionParent.childCount - positionOffset;\n const nodesToMove = positionParent._removeChildren(positionOffset, count);\n // Move nodes to cloned node.\n clonedNode._appendChild(nodesToMove);\n // Create new position to work on.\n const newPosition = new Position(positionParent.parent, offsetAfter);\n return this._breakAttributes(newPosition, forceSplitText);\n }\n }\n }\n /**\n * Stores the information that an {@link module:engine/view/attributeelement~AttributeElement attribute element} was\n * added to the tree. Saves the reference to the group in the given element and updates the group, so other elements\n * from the group now keep a reference to the given attribute element.\n *\n * The clones group can be obtained using {@link module:engine/view/attributeelement~AttributeElement#getElementsWithSameId}.\n *\n * Does nothing if added element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.\n *\n * @param element Attribute element to save.\n */\n _addToClonedElementsGroup(element) {\n // Add only if the element is in document tree.\n if (!element.root.is('rootElement')) {\n return;\n }\n // Traverse the element's children recursively to find other attribute elements that also might got inserted.\n // The loop is at the beginning so we can make fast returns later in the code.\n if (element.is('element')) {\n for (const child of element.getChildren()) {\n this._addToClonedElementsGroup(child);\n }\n }\n const id = element.id;\n if (!id) {\n return;\n }\n let group = this._cloneGroups.get(id);\n if (!group) {\n group = new Set();\n this._cloneGroups.set(id, group);\n }\n group.add(element);\n element._clonesGroup = group;\n }\n /**\n * Removes all the information about the given {@link module:engine/view/attributeelement~AttributeElement attribute element}\n * from its clones group.\n *\n * Keep in mind, that the element will still keep a reference to the group (but the group will not keep a reference to it).\n * This allows to reference the whole group even if the element was already removed from the tree.\n *\n * Does nothing if the element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.\n *\n * @param element Attribute element to remove.\n */\n _removeFromClonedElementsGroup(element) {\n // Traverse the element's children recursively to find other attribute elements that also got removed.\n // The loop is at the beginning so we can make fast returns later in the code.\n if (element.is('element')) {\n for (const child of element.getChildren()) {\n this._removeFromClonedElementsGroup(child);\n }\n }\n const id = element.id;\n if (!id) {\n return;\n }\n const group = this._cloneGroups.get(id);\n if (!group) {\n return;\n }\n group.delete(element);\n // Not removing group from element on purpose!\n // If other parts of code have reference to this element, they will be able to get references to other elements from the group.\n }\n}\n// Helper function for `view.writer.wrap`. Checks if given element has any children that are not ui elements.\nfunction _hasNonUiChildren(parent) {\n return Array.from(parent.getChildren()).some(child => !child.is('uiElement'));\n}\n/**\n * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`}\n * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.\n *\n * @error view-writer-wrap-invalid-attribute\n */\n/**\n * Returns first parent container of specified {@link module:engine/view/position~Position Position}.\n * Position's parent node is checked as first, then next parents are checked.\n * Note that {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.\n *\n * @param position Position used as a start point to locate parent container.\n * @returns Parent container element or `undefined` if container is not found.\n */\nfunction getParentContainer(position) {\n let parent = position.parent;\n while (!isContainerOrFragment(parent)) {\n if (!parent) {\n return undefined;\n }\n parent = parent.parent;\n }\n return parent;\n}\n/**\n * Checks if first {@link module:engine/view/attributeelement~AttributeElement AttributeElement} provided to the function\n * can be wrapped outside second element. It is done by comparing elements'\n * {@link module:engine/view/attributeelement~AttributeElement#priority priorities}, if both have same priority\n * {@link module:engine/view/element~Element#getIdentity identities} are compared.\n */\nfunction shouldABeOutsideB(a, b) {\n if (a.priority < b.priority) {\n return true;\n }\n else if (a.priority > b.priority) {\n return false;\n }\n // When priorities are equal and names are different - use identities.\n return a.getIdentity() < b.getIdentity();\n}\n/**\n * Returns new position that is moved to near text node. Returns same position if there is no text node before of after\n * specified position.\n *\n * ```html\n * <p>foo[]</p> -> <p>foo{}</p>\n * <p>[]foo</p> -> <p>{}foo</p>\n * ```\n *\n * @returns Position located inside text node or same position if there is no text nodes\n * before or after position location.\n */\nfunction movePositionToTextNode(position) {\n const nodeBefore = position.nodeBefore;\n if (nodeBefore && nodeBefore.is('$text')) {\n return new Position(nodeBefore, nodeBefore.data.length);\n }\n const nodeAfter = position.nodeAfter;\n if (nodeAfter && nodeAfter.is('$text')) {\n return new Position(nodeAfter, 0);\n }\n return position;\n}\n/**\n * Breaks text node into two text nodes when possible.\n *\n * ```html\n * <p>foo{}bar</p> -> <p>foo[]bar</p>\n * <p>{}foobar</p> -> <p>[]foobar</p>\n * <p>foobar{}</p> -> <p>foobar[]</p>\n * ```\n *\n * @param position Position that need to be placed inside text node.\n * @returns New position after breaking text node.\n */\nfunction breakTextNode(position) {\n if (position.offset == position.parent.data.length) {\n return new Position(position.parent.parent, position.parent.index + 1);\n }\n if (position.offset === 0) {\n return new Position(position.parent.parent, position.parent.index);\n }\n // Get part of the text that need to be moved.\n const textToMove = position.parent.data.slice(position.offset);\n // Leave rest of the text in position's parent.\n position.parent._data = position.parent.data.slice(0, position.offset);\n // Insert new text node after position's parent text node.\n position.parent.parent._insertChild(position.parent.index + 1, new Text(position.root.document, textToMove));\n // Return new position between two newly created text nodes.\n return new Position(position.parent.parent, position.parent.index + 1);\n}\n/**\n * Merges two text nodes into first node. Removes second node and returns merge position.\n *\n * @param t1 First text node to merge. Data from second text node will be moved at the end of this text node.\n * @param t2 Second text node to merge. This node will be removed after merging.\n * @returns Position after merging text nodes.\n */\nfunction mergeTextNodes(t1, t2) {\n // Merge text data into first text node and remove second one.\n const nodeBeforeLength = t1.data.length;\n t1._data += t2.data;\n t2._remove();\n return new Position(t1, nodeBeforeLength);\n}\nconst validNodesToInsert = [Text, AttributeElement, ContainerElement, EmptyElement, RawElement, UIElement];\n/**\n * Checks if provided nodes are valid to insert.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert\n * contains instances that are not supported ones (see error description for valid ones.\n */\nfunction validateNodesToInsert(nodes, errorContext) {\n for (const node of nodes) {\n if (!validNodesToInsert.some((validNode => node instanceof validNode))) { // eslint-disable-line no-use-before-define\n /**\n * One of the nodes to be inserted is of an invalid type.\n *\n * Nodes to be inserted with {@link module:engine/view/downcastwriter~DowncastWriter#insert `DowncastWriter#insert()`} should be\n * of the following types:\n *\n * * {@link module:engine/view/attributeelement~AttributeElement AttributeElement},\n * * {@link module:engine/view/containerelement~ContainerElement ContainerElement},\n * * {@link module:engine/view/emptyelement~EmptyElement EmptyElement},\n * * {@link module:engine/view/uielement~UIElement UIElement},\n * * {@link module:engine/view/rawelement~RawElement RawElement},\n * * {@link module:engine/view/text~Text Text}.\n *\n * @error view-writer-insert-invalid-node-type\n */\n throw new CKEditorError('view-writer-insert-invalid-node-type', errorContext);\n }\n if (!node.is('$text')) {\n validateNodesToInsert(node.getChildren(), errorContext);\n }\n }\n}\n/**\n * Checks if node is ContainerElement or DocumentFragment, because in most cases they should be treated the same way.\n *\n * @returns Returns `true` if node is instance of ContainerElement or DocumentFragment.\n */\nfunction isContainerOrFragment(node) {\n return node && (node.is('containerElement') || node.is('documentFragment'));\n}\n/**\n * Checks if {@link module:engine/view/range~Range#start range start} and {@link module:engine/view/range~Range#end range end} are placed\n * inside same {@link module:engine/view/containerelement~ContainerElement container element}.\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when validation fails.\n */\nfunction validateRangeContainer(range, errorContext) {\n const startContainer = getParentContainer(range.start);\n const endContainer = getParentContainer(range.end);\n if (!startContainer || !endContainer || startContainer !== endContainer) {\n /**\n * The container of the given range is invalid.\n *\n * This may happen if {@link module:engine/view/range~Range#start range start} and\n * {@link module:engine/view/range~Range#end range end} positions are not placed inside the same container element or\n * a parent container for these positions cannot be found.\n *\n * Methods like {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#remove()`},\n * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#clean()`},\n * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`},\n * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#unwrap()`} need to be called\n * on a range that has its start and end positions located in the same container element. Both positions can be\n * nested within other elements (e.g. an attribute element) but the closest container ancestor must be the same.\n *\n * @error view-writer-invalid-range-container\n */\n throw new CKEditorError('view-writer-invalid-range-container', errorContext);\n }\n}\n/**\n * Checks if two attribute elements can be joined together. Elements can be joined together if, and only if\n * they do not have ids specified.\n */\nfunction canBeJoined(a, b) {\n return a.id === null && b.id === null;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { keyCodes, isText } from '@ckeditor/ckeditor5-utils';\n/**\n * Set of utilities related to handling block and inline fillers.\n *\n * Browsers do not allow to put caret in elements which does not have height. Because of it, we need to fill all\n * empty elements which should be selectable with elements or characters called \"fillers\". Unfortunately there is no one\n * universal filler, this is why two types are uses:\n *\n * * Block filler is an element which fill block elements, like `<p>`. CKEditor uses `<br>` as a block filler during the editing,\n * as browsers do natively. So instead of an empty `<p>` there will be `<p><br></p>`. The advantage of block filler is that\n * it is transparent for the selection, so when the caret is before the `<br>` and user presses right arrow he will be\n * moved to the next paragraph, not after the `<br>`. The disadvantage is that it breaks a block, so it can not be used\n * in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `<br>` filler} can be replaced with any other\n * character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space} or\n * {@link module:engine/view/filler~MARKED_NBSP_FILLER marked non-breaking space}.\n *\n * * Inline filler is a filler which does not break a line of text, so it can be used inside the text, for instance in the empty\n * `<b>` surrendered by text: `foo<b></b>bar`, if we want to put the caret there. CKEditor uses a sequence of the zero-width\n * spaces as an {@link module:engine/view/filler~INLINE_FILLER inline filler} having the predetermined\n * {@link module:engine/view/filler~INLINE_FILLER_LENGTH length}. A sequence is used, instead of a single character to\n * avoid treating random zero-width spaces as the inline filler. Disadvantage of the inline filler is that it is not\n * transparent for the selection. The arrow key moves the caret between zero-width spaces characters, so the additional\n * code is needed to handle the caret.\n *\n * Both inline and block fillers are handled by the {@link module:engine/view/renderer~Renderer renderer} and are not present in the\n * view.\n *\n * @module engine/view/filler\n */\n/**\n * Non-breaking space filler creator. This function creates the ` ` text node.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~MARKED_NBSP_FILLER\n * @see module:engine/view/filler~BR_FILLER\n */\nexport const NBSP_FILLER = (domDocument) => domDocument.createTextNode('\\u00A0');\n/**\n * Marked non-breaking space filler creator. This function creates the `<span data-cke-filler=\"true\"> </span>` element.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~NBSP_FILLER\n * @see module:engine/view/filler~BR_FILLER\n */\nexport const MARKED_NBSP_FILLER = (domDocument) => {\n const span = domDocument.createElement('span');\n span.dataset.ckeFiller = 'true';\n span.innerText = '\\u00A0';\n return span;\n};\n/**\n * `<br>` filler creator. This function creates the `<br data-cke-filler=\"true\">` element.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~NBSP_FILLER\n * @see module:engine/view/filler~MARKED_NBSP_FILLER\n */\nexport const BR_FILLER = (domDocument) => {\n const fillerBr = domDocument.createElement('br');\n fillerBr.dataset.ckeFiller = 'true';\n return fillerBr;\n};\n/**\n * Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.\n */\nexport const INLINE_FILLER_LENGTH = 7;\n/**\n * Inline filler which is a sequence of the word joiners.\n */\nexport const INLINE_FILLER = '\\u2060'.repeat(INLINE_FILLER_LENGTH);\n/**\n * Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n *\n * ```ts\n * startsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true\n * startsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true\n * startsWithFiller( document.createTextNode( 'foo' ) ); // false\n * startsWithFiller( document.createElement( 'p' ) ); // false\n * ```\n *\n * @param domNode DOM node.\n * @returns True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function startsWithFiller(domNode) {\n if (typeof domNode == 'string') {\n return domNode.substr(0, INLINE_FILLER_LENGTH) === INLINE_FILLER;\n }\n return isText(domNode) && (domNode.data.substr(0, INLINE_FILLER_LENGTH) === INLINE_FILLER);\n}\n/**\n * Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n *\n * ```ts\n * isInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true\n * isInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false\n * ```\n *\n * @param domText DOM text node.\n * @returns True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function isInlineFiller(domText) {\n return domText.data.length == INLINE_FILLER_LENGTH && startsWithFiller(domText);\n}\n/**\n * Get string data from the text node, removing an {@link module:engine/view/filler~INLINE_FILLER inline filler} from it,\n * if text node contains it.\n *\n * ```ts\n * getDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true\n * getDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true\n * ```\n *\n * @param domText DOM text node, possible with inline filler.\n * @returns Data without filler.\n */\nexport function getDataWithoutFiller(domText) {\n const data = typeof domText == 'string' ? domText : domText.data;\n if (startsWithFiller(domText)) {\n return data.slice(INLINE_FILLER_LENGTH);\n }\n return data;\n}\n/**\n * Assign key observer which move cursor from the end of the inline filler to the beginning of it when\n * the left arrow is pressed, so the filler does not break navigation.\n *\n * @param view View controller instance we should inject quirks handling on.\n */\nexport function injectQuirksHandling(view) {\n view.document.on('arrowKey', jumpOverInlineFiller, { priority: 'low' });\n}\n/**\n * Move cursor from the end of the inline filler to the beginning of it when, so the filler does not break navigation.\n */\nfunction jumpOverInlineFiller(evt, data) {\n if (data.keyCode == keyCodes.arrowleft) {\n const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();\n if (domSelection.rangeCount == 1 && domSelection.getRangeAt(0).collapsed) {\n const domParent = domSelection.getRangeAt(0).startContainer;\n const domOffset = domSelection.getRangeAt(0).startOffset;\n if (startsWithFiller(domParent) && domOffset <= INLINE_FILLER_LENGTH) {\n domSelection.collapse(domParent, 0);\n }\n }\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./renderer.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./renderer.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/renderer\n */\nimport ViewText from './text.js';\nimport ViewPosition from './position.js';\nimport { INLINE_FILLER, INLINE_FILLER_LENGTH, startsWithFiller, isInlineFiller } from './filler.js';\nimport { CKEditorError, ObservableMixin, diff, env, fastDiff, insertAt, isComment, isNode, isText, remove, indexOf } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/renderer.css';\n/**\n * Renderer is responsible for updating the DOM structure and the DOM selection based on\n * the {@link module:engine/view/renderer~Renderer#markToSync information about updated view nodes}.\n * In other words, it renders the view to the DOM.\n *\n * Its main responsibility is to make only the necessary, minimal changes to the DOM. However, unlike in many\n * virtual DOM implementations, the primary reason for doing minimal changes is not the performance but ensuring\n * that native editing features such as text composition, autocompletion, spell checking, selection's x-index are\n * affected as little as possible.\n *\n * Renderer uses {@link module:engine/view/domconverter~DomConverter} to transform view nodes and positions\n * to and from the DOM.\n */\nexport default class Renderer extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a renderer instance.\n *\n * @param domConverter Converter instance.\n * @param selection View selection.\n */\n constructor(domConverter, selection) {\n super();\n /**\n * Set of DOM Documents instances.\n */\n this.domDocuments = new Set();\n /**\n * Set of nodes which attributes changed and may need to be rendered.\n */\n this.markedAttributes = new Set();\n /**\n * Set of elements which child lists changed and may need to be rendered.\n */\n this.markedChildren = new Set();\n /**\n * Set of text nodes which text data changed and may need to be rendered.\n */\n this.markedTexts = new Set();\n /**\n * The text node in which the inline filler was rendered.\n */\n this._inlineFiller = null;\n /**\n * DOM element containing fake selection.\n */\n this._fakeSelectionContainer = null;\n this.domConverter = domConverter;\n this.selection = selection;\n this.set('isFocused', false);\n this.set('isSelecting', false);\n this.set('isComposing', false);\n // Rendering the selection and inline filler manipulation should be postponed in (non-Android) Blink until the user finishes\n // creating the selection in DOM to avoid accidental selection collapsing\n // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).\n // When the user stops selecting, all pending changes should be rendered ASAP, though.\n if (env.isBlink && !env.isAndroid) {\n this.on('change:isSelecting', () => {\n if (!this.isSelecting) {\n this.render();\n }\n });\n }\n }\n /**\n * Marks a view node to be updated in the DOM by {@link #render `render()`}.\n *\n * Note that only view nodes whose parents have corresponding DOM elements need to be marked to be synchronized.\n *\n * @see #markedAttributes\n * @see #markedChildren\n * @see #markedTexts\n *\n * @param type Type of the change.\n * @param node ViewNode to be marked.\n */\n markToSync(type, node) {\n if (type === 'text') {\n if (this.domConverter.mapViewToDom(node.parent)) {\n this.markedTexts.add(node);\n }\n }\n else {\n // If the node has no DOM element it is not rendered yet,\n // its children/attributes do not need to be marked to be sync.\n if (!this.domConverter.mapViewToDom(node)) {\n return;\n }\n if (type === 'attributes') {\n this.markedAttributes.add(node);\n }\n else if (type === 'children') {\n this.markedChildren.add(node);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const unreachable = type;\n /**\n * Unknown type passed to Renderer.markToSync.\n *\n * @error view-renderer-unknown-type\n */\n throw new CKEditorError('view-renderer-unknown-type', this);\n }\n }\n }\n /**\n * Renders all buffered changes ({@link #markedAttributes}, {@link #markedChildren} and {@link #markedTexts}) and\n * the current view selection (if needed) to the DOM by applying a minimal set of changes to it.\n *\n * Renderer tries not to break the text composition (e.g. IME) and x-index of the selection,\n * so it does as little as it is needed to update the DOM.\n *\n * Renderer also handles {@link module:engine/view/filler fillers}. Especially, it checks if the inline filler is needed\n * at the selection position and adds or removes it. To prevent breaking text composition inline filler will not be\n * removed as long as the selection is in the text node which needed it at first.\n */\n render() {\n // Ignore rendering while in the composition mode. Composition events are not cancellable and browser will modify the DOM tree.\n // All marked elements, attributes, etc. will wait until next render after the composition ends.\n // On Android composition events are immediately applied to the model, so we don't need to skip rendering,\n // and we should not do it because the difference between view and DOM could lead to position mapping problems.\n if (this.isComposing && !env.isAndroid) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Rendering aborted while isComposing.',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-style: italic'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Renderer]%c Rendering',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-weight: bold'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n let inlineFillerPosition = null;\n const isInlineFillerRenderingPossible = env.isBlink && !env.isAndroid ? !this.isSelecting : true;\n // Refresh mappings.\n for (const element of this.markedChildren) {\n this._updateChildrenMappings(element);\n }\n // Don't manipulate inline fillers while the selection is being made in (non-Android) Blink to prevent accidental\n // DOM selection collapsing\n // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).\n if (isInlineFillerRenderingPossible) {\n // There was inline filler rendered in the DOM but it's not\n // at the selection position any more, so we can remove it\n // (cause even if it's needed, it must be placed in another location).\n if (this._inlineFiller && !this._isSelectionInInlineFiller()) {\n this._removeInlineFiller();\n }\n // If we've got the filler, let's try to guess its position in the view.\n if (this._inlineFiller) {\n inlineFillerPosition = this._getInlineFillerPosition();\n }\n // Otherwise, if it's needed, create it at the selection position.\n else if (this._needsInlineFillerAtSelection()) {\n inlineFillerPosition = this.selection.getFirstPosition();\n // Do not use `markToSync` so it will be added even if the parent is already added.\n this.markedChildren.add(inlineFillerPosition.parent);\n }\n }\n // Make sure the inline filler has any parent, so it can be mapped to view position by DomConverter.\n else if (this._inlineFiller && this._inlineFiller.parentNode) {\n // While the user is making selection, preserve the inline filler at its original position.\n inlineFillerPosition = this.domConverter.domPositionToView(this._inlineFiller);\n // While down-casting the document selection attributes, all existing empty\n // attribute elements (for selection position) are removed from the view and DOM,\n // so make sure that we were able to map filler position.\n // https://github.com/ckeditor/ckeditor5/issues/12026\n if (inlineFillerPosition && inlineFillerPosition.parent.is('$text')) {\n // The inline filler position is expected to be before the text node.\n inlineFillerPosition = ViewPosition._createBefore(inlineFillerPosition.parent);\n }\n }\n for (const element of this.markedAttributes) {\n this._updateAttrs(element);\n }\n for (const element of this.markedChildren) {\n this._updateChildren(element, { inlineFillerPosition });\n }\n for (const node of this.markedTexts) {\n if (!this.markedChildren.has(node.parent) && this.domConverter.mapViewToDom(node.parent)) {\n this._updateText(node, { inlineFillerPosition });\n }\n }\n // * Check whether the inline filler is required and where it really is in the DOM.\n // At this point in most cases it will be in the DOM, but there are exceptions.\n // For example, if the inline filler was deep in the created DOM structure, it will not be created.\n // Similarly, if it was removed at the beginning of this function and then neither text nor children were updated,\n // it will not be present. Fix those and similar scenarios.\n // * Don't manipulate inline fillers while the selection is being made in (non-Android) Blink to prevent accidental\n // DOM selection collapsing\n // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).\n if (isInlineFillerRenderingPossible) {\n if (inlineFillerPosition) {\n const fillerDomPosition = this.domConverter.viewPositionToDom(inlineFillerPosition);\n const domDocument = fillerDomPosition.parent.ownerDocument;\n if (!startsWithFiller(fillerDomPosition.parent)) {\n // Filler has not been created at filler position. Create it now.\n this._inlineFiller = addInlineFiller(domDocument, fillerDomPosition.parent, fillerDomPosition.offset);\n }\n else {\n // Filler has been found, save it.\n this._inlineFiller = fillerDomPosition.parent;\n }\n }\n else {\n // There is no filler needed.\n this._inlineFiller = null;\n }\n }\n // First focus the new editing host, then update the selection.\n // Otherwise, FF may throw an error (https://github.com/ckeditor/ckeditor5/issues/721).\n this._updateFocus();\n this._updateSelection();\n this.domConverter._clearTemporaryCustomProperties();\n this.markedTexts.clear();\n this.markedAttributes.clear();\n this.markedChildren.clear();\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n /**\n * Updates mappings of view element's children.\n *\n * Children that were replaced in the view structure by similar elements (same tag name) are treated as 'replaced'.\n * This means that their mappings can be updated so the new view elements are mapped to the existing DOM elements.\n * Thanks to that these elements do not need to be re-rendered completely.\n *\n * @param viewElement The view element whose children mappings will be updated.\n */\n _updateChildrenMappings(viewElement) {\n const domElement = this.domConverter.mapViewToDom(viewElement);\n if (!domElement) {\n // If there is no `domElement` it means that it was already removed from DOM and there is no need to process it.\n return;\n }\n // Removing nodes from the DOM as we iterate can cause `actualDomChildren`\n // (which is a live-updating `NodeList`) to get out of sync with the\n // indices that we compute as we iterate over `actions`.\n // This would produce incorrect element mappings.\n //\n // Converting live list to an array to make the list static.\n const actualDomChildren = Array.from(domElement.childNodes);\n const expectedDomChildren = Array.from(this.domConverter.viewChildrenToDom(viewElement, { withChildren: false }));\n const diff = this._diffNodeLists(actualDomChildren, expectedDomChildren);\n const actions = this._findUpdateActions(diff, actualDomChildren, expectedDomChildren, areSimilarElements);\n if (actions.indexOf('update') !== -1) {\n const counter = { equal: 0, insert: 0, delete: 0 };\n for (const action of actions) {\n if (action === 'update') {\n const insertIndex = counter.equal + counter.insert;\n const deleteIndex = counter.equal + counter.delete;\n const viewChild = viewElement.getChild(insertIndex);\n // UIElement and RawElement are special cases. Their children are not stored in a view (#799)\n // so we cannot use them with replacing flow (since they use view children during rendering\n // which will always result in rendering empty elements).\n if (viewChild && !viewChild.is('uiElement') && !viewChild.is('rawElement')) {\n this._updateElementMappings(viewChild, actualDomChildren[deleteIndex]);\n }\n remove(expectedDomChildren[insertIndex]);\n counter.equal++;\n }\n else {\n counter[action]++;\n }\n }\n }\n }\n /**\n * Updates mappings of a given view element.\n *\n * @param viewElement The view element whose mappings will be updated.\n * @param domElement The DOM element representing the given view element.\n */\n _updateElementMappings(viewElement, domElement) {\n // Remap 'DomConverter' bindings.\n this.domConverter.unbindDomElement(domElement);\n this.domConverter.bindElements(domElement, viewElement);\n // View element may have children which needs to be updated, but are not marked, mark them to update.\n this.markedChildren.add(viewElement);\n // Because we replace new view element mapping with the existing one, the corresponding DOM element\n // will not be rerendered. The new view element may have different attributes than the previous one.\n // Since its corresponding DOM element will not be rerendered, new attributes will not be added\n // to the DOM, so we need to mark it here to make sure its attributes gets updated. See #1427 for more\n // detailed case study.\n // Also there are cases where replaced element is removed from the view structure and then has\n // its attributes changed or removed. In such cases the element will not be present in `markedAttributes`\n // and also may be the same (`element.isSimilar()`) as the reused element not having its attributes updated.\n // To prevent such situations we always mark reused element to have its attributes rerenderd (#1560).\n this.markedAttributes.add(viewElement);\n }\n /**\n * Gets the position of the inline filler based on the current selection.\n * Here, we assume that we know that the filler is needed and\n * {@link #_isSelectionInInlineFiller is at the selection position}, and, since it is needed,\n * it is somewhere at the selection position.\n *\n * Note: The filler position cannot be restored based on the filler's DOM text node, because\n * when this method is called (before rendering), the bindings will often be broken. View-to-DOM\n * bindings are only dependable after rendering.\n */\n _getInlineFillerPosition() {\n const firstPos = this.selection.getFirstPosition();\n if (firstPos.parent.is('$text')) {\n return ViewPosition._createBefore(firstPos.parent);\n }\n else {\n return firstPos;\n }\n }\n /**\n * Returns `true` if the selection has not left the inline filler's text node.\n * If it is `true`, it means that the filler had been added for a reason and the selection did not\n * leave the filler's text node. For example, the user can be in the middle of a composition so it should not be touched.\n *\n * @returns `true` if the inline filler and selection are in the same place.\n */\n _isSelectionInInlineFiller() {\n if (this.selection.rangeCount != 1 || !this.selection.isCollapsed) {\n return false;\n }\n // Note, we can't check if selection's position equals position of the\n // this._inlineFiller node, because of #663. We may not be able to calculate\n // the filler's position in the view at this stage.\n // Instead, we check it the other way – whether selection is anchored in\n // that text node or next to it.\n // Possible options are:\n // \"FILLER{}\"\n // \"FILLERadded-text{}\"\n const selectionPosition = this.selection.getFirstPosition();\n const position = this.domConverter.viewPositionToDom(selectionPosition);\n if (position && isText(position.parent) && startsWithFiller(position.parent)) {\n return true;\n }\n return false;\n }\n /**\n * Removes the inline filler.\n */\n _removeInlineFiller() {\n const domFillerNode = this._inlineFiller;\n // Something weird happened and the stored node doesn't contain the filler's text.\n if (!startsWithFiller(domFillerNode)) {\n /**\n * The inline filler node was lost. Most likely, something overwrote the filler text node\n * in the DOM.\n *\n * @error view-renderer-filler-was-lost\n */\n throw new CKEditorError('view-renderer-filler-was-lost', this);\n }\n if (isInlineFiller(domFillerNode)) {\n domFillerNode.remove();\n }\n else {\n domFillerNode.data = domFillerNode.data.substr(INLINE_FILLER_LENGTH);\n }\n this._inlineFiller = null;\n }\n /**\n * Checks if the inline {@link module:engine/view/filler filler} should be added.\n *\n * @returns `true` if the inline filler should be added.\n */\n _needsInlineFillerAtSelection() {\n if (this.selection.rangeCount != 1 || !this.selection.isCollapsed) {\n return false;\n }\n const selectionPosition = this.selection.getFirstPosition();\n const selectionParent = selectionPosition.parent;\n const selectionOffset = selectionPosition.offset;\n // If there is no DOM root we do not care about fillers.\n if (!this.domConverter.mapViewToDom(selectionParent.root)) {\n return false;\n }\n if (!(selectionParent.is('element'))) {\n return false;\n }\n // Prevent adding inline filler inside elements with contenteditable=false.\n // https://github.com/ckeditor/ckeditor5-engine/issues/1170\n if (!isEditable(selectionParent)) {\n return false;\n }\n const nodeBefore = selectionPosition.nodeBefore;\n const nodeAfter = selectionPosition.nodeAfter;\n if (nodeBefore instanceof ViewText || nodeAfter instanceof ViewText) {\n return false;\n }\n // We have block filler, we do not need inline one.\n if (selectionOffset === selectionParent.getFillerOffset() && (!nodeBefore || !nodeBefore.is('element', 'br'))) {\n return false;\n }\n // Do not use inline filler while typing outside inline elements on Android.\n // The deleteContentBackward would remove part of the inline filler instead of removing last letter in a link.\n if (env.isAndroid && (nodeBefore || nodeAfter)) {\n return false;\n }\n return true;\n }\n /**\n * Checks if text needs to be updated and possibly updates it.\n *\n * @param viewText View text to update.\n * @param options.inlineFillerPosition The position where the inline filler should be rendered.\n */\n _updateText(viewText, options) {\n const domText = this.domConverter.findCorrespondingDomText(viewText);\n const newDomText = this.domConverter.viewToDom(viewText);\n let expectedText = newDomText.data;\n const filler = options.inlineFillerPosition;\n if (filler && filler.parent == viewText.parent && filler.offset == viewText.index) {\n expectedText = INLINE_FILLER + expectedText;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Renderer]%c Update text',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-weight: normal'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n this._updateTextNode(domText, expectedText);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n /**\n * Checks if attribute list needs to be updated and possibly updates it.\n *\n * @param viewElement The view element to update.\n */\n _updateAttrs(viewElement) {\n const domElement = this.domConverter.mapViewToDom(viewElement);\n if (!domElement) {\n // If there is no `domElement` it means that 'viewElement' is outdated as its mapping was updated\n // in 'this._updateChildrenMappings()'. There is no need to process it as new view element which\n // replaced old 'viewElement' mapping was also added to 'this.markedAttributes'\n // in 'this._updateChildrenMappings()' so it will be processed separately.\n return;\n }\n const domAttrKeys = Array.from(domElement.attributes).map(attr => attr.name);\n const viewAttrKeys = viewElement.getAttributeKeys();\n // Add or overwrite attributes.\n for (const key of viewAttrKeys) {\n this.domConverter.setDomElementAttribute(domElement, key, viewElement.getAttribute(key), viewElement);\n }\n // Remove from DOM attributes which do not exists in the view.\n for (const key of domAttrKeys) {\n // All other attributes not present in the DOM should be removed.\n if (!viewElement.hasAttribute(key)) {\n this.domConverter.removeDomElementAttribute(domElement, key);\n }\n }\n }\n /**\n * Checks if elements child list needs to be updated and possibly updates it.\n *\n * Note that on Android, to reduce the risk of composition breaks, it tries to update data of an existing\n * child text nodes instead of replacing them completely.\n *\n * @param viewElement View element to update.\n * @param options.inlineFillerPosition The position where the inline filler should be rendered.\n */\n _updateChildren(viewElement, options) {\n const domElement = this.domConverter.mapViewToDom(viewElement);\n if (!domElement) {\n // If there is no `domElement` it means that it was already removed from DOM.\n // There is no need to process it. It will be processed when re-inserted.\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Renderer]%c Update children',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-weight: normal'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // IME on Android inserts a new text node while typing after a link\n // instead of updating an existing text node that follows the link.\n // We must normalize those text nodes so the diff won't get confused.\n // https://github.com/ckeditor/ckeditor5/issues/12574.\n if (env.isAndroid) {\n let previousDomNode = null;\n for (const domNode of Array.from(domElement.childNodes)) {\n if (previousDomNode && isText(previousDomNode) && isText(domNode)) {\n domElement.normalize();\n break;\n }\n previousDomNode = domNode;\n }\n }\n const inlineFillerPosition = options.inlineFillerPosition;\n const actualDomChildren = domElement.childNodes;\n const expectedDomChildren = Array.from(this.domConverter.viewChildrenToDom(viewElement, { bind: true }));\n // Inline filler element has to be created as it is present in the DOM, but not in the view. It is required\n // during diffing so text nodes could be compared correctly and also during rendering to maintain\n // proper order and indexes while updating the DOM.\n if (inlineFillerPosition && inlineFillerPosition.parent === viewElement) {\n addInlineFiller(domElement.ownerDocument, expectedDomChildren, inlineFillerPosition.offset);\n }\n const diff = this._diffNodeLists(actualDomChildren, expectedDomChildren);\n // We need to make sure that we update the existing text node and not replace it with another one.\n // The composition and different \"language\" browser extensions are fragile to text node being completely replaced.\n const actions = this._findUpdateActions(diff, actualDomChildren, expectedDomChildren, areTextNodes);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping && actions.every( a => a == 'equal' ) ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Nothing to update.',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-style: italic'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n let i = 0;\n const nodesToUnbind = new Set();\n // Handle deletions first.\n // This is to prevent a situation where an element that already exists in `actualDomChildren` is inserted at a different\n // index in `actualDomChildren`. Since `actualDomChildren` is a `NodeList`, this works like move, not like an insert,\n // and it disrupts the whole algorithm. See https://github.com/ckeditor/ckeditor5/issues/6367.\n //\n // It doesn't matter in what order we remove or add nodes, as long as we remove and add correct nodes at correct indexes.\n for (const action of actions) {\n if (action === 'delete') {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING //\tconst node = actualDomChildren[ i ];\n // @if CK_DEBUG_TYPING // \tif ( isText( node ) ) {\n // @if CK_DEBUG_TYPING // \t\tconsole.info( '%c[Renderer]%c Remove text node' +\n // @if CK_DEBUG_TYPING // \t\t\t`${ this.isComposing ? ' while composing (may break composition)' : '' }: ` +\n // @if CK_DEBUG_TYPING // \t\t\t`%c${ _escapeTextNodeData( node.data ) }%c (${ node.data.length })`,\n // @if CK_DEBUG_TYPING // \t\t\t'color: green; font-weight: bold',\n // @if CK_DEBUG_TYPING // \t\t\tthis.isComposing ? 'color: red; font-weight: bold' : '', 'color: blue', ''\n // @if CK_DEBUG_TYPING // \t\t);\n // @if CK_DEBUG_TYPING // \t} else {\n // @if CK_DEBUG_TYPING // \t\tconsole.info( '%c[Renderer]%c Remove element' +\n // @if CK_DEBUG_TYPING // \t\t\t`${ this.isComposing ? ' while composing (may break composition)' : '' }: `,\n // @if CK_DEBUG_TYPING // \t\t\t'color: green; font-weight: bold',\n // @if CK_DEBUG_TYPING // \t\t\tthis.isComposing ? 'color: red; font-weight: bold' : '',\n // @if CK_DEBUG_TYPING // \t\t\tnode\n // @if CK_DEBUG_TYPING // \t\t);\n // @if CK_DEBUG_TYPING // \t}\n // @if CK_DEBUG_TYPING // }\n nodesToUnbind.add(actualDomChildren[i]);\n remove(actualDomChildren[i]);\n }\n else if (action === 'equal' || action === 'update') {\n i++;\n }\n }\n i = 0;\n for (const action of actions) {\n if (action === 'insert') {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING //\tconst node = expectedDomChildren[ i ];\n // @if CK_DEBUG_TYPING //\tif ( isText( node ) ) {\n // @if CK_DEBUG_TYPING //\t\tconsole.info( '%c[Renderer]%c Insert text node' +\n // @if CK_DEBUG_TYPING //\t\t\t`${ this.isComposing ? ' while composing (may break composition)' : '' }: ` +\n // @if CK_DEBUG_TYPING //\t\t\t`%c${ _escapeTextNodeData( node.data ) }%c (${ node.data.length })`,\n // @if CK_DEBUG_TYPING //\t\t\t'color: green; font-weight: bold',\n // @if CK_DEBUG_TYPING //\t\t\tthis.isComposing ? 'color: red; font-weight: bold' : '',\n // @if CK_DEBUG_TYPING //\t\t\t'color: blue', ''\n // @if CK_DEBUG_TYPING //\t\t);\n // @if CK_DEBUG_TYPING //\t} else {\n // @if CK_DEBUG_TYPING //\t\tconsole.info( '%c[Renderer]%c Insert element:',\n // @if CK_DEBUG_TYPING //\t\t\t'color: green; font-weight: bold', 'font-weight: normal',\n // @if CK_DEBUG_TYPING //\t\t\tnode\n // @if CK_DEBUG_TYPING //\t\t);\n // @if CK_DEBUG_TYPING //\t}\n // @if CK_DEBUG_TYPING // }\n insertAt(domElement, i, expectedDomChildren[i]);\n i++;\n }\n // Update the existing text node data.\n else if (action === 'update') {\n this._updateTextNode(actualDomChildren[i], expectedDomChildren[i].data);\n i++;\n }\n else if (action === 'equal') {\n // Force updating text nodes inside elements which did not change and do not need to be re-rendered (#1125).\n // Do it here (not in the loop above) because only after insertions the `i` index is correct.\n this._markDescendantTextToSync(this.domConverter.domToView(expectedDomChildren[i]));\n i++;\n }\n }\n // Unbind removed nodes. When node does not have a parent it means that it was removed from DOM tree during\n // comparison with the expected DOM. We don't need to check child nodes, because if child node was reinserted,\n // it was moved to DOM tree out of the removed node.\n for (const node of nodesToUnbind) {\n if (!node.parentNode) {\n this.domConverter.unbindDomElement(node);\n }\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n /**\n * Shorthand for diffing two arrays or node lists of DOM nodes.\n *\n * @param actualDomChildren Actual DOM children\n * @param expectedDomChildren Expected DOM children.\n * @returns The list of actions based on the {@link module:utils/diff~diff} function.\n */\n _diffNodeLists(actualDomChildren, expectedDomChildren) {\n actualDomChildren = filterOutFakeSelectionContainer(actualDomChildren, this._fakeSelectionContainer);\n return diff(actualDomChildren, expectedDomChildren, sameNodes.bind(null, this.domConverter));\n }\n /**\n * Finds DOM nodes that were replaced with the similar nodes (same tag name) in the view. All nodes are compared\n * within one `insert`/`delete` action group, for example:\n *\n * ```\n * Actual DOM:\t\t<p><b>Foo</b>Bar<i>Baz</i><b>Bax</b></p>\n * Expected DOM:\t<p>Bar<b>123</b><i>Baz</i><b>456</b></p>\n * Input actions:\t[ insert, insert, delete, delete, equal, insert, delete ]\n * Output actions:\t[ insert, replace, delete, equal, replace ]\n * ```\n *\n * @param actions Actions array which is a result of the {@link module:utils/diff~diff} function.\n * @param actualDom Actual DOM children\n * @param expectedDom Expected DOM children.\n * @param comparator A comparator function that should return `true` if the given node should be reused\n * (either by the update of a text node data or an element children list for similar elements).\n * @returns Actions array modified with the `update` actions.\n */\n _findUpdateActions(actions, actualDom, expectedDom, comparator) {\n // If there is no both 'insert' and 'delete' actions, no need to check for replaced elements.\n if (actions.indexOf('insert') === -1 || actions.indexOf('delete') === -1) {\n return actions;\n }\n let newActions = [];\n let actualSlice = [];\n let expectedSlice = [];\n const counter = { equal: 0, insert: 0, delete: 0 };\n for (const action of actions) {\n if (action === 'insert') {\n expectedSlice.push(expectedDom[counter.equal + counter.insert]);\n }\n else if (action === 'delete') {\n actualSlice.push(actualDom[counter.equal + counter.delete]);\n }\n else { // equal\n newActions = newActions.concat(diff(actualSlice, expectedSlice, comparator)\n .map(action => action === 'equal' ? 'update' : action));\n newActions.push('equal');\n // Reset stored elements on 'equal'.\n actualSlice = [];\n expectedSlice = [];\n }\n counter[action]++;\n }\n return newActions.concat(diff(actualSlice, expectedSlice, comparator)\n .map(action => action === 'equal' ? 'update' : action));\n }\n /**\n * Checks if text needs to be updated and possibly updates it by removing and inserting only parts\n * of the data from the existing text node to reduce impact on the IME composition.\n *\n * @param domText DOM text node to update.\n * @param expectedText The expected data of a text node.\n */\n _updateTextNode(domText, expectedText) {\n const actualText = domText.data;\n if (actualText == expectedText) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Text node does not need update:%c ' +\n // @if CK_DEBUG_TYPING // \t\t`${ _escapeTextNodeData( actualText ) }%c (${ actualText.length })`,\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-style: italic', 'color: blue', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // Our approach to interleaving space character with NBSP might differ with the one implemented by the browser.\n // Avoid modifying the text node in the DOM if only NBSPs and spaces are interchanged.\n // We should avoid DOM modifications while composing to avoid breakage of composition.\n // See: https://github.com/ckeditor/ckeditor5/issues/13994.\n if (env.isAndroid && this.isComposing && actualText.replace(/\\u00A0/g, ' ') == expectedText.replace(/\\u00A0/g, ' ')) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Text node ignore NBSP changes while composing: ' +\n // @if CK_DEBUG_TYPING // \t\t`%c${ _escapeTextNodeData( actualText ) }%c (${ actualText.length }) ->` +\n // @if CK_DEBUG_TYPING // \t\t` %c${ _escapeTextNodeData( expectedText ) }%c (${ expectedText.length })`,\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-style: italic', 'color: blue', '', 'color: blue', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Update text node' +\n // @if CK_DEBUG_TYPING // \t\t`${ this.isComposing ? ' while composing (may break composition)' : '' }: ` +\n // @if CK_DEBUG_TYPING // \t\t`%c${ _escapeTextNodeData( actualText ) }%c (${ actualText.length }) ->` +\n // @if CK_DEBUG_TYPING // \t\t` %c${ _escapeTextNodeData( expectedText ) }%c (${ expectedText.length })`,\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', this.isComposing ? 'color: red; font-weight: bold' : '',\n // @if CK_DEBUG_TYPING // \t\t'color: blue', '', 'color: blue', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n this._updateTextNodeInternal(domText, expectedText);\n }\n /**\n * Part of the `_updateTextNode` method extracted for easier testing.\n */\n _updateTextNodeInternal(domText, expectedText) {\n const actions = fastDiff(domText.data, expectedText);\n for (const action of actions) {\n if (action.type === 'insert') {\n domText.insertData(action.index, action.values.join(''));\n }\n else { // 'delete'\n domText.deleteData(action.index, action.howMany);\n }\n }\n }\n /**\n * Marks text nodes to be synchronized.\n *\n * If a text node is passed, it will be marked. If an element is passed, all descendant text nodes inside it will be marked.\n *\n * @param viewNode View node to sync.\n */\n _markDescendantTextToSync(viewNode) {\n if (!viewNode) {\n return;\n }\n if (viewNode.is('$text')) {\n this.markedTexts.add(viewNode);\n }\n else if (viewNode.is('element')) {\n for (const child of viewNode.getChildren()) {\n this._markDescendantTextToSync(child);\n }\n }\n }\n /**\n * Checks if the selection needs to be updated and possibly updates it.\n */\n _updateSelection() {\n // Block updating DOM selection in (non-Android) Blink while the user is selecting to prevent accidental selection collapsing.\n // Note: Structural changes in DOM must trigger selection rendering, though. Nodes the selection was anchored\n // to, may disappear in DOM which would break the selection (e.g. in real-time collaboration scenarios).\n // https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723\n if (env.isBlink && !env.isAndroid && this.isSelecting && !this.markedChildren.size) {\n return;\n }\n // If there is no selection - remove DOM and fake selections.\n if (this.selection.rangeCount === 0) {\n this._removeDomSelection();\n this._removeFakeSelection();\n return;\n }\n const domRoot = this.domConverter.mapViewToDom(this.selection.editableElement);\n // Do nothing if there is no focus, or there is no DOM element corresponding to selection's editable element.\n if (!this.isFocused || !domRoot) {\n return;\n }\n // Render fake selection - create the fake selection container (if needed) and move DOM selection to it.\n if (this.selection.isFake) {\n this._updateFakeSelection(domRoot);\n }\n // There was a fake selection so remove it and update the DOM selection.\n // This is especially important on Android because otherwise IME will try to compose over the fake selection container.\n else if (this._fakeSelectionContainer && this._fakeSelectionContainer.isConnected) {\n this._removeFakeSelection();\n this._updateDomSelection(domRoot);\n }\n // Update the DOM selection in case of a plain selection change (no fake selection is involved).\n // On non-Android the whole rendering is disabled in composition mode (including DOM selection update),\n // but updating DOM selection should be also disabled on Android if in the middle of the composition\n // (to not interrupt it).\n else if (!(this.isComposing && env.isAndroid)) {\n this._updateDomSelection(domRoot);\n }\n }\n /**\n * Updates the fake selection.\n *\n * @param domRoot A valid DOM root where the fake selection container should be added.\n */\n _updateFakeSelection(domRoot) {\n const domDocument = domRoot.ownerDocument;\n if (!this._fakeSelectionContainer) {\n this._fakeSelectionContainer = createFakeSelectionContainer(domDocument);\n }\n const container = this._fakeSelectionContainer;\n // Bind fake selection container with the current selection *position*.\n this.domConverter.bindFakeSelection(container, this.selection);\n if (!this._fakeSelectionNeedsUpdate(domRoot)) {\n return;\n }\n if (!container.parentElement || container.parentElement != domRoot) {\n domRoot.appendChild(container);\n }\n container.textContent = this.selection.fakeSelectionLabel || '\\u00A0';\n const domSelection = domDocument.getSelection();\n const domRange = domDocument.createRange();\n domSelection.removeAllRanges();\n domRange.selectNodeContents(container);\n domSelection.addRange(domRange);\n }\n /**\n * Updates the DOM selection.\n *\n * @param domRoot A valid DOM root where the DOM selection should be rendered.\n */\n _updateDomSelection(domRoot) {\n const domSelection = domRoot.ownerDocument.defaultView.getSelection();\n // Let's check whether DOM selection needs updating at all.\n if (!this._domSelectionNeedsUpdate(domSelection)) {\n return;\n }\n // Multi-range selection is not available in most browsers, and, at least in Chrome, trying to\n // set such selection, that is not continuous, throws an error. Because of that, we will just use anchor\n // and focus of view selection.\n // Since we are not supporting multi-range selection, we also do not need to check if proper editable is\n // selected. If there is any editable selected, it is okay (editable is taken from selection anchor).\n const anchor = this.domConverter.viewPositionToDom(this.selection.anchor);\n const focus = this.domConverter.viewPositionToDom(this.selection.focus);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Update DOM selection:',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', '', anchor, focus\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n domSelection.setBaseAndExtent(anchor.parent, anchor.offset, focus.parent, focus.offset);\n // Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).\n if (env.isGecko) {\n fixGeckoSelectionAfterBr(focus, domSelection);\n }\n }\n /**\n * Checks whether a given DOM selection needs to be updated.\n *\n * @param domSelection The DOM selection to check.\n */\n _domSelectionNeedsUpdate(domSelection) {\n if (!this.domConverter.isDomSelectionCorrect(domSelection)) {\n // Current DOM selection is in incorrect position. We need to update it.\n return true;\n }\n const oldViewSelection = domSelection && this.domConverter.domSelectionToView(domSelection);\n if (oldViewSelection && this.selection.isEqual(oldViewSelection)) {\n return false;\n }\n // If selection is not collapsed, it does not need to be updated if it is similar.\n if (!this.selection.isCollapsed && this.selection.isSimilar(oldViewSelection)) {\n // Selection did not changed and is correct, do not update.\n return false;\n }\n // Selections are not similar.\n return true;\n }\n /**\n * Checks whether the fake selection needs to be updated.\n *\n * @param domRoot A valid DOM root where a new fake selection container should be added.\n */\n _fakeSelectionNeedsUpdate(domRoot) {\n const container = this._fakeSelectionContainer;\n const domSelection = domRoot.ownerDocument.getSelection();\n // Fake selection needs to be updated if there's no fake selection container, or the container currently sits\n // in a different root.\n if (!container || container.parentElement !== domRoot) {\n return true;\n }\n // Make sure that the selection actually is within the fake selection.\n if (domSelection.anchorNode !== container && !container.contains(domSelection.anchorNode)) {\n return true;\n }\n return container.textContent !== this.selection.fakeSelectionLabel;\n }\n /**\n * Removes the DOM selection.\n */\n _removeDomSelection() {\n for (const doc of this.domDocuments) {\n const domSelection = doc.getSelection();\n if (domSelection.rangeCount) {\n const activeDomElement = doc.activeElement;\n const viewElement = this.domConverter.mapDomToView(activeDomElement);\n if (activeDomElement && viewElement) {\n domSelection.removeAllRanges();\n }\n }\n }\n }\n /**\n * Removes the fake selection.\n */\n _removeFakeSelection() {\n const container = this._fakeSelectionContainer;\n if (container) {\n container.remove();\n }\n }\n /**\n * Checks if focus needs to be updated and possibly updates it.\n */\n _updateFocus() {\n if (this.isFocused) {\n const editable = this.selection.editableElement;\n if (editable) {\n this.domConverter.focus(editable);\n }\n }\n }\n}\n/**\n * Checks if provided element is editable.\n */\nfunction isEditable(element) {\n if (element.getAttribute('contenteditable') == 'false') {\n return false;\n }\n const parent = element.findAncestor(element => element.hasAttribute('contenteditable'));\n return !parent || parent.getAttribute('contenteditable') == 'true';\n}\n/**\n * Adds inline filler at a given position.\n *\n * The position can be given as an array of DOM nodes and an offset in that array,\n * or a DOM parent element and an offset in that element.\n *\n * @returns The DOM text node that contains an inline filler.\n */\nfunction addInlineFiller(domDocument, domParentOrArray, offset) {\n const childNodes = domParentOrArray instanceof Array ? domParentOrArray : domParentOrArray.childNodes;\n const nodeAfterFiller = childNodes[offset];\n if (isText(nodeAfterFiller)) {\n nodeAfterFiller.data = INLINE_FILLER + nodeAfterFiller.data;\n return nodeAfterFiller;\n }\n else {\n const fillerNode = domDocument.createTextNode(INLINE_FILLER);\n if (Array.isArray(domParentOrArray)) {\n childNodes.splice(offset, 0, fillerNode);\n }\n else {\n insertAt(domParentOrArray, offset, fillerNode);\n }\n return fillerNode;\n }\n}\n/**\n * Whether two DOM nodes should be considered as similar.\n * Nodes are considered similar if they have the same tag name.\n */\nfunction areSimilarElements(node1, node2) {\n return isNode(node1) && isNode(node2) &&\n !isText(node1) && !isText(node2) &&\n !isComment(node1) && !isComment(node2) &&\n node1.tagName.toLowerCase() === node2.tagName.toLowerCase();\n}\n/**\n * Whether two DOM nodes are text nodes.\n */\nfunction areTextNodes(node1, node2) {\n return isNode(node1) && isNode(node2) &&\n isText(node1) && isText(node2);\n}\n/**\n * Whether two dom nodes should be considered as the same.\n * Two nodes which are considered the same are:\n *\n * * Text nodes with the same text.\n * * Element nodes represented by the same object.\n * * Two block filler elements.\n *\n * @param blockFillerMode Block filler mode, see {@link module:engine/view/domconverter~DomConverter#blockFillerMode}.\n */\nfunction sameNodes(domConverter, actualDomChild, expectedDomChild) {\n // Elements.\n if (actualDomChild === expectedDomChild) {\n return true;\n }\n // Texts.\n else if (isText(actualDomChild) && isText(expectedDomChild)) {\n return actualDomChild.data === expectedDomChild.data;\n }\n // Block fillers.\n else if (domConverter.isBlockFiller(actualDomChild) &&\n domConverter.isBlockFiller(expectedDomChild)) {\n return true;\n }\n // Not matching types.\n return false;\n}\n/**\n * The following is a Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).\n * When the native DOM selection is at the end of the block and preceded by <br /> e.g.\n *\n * ```html\n * <p>foo<br/>[]</p>\n * ```\n *\n * which happens a lot when using the soft line break, the browser fails to (visually) move the\n * caret to the new line. A quick fix is as simple as force–refreshing the selection with the same range.\n */\nfunction fixGeckoSelectionAfterBr(focus, domSelection) {\n let parent = focus.parent;\n let offset = focus.offset;\n if (isText(parent) && isInlineFiller(parent)) {\n offset = indexOf(parent) + 1;\n parent = parent.parentNode;\n }\n // This fix works only when the focus point is at the very end of an element.\n // There is no point in running it in cases unrelated to the browser bug.\n if (parent.nodeType != Node.ELEMENT_NODE || offset != parent.childNodes.length - 1) {\n return;\n }\n const childAtOffset = parent.childNodes[offset];\n // To stay on the safe side, the fix being as specific as possible, it targets only the\n // selection which is at the very end of the element and preceded by <br />.\n if (childAtOffset && childAtOffset.tagName == 'BR') {\n domSelection.addRange(domSelection.getRangeAt(0));\n }\n}\nfunction filterOutFakeSelectionContainer(domChildList, fakeSelectionContainer) {\n const childList = Array.from(domChildList);\n if (childList.length == 0 || !fakeSelectionContainer) {\n return childList;\n }\n const last = childList[childList.length - 1];\n if (last == fakeSelectionContainer) {\n childList.pop();\n }\n return childList;\n}\n/**\n * Creates a fake selection container for a given document.\n */\nfunction createFakeSelectionContainer(domDocument) {\n const container = domDocument.createElement('div');\n container.className = 'ck-fake-selection-container';\n Object.assign(container.style, {\n position: 'fixed',\n top: 0,\n left: '-9999px',\n // See https://github.com/ckeditor/ckeditor5/issues/752.\n width: '42px'\n });\n // Fill it with a text node so we can update it later.\n container.textContent = '\\u00A0';\n return container;\n}\n// @if CK_DEBUG_TYPING // function _escapeTextNodeData( text ) {\n// @if CK_DEBUG_TYPING // \tconst escapedText = text\n// @if CK_DEBUG_TYPING // \t\t.replace( /&/g, '&' )\n// @if CK_DEBUG_TYPING // \t\t.replace( /\\u00A0/g, ' ' )\n// @if CK_DEBUG_TYPING // \t\t.replace( /\\u2060/g, '⁠' );\n// @if CK_DEBUG_TYPING //\n// @if CK_DEBUG_TYPING // \treturn `\"${ escapedText }\"`;\n// @if CK_DEBUG_TYPING // }\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/domconverter\n */\n/* globals Node, NodeFilter, DOMParser */\nimport ViewText from './text.js';\nimport ViewElement from './element.js';\nimport ViewUIElement from './uielement.js';\nimport ViewPosition from './position.js';\nimport ViewRange from './range.js';\nimport ViewSelection from './selection.js';\nimport ViewDocumentFragment from './documentfragment.js';\nimport ViewTreeWalker from './treewalker.js';\nimport { default as Matcher } from './matcher.js';\nimport { BR_FILLER, INLINE_FILLER_LENGTH, NBSP_FILLER, MARKED_NBSP_FILLER, getDataWithoutFiller, isInlineFiller, startsWithFiller } from './filler.js';\nimport { global, logWarning, indexOf, getAncestors, isText, isComment, isValidAttributeName, first, env } from '@ckeditor/ckeditor5-utils';\nconst BR_FILLER_REF = BR_FILLER(global.document); // eslint-disable-line new-cap\nconst NBSP_FILLER_REF = NBSP_FILLER(global.document); // eslint-disable-line new-cap\nconst MARKED_NBSP_FILLER_REF = MARKED_NBSP_FILLER(global.document); // eslint-disable-line new-cap\nconst UNSAFE_ATTRIBUTE_NAME_PREFIX = 'data-ck-unsafe-attribute-';\nconst UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE = 'data-ck-unsafe-element';\n/**\n * `DomConverter` is a set of tools to do transformations between DOM nodes and view nodes. It also handles\n * {@link module:engine/view/domconverter~DomConverter#bindElements bindings} between these nodes.\n *\n * An instance of the DOM converter is available under\n * {@link module:engine/view/view~View#domConverter `editor.editing.view.domConverter`}.\n *\n * The DOM converter does not check which nodes should be rendered (use {@link module:engine/view/renderer~Renderer}), does not keep the\n * state of a tree nor keeps the synchronization between the tree view and the DOM tree (use {@link module:engine/view/document~Document}).\n *\n * The DOM converter keeps DOM elements to view element bindings, so when the converter gets destroyed, the bindings are lost.\n * Two converters will keep separate binding maps, so one tree view can be bound with two DOM trees.\n */\nexport default class DomConverter {\n /**\n * Creates a DOM converter.\n *\n * @param document The view document instance.\n * @param options An object with configuration options.\n * @param options.blockFillerMode The type of the block filler to use.\n * Default value depends on the options.renderingMode:\n * 'nbsp' when options.renderingMode == 'data',\n * 'br' when options.renderingMode == 'editing'.\n * @param options.renderingMode Whether to leave the View-to-DOM conversion result unchanged\n * or improve editing experience by filtering out interactive data.\n */\n constructor(document, { blockFillerMode, renderingMode = 'editing' } = {}) {\n /**\n * The DOM-to-view mapping.\n */\n this._domToViewMapping = new WeakMap();\n /**\n * The view-to-DOM mapping.\n */\n this._viewToDomMapping = new WeakMap();\n /**\n * Holds the mapping between fake selection containers and corresponding view selections.\n */\n this._fakeSelectionMapping = new WeakMap();\n /**\n * Matcher for view elements whose content should be treated as raw data\n * and not processed during the conversion from DOM nodes to view elements.\n */\n this._rawContentElementMatcher = new Matcher();\n /**\n * Matcher for inline object view elements. This is an extension of a simple {@link #inlineObjectElements} array of element names.\n */\n this._inlineObjectElementMatcher = new Matcher();\n /**\n * Set of elements with temporary custom properties that require clearing after render.\n */\n this._elementsWithTemporaryCustomProperties = new Set();\n this.document = document;\n this.renderingMode = renderingMode;\n this.blockFillerMode = blockFillerMode || (renderingMode === 'editing' ? 'br' : 'nbsp');\n this.preElements = ['pre'];\n this.blockElements = [\n 'address', 'article', 'aside', 'blockquote', 'caption', 'center', 'dd', 'details', 'dir', 'div',\n 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header',\n 'hgroup', 'legend', 'li', 'main', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'summary', 'table', 'tbody',\n 'td', 'tfoot', 'th', 'thead', 'tr', 'ul'\n ];\n this.inlineObjectElements = [\n 'object', 'iframe', 'input', 'button', 'textarea', 'select', 'option', 'video', 'embed', 'audio', 'img', 'canvas'\n ];\n this.unsafeElements = ['script', 'style'];\n this._domDocument = this.renderingMode === 'editing' ? global.document : global.document.implementation.createHTMLDocument('');\n }\n /**\n * Binds a given DOM element that represents fake selection to a **position** of a\n * {@link module:engine/view/documentselection~DocumentSelection document selection}.\n * Document selection copy is stored and can be retrieved by the\n * {@link module:engine/view/domconverter~DomConverter#fakeSelectionToView} method.\n */\n bindFakeSelection(domElement, viewDocumentSelection) {\n this._fakeSelectionMapping.set(domElement, new ViewSelection(viewDocumentSelection));\n }\n /**\n * Returns a {@link module:engine/view/selection~Selection view selection} instance corresponding to a given\n * DOM element that represents fake selection. Returns `undefined` if binding to the given DOM element does not exist.\n */\n fakeSelectionToView(domElement) {\n return this._fakeSelectionMapping.get(domElement);\n }\n /**\n * Binds DOM and view elements, so it will be possible to get corresponding elements using\n * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and\n * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.\n *\n * @param domElement The DOM element to bind.\n * @param viewElement The view element to bind.\n */\n bindElements(domElement, viewElement) {\n this._domToViewMapping.set(domElement, viewElement);\n this._viewToDomMapping.set(viewElement, domElement);\n }\n /**\n * Unbinds a given DOM element from the view element it was bound to. Unbinding is deep, meaning that all children of\n * the DOM element will be unbound too.\n *\n * @param domElement The DOM element to unbind.\n */\n unbindDomElement(domElement) {\n const viewElement = this._domToViewMapping.get(domElement);\n if (viewElement) {\n this._domToViewMapping.delete(domElement);\n this._viewToDomMapping.delete(viewElement);\n for (const child of Array.from(domElement.children)) {\n this.unbindDomElement(child);\n }\n }\n }\n /**\n * Binds DOM and view document fragments, so it will be possible to get corresponding document fragments using\n * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and\n * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.\n *\n * @param domFragment The DOM document fragment to bind.\n * @param viewFragment The view document fragment to bind.\n */\n bindDocumentFragments(domFragment, viewFragment) {\n this._domToViewMapping.set(domFragment, viewFragment);\n this._viewToDomMapping.set(viewFragment, domFragment);\n }\n /**\n * Decides whether a given pair of attribute key and value should be passed further down the pipeline.\n *\n * @param elementName Element name in lower case.\n */\n shouldRenderAttribute(attributeKey, attributeValue, elementName) {\n if (this.renderingMode === 'data') {\n return true;\n }\n attributeKey = attributeKey.toLowerCase();\n if (attributeKey.startsWith('on')) {\n return false;\n }\n if (attributeKey === 'srcdoc' &&\n attributeValue.match(/\\bon\\S+\\s*=|javascript:|<\\s*\\/*script/i)) {\n return false;\n }\n if (elementName === 'img' &&\n (attributeKey === 'src' || attributeKey === 'srcset')) {\n return true;\n }\n if (elementName === 'source' && attributeKey === 'srcset') {\n return true;\n }\n if (attributeValue.match(/^\\s*(javascript:|data:(image\\/svg|text\\/x?html))/i)) {\n return false;\n }\n return true;\n }\n /**\n * Set `domElement`'s content using provided `html` argument. Apply necessary filtering for the editing pipeline.\n *\n * @param domElement DOM element that should have `html` set as its content.\n * @param html Textual representation of the HTML that will be set on `domElement`.\n */\n setContentOf(domElement, html) {\n // For data pipeline we pass the HTML as-is.\n if (this.renderingMode === 'data') {\n domElement.innerHTML = html;\n return;\n }\n const document = new DOMParser().parseFromString(html, 'text/html');\n const fragment = document.createDocumentFragment();\n const bodyChildNodes = document.body.childNodes;\n while (bodyChildNodes.length > 0) {\n fragment.appendChild(bodyChildNodes[0]);\n }\n const treeWalker = document.createTreeWalker(fragment, NodeFilter.SHOW_ELEMENT);\n const nodes = [];\n let currentNode;\n // eslint-disable-next-line no-cond-assign\n while (currentNode = treeWalker.nextNode()) {\n nodes.push(currentNode);\n }\n for (const currentNode of nodes) {\n // Go through nodes to remove those that are prohibited in editing pipeline.\n for (const attributeName of currentNode.getAttributeNames()) {\n this.setDomElementAttribute(currentNode, attributeName, currentNode.getAttribute(attributeName));\n }\n const elementName = currentNode.tagName.toLowerCase();\n // There are certain nodes, that should be renamed to <span> in editing pipeline.\n if (this._shouldRenameElement(elementName)) {\n _logUnsafeElement(elementName);\n currentNode.replaceWith(this._createReplacementDomElement(elementName, currentNode));\n }\n }\n // Empty the target element.\n while (domElement.firstChild) {\n domElement.firstChild.remove();\n }\n domElement.append(fragment);\n }\n /**\n * Converts the view to the DOM. For all text nodes, not bound elements and document fragments new items will\n * be created. For bound elements and document fragments the method will return corresponding items.\n *\n * @param viewNode View node or document fragment to transform.\n * @param options Conversion options.\n * @param options.bind Determines whether new elements will be bound.\n * @param options.withChildren If `false`, node's and document fragment's children will not be converted.\n * @returns Converted node or DocumentFragment.\n */\n viewToDom(viewNode, options = {}) {\n if (viewNode.is('$text')) {\n const textData = this._processDataFromViewText(viewNode);\n return this._domDocument.createTextNode(textData);\n }\n else {\n const viewElementOrFragment = viewNode;\n if (this.mapViewToDom(viewElementOrFragment)) {\n // Do not reuse element that is marked to not reuse (for example an IMG element\n // so it can immediately display a placeholder background instead of waiting for the new src to load).\n if (viewElementOrFragment.getCustomProperty('editingPipeline:doNotReuseOnce')) {\n this._elementsWithTemporaryCustomProperties.add(viewElementOrFragment);\n }\n else {\n return this.mapViewToDom(viewElementOrFragment);\n }\n }\n let domElement;\n if (viewElementOrFragment.is('documentFragment')) {\n // Create DOM document fragment.\n domElement = this._domDocument.createDocumentFragment();\n if (options.bind) {\n this.bindDocumentFragments(domElement, viewElementOrFragment);\n }\n }\n else if (viewElementOrFragment.is('uiElement')) {\n if (viewElementOrFragment.name === '$comment') {\n domElement = this._domDocument.createComment(viewElementOrFragment.getCustomProperty('$rawContent'));\n }\n else {\n // UIElement has its own render() method (see #799).\n domElement = viewElementOrFragment.render(this._domDocument, this);\n }\n if (options.bind) {\n this.bindElements(domElement, viewElementOrFragment);\n }\n return domElement;\n }\n else {\n // Create DOM element.\n if (this._shouldRenameElement(viewElementOrFragment.name)) {\n _logUnsafeElement(viewElementOrFragment.name);\n domElement = this._createReplacementDomElement(viewElementOrFragment.name);\n }\n else if (viewElementOrFragment.hasAttribute('xmlns')) {\n domElement = this._domDocument.createElementNS(viewElementOrFragment.getAttribute('xmlns'), viewElementOrFragment.name);\n }\n else {\n domElement = this._domDocument.createElement(viewElementOrFragment.name);\n }\n // RawElement take care of their children in RawElement#render() method which can be customized\n // (see https://github.com/ckeditor/ckeditor5/issues/4469).\n if (viewElementOrFragment.is('rawElement')) {\n viewElementOrFragment.render(domElement, this);\n }\n if (options.bind) {\n this.bindElements(domElement, viewElementOrFragment);\n }\n // Copy element's attributes.\n for (const key of viewElementOrFragment.getAttributeKeys()) {\n this.setDomElementAttribute(domElement, key, viewElementOrFragment.getAttribute(key), viewElementOrFragment);\n }\n }\n if (options.withChildren !== false) {\n for (const child of this.viewChildrenToDom(viewElementOrFragment, options)) {\n if (domElement instanceof HTMLTemplateElement) {\n domElement.content.appendChild(child);\n }\n else {\n domElement.appendChild(child);\n }\n }\n }\n return domElement;\n }\n }\n /**\n * Sets the attribute on a DOM element.\n *\n * **Note**: To remove the attribute, use {@link #removeDomElementAttribute}.\n *\n * @param domElement The DOM element the attribute should be set on.\n * @param key The name of the attribute.\n * @param value The value of the attribute.\n * @param relatedViewElement The view element related to the `domElement` (if there is any).\n * It helps decide whether the attribute set is unsafe. For instance, view elements created via the\n * {@link module:engine/view/downcastwriter~DowncastWriter} methods can allow certain attributes that would normally be filtered out.\n */\n setDomElementAttribute(domElement, key, value, relatedViewElement) {\n const shouldRenderAttribute = this.shouldRenderAttribute(key, value, domElement.tagName.toLowerCase()) ||\n relatedViewElement && relatedViewElement.shouldRenderUnsafeAttribute(key);\n if (!shouldRenderAttribute) {\n logWarning('domconverter-unsafe-attribute-detected', { domElement, key, value });\n }\n if (!isValidAttributeName(key)) {\n /**\n * Invalid attribute name was ignored during rendering.\n *\n * @error domconverter-invalid-attribute-detected\n */\n logWarning('domconverter-invalid-attribute-detected', { domElement, key, value });\n return;\n }\n // The old value was safe but the new value is unsafe.\n if (domElement.hasAttribute(key) && !shouldRenderAttribute) {\n domElement.removeAttribute(key);\n }\n // The old value was unsafe (but prefixed) but the new value will be safe (will be unprefixed).\n else if (domElement.hasAttribute(UNSAFE_ATTRIBUTE_NAME_PREFIX + key) && shouldRenderAttribute) {\n domElement.removeAttribute(UNSAFE_ATTRIBUTE_NAME_PREFIX + key);\n }\n // If the attribute should not be rendered, rename it (instead of removing) to give developers some idea of what\n // is going on (https://github.com/ckeditor/ckeditor5/issues/10801).\n domElement.setAttribute(shouldRenderAttribute ? key : UNSAFE_ATTRIBUTE_NAME_PREFIX + key, value);\n }\n /**\n * Removes an attribute from a DOM element.\n *\n * **Note**: To set the attribute, use {@link #setDomElementAttribute}.\n *\n * @param domElement The DOM element the attribute should be removed from.\n * @param key The name of the attribute.\n */\n removeDomElementAttribute(domElement, key) {\n // See #_createReplacementDomElement() to learn what this is.\n if (key == UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE) {\n return;\n }\n domElement.removeAttribute(key);\n // See setDomElementAttribute() to learn what this is.\n domElement.removeAttribute(UNSAFE_ATTRIBUTE_NAME_PREFIX + key);\n }\n /**\n * Converts children of the view element to DOM using the\n * {@link module:engine/view/domconverter~DomConverter#viewToDom} method.\n * Additionally, this method adds block {@link module:engine/view/filler filler} to the list of children, if needed.\n *\n * @param viewElement Parent view element.\n * @param options See {@link module:engine/view/domconverter~DomConverter#viewToDom} options parameter.\n * @returns DOM nodes.\n */\n *viewChildrenToDom(viewElement, options = {}) {\n const fillerPositionOffset = viewElement.getFillerOffset && viewElement.getFillerOffset();\n let offset = 0;\n for (const childView of viewElement.getChildren()) {\n if (fillerPositionOffset === offset) {\n yield this._getBlockFiller();\n }\n const transparentRendering = childView.is('element') &&\n !!childView.getCustomProperty('dataPipeline:transparentRendering') &&\n !first(childView.getAttributes());\n if (transparentRendering && this.renderingMode == 'data') {\n // `RawElement` doesn't have #children defined, so they need to be temporarily rendered\n // and extracted directly.\n if (childView.is('rawElement')) {\n const tempElement = this._domDocument.createElement(childView.name);\n childView.render(tempElement, this);\n yield* [...tempElement.childNodes];\n }\n else {\n yield* this.viewChildrenToDom(childView, options);\n }\n }\n else {\n if (transparentRendering) {\n /**\n * The `dataPipeline:transparentRendering` flag is supported only in the data pipeline.\n *\n * @error domconverter-transparent-rendering-unsupported-in-editing-pipeline\n */\n logWarning('domconverter-transparent-rendering-unsupported-in-editing-pipeline', { viewElement: childView });\n }\n yield this.viewToDom(childView, options);\n }\n offset++;\n }\n if (fillerPositionOffset === offset) {\n yield this._getBlockFiller();\n }\n }\n /**\n * Converts view {@link module:engine/view/range~Range} to DOM range.\n * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.\n *\n * @param viewRange View range.\n * @returns DOM range.\n */\n viewRangeToDom(viewRange) {\n const domStart = this.viewPositionToDom(viewRange.start);\n const domEnd = this.viewPositionToDom(viewRange.end);\n const domRange = this._domDocument.createRange();\n domRange.setStart(domStart.parent, domStart.offset);\n domRange.setEnd(domEnd.parent, domEnd.offset);\n return domRange;\n }\n /**\n * Converts view {@link module:engine/view/position~Position} to DOM parent and offset.\n *\n * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.\n * If the converted position is directly before inline filler it is moved inside the filler.\n *\n * @param viewPosition View position.\n * @returns DOM position or `null` if view position could not be converted to DOM.\n * DOM position has two properties:\n * * `parent` - DOM position parent.\n * * `offset` - DOM position offset.\n */\n viewPositionToDom(viewPosition) {\n const viewParent = viewPosition.parent;\n if (viewParent.is('$text')) {\n const domParent = this.findCorrespondingDomText(viewParent);\n if (!domParent) {\n // Position is in a view text node that has not been rendered to DOM yet.\n return null;\n }\n let offset = viewPosition.offset;\n if (startsWithFiller(domParent)) {\n offset += INLINE_FILLER_LENGTH;\n }\n return { parent: domParent, offset };\n }\n else {\n // viewParent is instance of ViewElement.\n let domParent, domBefore, domAfter;\n if (viewPosition.offset === 0) {\n domParent = this.mapViewToDom(viewParent);\n if (!domParent) {\n // Position is in a view element that has not been rendered to DOM yet.\n return null;\n }\n domAfter = domParent.childNodes[0];\n }\n else {\n const nodeBefore = viewPosition.nodeBefore;\n domBefore = nodeBefore.is('$text') ?\n this.findCorrespondingDomText(nodeBefore) :\n this.mapViewToDom(nodeBefore);\n if (!domBefore) {\n // Position is after a view element that has not been rendered to DOM yet.\n return null;\n }\n domParent = domBefore.parentNode;\n domAfter = domBefore.nextSibling;\n }\n // If there is an inline filler at position return position inside the filler. We should never return\n // the position before the inline filler.\n if (isText(domAfter) && startsWithFiller(domAfter)) {\n return { parent: domAfter, offset: INLINE_FILLER_LENGTH };\n }\n const offset = domBefore ? indexOf(domBefore) + 1 : 0;\n return { parent: domParent, offset };\n }\n }\n /**\n * Converts DOM to view. For all text nodes, not bound elements and document fragments new items will\n * be created. For bound elements and document fragments function will return corresponding items. For\n * {@link module:engine/view/filler fillers} `null` will be returned.\n * For all DOM elements rendered by {@link module:engine/view/uielement~UIElement} that UIElement will be returned.\n *\n * @param domNode DOM node or document fragment to transform.\n * @param options Conversion options.\n * @param options.bind Determines whether new elements will be bound. False by default.\n * @param options.withChildren If `true`, node's and document fragment's children will be converted too. True by default.\n * @param options.keepOriginalCase If `false`, node's tag name will be converted to lower case. False by default.\n * @param options.skipComments If `false`, comment nodes will be converted to `$comment`\n * {@link module:engine/view/uielement~UIElement view UI elements}. False by default.\n * @returns Converted node or document fragment or `null` if DOM node is a {@link module:engine/view/filler filler}\n * or the given node is an empty text node.\n */\n domToView(domNode, options = {}) {\n const inlineNodes = [];\n const generator = this._domToView(domNode, options, inlineNodes);\n // Get the first yielded value or a returned value.\n const node = generator.next().value;\n if (!node) {\n return null;\n }\n // Trigger children handling.\n generator.next();\n // Whitespace cleaning.\n this._processDomInlineNodes(null, inlineNodes, options);\n // Text not got trimmed to an empty string so there is no result node.\n if (node.is('$text') && node.data.length == 0) {\n return null;\n }\n return node;\n }\n /**\n * Converts children of the DOM element to view nodes using\n * the {@link module:engine/view/domconverter~DomConverter#domToView} method.\n * Additionally this method omits block {@link module:engine/view/filler filler}, if it exists in the DOM parent.\n *\n * @param domElement Parent DOM element.\n * @param options See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.\n * @param inlineNodes An array that will be populated with inline nodes. It's used internally for whitespace processing.\n * @returns View nodes.\n */\n *domChildrenToView(domElement, options = {}, inlineNodes = []) {\n // Get child nodes from content document fragment if element is template\n let childNodes = [];\n if (domElement instanceof HTMLTemplateElement) {\n childNodes = [...domElement.content.childNodes];\n }\n else {\n childNodes = [...domElement.childNodes];\n }\n for (let i = 0; i < childNodes.length; i++) {\n const domChild = childNodes[i];\n const generator = this._domToView(domChild, options, inlineNodes);\n // Get the first yielded value or a returned value.\n const viewChild = generator.next().value;\n if (viewChild !== null) {\n // Whitespace cleaning before entering a block element (between block elements).\n if (this._isBlockViewElement(viewChild)) {\n this._processDomInlineNodes(domElement, inlineNodes, options);\n }\n yield viewChild;\n // Trigger children handling.\n generator.next();\n }\n }\n // Whitespace cleaning before leaving a block element (content of block element).\n this._processDomInlineNodes(domElement, inlineNodes, options);\n }\n /**\n * Converts DOM selection to view {@link module:engine/view/selection~Selection}.\n * Ranges which cannot be converted will be omitted.\n *\n * @param domSelection DOM selection.\n * @returns View selection.\n */\n domSelectionToView(domSelection) {\n // See: https://github.com/ckeditor/ckeditor5/issues/9635.\n if (isGeckoRestrictedDomSelection(domSelection)) {\n return new ViewSelection([]);\n }\n // DOM selection might be placed in fake selection container.\n // If container contains fake selection - return corresponding view selection.\n if (domSelection.rangeCount === 1) {\n let container = domSelection.getRangeAt(0).startContainer;\n // The DOM selection might be moved to the text node inside the fake selection container.\n if (isText(container)) {\n container = container.parentNode;\n }\n const viewSelection = this.fakeSelectionToView(container);\n if (viewSelection) {\n return viewSelection;\n }\n }\n const isBackward = this.isDomSelectionBackward(domSelection);\n const viewRanges = [];\n for (let i = 0; i < domSelection.rangeCount; i++) {\n // DOM Range have correct start and end, no matter what is the DOM Selection direction. So we don't have to fix anything.\n const domRange = domSelection.getRangeAt(i);\n const viewRange = this.domRangeToView(domRange);\n if (viewRange) {\n viewRanges.push(viewRange);\n }\n }\n return new ViewSelection(viewRanges, { backward: isBackward });\n }\n /**\n * Converts DOM Range to view {@link module:engine/view/range~Range}.\n * If the start or end position can not be converted `null` is returned.\n *\n * @param domRange DOM range.\n * @returns View range.\n */\n domRangeToView(domRange) {\n const viewStart = this.domPositionToView(domRange.startContainer, domRange.startOffset);\n const viewEnd = this.domPositionToView(domRange.endContainer, domRange.endOffset);\n if (viewStart && viewEnd) {\n return new ViewRange(viewStart, viewEnd);\n }\n return null;\n }\n /**\n * Converts DOM parent and offset to view {@link module:engine/view/position~Position}.\n *\n * If the position is inside a {@link module:engine/view/filler filler} which has no corresponding view node,\n * position of the filler will be converted and returned.\n *\n * If the position is inside DOM element rendered by {@link module:engine/view/uielement~UIElement}\n * that position will be converted to view position before that UIElement.\n *\n * If structures are too different and it is not possible to find corresponding position then `null` will be returned.\n *\n * @param domParent DOM position parent.\n * @param domOffset DOM position offset. You can skip it when converting the inline filler node.\n * @returns View position.\n */\n domPositionToView(domParent, domOffset = 0) {\n if (this.isBlockFiller(domParent)) {\n return this.domPositionToView(domParent.parentNode, indexOf(domParent));\n }\n // If position is somewhere inside UIElement or a RawElement - return position before that element.\n const viewElement = this.mapDomToView(domParent);\n if (viewElement && (viewElement.is('uiElement') || viewElement.is('rawElement'))) {\n return ViewPosition._createBefore(viewElement);\n }\n if (isText(domParent)) {\n if (isInlineFiller(domParent)) {\n return this.domPositionToView(domParent.parentNode, indexOf(domParent));\n }\n const viewParent = this.findCorrespondingViewText(domParent);\n let offset = domOffset;\n if (!viewParent) {\n return null;\n }\n if (startsWithFiller(domParent)) {\n offset -= INLINE_FILLER_LENGTH;\n offset = offset < 0 ? 0 : offset;\n }\n return new ViewPosition(viewParent, offset);\n }\n // domParent instanceof HTMLElement.\n else {\n if (domOffset === 0) {\n const viewParent = this.mapDomToView(domParent);\n if (viewParent) {\n return new ViewPosition(viewParent, 0);\n }\n }\n else {\n const domBefore = domParent.childNodes[domOffset - 1];\n // Jump over an inline filler (and also on Firefox jump over a block filler while pressing backspace in an empty paragraph).\n if (isText(domBefore) && isInlineFiller(domBefore) || domBefore && this.isBlockFiller(domBefore)) {\n return this.domPositionToView(domBefore.parentNode, indexOf(domBefore));\n }\n const viewBefore = isText(domBefore) ?\n this.findCorrespondingViewText(domBefore) :\n this.mapDomToView(domBefore);\n // TODO #663\n if (viewBefore && viewBefore.parent) {\n return new ViewPosition(viewBefore.parent, viewBefore.index + 1);\n }\n }\n return null;\n }\n }\n /**\n * Returns corresponding view {@link module:engine/view/element~Element Element} or\n * {@link module:engine/view/documentfragment~DocumentFragment} for provided DOM element or\n * document fragment. If there is no view item {@link module:engine/view/domconverter~DomConverter#bindElements bound}\n * to the given DOM - `undefined` is returned.\n *\n * For all DOM elements rendered by a {@link module:engine/view/uielement~UIElement} or\n * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.\n *\n * @param domElementOrDocumentFragment DOM element or document fragment.\n * @returns Corresponding view element, document fragment or `undefined` if no element was bound.\n */\n mapDomToView(domElementOrDocumentFragment) {\n const hostElement = this.getHostViewElement(domElementOrDocumentFragment);\n return hostElement || this._domToViewMapping.get(domElementOrDocumentFragment);\n }\n /**\n * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},\n * corresponding text node is returned based on the sibling or parent.\n *\n * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used\n * to find the corresponding text node.\n *\n * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}\n * element, it is used to find the corresponding text node.\n *\n * For all text nodes rendered by a {@link module:engine/view/uielement~UIElement} or\n * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.\n *\n * Otherwise `null` is returned.\n *\n * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.\n *\n * @param domText DOM text node.\n * @returns Corresponding view text node or `null`, if it was not possible to find a corresponding node.\n */\n findCorrespondingViewText(domText) {\n if (isInlineFiller(domText)) {\n return null;\n }\n // If DOM text was rendered by a UIElement or a RawElement - return this parent element.\n const hostElement = this.getHostViewElement(domText);\n if (hostElement) {\n return hostElement;\n }\n const previousSibling = domText.previousSibling;\n // Try to use previous sibling to find the corresponding text node.\n if (previousSibling) {\n if (!(this.isElement(previousSibling))) {\n // The previous is text or comment.\n return null;\n }\n const viewElement = this.mapDomToView(previousSibling);\n if (viewElement) {\n const nextSibling = viewElement.nextSibling;\n // It might be filler which has no corresponding view node.\n if (nextSibling instanceof ViewText) {\n return nextSibling;\n }\n else {\n return null;\n }\n }\n }\n // Try to use parent to find the corresponding text node.\n else {\n const viewElement = this.mapDomToView(domText.parentNode);\n if (viewElement) {\n const firstChild = viewElement.getChild(0);\n // It might be filler which has no corresponding view node.\n if (firstChild instanceof ViewText) {\n return firstChild;\n }\n else {\n return null;\n }\n }\n }\n return null;\n }\n mapViewToDom(documentFragmentOrElement) {\n return this._viewToDomMapping.get(documentFragmentOrElement);\n }\n /**\n * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},\n * corresponding text node is returned based on the sibling or parent.\n *\n * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used\n * to find the corresponding text node.\n *\n * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}\n * element, it is used to find the corresponding text node.\n *\n * Otherwise `null` is returned.\n *\n * @param viewText View text node.\n * @returns Corresponding DOM text node or `null`, if it was not possible to find a corresponding node.\n */\n findCorrespondingDomText(viewText) {\n const previousSibling = viewText.previousSibling;\n // Try to use previous sibling to find the corresponding text node.\n if (previousSibling && this.mapViewToDom(previousSibling)) {\n return this.mapViewToDom(previousSibling).nextSibling;\n }\n // If this is a first node, try to use parent to find the corresponding text node.\n if (!previousSibling && viewText.parent && this.mapViewToDom(viewText.parent)) {\n return this.mapViewToDom(viewText.parent).childNodes[0];\n }\n return null;\n }\n /**\n * Focuses DOM editable that is corresponding to provided {@link module:engine/view/editableelement~EditableElement}.\n */\n focus(viewEditable) {\n const domEditable = this.mapViewToDom(viewEditable);\n if (domEditable && domEditable.ownerDocument.activeElement !== domEditable) {\n // Save the scrollX and scrollY positions before the focus.\n const { scrollX, scrollY } = global.window;\n const scrollPositions = [];\n // Save all scrollLeft and scrollTop values starting from domEditable up to\n // document#documentElement.\n forEachDomElementAncestor(domEditable, node => {\n const { scrollLeft, scrollTop } = node;\n scrollPositions.push([scrollLeft, scrollTop]);\n });\n domEditable.focus();\n // Restore scrollLeft and scrollTop values starting from domEditable up to\n // document#documentElement.\n // https://github.com/ckeditor/ckeditor5-engine/issues/951\n // https://github.com/ckeditor/ckeditor5-engine/issues/957\n forEachDomElementAncestor(domEditable, node => {\n const [scrollLeft, scrollTop] = scrollPositions.shift();\n node.scrollLeft = scrollLeft;\n node.scrollTop = scrollTop;\n });\n // Restore the scrollX and scrollY positions after the focus.\n // https://github.com/ckeditor/ckeditor5-engine/issues/951\n global.window.scrollTo(scrollX, scrollY);\n }\n }\n /**\n * Remove DOM selection from blurred editable, so it won't interfere with clicking on dropdowns (especially on iOS).\n *\n * @internal\n */\n _clearDomSelection() {\n const domEditable = this.mapViewToDom(this.document.selection.editableElement);\n if (!domEditable) {\n return;\n }\n // Check if DOM selection is inside editor editable element.\n const domSelection = domEditable.ownerDocument.defaultView.getSelection();\n const newViewSelection = this.domSelectionToView(domSelection);\n const selectionInEditable = newViewSelection && newViewSelection.rangeCount > 0;\n if (selectionInEditable) {\n domSelection.removeAllRanges();\n }\n }\n /**\n * Returns `true` when `node.nodeType` equals `Node.ELEMENT_NODE`.\n *\n * @param node Node to check.\n */\n isElement(node) {\n return node && node.nodeType == Node.ELEMENT_NODE;\n }\n /**\n * Returns `true` when `node.nodeType` equals `Node.DOCUMENT_FRAGMENT_NODE`.\n *\n * @param node Node to check.\n */\n isDocumentFragment(node) {\n return node && node.nodeType == Node.DOCUMENT_FRAGMENT_NODE;\n }\n /**\n * Checks if the node is an instance of the block filler for this DOM converter.\n *\n * ```ts\n * const converter = new DomConverter( viewDocument, { blockFillerMode: 'br' } );\n *\n * converter.isBlockFiller( BR_FILLER( document ) ); // true\n * converter.isBlockFiller( NBSP_FILLER( document ) ); // false\n * ```\n *\n * **Note:**: For the `'nbsp'` mode the method also checks context of a node so it cannot be a detached node.\n *\n * **Note:** A special case in the `'nbsp'` mode exists where the `<br>` in `<p><br></p>` is treated as a block filler.\n *\n * @param domNode DOM node to check.\n * @returns True if a node is considered a block filler for given mode.\n */\n isBlockFiller(domNode) {\n if (this.blockFillerMode == 'br') {\n return domNode.isEqualNode(BR_FILLER_REF);\n }\n // Special case for <p><br></p> in which <br> should be treated as filler even when we are not in the 'br' mode. See ckeditor5#5564.\n if (domNode.tagName === 'BR' &&\n hasBlockParent(domNode, this.blockElements) &&\n domNode.parentNode.childNodes.length === 1) {\n return true;\n }\n // If not in 'br' mode, try recognizing both marked and regular nbsp block fillers.\n return domNode.isEqualNode(MARKED_NBSP_FILLER_REF) || isNbspBlockFiller(domNode, this.blockElements);\n }\n /**\n * Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.\n *\n * @param DOM Selection instance to check.\n */\n isDomSelectionBackward(selection) {\n if (selection.isCollapsed) {\n return false;\n }\n // Since it takes multiple lines of code to check whether a \"DOM Position\" is before/after another \"DOM Position\",\n // we will use the fact that range will collapse if it's end is before it's start.\n const range = this._domDocument.createRange();\n try {\n range.setStart(selection.anchorNode, selection.anchorOffset);\n range.setEnd(selection.focusNode, selection.focusOffset);\n }\n catch (e) {\n // Safari sometimes gives us a selection that makes Range.set{Start,End} throw.\n // See https://github.com/ckeditor/ckeditor5/issues/12375.\n return false;\n }\n const backward = range.collapsed;\n range.detach();\n return backward;\n }\n /**\n * Returns a parent {@link module:engine/view/uielement~UIElement} or {@link module:engine/view/rawelement~RawElement}\n * that hosts the provided DOM node. Returns `null` if there is no such parent.\n */\n getHostViewElement(domNode) {\n const ancestors = getAncestors(domNode);\n // Remove domNode from the list.\n ancestors.pop();\n while (ancestors.length) {\n const domNode = ancestors.pop();\n const viewNode = this._domToViewMapping.get(domNode);\n if (viewNode && (viewNode.is('uiElement') || viewNode.is('rawElement'))) {\n return viewNode;\n }\n }\n return null;\n }\n /**\n * Checks if the given selection's boundaries are at correct places.\n *\n * The following places are considered as incorrect for selection boundaries:\n *\n * * before or in the middle of an inline filler sequence,\n * * inside a DOM element which represents {@link module:engine/view/uielement~UIElement a view UI element},\n * * inside a DOM element which represents {@link module:engine/view/rawelement~RawElement a view raw element}.\n *\n * @param domSelection The DOM selection object to be checked.\n * @returns `true` if the given selection is at a correct place, `false` otherwise.\n */\n isDomSelectionCorrect(domSelection) {\n return this._isDomSelectionPositionCorrect(domSelection.anchorNode, domSelection.anchorOffset) &&\n this._isDomSelectionPositionCorrect(domSelection.focusNode, domSelection.focusOffset);\n }\n /**\n * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data\n * and not processed during the conversion from DOM nodes to view elements.\n *\n * This is affecting how {@link module:engine/view/domconverter~DomConverter#domToView} and\n * {@link module:engine/view/domconverter~DomConverter#domChildrenToView} process DOM nodes.\n *\n * The raw data can be later accessed by a\n * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `\"$rawContent\"`.\n *\n * @param pattern Pattern matching a view element whose content should\n * be treated as raw data.\n */\n registerRawContentMatcher(pattern) {\n this._rawContentElementMatcher.add(pattern);\n }\n /**\n * Registers a {@link module:engine/view/matcher~MatcherPattern} for inline object view elements.\n *\n * This is affecting how {@link module:engine/view/domconverter~DomConverter#domToView} and\n * {@link module:engine/view/domconverter~DomConverter#domChildrenToView} process DOM nodes.\n *\n * This is an extension of a simple {@link #inlineObjectElements} array of element names.\n *\n * @param pattern Pattern matching a view element which should be treated as an inline object.\n */\n registerInlineObjectMatcher(pattern) {\n this._inlineObjectElementMatcher.add(pattern);\n }\n /**\n * Clear temporary custom properties.\n *\n * @internal\n */\n _clearTemporaryCustomProperties() {\n for (const element of this._elementsWithTemporaryCustomProperties) {\n element._removeCustomProperty('editingPipeline:doNotReuseOnce');\n }\n this._elementsWithTemporaryCustomProperties.clear();\n }\n /**\n * Returns the block {@link module:engine/view/filler filler} node based on the current {@link #blockFillerMode} setting.\n */\n _getBlockFiller() {\n switch (this.blockFillerMode) {\n case 'nbsp':\n return NBSP_FILLER(this._domDocument); // eslint-disable-line new-cap\n case 'markedNbsp':\n return MARKED_NBSP_FILLER(this._domDocument); // eslint-disable-line new-cap\n case 'br':\n return BR_FILLER(this._domDocument); // eslint-disable-line new-cap\n }\n }\n /**\n * Checks if the given DOM position is a correct place for selection boundary. See {@link #isDomSelectionCorrect}.\n *\n * @param domParent Position parent.\n * @param offset Position offset.\n * @returns `true` if given position is at a correct place for selection boundary, `false` otherwise.\n */\n _isDomSelectionPositionCorrect(domParent, offset) {\n // If selection is before or in the middle of inline filler string, it is incorrect.\n if (isText(domParent) && startsWithFiller(domParent) && offset < INLINE_FILLER_LENGTH) {\n // Selection in a text node, at wrong position (before or in the middle of filler).\n return false;\n }\n if (this.isElement(domParent) && startsWithFiller(domParent.childNodes[offset])) {\n // Selection in an element node, before filler text node.\n return false;\n }\n const viewParent = this.mapDomToView(domParent);\n // The position is incorrect when anchored inside a UIElement or a RawElement.\n // Note: In case of UIElement and RawElement, mapDomToView() returns a parent element for any DOM child\n // so there's no need to perform any additional checks.\n if (viewParent && (viewParent.is('uiElement') || viewParent.is('rawElement'))) {\n return false;\n }\n return true;\n }\n /**\n * Internal generator for {@link #domToView}. Also used by {@link #domChildrenToView}.\n * Separates DOM nodes conversion from whitespaces processing.\n *\n * @param domNode DOM node or document fragment to transform.\n * @param inlineNodes An array of recently encountered inline nodes truncated to the block element boundaries.\n * Used later to process whitespaces.\n */\n *_domToView(domNode, options, inlineNodes) {\n if (this.isBlockFiller(domNode)) {\n return null;\n }\n // When node is inside a UIElement or a RawElement return that parent as it's view representation.\n const hostElement = this.getHostViewElement(domNode);\n if (hostElement) {\n return hostElement;\n }\n if (isComment(domNode) && options.skipComments) {\n return null;\n }\n if (isText(domNode)) {\n if (isInlineFiller(domNode)) {\n return null;\n }\n else {\n const textData = domNode.data;\n if (textData === '') {\n return null;\n }\n const textNode = new ViewText(this.document, textData);\n inlineNodes.push(textNode);\n return textNode;\n }\n }\n else {\n let viewElement = this.mapDomToView(domNode);\n if (viewElement) {\n if (this._isInlineObjectElement(viewElement)) {\n inlineNodes.push(viewElement);\n }\n return viewElement;\n }\n if (this.isDocumentFragment(domNode)) {\n // Create view document fragment.\n viewElement = new ViewDocumentFragment(this.document);\n if (options.bind) {\n this.bindDocumentFragments(domNode, viewElement);\n }\n }\n else {\n // Create view element.\n viewElement = this._createViewElement(domNode, options);\n if (options.bind) {\n this.bindElements(domNode, viewElement);\n }\n // Copy element's attributes.\n const attrs = domNode.attributes;\n if (attrs) {\n for (let l = attrs.length, i = 0; i < l; i++) {\n viewElement._setAttribute(attrs[i].name, attrs[i].value);\n }\n }\n // Treat this element's content as a raw data if it was registered as such.\n if (this._isViewElementWithRawContent(viewElement, options)) {\n viewElement._setCustomProperty('$rawContent', domNode.innerHTML);\n if (!this._isBlockViewElement(viewElement)) {\n inlineNodes.push(viewElement);\n }\n return viewElement;\n }\n // Comment node is also treated as an element with raw data.\n if (isComment(domNode)) {\n viewElement._setCustomProperty('$rawContent', domNode.data);\n return viewElement;\n }\n }\n // Yield the element first so the flow of nested inline nodes is not reversed inside elements.\n yield viewElement;\n const nestedInlineNodes = [];\n if (options.withChildren !== false) {\n for (const child of this.domChildrenToView(domNode, options, nestedInlineNodes)) {\n viewElement._appendChild(child);\n }\n }\n // Check if this is an inline object after processing child nodes so matcher\n // for inline objects can verify if the element is empty.\n if (this._isInlineObjectElement(viewElement)) {\n inlineNodes.push(viewElement);\n }\n else {\n // It's an inline element that is not an object (like <b>, <i>) or a block element.\n for (const inlineNode of nestedInlineNodes) {\n inlineNodes.push(inlineNode);\n }\n }\n }\n }\n /**\n * Internal helper that walks the list of inline view nodes already generated from DOM nodes\n * and handles whitespaces and NBSPs.\n *\n * @param domParent The DOM parent of the given inline nodes. This should be a document fragment or\n * a block element to whitespace processing start cleaning.\n * @param inlineNodes An array of recently encountered inline nodes truncated to the block element boundaries.\n */\n _processDomInlineNodes(domParent, inlineNodes, options) {\n if (!inlineNodes.length) {\n return;\n }\n // Process text nodes only after reaching a block or document fragment,\n // do not alter whitespaces while processing an inline element like <b> or <i>.\n if (domParent && !this.isDocumentFragment(domParent) && !this._isBlockDomElement(domParent)) {\n return;\n }\n let prevNodeEndsWithSpace = false;\n for (let i = 0; i < inlineNodes.length; i++) {\n const node = inlineNodes[i];\n if (!node.is('$text')) {\n prevNodeEndsWithSpace = false;\n continue;\n }\n let data;\n let nodeEndsWithSpace = false;\n if (this._isPreFormatted(node)) {\n data = getDataWithoutFiller(node.data);\n }\n else {\n // Change all consecutive whitespace characters (from the [ \\n\\t\\r] set –\n // see https://github.com/ckeditor/ckeditor5-engine/issues/822#issuecomment-311670249) to a single space character.\n // That's how multiple whitespaces are treated when rendered, so we normalize those whitespaces.\n // We're replacing 1+ (and not 2+) to also normalize singular \\n\\t\\r characters (#822).\n data = node.data.replace(/[ \\n\\t\\r]{1,}/g, ' ');\n nodeEndsWithSpace = /[^\\S\\u00A0]/.test(data.charAt(data.length - 1));\n const prevNode = i > 0 ? inlineNodes[i - 1] : null;\n const nextNode = i + 1 < inlineNodes.length ? inlineNodes[i + 1] : null;\n const shouldLeftTrim = !prevNode || prevNode.is('element') && prevNode.name == 'br' || prevNodeEndsWithSpace;\n const shouldRightTrim = nextNode ? false : !startsWithFiller(node.data);\n // Do not try to clear whitespaces if this is flat mapping for the purpose of mutation observer and differ in rendering.\n if (options.withChildren !== false) {\n // If the previous dom text node does not exist or it ends by whitespace character, remove space character from the\n // beginning of this text node. Such space character is treated as a whitespace.\n if (shouldLeftTrim) {\n data = data.replace(/^ /, '');\n }\n // If the next text node does not exist remove space character from the end of this text node.\n if (shouldRightTrim) {\n data = data.replace(/ $/, '');\n }\n }\n // At the beginning and end of a block element, Firefox inserts normal space + <br> instead of non-breaking space.\n // This means that the text node starts/end with normal space instead of non-breaking space.\n // This causes a problem because the normal space would be removed in `.replace` calls above. To prevent that,\n // the inline filler is removed only after the data is initially processed (by the `.replace` above). See ckeditor5#692.\n data = getDataWithoutFiller(data);\n // At this point we should have removed all whitespaces from DOM text data.\n //\n // Now, We will reverse the process that happens in `_processDataFromViewText`.\n //\n // We have to change chars, that were in DOM text data because of rendering reasons, to spaces.\n // First, change all ` \\u00A0` pairs (space + ) to two spaces. DOM converter changes two spaces from model/view to\n // ` \\u00A0` to ensure proper rendering. Since here we convert back, we recognize those pairs and change them back to ` `.\n data = data.replace(/ \\u00A0/g, ' ');\n const isNextNodeInlineObjectElement = nextNode && nextNode.is('element') && nextNode.name != 'br';\n const isNextNodeStartingWithSpace = nextNode && nextNode.is('$text') && nextNode.data.charAt(0) == ' ';\n // Then, let's change the last nbsp to a space.\n if (/[ \\u00A0]\\u00A0$/.test(data) || !nextNode || isNextNodeInlineObjectElement || isNextNodeStartingWithSpace) {\n data = data.replace(/\\u00A0$/, ' ');\n }\n // Then, change character that is at the beginning of the text node to space character.\n // We do that replacement only if this is the first node or the previous node ends on whitespace character.\n if (shouldLeftTrim || prevNode && prevNode.is('element') && prevNode.name != 'br') {\n data = data.replace(/^\\u00A0/, ' ');\n }\n }\n // At this point, all whitespaces should be removed and all created for rendering reasons should be\n // changed to normal space. All left are inserted intentionally.\n if (data.length == 0 && node.parent) {\n node._remove();\n inlineNodes.splice(i, 1);\n i--;\n }\n else {\n node._data = data;\n prevNodeEndsWithSpace = nodeEndsWithSpace;\n }\n }\n inlineNodes.length = 0;\n }\n /**\n * Takes text data from a given {@link module:engine/view/text~Text#data} and processes it so\n * it is correctly displayed in the DOM.\n *\n * Following changes are done:\n *\n * * a space at the beginning is changed to ` ` if this is the first text node in its container\n * element or if a previous text node ends with a space character,\n * * space at the end of the text node is changed to ` ` if there are two spaces at the end of a node or if next node\n * starts with a space or if it is the last text node in its container,\n * * remaining spaces are replaced to a chain of spaces and ` ` (e.g. `'x x'` becomes `'x x'`).\n *\n * Content of {@link #preElements} is not processed.\n *\n * @param node View text node to process.\n * @returns Processed text data.\n */\n _processDataFromViewText(node) {\n let data = node.data;\n // If the currently processed view text node is preformatted, we should not change whitespaces.\n if (this._isPreFormatted(node)) {\n return data;\n }\n // 1. Replace the first space with a nbsp if the previous node ends with a space or there is no previous node\n // (container element boundary).\n if (data.charAt(0) == ' ') {\n const prevNode = this._getTouchingInlineViewNode(node, false);\n const prevEndsWithSpace = prevNode && prevNode.is('$textProxy') && this._nodeEndsWithSpace(prevNode);\n if (prevEndsWithSpace || !prevNode) {\n data = '\\u00A0' + data.substr(1);\n }\n }\n // 2. Replace the last space with nbsp if there are two spaces at the end or if the next node starts with space or there is no\n // next node (container element boundary).\n //\n // Keep in mind that Firefox prefers $nbsp; before tag, not inside it:\n //\n // Foo <span> bar</span> <-- bad.\n // Foo <span> bar</span> <-- good.\n //\n // More here: https://github.com/ckeditor/ckeditor5-engine/issues/1747.\n if (data.charAt(data.length - 1) == ' ') {\n const nextNode = this._getTouchingInlineViewNode(node, true);\n const nextStartsWithSpace = nextNode && nextNode.is('$textProxy') && nextNode.data.charAt(0) == ' ';\n if (data.charAt(data.length - 2) == ' ' || !nextNode || nextStartsWithSpace) {\n data = data.substr(0, data.length - 1) + '\\u00A0';\n }\n }\n // 3. Create space+nbsp pairs.\n return data.replace(/ {2}/g, ' \\u00A0');\n }\n /**\n * Checks whether given node ends with a space character after changing appropriate space characters to ` `s.\n *\n * @param node Node to check.\n * @returns `true` if given `node` ends with space, `false` otherwise.\n */\n _nodeEndsWithSpace(node) {\n if (this._isPreFormatted(node)) {\n return false;\n }\n const data = this._processDataFromViewText(node);\n return data.charAt(data.length - 1) == ' ';\n }\n /**\n * Checks whether given text contains preformatted white space. This is the case if\n * * any of node ancestors has a name which is in `preElements` array, or\n * * the closest ancestor that has the `white-space` CSS property sets it to a value that preserves spaces\n *\n * @param node Node to check\n * @returns `true` if given node contains preformatted white space, `false` otherwise.\n */\n _isPreFormatted(node) {\n if (_hasViewParentOfType(node, this.preElements)) {\n return true;\n }\n for (const ancestor of node.getAncestors({ parentFirst: true })) {\n if (!ancestor.is('element') || !ancestor.hasStyle('white-space') || ancestor.getStyle('white-space') === 'inherit') {\n continue;\n }\n // If the node contains the `white-space` property with a value that does not preserve spaces, it will take\n // precedence over any white-space settings its ancestors contain, so no further parent checking needs to\n // be done.\n return ['pre', 'pre-wrap', 'break-spaces'].includes(ancestor.getStyle('white-space'));\n }\n return false;\n }\n /**\n * Helper function. For given {@link module:engine/view/text~Text view text node}, it finds previous or next sibling\n * that is contained in the same container element. If there is no such sibling, `null` is returned.\n *\n * @param node Reference node.\n * @returns Touching text node, an inline object\n * or `null` if there is no next or previous touching text node.\n */\n _getTouchingInlineViewNode(node, getNext) {\n const treeWalker = new ViewTreeWalker({\n startPosition: getNext ? ViewPosition._createAfter(node) : ViewPosition._createBefore(node),\n direction: getNext ? 'forward' : 'backward'\n });\n for (const { item } of treeWalker) {\n // Found a text node in the same container element.\n if (item.is('$textProxy')) {\n return item;\n }\n // Found a transparent element, skip it and continue inside it.\n else if (item.is('element') && item.getCustomProperty('dataPipeline:transparentRendering')) {\n continue;\n }\n // <br> found – it works like a block boundary, so do not scan further.\n else if (item.is('element', 'br')) {\n return null;\n }\n // Found an inline object (for example an image).\n else if (this._isInlineObjectElement(item)) {\n return item;\n }\n // ViewContainerElement is found on a way to next ViewText node, so given `node` was first/last\n // text node in its container element.\n else if (item.is('containerElement')) {\n return null;\n }\n }\n return null;\n }\n /**\n * Returns `true` if a DOM node belongs to {@link #blockElements}. `false` otherwise.\n */\n _isBlockDomElement(node) {\n return this.isElement(node) && this.blockElements.includes(node.tagName.toLowerCase());\n }\n /**\n * Returns `true` if a view node belongs to {@link #blockElements}. `false` otherwise.\n */\n _isBlockViewElement(node) {\n return node.is('element') && this.blockElements.includes(node.name);\n }\n /**\n * Returns `true` if a DOM node belongs to {@link #inlineObjectElements}. `false` otherwise.\n */\n _isInlineObjectElement(node) {\n if (!node.is('element')) {\n return false;\n }\n return node.name == 'br' ||\n this.inlineObjectElements.includes(node.name) ||\n !!this._inlineObjectElementMatcher.match(node);\n }\n /**\n * Creates view element basing on the node type.\n *\n * @param node DOM node to check.\n * @param options Conversion options. See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.\n */\n _createViewElement(node, options) {\n if (isComment(node)) {\n return new ViewUIElement(this.document, '$comment');\n }\n const viewName = options.keepOriginalCase ? node.tagName : node.tagName.toLowerCase();\n return new ViewElement(this.document, viewName);\n }\n /**\n * Checks if view element's content should be treated as a raw data.\n *\n * @param viewElement View element to check.\n * @param options Conversion options. See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.\n */\n _isViewElementWithRawContent(viewElement, options) {\n return options.withChildren !== false && viewElement.is('element') && !!this._rawContentElementMatcher.match(viewElement);\n }\n /**\n * Checks whether a given element name should be renamed in a current rendering mode.\n *\n * @param elementName The name of view element.\n */\n _shouldRenameElement(elementName) {\n const name = elementName.toLowerCase();\n return this.renderingMode === 'editing' && this.unsafeElements.includes(name);\n }\n /**\n * Return a <span> element with a special attribute holding the name of the original element.\n * Optionally, copy all the attributes of the original element if that element is provided.\n *\n * @param elementName The name of view element.\n * @param originalDomElement The original DOM element to copy attributes and content from.\n */\n _createReplacementDomElement(elementName, originalDomElement) {\n const newDomElement = this._domDocument.createElement('span');\n // Mark the span replacing a script as hidden.\n newDomElement.setAttribute(UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE, elementName);\n if (originalDomElement) {\n while (originalDomElement.firstChild) {\n newDomElement.appendChild(originalDomElement.firstChild);\n }\n for (const attributeName of originalDomElement.getAttributeNames()) {\n newDomElement.setAttribute(attributeName, originalDomElement.getAttribute(attributeName));\n }\n }\n return newDomElement;\n }\n}\n/**\n * Helper function.\n * Used to check if given native `Element` or `Text` node has parent with tag name from `types` array.\n *\n * @returns`true` if such parent exists or `false` if it does not.\n */\nfunction _hasViewParentOfType(node, types) {\n return node.getAncestors().some(parent => parent.is('element') && types.includes(parent.name));\n}\n/**\n * A helper that executes given callback for each DOM node's ancestor, starting from the given node\n * and ending in document#documentElement.\n *\n * @param callback A callback to be executed for each ancestor.\n */\nfunction forEachDomElementAncestor(element, callback) {\n let node = element;\n while (node) {\n callback(node);\n node = node.parentElement;\n }\n}\n/**\n * Checks if given node is a nbsp block filler.\n *\n * A is a block filler only if it is a single child of a block element.\n *\n * @param domNode DOM node.\n */\nfunction isNbspBlockFiller(domNode, blockElements) {\n const isNBSP = domNode.isEqualNode(NBSP_FILLER_REF);\n return isNBSP && hasBlockParent(domNode, blockElements) && domNode.parentNode.childNodes.length === 1;\n}\n/**\n * Checks if domNode has block parent.\n *\n * @param domNode DOM node.\n */\nfunction hasBlockParent(domNode, blockElements) {\n const parent = domNode.parentNode;\n return !!parent && !!parent.tagName && blockElements.includes(parent.tagName.toLowerCase());\n}\n/**\n * Log to console the information about element that was replaced.\n * Check UNSAFE_ELEMENTS for all recognized unsafe elements.\n *\n * @param elementName The name of the view element.\n */\nfunction _logUnsafeElement(elementName) {\n if (elementName === 'script') {\n logWarning('domconverter-unsafe-script-element-detected');\n }\n if (elementName === 'style') {\n logWarning('domconverter-unsafe-style-element-detected');\n }\n}\n/**\n * In certain cases, Firefox mysteriously assigns so called \"restricted objects\" to native DOM Range properties.\n * Any attempt at accessing restricted object's properties causes errors.\n * See: https://github.com/ckeditor/ckeditor5/issues/9635.\n */\nfunction isGeckoRestrictedDomSelection(domSelection) {\n if (!env.isGecko) {\n return false;\n }\n if (!domSelection.rangeCount) {\n return false;\n }\n const container = domSelection.getRangeAt(0).startContainer;\n try {\n Object.prototype.toString.call(container);\n }\n catch (error) {\n return true;\n }\n return false;\n}\n/**\n * While rendering the editor content, the {@link module:engine/view/domconverter~DomConverter} detected a `<script>` element that may\n * disrupt the editing experience. To avoid this, the `<script>` element was replaced with `<span data-ck-unsafe-element=\"script\"></span>`.\n *\n * @error domconverter-unsafe-script-element-detected\n */\n/**\n * While rendering the editor content, the {@link module:engine/view/domconverter~DomConverter} detected a `<style>` element that may affect\n * the editing experience. To avoid this, the `<style>` element was replaced with `<span data-ck-unsafe-element=\"style\"></span>`.\n *\n * @error domconverter-unsafe-style-element-detected\n */\n/**\n * The {@link module:engine/view/domconverter~DomConverter} detected an interactive attribute in the\n * {@glink framework/architecture/editing-engine#editing-pipeline editing pipeline}. For the best\n * editing experience, the attribute was renamed to `data-ck-unsafe-attribute-[original attribute name]`.\n *\n * If you are the author of the plugin that generated this attribute and you want it to be preserved\n * in the editing pipeline, you can configure this when creating the element\n * using {@link module:engine/view/downcastwriter~DowncastWriter} during the\n * {@glink framework/architecture/editing-engine#conversion model–view conversion}. Methods such as\n * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},\n * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement}, or\n * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement}\n * accept an option that will disable filtering of specific attributes:\n *\n * ```ts\n * const paragraph = writer.createContainerElement( 'p',\n * \t{\n * \t\tclass: 'clickable-paragraph',\n * \t\tonclick: 'alert( \"Paragraph clicked!\" )'\n * \t},\n * \t{\n * \t\t// Make sure the \"onclick\" attribute will pass through.\n * \t\trenderUnsafeAttributes: [ 'onclick' ]\n * \t}\n * );\n * ```\n *\n * @error domconverter-unsafe-attribute-detected\n * @param domElement The DOM element the attribute was set on.\n * @param key The original name of the attribute\n * @param value The value of the original attribute\n */\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/isvalidattributename\n */\nimport global from './global.js';\n/**\n * Checks if the given attribute name is valid in terms of HTML.\n *\n * @param name Attribute name.\n */\nexport default function isValidAttributeName(name) {\n try {\n global.document.createAttribute(name);\n }\n catch (error) {\n return false;\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals Node */\n/**\n * @module utils/dom/getancestors\n */\n/**\n * Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the\n * node is a part of `DocumentFragment` that `DocumentFragment` will be returned. In contrary, if the node is\n * appended to a `Document`, that `Document` will not be returned (algorithms operating on DOM tree care for `Document#documentElement`\n * at most, which will be returned).\n *\n * @param node DOM node.\n * @returns Array of given `node` parents.\n */\nexport default function getAncestors(node) {\n const nodes = [];\n let currentNode = node;\n // We are interested in `Node`s `DocumentFragment`s only.\n while (currentNode && currentNode.nodeType != Node.DOCUMENT_NODE) {\n nodes.unshift(currentNode);\n currentNode = currentNode.parentNode;\n }\n return nodes;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/observer\n */\nimport { DomEmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary\n * processing and fire events on the {@link module:engine/view/document~Document} objects.\n * Observers can also add features to the view, for instance by updating its status or marking elements\n * which need a refresh on DOM events.\n */\nexport default class Observer extends /* #__PURE__ */ DomEmitterMixin() {\n /**\n * Creates an instance of the observer.\n */\n constructor(view) {\n super();\n /**\n * The state of the observer. If it is disabled, no events will be fired.\n */\n this._isEnabled = false;\n this.view = view;\n this.document = view.document;\n }\n /**\n * The state of the observer. If it is disabled, no events will be fired.\n */\n get isEnabled() {\n return this._isEnabled;\n }\n /**\n * Enables the observer. This method is called when the observer is registered to the\n * {@link module:engine/view/view~View} and after {@link module:engine/view/view~View#forceRender rendering}\n * (all observers are {@link #disable disabled} before rendering).\n *\n * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.\n * However, a child class may not need to be disabled, so it can implement an empty method.\n *\n * @see module:engine/view/observer/observer~Observer#disable\n */\n enable() {\n this._isEnabled = true;\n }\n /**\n * Disables the observer. This method is called before\n * {@link module:engine/view/view~View#forceRender rendering} to prevent firing events during rendering.\n *\n * @see module:engine/view/observer/observer~Observer#enable\n */\n disable() {\n this._isEnabled = false;\n }\n /**\n * Disables and destroys the observer, among others removes event listeners created by the observer.\n */\n destroy() {\n this.disable();\n this.stopListening();\n }\n /**\n * Checks whether a given DOM event should be ignored (should not be turned into a synthetic view document event).\n *\n * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.\n * This attribute can be used inside the structures generated by\n * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events\n * fired within a UI that should be excluded from CKEditor 5's realms.\n *\n * @param domTarget The DOM event target to check (usually an element, sometimes a text node and\n * potentially sometimes a document, too).\n * @returns Whether this event should be ignored by the observer.\n */\n checkShouldIgnoreEventFromTarget(domTarget) {\n if (domTarget && domTarget.nodeType === 3) {\n domTarget = domTarget.parentNode;\n }\n if (!domTarget || domTarget.nodeType !== 1) {\n return false;\n }\n return domTarget.matches('[data-cke-ignore-events], [data-cke-ignore-events] *');\n }\n}\n","import copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport keysIn from './keysIn.js';\n\n/**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\nvar assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n});\n\nexport default assignIn;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/domeventdata\n */\nimport { extend } from 'lodash-es';\n/**\n * Information about a DOM event in context of the {@link module:engine/view/document~Document}.\n * It wraps the native event, which usually should not be used as the wrapper contains\n * additional data (like key code for keyboard events).\n *\n * @typeParam TEvent The type of DOM Event that this class represents.\n */\nexport default class DomEventData {\n /**\n * @param view The instance of the view controller.\n * @param domEvent The DOM event.\n * @param additionalData Additional properties that the instance should contain.\n */\n constructor(view, domEvent, additionalData) {\n this.view = view;\n this.document = view.document;\n this.domEvent = domEvent;\n this.domTarget = domEvent.target;\n extend(this, additionalData);\n }\n /**\n * The tree view element representing the target.\n */\n get target() {\n return this.view.domConverter.mapDomToView(this.domTarget);\n }\n /**\n * Prevents the native's event default action.\n */\n preventDefault() {\n this.domEvent.preventDefault();\n }\n /**\n * Stops native event propagation.\n */\n stopPropagation() {\n this.domEvent.stopPropagation();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/domeventobserver\n */\nimport Observer from './observer.js';\nimport DomEventData from './domeventdata.js';\n/**\n * Base class for DOM event observers. This class handles\n * {@link module:engine/view/observer/observer~Observer#observe adding} listeners to DOM elements,\n * {@link module:engine/view/observer/observer~Observer#disable disabling} and\n * {@link module:engine/view/observer/observer~Observer#enable re-enabling} events.\n * Child class needs to define\n * {@link module:engine/view/observer/domeventobserver~DomEventObserver#domEventType DOM event type} and\n * {@link module:engine/view/observer/domeventobserver~DomEventObserver#onDomEvent callback}.\n *\n * For instance:\n *\n * ```ts\n * class ClickObserver extends DomEventObserver<'click'> {\n * \t// It can also be defined as a normal property in the constructor.\n * \tget domEventType(): 'click' {\n * \t\treturn 'click';\n * \t}\n *\n * \tonDomEvent( domEvent: MouseEvent ): void {\n * \t\tthis.fire( 'click', domEvent );\n * \t}\n * }\n * ```\n *\n * @typeParam EventType DOM Event type name or an union of those.\n * @typeParam AdditionalData Additional data passed along with the event.\n */\nexport default class DomEventObserver extends Observer {\n constructor() {\n super(...arguments);\n /**\n * If set to `true` DOM events will be listened on the capturing phase.\n * Default value is `false`.\n */\n this.useCapture = false;\n }\n /**\n * @inheritDoc\n */\n observe(domElement) {\n const types = typeof this.domEventType == 'string' ? [this.domEventType] : this.domEventType;\n types.forEach(type => {\n this.listenTo(domElement, type, (eventInfo, domEvent) => {\n if (this.isEnabled && !this.checkShouldIgnoreEventFromTarget(domEvent.target)) {\n this.onDomEvent(domEvent);\n }\n }, { useCapture: this.useCapture });\n });\n }\n /**\n * @inheritDoc\n */\n stopObserving(domElement) {\n this.stopListening(domElement);\n }\n /**\n * Calls `Document#fire()` if observer {@link #isEnabled is enabled}.\n *\n * @see module:utils/emittermixin~Emitter#fire\n * @param eventType The event type (name).\n * @param domEvent The DOM event.\n * @param additionalData The additional data which should extend the\n * {@link module:engine/view/observer/domeventdata~DomEventData event data} object.\n */\n fire(eventType, domEvent, additionalData) {\n if (this.isEnabled) {\n this.document.fire(eventType, new DomEventData(this.view, domEvent, additionalData));\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/keyobserver\n */\nimport DomEventObserver from './domeventobserver.js';\nimport { getCode } from '@ckeditor/ckeditor5-utils';\n/**\n * Observer for events connected with pressing keyboard keys.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class KeyObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = ['keydown', 'keyup'];\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvt) {\n const data = {\n keyCode: domEvt.keyCode,\n altKey: domEvt.altKey,\n ctrlKey: domEvt.ctrlKey,\n shiftKey: domEvt.shiftKey,\n metaKey: domEvt.metaKey,\n get keystroke() {\n return getCode(this);\n }\n };\n this.fire(domEvt.type, domEvt, data);\n }\n}\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/fakeselectionobserver\n */\nimport Observer from './observer.js';\nimport ViewSelection from '../selection.js';\nimport { keyCodes } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\n/**\n * Fake selection observer class. If view selection is fake it is placed in dummy DOM container. This observer listens\n * on {@link module:engine/view/document~Document#event:keydown keydown} events and handles moving fake view selection to the correct place\n * if arrow keys are pressed.\n * Fires {@link module:engine/view/document~Document#event:selectionChange selectionChange event} simulating natural behaviour of\n * {@link module:engine/view/observer/selectionobserver~SelectionObserver SelectionObserver}.\n */\nexport default class FakeSelectionObserver extends Observer {\n /**\n * Creates new FakeSelectionObserver instance.\n */\n constructor(view) {\n super(view);\n this._fireSelectionChangeDoneDebounced = debounce(data => {\n this.document.fire('selectionChangeDone', data);\n }, 200);\n }\n /**\n * @inheritDoc\n */\n observe() {\n const document = this.document;\n document.on('arrowKey', (eventInfo, data) => {\n const selection = document.selection;\n if (selection.isFake && this.isEnabled) {\n // Prevents default key down handling - no selection change will occur.\n data.preventDefault();\n }\n }, { context: '$capture' });\n document.on('arrowKey', (eventInfo, data) => {\n const selection = document.selection;\n if (selection.isFake && this.isEnabled) {\n this._handleSelectionMove(data.keyCode);\n }\n }, { priority: 'lowest' });\n }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._fireSelectionChangeDoneDebounced.cancel();\n }\n /**\n * Handles collapsing view selection according to given key code. If left or up key is provided - new selection will be\n * collapsed to left. If right or down key is pressed - new selection will be collapsed to right.\n *\n * This method fires {@link module:engine/view/document~Document#event:selectionChange} and\n * {@link module:engine/view/document~Document#event:selectionChangeDone} events imitating behaviour of\n * {@link module:engine/view/observer/selectionobserver~SelectionObserver}.\n */\n _handleSelectionMove(keyCode) {\n const selection = this.document.selection;\n const newSelection = new ViewSelection(selection.getRanges(), { backward: selection.isBackward, fake: false });\n // Left or up arrow pressed - move selection to start.\n if (keyCode == keyCodes.arrowleft || keyCode == keyCodes.arrowup) {\n newSelection.setTo(newSelection.getFirstPosition());\n }\n // Right or down arrow pressed - move selection to end.\n if (keyCode == keyCodes.arrowright || keyCode == keyCodes.arrowdown) {\n newSelection.setTo(newSelection.getLastPosition());\n }\n const data = {\n oldSelection: selection,\n newSelection,\n domSelection: null\n };\n // Fire dummy selection change event.\n this.document.fire('selectionChange', data);\n // Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.\n // This function is debounced what means that `selectionChangeDone` event will be fired only when\n // defined int the function time will elapse since the last time the function was called.\n // So `selectionChangeDone` will be fired when selection will stop changing.\n this._fireSelectionChangeDoneDebounced(data);\n }\n}\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\nfunction isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n}\n\nexport default isEqualWith;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/mutationobserver\n */\n/* globals window */\nimport Observer from './observer.js';\nimport { startsWithFiller } from '../filler.js';\nimport { isEqualWith } from 'lodash-es';\n// @if CK_DEBUG_TYPING // const { _debouncedLine } = require( '../../dev-utils/utils.js' );\n/**\n * Mutation observer's role is to watch for any DOM changes inside the editor that weren't\n * done by the editor's {@link module:engine/view/renderer~Renderer} itself and reverting these changes.\n *\n * It does this by observing all mutations in the DOM, marking related view elements as changed and calling\n * {@link module:engine/view/renderer~Renderer#render}. Because all mutated nodes are marked as\n * \"to be rendered\" and the {@link module:engine/view/renderer~Renderer#render `render()`} method is called,\n * all changes are reverted in the DOM (the DOM is synced with the editor's view structure).\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class MutationObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n this._config = {\n childList: true,\n characterData: true,\n subtree: true\n };\n this.domConverter = view.domConverter;\n this._domElements = new Set();\n this._mutationObserver = new window.MutationObserver(this._onMutations.bind(this));\n }\n /**\n * Synchronously handles mutations and empties the queue.\n */\n flush() {\n this._onMutations(this._mutationObserver.takeRecords());\n }\n /**\n * @inheritDoc\n */\n observe(domElement) {\n this._domElements.add(domElement);\n if (this.isEnabled) {\n this._mutationObserver.observe(domElement, this._config);\n }\n }\n /**\n * @inheritDoc\n */\n stopObserving(domElement) {\n this._domElements.delete(domElement);\n if (this.isEnabled) {\n // Unfortunately, it is not possible to stop observing particular DOM element.\n // In order to stop observing one of multiple DOM elements, we need to re-connect the mutation observer.\n this._mutationObserver.disconnect();\n for (const domElement of this._domElements) {\n this._mutationObserver.observe(domElement, this._config);\n }\n }\n }\n /**\n * @inheritDoc\n */\n enable() {\n super.enable();\n for (const domElement of this._domElements) {\n this._mutationObserver.observe(domElement, this._config);\n }\n }\n /**\n * @inheritDoc\n */\n disable() {\n super.disable();\n this._mutationObserver.disconnect();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._mutationObserver.disconnect();\n }\n /**\n * Handles mutations. Mark view elements to sync and call render.\n *\n * @param domMutations Array of native mutations.\n */\n _onMutations(domMutations) {\n // As a result of this.flush() we can have an empty collection.\n if (domMutations.length === 0) {\n return;\n }\n const domConverter = this.domConverter;\n // Use map and set for deduplication.\n const mutatedTextNodes = new Set();\n const elementsWithMutatedChildren = new Set();\n // Handle `childList` mutations first, so we will be able to check if the `characterData` mutation is in the\n // element with changed structure anyway.\n for (const mutation of domMutations) {\n const element = domConverter.mapDomToView(mutation.target);\n if (!element) {\n continue;\n }\n // Do not collect mutations from UIElements and RawElements.\n if (element.is('uiElement') || element.is('rawElement')) {\n continue;\n }\n if (mutation.type === 'childList' && !this._isBogusBrMutation(mutation)) {\n elementsWithMutatedChildren.add(element);\n }\n }\n // Handle `characterData` mutations later, when we have the full list of nodes which changed structure.\n for (const mutation of domMutations) {\n const element = domConverter.mapDomToView(mutation.target);\n // Do not collect mutations from UIElements and RawElements.\n if (element && (element.is('uiElement') || element.is('rawElement'))) {\n continue;\n }\n if (mutation.type === 'characterData') {\n const text = domConverter.findCorrespondingViewText(mutation.target);\n if (text && !elementsWithMutatedChildren.has(text.parent)) {\n mutatedTextNodes.add(text);\n }\n // When we added first letter to the text node which had only inline filler, for the DOM it is mutation\n // on text, but for the view, where filler text node did not exist, new text node was created, so we\n // need to handle it as a 'children' mutation instead of 'text'.\n else if (!text && startsWithFiller(mutation.target)) {\n elementsWithMutatedChildren.add(domConverter.mapDomToView(mutation.target.parentNode));\n }\n }\n }\n // Now we build the list of mutations to mark elements. We did not do it earlier to avoid marking the\n // same node multiple times in case of duplication.\n const mutations = [];\n for (const textNode of mutatedTextNodes) {\n mutations.push({ type: 'text', node: textNode });\n }\n for (const viewElement of elementsWithMutatedChildren) {\n const domElement = domConverter.mapViewToDom(viewElement);\n const viewChildren = Array.from(viewElement.getChildren());\n const newViewChildren = Array.from(domConverter.domChildrenToView(domElement, { withChildren: false }));\n // It may happen that as a result of many changes (sth was inserted and then removed),\n // both elements haven't really changed. #1031\n if (!isEqualWith(viewChildren, newViewChildren, sameNodes)) {\n mutations.push({ type: 'children', node: viewElement });\n }\n }\n // In case only non-relevant mutations were recorded it skips the event and force render (#5600).\n if (mutations.length) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \t_debouncedLine();\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[MutationObserver]%c Mutations detected',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green', 'font-weight: bold'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n this.document.fire('mutations', { mutations });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n }\n /**\n * Checks if mutation was generated by the browser inserting bogus br on the end of the block element.\n * Such mutations are generated while pressing space or performing native spellchecker correction\n * on the end of the block element in Firefox browser.\n *\n * @param mutation Native mutation object.\n */\n _isBogusBrMutation(mutation) {\n let addedNode = null;\n // Check if mutation added only one node on the end of its parent.\n if (mutation.nextSibling === null && mutation.removedNodes.length === 0 && mutation.addedNodes.length == 1) {\n addedNode = this.domConverter.domToView(mutation.addedNodes[0], {\n withChildren: false\n });\n }\n return addedNode && addedNode.is('element', 'br');\n }\n}\nfunction sameNodes(child1, child2) {\n // First level of comparison (array of children vs array of children) – use the Lodash's default behavior.\n if (Array.isArray(child1)) {\n return;\n }\n // Elements.\n if (child1 === child2) {\n return true;\n }\n // Texts.\n else if (child1.is('$text') && child2.is('$text')) {\n return child1.data === child2.data;\n }\n // Not matching types.\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/focusobserver\n */\n/* globals setTimeout, clearTimeout */\nimport DomEventObserver from './domeventobserver.js';\n/**\n * {@link module:engine/view/document~Document#event:focus Focus}\n * and {@link module:engine/view/document~Document#event:blur blur} events observer.\n * Focus observer handle also {@link module:engine/view/rooteditableelement~RootEditableElement#isFocused isFocused} property of the\n * {@link module:engine/view/rooteditableelement~RootEditableElement root elements}.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class FocusObserver extends DomEventObserver {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n /**\n * Identifier of the timeout currently used by focus listener to delay rendering execution.\n */\n this._renderTimeoutId = null;\n /**\n * Set to `true` if the document is in the process of setting the focus.\n *\n * The flag is used to indicate that setting the focus is in progress.\n */\n this._isFocusChanging = false;\n /**\n * @inheritDoc\n */\n this.domEventType = ['focus', 'blur'];\n this.useCapture = true;\n const document = this.document;\n document.on('focus', () => this._handleFocus());\n document.on('blur', (evt, data) => this._handleBlur(data));\n // Focus the editor in cases where browser dispatches `beforeinput` event to a not-focused editable element.\n // This is flushed by the beforeinput listener in the `InsertTextObserver`.\n // Note that focus is set only if the document is not focused yet.\n // See https://github.com/ckeditor/ckeditor5/issues/14702.\n document.on('beforeinput', () => {\n if (!document.isFocused) {\n this._handleFocus();\n }\n }, { priority: 'highest' });\n }\n /**\n * Finishes setting the document focus state.\n */\n flush() {\n if (this._isFocusChanging) {\n this._isFocusChanging = false;\n this.document.isFocused = true;\n }\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n this.fire(domEvent.type, domEvent);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this._clearTimeout();\n super.destroy();\n }\n /**\n * The `focus` event handler.\n */\n _handleFocus() {\n this._clearTimeout();\n this._isFocusChanging = true;\n // Unfortunately native `selectionchange` event is fired asynchronously.\n // We need to wait until `SelectionObserver` handle the event and then render. Otherwise rendering will\n // overwrite new DOM selection with selection from the view.\n // See https://github.com/ckeditor/ckeditor5-engine/issues/795 for more details.\n // Long timeout is needed to solve #676 and https://github.com/ckeditor/ckeditor5-engine/issues/1157 issues.\n //\n // Using `view.change()` instead of `view.forceRender()` to prevent double rendering\n // in a situation where `selectionchange` already caused selection change.\n this._renderTimeoutId = setTimeout(() => {\n this._renderTimeoutId = null;\n this.flush();\n this.view.change(() => { });\n }, 50);\n }\n /**\n * The `blur` event handler.\n */\n _handleBlur(data) {\n const selectedEditable = this.document.selection.editableElement;\n if (selectedEditable === null || selectedEditable === data.target) {\n this.document.isFocused = false;\n this._isFocusChanging = false;\n // Re-render the document to update view elements\n // (changing document.isFocused already marked view as changed since last rendering).\n this.view.change(() => { });\n }\n }\n /**\n * Clears timeout.\n */\n _clearTimeout() {\n if (this._renderTimeoutId) {\n clearTimeout(this._renderTimeoutId);\n this._renderTimeoutId = null;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/selectionobserver\n */\n/* global setInterval, clearInterval */\nimport Observer from './observer.js';\nimport MutationObserver from './mutationobserver.js';\nimport FocusObserver from './focusobserver.js';\nimport { env } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\n/**\n * Selection observer class observes selection changes in the document. If a selection changes on the document this\n * observer checks if the DOM selection is different from the {@link module:engine/view/document~Document#selection view selection}.\n * The selection observer fires {@link module:engine/view/document~Document#event:selectionChange} event only if\n * a selection change was the only change in the document and the DOM selection is different from the view selection.\n *\n * This observer also manages the {@link module:engine/view/document~Document#isSelecting} property of the view document.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class SelectionObserver extends Observer {\n constructor(view) {\n super(view);\n this.mutationObserver = view.getObserver(MutationObserver);\n this.focusObserver = view.getObserver(FocusObserver);\n this.selection = this.document.selection;\n this.domConverter = view.domConverter;\n this._documents = new WeakSet();\n this._fireSelectionChangeDoneDebounced = debounce(data => {\n this.document.fire('selectionChangeDone', data);\n }, 200);\n this._clearInfiniteLoopInterval = setInterval(() => this._clearInfiniteLoop(), 1000);\n this._documentIsSelectingInactivityTimeoutDebounced = debounce(() => (this.document.isSelecting = false), 5000);\n this._loopbackCounter = 0;\n }\n /**\n * @inheritDoc\n */\n observe(domElement) {\n const domDocument = domElement.ownerDocument;\n const startDocumentIsSelecting = () => {\n this.document.isSelecting = true;\n // Let's activate the safety timeout each time the document enters the \"is selecting\" state.\n this._documentIsSelectingInactivityTimeoutDebounced();\n };\n const endDocumentIsSelecting = () => {\n if (!this.document.isSelecting) {\n return;\n }\n // Make sure that model selection is up-to-date at the end of selecting process.\n // Sometimes `selectionchange` events could arrive after the `mouseup` event and that selection could be already outdated.\n this._handleSelectionChange(domDocument);\n this.document.isSelecting = false;\n // The safety timeout can be canceled when the document leaves the \"is selecting\" state.\n this._documentIsSelectingInactivityTimeoutDebounced.cancel();\n };\n // The document has the \"is selecting\" state while the user keeps making (extending) the selection\n // (e.g. by holding the mouse button and moving the cursor). The state resets when they either released\n // the mouse button or interrupted the process by pressing or releasing any key.\n this.listenTo(domElement, 'selectstart', startDocumentIsSelecting, { priority: 'highest' });\n this.listenTo(domElement, 'keydown', endDocumentIsSelecting, { priority: 'highest', useCapture: true });\n this.listenTo(domElement, 'keyup', endDocumentIsSelecting, { priority: 'highest', useCapture: true });\n // Add document-wide listeners only once. This method could be called for multiple editing roots.\n if (this._documents.has(domDocument)) {\n return;\n }\n // This listener is using capture mode to make sure that selection is upcasted before any other\n // handler would like to check it and update (for example table multi cell selection).\n this.listenTo(domDocument, 'mouseup', endDocumentIsSelecting, { priority: 'highest', useCapture: true });\n this.listenTo(domDocument, 'selectionchange', (evt, domEvent) => {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \t_debouncedLine();\n // @if CK_DEBUG_TYPING // \tconst domSelection = domDocument.defaultView!.getSelection();\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[SelectionObserver]%c selectionchange', 'color: green', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[SelectionObserver]%c DOM Selection:', 'font-weight: bold; color: green', '',\n // @if CK_DEBUG_TYPING // \t\t{ node: domSelection!.anchorNode, offset: domSelection!.anchorOffset },\n // @if CK_DEBUG_TYPING // \t\t{ node: domSelection!.focusNode, offset: domSelection!.focusOffset }\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // The Renderer is disabled while composing on non-android browsers, so we can't update the view selection\n // because the DOM and view tree drifted apart. Position mapping could fail because of it.\n if (this.document.isComposing && !env.isAndroid) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[SelectionObserver]%c Selection change ignored (isComposing)',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n return;\n }\n this._handleSelectionChange(domDocument);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n // Defer the safety timeout when the selection changes (e.g. the user keeps extending the selection\n // using their mouse).\n this._documentIsSelectingInactivityTimeoutDebounced();\n });\n // Update the model DocumentSelection just after the Renderer and the SelectionObserver are locked.\n // We do this synchronously (without waiting for the `selectionchange` DOM event) as browser updates\n // the DOM selection (but not visually) to span the text that is under composition and could be replaced.\n this.listenTo(this.view.document, 'compositionstart', () => {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconst domSelection = domDocument.defaultView!.getSelection();\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[SelectionObserver]%c update selection on compositionstart', 'color: green', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[SelectionObserver]%c DOM Selection:', 'font-weight: bold; color: green', '',\n // @if CK_DEBUG_TYPING // \t\t{ node: domSelection!.anchorNode, offset: domSelection!.anchorOffset },\n // @if CK_DEBUG_TYPING // \t\t{ node: domSelection!.focusNode, offset: domSelection!.focusOffset }\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n this._handleSelectionChange(domDocument);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }, { priority: 'lowest' });\n this._documents.add(domDocument);\n }\n /**\n * @inheritDoc\n */\n stopObserving(domElement) {\n this.stopListening(domElement);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n clearInterval(this._clearInfiniteLoopInterval);\n this._fireSelectionChangeDoneDebounced.cancel();\n this._documentIsSelectingInactivityTimeoutDebounced.cancel();\n }\n /* istanbul ignore next -- @preserve */\n _reportInfiniteLoop() {\n // @if CK_DEBUG //\t\tthrow new Error(\n // @if CK_DEBUG //\t\t\t'Selection change observer detected an infinite rendering loop.\\n\\n' +\n // @if CK_DEBUG //\t \t\t'âš ï¸âš ï¸ Report this error on https://github.com/ckeditor/ckeditor5/issues/11658.'\n // @if CK_DEBUG //\t\t);\n }\n /**\n * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if\n * a selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change\n * and {@link module:engine/view/document~Document#event:selectionChangeDone} when a selection stop changing.\n *\n * @param domDocument DOM document.\n */\n _handleSelectionChange(domDocument) {\n if (!this.isEnabled) {\n return;\n }\n const domSelection = domDocument.defaultView.getSelection();\n if (this.checkShouldIgnoreEventFromTarget(domSelection.anchorNode)) {\n return;\n }\n // Ensure the mutation event will be before selection event on all browsers.\n this.mutationObserver.flush();\n const newViewSelection = this.domConverter.domSelectionToView(domSelection);\n // Do not convert selection change if the new view selection has no ranges in it.\n //\n // It means that the DOM selection is in some way incorrect. Ranges that were in the DOM selection could not be\n // converted to the view. This happens when the DOM selection was moved outside of the editable element.\n if (newViewSelection.rangeCount == 0) {\n this.view.hasDomSelection = false;\n return;\n }\n this.view.hasDomSelection = true;\n // Mark the latest focus change as complete (we got new selection after the focus so the selection is in the focused element).\n this.focusObserver.flush();\n if (this.selection.isEqual(newViewSelection) && this.domConverter.isDomSelectionCorrect(domSelection)) {\n return;\n }\n // Ensure we are not in the infinite loop (#400).\n // This counter is reset each second. 60 selection changes in 1 second is enough high number\n // to be very difficult (impossible) to achieve using just keyboard keys (during normal editor use).\n if (++this._loopbackCounter > 60) {\n // Selection change observer detected an infinite rendering loop.\n // Most probably you try to put the selection in the position which is not allowed\n // by the browser and browser fixes it automatically what causes `selectionchange` event on\n // which a loopback through a model tries to re-render the wrong selection and again.\n this._reportInfiniteLoop();\n return;\n }\n if (this.selection.isSimilar(newViewSelection)) {\n // If selection was equal and we are at this point of algorithm, it means that it was incorrect.\n // Just re-render it, no need to fire any events, etc.\n this.view.forceRender();\n }\n else {\n const data = {\n oldSelection: this.selection,\n newSelection: newViewSelection,\n domSelection\n };\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[SelectionObserver]%c Fire selection change:',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green', '',\n // @if CK_DEBUG_TYPING // \t\tnewViewSelection.getFirstRange()\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // Prepare data for new selection and fire appropriate events.\n this.document.fire('selectionChange', data);\n // Call `#_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.\n // This function is debounced what means that `selectionChangeDone` event will be fired only when\n // defined int the function time will elapse since the last time the function was called.\n // So `selectionChangeDone` will be fired when selection will stop changing.\n this._fireSelectionChangeDoneDebounced(data);\n }\n }\n /**\n * Clears `SelectionObserver` internal properties connected with preventing infinite loop.\n */\n _clearInfiniteLoop() {\n this._loopbackCounter = 0;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/compositionobserver\n */\nimport DomEventObserver from './domeventobserver.js';\n// @if CK_DEBUG_TYPING // const { _debouncedLine } = require( '../../dev-utils/utils.js' );\n/**\n * {@link module:engine/view/document~Document#event:compositionstart Compositionstart},\n * {@link module:engine/view/document~Document#event:compositionupdate compositionupdate} and\n * {@link module:engine/view/document~Document#event:compositionend compositionend} events observer.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class CompositionObserver extends DomEventObserver {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n /**\n * @inheritDoc\n */\n this.domEventType = ['compositionstart', 'compositionupdate', 'compositionend'];\n const document = this.document;\n document.on('compositionstart', () => {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[CompositionObserver] ' +\n // @if CK_DEBUG_TYPING // \t\t'┌───────────────────────────── isComposing = true ─────────────────────────────â”',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n document.isComposing = true;\n }, { priority: 'low' });\n document.on('compositionend', () => {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[CompositionObserver] ' +\n // @if CK_DEBUG_TYPING // \t\t'└───────────────────────────── isComposing = false ─────────────────────────────┘',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n document.isComposing = false;\n }, { priority: 'low' });\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \t_debouncedLine();\n // @if CK_DEBUG_TYPING // \tconsole.group( `%c[CompositionObserver]%c ${ domEvent.type }`, 'color: green', '' );\n // @if CK_DEBUG_TYPING // }\n this.fire(domEvent.type, domEvent, {\n data: domEvent.data\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.\n */\nexport default class DataTransfer {\n /**\n * @param nativeDataTransfer The native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.\n * @param options.cacheFiles Whether `files` list should be initialized in the constructor.\n */\n constructor(nativeDataTransfer, options = {}) {\n // We should store references to the File instances in case someone would like to process this files\n // outside the event handler. Files are stored only for `drop` and `paste` events because they are not usable\n // in other events and are generating a huge delay on Firefox while dragging.\n // See https://github.com/ckeditor/ckeditor5/issues/13366.\n this._files = options.cacheFiles ? getFiles(nativeDataTransfer) : null;\n this._native = nativeDataTransfer;\n }\n /**\n * The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.\n */\n get files() {\n if (!this._files) {\n this._files = getFiles(this._native);\n }\n return this._files;\n }\n /**\n * Returns an array of available native content types.\n */\n get types() {\n return this._native.types;\n }\n /**\n * Gets the data from the data transfer by its MIME type.\n *\n * ```ts\n * dataTransfer.getData( 'text/plain' );\n * ```\n *\n * @param type The MIME type. E.g. `text/html` or `text/plain`.\n */\n getData(type) {\n return this._native.getData(type);\n }\n /**\n * Sets the data in the data transfer.\n *\n * @param type The MIME type. E.g. `text/html` or `text/plain`.\n */\n setData(type, data) {\n this._native.setData(type, data);\n }\n /**\n * The effect that is allowed for a drag operation.\n */\n set effectAllowed(value) {\n this._native.effectAllowed = value;\n }\n get effectAllowed() {\n return this._native.effectAllowed;\n }\n /**\n * The actual drop effect.\n */\n set dropEffect(value) {\n this._native.dropEffect = value;\n }\n get dropEffect() {\n return this._native.dropEffect;\n }\n /**\n * Set a preview image of the dragged content.\n */\n setDragImage(image, x, y) {\n this._native.setDragImage(image, x, y);\n }\n /**\n * Whether the dragging operation was canceled.\n */\n get isCanceled() {\n return this._native.dropEffect == 'none' || !!this._native.mozUserCancelled;\n }\n}\nfunction getFiles(nativeDataTransfer) {\n // DataTransfer.files and items are array-like and might not have an iterable interface.\n const files = Array.from(nativeDataTransfer.files || []);\n const items = Array.from(nativeDataTransfer.items || []);\n if (files.length) {\n return files;\n }\n // Chrome has empty DataTransfer.files, but allows getting files through the items interface.\n return items\n .filter(item => item.kind === 'file')\n .map(item => item.getAsFile());\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/inputobserver\n */\nimport DomEventObserver from './domeventobserver.js';\nimport DataTransfer from '../datatransfer.js';\nimport { env } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_TYPING // const { _debouncedLine } = require( '../../dev-utils/utils.js' );\n/**\n * Observer for events connected with data input.\n *\n * **Note**: This observer is attached by {@link module:engine/view/view~View} and available by default in all\n * editor instances.\n */\nexport default class InputObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = 'beforeinput';\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \t_debouncedLine();\n // @if CK_DEBUG_TYPING // \tconsole.group( `%c[InputObserver]%c ${ domEvent.type }: ${ domEvent.inputType }`,\n // @if CK_DEBUG_TYPING // \t\t'color: green', 'color: default'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n const domTargetRanges = domEvent.getTargetRanges();\n const view = this.view;\n const viewDocument = view.document;\n let dataTransfer = null;\n let data = null;\n let targetRanges = [];\n if (domEvent.dataTransfer) {\n dataTransfer = new DataTransfer(domEvent.dataTransfer);\n }\n if (domEvent.data !== null) {\n data = domEvent.data;\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( `%c[InputObserver]%c event data: %c${ JSON.stringify( data ) }`,\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-weight: bold', 'color: blue;'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n else if (dataTransfer) {\n data = dataTransfer.getData('text/plain');\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( `%c[InputObserver]%c event data transfer: %c${ JSON.stringify( data ) }`,\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-weight: bold', 'color: blue;'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n // If the editor selection is fake (an object is selected), the DOM range does not make sense because it is anchored\n // in the fake selection container.\n if (viewDocument.selection.isFake) {\n // Future-proof: in case of multi-range fake selections being possible.\n targetRanges = Array.from(viewDocument.selection.getRanges());\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[InputObserver]%c using fake selection:',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-weight: bold', targetRanges,\n // @if CK_DEBUG_TYPING // \t\tviewDocument.selection.isFake ? 'fake view selection' : 'fake DOM parent'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n else if (domTargetRanges.length) {\n targetRanges = domTargetRanges.map(domRange => {\n // Sometimes browser provides range that starts before editable node.\n // We try to fall back to collapsed range at the valid end position.\n // See https://github.com/ckeditor/ckeditor5/issues/14411.\n // See https://github.com/ckeditor/ckeditor5/issues/14050.\n const viewStart = view.domConverter.domPositionToView(domRange.startContainer, domRange.startOffset);\n const viewEnd = view.domConverter.domPositionToView(domRange.endContainer, domRange.endOffset);\n if (viewStart) {\n return view.createRange(viewStart, viewEnd);\n }\n else if (viewEnd) {\n return view.createRange(viewEnd);\n }\n }).filter((range) => !!range);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[InputObserver]%c using target ranges:',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-weight: bold', targetRanges\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n // For Android devices we use a fallback to the current DOM selection, Android modifies it according\n // to the expected target ranges of input event.\n else if (env.isAndroid) {\n const domSelection = domEvent.target.ownerDocument.defaultView.getSelection();\n targetRanges = Array.from(view.domConverter.domSelectionToView(domSelection).getRanges());\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[InputObserver]%c using selection ranges:',\n // @if CK_DEBUG_TYPING // \t\t'color: green; font-weight: bold', 'font-weight: bold', targetRanges\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n // Android sometimes fires insertCompositionText with a new-line character at the end of the data\n // instead of firing insertParagraph beforeInput event.\n // Fire the correct type of beforeInput event and ignore the replaced fragment of text because\n // it wants to replace \"test\" with \"test\\n\".\n // https://github.com/ckeditor/ckeditor5/issues/12368.\n if (env.isAndroid && domEvent.inputType == 'insertCompositionText' && data && data.endsWith('\\n')) {\n this.fire(domEvent.type, domEvent, {\n inputType: 'insertParagraph',\n targetRanges: [view.createRange(targetRanges[0].end)]\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // Normalize the insertText data that includes new-line characters.\n // https://github.com/ckeditor/ckeditor5/issues/2045.\n if (domEvent.inputType == 'insertText' && data && data.includes('\\n')) {\n // There might be a single new-line or double for new paragraph, but we translate\n // it to paragraphs as it is our default action for enter handling.\n const parts = data.split(/\\n{1,2}/g);\n let partTargetRanges = targetRanges;\n for (let i = 0; i < parts.length; i++) {\n const dataPart = parts[i];\n if (dataPart != '') {\n this.fire(domEvent.type, domEvent, {\n data: dataPart,\n dataTransfer,\n targetRanges: partTargetRanges,\n inputType: domEvent.inputType,\n isComposing: domEvent.isComposing\n });\n // Use the result view selection so following events will be added one after another.\n partTargetRanges = [viewDocument.selection.getFirstRange()];\n }\n if (i + 1 < parts.length) {\n this.fire(domEvent.type, domEvent, {\n inputType: 'insertParagraph',\n targetRanges: partTargetRanges\n });\n // Use the result view selection so following events will be added one after another.\n partTargetRanges = [viewDocument.selection.getFirstRange()];\n }\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // Fire the normalized beforeInput event.\n this.fire(domEvent.type, domEvent, {\n data,\n dataTransfer,\n targetRanges,\n inputType: domEvent.inputType,\n isComposing: domEvent.isComposing\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/arrowkeysobserver\n */\nimport Observer from './observer.js';\nimport BubblingEventInfo from './bubblingeventinfo.js';\nimport { isArrowKeyCode } from '@ckeditor/ckeditor5-utils';\n/**\n * Arrow keys observer introduces the {@link module:engine/view/document~Document#event:arrowKey `Document#arrowKey`} event.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class ArrowKeysObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n this.document.on('keydown', (event, data) => {\n if (this.isEnabled && isArrowKeyCode(data.keyCode)) {\n const eventInfo = new BubblingEventInfo(this.document, 'arrowKey', this.document.selection.getFirstRange());\n this.document.fire(eventInfo, data);\n if (eventInfo.stop.called) {\n event.stop();\n }\n }\n });\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport Observer from './observer.js';\nimport BubblingEventInfo from './bubblingeventinfo.js';\nimport { keyCodes } from '@ckeditor/ckeditor5-utils';\n/**\n * Tab observer introduces the {@link module:engine/view/document~Document#event:tab `Document#tab`} event.\n *\n * Note that because {@link module:engine/view/observer/tabobserver~TabObserver} is attached by the\n * {@link module:engine/view/view~View}, this event is available by default.\n */\nexport default class TabObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n const doc = this.document;\n doc.on('keydown', (evt, data) => {\n if (!this.isEnabled ||\n data.keyCode != keyCodes.tab ||\n data.ctrlKey) {\n return;\n }\n const event = new BubblingEventInfo(doc, 'tab', doc.selection.getFirstRange());\n doc.fire(event, data);\n if (event.stop.called) {\n evt.stop();\n }\n });\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/view\n */\nimport Document from './document.js';\nimport DowncastWriter from './downcastwriter.js';\nimport Renderer from './renderer.js';\nimport DomConverter from './domconverter.js';\nimport Position from './position.js';\nimport Range from './range.js';\nimport Selection from './selection.js';\nimport KeyObserver from './observer/keyobserver.js';\nimport FakeSelectionObserver from './observer/fakeselectionobserver.js';\nimport MutationObserver from './observer/mutationobserver.js';\nimport SelectionObserver from './observer/selectionobserver.js';\nimport FocusObserver from './observer/focusobserver.js';\nimport CompositionObserver from './observer/compositionobserver.js';\nimport InputObserver from './observer/inputobserver.js';\nimport ArrowKeysObserver from './observer/arrowkeysobserver.js';\nimport TabObserver from './observer/tabobserver.js';\nimport { CKEditorError, env, ObservableMixin, scrollViewportToShowTarget } from '@ckeditor/ckeditor5-utils';\nimport { injectUiElementHandling } from './uielement.js';\nimport { injectQuirksHandling } from './filler.js';\nimport { cloneDeep } from 'lodash-es';\n/**\n * Editor's view controller class. Its main responsibility is DOM - View management for editing purposes, to provide\n * abstraction over the DOM structure and events and hide all browsers quirks.\n *\n * View controller renders view document to DOM whenever view structure changes. To determine when view can be rendered,\n * all changes need to be done using the {@link module:engine/view/view~View#change} method, using\n * {@link module:engine/view/downcastwriter~DowncastWriter}:\n *\n * ```ts\n * view.change( writer => {\n * \twriter.insert( position, writer.createText( 'foo' ) );\n * } );\n * ```\n *\n * View controller also register {@link module:engine/view/observer/observer~Observer observers} which observes changes\n * on DOM and fire events on the {@link module:engine/view/document~Document Document}.\n * Note that the following observers are added by the class constructor and are always available:\n *\n * * {@link module:engine/view/observer/selectionobserver~SelectionObserver},\n * * {@link module:engine/view/observer/focusobserver~FocusObserver},\n * * {@link module:engine/view/observer/keyobserver~KeyObserver},\n * * {@link module:engine/view/observer/fakeselectionobserver~FakeSelectionObserver}.\n * * {@link module:engine/view/observer/compositionobserver~CompositionObserver}.\n * * {@link module:engine/view/observer/inputobserver~InputObserver}.\n * * {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.\n * * {@link module:engine/view/observer/tabobserver~TabObserver}.\n *\n * This class also {@link module:engine/view/view~View#attachDomRoot binds the DOM and the view elements}.\n *\n * If you do not need full a DOM - view management, and only want to transform a tree of view elements to a tree of DOM\n * elements you do not need this controller. You can use the {@link module:engine/view/domconverter~DomConverter DomConverter} instead.\n */\nexport default class View extends /* #__PURE__ */ ObservableMixin() {\n /**\n * @param stylesProcessor The styles processor instance.\n */\n constructor(stylesProcessor) {\n super();\n /**\n * Roots of the DOM tree. Map on the `HTMLElement`s with roots names as keys.\n */\n this.domRoots = new Map();\n /**\n * A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element\n * is {@link module:engine/view/view~View#attachDomRoot attached} to the view so later on, when\n * the view is destroyed ({@link module:engine/view/view~View#detachDomRoot}), they can be easily restored.\n * This way, the DOM element can go back to the (clean) state as if the editing view never used it.\n */\n this._initialDomRootAttributes = new WeakMap();\n /**\n * Map of registered {@link module:engine/view/observer/observer~Observer observers}.\n */\n this._observers = new Map();\n /**\n * Is set to `true` when {@link #change view changes} are currently in progress.\n */\n this._ongoingChange = false;\n /**\n * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.\n */\n this._postFixersInProgress = false;\n /**\n * Internal flag to temporary disable rendering. See the usage in the {@link #_disableRendering}.\n */\n this._renderingDisabled = false;\n /**\n * Internal flag that disables rendering when there are no changes since the last rendering.\n * It stores information about changed selection and changed elements from attached document roots.\n */\n this._hasChangedSinceTheLastRendering = false;\n this.document = new Document(stylesProcessor);\n this.domConverter = new DomConverter(this.document);\n this.set('isRenderingInProgress', false);\n this.set('hasDomSelection', false);\n this._renderer = new Renderer(this.domConverter, this.document.selection);\n this._renderer.bind('isFocused', 'isSelecting', 'isComposing')\n .to(this.document, 'isFocused', 'isSelecting', 'isComposing');\n this._writer = new DowncastWriter(this.document);\n // Add default observers.\n // Make sure that this list matches AlwaysRegisteredObservers type.\n this.addObserver(MutationObserver);\n this.addObserver(FocusObserver);\n this.addObserver(SelectionObserver);\n this.addObserver(KeyObserver);\n this.addObserver(FakeSelectionObserver);\n this.addObserver(CompositionObserver);\n this.addObserver(ArrowKeysObserver);\n this.addObserver(InputObserver);\n this.addObserver(TabObserver);\n // Inject quirks handlers.\n injectQuirksHandling(this);\n injectUiElementHandling(this);\n // Use 'normal' priority so that rendering is performed as first when using that priority.\n this.on('render', () => {\n this._render();\n // Informs that layout has changed after render.\n this.document.fire('layoutChanged');\n // Reset the `_hasChangedSinceTheLastRendering` flag after rendering.\n this._hasChangedSinceTheLastRendering = false;\n });\n // Listen to the document selection changes directly.\n this.listenTo(this.document.selection, 'change', () => {\n this._hasChangedSinceTheLastRendering = true;\n });\n // Trigger re-render if only the focus changed.\n this.listenTo(this.document, 'change:isFocused', () => {\n this._hasChangedSinceTheLastRendering = true;\n });\n // Remove ranges from DOM selection if editor is blurred.\n // See https://github.com/ckeditor/ckeditor5/issues/5753.\n if (env.isiOS) {\n this.listenTo(this.document, 'blur', (evt, data) => {\n const relatedViewElement = this.domConverter.mapDomToView(data.domEvent.relatedTarget);\n // Do not modify DOM selection if focus is moved to other editable of the same editor.\n if (!relatedViewElement) {\n this.domConverter._clearDomSelection();\n }\n });\n }\n // Listen to external content mutations (directly in the DOM) and mark them to get verified by the renderer.\n this.listenTo(this.document, 'mutations', (evt, { mutations }) => {\n mutations.forEach(mutation => this._renderer.markToSync(mutation.type, mutation.node));\n }, { priority: 'low' });\n // After all mutated nodes were marked to sync we can trigger view to DOM synchronization\n // to make sure the DOM structure matches the view.\n this.listenTo(this.document, 'mutations', () => {\n this.forceRender();\n }, { priority: 'lowest' });\n }\n /**\n * Attaches a DOM root element to the view element and enable all observers on that element.\n * Also {@link module:engine/view/renderer~Renderer#markToSync mark element} to be synchronized\n * with the view what means that all child nodes will be removed and replaced with content of the view root.\n *\n * This method also will change view element name as the same as tag name of given dom root.\n * Name is always transformed to lower case.\n *\n * **Note:** Use {@link #detachDomRoot `detachDomRoot()`} to revert this action.\n *\n * @param domRoot DOM root element.\n * @param name Name of the root.\n */\n attachDomRoot(domRoot, name = 'main') {\n const viewRoot = this.document.getRoot(name);\n // Set view root name the same as DOM root tag name.\n viewRoot._name = domRoot.tagName.toLowerCase();\n const initialDomRootAttributes = {};\n // 1. Copy and cache the attributes to remember the state of the element before attaching.\n // The cached attributes will be restored in detachDomRoot() so the element goes to the\n // clean state as if the editing view never used it.\n // 2. Apply the attributes using the view writer, so they all go under the control of the engine.\n // The editing view takes over the attribute management completely because various\n // features (e.g. addPlaceholder()) require dynamic changes of those attributes and they\n // cannot be managed by the engine and the UI library at the same time.\n for (const { name, value } of Array.from(domRoot.attributes)) {\n initialDomRootAttributes[name] = value;\n // Do not use writer.setAttribute() for the class attribute. The EditableUIView class\n // and its descendants could have already set some using the writer.addClass() on the view\n // document root. They haven't been rendered yet so they are not present in the DOM root.\n // Using writer.setAttribute( 'class', ... ) would override them completely.\n if (name === 'class') {\n this._writer.addClass(value.split(' '), viewRoot);\n }\n else {\n this._writer.setAttribute(name, value, viewRoot);\n }\n }\n this._initialDomRootAttributes.set(domRoot, initialDomRootAttributes);\n const updateContenteditableAttribute = () => {\n this._writer.setAttribute('contenteditable', (!viewRoot.isReadOnly).toString(), viewRoot);\n if (viewRoot.isReadOnly) {\n this._writer.addClass('ck-read-only', viewRoot);\n }\n else {\n this._writer.removeClass('ck-read-only', viewRoot);\n }\n };\n // Set initial value.\n updateContenteditableAttribute();\n this.domRoots.set(name, domRoot);\n this.domConverter.bindElements(domRoot, viewRoot);\n this._renderer.markToSync('children', viewRoot);\n this._renderer.markToSync('attributes', viewRoot);\n this._renderer.domDocuments.add(domRoot.ownerDocument);\n viewRoot.on('change:children', (evt, node) => this._renderer.markToSync('children', node));\n viewRoot.on('change:attributes', (evt, node) => this._renderer.markToSync('attributes', node));\n viewRoot.on('change:text', (evt, node) => this._renderer.markToSync('text', node));\n viewRoot.on('change:isReadOnly', () => this.change(updateContenteditableAttribute));\n viewRoot.on('change', () => {\n this._hasChangedSinceTheLastRendering = true;\n });\n for (const observer of this._observers.values()) {\n observer.observe(domRoot, name);\n }\n }\n /**\n * Detaches a DOM root element from the view element and restores its attributes to the state before\n * {@link #attachDomRoot `attachDomRoot()`}.\n *\n * @param name Name of the root to detach.\n */\n detachDomRoot(name) {\n const domRoot = this.domRoots.get(name);\n // Remove all root attributes so the DOM element is \"bare\".\n Array.from(domRoot.attributes).forEach(({ name }) => domRoot.removeAttribute(name));\n const initialDomRootAttributes = this._initialDomRootAttributes.get(domRoot);\n // Revert all view root attributes back to the state before attachDomRoot was called.\n for (const attribute in initialDomRootAttributes) {\n domRoot.setAttribute(attribute, initialDomRootAttributes[attribute]);\n }\n this.domRoots.delete(name);\n this.domConverter.unbindDomElement(domRoot);\n for (const observer of this._observers.values()) {\n observer.stopObserving(domRoot);\n }\n }\n /**\n * Gets DOM root element.\n *\n * @param name Name of the root.\n * @returns DOM root element instance.\n */\n getDomRoot(name = 'main') {\n return this.domRoots.get(name);\n }\n /**\n * Creates observer of the given type if not yet created, {@link module:engine/view/observer/observer~Observer#enable enables} it\n * and {@link module:engine/view/observer/observer~Observer#observe attaches} to all existing and future\n * {@link #domRoots DOM roots}.\n *\n * Note: Observers are recognized by their constructor (classes). A single observer will be instantiated and used only\n * when registered for the first time. This means that features and other components can register a single observer\n * multiple times without caring whether it has been already added or not.\n *\n * @param ObserverConstructor The constructor of an observer to add.\n * Should create an instance inheriting from {@link module:engine/view/observer/observer~Observer}.\n * @returns Added observer instance.\n */\n addObserver(ObserverConstructor) {\n let observer = this._observers.get(ObserverConstructor);\n if (observer) {\n return observer;\n }\n observer = new ObserverConstructor(this);\n this._observers.set(ObserverConstructor, observer);\n for (const [name, domElement] of this.domRoots) {\n observer.observe(domElement, name);\n }\n observer.enable();\n return observer;\n }\n /**\n * Returns observer of the given type or `undefined` if such observer has not been added yet.\n *\n * @param ObserverConstructor The constructor of an observer to get.\n * @returns Observer instance or undefined.\n */\n getObserver(ObserverConstructor) {\n return this._observers.get(ObserverConstructor);\n }\n /**\n * Disables all added observers.\n */\n disableObservers() {\n for (const observer of this._observers.values()) {\n observer.disable();\n }\n }\n /**\n * Enables all added observers.\n */\n enableObservers() {\n for (const observer of this._observers.values()) {\n observer.enable();\n }\n }\n /**\n * Scrolls the page viewport and {@link #domRoots} with their ancestors to reveal the\n * caret, **if not already visible to the user**.\n *\n * **Note**: Calling this method fires the {@link module:engine/view/view~ViewScrollToTheSelectionEvent} event that\n * allows custom behaviors.\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.viewportOffset A distance between the DOM selection and the viewport boundary to be maintained\n * while scrolling to the selection (default is 20px). Setting this value to `0` will reveal the selection precisely at\n * the viewport boundary.\n * @param options.ancestorOffset A distance between the DOM selection and scrollable DOM root ancestor(s) to be maintained\n * while scrolling to the selection (default is 20px). Setting this value to `0` will reveal the selection precisely at\n * the scrollable ancestor(s) boundary.\n * @param options.alignToTop When set `true`, the DOM selection will be aligned to the top of the viewport if not already visible\n * (see `forceScroll` to learn more).\n * @param options.forceScroll When set `true`, the DOM selection will be aligned to the top of the viewport and scrollable ancestors\n * whether it is already visible or not. This option will only work when `alignToTop` is `true`.\n */\n scrollToTheSelection({ alignToTop, forceScroll, viewportOffset = 20, ancestorOffset = 20 } = {}) {\n const range = this.document.selection.getFirstRange();\n if (!range) {\n return;\n }\n // Clone to make sure properties like `viewportOffset` are not mutated in the event listeners.\n const originalArgs = cloneDeep({ alignToTop, forceScroll, viewportOffset, ancestorOffset });\n if (typeof viewportOffset === 'number') {\n viewportOffset = {\n top: viewportOffset,\n bottom: viewportOffset,\n left: viewportOffset,\n right: viewportOffset\n };\n }\n const options = {\n target: this.domConverter.viewRangeToDom(range),\n viewportOffset,\n ancestorOffset,\n alignToTop,\n forceScroll\n };\n this.fire('scrollToTheSelection', options, originalArgs);\n scrollViewportToShowTarget(options);\n }\n /**\n * It will focus DOM element representing {@link module:engine/view/editableelement~EditableElement EditableElement}\n * that is currently having selection inside.\n */\n focus() {\n if (!this.document.isFocused) {\n const editable = this.document.selection.editableElement;\n if (editable) {\n this.domConverter.focus(editable);\n this.forceRender();\n }\n else {\n // Before focusing view document, selection should be placed inside one of the view's editables.\n // Normally its selection will be converted from model document (which have default selection), but\n // when using view document on its own, we need to manually place selection before focusing it.\n //\n // @if CK_DEBUG // console.warn( 'There is no selection in any editable to focus.' );\n }\n }\n }\n /**\n * The `change()` method is the primary way of changing the view. You should use it to modify any node in the view tree.\n * It makes sure that after all changes are made the view is rendered to the DOM (assuming that the view will be changed\n * inside the callback). It prevents situations when the DOM is updated when the view state is not yet correct. It allows\n * to nest calls one inside another and still performs a single rendering after all those changes are made.\n * It also returns the return value of its callback.\n *\n * ```ts\n * const text = view.change( writer => {\n * \tconst newText = writer.createText( 'foo' );\n * \twriter.insert( position1, newText );\n *\n * \tview.change( writer => {\n * \t\twriter.insert( position2, writer.createText( 'bar' ) );\n * \t} );\n *\n * \twriter.remove( range );\n *\n * \treturn newText;\n * } );\n * ```\n *\n * When the outermost change block is done and rendering to the DOM is over the\n * {@link module:engine/view/view~View#event:render `View#render`} event is fired.\n *\n * This method throws a `applying-view-changes-on-rendering` error when\n * the change block is used after rendering to the DOM has started.\n *\n * @param callback Callback function which may modify the view.\n * @returns Value returned by the callback.\n */\n change(callback) {\n if (this.isRenderingInProgress || this._postFixersInProgress) {\n /**\n * Thrown when there is an attempt to make changes to the view tree when it is in incorrect state. This may\n * cause some unexpected behaviour and inconsistency between the DOM and the view.\n * This may be caused by:\n *\n * * calling {@link module:engine/view/view~View#change} or {@link module:engine/view/view~View#forceRender} during rendering\n * process,\n * * calling {@link module:engine/view/view~View#change} or {@link module:engine/view/view~View#forceRender} inside of\n * {@link module:engine/view/document~Document#registerPostFixer post-fixer function}.\n *\n * @error cannot-change-view-tree\n */\n throw new CKEditorError('cannot-change-view-tree', this);\n }\n try {\n // Recursive call to view.change() method - execute listener immediately.\n if (this._ongoingChange) {\n return callback(this._writer);\n }\n // This lock will assure that all recursive calls to view.change() will end up in same block - one \"render\"\n // event for all nested calls.\n this._ongoingChange = true;\n const callbackResult = callback(this._writer);\n this._ongoingChange = false;\n // This lock is used by editing controller to render changes from outer most model.change() once. As plugins might call\n // view.change() inside model.change() block - this will ensures that postfixers and rendering are called once after all\n // changes. Also, we don't need to render anything if there're no changes since last rendering.\n if (!this._renderingDisabled && this._hasChangedSinceTheLastRendering) {\n this._postFixersInProgress = true;\n this.document._callPostFixers(this._writer);\n this._postFixersInProgress = false;\n this.fire('render');\n }\n return callbackResult;\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n /**\n * Forces rendering {@link module:engine/view/document~Document view document} to DOM. If any view changes are\n * currently in progress, rendering will start after all {@link #change change blocks} are processed.\n *\n * Note that this method is dedicated for special cases. All view changes should be wrapped in the {@link #change}\n * block and the view will automatically check whether it needs to render DOM or not.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `applying-view-changes-on-rendering` when\n * trying to re-render when rendering to DOM has already started.\n */\n forceRender() {\n this._hasChangedSinceTheLastRendering = true;\n this.getObserver(FocusObserver).flush();\n this.change(() => { });\n }\n /**\n * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.\n */\n destroy() {\n for (const observer of this._observers.values()) {\n observer.destroy();\n }\n this.document.destroy();\n this.stopListening();\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link #createPositionBefore},\n * * {@link #createPositionAfter},\n *\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return Position._createAt(itemOrPosition, offset);\n }\n /**\n * Creates a new position after given view item.\n *\n * @param item View item after which the position should be located.\n */\n createPositionAfter(item) {\n return Position._createAfter(item);\n }\n /**\n * Creates a new position before given view item.\n *\n * @param item View item before which the position should be located.\n */\n createPositionBefore(item) {\n return Position._createBefore(item);\n }\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at `start` position.\n */\n createRange(start, end) {\n return new Range(start, end);\n }\n /**\n * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n */\n createRangeOn(item) {\n return Range._createOn(item);\n }\n /**\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return Range._createIn(element);\n }\n createSelection(...args) {\n return new Selection(...args);\n }\n /**\n * Disables or enables rendering. If the flag is set to `true` then the rendering will be disabled.\n * If the flag is set to `false` and if there was some change in the meantime, then the rendering action will be performed.\n *\n * @internal\n * @param flag A flag indicates whether the rendering should be disabled.\n */\n _disableRendering(flag) {\n this._renderingDisabled = flag;\n if (flag == false) {\n // Render when you stop blocking rendering.\n this.change(() => { });\n }\n }\n /**\n * Renders all changes. In order to avoid triggering the observers (e.g. selection) all observers are disabled\n * before rendering and re-enabled after that.\n */\n _render() {\n this.isRenderingInProgress = true;\n this.disableObservers();\n this._renderer.render();\n this.enableObservers();\n this.isRenderingInProgress = false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nexport default class TypeCheckable {\n /* istanbul ignore next -- @preserve */\n is() {\n // There are a lot of overloads above.\n // Overriding method in derived classes remove them and only `is( type: string ): boolean` is visible which we don't want.\n // One option would be to copy them all to all classes, but that's ugly.\n // It's best when TypeScript compiler doesn't see those overloads, except the one in the top base class.\n // To overload a method, but not let the compiler see it, do after class definition:\n // `MyClass.prototype.is = function( type: string ) {...}`\n throw new Error('is() method is abstract');\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n * @module engine/model/node\n */\nimport TypeCheckable from './typecheckable.js';\nimport { CKEditorError, compareArrays, toMap } from '@ckeditor/ckeditor5-utils';\n/**\n * Model node. Most basic structure of model tree.\n *\n * This is an abstract class that is a base for other classes representing different nodes in model.\n *\n * **Note:** If a node is detached from the model tree, you can manipulate it using it's API.\n * However, it is **very important** that nodes already attached to model tree should be only changed through\n * {@link module:engine/model/writer~Writer Writer API}.\n *\n * Changes done by `Node` methods, like {@link module:engine/model/element~Element#_insertChild _insertChild} or\n * {@link module:engine/model/node~Node#_setAttribute _setAttribute}\n * do not generate {@link module:engine/model/operation/operation~Operation operations}\n * which are essential for correct editor work if you modify nodes in {@link module:engine/model/document~Document document} root.\n *\n * The flow of working on `Node` (and classes that inherits from it) is as such:\n * 1. You can create a `Node` instance, modify it using it's API.\n * 2. Add `Node` to the model using `Batch` API.\n * 3. Change `Node` that was already added to the model using `Batch` API.\n *\n * Similarly, you cannot use `Batch` API on a node that has not been added to the model tree, with the exception\n * of {@link module:engine/model/writer~Writer#insert inserting} that node to the model tree.\n *\n * Be aware that using {@link module:engine/model/writer~Writer#remove remove from Batch API} does not allow to use `Node` API because\n * the information about `Node` is still kept in model document.\n *\n * In case of {@link module:engine/model/element~Element element node}, adding and removing children also counts as changing a node and\n * follows same rules.\n */\nexport default class Node extends TypeCheckable {\n /**\n * Creates a model node.\n *\n * This is an abstract class, so this constructor should not be used directly.\n *\n * @param attrs Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n */\n constructor(attrs) {\n super();\n /**\n * Parent of this node. It could be {@link module:engine/model/element~Element}\n * or {@link module:engine/model/documentfragment~DocumentFragment}.\n * Equals to `null` if the node has no parent.\n */\n this.parent = null;\n this._attrs = toMap(attrs);\n }\n /**\n * {@link module:engine/model/document~Document Document} that owns this root element.\n */\n get document() {\n return null;\n }\n /**\n * Index of this node in its parent or `null` if the node has no parent.\n *\n * Accessing this property throws an error if this node's parent element does not contain it.\n * This means that model tree got broken.\n */\n get index() {\n let pos;\n if (!this.parent) {\n return null;\n }\n if ((pos = this.parent.getChildIndex(this)) === null) {\n throw new CKEditorError('model-node-not-found-in-parent', this);\n }\n return pos;\n }\n /**\n * Offset at which this node starts in its parent. It is equal to the sum of {@link #offsetSize offsetSize}\n * of all its previous siblings. Equals to `null` if node has no parent.\n *\n * Accessing this property throws an error if this node's parent element does not contain it.\n * This means that model tree got broken.\n */\n get startOffset() {\n let pos;\n if (!this.parent) {\n return null;\n }\n if ((pos = this.parent.getChildStartOffset(this)) === null) {\n throw new CKEditorError('model-node-not-found-in-parent', this);\n }\n return pos;\n }\n /**\n * Offset size of this node. Represents how much \"offset space\" is occupied by the node in it's parent.\n * It is important for {@link module:engine/model/position~Position position}. When node has `offsetSize` greater than `1`, position\n * can be placed between that node start and end. `offsetSize` greater than `1` is for nodes that represents more\n * than one entity, i.e. {@link module:engine/model/text~Text text node}.\n */\n get offsetSize() {\n return 1;\n }\n /**\n * Offset at which this node ends in it's parent. It is equal to the sum of this node's\n * {@link module:engine/model/node~Node#startOffset start offset} and {@link #offsetSize offset size}.\n * Equals to `null` if the node has no parent.\n */\n get endOffset() {\n if (!this.parent) {\n return null;\n }\n return this.startOffset + this.offsetSize;\n }\n /**\n * Node's next sibling or `null` if the node is a last child of it's parent or if the node has no parent.\n */\n get nextSibling() {\n const index = this.index;\n return (index !== null && this.parent.getChild(index + 1)) || null;\n }\n /**\n * Node's previous sibling or `null` if the node is a first child of it's parent or if the node has no parent.\n */\n get previousSibling() {\n const index = this.index;\n return (index !== null && this.parent.getChild(index - 1)) || null;\n }\n /**\n * The top-most ancestor of the node. If node has no parent it is the root itself. If the node is a part\n * of {@link module:engine/model/documentfragment~DocumentFragment}, it's `root` is equal to that `DocumentFragment`.\n */\n get root() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let root = this;\n while (root.parent) {\n root = root.parent;\n }\n return root;\n }\n /**\n * Returns `true` if the node is inside a document root that is attached to the document.\n */\n isAttached() {\n // If the node has no parent it means that it is a root.\n // But this is not a `RootElement`, so it means that it is not attached.\n //\n // If this is not the root, check if this element's root is attached.\n return this.parent === null ? false : this.root.isAttached();\n }\n /**\n * Gets path to the node. The path is an array containing starting offsets of consecutive ancestors of this node,\n * beginning from {@link module:engine/model/node~Node#root root}, down to this node's starting offset. The path can be used to\n * create {@link module:engine/model/position~Position Position} instance.\n *\n * ```ts\n * const abc = new Text( 'abc' );\n * const foo = new Text( 'foo' );\n * const h1 = new Element( 'h1', null, new Text( 'header' ) );\n * const p = new Element( 'p', null, [ abc, foo ] );\n * const div = new Element( 'div', null, [ h1, p ] );\n * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.\n * h1.getPath(); // Returns [ 0 ].\n * div.getPath(); // Returns [].\n * ```\n */\n getPath() {\n const path = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let node = this;\n while (node.parent) {\n path.unshift(node.startOffset);\n node = node.parent;\n }\n return path;\n }\n /**\n * Returns ancestors array of this node.\n *\n * @param options Options object.\n * @param options.includeSelf When set to `true` this node will be also included in parent's array.\n * @param options.parentFirst When set to `true`, array will be sorted from node's parent to root element,\n * otherwise root element will be the first item in the array.\n * @returns Array with ancestors.\n */\n getAncestors(options = {}) {\n const ancestors = [];\n let parent = options.includeSelf ? this : this.parent;\n while (parent) {\n ancestors[options.parentFirst ? 'push' : 'unshift'](parent);\n parent = parent.parent;\n }\n return ancestors;\n }\n /**\n * Returns a {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}\n * which is a common ancestor of both nodes.\n *\n * @param node The second node.\n * @param options Options object.\n * @param options.includeSelf When set to `true` both nodes will be considered \"ancestors\" too.\n * Which means that if e.g. node A is inside B, then their common ancestor will be B.\n */\n getCommonAncestor(node, options = {}) {\n const ancestorsA = this.getAncestors(options);\n const ancestorsB = node.getAncestors(options);\n let i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n /**\n * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,\n * in different {@link module:engine/model/documentfragment~DocumentFragment}s).\n *\n * @param node Node to compare with.\n */\n isBefore(node) {\n // Given node is not before this node if they are same.\n if (this == node) {\n return false;\n }\n // Return `false` if it is impossible to compare nodes.\n if (this.root !== node.root) {\n return false;\n }\n const thisPath = this.getPath();\n const nodePath = node.getPath();\n const result = compareArrays(thisPath, nodePath);\n switch (result) {\n case 'prefix':\n return true;\n case 'extension':\n return false;\n default:\n return thisPath[result] < nodePath[result];\n }\n }\n /**\n * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,\n * in different {@link module:engine/model/documentfragment~DocumentFragment}s).\n *\n * @param node Node to compare with.\n */\n isAfter(node) {\n // Given node is not before this node if they are same.\n if (this == node) {\n return false;\n }\n // Return `false` if it is impossible to compare nodes.\n if (this.root !== node.root) {\n return false;\n }\n // In other cases, just check if the `node` is before, and return the opposite.\n return !this.isBefore(node);\n }\n /**\n * Checks if the node has an attribute with given key.\n *\n * @param key Key of attribute to check.\n * @returns `true` if attribute with given key is set on node, `false` otherwise.\n */\n hasAttribute(key) {\n return this._attrs.has(key);\n }\n /**\n * Gets an attribute value for given key or `undefined` if that attribute is not set on node.\n *\n * @param key Key of attribute to look for.\n * @returns Attribute value or `undefined`.\n */\n getAttribute(key) {\n return this._attrs.get(key);\n }\n /**\n * Returns iterator that iterates over this node's attributes.\n *\n * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n getAttributes() {\n return this._attrs.entries();\n }\n /**\n * Returns iterator that iterates over this node's attribute keys.\n */\n getAttributeKeys() {\n return this._attrs.keys();\n }\n /**\n * Converts `Node` to plain object and returns it.\n *\n * @returns `Node` converted to plain object.\n */\n toJSON() {\n const json = {};\n // Serializes attributes to the object.\n // attributes = { a: 'foo', b: 1, c: true }.\n if (this._attrs.size) {\n json.attributes = Array.from(this._attrs).reduce((result, attr) => {\n result[attr[0]] = attr[1];\n return result;\n }, {});\n }\n return json;\n }\n /**\n * Creates a copy of this node, that is a node with exactly same attributes, and returns it.\n *\n * @internal\n * @returns Node with same attributes as this node.\n */\n _clone(_deep) {\n return new this.constructor(this._attrs);\n }\n /**\n * Removes this node from it's parent.\n *\n * @internal\n * @see module:engine/model/writer~Writer#remove\n */\n _remove() {\n this.parent._removeChildren(this.index);\n }\n /**\n * Sets attribute on the node. If attribute with the same key already is set, it's value is overwritten.\n *\n * @see module:engine/model/writer~Writer#setAttribute\n * @internal\n * @param key Key of attribute to set.\n * @param value Attribute value.\n */\n _setAttribute(key, value) {\n this._attrs.set(key, value);\n }\n /**\n * Removes all attributes from the node and sets given attributes.\n *\n * @see module:engine/model/writer~Writer#setAttributes\n * @internal\n * @param attrs Attributes to set. See {@link module:utils/tomap~toMap} for a list of accepted values.\n */\n _setAttributesTo(attrs) {\n this._attrs = toMap(attrs);\n }\n /**\n * Removes an attribute with given key from the node.\n *\n * @see module:engine/model/writer~Writer#removeAttribute\n * @internal\n * @param key Key of attribute to remove.\n * @returns `true` if the attribute was set on the element, `false` otherwise.\n */\n _removeAttribute(key) {\n return this._attrs.delete(key);\n }\n /**\n * Removes all attributes from the node.\n *\n * @see module:engine/model/writer~Writer#clearAttributes\n * @internal\n */\n _clearAttributes() {\n this._attrs.clear();\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nNode.prototype.is = function (type) {\n return type === 'node' || type === 'model:node';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/nodelist\n */\nimport Node from './node.js';\nimport { CKEditorError, spliceArray } from '@ckeditor/ckeditor5-utils';\n/**\n * Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally\n * in classes like {@link module:engine/model/element~Element Element}\n * or {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment}.\n */\nexport default class NodeList {\n /**\n * Creates an empty node list.\n *\n * @internal\n * @param nodes Nodes contained in this node list.\n */\n constructor(nodes) {\n /**\n * Nodes contained in this node list.\n */\n this._nodes = [];\n if (nodes) {\n this._insertNodes(0, nodes);\n }\n }\n /**\n * Iterable interface.\n *\n * Iterates over all nodes contained inside this node list.\n */\n [Symbol.iterator]() {\n return this._nodes[Symbol.iterator]();\n }\n /**\n * Number of nodes contained inside this node list.\n */\n get length() {\n return this._nodes.length;\n }\n /**\n * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes contained inside this node list.\n */\n get maxOffset() {\n return this._nodes.reduce((sum, node) => sum + node.offsetSize, 0);\n }\n /**\n * Gets the node at the given index. Returns `null` if incorrect index was passed.\n */\n getNode(index) {\n return this._nodes[index] || null;\n }\n /**\n * Returns an index of the given node. Returns `null` if given node is not inside this node list.\n */\n getNodeIndex(node) {\n const index = this._nodes.indexOf(node);\n return index == -1 ? null : index;\n }\n /**\n * Returns the starting offset of given node. Starting offset is equal to the sum of\n * {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes that are before this node in this node list.\n */\n getNodeStartOffset(node) {\n const index = this.getNodeIndex(node);\n return index === null ? null : this._nodes.slice(0, index).reduce((sum, node) => sum + node.offsetSize, 0);\n }\n /**\n * Converts index to offset in node list.\n *\n * Returns starting offset of a node that is at given index. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * `model-nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link #length}.\n */\n indexToOffset(index) {\n if (index == this._nodes.length) {\n return this.maxOffset;\n }\n const node = this._nodes[index];\n if (!node) {\n /**\n * Given index cannot be found in the node list.\n *\n * @error model-nodelist-index-out-of-bounds\n */\n throw new CKEditorError('model-nodelist-index-out-of-bounds', this);\n }\n return this.getNodeStartOffset(node);\n }\n /**\n * Converts offset in node list to index.\n *\n * Returns index of a node that occupies given offset. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * `model-nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link #maxOffset}.\n */\n offsetToIndex(offset) {\n let totalOffset = 0;\n for (const node of this._nodes) {\n if (offset >= totalOffset && offset < totalOffset + node.offsetSize) {\n return this.getNodeIndex(node);\n }\n totalOffset += node.offsetSize;\n }\n if (totalOffset != offset) {\n /**\n * Given offset cannot be found in the node list.\n *\n * @error model-nodelist-offset-out-of-bounds\n * @param offset\n * @param nodeList Stringified node list.\n */\n throw new CKEditorError('model-nodelist-offset-out-of-bounds', this, {\n offset,\n nodeList: this\n });\n }\n return this.length;\n }\n /**\n * Inserts given nodes at given index.\n *\n * @internal\n * @param index Index at which nodes should be inserted.\n * @param nodes Nodes to be inserted.\n */\n _insertNodes(index, nodes) {\n // Validation.\n for (const node of nodes) {\n if (!(node instanceof Node)) {\n /**\n * Trying to insert an object which is not a Node instance.\n *\n * @error model-nodelist-insertnodes-not-node\n */\n throw new CKEditorError('model-nodelist-insertnodes-not-node', this);\n }\n }\n this._nodes = spliceArray(this._nodes, Array.from(nodes), index, 0);\n }\n /**\n * Removes one or more nodes starting at the given index.\n *\n * @internal\n * @param indexStart Index of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @returns Array containing removed nodes.\n */\n _removeNodes(indexStart, howMany = 1) {\n return this._nodes.splice(indexStart, howMany);\n }\n /**\n * Converts `NodeList` instance to an array containing nodes that were inserted in the node list. Nodes\n * are also converted to their plain object representation.\n *\n * @returns `NodeList` instance converted to `Array`.\n */\n toJSON() {\n return this._nodes.map(node => node.toJSON());\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/splicearray\n */\nconst BIG_CHUNK_SIZE = 10000;\n/**\n * Splices one array into another. To be used instead of `Array.prototype.splice` as the latter may\n * throw \"Maximum call stack size exceeded\" when passed huge number of items to insert.\n *\n * Note: in contrary to Array.splice, this function does not modify the original `target`.\n *\n * ```ts\n * spliceArray( [ 1, 2 ], [ 3, 4 ], 0, 0 );\t// [ 3, 4, 1, 2 ]\n * spliceArray( [ 1, 2 ], [ 3, 4 ], 1, 1 );\t// [ 1, 3, 4 ]\n * spliceArray( [ 1, 2 ], [ 3, 4 ], 1, 0 );\t// [ 1, 3, 4, 2 ]\n * spliceArray( [ 1, 2 ], [ 3, 4 ], 2, 0 );\t// [ 1, 2, 3, 4 ]\n * spliceArray( [ 1, 2 ], [], 0, 1 );\t// [ 2 ]\n * ```\n *\n * @param target Array to be spliced.\n * @param source Array of elements to be inserted to target.\n * @param start Index at which nodes should be inserted/removed.\n * @param count Number of items.\n *\n * @returns New spliced array.\n */\nexport default function spliceArray(target, source, start, count) {\n // In case of performance problems, see: https://github.com/ckeditor/ckeditor5/pull/12429/files#r965850568\n if (Math.max(source.length, target.length) > BIG_CHUNK_SIZE) {\n return target.slice(0, start).concat(source).concat(target.slice(start + count, target.length));\n }\n else {\n const newTarget = Array.from(target);\n newTarget.splice(start, count, ...source);\n return newTarget;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/text\n */\nimport Node from './node.js';\n// @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );\n/**\n * Model text node. Type of {@link module:engine/model/node~Node node} that contains {@link module:engine/model/text~Text#data text data}.\n *\n * **Important:** see {@link module:engine/model/node~Node} to read about restrictions using `Text` and `Node` API.\n *\n * **Note:** keep in mind that `Text` instances might indirectly got removed from model tree when model is changed.\n * This happens when {@link module:engine/model/writer~Writer model writer} is used to change model and the text node is merged with\n * another text node. Then, both text nodes are removed and a new text node is inserted into the model. Because of\n * this behavior, keeping references to `Text` is not recommended. Instead, consider creating\n * {@link module:engine/model/liveposition~LivePosition live position} placed before the text node.\n */\nexport default class Text extends Node {\n /**\n * Creates a text node.\n *\n * **Note:** Constructor of this class shouldn't be used directly in the code.\n * Use the {@link module:engine/model/writer~Writer#createText} method instead.\n *\n * @internal\n * @param data Node's text.\n * @param attrs Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n */\n constructor(data, attrs) {\n super(attrs);\n this._data = data || '';\n }\n /**\n * @inheritDoc\n */\n get offsetSize() {\n return this.data.length;\n }\n /**\n * Returns a text data contained in the node.\n */\n get data() {\n return this._data;\n }\n /**\n * Converts `Text` instance to plain object and returns it.\n *\n * @returns`Text` instance converted to plain object.\n */\n toJSON() {\n const json = super.toJSON();\n json.data = this.data;\n return json;\n }\n /**\n * Creates a copy of this text node and returns it. Created text node has same text data and attributes as original text node.\n *\n * @internal\n * @returns `Text` instance created using given plain object.\n */\n _clone() {\n return new Text(this.data, this.getAttributes());\n }\n /**\n * Creates a `Text` instance from given plain object (i.e. parsed JSON string).\n *\n * @param json Plain object to be converted to `Text`.\n * @returns `Text` instance created using given plain object.\n */\n static fromJSON(json) {\n return new Text(json.data, json.attributes);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nText.prototype.is = function (type) {\n return type === '$text' || type === 'model:$text' ||\n // This are legacy values kept for backward compatibility.\n type === 'text' || type === 'model:text' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'node' || type === 'model:node';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/textproxy\n */\nimport TypeCheckable from './typecheckable.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );\n/**\n * `TextProxy` represents a part of {@link module:engine/model/text~Text text node}.\n *\n * Since {@link module:engine/model/position~Position positions} can be placed between characters of a text node,\n * {@link module:engine/model/range~Range ranges} may contain only parts of text nodes. When {@link module:engine/model/range~Range#getItems\n * getting items}\n * contained in such range, we need to represent a part of that text node, since returning the whole text node would be incorrect.\n * `TextProxy` solves this issue.\n *\n * `TextProxy` has an API similar to {@link module:engine/model/text~Text Text} and allows to do most of the common tasks performed\n * on model nodes.\n *\n * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.\n * See {@link module:engine/model/textproxy~TextProxy#isPartial}.\n *\n * **Note:** `TextProxy` is not an instance of {@link module:engine/model/node~Node node}. Keep this in mind when using it as a\n * parameter of methods.\n *\n * **Note:** `TextProxy` is a readonly interface. If you want to perform changes on model data represented by a `TextProxy`\n * use {@link module:engine/model/writer~Writer model writer API}.\n *\n * **Note:** `TextProxy` instances are created on the fly, basing on the current state of model. Because of this, it is\n * highly unrecommended to store references to `TextProxy` instances. `TextProxy` instances are not refreshed when\n * model changes, so they might get invalidated. Instead, consider creating {@link module:engine/model/liveposition~LivePosition live\n * position}.\n *\n * `TextProxy` instances are created by {@link module:engine/model/treewalker~TreeWalker model tree walker}. You should not need to create\n * an instance of this class by your own.\n */\nexport default class TextProxy extends TypeCheckable {\n /**\n * Creates a text proxy.\n *\n * @internal\n * @param textNode Text node which part is represented by this text proxy.\n * @param offsetInText Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy\n * starts.\n * @param length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.\n */\n constructor(textNode, offsetInText, length) {\n super();\n this.textNode = textNode;\n if (offsetInText < 0 || offsetInText > textNode.offsetSize) {\n /**\n * Given `offsetInText` value is incorrect.\n *\n * @error model-textproxy-wrong-offsetintext\n */\n throw new CKEditorError('model-textproxy-wrong-offsetintext', this);\n }\n if (length < 0 || offsetInText + length > textNode.offsetSize) {\n /**\n * Given `length` value is incorrect.\n *\n * @error model-textproxy-wrong-length\n */\n throw new CKEditorError('model-textproxy-wrong-length', this);\n }\n this.data = textNode.data.substring(offsetInText, offsetInText + length);\n this.offsetInText = offsetInText;\n }\n /**\n * Offset at which this text proxy starts in it's parent.\n *\n * @see module:engine/model/node~Node#startOffset\n */\n get startOffset() {\n return this.textNode.startOffset !== null ? this.textNode.startOffset + this.offsetInText : null;\n }\n /**\n * Offset size of this text proxy. Equal to the number of characters represented by the text proxy.\n *\n * @see module:engine/model/node~Node#offsetSize\n */\n get offsetSize() {\n return this.data.length;\n }\n /**\n * Offset at which this text proxy ends in it's parent.\n *\n * @see module:engine/model/node~Node#endOffset\n */\n get endOffset() {\n return this.startOffset !== null ? this.startOffset + this.offsetSize : null;\n }\n /**\n * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/model/text~Text text node}\n * (`true`) or the whole text node (`false`).\n *\n * This is `false` when text proxy starts at the very beginning of {@link module:engine/model/textproxy~TextProxy#textNode textNode}\n * ({@link module:engine/model/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to\n * text node size.\n */\n get isPartial() {\n return this.offsetSize !== this.textNode.offsetSize;\n }\n /**\n * Parent of this text proxy, which is same as parent of text node represented by this text proxy.\n */\n get parent() {\n return this.textNode.parent;\n }\n /**\n * Root of this text proxy, which is same as root of text node represented by this text proxy.\n */\n get root() {\n return this.textNode.root;\n }\n /**\n * Gets path to this text proxy.\n *\n * @see module:engine/model/node~Node#getPath\n */\n getPath() {\n const path = this.textNode.getPath();\n if (path.length > 0) {\n path[path.length - 1] += this.offsetInText;\n }\n return path;\n }\n /**\n * Returns ancestors array of this text proxy.\n *\n * @param options Options object.\n * @param options.includeSelf When set to `true` this text proxy will be also included in parent's array.\n * @param options.parentFirst When set to `true`, array will be sorted from text proxy parent to root element,\n * otherwise root element will be the first item in the array.\n * @returns Array with ancestors.\n */\n getAncestors(options = {}) {\n const ancestors = [];\n let parent = options.includeSelf ? this : this.parent;\n while (parent) {\n ancestors[options.parentFirst ? 'push' : 'unshift'](parent);\n parent = parent.parent;\n }\n return ancestors;\n }\n /**\n * Checks if this text proxy has an attribute for given key.\n *\n * @param key Key of attribute to check.\n * @returns `true` if attribute with given key is set on text proxy, `false` otherwise.\n */\n hasAttribute(key) {\n return this.textNode.hasAttribute(key);\n }\n /**\n * Gets an attribute value for given key or `undefined` if that attribute is not set on text proxy.\n *\n * @param key Key of attribute to look for.\n * @returns Attribute value or `undefined`.\n */\n getAttribute(key) {\n return this.textNode.getAttribute(key);\n }\n /**\n * Returns iterator that iterates over this node's attributes. Attributes are returned as arrays containing two\n * items. First one is attribute key and second is attribute value.\n *\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n getAttributes() {\n return this.textNode.getAttributes();\n }\n /**\n * Returns iterator that iterates over this node's attribute keys.\n */\n getAttributeKeys() {\n return this.textNode.getAttributeKeys();\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nTextProxy.prototype.is = function (type) {\n return type === '$textProxy' || type === 'model:$textProxy' ||\n // This are legacy values kept for backward compatibility.\n type === 'textProxy' || type === 'model:textProxy';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/element\n */\nimport Node from './node.js';\nimport NodeList from './nodelist.js';\nimport Text from './text.js';\nimport TextProxy from './textproxy.js';\nimport { isIterable } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { stringifyMap, convertMapToStringifiedObject, convertMapToTags } = require( '../dev-utils/utils' );\n/**\n * Model element. Type of {@link module:engine/model/node~Node node} that has a {@link module:engine/model/element~Element#name name} and\n * {@link module:engine/model/element~Element#getChildren child nodes}.\n *\n * **Important**: see {@link module:engine/model/node~Node} to read about restrictions using `Element` and `Node` API.\n */\nexport default class Element extends Node {\n /**\n * Creates a model element.\n *\n * **Note:** Constructor of this class shouldn't be used directly in the code.\n * Use the {@link module:engine/model/writer~Writer#createElement} method instead.\n *\n * @internal\n * @param name Element's name.\n * @param attrs Element's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n * @param children One or more nodes to be inserted as children of created element.\n */\n constructor(name, attrs, children) {\n super(attrs);\n /**\n * List of children nodes.\n */\n this._children = new NodeList();\n this.name = name;\n if (children) {\n this._insertChild(0, children);\n }\n }\n /**\n * Number of this element's children.\n */\n get childCount() {\n return this._children.length;\n }\n /**\n * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this element's children.\n */\n get maxOffset() {\n return this._children.maxOffset;\n }\n /**\n * Is `true` if there are no nodes inside this element, `false` otherwise.\n */\n get isEmpty() {\n return this.childCount === 0;\n }\n /**\n * Gets the child at the given index.\n */\n getChild(index) {\n return this._children.getNode(index);\n }\n /**\n * Returns an iterator that iterates over all of this element's children.\n */\n getChildren() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Returns an index of the given child node. Returns `null` if given node is not a child of this element.\n *\n * @param node Child node to look for.\n * @returns Child node's index in this element.\n */\n getChildIndex(node) {\n return this._children.getNodeIndex(node);\n }\n /**\n * Returns the starting offset of given child. Starting offset is equal to the sum of\n * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if\n * given node is not a child of this element.\n *\n * @param node Child node to look for.\n * @returns Child node's starting offset.\n */\n getChildStartOffset(node) {\n return this._children.getNodeStartOffset(node);\n }\n /**\n * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is\n * too high, returns {@link module:engine/model/element~Element#getChildIndex index after last child}.\n *\n * ```ts\n * const textNode = new Text( 'foo' );\n * const pElement = new Element( 'p' );\n * const divElement = new Element( [ textNode, pElement ] );\n * divElement.offsetToIndex( -1 ); // Returns 0, because offset is too low.\n * divElement.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.\n * divElement.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.\n * divElement.offsetToIndex( 2 ); // Returns 0.\n * divElement.offsetToIndex( 3 ); // Returns 1.\n * divElement.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.\n * ```\n */\n offsetToIndex(offset) {\n return this._children.offsetToIndex(offset);\n }\n /**\n * Returns a descendant node by its path relative to this element.\n *\n * ```ts\n * // <this>a<b>c</b></this>\n * this.getNodeByPath( [ 0 ] ); // -> \"a\"\n * this.getNodeByPath( [ 1 ] ); // -> <b>\n * this.getNodeByPath( [ 1, 0 ] ); // -> \"c\"\n * ```\n *\n * @param relativePath Path of the node to find, relative to this element.\n */\n getNodeByPath(relativePath) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let node = this;\n for (const index of relativePath) {\n node = node.getChild(node.offsetToIndex(index));\n }\n return node;\n }\n /**\n * Returns the parent element of the given name. Returns null if the element is not inside the desired parent.\n *\n * @param parentName The name of the parent element to find.\n * @param options Options object.\n * @param options.includeSelf When set to `true` this node will be also included while searching.\n */\n findAncestor(parentName, options = {}) {\n let parent = options.includeSelf ? this : this.parent;\n while (parent) {\n if (parent.name === parentName) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n /**\n * Converts `Element` instance to plain object and returns it. Takes care of converting all of this element's children.\n *\n * @returns `Element` instance converted to plain object.\n */\n toJSON() {\n const json = super.toJSON();\n json.name = this.name;\n if (this._children.length > 0) {\n json.children = [];\n for (const node of this._children) {\n json.children.push(node.toJSON());\n }\n }\n return json;\n }\n /**\n * Creates a copy of this element and returns it. Created element has the same name and attributes as the original element.\n * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.\n *\n * @internal\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any child.\n */\n _clone(deep = false) {\n const children = deep ? Array.from(this._children).map(node => node._clone(true)) : undefined;\n return new Element(this.name, this.getAttributes(), children);\n }\n /**\n * {@link module:engine/model/element~Element#_insertChild Inserts} one or more nodes at the end of this element.\n *\n * @see module:engine/model/writer~Writer#append\n * @internal\n * @param nodes Nodes to be inserted.\n */\n _appendChild(nodes) {\n this._insertChild(this.childCount, nodes);\n }\n /**\n * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes\n * to this element.\n *\n * @see module:engine/model/writer~Writer#insert\n * @internal\n * @param index Index at which nodes should be inserted.\n * @param items Items to be inserted.\n */\n _insertChild(index, items) {\n const nodes = normalize(items);\n for (const node of nodes) {\n // If node that is being added to this element is already inside another element, first remove it from the old parent.\n if (node.parent !== null) {\n node._remove();\n }\n node.parent = this;\n }\n this._children._insertNodes(index, nodes);\n }\n /**\n * Removes one or more nodes starting at the given index and sets\n * {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.\n *\n * @see module:engine/model/writer~Writer#remove\n * @internal\n * @param index Index of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @returns Array containing removed nodes.\n */\n _removeChildren(index, howMany = 1) {\n const nodes = this._children._removeNodes(index, howMany);\n for (const node of nodes) {\n node.parent = null;\n }\n return nodes;\n }\n /**\n * Creates an `Element` instance from given plain object (i.e. parsed JSON string).\n * Converts `Element` children to proper nodes.\n *\n * @param json Plain object to be converted to `Element`.\n * @returns `Element` instance created using given plain object.\n */\n static fromJSON(json) {\n let children;\n if (json.children) {\n children = [];\n for (const child of json.children) {\n if (child.name) {\n // If child has name property, it is an Element.\n children.push(Element.fromJSON(child));\n }\n else {\n // Otherwise, it is a Text node.\n children.push(Text.fromJSON(child));\n }\n }\n }\n return new Element(json.name, json.attributes, children);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'element' || type === 'model:element' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'node' || type === 'model:node';\n }\n return name === this.name && (type === 'element' || type === 'model:element');\n};\n/**\n * Converts strings to Text and non-iterables to arrays.\n */\nfunction normalize(nodes) {\n // Separate condition because string is iterable.\n if (typeof nodes == 'string') {\n return [new Text(nodes)];\n }\n if (!isIterable(nodes)) {\n nodes = [nodes];\n }\n // Array.from to enable .map() on non-arrays.\n return Array.from(nodes)\n .map(node => {\n if (typeof node == 'string') {\n return new Text(node);\n }\n if (node instanceof TextProxy) {\n return new Text(node.data, node.getAttributes());\n }\n return node;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/treewalker\n */\nimport Element from './element.js';\nimport { default as Position, getTextNodeAtPosition, getNodeAfterPosition, getNodeBeforePosition } from './position.js';\nimport Text from './text.js';\nimport TextProxy from './textproxy.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Position iterator class. It allows to iterate forward and backward over the document.\n */\nexport default class TreeWalker {\n /**\n * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.\n *\n * @param options Object with configuration.\n */\n constructor(options) {\n if (!options || (!options.boundaries && !options.startPosition)) {\n /**\n * Neither boundaries nor starting position of a `TreeWalker` have been defined.\n *\n * @error model-tree-walker-no-start-position\n */\n throw new CKEditorError('model-tree-walker-no-start-position', null);\n }\n const direction = options.direction || 'forward';\n if (direction != 'forward' && direction != 'backward') {\n /**\n * Only `backward` and `forward` direction allowed.\n *\n * @error model-tree-walker-unknown-direction\n */\n throw new CKEditorError('model-tree-walker-unknown-direction', options, { direction });\n }\n this.direction = direction;\n this.boundaries = options.boundaries || null;\n if (options.startPosition) {\n this._position = options.startPosition.clone();\n }\n else {\n this._position = Position._createAt(this.boundaries[this.direction == 'backward' ? 'end' : 'start']);\n }\n // Reset position stickiness in case it was set to other value, as the stickiness is kept after cloning.\n this.position.stickiness = 'toNone';\n this.singleCharacters = !!options.singleCharacters;\n this.shallow = !!options.shallow;\n this.ignoreElementEnd = !!options.ignoreElementEnd;\n this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;\n this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;\n this._visitedParent = this.position.parent;\n }\n /**\n * Iterable interface.\n *\n * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}\n */\n [Symbol.iterator]() {\n return this;\n }\n /**\n * Iterator position. This is always static position, even if the initial position was a\n * {@link module:engine/model/liveposition~LivePosition live position}. If start position is not defined then position depends\n * on {@link #direction}. If direction is `'forward'` position starts form the beginning, when direction\n * is `'backward'` position starts from the end.\n */\n get position() {\n return this._position;\n }\n /**\n * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.\n *\n * For example:\n *\n * ```ts\n * walker.skip( value => value.type == 'text' ); // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>\n * walker.skip( () => true ); // Move the position to the end: <paragraph>[]foo</paragraph> -> <paragraph>foo</paragraph>[]\n * walker.skip( () => false ); // Do not move the position.\n * ```\n *\n * @param skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n */\n skip(skip) {\n let done, value, prevPosition, prevVisitedParent;\n do {\n prevPosition = this.position;\n prevVisitedParent = this._visitedParent;\n ({ done, value } = this.next());\n } while (!done && skip(value));\n if (!done) {\n this._position = prevPosition;\n this._visitedParent = prevVisitedParent;\n }\n }\n /**\n * Gets the next tree walker's value.\n */\n next() {\n if (this.direction == 'forward') {\n return this._next();\n }\n else {\n return this._previous();\n }\n }\n /**\n * Makes a step forward in model. Moves the {@link #position} to the next position and returns the encountered value.\n */\n _next() {\n const previousPosition = this.position;\n const position = this.position.clone();\n const parent = this._visitedParent;\n // We are at the end of the root.\n if (parent.parent === null && position.offset === parent.maxOffset) {\n return { done: true, value: undefined };\n }\n // We reached the walker boundary.\n if (parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset) {\n return { done: true, value: undefined };\n }\n // Get node just after the current position.\n // Use a highly optimized version instead of checking the text node first and then getting the node after. See #6582.\n const textNodeAtPosition = getTextNodeAtPosition(position, parent);\n const node = textNodeAtPosition || getNodeAfterPosition(position, parent, textNodeAtPosition);\n if (node instanceof Element) {\n if (!this.shallow) {\n // Manual operations on path internals for optimization purposes. Here and in the rest of the method.\n position.path.push(0);\n this._visitedParent = node;\n }\n else {\n // We are past the walker boundaries.\n if (this.boundaries && this.boundaries.end.isBefore(position)) {\n return { done: true, value: undefined };\n }\n position.offset++;\n }\n this._position = position;\n return formatReturnValue('elementStart', node, previousPosition, position, 1);\n }\n if (node instanceof Text) {\n let charactersCount;\n if (this.singleCharacters) {\n charactersCount = 1;\n }\n else {\n let offset = node.endOffset;\n if (this._boundaryEndParent == parent && this.boundaries.end.offset < offset) {\n offset = this.boundaries.end.offset;\n }\n charactersCount = offset - position.offset;\n }\n const offsetInTextNode = position.offset - node.startOffset;\n const item = new TextProxy(node, offsetInTextNode, charactersCount);\n position.offset += charactersCount;\n this._position = position;\n return formatReturnValue('text', item, previousPosition, position, charactersCount);\n }\n // `node` is not set, we reached the end of current `parent`.\n position.path.pop();\n position.offset++;\n this._position = position;\n this._visitedParent = parent.parent;\n if (this.ignoreElementEnd) {\n return this._next();\n }\n return formatReturnValue('elementEnd', parent, previousPosition, position);\n }\n /**\n * Makes a step backward in model. Moves the {@link #position} to the previous position and returns the encountered value.\n */\n _previous() {\n const previousPosition = this.position;\n const position = this.position.clone();\n const parent = this._visitedParent;\n // We are at the beginning of the root.\n if (parent.parent === null && position.offset === 0) {\n return { done: true, value: undefined };\n }\n // We reached the walker boundary.\n if (parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset) {\n return { done: true, value: undefined };\n }\n // Get node just before the current position.\n // Use a highly optimized version instead of checking the text node first and then getting the node before. See #6582.\n const positionParent = position.parent;\n const textNodeAtPosition = getTextNodeAtPosition(position, positionParent);\n const node = textNodeAtPosition || getNodeBeforePosition(position, positionParent, textNodeAtPosition);\n if (node instanceof Element) {\n position.offset--;\n if (this.shallow) {\n this._position = position;\n return formatReturnValue('elementStart', node, previousPosition, position, 1);\n }\n position.path.push(node.maxOffset);\n this._position = position;\n this._visitedParent = node;\n if (this.ignoreElementEnd) {\n return this._previous();\n }\n return formatReturnValue('elementEnd', node, previousPosition, position);\n }\n if (node instanceof Text) {\n let charactersCount;\n if (this.singleCharacters) {\n charactersCount = 1;\n }\n else {\n let offset = node.startOffset;\n if (this._boundaryStartParent == parent && this.boundaries.start.offset > offset) {\n offset = this.boundaries.start.offset;\n }\n charactersCount = position.offset - offset;\n }\n const offsetInTextNode = position.offset - node.startOffset;\n const item = new TextProxy(node, offsetInTextNode - charactersCount, charactersCount);\n position.offset -= charactersCount;\n this._position = position;\n return formatReturnValue('text', item, previousPosition, position, charactersCount);\n }\n // `node` is not set, we reached the beginning of current `parent`.\n position.path.pop();\n this._position = position;\n this._visitedParent = parent.parent;\n return formatReturnValue('elementStart', parent, previousPosition, position, 1);\n }\n}\nfunction formatReturnValue(type, item, previousPosition, nextPosition, length) {\n return {\n done: false,\n value: {\n type,\n item,\n previousPosition,\n nextPosition,\n length\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/position\n */\nimport TypeCheckable from './typecheckable.js';\nimport TreeWalker from './treewalker.js';\nimport { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';\n/**\n * Represents a position in the model tree.\n *\n * A position is represented by its {@link module:engine/model/position~Position#root} and\n * a {@link module:engine/model/position~Position#path} in that root.\n *\n * You can create position instances via its constructor or the `createPosition*()` factory methods of\n * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.\n *\n * **Note:** Position is based on offsets, not indexes. This means that a position between two text nodes\n * `foo` and `bar` has offset `3`, not `1`. See {@link module:engine/model/position~Position#path} for more information.\n *\n * Since a position in the model is represented by a {@link module:engine/model/position~Position#root position root} and\n * {@link module:engine/model/position~Position#path position path} it is possible to create positions placed in non-existing places.\n * This requirement is important for operational transformation algorithms.\n *\n * Also, {@link module:engine/model/operation/operation~Operation operations}\n * kept in the {@link module:engine/model/document~Document#history document history}\n * are storing positions (and ranges) which were correct when those operations were applied, but may not be correct\n * after the document has changed.\n *\n * When changes are applied to the model, it may also happen that {@link module:engine/model/position~Position#parent position parent}\n * will change even if position path has not changed. Keep in mind, that if a position leads to non-existing element,\n * {@link module:engine/model/position~Position#parent} and some other properties and methods will throw errors.\n *\n * In most cases, position with wrong path is caused by an error in code, but it is sometimes needed, as described above.\n */\nexport default class Position extends TypeCheckable {\n /**\n * Creates a position.\n *\n * @param root Root of the position.\n * @param path Position path. See {@link module:engine/model/position~Position#path}.\n * @param stickiness Position stickiness. See {@link module:engine/model/position~PositionStickiness}.\n */\n constructor(root, path, stickiness = 'toNone') {\n super();\n if (!root.is('element') && !root.is('documentFragment')) {\n /**\n * Position root is invalid.\n *\n * Positions can only be anchored in elements or document fragments.\n *\n * @error model-position-root-invalid\n */\n throw new CKEditorError('model-position-root-invalid', root);\n }\n if (!(path instanceof Array) || path.length === 0) {\n /**\n * Position path must be an array with at least one item.\n *\n * @error model-position-path-incorrect-format\n * @param path\n */\n throw new CKEditorError('model-position-path-incorrect-format', root, { path });\n }\n // Normalize the root and path when element (not root) is passed.\n if (root.is('rootElement')) {\n path = path.slice();\n }\n else {\n path = [...root.getPath(), ...path];\n root = root.root;\n }\n this.root = root;\n this.path = path;\n this.stickiness = stickiness;\n }\n /**\n * Offset at which this position is located in its {@link module:engine/model/position~Position#parent parent}. It is equal\n * to the last item in position {@link module:engine/model/position~Position#path path}.\n *\n * @type {Number}\n */\n get offset() {\n return this.path[this.path.length - 1];\n }\n set offset(newOffset) {\n this.path[this.path.length - 1] = newOffset;\n }\n /**\n * Parent element of this position.\n *\n * Keep in mind that `parent` value is calculated when the property is accessed.\n * If {@link module:engine/model/position~Position#path position path}\n * leads to a non-existing element, `parent` property will throw error.\n *\n * Also it is a good idea to cache `parent` property if it is used frequently in an algorithm (i.e. in a long loop).\n */\n get parent() {\n let parent = this.root;\n for (let i = 0; i < this.path.length - 1; i++) {\n parent = parent.getChild(parent.offsetToIndex(this.path[i]));\n if (!parent) {\n /**\n * The position's path is incorrect. This means that a position does not point to\n * a correct place in the tree and hence, some of its methods and getters cannot work correctly.\n *\n * **Note**: Unlike DOM and view positions, in the model, the\n * {@link module:engine/model/position~Position#parent position's parent} is always an element or a document fragment.\n * The last offset in the {@link module:engine/model/position~Position#path position's path} is the point in this element\n * where this position points.\n *\n * Read more about model positions and offsets in\n * the {@glink framework/architecture/editing-engine#indexes-and-offsets Editing engine architecture} guide.\n *\n * @error model-position-path-incorrect\n * @param position The incorrect position.\n */\n throw new CKEditorError('model-position-path-incorrect', this, { position: this });\n }\n }\n if (parent.is('$text')) {\n throw new CKEditorError('model-position-path-incorrect', this, { position: this });\n }\n return parent;\n }\n /**\n * Position {@link module:engine/model/position~Position#offset offset} converted to an index in position's parent node. It is\n * equal to the {@link module:engine/model/node~Node#index index} of a node after this position. If position is placed\n * in text node, position index is equal to the index of that text node.\n */\n get index() {\n return this.parent.offsetToIndex(this.offset);\n }\n /**\n * Returns {@link module:engine/model/text~Text text node} instance in which this position is placed or `null` if this\n * position is not in a text node.\n */\n get textNode() {\n return getTextNodeAtPosition(this, this.parent);\n }\n /**\n * Node directly after this position or `null` if this position is in text node.\n */\n get nodeAfter() {\n // Cache the parent and reuse for performance reasons. See #6579 and #6582.\n const parent = this.parent;\n return getNodeAfterPosition(this, parent, getTextNodeAtPosition(this, parent));\n }\n /**\n * Node directly before this position or `null` if this position is in text node.\n */\n get nodeBefore() {\n // Cache the parent and reuse for performance reasons. See #6579 and #6582.\n const parent = this.parent;\n return getNodeBeforePosition(this, parent, getTextNodeAtPosition(this, parent));\n }\n /**\n * Is `true` if position is at the beginning of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.\n */\n get isAtStart() {\n return this.offset === 0;\n }\n /**\n * Is `true` if position is at the end of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.\n */\n get isAtEnd() {\n return this.offset == this.parent.maxOffset;\n }\n /**\n * Checks whether this position is before or after given position.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n */\n compareWith(otherPosition) {\n if (this.root != otherPosition.root) {\n return 'different';\n }\n const result = compareArrays(this.path, otherPosition.path);\n switch (result) {\n case 'same':\n return 'same';\n case 'prefix':\n return 'before';\n case 'extension':\n return 'after';\n default:\n return this.path[result] < otherPosition.path[result] ? 'before' : 'after';\n }\n }\n /**\n * Gets the farthest position which matches the callback using\n * {@link module:engine/model/treewalker~TreeWalker TreeWalker}.\n *\n * For example:\n *\n * ```ts\n * getLastMatchingPosition( value => value.type == 'text' );\n * // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>\n *\n * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } );\n * // <paragraph>foo[]</paragraph> -> <paragraph>[]foo</paragraph>\n *\n * getLastMatchingPosition( value => false );\n * // Do not move the position.\n * ```\n *\n * @param skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n *\n * @returns The position after the last item which matches the `skip` callback test.\n */\n getLastMatchingPosition(skip, options = {}) {\n options.startPosition = this;\n const treeWalker = new TreeWalker(options);\n treeWalker.skip(skip);\n return treeWalker.position;\n }\n /**\n * Returns a path to this position's parent. Parent path is equal to position {@link module:engine/model/position~Position#path path}\n * but without the last item.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @returns Path to the parent.\n */\n getParentPath() {\n return this.path.slice(0, -1);\n }\n /**\n * Returns ancestors array of this position, that is this position's parent and its ancestors.\n *\n * @returns Array with ancestors.\n */\n getAncestors() {\n const parent = this.parent;\n if (parent.is('documentFragment')) {\n return [parent];\n }\n else {\n return parent.getAncestors({ includeSelf: true });\n }\n }\n /**\n * Returns the parent element of the given name. Returns null if the position is not inside the desired parent.\n *\n * @param parentName The name of the parent element to find.\n */\n findAncestor(parentName) {\n const parent = this.parent;\n if (parent.is('element')) {\n return parent.findAncestor(parentName, { includeSelf: true });\n }\n return null;\n }\n /**\n * Returns the slice of two position {@link #path paths} which is identical. The {@link #root roots}\n * of these two paths must be identical.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param position The second position.\n * @returns The common path.\n */\n getCommonPath(position) {\n if (this.root != position.root) {\n return [];\n }\n // We find on which tree-level start and end have the lowest common ancestor\n const cmp = compareArrays(this.path, position.path);\n // If comparison returned string it means that arrays are same.\n const diffAt = (typeof cmp == 'string') ? Math.min(this.path.length, position.path.length) : cmp;\n return this.path.slice(0, diffAt);\n }\n /**\n * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}\n * which is a common ancestor of both positions. The {@link #root roots} of these two positions must be identical.\n *\n * @param position The second position.\n */\n getCommonAncestor(position) {\n const ancestorsA = this.getAncestors();\n const ancestorsB = position.getAncestors();\n let i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n /**\n * Returns a new instance of `Position`, that has same {@link #parent parent} but it's offset\n * is shifted by `shift` value (can be a negative value).\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param shift Offset shift. Can be a negative value.\n * @returns Shifted position.\n */\n getShiftedBy(shift) {\n const shifted = this.clone();\n const offset = shifted.offset + shift;\n shifted.offset = offset < 0 ? 0 : offset;\n return shifted;\n }\n /**\n * Checks whether this position is after given position.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @see module:engine/model/position~Position#isBefore\n * @param otherPosition Position to compare with.\n * @returns True if this position is after given position.\n */\n isAfter(otherPosition) {\n return this.compareWith(otherPosition) == 'after';\n }\n /**\n * Checks whether this position is before given position.\n *\n * **Note:** watch out when using negation of the value returned by this method, because the negation will also\n * be `true` if positions are in different roots and you might not expect this. You should probably use\n * `a.isAfter( b ) || a.isEqual( b )` or `!a.isBefore( p ) && a.root == b.root` in most scenarios. If your\n * condition uses multiple `isAfter` and `isBefore` checks, build them so they do not use negated values, i.e.:\n *\n * ```ts\n * if ( a.isBefore( b ) && c.isAfter( d ) ) {\n * \t// do A.\n * } else {\n * \t// do B.\n * }\n * ```\n *\n * or, if you have only one if-branch:\n *\n * ```ts\n * if ( !( a.isBefore( b ) && c.isAfter( d ) ) {\n * \t// do B.\n * }\n * ```\n *\n * rather than:\n *\n * ```ts\n * if ( !a.isBefore( b ) || && !c.isAfter( d ) ) {\n * \t// do B.\n * } else {\n * \t// do A.\n * }\n * ```\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param otherPosition Position to compare with.\n * @returns True if this position is before given position.\n */\n isBefore(otherPosition) {\n return this.compareWith(otherPosition) == 'before';\n }\n /**\n * Checks whether this position is equal to given position.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param otherPosition Position to compare with.\n * @returns True if positions are same.\n */\n isEqual(otherPosition) {\n return this.compareWith(otherPosition) == 'same';\n }\n /**\n * Checks whether this position is touching given position. Positions touch when there are no text nodes\n * or empty nodes in a range between them. Technically, those positions are not equal but in many cases\n * they are very similar or even indistinguishable.\n *\n * @param otherPosition Position to compare with.\n * @returns True if positions touch.\n */\n isTouching(otherPosition) {\n if (this.root !== otherPosition.root) {\n return false;\n }\n const commonLevel = Math.min(this.path.length, otherPosition.path.length);\n for (let level = 0; level < commonLevel; level++) {\n const diff = this.path[level] - otherPosition.path[level];\n // Positions are spread by a node, so they are not touching.\n if (diff < -1 || diff > 1) {\n return false;\n }\n else if (diff === 1) {\n // `otherPosition` is on the left.\n // `this` is on the right.\n return checkTouchingBranch(otherPosition, this, level);\n }\n else if (diff === -1) {\n // `this` is on the left.\n // `otherPosition` is on the right.\n return checkTouchingBranch(this, otherPosition, level);\n }\n // `diff === 0`.\n // Positions are inside the same element on this level, compare deeper.\n }\n // If we ended up here, it means that positions paths have the same beginning.\n // If the paths have the same length, then it means that they are identical, so the positions are same.\n if (this.path.length === otherPosition.path.length) {\n return true;\n }\n // If positions have different length of paths, then the common part is the same.\n // In this case, the \"shorter\" position is on the left, the \"longer\" position is on the right.\n //\n // If the positions are touching, the \"longer\" position must have only zeroes. For example:\n // [ 1, 2 ] vs [ 1, 2, 0 ]\n // [ 1, 2 ] vs [ 1, 2, 0, 0, 0 ]\n else if (this.path.length > otherPosition.path.length) {\n return checkOnlyZeroes(this.path, commonLevel);\n }\n else {\n return checkOnlyZeroes(otherPosition.path, commonLevel);\n }\n }\n /**\n * Checks if two positions are in the same parent.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param position Position to compare with.\n * @returns `true` if positions have the same parent, `false` otherwise.\n */\n hasSameParentAs(position) {\n if (this.root !== position.root) {\n return false;\n }\n const thisParentPath = this.getParentPath();\n const posParentPath = position.getParentPath();\n return compareArrays(thisParentPath, posParentPath) == 'same';\n }\n /**\n * Returns a copy of this position that is transformed by given `operation`.\n *\n * The new position's parameters are updated accordingly to the effect of the `operation`.\n *\n * For example, if `n` nodes are inserted before the position, the returned position {@link ~Position#offset} will be\n * increased by `n`. If the position was in a merged element, it will be accordingly moved to the new element, etc.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param operation Operation to transform by.\n * @returns Transformed position.\n */\n getTransformedByOperation(operation) {\n let result;\n switch (operation.type) {\n case 'insert':\n result = this._getTransformedByInsertOperation(operation);\n break;\n case 'move':\n case 'remove':\n case 'reinsert':\n result = this._getTransformedByMoveOperation(operation);\n break;\n case 'split':\n result = this._getTransformedBySplitOperation(operation);\n break;\n case 'merge':\n result = this._getTransformedByMergeOperation(operation);\n break;\n default:\n result = Position._createAt(this);\n break;\n }\n return result;\n }\n /**\n * Returns a copy of this position transformed by an insert operation.\n *\n * @internal\n */\n _getTransformedByInsertOperation(operation) {\n return this._getTransformedByInsertion(operation.position, operation.howMany);\n }\n /**\n * Returns a copy of this position transformed by a move operation.\n *\n * @internal\n */\n _getTransformedByMoveOperation(operation) {\n return this._getTransformedByMove(operation.sourcePosition, operation.targetPosition, operation.howMany);\n }\n /**\n * Returns a copy of this position transformed by a split operation.\n *\n * @internal\n */\n _getTransformedBySplitOperation(operation) {\n const movedRange = operation.movedRange;\n const isContained = movedRange.containsPosition(this) ||\n (movedRange.start.isEqual(this) && this.stickiness == 'toNext');\n if (isContained) {\n return this._getCombined(operation.splitPosition, operation.moveTargetPosition);\n }\n else {\n if (operation.graveyardPosition) {\n return this._getTransformedByMove(operation.graveyardPosition, operation.insertionPosition, 1);\n }\n else {\n return this._getTransformedByInsertion(operation.insertionPosition, 1);\n }\n }\n }\n /**\n * Returns a copy of this position transformed by merge operation.\n *\n * @internal\n */\n _getTransformedByMergeOperation(operation) {\n const movedRange = operation.movedRange;\n const isContained = movedRange.containsPosition(this) || movedRange.start.isEqual(this);\n let pos;\n if (isContained) {\n pos = this._getCombined(operation.sourcePosition, operation.targetPosition);\n if (operation.sourcePosition.isBefore(operation.targetPosition)) {\n // Above happens during OT when the merged element is moved before the merged-to element.\n pos = pos._getTransformedByDeletion(operation.deletionPosition, 1);\n }\n }\n else if (this.isEqual(operation.deletionPosition)) {\n pos = Position._createAt(operation.deletionPosition);\n }\n else {\n pos = this._getTransformedByMove(operation.deletionPosition, operation.graveyardPosition, 1);\n }\n return pos;\n }\n /**\n * Returns a copy of this position that is updated by removing `howMany` nodes starting from `deletePosition`.\n * It may happen that this position is in a removed node. If that is the case, `null` is returned instead.\n *\n * @internal\n * @param deletePosition Position before the first removed node.\n * @param howMany How many nodes are removed.\n * @returns Transformed position or `null`.\n */\n _getTransformedByDeletion(deletePosition, howMany) {\n const transformed = Position._createAt(this);\n // This position can't be affected if deletion was in a different root.\n if (this.root != deletePosition.root) {\n return transformed;\n }\n if (compareArrays(deletePosition.getParentPath(), this.getParentPath()) == 'same') {\n // If nodes are removed from the node that is pointed by this position...\n if (deletePosition.offset < this.offset) {\n // And are removed from before an offset of that position...\n if (deletePosition.offset + howMany > this.offset) {\n // Position is in removed range, it's no longer in the tree.\n return null;\n }\n else {\n // Decrement the offset accordingly.\n transformed.offset -= howMany;\n }\n }\n }\n else if (compareArrays(deletePosition.getParentPath(), this.getParentPath()) == 'prefix') {\n // If nodes are removed from a node that is on a path to this position...\n const i = deletePosition.path.length - 1;\n if (deletePosition.offset <= this.path[i]) {\n // And are removed from before next node of that path...\n if (deletePosition.offset + howMany > this.path[i]) {\n // If the next node of that path is removed return null\n // because the node containing this position got removed.\n return null;\n }\n else {\n // Otherwise, decrement index on that path.\n transformed.path[i] -= howMany;\n }\n }\n }\n return transformed;\n }\n /**\n * Returns a copy of this position that is updated by inserting `howMany` nodes at `insertPosition`.\n *\n * @internal\n * @param insertPosition Position where nodes are inserted.\n * @param howMany How many nodes are inserted.\n * @returns Transformed position.\n */\n _getTransformedByInsertion(insertPosition, howMany) {\n const transformed = Position._createAt(this);\n // This position can't be affected if insertion was in a different root.\n if (this.root != insertPosition.root) {\n return transformed;\n }\n if (compareArrays(insertPosition.getParentPath(), this.getParentPath()) == 'same') {\n // If nodes are inserted in the node that is pointed by this position...\n if (insertPosition.offset < this.offset || (insertPosition.offset == this.offset && this.stickiness != 'toPrevious')) {\n // And are inserted before an offset of that position...\n // \"Push\" this positions offset.\n transformed.offset += howMany;\n }\n }\n else if (compareArrays(insertPosition.getParentPath(), this.getParentPath()) == 'prefix') {\n // If nodes are inserted in a node that is on a path to this position...\n const i = insertPosition.path.length - 1;\n if (insertPosition.offset <= this.path[i]) {\n // And are inserted before next node of that path...\n // \"Push\" the index on that path.\n transformed.path[i] += howMany;\n }\n }\n return transformed;\n }\n /**\n * Returns a copy of this position that is updated by moving `howMany` nodes from `sourcePosition` to `targetPosition`.\n *\n * @internal\n * @param sourcePosition Position before the first element to move.\n * @param targetPosition Position where moved elements will be inserted.\n * @param howMany How many consecutive nodes to move, starting from `sourcePosition`.\n * @returns Transformed position.\n */\n _getTransformedByMove(sourcePosition, targetPosition, howMany) {\n // Update target position, as it could be affected by nodes removal.\n targetPosition = targetPosition._getTransformedByDeletion(sourcePosition, howMany);\n if (sourcePosition.isEqual(targetPosition)) {\n // If `targetPosition` is equal to `sourcePosition` this isn't really any move. Just return position as it is.\n return Position._createAt(this);\n }\n // Moving a range removes nodes from their original position. We acknowledge this by proper transformation.\n const transformed = this._getTransformedByDeletion(sourcePosition, howMany);\n const isMoved = transformed === null ||\n (sourcePosition.isEqual(this) && this.stickiness == 'toNext') ||\n (sourcePosition.getShiftedBy(howMany).isEqual(this) && this.stickiness == 'toPrevious');\n if (isMoved) {\n // This position is inside moved range (or sticks to it).\n // In this case, we calculate a combination of this position, move source position and target position.\n return this._getCombined(sourcePosition, targetPosition);\n }\n else {\n // This position is not inside a removed range.\n //\n // In next step, we simply reflect inserting `howMany` nodes, which might further affect the position.\n return transformed._getTransformedByInsertion(targetPosition, howMany);\n }\n }\n /**\n * Returns a new position that is a combination of this position and given positions.\n *\n * The combined position is a copy of this position transformed by moving a range starting at `source` position\n * to the `target` position. It is expected that this position is inside the moved range.\n *\n * Example:\n *\n * ```ts\n * let original = model.createPositionFromPath( root, [ 2, 3, 1 ] );\n * let source = model.createPositionFromPath( root, [ 2, 2 ] );\n * let target = model.createPositionFromPath( otherRoot, [ 1, 1, 3 ] );\n * original._getCombined( source, target ); // path is [ 1, 1, 4, 1 ], root is `otherRoot`\n * ```\n *\n * Explanation:\n *\n * We have a position `[ 2, 3, 1 ]` and move some nodes from `[ 2, 2 ]` to `[ 1, 1, 3 ]`. The original position\n * was inside moved nodes and now should point to the new place. The moved nodes will be after\n * positions `[ 1, 1, 3 ]`, `[ 1, 1, 4 ]`, `[ 1, 1, 5 ]`. Since our position was in the second moved node,\n * the transformed position will be in a sub-tree of a node at `[ 1, 1, 4 ]`. Looking at original path, we\n * took care of `[ 2, 3 ]` part of it. Now we have to add the rest of the original path to the transformed path.\n * Finally, the transformed position will point to `[ 1, 1, 4, 1 ]`.\n *\n * @internal\n * @param source Beginning of the moved range.\n * @param target Position where the range is moved.\n * @returns Combined position.\n */\n _getCombined(source, target) {\n const i = source.path.length - 1;\n // The first part of a path to combined position is a path to the place where nodes were moved.\n const combined = Position._createAt(target);\n combined.stickiness = this.stickiness;\n // Then we have to update the rest of the path.\n // Fix the offset because this position might be after `from` position and we have to reflect that.\n combined.offset = combined.offset + this.path[i] - source.offset;\n // Then, add the rest of the path.\n // If this position is at the same level as `from` position nothing will get added.\n combined.path = [...combined.path, ...this.path.slice(i + 1)];\n return combined;\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n return {\n root: this.root.toJSON(),\n path: Array.from(this.path),\n stickiness: this.stickiness\n };\n }\n /**\n * Returns a new position that is equal to current position.\n */\n clone() {\n return new this.constructor(this.root, this.path, this.stickiness);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/model/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/model/item~Item model item} and `'before'` or `'after'` (sets position before or after given model item).\n *\n * This method is a shortcut to other factory methods such as:\n *\n * * {@link module:engine/model/position~Position._createBefore},\n * * {@link module:engine/model/position~Position._createAfter}.\n *\n * @internal\n * @param offset Offset or one of the flags. Used only when the first parameter is a {@link module:engine/model/item~Item model item}.\n * @param stickiness Position stickiness. Used only when the first parameter is a {@link module:engine/model/item~Item model item}.\n */\n static _createAt(itemOrPosition, offset, stickiness = 'toNone') {\n if (itemOrPosition instanceof Position) {\n return new Position(itemOrPosition.root, itemOrPosition.path, itemOrPosition.stickiness);\n }\n else {\n const node = itemOrPosition;\n if (offset == 'end') {\n offset = node.maxOffset;\n }\n else if (offset == 'before') {\n return this._createBefore(node, stickiness);\n }\n else if (offset == 'after') {\n return this._createAfter(node, stickiness);\n }\n else if (offset !== 0 && !offset) {\n /**\n * {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}\n * requires the offset to be specified when the first parameter is a model item.\n *\n * @error model-createpositionat-offset-required\n */\n throw new CKEditorError('model-createpositionat-offset-required', [this, itemOrPosition]);\n }\n if (!node.is('element') && !node.is('documentFragment')) {\n /**\n * Position parent have to be a model element or model document fragment.\n *\n * @error model-position-parent-incorrect\n */\n throw new CKEditorError('model-position-parent-incorrect', [this, itemOrPosition]);\n }\n const path = node.getPath();\n path.push(offset);\n return new this(node.root, path, stickiness);\n }\n }\n /**\n * Creates a new position, after given {@link module:engine/model/item~Item model item}.\n *\n * @internal\n * @param item Item after which the position should be placed.\n * @param stickiness Position stickiness.\n */\n static _createAfter(item, stickiness) {\n if (!item.parent) {\n /**\n * You can not make a position after a root element.\n *\n * @error model-position-after-root\n * @param root\n */\n throw new CKEditorError('model-position-after-root', [this, item], { root: item });\n }\n return this._createAt(item.parent, item.endOffset, stickiness);\n }\n /**\n * Creates a new position, before the given {@link module:engine/model/item~Item model item}.\n *\n * @internal\n * @param item Item before which the position should be placed.\n * @param stickiness Position stickiness.\n */\n static _createBefore(item, stickiness) {\n if (!item.parent) {\n /**\n * You can not make a position before a root element.\n *\n * @error model-position-before-root\n * @param root\n */\n throw new CKEditorError('model-position-before-root', item, { root: item });\n }\n return this._createAt(item.parent, item.startOffset, stickiness);\n }\n /**\n * Creates a `Position` instance from given plain object (i.e. parsed JSON string).\n *\n * @param json Plain object to be converted to `Position`.\n * @param doc Document object that will be position owner.\n * @returns `Position` instance created using given plain object.\n */\n static fromJSON(json, doc) {\n if (json.root === '$graveyard') {\n const pos = new Position(doc.graveyard, json.path);\n pos.stickiness = json.stickiness;\n return pos;\n }\n if (!doc.getRoot(json.root)) {\n /**\n * Cannot create position for document. Root with specified name does not exist.\n *\n * @error model-position-fromjson-no-root\n * @param rootName\n */\n throw new CKEditorError('model-position-fromjson-no-root', doc, { rootName: json.root });\n }\n return new Position(doc.getRoot(json.root), json.path, json.stickiness);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nPosition.prototype.is = function (type) {\n return type === 'position' || type === 'model:position';\n};\n/**\n * Returns a text node at the given position.\n *\n * This is a helper function optimized to reuse the position parent instance for performance reasons.\n *\n * Normally, you should use {@link module:engine/model/position~Position#textNode `Position#textNode`}.\n * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`}\n * check if your algorithm does not access it multiple times (which can happen directly or indirectly via other position properties).\n *\n * See https://github.com/ckeditor/ckeditor5/issues/6579.\n *\n * See also:\n *\n * * {@link module:engine/model/position~getNodeAfterPosition}\n * * {@link module:engine/model/position~getNodeBeforePosition}\n *\n * @param positionParent The parent of the given position.\n */\nexport function getTextNodeAtPosition(position, positionParent) {\n const node = positionParent.getChild(positionParent.offsetToIndex(position.offset));\n if (node && node.is('$text') && node.startOffset < position.offset) {\n return node;\n }\n return null;\n}\n/**\n * Returns the node after the given position.\n *\n * This is a helper function optimized to reuse the position parent instance and the calculation of the text node at the\n * specific position for performance reasons.\n *\n * Normally, you should use {@link module:engine/model/position~Position#nodeAfter `Position#nodeAfter`}.\n * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`} and/or\n * {@link module:engine/model/position~Position#textNode `Position#textNode`}\n * check if your algorithm does not access those properties multiple times\n * (which can happen directly or indirectly via other position properties).\n *\n * See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.\n *\n * See also:\n *\n * * {@link module:engine/model/position~getTextNodeAtPosition}\n * * {@link module:engine/model/position~getNodeBeforePosition}\n *\n * @param positionParent The parent of the given position.\n * @param textNode Text node at the given position.\n */\nexport function getNodeAfterPosition(position, positionParent, textNode) {\n if (textNode !== null) {\n return null;\n }\n return positionParent.getChild(positionParent.offsetToIndex(position.offset));\n}\n/**\n * Returns the node before the given position.\n *\n * Refer to {@link module:engine/model/position~getNodeBeforePosition} for documentation on when to use this util method.\n *\n * See also:\n *\n * * {@link module:engine/model/position~getTextNodeAtPosition}\n * * {@link module:engine/model/position~getNodeAfterPosition}\n *\n * @param positionParent The parent of the given position.\n * @param textNode Text node at the given position.\n */\nexport function getNodeBeforePosition(position, positionParent, textNode) {\n if (textNode !== null) {\n return null;\n }\n return positionParent.getChild(positionParent.offsetToIndex(position.offset) - 1);\n}\n/**\n * This is a helper function for `Position#isTouching()`.\n *\n * It checks whether to given positions are touching, considering that they have the same root and paths\n * until given level, and at given level they differ by 1 (so they are branching at `level` point).\n *\n * The exact requirements for touching positions are described in `Position#isTouching()` and also\n * in the body of this function.\n *\n * @param left Position \"on the left\" (it is before `right`).\n * @param right Position \"on the right\" (it is after `left`).\n * @param level Level on which the positions are different.\n */\nfunction checkTouchingBranch(left, right, level) {\n if (level + 1 === left.path.length) {\n // Left position does not have any more entries after the point where the positions differ.\n // [ 2 ] vs [ 3 ]\n // [ 2 ] vs [ 3, 0, 0 ]\n // The positions are spread by node at [ 2 ].\n return false;\n }\n if (!checkOnlyZeroes(right.path, level + 1)) {\n // Right position does not have only zeroes, so we have situation like:\n // [ 2, maxOffset ] vs [ 3, 1 ]\n // [ 2, maxOffset ] vs [ 3, 1, 0, 0 ]\n // The positions are spread by node at [ 3, 0 ].\n return false;\n }\n if (!checkOnlyMaxOffset(left, level + 1)) {\n // Left position does not have only max offsets, so we have situation like:\n // [ 2, 4 ] vs [ 3 ]\n // [ 2, 4 ] vs [ 3, 0, 0 ]\n // The positions are spread by node at [ 2, 5 ].\n return false;\n }\n // Left position has only max offsets and right position has only zeroes or nothing.\n // [ 2, maxOffset ] vs [ 3 ]\n // [ 2, maxOffset, maxOffset ] vs [ 3, 0 ]\n // There are not elements between positions. The positions are touching.\n return true;\n}\n/**\n * Checks whether for given array, starting from given index until the end of the array, all items are `0`s.\n *\n * This is a helper function for `Position#isTouching()`.\n */\nfunction checkOnlyZeroes(arr, idx) {\n while (idx < arr.length) {\n if (arr[idx] !== 0) {\n return false;\n }\n idx++;\n }\n return true;\n}\n/**\n * Checks whether for given position, starting from given path level, whether the position is at the end of\n * its parent and whether each element on the path to the position is also at at the end of its parent.\n *\n * This is a helper function for `Position#isTouching()`.\n */\nfunction checkOnlyMaxOffset(pos, level) {\n let parent = pos.parent;\n let idx = pos.path.length - 1;\n let add = 0;\n while (idx >= level) {\n if (pos.path[idx] + add !== parent.maxOffset) {\n return false;\n }\n // After the first check, we \"go up\", and check whether the position's parent-parent is the last element.\n // However, we need to add 1 to the value in the path to \"simulate\" moving the path after the parent.\n // It happens just once.\n add = 1;\n idx--;\n parent = parent.parent;\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/range\n */\nimport TypeCheckable from './typecheckable.js';\nimport Position from './position.js';\nimport TreeWalker from './treewalker.js';\nimport { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';\n/**\n * Represents a range in the model tree.\n *\n * A range is defined by its {@link module:engine/model/range~Range#start} and {@link module:engine/model/range~Range#end}\n * positions.\n *\n * You can create range instances via its constructor or the `createRange*()` factory methods of\n * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.\n */\nexport default class Range extends TypeCheckable {\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * @param start The start position.\n * @param end The end position. If not set, the range will be collapsed at the `start` position.\n */\n constructor(start, end) {\n super();\n this.start = Position._createAt(start);\n this.end = end ? Position._createAt(end) : Position._createAt(start);\n // If the range is collapsed, treat in a similar way as a position and set its boundaries stickiness to 'toNone'.\n // In other case, make the boundaries stick to the \"inside\" of the range.\n this.start.stickiness = this.isCollapsed ? 'toNone' : 'toNext';\n this.end.stickiness = this.isCollapsed ? 'toNone' : 'toPrevious';\n }\n /**\n * Iterable interface.\n *\n * Iterates over all {@link module:engine/model/item~Item items} that are in this range and returns\n * them together with additional information like length or {@link module:engine/model/position~Position positions},\n * grouped as {@link module:engine/model/treewalker~TreeWalkerValue}.\n * It iterates over all {@link module:engine/model/textproxy~TextProxy text contents} that are inside the range\n * and all the {@link module:engine/model/element~Element}s that are entered into when iterating over this range.\n *\n * This iterator uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range\n * and `ignoreElementEnd` option set to `true`.\n */\n *[Symbol.iterator]() {\n yield* new TreeWalker({ boundaries: this, ignoreElementEnd: true });\n }\n /**\n * Describes whether the range is collapsed, that is if {@link #start} and\n * {@link #end} positions are equal.\n */\n get isCollapsed() {\n return this.start.isEqual(this.end);\n }\n /**\n * Describes whether this range is flat, that is if {@link #start} position and\n * {@link #end} position are in the same {@link module:engine/model/position~Position#parent}.\n */\n get isFlat() {\n const startParentPath = this.start.getParentPath();\n const endParentPath = this.end.getParentPath();\n return compareArrays(startParentPath, endParentPath) == 'same';\n }\n /**\n * Range root element.\n */\n get root() {\n return this.start.root;\n }\n /**\n * Checks whether this range contains given {@link module:engine/model/position~Position position}.\n *\n * @param position Position to check.\n * @returns `true` if given {@link module:engine/model/position~Position position} is contained\n * in this range,`false` otherwise.\n */\n containsPosition(position) {\n return position.isAfter(this.start) && position.isBefore(this.end);\n }\n /**\n * Checks whether this range contains given {@link ~Range range}.\n *\n * @param otherRange Range to check.\n * @param loose Whether the check is loose or strict. If the check is strict (`false`), compared range cannot\n * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or\n * even be equal to this range. Note that collapsed ranges are always compared in strict mode.\n * @returns {Boolean} `true` if given {@link ~Range range} boundaries are contained by this range, `false` otherwise.\n */\n containsRange(otherRange, loose = false) {\n if (otherRange.isCollapsed) {\n loose = false;\n }\n const containsStart = this.containsPosition(otherRange.start) || (loose && this.start.isEqual(otherRange.start));\n const containsEnd = this.containsPosition(otherRange.end) || (loose && this.end.isEqual(otherRange.end));\n return containsStart && containsEnd;\n }\n /**\n * Checks whether given {@link module:engine/model/item~Item} is inside this range.\n */\n containsItem(item) {\n const pos = Position._createBefore(item);\n return this.containsPosition(pos) || this.start.isEqual(pos);\n }\n /**\n * Two ranges are equal if their {@link #start} and {@link #end} positions are equal.\n *\n * @param otherRange Range to compare with.\n * @returns `true` if ranges are equal, `false` otherwise.\n */\n isEqual(otherRange) {\n return this.start.isEqual(otherRange.start) && this.end.isEqual(otherRange.end);\n }\n /**\n * Checks and returns whether this range intersects with given range.\n *\n * @param otherRange Range to compare with.\n * @returns `true` if ranges intersect, `false` otherwise.\n */\n isIntersecting(otherRange) {\n return this.start.isBefore(otherRange.end) && this.end.isAfter(otherRange.start);\n }\n /**\n * Computes which part(s) of this {@link ~Range range} is not a part of given {@link ~Range range}.\n * Returned array contains zero, one or two {@link ~Range ranges}.\n *\n * Examples:\n *\n * ```ts\n * let range = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n * \tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n * );\n * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 5 ] ) );\n * let transformed = range.getDifference( otherRange );\n * // transformed array has no ranges because `otherRange` contains `range`\n *\n * otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 3 ] ) );\n * transformed = range.getDifference( otherRange );\n * // transformed array has one range: from [ 3 ] to [ 4, 0, 1 ]\n *\n * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 4 ] ) );\n * transformed = range.getDifference( otherRange );\n * // transformed array has two ranges: from [ 2, 7 ] to [ 3 ] and from [ 4 ] to [ 4, 0, 1 ]\n * ```\n *\n * @param otherRange Range to differentiate against.\n * @returns The difference between ranges.\n */\n getDifference(otherRange) {\n const ranges = [];\n if (this.isIntersecting(otherRange)) {\n // Ranges intersect.\n if (this.containsPosition(otherRange.start)) {\n // Given range start is inside this range. This means that we have to\n // add shrunken range - from the start to the middle of this range.\n ranges.push(new Range(this.start, otherRange.start));\n }\n if (this.containsPosition(otherRange.end)) {\n // Given range end is inside this range. This means that we have to\n // add shrunken range - from the middle of this range to the end.\n ranges.push(new Range(otherRange.end, this.end));\n }\n }\n else {\n // Ranges do not intersect, return the original range.\n ranges.push(new Range(this.start, this.end));\n }\n return ranges;\n }\n /**\n * Returns an intersection of this {@link ~Range range} and given {@link ~Range range}.\n * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.\n *\n * Examples:\n *\n * ```ts\n * let range = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n * \tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n * );\n * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 2 ] ) );\n * let transformed = range.getIntersection( otherRange ); // null - ranges have no common part\n *\n * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 5 ] ) );\n * transformed = range.getIntersection( otherRange ); // range from [ 3 ] to [ 4, 0, 1 ]\n * ```\n *\n * @param otherRange Range to check for intersection.\n * @returns A common part of given ranges or `null` if ranges have no common part.\n */\n getIntersection(otherRange) {\n if (this.isIntersecting(otherRange)) {\n // Ranges intersect, so a common range will be returned.\n // At most, it will be same as this range.\n let commonRangeStart = this.start;\n let commonRangeEnd = this.end;\n if (this.containsPosition(otherRange.start)) {\n // Given range start is inside this range. This means thaNt we have to\n // shrink common range to the given range start.\n commonRangeStart = otherRange.start;\n }\n if (this.containsPosition(otherRange.end)) {\n // Given range end is inside this range. This means that we have to\n // shrink common range to the given range end.\n commonRangeEnd = otherRange.end;\n }\n return new Range(commonRangeStart, commonRangeEnd);\n }\n // Ranges do not intersect, so they do not have common part.\n return null;\n }\n /**\n * Returns a range created by joining this {@link ~Range range} with the given {@link ~Range range}.\n * If ranges have no common part, returns `null`.\n *\n * Examples:\n *\n * ```ts\n * let range = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n * \tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n * );\n * let otherRange = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 1 ] ),\n * \tmodel.createPositionFromPath( root, [ 2 ] )\n * );\n * let transformed = range.getJoined( otherRange ); // null - ranges have no common part\n *\n * otherRange = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 3 ] ),\n * \tmodel.createPositionFromPath( root, [ 5 ] )\n * );\n * transformed = range.getJoined( otherRange ); // range from [ 2, 7 ] to [ 5 ]\n * ```\n *\n * @param otherRange Range to be joined.\n * @param loose Whether the intersection check is loose or strict. If the check is strict (`false`),\n * ranges are tested for intersection or whether start/end positions are equal. If the check is loose (`true`),\n * compared range is also checked if it's {@link module:engine/model/position~Position#isTouching touching} current range.\n * @returns A sum of given ranges or `null` if ranges have no common part.\n */\n getJoined(otherRange, loose = false) {\n let shouldJoin = this.isIntersecting(otherRange);\n if (!shouldJoin) {\n if (this.start.isBefore(otherRange.start)) {\n shouldJoin = loose ? this.end.isTouching(otherRange.start) : this.end.isEqual(otherRange.start);\n }\n else {\n shouldJoin = loose ? otherRange.end.isTouching(this.start) : otherRange.end.isEqual(this.start);\n }\n }\n if (!shouldJoin) {\n return null;\n }\n let startPosition = this.start;\n let endPosition = this.end;\n if (otherRange.start.isBefore(startPosition)) {\n startPosition = otherRange.start;\n }\n if (otherRange.end.isAfter(endPosition)) {\n endPosition = otherRange.end;\n }\n return new Range(startPosition, endPosition);\n }\n /**\n * Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.\n *\n * See an example of a model structure (`[` and `]` are range boundaries):\n *\n * ```\n * root root\n * |- element DIV DIV P2 P3 DIV\n * | |- element H H P1 f o o b a r H P4\n * | | |- \"fir[st\" fir[st lorem se]cond ipsum\n * | |- element P1\n * | | |- \"lorem\" ||\n * |- element P2 ||\n * | |- \"foo\" VV\n * |- element P3\n * | |- \"bar\" root\n * |- element DIV DIV [P2 P3] DIV\n * | |- element H H [P1] f o o b a r H P4\n * | | |- \"se]cond\" fir[st] lorem [se]cond ipsum\n * | |- element P4\n * | | |- \"ipsum\"\n * ```\n *\n * As it can be seen, letters contained in the range are: `stloremfoobarse`, spread across different parents.\n * We are looking for minimal set of flat ranges that contains the same nodes.\n *\n * Minimal flat ranges for above range `( [ 0, 0, 3 ], [ 3, 0, 2 ] )` will be:\n *\n * ```\n * ( [ 0, 0, 3 ], [ 0, 0, 5 ] ) = \"st\"\n * ( [ 0, 1 ], [ 0, 2 ] ) = element P1 (\"lorem\")\n * ( [ 1 ], [ 3 ] ) = element P2, element P3 (\"foobar\")\n * ( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = \"se\"\n * ```\n *\n * **Note:** if an {@link module:engine/model/element~Element element} is not wholly contained in this range, it won't be returned\n * in any of the returned flat ranges. See in the example how `H` elements at the beginning and at the end of the range\n * were omitted. Only their parts that were wholly in the range were returned.\n *\n * **Note:** this method is not returning flat ranges that contain no nodes.\n *\n * @returns Array of flat ranges covering this range.\n */\n getMinimalFlatRanges() {\n const ranges = [];\n const diffAt = this.start.getCommonPath(this.end).length;\n const pos = Position._createAt(this.start);\n let posParent = pos.parent;\n // Go up.\n while (pos.path.length > diffAt + 1) {\n const howMany = posParent.maxOffset - pos.offset;\n if (howMany !== 0) {\n ranges.push(new Range(pos, pos.getShiftedBy(howMany)));\n }\n pos.path = pos.path.slice(0, -1);\n pos.offset++;\n posParent = posParent.parent;\n }\n // Go down.\n while (pos.path.length <= this.end.path.length) {\n const offset = this.end.path[pos.path.length - 1];\n const howMany = offset - pos.offset;\n if (howMany !== 0) {\n ranges.push(new Range(pos, pos.getShiftedBy(howMany)));\n }\n pos.offset = offset;\n pos.path.push(0);\n }\n return ranges;\n }\n /**\n * Creates a {@link module:engine/model/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.\n *\n * For example, to iterate over all items in the entire document root:\n *\n * ```ts\n * // Create a range spanning over the entire root content:\n * const range = editor.model.createRangeIn( editor.model.document.getRoot() );\n *\n * // Iterate over all items in this range:\n * for ( const value of range.getWalker() ) {\n * \tconsole.log( value.item );\n * }\n * ```\n *\n * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n */\n getWalker(options = {}) {\n options.boundaries = this;\n return new TreeWalker(options);\n }\n /**\n * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns\n * them.\n *\n * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option\n * set to `true`. However it returns only {@link module:engine/model/item~Item model items},\n * not {@link module:engine/model/treewalker~TreeWalkerValue}.\n *\n * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for\n * a full list of available options.\n *\n * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n */\n *getItems(options = {}) {\n options.boundaries = this;\n options.ignoreElementEnd = true;\n const treeWalker = new TreeWalker(options);\n for (const value of treeWalker) {\n yield value.item;\n }\n }\n /**\n * Returns an iterator that iterates over all {@link module:engine/model/position~Position positions} that are boundaries or\n * contained in this range.\n *\n * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only\n * {@link module:engine/model/position~Position positions}, not {@link module:engine/model/treewalker~TreeWalkerValue}.\n *\n * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for\n * a full list of available options.\n *\n * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n */\n *getPositions(options = {}) {\n options.boundaries = this;\n const treeWalker = new TreeWalker(options);\n yield treeWalker.position;\n for (const value of treeWalker) {\n yield value.nextPosition;\n }\n }\n /**\n * Returns a range that is a result of transforming this range by given `operation`.\n *\n * **Note:** transformation may break one range into multiple ranges (for example, when a part of the range is\n * moved to a different part of document tree). For this reason, an array is returned by this method and it\n * may contain one or more `Range` instances.\n *\n * @param operation Operation to transform range by.\n * @returns Range which is the result of transformation.\n */\n getTransformedByOperation(operation) {\n switch (operation.type) {\n case 'insert':\n return this._getTransformedByInsertOperation(operation);\n case 'move':\n case 'remove':\n case 'reinsert':\n return this._getTransformedByMoveOperation(operation);\n case 'split':\n return [this._getTransformedBySplitOperation(operation)];\n case 'merge':\n return [this._getTransformedByMergeOperation(operation)];\n }\n return [new Range(this.start, this.end)];\n }\n /**\n * Returns a range that is a result of transforming this range by multiple `operations`.\n *\n * @see ~Range#getTransformedByOperation\n * @param operations Operations to transform the range by.\n * @returns Range which is the result of transformation.\n */\n getTransformedByOperations(operations) {\n const ranges = [new Range(this.start, this.end)];\n for (const operation of operations) {\n for (let i = 0; i < ranges.length; i++) {\n const result = ranges[i].getTransformedByOperation(operation);\n ranges.splice(i, 1, ...result);\n i += result.length - 1;\n }\n }\n // It may happen that a range is split into two, and then the part of second \"piece\" is moved into first\n // \"piece\". In this case we will have incorrect third range, which should not be included in the result --\n // because it is already included in the first \"piece\". In this loop we are looking for all such ranges that\n // are inside other ranges and we simply remove them.\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n for (let j = i + 1; j < ranges.length; j++) {\n const next = ranges[j];\n if (range.containsRange(next) || next.containsRange(range) || range.isEqual(next)) {\n ranges.splice(j, 1);\n }\n }\n }\n return ranges;\n }\n /**\n * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}\n * which is a common ancestor of the range's both ends (in which the entire range is contained).\n */\n getCommonAncestor() {\n return this.start.getCommonAncestor(this.end);\n }\n /**\n * Returns an {@link module:engine/model/element~Element Element} contained by the range.\n * The element will be returned when it is the **only** node within the range and **fully–contained**\n * at the same time.\n */\n getContainedElement() {\n if (this.isCollapsed) {\n return null;\n }\n const nodeAfterStart = this.start.nodeAfter;\n const nodeBeforeEnd = this.end.nodeBefore;\n if (nodeAfterStart && nodeAfterStart.is('element') && nodeAfterStart === nodeBeforeEnd) {\n return nodeAfterStart;\n }\n return null;\n }\n /**\n * Converts `Range` to plain object and returns it.\n *\n * @returns `Node` converted to plain object.\n */\n toJSON() {\n return {\n start: this.start.toJSON(),\n end: this.end.toJSON()\n };\n }\n /**\n * Returns a new range that is equal to current range.\n */\n clone() {\n return new this.constructor(this.start, this.end);\n }\n /**\n * Returns a result of transforming a copy of this range by insert operation.\n *\n * One or more ranges may be returned as a result of this transformation.\n *\n * @internal\n */\n _getTransformedByInsertOperation(operation, spread = false) {\n return this._getTransformedByInsertion(operation.position, operation.howMany, spread);\n }\n /**\n * Returns a result of transforming a copy of this range by move operation.\n *\n * One or more ranges may be returned as a result of this transformation.\n *\n * @internal\n */\n _getTransformedByMoveOperation(operation, spread = false) {\n const sourcePosition = operation.sourcePosition;\n const howMany = operation.howMany;\n const targetPosition = operation.targetPosition;\n return this._getTransformedByMove(sourcePosition, targetPosition, howMany, spread);\n }\n /**\n * Returns a result of transforming a copy of this range by split operation.\n *\n * Always one range is returned. The transformation is done in a way to not break the range.\n *\n * @internal\n */\n _getTransformedBySplitOperation(operation) {\n const start = this.start._getTransformedBySplitOperation(operation);\n let end = this.end._getTransformedBySplitOperation(operation);\n if (this.end.isEqual(operation.insertionPosition)) {\n end = this.end.getShiftedBy(1);\n }\n // Below may happen when range contains graveyard element used by split operation.\n if (start.root != end.root) {\n // End position was next to the moved graveyard element and was moved with it.\n // Fix it by using old `end` which has proper `root`.\n end = this.end.getShiftedBy(-1);\n }\n return new Range(start, end);\n }\n /**\n * Returns a result of transforming a copy of this range by merge operation.\n *\n * Always one range is returned. The transformation is done in a way to not break the range.\n *\n * @internal\n */\n _getTransformedByMergeOperation(operation) {\n // Special case when the marker is set on \"the closing tag\" of an element. Marker can be set like that during\n // transformations, especially when a content of a few block elements were removed. For example:\n //\n // {} is the transformed range, [] is the removed range.\n // <p>F[o{o</p><p>B}ar</p><p>Xy]z</p>\n //\n // <p>Fo{o</p><p>B}ar</p><p>z</p>\n // <p>F{</p><p>B}ar</p><p>z</p>\n // <p>F{</p>}<p>z</p>\n // <p>F{}z</p>\n //\n if (this.start.isEqual(operation.targetPosition) && this.end.isEqual(operation.deletionPosition)) {\n return new Range(this.start);\n }\n let start = this.start._getTransformedByMergeOperation(operation);\n let end = this.end._getTransformedByMergeOperation(operation);\n if (start.root != end.root) {\n // This happens when the end position was next to the merged (deleted) element.\n // Then, the end position was moved to the graveyard root. In this case we need to fix\n // the range cause its boundaries would be in different roots.\n end = this.end.getShiftedBy(-1);\n }\n if (start.isAfter(end)) {\n // This happens in three following cases:\n //\n // Case 1: Merge operation source position is before the target position (due to some transformations, OT, etc.)\n // This means that start can be moved before the end of the range.\n //\n // Before: <p>a{a</p><p>b}b</p><p>cc</p>\n // Merge: <p>b}b</p><p>cca{a</p>\n // Fix: <p>{b}b</p><p>ccaa</p>\n //\n // Case 2: Range start is before merged node but not directly.\n // Result should include all nodes that were in the original range.\n //\n // Before: <p>aa</p>{<p>cc</p><p>b}b</p>\n // Merge: <p>aab}b</p>{<p>cc</p>\n // Fix: <p>aa{bb</p><p>cc</p>}\n //\n // The range is expanded by an additional `b` letter but it is better than dropping the whole `cc` paragraph.\n //\n // Case 3: Range start is directly before merged node.\n // Resulting range should include only nodes from the merged element:\n //\n // Before: <p>aa</p>{<p>b}b</p><p>cc</p>\n // Merge: <p>aab}b</p>{<p>cc</p>\n // Fix: <p>aa{b}b</p><p>cc</p>\n //\n if (operation.sourcePosition.isBefore(operation.targetPosition)) {\n // Case 1.\n start = Position._createAt(end);\n start.offset = 0;\n }\n else {\n if (!operation.deletionPosition.isEqual(start)) {\n // Case 2.\n end = operation.deletionPosition;\n }\n // In both case 2 and 3 start is at the end of the merge-to element.\n start = operation.targetPosition;\n }\n return new Range(start, end);\n }\n return new Range(start, end);\n }\n /**\n * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this\n * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are\n * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.\n *\n * Examples:\n *\n * ```ts\n * let range = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n * \tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n * );\n * let transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 1 ] ), 2 );\n * // transformed array has one range from [ 4, 7 ] to [ 6, 0, 1 ]\n *\n * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 4, 0, 0 ] ), 4 );\n * // transformed array has one range from [ 2, 7 ] to [ 4, 0, 5 ]\n *\n * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4 );\n * // transformed array has one range, which is equal to original range\n *\n * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4, true );\n * // transformed array has two ranges: from [ 2, 7 ] to [ 3, 2 ] and from [ 3, 6 ] to [ 4, 0, 1 ]\n * ```\n *\n * @internal\n * @param insertPosition Position where nodes are inserted.\n * @param howMany How many nodes are inserted.\n * @param spread Flag indicating whether this range should be spread if insertion\n * was inside the range. Defaults to `false`.\n * @returns Result of the transformation.\n */\n _getTransformedByInsertion(insertPosition, howMany, spread = false) {\n if (spread && this.containsPosition(insertPosition)) {\n // Range has to be spread. The first part is from original start to the spread point.\n // The other part is from spread point to the original end, but transformed by\n // insertion to reflect insertion changes.\n return [\n new Range(this.start, insertPosition),\n new Range(insertPosition.getShiftedBy(howMany), this.end._getTransformedByInsertion(insertPosition, howMany))\n ];\n }\n else {\n const range = new Range(this.start, this.end);\n range.start = range.start._getTransformedByInsertion(insertPosition, howMany);\n range.end = range.end._getTransformedByInsertion(insertPosition, howMany);\n return [range];\n }\n }\n /**\n * Returns an array containing {@link ~Range ranges} that are a result of transforming this\n * {@link ~Range range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.\n *\n * @internal\n * @param sourcePosition Position from which nodes are moved.\n * @param targetPosition Position to where nodes are moved.\n * @param howMany How many nodes are moved.\n * @param spread Whether the range should be spread if the move points inside the range.\n * @returns Result of the transformation.\n */\n _getTransformedByMove(sourcePosition, targetPosition, howMany, spread = false) {\n // Special case for transforming a collapsed range. Just transform it like a position.\n if (this.isCollapsed) {\n const newPos = this.start._getTransformedByMove(sourcePosition, targetPosition, howMany);\n return [new Range(newPos)];\n }\n // Special case for transformation when a part of the range is moved towards the range.\n //\n // Examples:\n //\n // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p></div><p>c[d</p><p>e]f</p>\n // <p>e[f</p><div><p>a]b</p><p>cd</p></div> --> <p>e[f</p><p>a]b</p><div><p>cd</p></div>\n //\n // Without this special condition, the default algorithm leaves an \"artifact\" range from one of `differenceSet` parts:\n //\n // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p>{</div>}<p>c[d</p><p>e]f</p>\n //\n // This special case is applied only if the range is to be kept together (not spread).\n const moveRange = Range._createFromPositionAndShift(sourcePosition, howMany);\n const insertPosition = targetPosition._getTransformedByDeletion(sourcePosition, howMany);\n if (this.containsPosition(targetPosition) && !spread) {\n if (moveRange.containsPosition(this.start) || moveRange.containsPosition(this.end)) {\n const start = this.start._getTransformedByMove(sourcePosition, targetPosition, howMany);\n const end = this.end._getTransformedByMove(sourcePosition, targetPosition, howMany);\n return [new Range(start, end)];\n }\n }\n // Default algorithm.\n let result;\n const differenceSet = this.getDifference(moveRange);\n let difference = null;\n const common = this.getIntersection(moveRange);\n if (differenceSet.length == 1) {\n // `moveRange` and this range may intersect but may be separate.\n difference = new Range(differenceSet[0].start._getTransformedByDeletion(sourcePosition, howMany), differenceSet[0].end._getTransformedByDeletion(sourcePosition, howMany));\n }\n else if (differenceSet.length == 2) {\n // `moveRange` is inside this range.\n difference = new Range(this.start, this.end._getTransformedByDeletion(sourcePosition, howMany));\n } // else, `moveRange` contains this range.\n if (difference) {\n result = difference._getTransformedByInsertion(insertPosition, howMany, common !== null || spread);\n }\n else {\n result = [];\n }\n if (common) {\n const transformedCommon = new Range(common.start._getCombined(moveRange.start, insertPosition), common.end._getCombined(moveRange.start, insertPosition));\n if (result.length == 2) {\n result.splice(1, 0, transformedCommon);\n }\n else {\n result.push(transformedCommon);\n }\n }\n return result;\n }\n /**\n * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.\n *\n * If the deleted range is intersecting with the transformed range, the transformed range will be shrank.\n *\n * If the deleted range contains transformed range, `null` will be returned.\n *\n * @internal\n * @param deletionPosition Position from which nodes are removed.\n * @param howMany How many nodes are removed.\n * @returns Result of the transformation.\n */\n _getTransformedByDeletion(deletePosition, howMany) {\n let newStart = this.start._getTransformedByDeletion(deletePosition, howMany);\n let newEnd = this.end._getTransformedByDeletion(deletePosition, howMany);\n if (newStart == null && newEnd == null) {\n return null;\n }\n if (newStart == null) {\n newStart = deletePosition;\n }\n if (newEnd == null) {\n newEnd = deletePosition;\n }\n return new Range(newStart, newEnd);\n }\n /**\n * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by\n * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.\n *\n * @internal\n * @param position Beginning of the range.\n * @param shift How long the range should be.\n */\n static _createFromPositionAndShift(position, shift) {\n const start = position;\n const end = position.getShiftedBy(shift);\n return shift > 0 ? new this(start, end) : new this(end, start);\n }\n /**\n * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @internal\n * @param element Element which is a parent for the range.\n */\n static _createIn(element) {\n return new this(Position._createAt(element, 0), Position._createAt(element, element.maxOffset));\n }\n /**\n * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.\n *\n * @internal\n */\n static _createOn(item) {\n return this._createFromPositionAndShift(Position._createBefore(item), item.offsetSize);\n }\n /**\n * Combines all ranges from the passed array into a one range. At least one range has to be passed.\n * Passed ranges must not have common parts.\n *\n * The first range from the array is a reference range. If other ranges start or end on the exactly same position where\n * the reference range, they get combined into one range.\n *\n * ```\n * [ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted\n * [ ] // The result of the function if the first range was a reference range.\n * [ ] // The result of the function if the third-to-seventh range was a reference range.\n * [ ] // The result of the function if the last range was a reference range.\n * ```\n *\n * @internal\n * @param ranges Ranges to combine.\n * @returns Combined range.\n */\n static _createFromRanges(ranges) {\n if (ranges.length === 0) {\n /**\n * At least one range has to be passed to\n * {@link module:engine/model/range~Range._createFromRanges `Range._createFromRanges()`}.\n *\n * @error range-create-from-ranges-empty-array\n */\n throw new CKEditorError('range-create-from-ranges-empty-array', null);\n }\n else if (ranges.length == 1) {\n return ranges[0].clone();\n }\n // 1. Set the first range in `ranges` array as a reference range.\n // If we are going to return just a one range, one of the ranges need to be the reference one.\n // Other ranges will be stuck to that range, if possible.\n const ref = ranges[0];\n // 2. Sort all the ranges so it's easier to process them.\n ranges.sort((a, b) => {\n return a.start.isAfter(b.start) ? 1 : -1;\n });\n // 3. Check at which index the reference range is now.\n const refIndex = ranges.indexOf(ref);\n // 4. At this moment we don't need the original range.\n // We are going to modify the result and we need to return a new instance of Range.\n // We have to create a copy of the reference range.\n const result = new this(ref.start, ref.end);\n // 5. Ranges should be checked and glued starting from the range that is closest to the reference range.\n // Since ranges are sorted, start with the range with index that is closest to reference range index.\n if (refIndex > 0) {\n // eslint-disable-next-line no-constant-condition\n for (let i = refIndex - 1; true; i++) {\n if (ranges[i].end.isEqual(result.start)) {\n result.start = Position._createAt(ranges[i].start);\n }\n else {\n // If ranges are not starting/ending at the same position there is no point in looking further.\n break;\n }\n }\n }\n // 6. Ranges should be checked and glued starting from the range that is closest to the reference range.\n // Since ranges are sorted, start with the range with index that is closest to reference range index.\n for (let i = refIndex + 1; i < ranges.length; i++) {\n if (ranges[i].start.isEqual(result.end)) {\n result.end = Position._createAt(ranges[i].end);\n }\n else {\n // If ranges are not starting/ending at the same position there is no point in looking further.\n break;\n }\n }\n return result;\n }\n /**\n * Creates a `Range` instance from given plain object (i.e. parsed JSON string).\n *\n * @param json Plain object to be converted to `Range`.\n * @param doc Document object that will be range owner.\n * @returns `Range` instance created using given plain object.\n */\n static fromJSON(json, doc) {\n return new this(Position.fromJSON(json.start, doc), Position.fromJSON(json.end, doc));\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRange.prototype.is = function (type) {\n return type === 'range' || type === 'model:range';\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/mapper\n */\nimport ModelPosition from '../model/position.js';\nimport ModelRange from '../model/range.js';\nimport ViewPosition from '../view/position.js';\nimport ViewRange from '../view/range.js';\nimport ViewText from '../view/text.js';\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Maps elements, positions and markers between the {@link module:engine/view/document~Document view} and\n * the {@link module:engine/model/model model}.\n *\n * The instance of the Mapper used for the editing pipeline is available in\n * {@link module:engine/controller/editingcontroller~EditingController#mapper `editor.editing.mapper`}.\n *\n * Mapper uses bound elements to find corresponding elements and positions, so, to get proper results,\n * all model elements should be {@link module:engine/conversion/mapper~Mapper#bindElements bound}.\n *\n * To map the complex model to/from view relations, you may provide custom callbacks for the\n * {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition modelToViewPosition event} and\n * {@link module:engine/conversion/mapper~Mapper#event:viewToModelPosition viewToModelPosition event} that are fired whenever\n * a position mapping request occurs.\n * Those events are fired by the {@link module:engine/conversion/mapper~Mapper#toViewPosition toViewPosition}\n * and {@link module:engine/conversion/mapper~Mapper#toModelPosition toModelPosition} methods. `Mapper` adds its own default callbacks\n * with `'lowest'` priority. To override default `Mapper` mapping, add custom callback with higher priority and\n * stop the event.\n */\nexport default class Mapper extends /* #__PURE__ */ EmitterMixin() {\n /**\n * Creates an instance of the mapper.\n */\n constructor() {\n super();\n /**\n * Model element to view element mapping.\n */\n this._modelToViewMapping = new WeakMap();\n /**\n * View element to model element mapping.\n */\n this._viewToModelMapping = new WeakMap();\n /**\n * A map containing callbacks between view element names and functions evaluating length of view elements\n * in model.\n */\n this._viewToModelLengthCallbacks = new Map();\n /**\n * Model marker name to view elements mapping.\n *\n * Keys are `String`s while values are `Set`s with {@link module:engine/view/element~Element view elements}.\n * One marker (name) can be mapped to multiple elements.\n */\n this._markerNameToElements = new Map();\n /**\n * View element to model marker names mapping.\n *\n * This is reverse to {@link ~Mapper#_markerNameToElements} map.\n */\n this._elementToMarkerNames = new Map();\n /**\n * The map of removed view elements with their current root (used for deferred unbinding).\n */\n this._deferredBindingRemovals = new Map();\n /**\n * Stores marker names of markers which have changed due to unbinding a view element (so it is assumed that the view element\n * has been removed, moved or renamed).\n */\n this._unboundMarkerNames = new Set();\n // Default mapper algorithm for mapping model position to view position.\n this.on('modelToViewPosition', (evt, data) => {\n if (data.viewPosition) {\n return;\n }\n const viewContainer = this._modelToViewMapping.get(data.modelPosition.parent);\n if (!viewContainer) {\n /**\n * A model position could not be mapped to the view because the parent of the model position\n * does not have a mapped view element (might have not been converted yet or it has no converter).\n *\n * Make sure that the model element is correctly converted to the view.\n *\n * @error mapping-model-position-view-parent-not-found\n */\n throw new CKEditorError('mapping-model-position-view-parent-not-found', this, { modelPosition: data.modelPosition });\n }\n data.viewPosition = this.findPositionIn(viewContainer, data.modelPosition.offset);\n }, { priority: 'low' });\n // Default mapper algorithm for mapping view position to model position.\n this.on('viewToModelPosition', (evt, data) => {\n if (data.modelPosition) {\n return;\n }\n const viewBlock = this.findMappedViewAncestor(data.viewPosition);\n const modelParent = this._viewToModelMapping.get(viewBlock);\n const modelOffset = this._toModelOffset(data.viewPosition.parent, data.viewPosition.offset, viewBlock);\n data.modelPosition = ModelPosition._createAt(modelParent, modelOffset);\n }, { priority: 'low' });\n }\n /**\n * Marks model and view elements as corresponding. Corresponding elements can be retrieved by using\n * the {@link module:engine/conversion/mapper~Mapper#toModelElement toModelElement} and\n * {@link module:engine/conversion/mapper~Mapper#toViewElement toViewElement} methods.\n * The information that elements are bound is also used to translate positions.\n *\n * @param modelElement Model element.\n * @param viewElement View element.\n */\n bindElements(modelElement, viewElement) {\n this._modelToViewMapping.set(modelElement, viewElement);\n this._viewToModelMapping.set(viewElement, modelElement);\n }\n /**\n * Unbinds the given {@link module:engine/view/element~Element view element} from the map.\n *\n * **Note:** view-to-model binding will be removed, if it existed. However, corresponding model-to-view binding\n * will be removed only if model element is still bound to the passed `viewElement`.\n *\n * This behavior allows for re-binding model element to another view element without fear of losing the new binding\n * when the previously bound view element is unbound.\n *\n * @param viewElement View element to unbind.\n * @param options The options object.\n * @param options.defer Controls whether the binding should be removed immediately or deferred until a\n * {@link #flushDeferredBindings `flushDeferredBindings()`} call.\n */\n unbindViewElement(viewElement, options = {}) {\n const modelElement = this.toModelElement(viewElement);\n if (this._elementToMarkerNames.has(viewElement)) {\n for (const markerName of this._elementToMarkerNames.get(viewElement)) {\n this._unboundMarkerNames.add(markerName);\n }\n }\n if (options.defer) {\n this._deferredBindingRemovals.set(viewElement, viewElement.root);\n }\n else {\n this._viewToModelMapping.delete(viewElement);\n if (this._modelToViewMapping.get(modelElement) == viewElement) {\n this._modelToViewMapping.delete(modelElement);\n }\n }\n }\n /**\n * Unbinds the given {@link module:engine/model/element~Element model element} from the map.\n *\n * **Note:** the model-to-view binding will be removed, if it existed. However, the corresponding view-to-model binding\n * will be removed only if the view element is still bound to the passed `modelElement`.\n *\n * This behavior lets for re-binding view element to another model element without fear of losing the new binding\n * when the previously bound model element is unbound.\n *\n * @param modelElement Model element to unbind.\n */\n unbindModelElement(modelElement) {\n const viewElement = this.toViewElement(modelElement);\n this._modelToViewMapping.delete(modelElement);\n if (this._viewToModelMapping.get(viewElement) == modelElement) {\n this._viewToModelMapping.delete(viewElement);\n }\n }\n /**\n * Binds the given marker name with the given {@link module:engine/view/element~Element view element}. The element\n * will be added to the current set of elements bound with the given marker name.\n *\n * @param element Element to bind.\n * @param name Marker name.\n */\n bindElementToMarker(element, name) {\n const elements = this._markerNameToElements.get(name) || new Set();\n elements.add(element);\n const names = this._elementToMarkerNames.get(element) || new Set();\n names.add(name);\n this._markerNameToElements.set(name, elements);\n this._elementToMarkerNames.set(element, names);\n }\n /**\n * Unbinds an element from given marker name.\n *\n * @param element Element to unbind.\n * @param name Marker name.\n */\n unbindElementFromMarkerName(element, name) {\n const nameToElements = this._markerNameToElements.get(name);\n if (nameToElements) {\n nameToElements.delete(element);\n if (nameToElements.size == 0) {\n this._markerNameToElements.delete(name);\n }\n }\n const elementToNames = this._elementToMarkerNames.get(element);\n if (elementToNames) {\n elementToNames.delete(name);\n if (elementToNames.size == 0) {\n this._elementToMarkerNames.delete(element);\n }\n }\n }\n /**\n * Returns all marker names of markers which have changed due to unbinding a view element (so it is assumed that the view element\n * has been removed, moved or renamed) since the last flush. After returning, the marker names list is cleared.\n */\n flushUnboundMarkerNames() {\n const markerNames = Array.from(this._unboundMarkerNames);\n this._unboundMarkerNames.clear();\n return markerNames;\n }\n /**\n * Unbinds all deferred binding removals of view elements that in the meantime were not re-attached to some root or document fragment.\n *\n * See: {@link #unbindViewElement `unbindViewElement()`}.\n */\n flushDeferredBindings() {\n for (const [viewElement, root] of this._deferredBindingRemovals) {\n // Unbind it only if it wasn't re-attached to some root or document fragment.\n if (viewElement.root == root) {\n this.unbindViewElement(viewElement);\n }\n }\n this._deferredBindingRemovals = new Map();\n }\n /**\n * Removes all model to view and view to model bindings.\n */\n clearBindings() {\n this._modelToViewMapping = new WeakMap();\n this._viewToModelMapping = new WeakMap();\n this._markerNameToElements = new Map();\n this._elementToMarkerNames = new Map();\n this._unboundMarkerNames = new Set();\n this._deferredBindingRemovals = new Map();\n }\n toModelElement(viewElement) {\n return this._viewToModelMapping.get(viewElement);\n }\n toViewElement(modelElement) {\n return this._modelToViewMapping.get(modelElement);\n }\n /**\n * Gets the corresponding model range.\n *\n * @param viewRange View range.\n * @returns Corresponding model range.\n */\n toModelRange(viewRange) {\n return new ModelRange(this.toModelPosition(viewRange.start), this.toModelPosition(viewRange.end));\n }\n /**\n * Gets the corresponding view range.\n *\n * @param modelRange Model range.\n * @returns Corresponding view range.\n */\n toViewRange(modelRange) {\n return new ViewRange(this.toViewPosition(modelRange.start), this.toViewPosition(modelRange.end));\n }\n /**\n * Gets the corresponding model position.\n *\n * @fires viewToModelPosition\n * @param viewPosition View position.\n * @returns Corresponding model position.\n */\n toModelPosition(viewPosition) {\n const data = {\n viewPosition,\n mapper: this\n };\n this.fire('viewToModelPosition', data);\n return data.modelPosition;\n }\n /**\n * Gets the corresponding view position.\n *\n * @fires modelToViewPosition\n * @param modelPosition Model position.\n * @param options Additional options for position mapping process.\n * @param options.isPhantom Should be set to `true` if the model position to map is pointing to a place\n * in model tree which no longer exists. For example, it could be an end of a removed model range.\n * @returns Corresponding view position.\n */\n toViewPosition(modelPosition, options = {}) {\n const data = {\n modelPosition,\n mapper: this,\n isPhantom: options.isPhantom\n };\n this.fire('modelToViewPosition', data);\n return data.viewPosition;\n }\n /**\n * Gets all view elements bound to the given marker name.\n *\n * @param name Marker name.\n * @returns View elements bound with the given marker name or `null`\n * if no elements are bound to the given marker name.\n */\n markerNameToElements(name) {\n const boundElements = this._markerNameToElements.get(name);\n if (!boundElements) {\n return null;\n }\n const elements = new Set();\n for (const element of boundElements) {\n if (element.is('attributeElement')) {\n for (const clone of element.getElementsWithSameId()) {\n elements.add(clone);\n }\n }\n else {\n elements.add(element);\n }\n }\n return elements;\n }\n /**\n * Registers a callback that evaluates the length in the model of a view element with the given name.\n *\n * The callback is fired with one argument, which is a view element instance. The callback is expected to return\n * a number representing the length of the view element in the model.\n *\n * ```ts\n * // List item in view may contain nested list, which have other list items. In model though,\n * // the lists are represented by flat structure. Because of those differences, length of list view element\n * // may be greater than one. In the callback it's checked how many nested list items are in evaluated list item.\n *\n * function getViewListItemLength( element ) {\n * \tlet length = 1;\n *\n * \tfor ( let child of element.getChildren() ) {\n * \t\tif ( child.name == 'ul' || child.name == 'ol' ) {\n * \t\t\tfor ( let item of child.getChildren() ) {\n * \t\t\t\tlength += getViewListItemLength( item );\n * \t\t\t}\n * \t\t}\n * \t}\n *\n * \treturn length;\n * }\n *\n * mapper.registerViewToModelLength( 'li', getViewListItemLength );\n * ```\n *\n * @param viewElementName Name of view element for which callback is registered.\n * @param lengthCallback Function return a length of view element instance in model.\n */\n registerViewToModelLength(viewElementName, lengthCallback) {\n this._viewToModelLengthCallbacks.set(viewElementName, lengthCallback);\n }\n /**\n * For the given `viewPosition`, finds and returns the closest ancestor of this position that has a mapping to\n * the model.\n *\n * @param viewPosition Position for which a mapped ancestor should be found.\n */\n findMappedViewAncestor(viewPosition) {\n let parent = viewPosition.parent;\n while (!this._viewToModelMapping.has(parent)) {\n parent = parent.parent;\n }\n return parent;\n }\n /**\n * Calculates model offset based on the view position and the block element.\n *\n * Example:\n *\n * ```html\n * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, p ) -> 5\n * ```\n *\n * Is a sum of:\n *\n * ```html\n * <p>foo|<b>bar</b></p> // _toModelOffset( p, 3, p ) -> 3\n * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, b ) -> 2\n * ```\n *\n * @param viewParent Position parent.\n * @param viewOffset Position offset.\n * @param viewBlock Block used as a base to calculate offset.\n * @returns Offset in the model.\n */\n _toModelOffset(viewParent, viewOffset, viewBlock) {\n if (viewBlock != viewParent) {\n // See example.\n const offsetToParentStart = this._toModelOffset(viewParent.parent, viewParent.index, viewBlock);\n const offsetInParent = this._toModelOffset(viewParent, viewOffset, viewParent);\n return offsetToParentStart + offsetInParent;\n }\n // viewBlock == viewParent, so we need to calculate the offset in the parent element.\n // If the position is a text it is simple (\"ba|r\" -> 2).\n if (viewParent.is('$text')) {\n return viewOffset;\n }\n // If the position is in an element we need to sum lengths of siblings ( <b> bar </b> foo | -> 3 + 3 = 6 ).\n let modelOffset = 0;\n for (let i = 0; i < viewOffset; i++) {\n modelOffset += this.getModelLength(viewParent.getChild(i));\n }\n return modelOffset;\n }\n /**\n * Gets the length of the view element in the model.\n *\n * The length is calculated as follows:\n * * if a {@link #registerViewToModelLength length mapping callback} is provided for the given `viewNode`, it is used to\n * evaluate the model length (`viewNode` is used as first and only parameter passed to the callback),\n * * length of a {@link module:engine/view/text~Text text node} is equal to the length of its\n * {@link module:engine/view/text~Text#data data},\n * * length of a {@link module:engine/view/uielement~UIElement ui element} is equal to 0,\n * * length of a mapped {@link module:engine/view/element~Element element} is equal to 1,\n * * length of a non-mapped {@link module:engine/view/element~Element element} is equal to the length of its children.\n *\n * Examples:\n *\n * ```\n * foo -> 3 // Text length is equal to its data length.\n * <p>foo</p> -> 1 // Length of an element which is mapped is by default equal to 1.\n * <b>foo</b> -> 3 // Length of an element which is not mapped is a length of its children.\n * <div><p>x</p><p>y</p></div> -> 2 // Assuming that <div> is not mapped and <p> are mapped.\n * ```\n *\n * @param viewNode View node.\n * @returns Length of the node in the tree model.\n */\n getModelLength(viewNode) {\n if (this._viewToModelLengthCallbacks.get(viewNode.name)) {\n const callback = this._viewToModelLengthCallbacks.get(viewNode.name);\n return callback(viewNode);\n }\n else if (this._viewToModelMapping.has(viewNode)) {\n return 1;\n }\n else if (viewNode.is('$text')) {\n return viewNode.data.length;\n }\n else if (viewNode.is('uiElement')) {\n return 0;\n }\n else {\n let len = 0;\n for (const child of viewNode.getChildren()) {\n len += this.getModelLength(child);\n }\n return len;\n }\n }\n /**\n * Finds the position in the view node (or in its children) with the expected model offset.\n *\n * Example:\n *\n * ```\n * <p>fo<b>bar</b>bom</p> -> expected offset: 4\n *\n * findPositionIn( p, 4 ):\n * <p>|fo<b>bar</b>bom</p> -> expected offset: 4, actual offset: 0\n * <p>fo|<b>bar</b>bom</p> -> expected offset: 4, actual offset: 2\n * <p>fo<b>bar</b>|bom</p> -> expected offset: 4, actual offset: 5 -> we are too far\n *\n * findPositionIn( b, 4 - ( 5 - 3 ) ):\n * <p>fo<b>|bar</b>bom</p> -> expected offset: 2, actual offset: 0\n * <p>fo<b>bar|</b>bom</p> -> expected offset: 2, actual offset: 3 -> we are too far\n *\n * findPositionIn( bar, 2 - ( 3 - 3 ) ):\n * We are in the text node so we can simple find the offset.\n * <p>fo<b>ba|r</b>bom</p> -> expected offset: 2, actual offset: 2 -> position found\n * ```\n *\n * @param viewParent Tree view element in which we are looking for the position.\n * @param expectedOffset Expected offset.\n * @returns Found position.\n */\n findPositionIn(viewParent, expectedOffset) {\n // Last scanned view node.\n let viewNode;\n // Length of the last scanned view node.\n let lastLength = 0;\n let modelOffset = 0;\n let viewOffset = 0;\n // In the text node it is simple: the offset in the model equals the offset in the text.\n if (viewParent.is('$text')) {\n return new ViewPosition(viewParent, expectedOffset);\n }\n // In other cases we add lengths of child nodes to find the proper offset.\n // If it is smaller we add the length.\n while (modelOffset < expectedOffset) {\n viewNode = viewParent.getChild(viewOffset);\n lastLength = this.getModelLength(viewNode);\n modelOffset += lastLength;\n viewOffset++;\n }\n // If it equals we found the position.\n if (modelOffset == expectedOffset) {\n return this._moveViewPositionToTextNode(new ViewPosition(viewParent, viewOffset));\n }\n // If it is higher we need to enter last child.\n else {\n // ( modelOffset - lastLength ) is the offset to the child we enter,\n // so we subtract it from the expected offset to fine the offset in the child.\n return this.findPositionIn(viewNode, expectedOffset - (modelOffset - lastLength));\n }\n }\n /**\n * Because we prefer positions in the text nodes over positions next to text nodes, if the view position was next to a text node,\n * it moves it into the text node instead.\n *\n * ```\n * <p>[]<b>foo</b></p> -> <p>[]<b>foo</b></p> // do not touch if position is not directly next to text\n * <p>foo[]<b>foo</b></p> -> <p>foo{}<b>foo</b></p> // move to text node\n * <p><b>[]foo</b></p> -> <p><b>{}foo</b></p> // move to text node\n * ```\n *\n * @param viewPosition Position potentially next to the text node.\n * @returns Position in the text node if possible.\n */\n _moveViewPositionToTextNode(viewPosition) {\n // If the position is just after a text node, put it at the end of that text node.\n // If the position is just before a text node, put it at the beginning of that text node.\n const nodeBefore = viewPosition.nodeBefore;\n const nodeAfter = viewPosition.nodeAfter;\n if (nodeBefore instanceof ViewText) {\n return new ViewPosition(nodeBefore, nodeBefore.data.length);\n }\n else if (nodeAfter instanceof ViewText) {\n return new ViewPosition(nodeAfter, 0);\n }\n // Otherwise, just return the given position.\n return viewPosition;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/modelconsumable\n */\nimport TextProxy from '../model/textproxy.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Manages a list of consumable values for the {@link module:engine/model/item~Item model items}.\n *\n * Consumables are various aspects of the model. A model item can be broken down into separate, single properties that might be\n * taken into consideration when converting that item.\n *\n * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing the changed\n * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down\n * into singular properties (the item itself and its attributes). All those parts are saved in `ModelConsumable`. Then,\n * during conversion, when the given part of a model item is converted (i.e. the view element has been inserted into the view,\n * but without attributes), the consumable value is removed from `ModelConsumable`.\n *\n * For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattribute:<attributeKey>`,\n * `changeattributes:<attributeKey>`, `removeattributes:<attributeKey>`.\n *\n * In most cases, it is enough to let th {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}\n * gather consumable values, so there is no need to use\n * the {@link module:engine/conversion/modelconsumable~ModelConsumable#add add method} directly.\n * However, it is important to understand how consumable values can be\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.\n * See {@link module:engine/conversion/downcasthelpers default downcast converters} for more information.\n *\n * Keep in mind that one conversion event may have multiple callbacks (converters) attached to it. Each of those is\n * able to convert one or more parts of the model. However, when one of those callbacks actually converts\n * something, the others should not, because they would duplicate the results. Using `ModelConsumable` helps to avoid\n * this situation, because callbacks should only convert these values that were not yet consumed from `ModelConsumable`.\n *\n * Consuming multiple values in a single callback:\n *\n * ```ts\n * // Converter for custom `imageBlock` element that might have a `caption` element inside which changes\n * // how the image is displayed in the view:\n * //\n * // Model:\n * //\n * // [imageBlock]\n * // └─ [caption]\n * // └─ foo\n * //\n * // View:\n * //\n * // <figure>\n * // ├─ <img />\n * // └─ <caption>\n * // └─ foo\n * modelConversionDispatcher.on( 'insert:imageBlock', ( evt, data, conversionApi ) => {\n * \t// First, consume the `imageBlock` element.\n * \tconversionApi.consumable.consume( data.item, 'insert' );\n *\n * \t// Just create normal image element for the view.\n * \t// Maybe it will be \"decorated\" later.\n * \tconst viewImage = new ViewElement( 'img' );\n * \tconst insertPosition = conversionApi.mapper.toViewPosition( data.range.start );\n * \tconst viewWriter = conversionApi.writer;\n *\n * \t// Check if the `imageBlock` element has children.\n * \tif ( data.item.childCount > 0 ) {\n * \t\tconst modelCaption = data.item.getChild( 0 );\n *\n * \t\t// `modelCaption` insertion change is consumed from consumable values.\n * \t\t// It will not be converted by other converters, but it's children (probably some text) will be.\n * \t\t// Through mapping, converters for text will know where to insert contents of `modelCaption`.\n * \t\tif ( conversionApi.consumable.consume( modelCaption, 'insert' ) ) {\n * \t\t\tconst viewCaption = new ViewElement( 'figcaption' );\n *\n * \t\t\tconst viewImageHolder = new ViewElement( 'figure', null, [ viewImage, viewCaption ] );\n *\n * \t\t\tconversionApi.mapper.bindElements( modelCaption, viewCaption );\n * \t\t\tconversionApi.mapper.bindElements( data.item, viewImageHolder );\n * \t\t\tviewWriter.insert( insertPosition, viewImageHolder );\n * \t\t}\n * \t} else {\n * \t\tconversionApi.mapper.bindElements( data.item, viewImage );\n * \t\tviewWriter.insert( insertPosition, viewImage );\n * \t}\n *\n * \tevt.stop();\n * } );\n * ```\n */\nexport default class ModelConsumable {\n constructor() {\n /**\n * Contains list of consumable values.\n */\n this._consumable = new Map();\n /**\n * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds a parent\n * of that `TextProxy` and the start and end indices of that `TextProxy`. This allows identification of the `TextProxy`\n * instances that point to the same part of the model but are different instances. Each distinct `TextProxy`\n * is given a unique `Symbol` which is then registered as consumable. This process is transparent for the `ModelConsumable`\n * API user because whenever `TextProxy` is added, tested, consumed or reverted, the internal mechanisms of\n * `ModelConsumable` translate `TextProxy` to that unique `Symbol`.\n */\n this._textProxyRegistry = new Map();\n }\n /**\n * Adds a consumable value to the consumables list and links it with a given model item.\n *\n * ```ts\n * modelConsumable.add( modelElement, 'insert' ); // Add `modelElement` insertion change to consumable values.\n * modelConsumable.add( modelElement, 'addAttribute:bold' ); // Add `bold` attribute insertion on `modelElement` change.\n * modelConsumable.add( modelElement, 'removeAttribute:bold' ); // Add `bold` attribute removal on `modelElement` change.\n * modelConsumable.add( modelSelection, 'selection' ); // Add `modelSelection` to consumable values.\n * modelConsumable.add( modelRange, 'range' ); // Add `modelRange` to consumable values.\n * ```\n *\n * @param item Model item, range or selection that has the consumable.\n * @param type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.\n * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n */\n add(item, type) {\n type = _normalizeConsumableType(type);\n if (item instanceof TextProxy) {\n item = this._getSymbolForTextProxy(item);\n }\n if (!this._consumable.has(item)) {\n this._consumable.set(item, new Map());\n }\n this._consumable.get(item).set(type, true);\n }\n /**\n * Removes a given consumable value from a given model item.\n *\n * ```ts\n * modelConsumable.consume( modelElement, 'insert' ); // Remove `modelElement` insertion change from consumable values.\n * modelConsumable.consume( modelElement, 'addAttribute:bold' ); // Remove `bold` attribute insertion on `modelElement` change.\n * modelConsumable.consume( modelElement, 'removeAttribute:bold' ); // Remove `bold` attribute removal on `modelElement` change.\n * modelConsumable.consume( modelSelection, 'selection' ); // Remove `modelSelection` from consumable values.\n * modelConsumable.consume( modelRange, 'range' ); // Remove 'modelRange' from consumable values.\n * ```\n *\n * @param item Model item, range or selection from which consumable will be consumed.\n * @param type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.\n * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n * @returns `true` if consumable value was available and was consumed, `false` otherwise.\n */\n consume(item, type) {\n type = _normalizeConsumableType(type);\n if (item instanceof TextProxy) {\n item = this._getSymbolForTextProxy(item);\n }\n if (this.test(item, type)) {\n this._consumable.get(item).set(type, false);\n return true;\n }\n else {\n return false;\n }\n }\n /**\n * Tests whether there is a consumable value of a given type connected with a given model item.\n *\n * ```ts\n * modelConsumable.test( modelElement, 'insert' ); // Check for `modelElement` insertion change.\n * modelConsumable.test( modelElement, 'addAttribute:bold' ); // Check for `bold` attribute insertion on `modelElement` change.\n * modelConsumable.test( modelElement, 'removeAttribute:bold' ); // Check for `bold` attribute removal on `modelElement` change.\n * modelConsumable.test( modelSelection, 'selection' ); // Check if `modelSelection` is consumable.\n * modelConsumable.test( modelRange, 'range' ); // Check if `modelRange` is consumable.\n * ```\n *\n * @param item Model item, range or selection to be tested.\n * @param type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.\n * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n * @returns `null` if such consumable was never added, `false` if the consumable values was\n * already consumed or `true` if it was added and not consumed yet.\n */\n test(item, type) {\n type = _normalizeConsumableType(type);\n if (item instanceof TextProxy) {\n item = this._getSymbolForTextProxy(item);\n }\n const itemConsumables = this._consumable.get(item);\n if (itemConsumables === undefined) {\n return null;\n }\n const value = itemConsumables.get(type);\n if (value === undefined) {\n return null;\n }\n return value;\n }\n /**\n * Reverts consuming of a consumable value.\n *\n * ```ts\n * modelConsumable.revert( modelElement, 'insert' ); // Revert consuming `modelElement` insertion change.\n * modelConsumable.revert( modelElement, 'addAttribute:bold' ); // Revert consuming `bold` attribute insert from `modelElement`.\n * modelConsumable.revert( modelElement, 'removeAttribute:bold' ); // Revert consuming `bold` attribute remove from `modelElement`.\n * modelConsumable.revert( modelSelection, 'selection' ); // Revert consuming `modelSelection`.\n * modelConsumable.revert( modelRange, 'range' ); // Revert consuming `modelRange`.\n * ```\n *\n * @param item Model item, range or selection to be reverted.\n * @param type Consumable type.\n * @returns `true` if consumable has been reversed, `false` otherwise. `null` if the consumable has\n * never been added.\n */\n revert(item, type) {\n type = _normalizeConsumableType(type);\n if (item instanceof TextProxy) {\n item = this._getSymbolForTextProxy(item);\n }\n const test = this.test(item, type);\n if (test === false) {\n this._consumable.get(item).set(type, true);\n return true;\n }\n else if (test === true) {\n return false;\n }\n return null;\n }\n /**\n * Verifies if all events from the specified group were consumed.\n *\n * @param eventGroup The events group to verify.\n */\n verifyAllConsumed(eventGroup) {\n const items = [];\n for (const [item, consumables] of this._consumable) {\n for (const [event, canConsume] of consumables) {\n const eventPrefix = event.split(':')[0];\n if (canConsume && eventGroup == eventPrefix) {\n items.push({\n event,\n item: item.name || item.description\n });\n }\n }\n }\n if (items.length) {\n /**\n * Some of the {@link module:engine/model/item~Item model items} were not consumed while downcasting the model to view.\n *\n * This might be the effect of:\n *\n * * A missing converter for some model elements. Make sure that you registered downcast converters for all model elements.\n * * A custom converter that does not consume converted items. Make sure that you\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} all model elements that you converted\n * from the model to the view.\n * * A custom converter that called `event.stop()`. When providing a custom converter, keep in mind that you should not stop\n * the event. If you stop it then the default converter at the `lowest` priority will not trigger the conversion of this node's\n * attributes and child nodes.\n *\n * @error conversion-model-consumable-not-consumed\n * @param {Array.<module:engine/model/item~Item>} items Items that were not consumed.\n */\n throw new CKEditorError('conversion-model-consumable-not-consumed', null, { items });\n }\n }\n /**\n * Gets a unique symbol for the passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that\n * have same parent, same start index and same end index will get the same symbol.\n *\n * Used internally to correctly consume `TextProxy` instances.\n *\n * @internal\n * @param textProxy `TextProxy` instance to get a symbol for.\n * @returns Symbol representing all equal instances of `TextProxy`.\n */\n _getSymbolForTextProxy(textProxy) {\n let symbol = null;\n const startMap = this._textProxyRegistry.get(textProxy.startOffset);\n if (startMap) {\n const endMap = startMap.get(textProxy.endOffset);\n if (endMap) {\n symbol = endMap.get(textProxy.parent);\n }\n }\n if (!symbol) {\n symbol = this._addSymbolForTextProxy(textProxy);\n }\n return symbol;\n }\n /**\n * Adds a symbol for the given {@link module:engine/model/textproxy~TextProxy} instance.\n *\n * Used internally to correctly consume `TextProxy` instances.\n *\n * @param textProxy Text proxy instance.\n * @returns Symbol generated for given `TextProxy`.\n */\n _addSymbolForTextProxy(textProxy) {\n const start = textProxy.startOffset;\n const end = textProxy.endOffset;\n const parent = textProxy.parent;\n const symbol = Symbol('$textProxy:' + textProxy.data);\n let startMap;\n let endMap;\n startMap = this._textProxyRegistry.get(start);\n if (!startMap) {\n startMap = new Map();\n this._textProxyRegistry.set(start, startMap);\n }\n endMap = startMap.get(end);\n if (!endMap) {\n endMap = new Map();\n startMap.set(end, endMap);\n }\n endMap.set(parent, symbol);\n return symbol;\n }\n}\n/**\n * Returns a normalized consumable type name from the given string. A normalized consumable type name is a string that has\n * at most one colon, for example: `insert` or `addMarker:highlight`. If a string to normalize has more \"parts\" (more colons),\n * the further parts are dropped, for example: `addattribute:bold:$text` -> `addattributes:bold`.\n *\n * @param type Consumable type.\n * @returns Normalized consumable type.\n */\nfunction _normalizeConsumableType(type) {\n const parts = type.split(':');\n // For inserts allow passing event name, it's stored in the context of a specified element so the element name is not needed.\n if (parts[0] == 'insert') {\n return parts[0];\n }\n // Markers are identified by the whole name (otherwise we would consume the whole markers group).\n if (parts[0] == 'addMarker' || parts[0] == 'removeMarker') {\n return type;\n }\n return parts.length > 1 ? parts[0] + ':' + parts[1] : parts[0];\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/downcastdispatcher\n */\nimport Consumable from './modelconsumable.js';\nimport Range from '../model/range.js';\nimport { EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The downcast dispatcher is a central point of downcasting (conversion from the model to the view), which is a process of reacting\n * to changes in the model and firing a set of events. The callbacks listening to these events are called converters. The\n * converters' role is to convert the model changes to changes in view (for example, adding view nodes or\n * changing attributes on view elements).\n *\n * During the conversion process, downcast dispatcher fires events basing on the state of the model and prepares\n * data for these events. It is important to understand that the events are connected with the changes done on the model,\n * for example: \"a node has been inserted\" or \"an attribute has changed\". This is in contrary to upcasting (a view-to-model conversion)\n * where you convert the view state (view nodes) to a model tree.\n *\n * The events are prepared basing on a diff created by the {@link module:engine/model/differ~Differ Differ}, which buffers them\n * and then passes to the downcast dispatcher as a diff between the old model state and the new model state.\n *\n * Note that because the changes are converted, there is a need to have a mapping between the model structure and the view structure.\n * To map positions and elements during the downcast (a model-to-view conversion), use {@link module:engine/conversion/mapper~Mapper}.\n *\n * Downcast dispatcher fires the following events for model tree changes:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`} –\n * If a range of nodes was inserted to the model tree.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove `remove`} –\n * If a range of nodes was removed from the model tree.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`} –\n * If an attribute was added, changed or removed from a model node.\n *\n * For {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`}\n * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`},\n * the downcast dispatcher generates {@link module:engine/conversion/modelconsumable~ModelConsumable consumables}.\n * These are used to have control over which changes have already been consumed. It is useful when some converters\n * overwrite others or convert multiple changes (for example, it converts an insertion of an element and also converts that\n * element's attributes during the insertion).\n *\n * Additionally, downcast dispatcher fires events for {@link module:engine/model/markercollection~Marker marker} changes:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker `addMarker`} – If a marker was added.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker `removeMarker`} – If a marker was\n * removed.\n *\n * Note that changing a marker is done through removing the marker from the old range and adding it to the new range,\n * so both of these events are fired.\n *\n * Finally, a downcast dispatcher also handles firing events for the {@link module:engine/model/selection model selection}\n * conversion:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:selection `selection`}\n * – Converts the selection from the model to the view.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`}\n * – Fired for every selection attribute.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker `addMarker`}\n * – Fired for every marker that contains a selection.\n *\n * Unlike the model tree and the markers, the events for selection are not fired for changes but for a selection state.\n *\n * When providing custom listeners for a downcast dispatcher, remember to check whether a given change has not been\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} yet.\n *\n * When providing custom listeners for a downcast dispatcher, keep in mind that you **should not** stop the event. If you stop it,\n * then the default converter at the `lowest` priority will not trigger the conversion of this node's attributes and child nodes.\n *\n * When providing custom listeners for a downcast dispatcher, remember to use the provided\n * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} to apply changes to the view document.\n *\n * You can read more about conversion in the following guide:\n *\n * * {@glink framework/deep-dive/conversion/downcast Downcast conversion}\n *\n * An example of a custom converter for the downcast dispatcher:\n *\n * ```ts\n * // You will convert inserting a \"paragraph\" model element into the model.\n * downcastDispatcher.on( 'insert:paragraph', ( evt, data, conversionApi ) => {\n * \t// Remember to check whether the change has not been consumed yet and consume it.\n * \tif ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {\n * \t\treturn;\n * \t}\n *\n * \t// Translate the position in the model to a position in the view.\n * \tconst viewPosition = conversionApi.mapper.toViewPosition( data.range.start );\n *\n * \t// Create a <p> element that will be inserted into the view at the `viewPosition`.\n * \tconst viewElement = conversionApi.writer.createContainerElement( 'p' );\n *\n * \t// Bind the newly created view element to the model element so positions will map accordingly in the future.\n * \tconversionApi.mapper.bindElements( data.item, viewElement );\n *\n * \t// Add the newly created view element to the view.\n * \tconversionApi.writer.insert( viewPosition, viewElement );\n * } );\n * ```\n */\nexport default class DowncastDispatcher extends /* #__PURE__ */ EmitterMixin() {\n /**\n * Creates a downcast dispatcher instance.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastConversionApi\n *\n * @param conversionApi Additional properties for an interface that will be passed to events fired\n * by the downcast dispatcher.\n */\n constructor(conversionApi) {\n super();\n this._conversionApi = { dispatcher: this, ...conversionApi };\n this._firedEventsMap = new WeakMap();\n }\n /**\n * Converts changes buffered in the given {@link module:engine/model/differ~Differ model differ}\n * and fires conversion events based on it.\n *\n * @fires insert\n * @fires remove\n * @fires attribute\n * @fires addMarker\n * @fires removeMarker\n * @fires reduceChanges\n * @param differ The differ object with buffered changes.\n * @param markers Markers related to the model fragment to convert.\n * @param writer The view writer that should be used to modify the view document.\n */\n convertChanges(differ, markers, writer) {\n const conversionApi = this._createConversionApi(writer, differ.getRefreshedItems());\n // Before the view is updated, remove markers which have changed.\n for (const change of differ.getMarkersToRemove()) {\n this._convertMarkerRemove(change.name, change.range, conversionApi);\n }\n // Let features modify the change list (for example to allow reconversion).\n const changes = this._reduceChanges(differ.getChanges());\n // Convert changes that happened on model tree.\n for (const entry of changes) {\n if (entry.type === 'insert') {\n this._convertInsert(Range._createFromPositionAndShift(entry.position, entry.length), conversionApi);\n }\n else if (entry.type === 'reinsert') {\n this._convertReinsert(Range._createFromPositionAndShift(entry.position, entry.length), conversionApi);\n }\n else if (entry.type === 'remove') {\n this._convertRemove(entry.position, entry.length, entry.name, conversionApi);\n }\n else {\n // Defaults to 'attribute' change.\n this._convertAttribute(entry.range, entry.attributeKey, entry.attributeOldValue, entry.attributeNewValue, conversionApi);\n }\n }\n // Remove mappings for all removed view elements.\n // Remove these mappings as soon as they are not needed (https://github.com/ckeditor/ckeditor5/issues/15411).\n conversionApi.mapper.flushDeferredBindings();\n for (const markerName of conversionApi.mapper.flushUnboundMarkerNames()) {\n const markerRange = markers.get(markerName).getRange();\n this._convertMarkerRemove(markerName, markerRange, conversionApi);\n this._convertMarkerAdd(markerName, markerRange, conversionApi);\n }\n // After the view is updated, convert markers which have changed.\n for (const change of differ.getMarkersToAdd()) {\n this._convertMarkerAdd(change.name, change.range, conversionApi);\n }\n // Verify if all insert consumables were consumed.\n conversionApi.consumable.verifyAllConsumed('insert');\n }\n /**\n * Starts a conversion of a model range and the provided markers.\n *\n * @fires insert\n * @fires attribute\n * @fires addMarker\n * @param range The inserted range.\n * @param markers The map of markers that should be down-casted.\n * @param writer The view writer that should be used to modify the view document.\n * @param options Optional options object passed to `convertionApi.options`.\n */\n convert(range, markers, writer, options = {}) {\n const conversionApi = this._createConversionApi(writer, undefined, options);\n this._convertInsert(range, conversionApi);\n for (const [name, range] of markers) {\n this._convertMarkerAdd(name, range, conversionApi);\n }\n // Verify if all insert consumables were consumed.\n conversionApi.consumable.verifyAllConsumed('insert');\n }\n /**\n * Starts the model selection conversion.\n *\n * Fires events for a given {@link module:engine/model/selection~Selection selection} to start the selection conversion.\n *\n * @fires selection\n * @fires addMarker\n * @fires attribute\n * @param selection The selection to convert.\n * @param markers Markers connected with the converted model.\n * @param writer View writer that should be used to modify the view document.\n */\n convertSelection(selection, markers, writer) {\n const conversionApi = this._createConversionApi(writer);\n // First perform a clean-up at the current position of the selection.\n this.fire('cleanSelection', { selection }, conversionApi);\n // Don't convert selection if it is in a model root that does not have a view root (for now this is only the graveyard root).\n const modelRoot = selection.getFirstPosition().root;\n if (!conversionApi.mapper.toViewElement(modelRoot)) {\n return;\n }\n // Now, perform actual selection conversion.\n const markersAtSelection = Array.from(markers.getMarkersAtPosition(selection.getFirstPosition()));\n this._addConsumablesForSelection(conversionApi.consumable, selection, markersAtSelection);\n this.fire('selection', { selection }, conversionApi);\n if (!selection.isCollapsed) {\n return;\n }\n for (const marker of markersAtSelection) {\n // Do not fire event if the marker has been consumed.\n if (conversionApi.consumable.test(selection, 'addMarker:' + marker.name)) {\n const markerRange = marker.getRange();\n if (!shouldMarkerChangeBeConverted(selection.getFirstPosition(), marker, conversionApi.mapper)) {\n continue;\n }\n const data = {\n item: selection,\n markerName: marker.name,\n markerRange\n };\n this.fire(`addMarker:${marker.name}`, data, conversionApi);\n }\n }\n for (const key of selection.getAttributeKeys()) {\n // Do not fire event if the attribute has been consumed.\n if (conversionApi.consumable.test(selection, 'attribute:' + key)) {\n const data = {\n item: selection,\n range: selection.getFirstRange(),\n attributeKey: key,\n attributeOldValue: null,\n attributeNewValue: selection.getAttribute(key)\n };\n this.fire(`attribute:${key}:$text`, data, conversionApi);\n }\n }\n }\n /**\n * Fires insertion conversion of a range of nodes.\n *\n * For each node in the range, {@link #event:insert `insert` event is fired}. For each attribute on each node,\n * {@link #event:attribute `attribute` event is fired}.\n *\n * @fires insert\n * @fires attribute\n * @param range The inserted range.\n * @param conversionApi The conversion API object.\n * @param options.doNotAddConsumables Whether the ModelConsumable should not get populated\n * for items in the provided range.\n */\n _convertInsert(range, conversionApi, options = {}) {\n if (!options.doNotAddConsumables) {\n // Collect a list of things that can be consumed, consisting of nodes and their attributes.\n this._addConsumablesForInsert(conversionApi.consumable, range);\n }\n // Fire a separate insert event for each node and text fragment contained in the range.\n for (const data of Array.from(range.getWalker({ shallow: true })).map(walkerValueToEventData)) {\n this._testAndFire('insert', data, conversionApi);\n }\n }\n /**\n * Fires conversion of a single node removal. Fires {@link #event:remove remove event} with provided data.\n *\n * @param position Position from which node was removed.\n * @param length Offset size of removed node.\n * @param name Name of removed node.\n * @param conversionApi The conversion API object.\n */\n _convertRemove(position, length, name, conversionApi) {\n this.fire(`remove:${name}`, { position, length }, conversionApi);\n }\n /**\n * Starts a conversion of an attribute change on a given `range`.\n *\n * For each node in the given `range`, {@link #event:attribute attribute event} is fired with the passed data.\n *\n * @fires attribute\n * @param range Changed range.\n * @param key Key of the attribute that has changed.\n * @param oldValue Attribute value before the change or `null` if the attribute has not been set before.\n * @param newValue New attribute value or `null` if the attribute has been removed.\n * @param conversionApi The conversion API object.\n */\n _convertAttribute(range, key, oldValue, newValue, conversionApi) {\n // Create a list with attributes to consume.\n this._addConsumablesForRange(conversionApi.consumable, range, `attribute:${key}`);\n // Create a separate attribute event for each node in the range.\n for (const value of range) {\n const data = {\n item: value.item,\n range: Range._createFromPositionAndShift(value.previousPosition, value.length),\n attributeKey: key,\n attributeOldValue: oldValue,\n attributeNewValue: newValue\n };\n this._testAndFire(`attribute:${key}`, data, conversionApi);\n }\n }\n /**\n * Fires re-insertion conversion (with a `reconversion` flag passed to `insert` events)\n * of a range of elements (only elements on the range depth, without children).\n *\n * For each node in the range on its depth (without children), {@link #event:insert `insert` event} is fired.\n * For each attribute on each node, {@link #event:attribute `attribute` event} is fired.\n *\n * @fires insert\n * @fires attribute\n * @param range The range to reinsert.\n * @param conversionApi The conversion API object.\n */\n _convertReinsert(range, conversionApi) {\n // Convert the elements - without converting children.\n const walkerValues = Array.from(range.getWalker({ shallow: true }));\n // Collect a list of things that can be consumed, consisting of nodes and their attributes.\n this._addConsumablesForInsert(conversionApi.consumable, walkerValues);\n // Fire a separate insert event for each node and text fragment contained shallowly in the range.\n for (const data of walkerValues.map(walkerValueToEventData)) {\n this._testAndFire('insert', { ...data, reconversion: true }, conversionApi);\n }\n }\n /**\n * Converts the added marker. Fires the {@link #event:addMarker `addMarker`} event for each item\n * in the marker's range. If the range is collapsed, a single event is dispatched. See the event description for more details.\n *\n * @fires addMarker\n * @param markerName Marker name.\n * @param markerRange The marker range.\n * @param conversionApi The conversion API object.\n */\n _convertMarkerAdd(markerName, markerRange, conversionApi) {\n // Do not convert if range is in graveyard.\n if (markerRange.root.rootName == '$graveyard') {\n return;\n }\n // In markers' case, event name == consumable name.\n const eventName = `addMarker:${markerName}`;\n //\n // First, fire an event for the whole marker.\n //\n conversionApi.consumable.add(markerRange, eventName);\n this.fire(eventName, { markerName, markerRange }, conversionApi);\n //\n // Do not fire events for each item inside the range if the range got consumed.\n // Also consume the whole marker consumable if it wasn't consumed.\n //\n if (!conversionApi.consumable.consume(markerRange, eventName)) {\n return;\n }\n //\n // Then, fire an event for each item inside the marker range.\n //\n this._addConsumablesForRange(conversionApi.consumable, markerRange, eventName);\n for (const item of markerRange.getItems()) {\n // Do not fire event for already consumed items.\n if (!conversionApi.consumable.test(item, eventName)) {\n continue;\n }\n const data = { item, range: Range._createOn(item), markerName, markerRange };\n this.fire(eventName, data, conversionApi);\n }\n }\n /**\n * Fires the conversion of the marker removal. Fires the {@link #event:removeMarker `removeMarker`} event with the provided data.\n *\n * @fires removeMarker\n * @param markerName Marker name.\n * @param markerRange The marker range.\n * @param conversionApi The conversion API object.\n */\n _convertMarkerRemove(markerName, markerRange, conversionApi) {\n // Do not convert if range is in graveyard.\n if (markerRange.root.rootName == '$graveyard') {\n return;\n }\n this.fire(`removeMarker:${markerName}`, { markerName, markerRange }, conversionApi);\n }\n /**\n * Fires the reduction of changes buffered in the {@link module:engine/model/differ~Differ `Differ`}.\n *\n * Features can replace selected {@link module:engine/model/differ~DiffItem `DiffItem`}s with `reinsert` entries to trigger\n * reconversion. The {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure\n * `DowncastHelpers.elementToStructure()`} is using this event to trigger reconversion.\n *\n * @fires reduceChanges\n */\n _reduceChanges(changes) {\n const data = { changes };\n this.fire('reduceChanges', data);\n return data.changes;\n }\n /**\n * Populates provided {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume from a given range,\n * assuming that the range has just been inserted to the model.\n *\n * @param consumable The consumable.\n * @param walkerValues The walker values for the inserted range.\n * @returns The values to consume.\n */\n _addConsumablesForInsert(consumable, walkerValues) {\n for (const value of walkerValues) {\n const item = value.item;\n // Add consumable if it wasn't there yet.\n if (consumable.test(item, 'insert') === null) {\n consumable.add(item, 'insert');\n for (const key of item.getAttributeKeys()) {\n consumable.add(item, 'attribute:' + key);\n }\n }\n }\n return consumable;\n }\n /**\n * Populates provided {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume for a given range.\n *\n * @param consumable The consumable.\n * @param range The affected range.\n * @param type Consumable type.\n * @returns The values to consume.\n */\n _addConsumablesForRange(consumable, range, type) {\n for (const item of range.getItems()) {\n consumable.add(item, type);\n }\n return consumable;\n }\n /**\n * Populates provided {@link module:engine/conversion/modelconsumable~ModelConsumable} with selection consumable values.\n *\n * @param consumable The consumable.\n * @param selection The selection to create the consumable from.\n * @param markers Markers that contain the selection.\n * @returns The values to consume.\n */\n _addConsumablesForSelection(consumable, selection, markers) {\n consumable.add(selection, 'selection');\n for (const marker of markers) {\n consumable.add(selection, 'addMarker:' + marker.name);\n }\n for (const key of selection.getAttributeKeys()) {\n consumable.add(selection, 'attribute:' + key);\n }\n return consumable;\n }\n /**\n * Tests whether given event wasn't already fired and if so, fires it.\n *\n * @fires insert\n * @fires attribute\n * @param type Event type.\n * @param data Event data.\n * @param conversionApi The conversion API object.\n */\n _testAndFire(type, data, conversionApi) {\n const eventName = getEventName(type, data);\n const itemKey = data.item.is('$textProxy') ? conversionApi.consumable._getSymbolForTextProxy(data.item) : data.item;\n const eventsFiredForConversion = this._firedEventsMap.get(conversionApi);\n const eventsFiredForItem = eventsFiredForConversion.get(itemKey);\n if (!eventsFiredForItem) {\n eventsFiredForConversion.set(itemKey, new Set([eventName]));\n }\n else if (!eventsFiredForItem.has(eventName)) {\n eventsFiredForItem.add(eventName);\n }\n else {\n return;\n }\n this.fire(eventName, data, conversionApi);\n }\n /**\n * Fires not already fired events for setting attributes on just inserted item.\n *\n * @param item The model item to convert attributes for.\n * @param conversionApi The conversion API object.\n */\n _testAndFireAddAttributes(item, conversionApi) {\n const data = {\n item,\n range: Range._createOn(item)\n };\n for (const key of data.item.getAttributeKeys()) {\n data.attributeKey = key;\n data.attributeOldValue = null;\n data.attributeNewValue = data.item.getAttribute(key);\n this._testAndFire(`attribute:${key}`, data, conversionApi);\n }\n }\n /**\n * Builds an instance of the {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi} from a template and a given\n * {@link module:engine/view/downcastwriter~DowncastWriter `DowncastWriter`} and options object.\n *\n * @param writer View writer that should be used to modify the view document.\n * @param refreshedItems A set of model elements that should not reuse their\n * previous view representations.\n * @param options Optional options passed to `convertionApi.options`.\n * @return The conversion API object.\n */\n _createConversionApi(writer, refreshedItems = new Set(), options = {}) {\n const conversionApi = {\n ...this._conversionApi,\n consumable: new Consumable(),\n writer,\n options,\n convertItem: item => this._convertInsert(Range._createOn(item), conversionApi),\n convertChildren: element => this._convertInsert(Range._createIn(element), conversionApi, { doNotAddConsumables: true }),\n convertAttributes: item => this._testAndFireAddAttributes(item, conversionApi),\n canReuseView: viewElement => !refreshedItems.has(conversionApi.mapper.toModelElement(viewElement))\n };\n this._firedEventsMap.set(conversionApi, new Map());\n return conversionApi;\n }\n}\n/**\n * Helper function, checks whether change of `marker` at `modelPosition` should be converted. Marker changes are not\n * converted if they happen inside an element with custom conversion method.\n */\nfunction shouldMarkerChangeBeConverted(modelPosition, marker, mapper) {\n const range = marker.getRange();\n const ancestors = Array.from(modelPosition.getAncestors());\n ancestors.shift(); // Remove root element. It cannot be passed to `model.Range#containsItem`.\n ancestors.reverse();\n const hasCustomHandling = ancestors.some(element => {\n if (range.containsItem(element)) {\n const viewElement = mapper.toViewElement(element);\n return !!viewElement.getCustomProperty('addHighlight');\n }\n });\n return !hasCustomHandling;\n}\nfunction getEventName(type, data) {\n const name = data.item.is('element') ? data.item.name : '$text';\n return `${type}:${name}`;\n}\nfunction walkerValueToEventData(value) {\n const item = value.item;\n const itemRange = Range._createFromPositionAndShift(value.previousPosition, value.length);\n return {\n item,\n range: itemRange\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/selection\n */\nimport TypeCheckable from './typecheckable.js';\nimport Node from './node.js';\nimport Position from './position.js';\nimport Range from './range.js';\nimport { CKEditorError, EmitterMixin, isIterable } from '@ckeditor/ckeditor5-utils';\n/**\n * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its\n * {@link module:engine/model/selection~Selection#anchor anchor} and {@link module:engine/model/selection~Selection#focus focus}\n * (it can be {@link module:engine/model/selection~Selection#isBackward forward or backward}).\n * Additionally, selection may have its own attributes (think – whether text typed in in this selection\n * should have those attributes – e.g. whether you type a bolded text).\n */\nexport default class Selection extends /* #__PURE__ */ EmitterMixin(TypeCheckable) {\n /**\n * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}\n * or creates an empty selection if no arguments were passed.\n *\n * ```ts\n * // Creates empty selection without ranges.\n * const selection = writer.createSelection();\n *\n * // Creates selection at the given range.\n * const range = writer.createRange( start, end );\n * const selection = writer.createSelection( range );\n *\n * // Creates selection at the given ranges\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n * const selection = writer.createSelection( ranges );\n *\n * // Creates selection from the other selection.\n * // Note: It doesn't copy selection attributes.\n * const otherSelection = writer.createSelection();\n * const selection = writer.createSelection( otherSelection );\n *\n * // Creates selection from the given document selection.\n * // Note: It doesn't copy selection attributes.\n * const documentSelection = model.document.selection;\n * const selection = writer.createSelection( documentSelection );\n *\n * // Creates selection at the given position.\n * const position = writer.createPositionFromPath( root, path );\n * const selection = writer.createSelection( position );\n *\n * // Creates selection at the given offset in the given element.\n * const paragraph = writer.createElement( 'paragraph' );\n * const selection = writer.createSelection( paragraph, offset );\n *\n * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the\n * // first child of that element and ends after the last child of that element.\n * const selection = writer.createSelection( paragraph, 'in' );\n *\n * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends\n * // just after the item.\n * const selection = writer.createSelection( paragraph, 'on' );\n * ```\n *\n * Selection's constructor allow passing additional options (`'backward'`) as the last argument.\n *\n * ```ts\n * // Creates backward selection.\n * const selection = writer.createSelection( range, { backward: true } );\n * ```\n *\n * @internal\n */\n constructor(...args) {\n super();\n /**\n * Specifies whether the last added range was added as a backward or forward range.\n */\n this._lastRangeBackward = false;\n /**\n * List of attributes set on current selection.\n */\n this._attrs = new Map();\n /** @internal */\n this._ranges = [];\n if (args.length) {\n this.setTo(...args);\n }\n }\n /**\n * Selection anchor. Anchor is the position from which the selection was started. If a user is making a selection\n * by dragging the mouse, the anchor is where the user pressed the mouse button (the beginning of the selection).\n *\n * Anchor and {@link #focus} define the direction of the selection, which is important\n * when expanding/shrinking selection. The focus moves, while the anchor should remain in the same place.\n *\n * Anchor is always set to the {@link module:engine/model/range~Range#start start} or\n * {@link module:engine/model/range~Range#end end} position of the last of selection's ranges. Whether it is\n * the `start` or `end` depends on the specified `options.backward`. See the {@link #setTo `setTo()`} method.\n *\n * May be set to `null` if there are no ranges in the selection.\n *\n * @see #focus\n */\n get anchor() {\n if (this._ranges.length > 0) {\n const range = this._ranges[this._ranges.length - 1];\n return this._lastRangeBackward ? range.end : range.start;\n }\n return null;\n }\n /**\n * Selection focus. Focus is the position where the selection ends. If a user is making a selection\n * by dragging the mouse, the focus is where the mouse cursor is.\n *\n * May be set to `null` if there are no ranges in the selection.\n *\n * @see #anchor\n */\n get focus() {\n if (this._ranges.length > 0) {\n const range = this._ranges[this._ranges.length - 1];\n return this._lastRangeBackward ? range.start : range.end;\n }\n return null;\n }\n /**\n * Whether the selection is collapsed. Selection is collapsed when there is exactly one range in it\n * and it is collapsed.\n */\n get isCollapsed() {\n const length = this._ranges.length;\n if (length === 1) {\n return this._ranges[0].isCollapsed;\n }\n else {\n return false;\n }\n }\n /**\n * Returns the number of ranges in the selection.\n */\n get rangeCount() {\n return this._ranges.length;\n }\n /**\n * Specifies whether the selection's {@link #focus} precedes the selection's {@link #anchor}.\n */\n get isBackward() {\n return !this.isCollapsed && this._lastRangeBackward;\n }\n /**\n * Checks whether this selection is equal to the given selection. Selections are equal if they have the same directions,\n * the same number of ranges and all ranges from one selection equal to ranges from the another selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are equal, `false` otherwise.\n */\n isEqual(otherSelection) {\n if (this.rangeCount != otherSelection.rangeCount) {\n return false;\n }\n else if (this.rangeCount === 0) {\n return true;\n }\n if (!this.anchor.isEqual(otherSelection.anchor) || !this.focus.isEqual(otherSelection.focus)) {\n return false;\n }\n for (const thisRange of this._ranges) {\n let found = false;\n for (const otherRange of otherSelection._ranges) {\n if (thisRange.isEqual(otherRange)) {\n found = true;\n break;\n }\n }\n if (!found) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns an iterable object that iterates over copies of selection ranges.\n */\n *getRanges() {\n for (const range of this._ranges) {\n yield new Range(range.start, range.end);\n }\n }\n /**\n * Returns a copy of the first range in the selection.\n * First range is the one which {@link module:engine/model/range~Range#start start} position\n * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges\n * (not to confuse with the first range added to the selection).\n *\n * Returns `null` if there are no ranges in selection.\n */\n getFirstRange() {\n let first = null;\n for (const range of this._ranges) {\n if (!first || range.start.isBefore(first.start)) {\n first = range;\n }\n }\n return first ? new Range(first.start, first.end) : null;\n }\n /**\n * Returns a copy of the last range in the selection.\n * Last range is the one which {@link module:engine/model/range~Range#end end} position\n * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most\n * recently added to the selection).\n *\n * Returns `null` if there are no ranges in selection.\n */\n getLastRange() {\n let last = null;\n for (const range of this._ranges) {\n if (!last || range.end.isAfter(last.end)) {\n last = range;\n }\n }\n return last ? new Range(last.start, last.end) : null;\n }\n /**\n * Returns the first position in the selection.\n * First position is the position that {@link module:engine/model/position~Position#isBefore is before}\n * any other position in the selection.\n *\n * Returns `null` if there are no ranges in selection.\n */\n getFirstPosition() {\n const first = this.getFirstRange();\n return first ? first.start.clone() : null;\n }\n /**\n * Returns the last position in the selection.\n * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}\n * any other position in the selection.\n *\n * Returns `null` if there are no ranges in selection.\n */\n getLastPosition() {\n const lastRange = this.getLastRange();\n return lastRange ? lastRange.end.clone() : null;\n }\n /**\n * Sets this selection's ranges and direction to the specified location based on the given\n * {@link module:engine/model/selection~Selectable selectable}.\n *\n * ```ts\n * // Removes all selection's ranges.\n * selection.setTo( null );\n *\n * // Sets selection to the given range.\n * const range = writer.createRange( start, end );\n * selection.setTo( range );\n *\n * // Sets selection to given ranges.\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n * selection.setTo( ranges );\n *\n * // Sets selection to other selection.\n * // Note: It doesn't copy selection attributes.\n * const otherSelection = writer.createSelection();\n * selection.setTo( otherSelection );\n *\n * // Sets selection to the given document selection.\n * // Note: It doesn't copy selection attributes.\n * const documentSelection = new DocumentSelection( doc );\n * selection.setTo( documentSelection );\n *\n * // Sets collapsed selection at the given position.\n * const position = writer.createPositionFromPath( root, path );\n * selection.setTo( position );\n *\n * // Sets collapsed selection at the position of the given node and an offset.\n * selection.setTo( paragraph, offset );\n * ```\n *\n * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * ```ts\n * selection.setTo( paragraph, 'in' );\n * ```\n *\n * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.\n *\n * ```ts\n * selection.setTo( paragraph, 'on' );\n * ```\n *\n * `Selection#setTo()`' method allow passing additional options (`backward`) as the last argument.\n *\n * ```ts\n * // Sets backward selection.\n * const selection = writer.createSelection( range, { backward: true } );\n * ```\n */\n setTo(...args) {\n let [selectable, placeOrOffset, options] = args;\n if (typeof placeOrOffset == 'object') {\n options = placeOrOffset;\n placeOrOffset = undefined;\n }\n if (selectable === null) {\n this._setRanges([]);\n }\n else if (selectable instanceof Selection) {\n this._setRanges(selectable.getRanges(), selectable.isBackward);\n }\n else if (selectable && typeof selectable.getRanges == 'function') {\n // We assume that the selectable is a DocumentSelection.\n // It can't be imported here, because it would lead to circular imports.\n this._setRanges(selectable.getRanges(), selectable.isBackward);\n }\n else if (selectable instanceof Range) {\n this._setRanges([selectable], !!options && !!options.backward);\n }\n else if (selectable instanceof Position) {\n this._setRanges([new Range(selectable)]);\n }\n else if (selectable instanceof Node) {\n const backward = !!options && !!options.backward;\n let range;\n if (placeOrOffset == 'in') {\n range = Range._createIn(selectable);\n }\n else if (placeOrOffset == 'on') {\n range = Range._createOn(selectable);\n }\n else if (placeOrOffset !== undefined) {\n range = new Range(Position._createAt(selectable, placeOrOffset));\n }\n else {\n /**\n * selection.setTo requires the second parameter when the first parameter is a node.\n *\n * @error model-selection-setto-required-second-parameter\n */\n throw new CKEditorError('model-selection-setto-required-second-parameter', [this, selectable]);\n }\n this._setRanges([range], backward);\n }\n else if (isIterable(selectable)) {\n // We assume that the selectable is an iterable of ranges.\n this._setRanges(selectable, options && !!options.backward);\n }\n else {\n /**\n * Cannot set the selection to the given place.\n *\n * Invalid parameters were specified when setting the selection. Common issues:\n *\n * * A {@link module:engine/model/textproxy~TextProxy} instance was passed instead of\n * a real {@link module:engine/model/text~Text}.\n * * View nodes were passed instead of model nodes.\n * * `null`/`undefined` was passed.\n *\n * @error model-selection-setto-not-selectable\n */\n throw new CKEditorError('model-selection-setto-not-selectable', [this, selectable]);\n }\n }\n /**\n * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array\n * is treated like the last added range and is used to set {@link module:engine/model/selection~Selection#anchor} and\n * {@link module:engine/model/selection~Selection#focus}. Accepts a flag describing in which direction the selection is made.\n *\n * @fires change:range\n * @param newRanges Ranges to set.\n * @param isLastBackward Flag describing if last added range was selected forward - from start to end (`false`)\n * or backward - from end to start (`true`).\n */\n _setRanges(newRanges, isLastBackward = false) {\n const ranges = Array.from(newRanges);\n // Check whether there is any range in new ranges set that is different than all already added ranges.\n const anyNewRange = ranges.some(newRange => {\n if (!(newRange instanceof Range)) {\n /**\n * Selection range set to an object that is not an instance of {@link module:engine/model/range~Range}.\n *\n * Only {@link module:engine/model/range~Range} instances can be used to set a selection.\n * Common mistakes leading to this error are:\n *\n * * using DOM `Range` object,\n * * incorrect CKEditor 5 installation with multiple `ckeditor5-engine` packages having different versions.\n *\n * @error model-selection-set-ranges-not-range\n */\n throw new CKEditorError('model-selection-set-ranges-not-range', [this, newRanges]);\n }\n return this._ranges.every(oldRange => {\n return !oldRange.isEqual(newRange);\n });\n });\n // Don't do anything if nothing changed.\n if (ranges.length === this._ranges.length && !anyNewRange) {\n return;\n }\n this._replaceAllRanges(ranges);\n this._lastRangeBackward = !!isLastBackward;\n this.fire('change:range', { directChange: true });\n }\n /**\n * Moves {@link module:engine/model/selection~Selection#focus} to the specified location.\n *\n * The location can be specified in the same form as\n * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.\n *\n * @fires change:range\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~Item model item}.\n */\n setFocus(itemOrPosition, offset) {\n if (this.anchor === null) {\n /**\n * Cannot set selection focus if there are no ranges in selection.\n *\n * @error model-selection-setfocus-no-ranges\n */\n throw new CKEditorError('model-selection-setfocus-no-ranges', [this, itemOrPosition]);\n }\n const newFocus = Position._createAt(itemOrPosition, offset);\n if (newFocus.compareWith(this.focus) == 'same') {\n return;\n }\n const anchor = this.anchor;\n if (this._ranges.length) {\n this._popRange();\n }\n if (newFocus.compareWith(anchor) == 'before') {\n this._pushRange(new Range(newFocus, anchor));\n this._lastRangeBackward = true;\n }\n else {\n this._pushRange(new Range(anchor, newFocus));\n this._lastRangeBackward = false;\n }\n this.fire('change:range', { directChange: true });\n }\n /**\n * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.\n *\n * @param key Key of attribute to look for.\n * @returns Attribute value or `undefined`.\n */\n getAttribute(key) {\n return this._attrs.get(key);\n }\n /**\n * Returns iterable that iterates over this selection's attributes.\n *\n * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n getAttributes() {\n return this._attrs.entries();\n }\n /**\n * Returns iterable that iterates over this selection's attribute keys.\n */\n getAttributeKeys() {\n return this._attrs.keys();\n }\n /**\n * Checks if the selection has an attribute for given key.\n *\n * @param key Key of attribute to check.\n * @returns `true` if attribute with given key is set on selection, `false` otherwise.\n */\n hasAttribute(key) {\n return this._attrs.has(key);\n }\n /**\n * Removes an attribute with given key from the selection.\n *\n * If given attribute was set on the selection, fires the {@link #event:change:range} event with\n * removed attribute key.\n *\n * @fires change:attribute\n * @param key Key of attribute to remove.\n */\n removeAttribute(key) {\n if (this.hasAttribute(key)) {\n this._attrs.delete(key);\n this.fire('change:attribute', { attributeKeys: [key], directChange: true });\n }\n }\n /**\n * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.\n *\n * If the attribute value has changed, fires the {@link #event:change:range} event with\n * the attribute key.\n *\n * @fires change:attribute\n * @param key Key of attribute to set.\n * @param value Attribute value.\n */\n setAttribute(key, value) {\n if (this.getAttribute(key) !== value) {\n this._attrs.set(key, value);\n this.fire('change:attribute', { attributeKeys: [key], directChange: true });\n }\n }\n /**\n * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only\n * one range in the selection, and that range contains exactly one element.\n * Returns `null` if there is no selected element.\n */\n getSelectedElement() {\n if (this.rangeCount !== 1) {\n return null;\n }\n return this.getFirstRange().getContainedElement();\n }\n /**\n * Gets elements of type {@link module:engine/model/schema~Schema#isBlock \"block\"} touched by the selection.\n *\n * This method's result can be used for example to apply block styling to all blocks covered by this selection.\n *\n * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements\n * but will not return blocks nested in other blocks.\n *\n * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):\n *\n * ```xml\n * <paragraph>[a</paragraph>\n * <blockQuote>\n * \t<paragraph>b</paragraph>\n * </blockQuote>\n * <paragraph>c]d</paragraph>\n * ```\n *\n * In this case the paragraph will also be returned, despite the collapsed selection:\n *\n * ```xml\n * <paragraph>[]a</paragraph>\n * ```\n *\n * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:\n *\n * ```xml\n * [<blockA></blockA>\n * <blockB>\n * \t<blockC></blockC>\n * \t<blockD></blockD>\n * </blockB>\n * <blockE></blockE>]\n * ```\n *\n * If the selection is inside a block all the inner blocks (A & B) are returned:\n *\n * ```xml\n * <block>\n * \t<blockA>[a</blockA>\n * \t<blockB>b]</blockB>\n * </block>\n * ```\n *\n * **Special case**: Selection ignores first and/or last blocks if nothing (from user perspective) is selected in them.\n *\n * ```xml\n * // Selection ends and the beginning of the last block.\n * <paragraph>[a</paragraph>\n * <paragraph>b</paragraph>\n * <paragraph>]c</paragraph> // This block will not be returned\n *\n * // Selection begins at the end of the first block.\n * <paragraph>a[</paragraph> // This block will not be returned\n * <paragraph>b</paragraph>\n * <paragraph>c]</paragraph>\n *\n * // Selection begings at the end of the first block and ends at the beginning of the last block.\n * <paragraph>a[</paragraph> // This block will not be returned\n * <paragraph>b</paragraph>\n * <paragraph>]c</paragraph> // This block will not be returned\n * ```\n */\n *getSelectedBlocks() {\n const visited = new WeakSet();\n for (const range of this.getRanges()) {\n // Get start block of range in case of a collapsed range.\n const startBlock = getParentBlock(range.start, visited);\n if (isStartBlockSelected(startBlock, range)) {\n yield startBlock;\n }\n for (const value of range.getWalker()) {\n const block = value.item;\n if (value.type == 'elementEnd' && isUnvisitedTopBlock(block, visited, range)) {\n yield block;\n }\n }\n const endBlock = getParentBlock(range.end, visited);\n if (isEndBlockSelected(endBlock, range)) {\n yield endBlock;\n }\n }\n }\n /**\n * Checks whether the selection contains the entire content of the given element. This means that selection must start\n * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position\n * touching the element's end.\n *\n * By default, this method will check whether the entire content of the selection's current root is selected.\n * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.\n */\n containsEntireContent(element = this.anchor.root) {\n const limitStartPosition = Position._createAt(element, 0);\n const limitEndPosition = Position._createAt(element, 'end');\n return limitStartPosition.isTouching(this.getFirstPosition()) &&\n limitEndPosition.isTouching(this.getLastPosition());\n }\n /**\n * Adds given range to internal {@link #_ranges ranges array}. Throws an error\n * if given range is intersecting with any range that is already stored in this selection.\n */\n _pushRange(range) {\n this._checkRange(range);\n this._ranges.push(new Range(range.start, range.end));\n }\n /**\n * Checks if given range intersects with ranges that are already in the selection. Throws an error if it does.\n */\n _checkRange(range) {\n for (let i = 0; i < this._ranges.length; i++) {\n if (range.isIntersecting(this._ranges[i])) {\n /**\n * Trying to add a range that intersects with another range in the selection.\n *\n * @error model-selection-range-intersects\n * @param addedRange Range that was added to the selection.\n * @param intersectingRange Range in the selection that intersects with `addedRange`.\n */\n throw new CKEditorError('model-selection-range-intersects', [this, range], { addedRange: range, intersectingRange: this._ranges[i] });\n }\n }\n }\n /**\n * Replaces all the ranges by the given ones.\n * Uses {@link #_popRange _popRange} and {@link #_pushRange _pushRange} to ensure proper ranges removal and addition.\n */\n _replaceAllRanges(ranges) {\n this._removeAllRanges();\n for (const range of ranges) {\n this._pushRange(range);\n }\n }\n /**\n * Deletes ranges from internal range array. Uses {@link #_popRange _popRange} to\n * ensure proper ranges removal.\n */\n _removeAllRanges() {\n while (this._ranges.length > 0) {\n this._popRange();\n }\n }\n /**\n * Removes most recently added range from the selection.\n */\n _popRange() {\n this._ranges.pop();\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nSelection.prototype.is = function (type) {\n return type === 'selection' || type === 'model:selection';\n};\n/**\n * Checks whether the given element extends $block in the schema and has a parent (is not a root).\n * Marks it as already visited.\n */\nfunction isUnvisitedBlock(element, visited) {\n if (visited.has(element)) {\n return false;\n }\n visited.add(element);\n return element.root.document.model.schema.isBlock(element) && !!element.parent;\n}\n/**\n * Checks if the given element is a $block was not previously visited and is a top block in a range.\n */\nfunction isUnvisitedTopBlock(element, visited, range) {\n return isUnvisitedBlock(element, visited) && isTopBlockInRange(element, range);\n}\n/**\n * Finds the lowest element in position's ancestors which is a block.\n * It will search until first ancestor that is a limit element.\n * Marks all ancestors as already visited to not include any of them later on.\n */\nfunction getParentBlock(position, visited) {\n const element = position.parent;\n const schema = element.root.document.model.schema;\n const ancestors = position.parent.getAncestors({ parentFirst: true, includeSelf: true });\n let hasParentLimit = false;\n const block = ancestors.find((element) => {\n // Stop searching after first parent node that is limit element.\n if (hasParentLimit) {\n return false;\n }\n hasParentLimit = schema.isLimit(element);\n return !hasParentLimit && isUnvisitedBlock(element, visited);\n });\n // Mark all ancestors of this position's parent, because find() might've stopped early and\n // the found block may be a child of another block.\n ancestors.forEach(element => visited.add(element));\n return block;\n}\n/**\n * Checks if the blocks is not nested in other block inside a range.\n */\nfunction isTopBlockInRange(block, range) {\n const parentBlock = findAncestorBlock(block);\n if (!parentBlock) {\n return true;\n }\n // Add loose flag to check as parentRange can be equal to range.\n const isParentInRange = range.containsRange(Range._createOn(parentBlock), true);\n return !isParentInRange;\n}\n/**\n * If a selection starts at the end of a block, that block is not returned as from the user's perspective this block wasn't selected.\n * See [#11585](https://github.com/ckeditor/ckeditor5/issues/11585) for more details.\n *\n * ```xml\n * <paragraph>a[</paragraph> // This block will not be returned\n * <paragraph>b</paragraph>\n * <paragraph>c]</paragraph>\n * ```\n *\n * Collapsed selection is not affected by it:\n *\n * ```xml\n * <paragraph>a[]</paragraph> // This block will be returned\n * ```\n */\nfunction isStartBlockSelected(startBlock, range) {\n if (!startBlock) {\n return false;\n }\n if (range.isCollapsed || startBlock.isEmpty) {\n return true;\n }\n if (range.start.isTouching(Position._createAt(startBlock, startBlock.maxOffset))) {\n return false;\n }\n return isTopBlockInRange(startBlock, range);\n}\n/**\n * If a selection ends at the beginning of a block, that block is not returned as from the user's perspective this block wasn't selected.\n * See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.\n *\n * ```xml\n * <paragraph>[a</paragraph>\n * <paragraph>b</paragraph>\n * <paragraph>]c</paragraph> // this block will not be returned\n * ```\n *\n * Collapsed selection is not affected by it:\n *\n * ```xml\n * <paragraph>[]a</paragraph> // this block will be returned\n * ```\n */\nfunction isEndBlockSelected(endBlock, range) {\n if (!endBlock) {\n return false;\n }\n if (range.isCollapsed || endBlock.isEmpty) {\n return true;\n }\n if (range.end.isTouching(Position._createAt(endBlock, 0))) {\n return false;\n }\n return isTopBlockInRange(endBlock, range);\n}\n/**\n * Returns first ancestor block of a node.\n */\nfunction findAncestorBlock(node) {\n const schema = node.root.document.model.schema;\n let parent = node.parent;\n while (parent) {\n if (schema.isBlock(parent)) {\n return parent;\n }\n parent = parent.parent;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/liverange\n */\nimport Range from './range.js';\nimport { EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * `LiveRange` is a type of {@link module:engine/model/range~Range Range}\n * that updates itself as {@link module:engine/model/document~Document document}\n * is changed through operations. It may be used as a bookmark.\n *\n * **Note:** Be very careful when dealing with `LiveRange`. Each `LiveRange` instance bind events that might\n * have to be unbound. Use {@link module:engine/model/liverange~LiveRange#detach detach} whenever you don't need `LiveRange` anymore.\n */\nexport default class LiveRange extends /* #__PURE__ */ EmitterMixin(Range) {\n /**\n * Creates a live range.\n *\n * @see module:engine/model/range~Range\n */\n constructor(start, end) {\n super(start, end);\n bindWithDocument.call(this);\n }\n /**\n * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance\n * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was\n * referring to it).\n */\n detach() {\n this.stopListening();\n }\n /**\n * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.\n */\n toRange() {\n return new Range(this.start, this.end);\n }\n /**\n * Creates a `LiveRange` instance that is equal to the given range.\n */\n static fromRange(range) {\n return new LiveRange(range.start, range.end);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nLiveRange.prototype.is = function (type) {\n return type === 'liveRange' || type === 'model:liveRange' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type == 'range' || type === 'model:range';\n};\n/**\n * Binds this `LiveRange` to the {@link module:engine/model/document~Document document}\n * that owns this range's {@link module:engine/model/range~Range#root root}.\n */\nfunction bindWithDocument() {\n this.listenTo(this.root.document.model, 'applyOperation', (event, args) => {\n const operation = args[0];\n if (!operation.isDocumentOperation) {\n return;\n }\n transform.call(this, operation);\n }, { priority: 'low' });\n}\n/**\n * Updates this range accordingly to the updates applied to the model. Bases on change events.\n */\nfunction transform(operation) {\n // Transform the range by the operation. Join the result ranges if needed.\n const ranges = this.getTransformedByOperation(operation);\n const result = Range._createFromRanges(ranges);\n const boundariesChanged = !result.isEqual(this);\n const contentChanged = doesOperationChangeRangeContent(this, operation);\n let deletionPosition = null;\n if (boundariesChanged) {\n // If range boundaries have changed, fire `change:range` event.\n //\n if (result.root.rootName == '$graveyard') {\n // If the range was moved to the graveyard root, set `deletionPosition`.\n if (operation.type == 'remove') {\n deletionPosition = operation.sourcePosition;\n }\n else {\n // Merge operation.\n deletionPosition = operation.deletionPosition;\n }\n }\n const oldRange = this.toRange();\n this.start = result.start;\n this.end = result.end;\n this.fire('change:range', oldRange, { deletionPosition });\n }\n else if (contentChanged) {\n // If range boundaries have not changed, but there was change inside the range, fire `change:content` event.\n this.fire('change:content', this.toRange(), { deletionPosition });\n }\n}\n/**\n * Checks whether given operation changes something inside the range (even if it does not change boundaries).\n */\nfunction doesOperationChangeRangeContent(range, operation) {\n switch (operation.type) {\n case 'insert':\n return range.containsPosition(operation.position);\n case 'move':\n case 'remove':\n case 'reinsert':\n case 'merge':\n return range.containsPosition(operation.sourcePosition) ||\n range.start.isEqual(operation.sourcePosition) ||\n range.containsPosition(operation.targetPosition);\n case 'split':\n return range.containsPosition(operation.splitPosition) || range.containsPosition(operation.insertionPosition);\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/documentselection\n */\nimport TypeCheckable from './typecheckable.js';\nimport LiveRange from './liverange.js';\nimport Selection from './selection.js';\nimport Text from './text.js';\nimport TextProxy from './textproxy.js';\nimport { CKEditorError, Collection, EmitterMixin, toMap, uid } from '@ckeditor/ckeditor5-utils';\nconst storePrefix = 'selection:';\n/**\n * `DocumentSelection` is a special selection which is used as the\n * {@link module:engine/model/document~Document#selection document's selection}.\n * There can be only one instance of `DocumentSelection` per document.\n *\n * Document selection can only be changed by using the {@link module:engine/model/writer~Writer} instance\n * inside the {@link module:engine/model/model~Model#change `change()`} block, as it provides a secure way to modify model.\n *\n * `DocumentSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}\n * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.\n *\n * Differences between {@link module:engine/model/selection~Selection} and `DocumentSelection` are:\n * * there is always a range in `DocumentSelection` - even if no ranges were added there is a \"default range\"\n * present in the selection,\n * * ranges added to this selection updates automatically when the document changes,\n * * attributes of `DocumentSelection` are updated automatically according to selection ranges.\n *\n * Since `DocumentSelection` uses {@link module:engine/model/liverange~LiveRange live ranges}\n * and is updated when {@link module:engine/model/document~Document document}\n * changes, it cannot be set on {@link module:engine/model/node~Node nodes}\n * that are inside {@link module:engine/model/documentfragment~DocumentFragment document fragment}.\n * If you need to represent a selection in document fragment,\n * use {@link module:engine/model/selection~Selection Selection class} instead.\n */\nexport default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(TypeCheckable) {\n /**\n * Creates an empty live selection for given {@link module:engine/model/document~Document}.\n *\n * @param doc Document which owns this selection.\n */\n constructor(doc) {\n super();\n this._selection = new LiveSelection(doc);\n this._selection.delegate('change:range').to(this);\n this._selection.delegate('change:attribute').to(this);\n this._selection.delegate('change:marker').to(this);\n }\n /**\n * Describes whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n * collapsed.\n */\n get isCollapsed() {\n return this._selection.isCollapsed;\n }\n /**\n * Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.\n * Together with {@link #focus} they define the direction of selection, which is important\n * when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~Range#start start} or\n * {@link module:engine/model/range~Range#end end} position of the most recently added range.\n *\n * Is set to `null` if there are no ranges in selection.\n *\n * @see #focus\n */\n get anchor() {\n return this._selection.anchor;\n }\n /**\n * Selection focus. Focus is a position where the selection ends.\n *\n * Is set to `null` if there are no ranges in selection.\n *\n * @see #anchor\n */\n get focus() {\n return this._selection.focus;\n }\n /**\n * Number of ranges in selection.\n */\n get rangeCount() {\n return this._selection.rangeCount;\n }\n /**\n * Describes whether `Documentselection` has own range(s) set, or if it is defaulted to\n * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.\n */\n get hasOwnRange() {\n return this._selection.hasOwnRange;\n }\n /**\n * Specifies whether the {@link #focus}\n * precedes {@link #anchor}.\n *\n * @readonly\n * @type {Boolean}\n */\n get isBackward() {\n return this._selection.isBackward;\n }\n /**\n * Describes whether the gravity is overridden (using {@link module:engine/model/writer~Writer#overrideSelectionGravity}) or not.\n *\n * Note that the gravity remains overridden as long as will not be restored the same number of times as it was overridden.\n */\n get isGravityOverridden() {\n return this._selection.isGravityOverridden;\n }\n /**\n * A collection of selection {@link module:engine/model/markercollection~Marker markers}.\n * Marker is a selection marker when selection range is inside the marker range.\n *\n * **Note**: Only markers from {@link ~DocumentSelection#observeMarkers observed markers groups} are collected.\n */\n get markers() {\n return this._selection.markers;\n }\n /**\n * Used for the compatibility with the {@link module:engine/model/selection~Selection#isEqual} method.\n *\n * @internal\n */\n get _ranges() {\n return this._selection._ranges;\n }\n /**\n * Returns an iterable that iterates over copies of selection ranges.\n */\n getRanges() {\n return this._selection.getRanges();\n }\n /**\n * Returns the first position in the selection.\n * First position is the position that {@link module:engine/model/position~Position#isBefore is before}\n * any other position in the selection.\n *\n * Returns `null` if there are no ranges in selection.\n */\n getFirstPosition() {\n return this._selection.getFirstPosition();\n }\n /**\n * Returns the last position in the selection.\n * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}\n * any other position in the selection.\n *\n * Returns `null` if there are no ranges in selection.\n */\n getLastPosition() {\n return this._selection.getLastPosition();\n }\n /**\n * Returns a copy of the first range in the selection.\n * First range is the one which {@link module:engine/model/range~Range#start start} position\n * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges\n * (not to confuse with the first range added to the selection).\n *\n * Returns `null` if there are no ranges in selection.\n */\n getFirstRange() {\n return this._selection.getFirstRange();\n }\n /**\n * Returns a copy of the last range in the selection.\n * Last range is the one which {@link module:engine/model/range~Range#end end} position\n * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most\n * recently added to the selection).\n *\n * Returns `null` if there are no ranges in selection.\n */\n getLastRange() {\n return this._selection.getLastRange();\n }\n /**\n * Gets elements of type {@link module:engine/model/schema~Schema#isBlock \"block\"} touched by the selection.\n *\n * This method's result can be used for example to apply block styling to all blocks covered by this selection.\n *\n * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements\n * but will not return blocks nested in other blocks.\n *\n * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):\n *\n * ```\n * <paragraph>[a</paragraph>\n * <blockQuote>\n * \t<paragraph>b</paragraph>\n * </blockQuote>\n * <paragraph>c]d</paragraph>\n * ```\n *\n * In this case the paragraph will also be returned, despite the collapsed selection:\n *\n * ```\n * <paragraph>[]a</paragraph>\n * ```\n *\n * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:\n *\n * ```\n * [<blockA></blockA>\n * <blockB>\n * \t<blockC></blockC>\n * \t<blockD></blockD>\n * </blockB>\n * <blockE></blockE>]\n * ```\n *\n * If the selection is inside a block all the inner blocks (A & B) are returned:\n *\n * ```\n * <block>\n * \t<blockA>[a</blockA>\n * \t<blockB>b]</blockB>\n * </block>\n * ```\n *\n * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective\n * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.\n *\n * ```\n * <paragraph>[a</paragraph>\n * <paragraph>b</paragraph>\n * <paragraph>]c</paragraph> // this block will not be returned\n * ```\n */\n getSelectedBlocks() {\n return this._selection.getSelectedBlocks();\n }\n /**\n * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only\n * one range in the selection, and that range contains exactly one element.\n * Returns `null` if there is no selected element.\n */\n getSelectedElement() {\n return this._selection.getSelectedElement();\n }\n /**\n * Checks whether the selection contains the entire content of the given element. This means that selection must start\n * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position\n * touching the element's end.\n *\n * By default, this method will check whether the entire content of the selection's current root is selected.\n * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.\n */\n containsEntireContent(element) {\n return this._selection.containsEntireContent(element);\n }\n /**\n * Unbinds all events previously bound by document selection.\n */\n destroy() {\n this._selection.destroy();\n }\n /**\n * Returns iterable that iterates over this selection's attribute keys.\n */\n getAttributeKeys() {\n return this._selection.getAttributeKeys();\n }\n /**\n * Returns iterable that iterates over this selection's attributes.\n *\n * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n getAttributes() {\n return this._selection.getAttributes();\n }\n /**\n * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.\n *\n * @param key Key of attribute to look for.\n * @returns Attribute value or `undefined`.\n */\n getAttribute(key) {\n return this._selection.getAttribute(key);\n }\n /**\n * Checks if the selection has an attribute for given key.\n *\n * @param key Key of attribute to check.\n * @returns `true` if attribute with given key is set on selection, `false` otherwise.\n */\n hasAttribute(key) {\n return this._selection.hasAttribute(key);\n }\n /**\n * Refreshes selection attributes and markers according to the current position in the model.\n */\n refresh() {\n this._selection.updateMarkers();\n this._selection._updateAttributes(false);\n }\n /**\n * Registers a marker group prefix or a marker name to be collected in the\n * {@link ~DocumentSelection#markers selection markers collection}.\n *\n * See also {@link module:engine/model/markercollection~MarkerCollection#getMarkersGroup `MarkerCollection#getMarkersGroup()`}.\n *\n * @param prefixOrName The marker group prefix or marker name.\n */\n observeMarkers(prefixOrName) {\n this._selection.observeMarkers(prefixOrName);\n }\n /**\n * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.\n * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionFocus} method.\n *\n * The location can be specified in the same form as\n * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.\n *\n * @see module:engine/model/writer~Writer#setSelectionFocus\n * @internal\n * @param offset Offset or one of the flags. Used only when\n * first parameter is a {@link module:engine/model/item~Item model item}.\n */\n _setFocus(itemOrPosition, offset) {\n this._selection.setFocus(itemOrPosition, offset);\n }\n /**\n * Sets this selection's ranges and direction to the specified location based on the given\n * {@link module:engine/model/selection~Selectable selectable}.\n * Should be used only within the {@link module:engine/model/writer~Writer#setSelection} method.\n *\n * @see module:engine/model/writer~Writer#setSelection\n * @internal\n */\n _setTo(...args) {\n this._selection.setTo(...args);\n }\n /**\n * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.\n * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionAttribute} method.\n *\n * @see module:engine/model/writer~Writer#setSelectionAttribute\n * @internal\n * @param key Key of the attribute to set.\n * @param value Attribute value.\n */\n _setAttribute(key, value) {\n this._selection.setAttribute(key, value);\n }\n /**\n * Removes an attribute with given key from the selection.\n * If the given attribute was set on the selection, fires the {@link module:engine/model/selection~Selection#event:change:range}\n * event with removed attribute key.\n * Should be used only within the {@link module:engine/model/writer~Writer#removeSelectionAttribute} method.\n *\n * @see module:engine/model/writer~Writer#removeSelectionAttribute\n * @internal\n * @param key Key of the attribute to remove.\n */\n _removeAttribute(key) {\n this._selection.removeAttribute(key);\n }\n /**\n * Returns an iterable that iterates through all selection attributes stored in current selection's parent.\n *\n * @internal\n */\n _getStoredAttributes() {\n return this._selection.getStoredAttributes();\n }\n /**\n * Temporarily changes the gravity of the selection from the left to the right.\n *\n * The gravity defines from which direction the selection inherits its attributes. If it's the default left\n * gravity, the selection (after being moved by the the user) inherits attributes from its left hand side.\n * This method allows to temporarily override this behavior by forcing the gravity to the right.\n *\n * It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry\n * of the process.\n *\n * @see module:engine/model/writer~Writer#overrideSelectionGravity\n * @internal\n * @returns The unique id which allows restoring the gravity.\n */\n _overrideGravity() {\n return this._selection.overrideGravity();\n }\n /**\n * Restores the {@link ~DocumentSelection#_overrideGravity overridden gravity}.\n *\n * Restoring the gravity is only possible using the unique identifier returned by\n * {@link ~DocumentSelection#_overrideGravity}. Note that the gravity remains overridden as long as won't be restored\n * the same number of times it was overridden.\n *\n * @see module:engine/model/writer~Writer#restoreSelectionGravity\n * @internal\n * @param uid The unique id returned by {@link #_overrideGravity}.\n */\n _restoreGravity(uid) {\n this._selection.restoreGravity(uid);\n }\n /**\n * Generates and returns an attribute key for selection attributes store, basing on original attribute key.\n *\n * @internal\n * @param key Attribute key to convert.\n * @returns Converted attribute key, applicable for selection store.\n */\n static _getStoreAttributeKey(key) {\n return storePrefix + key;\n }\n /**\n * Checks whether the given attribute key is an attribute stored on an element.\n *\n * @internal\n */\n static _isStoreAttributeKey(key) {\n return key.startsWith(storePrefix);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nDocumentSelection.prototype.is = function (type) {\n return type === 'selection' ||\n type == 'model:selection' ||\n type == 'documentSelection' ||\n type == 'model:documentSelection';\n};\n/**\n * `LiveSelection` is used internally by {@link module:engine/model/documentselection~DocumentSelection} and shouldn't be used directly.\n *\n * LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}\n * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.\n *\n * Differences between {@link module:engine/model/selection~Selection} and `LiveSelection` are:\n * * there is always a range in `LiveSelection` - even if no ranges were added there is a \"default range\"\n * present in the selection,\n * * ranges added to this selection updates automatically when the document changes,\n * * attributes of `LiveSelection` are updated automatically according to selection ranges.\n */\nclass LiveSelection extends Selection {\n /**\n * Creates an empty live selection for given {@link module:engine/model/document~Document}.\n *\n * @param doc Document which owns this selection.\n */\n constructor(doc) {\n super();\n /**\n * List of selection markers.\n * Marker is a selection marker when selection range is inside the marker range.\n */\n this.markers = new Collection({ idProperty: 'name' });\n /**\n * Keeps mapping of attribute name to priority with which the attribute got modified (added/changed/removed)\n * last time. Possible values of priority are: `'low'` and `'normal'`.\n *\n * Priorities are used by internal `LiveSelection` mechanisms. All attributes set using `LiveSelection`\n * attributes API are set with `'normal'` priority.\n */\n this._attributePriority = new Map();\n /**\n * Position to which the selection should be set if the last selection range was moved to the graveyard.\n */\n this._selectionRestorePosition = null;\n /**\n * Flag that informs whether the selection ranges have changed. It is changed on true when `LiveRange#change:range` event is fired.\n */\n this._hasChangedRange = false;\n /**\n * Each overriding gravity adds an UID to the set and each removal removes it.\n * Gravity is overridden when there's at least one UID in the set.\n * Gravity is restored when the set is empty.\n * This is to prevent conflicts when gravity is overridden by more than one feature at the same time.\n */\n this._overriddenGravityRegister = new Set();\n /**\n * Prefixes of marker names that should affect `LiveSelection#markers` collection.\n */\n this._observedMarkers = new Set();\n this._model = doc.model;\n this._document = doc;\n // Ensure selection is correct after each operation.\n this.listenTo(this._model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n if (!operation.isDocumentOperation || operation.type == 'marker' || operation.type == 'rename' || operation.type == 'noop') {\n return;\n }\n // Fix selection if the last range was removed from it and we have a position to which we can restore the selection.\n if (this._ranges.length == 0 && this._selectionRestorePosition) {\n this._fixGraveyardSelection(this._selectionRestorePosition);\n }\n // \"Forget\" the restore position even if it was not \"used\".\n this._selectionRestorePosition = null;\n if (this._hasChangedRange) {\n this._hasChangedRange = false;\n this.fire('change:range', { directChange: false });\n }\n }, { priority: 'lowest' });\n // Ensure selection is correct and up to date after each range change.\n this.on('change:range', () => {\n this._validateSelectionRanges(this.getRanges());\n });\n // Update markers data stored by the selection after each marker change.\n // This handles only marker changes done through marker operations (not model tree changes).\n this.listenTo(this._model.markers, 'update', (evt, marker, oldRange, newRange) => {\n this._updateMarker(marker, newRange);\n });\n // Ensure selection is up to date after each change block.\n this.listenTo(this._document, 'change', (evt, batch) => {\n clearAttributesStoredInElement(this._model, batch);\n });\n }\n get isCollapsed() {\n const length = this._ranges.length;\n return length === 0 ? this._document._getDefaultRange().isCollapsed : super.isCollapsed;\n }\n get anchor() {\n return super.anchor || this._document._getDefaultRange().start;\n }\n get focus() {\n return super.focus || this._document._getDefaultRange().end;\n }\n get rangeCount() {\n return this._ranges.length ? this._ranges.length : 1;\n }\n /**\n * Describes whether `LiveSelection` has own range(s) set, or if it is defaulted to\n * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.\n */\n get hasOwnRange() {\n return this._ranges.length > 0;\n }\n /**\n * When set to `true` then selection attributes on node before the caret won't be taken\n * into consideration while updating selection attributes.\n */\n get isGravityOverridden() {\n return !!this._overriddenGravityRegister.size;\n }\n /**\n * Unbinds all events previously bound by live selection.\n */\n destroy() {\n for (let i = 0; i < this._ranges.length; i++) {\n this._ranges[i].detach();\n }\n this.stopListening();\n }\n *getRanges() {\n if (this._ranges.length) {\n yield* super.getRanges();\n }\n else {\n yield this._document._getDefaultRange();\n }\n }\n getFirstRange() {\n return super.getFirstRange() || this._document._getDefaultRange();\n }\n getLastRange() {\n return super.getLastRange() || this._document._getDefaultRange();\n }\n setTo(...args) {\n super.setTo(...args);\n this._updateAttributes(true);\n this.updateMarkers();\n }\n setFocus(itemOrPosition, offset) {\n super.setFocus(itemOrPosition, offset);\n this._updateAttributes(true);\n this.updateMarkers();\n }\n setAttribute(key, value) {\n if (this._setAttribute(key, value)) {\n // Fire event with exact data.\n const attributeKeys = [key];\n this.fire('change:attribute', { attributeKeys, directChange: true });\n }\n }\n removeAttribute(key) {\n if (this._removeAttribute(key)) {\n // Fire event with exact data.\n const attributeKeys = [key];\n this.fire('change:attribute', { attributeKeys, directChange: true });\n }\n }\n overrideGravity() {\n const overrideUid = uid();\n // Remember that another overriding has been requested. It will need to be removed\n // before the gravity is to be restored.\n this._overriddenGravityRegister.add(overrideUid);\n if (this._overriddenGravityRegister.size === 1) {\n this._updateAttributes(true);\n }\n return overrideUid;\n }\n restoreGravity(uid) {\n if (!this._overriddenGravityRegister.has(uid)) {\n /**\n * Restoring gravity for an unknown UID is not possible. Make sure you are using a correct\n * UID obtained from the {@link module:engine/model/writer~Writer#overrideSelectionGravity} to restore.\n *\n * @error document-selection-gravity-wrong-restore\n * @param uid The unique identifier returned by\n * {@link module:engine/model/documentselection~DocumentSelection#_overrideGravity}.\n */\n throw new CKEditorError('document-selection-gravity-wrong-restore', this, { uid });\n }\n this._overriddenGravityRegister.delete(uid);\n // Restore gravity only when all overriding have been restored.\n if (!this.isGravityOverridden) {\n this._updateAttributes(true);\n }\n }\n observeMarkers(prefixOrName) {\n this._observedMarkers.add(prefixOrName);\n this.updateMarkers();\n }\n _replaceAllRanges(ranges) {\n this._validateSelectionRanges(ranges);\n super._replaceAllRanges(ranges);\n }\n _popRange() {\n this._ranges.pop().detach();\n }\n _pushRange(range) {\n const liveRange = this._prepareRange(range);\n // `undefined` is returned when given `range` is in graveyard root.\n if (liveRange) {\n this._ranges.push(liveRange);\n }\n }\n _validateSelectionRanges(ranges) {\n for (const range of ranges) {\n if (!this._document._validateSelectionRange(range)) {\n /**\n * Range from {@link module:engine/model/documentselection~DocumentSelection document selection}\n * starts or ends at incorrect position.\n *\n * @error document-selection-wrong-position\n * @param range\n */\n throw new CKEditorError('document-selection-wrong-position', this, { range });\n }\n }\n }\n /**\n * Prepares given range to be added to selection. Checks if it is correct,\n * converts it to {@link module:engine/model/liverange~LiveRange LiveRange}\n * and sets listeners listening to the range's change event.\n */\n _prepareRange(range) {\n this._checkRange(range);\n if (range.root == this._document.graveyard) {\n // @if CK_DEBUG // console.warn( 'Trying to add a Range that is in the graveyard root. Range rejected.' );\n return;\n }\n const liveRange = LiveRange.fromRange(range);\n // If selection range is moved to the graveyard remove it from the selection object.\n // Also, save some data that can be used to restore selection later, on `Model#applyOperation` event.\n liveRange.on('change:range', (evt, oldRange, data) => {\n this._hasChangedRange = true;\n if (liveRange.root == this._document.graveyard) {\n this._selectionRestorePosition = data.deletionPosition;\n const index = this._ranges.indexOf(liveRange);\n this._ranges.splice(index, 1);\n liveRange.detach();\n }\n });\n return liveRange;\n }\n updateMarkers() {\n if (!this._observedMarkers.size) {\n return;\n }\n const markers = [];\n let changed = false;\n for (const marker of this._model.markers) {\n const markerGroup = marker.name.split(':', 1)[0];\n if (!this._observedMarkers.has(markerGroup)) {\n continue;\n }\n const markerRange = marker.getRange();\n for (const selectionRange of this.getRanges()) {\n if (markerRange.containsRange(selectionRange, !selectionRange.isCollapsed)) {\n markers.push(marker);\n }\n }\n }\n const oldMarkers = Array.from(this.markers);\n for (const marker of markers) {\n if (!this.markers.has(marker)) {\n this.markers.add(marker);\n changed = true;\n }\n }\n for (const marker of Array.from(this.markers)) {\n if (!markers.includes(marker)) {\n this.markers.remove(marker);\n changed = true;\n }\n }\n if (changed) {\n this.fire('change:marker', { oldMarkers, directChange: false });\n }\n }\n _updateMarker(marker, markerRange) {\n const markerGroup = marker.name.split(':', 1)[0];\n if (!this._observedMarkers.has(markerGroup)) {\n return;\n }\n let changed = false;\n const oldMarkers = Array.from(this.markers);\n const hasMarker = this.markers.has(marker);\n if (!markerRange) {\n if (hasMarker) {\n this.markers.remove(marker);\n changed = true;\n }\n }\n else {\n let contained = false;\n for (const selectionRange of this.getRanges()) {\n if (markerRange.containsRange(selectionRange, !selectionRange.isCollapsed)) {\n contained = true;\n break;\n }\n }\n if (contained && !hasMarker) {\n this.markers.add(marker);\n changed = true;\n }\n else if (!contained && hasMarker) {\n this.markers.remove(marker);\n changed = true;\n }\n }\n if (changed) {\n this.fire('change:marker', { oldMarkers, directChange: false });\n }\n }\n /**\n * Updates this selection attributes according to its ranges and the {@link module:engine/model/document~Document model document}.\n */\n _updateAttributes(clearAll) {\n const newAttributes = toMap(this._getSurroundingAttributes());\n const oldAttributes = toMap(this.getAttributes());\n if (clearAll) {\n // If `clearAll` remove all attributes and reset priorities.\n this._attributePriority = new Map();\n this._attrs = new Map();\n }\n else {\n // If not, remove only attributes added with `low` priority.\n for (const [key, priority] of this._attributePriority) {\n if (priority == 'low') {\n this._attrs.delete(key);\n this._attributePriority.delete(key);\n }\n }\n }\n this._setAttributesTo(newAttributes);\n // Let's evaluate which attributes really changed.\n const changed = [];\n // First, loop through all attributes that are set on selection right now.\n // Check which of them are different than old attributes.\n for (const [newKey, newValue] of this.getAttributes()) {\n if (!oldAttributes.has(newKey) || oldAttributes.get(newKey) !== newValue) {\n changed.push(newKey);\n }\n }\n // Then, check which of old attributes got removed.\n for (const [oldKey] of oldAttributes) {\n if (!this.hasAttribute(oldKey)) {\n changed.push(oldKey);\n }\n }\n // Fire event with exact data (fire only if anything changed).\n if (changed.length > 0) {\n this.fire('change:attribute', { attributeKeys: changed, directChange: false });\n }\n }\n /**\n * Internal method for setting `LiveSelection` attribute. Supports attribute priorities (through `directChange`\n * parameter).\n */\n _setAttribute(key, value, directChange = true) {\n const priority = directChange ? 'normal' : 'low';\n if (priority == 'low' && this._attributePriority.get(key) == 'normal') {\n // Priority too low.\n return false;\n }\n const oldValue = super.getAttribute(key);\n // Don't do anything if value has not changed.\n if (oldValue === value) {\n return false;\n }\n this._attrs.set(key, value);\n // Update priorities map.\n this._attributePriority.set(key, priority);\n return true;\n }\n /**\n * Internal method for removing `LiveSelection` attribute. Supports attribute priorities (through `directChange`\n * parameter).\n *\n * NOTE: Even if attribute is not present in the selection but is provided to this method, it's priority will\n * be changed according to `directChange` parameter.\n */\n _removeAttribute(key, directChange = true) {\n const priority = directChange ? 'normal' : 'low';\n if (priority == 'low' && this._attributePriority.get(key) == 'normal') {\n // Priority too low.\n return false;\n }\n // Update priorities map.\n this._attributePriority.set(key, priority);\n // Don't do anything if value has not changed.\n if (!super.hasAttribute(key)) {\n return false;\n }\n this._attrs.delete(key);\n return true;\n }\n /**\n * Internal method for setting multiple `LiveSelection` attributes. Supports attribute priorities (through\n * `directChange` parameter).\n */\n _setAttributesTo(attrs) {\n const changed = new Set();\n for (const [oldKey, oldValue] of this.getAttributes()) {\n // Do not remove attribute if attribute with same key and value is about to be set.\n if (attrs.get(oldKey) === oldValue) {\n continue;\n }\n // All rest attributes will be removed so changed attributes won't change .\n this._removeAttribute(oldKey, false);\n }\n for (const [key, value] of attrs) {\n // Attribute may not be set because of attributes or because same key/value is already added.\n const gotAdded = this._setAttribute(key, value, false);\n if (gotAdded) {\n changed.add(key);\n }\n }\n return changed;\n }\n /**\n * Returns an iterable that iterates through all selection attributes stored in current selection's parent.\n */\n *getStoredAttributes() {\n const selectionParent = this.getFirstPosition().parent;\n if (this.isCollapsed && selectionParent.isEmpty) {\n for (const key of selectionParent.getAttributeKeys()) {\n if (key.startsWith(storePrefix)) {\n const realKey = key.substr(storePrefix.length);\n yield [realKey, selectionParent.getAttribute(key)];\n }\n }\n }\n }\n /**\n * Checks model text nodes that are closest to the selection's first position and returns attributes of first\n * found element. If there are no text nodes in selection's first position parent, it returns selection\n * attributes stored in that parent.\n */\n _getSurroundingAttributes() {\n const position = this.getFirstPosition();\n const schema = this._model.schema;\n if (position.root.rootName == '$graveyard') {\n return null;\n }\n let attrs = null;\n if (!this.isCollapsed) {\n // 1. If selection is a range...\n const range = this.getFirstRange();\n // ...look for a first character node in that range and take attributes from it.\n for (const value of range) {\n // If the item is an object, we don't want to get attributes from its children...\n if (value.item.is('element') && schema.isObject(value.item)) {\n // ...but collect attributes from inline object.\n attrs = getTextAttributes(value.item, schema);\n break;\n }\n if (value.type == 'text') {\n attrs = value.item.getAttributes();\n break;\n }\n }\n }\n else {\n // 2. If the selection is a caret or the range does not contain a character node...\n const nodeBefore = position.textNode ? position.textNode : position.nodeBefore;\n const nodeAfter = position.textNode ? position.textNode : position.nodeAfter;\n // When gravity is overridden then don't take node before into consideration.\n if (!this.isGravityOverridden) {\n // ...look at the node before caret and take attributes from it if it is a character node.\n attrs = getTextAttributes(nodeBefore, schema);\n }\n // 3. If not, look at the node after caret...\n if (!attrs) {\n attrs = getTextAttributes(nodeAfter, schema);\n }\n // 4. If not, try to find the first character on the left, that is in the same node.\n // When gravity is overridden then don't take node before into consideration.\n if (!this.isGravityOverridden && !attrs) {\n let node = nodeBefore;\n while (node && !attrs) {\n node = node.previousSibling;\n attrs = getTextAttributes(node, schema);\n }\n }\n // 5. If not found, try to find the first character on the right, that is in the same node.\n if (!attrs) {\n let node = nodeAfter;\n while (node && !attrs) {\n node = node.nextSibling;\n attrs = getTextAttributes(node, schema);\n }\n }\n // 6. If not found, selection should retrieve attributes from parent.\n if (!attrs) {\n attrs = this.getStoredAttributes();\n }\n }\n return attrs;\n }\n /**\n * Fixes the selection after all its ranges got removed.\n * @param deletionPosition Position where the deletion happened.\n */\n _fixGraveyardSelection(deletionPosition) {\n // Find a range that is a correct selection range and is closest to the position where the deletion happened.\n const selectionRange = this._model.schema.getNearestSelectionRange(deletionPosition);\n // If nearest valid selection range has been found - add it in the place of old range.\n if (selectionRange) {\n // Check the range, convert it to live range, bind events, etc.\n this._pushRange(selectionRange);\n }\n // If nearest valid selection range cannot be found don't add any range. Selection will be set to the default range.\n }\n}\n/**\n * Helper function for {@link module:engine/model/liveselection~LiveSelection#_updateAttributes}.\n *\n * It checks if the passed model item is a text node (or text proxy) and, if so, returns it's attributes.\n * If not, it checks if item is an inline object and does the same. Otherwise it returns `null`.\n */\nfunction getTextAttributes(node, schema) {\n if (!node) {\n return null;\n }\n if (node instanceof TextProxy || node instanceof Text) {\n return node.getAttributes();\n }\n if (!schema.isInline(node)) {\n return null;\n }\n // Stop on inline elements (such as `<softBreak>`) that are not objects (such as `<imageInline>` or `<mathml>`).\n if (!schema.isObject(node)) {\n return [];\n }\n const attributes = [];\n // Collect all attributes that can be applied to the text node.\n for (const [key, value] of node.getAttributes()) {\n if (schema.checkAttribute('$text', key) &&\n schema.getAttributeProperties(key).copyFromObject !== false) {\n attributes.push([key, value]);\n }\n }\n return attributes;\n}\n/**\n * Removes selection attributes from element which is not empty anymore.\n */\nfunction clearAttributesStoredInElement(model, batch) {\n const differ = model.document.differ;\n for (const entry of differ.getChanges()) {\n if (entry.type != 'insert') {\n continue;\n }\n const changeParent = entry.position.parent;\n const isNoLongerEmpty = entry.length === changeParent.maxOffset;\n if (isNoLongerEmpty) {\n model.enqueueChange(batch, writer => {\n const storedAttributes = Array.from(changeParent.getAttributeKeys())\n .filter(key => key.startsWith(storePrefix));\n for (const key of storedAttributes) {\n writer.removeAttribute(key, changeParent);\n }\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/conversionhelpers\n */\n/**\n * Base class for conversion helpers.\n */\nexport default class ConversionHelpers {\n /**\n * Creates a conversion helpers instance.\n */\n constructor(dispatchers) {\n this._dispatchers = dispatchers;\n }\n /**\n * Registers a conversion helper.\n *\n * **Note**: See full usage example in the `{@link module:engine/conversion/conversion~Conversion#for conversion.for()}`\n * method description.\n *\n * @param conversionHelper The function to be called on event.\n */\n add(conversionHelper) {\n for (const dispatcher of this._dispatchers) {\n conversionHelper(dispatcher);\n }\n return this;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Contains downcast (model-to-view) converters for {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}.\n *\n * @module engine/conversion/downcasthelpers\n */\nimport ModelRange from '../model/range.js';\nimport ModelSelection from '../model/selection.js';\nimport ModelDocumentSelection from '../model/documentselection.js';\nimport ModelElement from '../model/element.js';\nimport ModelPosition from '../model/position.js';\nimport ViewAttributeElement from '../view/attributeelement.js';\nimport ConversionHelpers from './conversionhelpers.js';\nimport StylesMap from '../view/stylesmap.js';\nimport { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';\nimport { cloneDeep } from 'lodash-es';\n/**\n * Downcast conversion helper functions.\n *\n * Learn more about {@glink framework/deep-dive/conversion/downcast downcast helpers}.\n *\n * @extends module:engine/conversion/conversionhelpers~ConversionHelpers\n */\nexport default class DowncastHelpers extends ConversionHelpers {\n /**\n * Model element to view element conversion helper.\n *\n * This conversion results in creating a view element. For example, model `<paragraph>Foo</paragraph>` becomes `<p>Foo</p>` in the view.\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'paragraph',\n * \tview: 'p'\n * } );\n *\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'paragraph',\n * \tview: 'div',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'fancyParagraph',\n * \tview: {\n * \t\tname: 'p',\n * \t\tclasses: 'fancy'\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'heading',\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) );\n * \t}\n * } );\n * ```\n *\n * The element-to-element conversion supports the reconversion mechanism. It can be enabled by using either the `attributes` or\n * the `children` props on a model description. You will find a couple examples below.\n *\n * In order to reconvert an element if any of its direct children have been added or removed, use the `children` property on a `model`\n * description. For example, this model:\n *\n * ```xml\n * <box>\n * \t<paragraph>Some text.</paragraph>\n * </box>\n * ```\n *\n * will be converted into this structure in the view:\n *\n * ```html\n * <div class=\"box\" data-type=\"single\">\n * \t<p>Some text.</p>\n * </div>\n * ```\n *\n * But if more items were inserted in the model:\n *\n * ```xml\n * <box>\n * \t<paragraph>Some text.</paragraph>\n * \t<paragraph>Other item.</paragraph>\n * </box>\n * ```\n *\n * it will be converted into this structure in the view (note the element `data-type` change):\n *\n * ```html\n * <div class=\"box\" data-type=\"multiple\">\n * \t<p>Some text.</p>\n * \t<p>Other item.</p>\n * </div>\n * ```\n *\n * Such a converter would look like this (note that the `paragraph` elements are converted separately):\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: {\n * \t\tname: 'box',\n * \t\tchildren: true\n * \t},\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createContainerElement( 'div', {\n * \t\t\tclass: 'box',\n * \t\t\t'data-type': modelElement.childCount == 1 ? 'single' : 'multiple'\n * \t\t} );\n * \t}\n * } );\n * ```\n *\n * In order to reconvert element if any of its attributes have been updated, use the `attributes` property on a `model`\n * description. For example, this model:\n *\n * ```xml\n * <heading level=\"2\">Some text.</heading>\n * ```\n *\n * will be converted into this structure in the view:\n *\n * ```html\n * <h2>Some text.</h2>\n * ```\n *\n * But if the `heading` element's `level` attribute has been updated to `3` for example, then\n * it will be converted into this structure in the view:\n *\n * ```html\n * <h3>Some text.</h3>\n * ```\n *\n * Such a converter would look as follows:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: {\n * \t\tname: 'heading',\n * \t\tattributes: 'level'\n * \t},\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) );\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * You can read more about the element-to-element conversion in the\n * {@glink framework/deep-dive/conversion/downcast downcast conversion} guide.\n *\n * @param config Conversion configuration.\n * @param config.model The description or a name of the model element to convert.\n * @param config.model.attributes The list of attribute names that should be consumed while creating\n * the view element. Note that the view will be reconverted if any of the listed attributes changes.\n * @param config.model.children Specifies whether the view element requires reconversion if the list\n * of the model child nodes changed.\n * @param config.view A view element definition or a function that takes the model element and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}\n * as parameters and returns a view container element.\n */\n elementToElement(config) {\n return this.add(downcastElementToElement(config));\n }\n /**\n * The model element to view structure (several elements) conversion helper.\n *\n * This conversion results in creating a view structure with one or more slots defined for the child nodes.\n * For example, a model `<table>` may become this structure in the view:\n *\n * ```html\n * <figure class=\"table\">\n * \t<table>\n * \t\t<tbody>${ slot for table rows }</tbody>\n * \t</table>\n * </figure>\n * ```\n *\n * The children of the model's `<table>` element will be inserted into the `<tbody>` element.\n * If the `elementToElement()` helper was used, the children would be inserted into the `<figure>`.\n *\n * Imagine a table feature where for this model structure:\n *\n * ```xml\n * <table headingRows=\"1\">\n * \t<tableRow> ... table cells 1 ... </tableRow>\n * \t<tableRow> ... table cells 2 ... </tableRow>\n * \t<tableRow> ... table cells 3 ... </tableRow>\n * \t<caption>Caption text</caption>\n * </table>\n * ```\n *\n * we want to generate this view structure:\n *\n * ```html\n * <figure class=\"table\">\n * \t<table>\n * \t\t<thead>\n * \t\t\t<tr> ... table cells 1 ... </tr>\n * \t\t</thead>\n * \t\t<tbody>\n * \t\t\t<tr> ... table cells 2 ... </tr>\n * \t\t\t<tr> ... table cells 3 ... </tr>\n * \t\t</tbody>\n * \t</table>\n * \t<figcaption>Caption text</figcaption>\n * </figure>\n * ```\n *\n * The converter has to take the `headingRows` attribute into consideration when allocating the `<tableRow>` elements\n * into the `<tbody>` and `<thead>` elements. Hence, we need two slots and need to define proper filter callbacks for them.\n *\n * Additionally, all elements other than `<tableRow>` should be placed outside the `<table>` tag.\n * In the example above, this will handle the table caption.\n *\n * Such a converter would look like this:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToStructure( {\n * \tmodel: {\n * \t\tname: 'table',\n * \t\tattributes: [ 'headingRows' ]\n * \t},\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\tconst figureElement = writer.createContainerElement( 'figure', { class: 'table' } );\n * \t\tconst tableElement = writer.createContainerElement( 'table' );\n *\n * \t\twriter.insert( writer.createPositionAt( figureElement, 0 ), tableElement );\n *\n * \t\tconst headingRows = modelElement.getAttribute( 'headingRows' ) || 0;\n *\n * \t\tif ( headingRows > 0 ) {\n * \t\t\tconst tableHead = writer.createContainerElement( 'thead' );\n *\n * \t\t\tconst headSlot = writer.createSlot( node => node.is( 'element', 'tableRow' ) && node.index < headingRows );\n *\n * \t\t\twriter.insert( writer.createPositionAt( tableElement, 'end' ), tableHead );\n * \t\t\twriter.insert( writer.createPositionAt( tableHead, 0 ), headSlot );\n * \t\t}\n *\n * \t\tif ( headingRows < tableUtils.getRows( table ) ) {\n * \t\t\tconst tableBody = writer.createContainerElement( 'tbody' );\n *\n * \t\t\tconst bodySlot = writer.createSlot( node => node.is( 'element', 'tableRow' ) && node.index >= headingRows );\n *\n * \t\t\twriter.insert( writer.createPositionAt( tableElement, 'end' ), tableBody );\n * \t\t\twriter.insert( writer.createPositionAt( tableBody, 0 ), bodySlot );\n * \t\t}\n *\n * \t\tconst restSlot = writer.createSlot( node => !node.is( 'element', 'tableRow' ) );\n *\n * \t\twriter.insert( writer.createPositionAt( figureElement, 'end' ), restSlot );\n *\n * \t\treturn figureElement;\n * \t}\n * } );\n * ```\n *\n * Note: The children of a model element that's being converted must be allocated in the same order in the view\n * in which they are placed in the model.\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The description or a name of the model element to convert.\n * @param config.model.name The name of the model element to convert.\n * @param config.model.attributes The list of attribute names that should be consumed while creating\n * the view structure. Note that the view will be reconverted if any of the listed attributes will change.\n * @param config.view A function that takes the model element and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters\n * and returns a view container element with slots for model child nodes to be converted into.\n */\n elementToStructure(config) {\n return this.add(downcastElementToStructure(config));\n }\n /**\n * Model attribute to view element conversion helper.\n *\n * This conversion results in wrapping view nodes with a view attribute element. For example, a model text node with\n * `\"Foo\"` as data and the `bold` attribute becomes `<strong>Foo</strong>` in the view.\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: 'bold',\n * \tview: 'strong'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: 'bold',\n * \tview: 'b',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: 'invert',\n * \tview: {\n * \t\tname: 'span',\n * \t\tclasses: [ 'font-light', 'bg-dark' ]\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'fontSize',\n * \t\tvalues: [ 'big', 'small' ]\n * \t},\n * \tview: {\n * \t\tbig: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-size': '1.2em'\n * \t\t\t}\n * \t\t},\n * \t\tsmall: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-size': '0.8em'\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: 'bold',\n * \tview: ( modelAttributeValue, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createAttributeElement( 'span', {\n * \t\t\tstyle: 'font-weight:' + modelAttributeValue\n * \t\t} );\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'color',\n * \t\tname: '$text'\n * \t},\n * \tview: ( modelAttributeValue, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createAttributeElement( 'span', {\n * \t\t\tstyle: 'color:' + modelAttributeValue\n * \t\t} );\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array\n * of `String`s with possible values if the model attribute is an enumerable.\n * @param config.view A view element definition or a function\n * that takes the model attribute value and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters and returns a view\n * attribute element. If `config.model.values` is given, `config.view` should be an object assigning values from `config.model.values`\n * to view element definitions or functions.\n * @param config.converterPriority Converter priority.\n */\n attributeToElement(config) {\n return this.add(downcastAttributeToElement(config));\n }\n /**\n * Model attribute to view attribute conversion helper.\n *\n * This conversion results in adding an attribute to a view node, basing on an attribute from a model node. For example,\n * `<imageInline src='foo.jpg'></imageInline>` is converted to `<img src='foo.jpg'></img>`.\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'source',\n * \tview: 'src'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'source',\n * \tview: 'href',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: {\n * \t\tname: 'imageInline',\n * \t\tkey: 'source'\n * \t},\n * \tview: 'src'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: {\n * \t\tname: 'styled',\n * \t\tvalues: [ 'dark', 'light' ]\n * \t},\n * \tview: {\n * \t\tdark: {\n * \t\t\tkey: 'class',\n * \t\t\tvalue: [ 'styled', 'styled-dark' ]\n * \t\t},\n * \t\tlight: {\n * \t\t\tkey: 'class',\n * \t\t\tvalue: [ 'styled', 'styled-light' ]\n * \t\t}\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'styled',\n * \tview: modelAttributeValue => ( {\n * \t\tkey: 'class',\n * \t\tvalue: 'styled-' + modelAttributeValue\n * \t} )\n * } );\n * ```\n *\n * **Note**: Downcasting to a style property requires providing `value` as an object:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'lineHeight',\n * \tview: modelAttributeValue => ( {\n * \t\tkey: 'style',\n * \t\tvalue: {\n * \t\t\t'line-height': modelAttributeValue,\n * \t\t\t'border-bottom': '1px dotted #ba2'\n * \t\t}\n * \t} )\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing\n * the attribute key, possible values and, optionally, an element name to convert from.\n * @param config.view A view attribute key, or a `{ key, value }` object or a function that takes the model attribute value and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}\n * as parameters and returns a `{ key, value }` object. If the `key` is `'class'`, the `value` can be a `String` or an\n * array of `String`s. If the `key` is `'style'`, the `value` is an object with key-value pairs. In other cases, `value` is a `String`.\n * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to\n * `{ key, value }` objects or a functions.\n * @param config.converterPriority Converter priority.\n */\n attributeToAttribute(config) {\n return this.add(downcastAttributeToAttribute(config));\n }\n /**\n * Model marker to view element conversion helper.\n *\n * **Note**: This method should be used mainly for editing the downcast and it is recommended\n * to use the {@link #markerToData `#markerToData()`} helper instead.\n *\n * This helper may produce invalid HTML code (e.g. a span between table cells).\n * It should only be used when you are sure that the produced HTML will be semantically correct.\n *\n * This conversion results in creating a view element on the boundaries of the converted marker. If the converted marker\n * is collapsed, only one element is created. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>`\n * becomes `<p>F<span data-marker=\"search\"></span>oo b<span data-marker=\"search\"></span>ar</p>` in the view.\n *\n * ```ts\n * editor.conversion.for( 'editingDowncast' ).markerToElement( {\n * \tmodel: 'search',\n * \tview: 'marker-search'\n * } );\n *\n * editor.conversion.for( 'editingDowncast' ).markerToElement( {\n * \tmodel: 'search',\n * \tview: 'search-result',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'editingDowncast' ).markerToElement( {\n * \tmodel: 'search',\n * \tview: {\n * \t\tname: 'span',\n * \t\tattributes: {\n * \t\t\t'data-marker': 'search'\n * \t\t}\n * \t}\n * } );\n *\n * editor.conversion.for( 'editingDowncast' ).markerToElement( {\n * \tmodel: 'search',\n * \tview: ( markerData, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createUIElement( 'span', {\n * \t\t\t'data-marker': 'search',\n * \t\t\t'data-start': markerData.isOpening\n * \t\t} );\n * \t}\n * } );\n * ```\n *\n * If a function is passed as the `config.view` parameter, it will be used to generate both boundary elements. The function\n * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}\n * as a parameters and should return an instance of the\n * {@link module:engine/view/uielement~UIElement view UI element}. The `data` object and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi `conversionApi`} are passed from\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}. Additionally,\n * the `data.isOpening` parameter is passed, which is set to `true` for the marker start boundary element, and `false` for\n * the marker end boundary element.\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or model marker group) to convert.\n * @param config.view A view element definition or a function that takes the model marker data and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters\n * and returns a view UI element.\n * @param config.converterPriority Converter priority.\n */\n markerToElement(config) {\n return this.add(downcastMarkerToElement(config));\n }\n /**\n * Model marker to highlight conversion helper.\n *\n * This conversion results in creating a highlight on view nodes. For this kind of conversion,\n * the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} should be provided.\n *\n * For text nodes, a `<span>` {@link module:engine/view/attributeelement~AttributeElement} is created and it wraps all text nodes\n * in the converted marker range. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>` becomes\n * `<p>F<span class=\"comment\">oo b</span>ar</p>` in the view.\n *\n * {@link module:engine/view/containerelement~ContainerElement} may provide a custom way of handling highlight. Most often,\n * the element itself is given classes and attributes described in the highlight descriptor (instead of being wrapped in `<span>`).\n * For example, a model marker set like this:\n * `[<imageInline src=\"foo.jpg\"></imageInline>]` becomes `<img src=\"foo.jpg\" class=\"comment\"></img>` in the view.\n *\n * For container elements, the conversion is two-step. While the converter processes the highlight descriptor and passes it\n * to a container element, it is the container element instance itself that applies values from the highlight descriptor.\n * So, in a sense, the converter takes care of stating what should be applied on what, while the element decides how to apply that.\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).markerToHighlight( { model: 'comment', view: { classes: 'comment' } } );\n *\n * editor.conversion.for( 'downcast' ).markerToHighlight( {\n * \tmodel: 'comment',\n * \tview: { classes: 'comment' },\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'downcast' ).markerToHighlight( {\n * \tmodel: 'comment',\n * \tview: ( data, conversionApi ) => {\n * \t\t// Assuming that the marker name is in a form of comment:commentType:commentId.\n * \t\tconst [ , commentType, commentId ] = data.markerName.split( ':' );\n *\n * \t\treturn {\n * \t\t\tclasses: [ 'comment', 'comment-' + commentType ],\n * \t\t\tattributes: { 'data-comment-id': commentId }\n * \t\t};\n * \t}\n * } );\n * ```\n *\n * If a function is passed as the `config.view` parameter, it will be used to generate the highlight descriptor. The function\n * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}\n * as the parameters and should return a\n * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor}.\n * The `data` object properties are passed from {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}.\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or model marker group) to convert.\n * @param config.view A highlight descriptor that will be used for highlighting or a function that takes the model marker data and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters\n * and returns a highlight descriptor.\n * @param config.converterPriority Converter priority.\n */\n markerToHighlight(config) {\n return this.add(downcastMarkerToHighlight(config));\n }\n /**\n * Model marker converter for data downcast.\n *\n * This conversion creates a representation for model marker boundaries in the view:\n *\n * * If the marker boundary is before or after a model element, a view attribute is set on a corresponding view element.\n * * In other cases, a view element with the specified tag name is inserted at the corresponding view position.\n *\n * Typically, the marker names use the `group:uniqueId:otherData` convention. For example: `comment:e34zfk9k2n459df53sjl34:zx32c`.\n * The default configuration for this conversion is that the first part is the `group` part and the rest of\n * the marker name becomes the `name` part.\n *\n * Tag and attribute names and values are generated from the marker name:\n *\n * * The templates for attributes are `data-[group]-start-before=\"[name]\"`, `data-[group]-start-after=\"[name]\"`,\n * `data-[group]-end-before=\"[name]\"` and `data-[group]-end-after=\"[name]\"`.\n * * The templates for view elements are `<[group]-start name=\"[name]\">` and `<[group]-end name=\"[name]\">`.\n *\n * Attributes mark whether the given marker's start or end boundary is before or after the given element.\n * The `data-[group]-start-before` and `data-[group]-end-after` attributes are favored.\n * The other two are used when the former two cannot be used.\n *\n * The conversion configuration can take a function that will generate different group and name parts.\n * If such a function is set as the `config.view` parameter, it is passed a marker name and it is expected to return an object with two\n * properties: `group` and `name`. If the function returns a falsy value, the conversion will not take place.\n *\n * Basic usage:\n *\n * ```ts\n * // Using the default conversion.\n * // In this case, all markers with names starting with 'comment:' will be converted.\n * // The `group` parameter will be set to `comment`.\n * // The `name` parameter will be the rest of the marker name (without the `:`).\n * editor.conversion.for( 'dataDowncast' ).markerToData( {\n * \tmodel: 'comment'\n * } );\n * ```\n *\n * An example of a view that may be generated by this conversion (assuming a marker with the name `comment:commentId:uid` marked\n * by `[]`):\n *\n * ```\n * // Model:\n * <paragraph>Foo[bar</paragraph>\n * <imageBlock src=\"abc.jpg\"></imageBlock>]\n *\n * // View:\n * <p>Foo<comment-start name=\"commentId:uid\"></comment-start>bar</p>\n * <figure data-comment-end-after=\"commentId:uid\" class=\"image\"><img src=\"abc.jpg\" /></figure>\n * ```\n *\n * In the example above, the comment starts before \"bar\" and ends after the image.\n *\n * If the `name` part is empty, the following view may be generated:\n *\n * ```html\n * <p>Foo <myMarker-start></myMarker-start>bar</p>\n * <figure data-myMarker-end-after=\"\" class=\"image\"><img src=\"abc.jpg\" /></figure>\n * ```\n *\n * **Note:** A situation where some markers have the `name` part and some do not, is incorrect and should be avoided.\n *\n * Examples where `data-group-start-after` and `data-group-end-before` are used:\n *\n * ```\n * // Model:\n * <blockQuote>[]<paragraph>Foo</paragraph></blockQuote>\n *\n * // View:\n * <blockquote><p data-group-end-before=\"name\" data-group-start-before=\"name\">Foo</p></blockquote>\n * ```\n *\n * Similarly, when a marker is collapsed after the last element:\n *\n * ```\n * // Model:\n * <blockQuote><paragraph>Foo</paragraph>[]</blockQuote>\n *\n * // View:\n * <blockquote><p data-group-end-after=\"name\" data-group-start-after=\"name\">Foo</p></blockquote>\n * ```\n *\n * When there are multiple markers from the same group stored in the same attribute of the same element, their\n * name parts are put together in the attribute value, for example: `data-group-start-before=\"name1,name2,name3\"`.\n *\n * Other examples of usage:\n *\n * ```ts\n * // Using a custom function which is the same as the default conversion:\n * editor.conversion.for( 'dataDowncast' ).markerToData( {\n * \tmodel: 'comment',\n * \tview: markerName => ( {\n * \t\tgroup: 'comment',\n * \t\tname: markerName.substr( 8 ) // Removes 'comment:' part.\n * \t} )\n * } );\n *\n * // Using the converter priority:\n * editor.conversion.for( 'dataDowncast' ).markerToData( {\n * \tmodel: 'comment',\n * \tview: markerName => ( {\n * \t\tgroup: 'comment',\n * \t\tname: markerName.substr( 8 ) // Removes 'comment:' part.\n * \t} ),\n * \tconverterPriority: 'high'\n * } );\n * ```\n *\n * This kind of conversion is useful for saving data into the database, so it should be used in the data conversion pipeline.\n *\n * See the {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} API guide to learn how to\n * add a converter to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or the model marker group) to convert.\n * @param config.view A function that takes the model marker name and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as the parameters\n * and returns an object with the `group` and `name` properties.\n * @param config.converterPriority Converter priority.\n */\n markerToData(config) {\n return this.add(downcastMarkerToData(config));\n }\n}\n/**\n * Function factory that creates a default downcast converter for text insertion changes.\n *\n * The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n *\n * ```ts\n * modelDispatcher.on( 'insert:$text', insertText() );\n * ```\n *\n * @returns Insert text event converter.\n */\nexport function insertText() {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewPosition = conversionApi.mapper.toViewPosition(data.range.start);\n const viewText = viewWriter.createText(data.item.data);\n viewWriter.insert(viewPosition, viewText);\n };\n}\n/**\n * Function factory that creates a default downcast converter for triggering attributes and children conversion.\n *\n * @returns The converter.\n */\nexport function insertAttributesAndChildren() {\n return (evt, data, conversionApi) => {\n conversionApi.convertAttributes(data.item);\n // Start converting children of the current item.\n // In case of reconversion children were already re-inserted or converted separately.\n if (!data.reconversion && data.item.is('element') && !data.item.isEmpty) {\n conversionApi.convertChildren(data.item);\n }\n };\n}\n/**\n * Function factory that creates a default downcast converter for node remove changes.\n *\n * ```ts\n * modelDispatcher.on( 'remove', remove() );\n * ```\n *\n * @returns Remove event converter.\n */\nexport function remove() {\n return (evt, data, conversionApi) => {\n // Find the view range start position by mapping the model position at which the remove happened.\n const viewStart = conversionApi.mapper.toViewPosition(data.position);\n const modelEnd = data.position.getShiftedBy(data.length);\n const viewEnd = conversionApi.mapper.toViewPosition(modelEnd, { isPhantom: true });\n const viewRange = conversionApi.writer.createRange(viewStart, viewEnd);\n // Trim the range to remove in case some UI elements are on the view range boundaries.\n const removed = conversionApi.writer.remove(viewRange.getTrimmed());\n // After the range is removed, unbind all view elements from the model.\n // Range inside view document fragment is used to unbind deeply.\n for (const child of conversionApi.writer.createRangeIn(removed).getItems()) {\n conversionApi.mapper.unbindViewElement(child, { defer: true });\n }\n };\n}\n/**\n * Creates a `<span>` {@link module:engine/view/attributeelement~AttributeElement view attribute element} from the information\n * provided by the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor} object. If the priority\n * is not provided in the descriptor, the default priority will be used.\n */\nexport function createViewElementFromHighlightDescriptor(writer, descriptor) {\n const viewElement = writer.createAttributeElement('span', descriptor.attributes);\n if (descriptor.classes) {\n viewElement._addClass(descriptor.classes);\n }\n if (typeof descriptor.priority === 'number') {\n viewElement._priority = descriptor.priority;\n }\n viewElement._id = descriptor.id;\n return viewElement;\n}\n/**\n * Function factory that creates a converter which converts a non-collapsed {@link module:engine/model/selection~Selection model selection}\n * to a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate\n * value from the `consumable` object and maps model positions from the selection to view positions.\n *\n * ```ts\n * modelDispatcher.on( 'selection', convertRangeSelection() );\n * ```\n *\n * @returns Selection converter.\n */\nexport function convertRangeSelection() {\n return (evt, data, conversionApi) => {\n const selection = data.selection;\n if (selection.isCollapsed) {\n return;\n }\n if (!conversionApi.consumable.consume(selection, 'selection')) {\n return;\n }\n const viewRanges = [];\n for (const range of selection.getRanges()) {\n viewRanges.push(conversionApi.mapper.toViewRange(range));\n }\n conversionApi.writer.setSelection(viewRanges, { backward: selection.isBackward });\n };\n}\n/**\n * Function factory that creates a converter which converts a collapsed {@link module:engine/model/selection~Selection model selection} to\n * a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate\n * value from the `consumable` object, maps the model selection position to the view position and breaks\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} at the selection position.\n *\n * ```ts\n * modelDispatcher.on( 'selection', convertCollapsedSelection() );\n * ```\n *\n * An example of the view state before and after converting the collapsed selection:\n *\n * ```\n * <p><strong>f^oo<strong>bar</p>\n * -> <p><strong>f</strong>^<strong>oo</strong>bar</p>\n * ```\n *\n * By breaking attribute elements like `<strong>`, the selection is in a correct element. Then, when the selection attribute is\n * converted, broken attributes might be merged again, or the position where the selection is may be wrapped\n * with different, appropriate attribute elements.\n *\n * See also {@link module:engine/conversion/downcasthelpers~cleanSelection} which does a clean-up\n * by merging attributes.\n *\n * @returns Selection converter.\n */\nexport function convertCollapsedSelection() {\n return (evt, data, conversionApi) => {\n const selection = data.selection;\n if (!selection.isCollapsed) {\n return;\n }\n if (!conversionApi.consumable.consume(selection, 'selection')) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const modelPosition = selection.getFirstPosition();\n const viewPosition = conversionApi.mapper.toViewPosition(modelPosition);\n const brokenPosition = viewWriter.breakAttributes(viewPosition);\n viewWriter.setSelection(brokenPosition);\n };\n}\n/**\n * Function factory that creates a converter which cleans artifacts after the previous\n * {@link module:engine/model/selection~Selection model selection} conversion. It removes all empty\n * {@link module:engine/view/attributeelement~AttributeElement view attribute elements} and merges sibling attributes at all start and end\n * positions of all ranges.\n *\n * ```\n * <p><strong>^</strong></p>\n * -> <p>^</p>\n *\n * <p><strong>foo</strong>^<strong>bar</strong>bar</p>\n * -> <p><strong>foo^bar<strong>bar</p>\n *\n * <p><strong>foo</strong><em>^</em><strong>bar</strong>bar</p>\n * -> <p><strong>foo^bar<strong>bar</p>\n * ```\n *\n * This listener should be assigned before any converter for the new selection:\n *\n * ```ts\n * modelDispatcher.on( 'cleanSelection', cleanSelection() );\n * ```\n *\n * See {@link module:engine/conversion/downcasthelpers~convertCollapsedSelection}\n * which does the opposite by breaking attributes in the selection position.\n *\n * @returns Selection converter.\n */\nexport function cleanSelection() {\n return (evt, data, conversionApi) => {\n const viewWriter = conversionApi.writer;\n const viewSelection = viewWriter.document.selection;\n for (const range of viewSelection.getRanges()) {\n // Not collapsed selection should not have artifacts.\n if (range.isCollapsed) {\n // Position might be in the node removed by the view writer.\n if (range.end.parent.isAttached()) {\n conversionApi.writer.mergeAttributes(range.start);\n }\n }\n }\n viewWriter.setSelection(null);\n };\n}\n/**\n * Function factory that creates a converter which converts the set/change/remove attribute changes from the model to the view.\n * It can also be used to convert selection attributes. In that case, an empty attribute element will be created and the\n * selection will be put inside it.\n *\n * Attributes from the model are converted to a view element that will be wrapping these view nodes that are bound to\n * model elements having the given attribute. This is useful for attributes like `bold` that may be set on text nodes in the model\n * but are represented as an element in the view:\n *\n * ```\n * [paragraph] MODEL ====> VIEW <p>\n * \t|- a {bold: true} |- <b>\n * \t|- b {bold: true} | |- ab\n * \t|- c |- c\n * \t```\n *\n * Passed `Function` will be provided with the attribute value and then all the parameters of the\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute` event}.\n * It is expected that the function returns an {@link module:engine/view/element~Element}.\n * The result of the function will be the wrapping element.\n * When the provided `Function` does not return any element, no conversion will take place.\n *\n * The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n *\n * ```ts\n * modelDispatcher.on( 'attribute:bold', wrap( ( modelAttributeValue, { writer } ) => {\n * \treturn writer.createAttributeElement( 'strong' );\n * } );\n * ```\n *\n * @internal\n * @param elementCreator Function returning a view element that will be used for wrapping.\n * @returns Set/change attribute converter.\n */\nexport function wrap(elementCreator) {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n // Recreate current wrapping node. It will be used to unwrap view range if the attribute value has changed\n // or the attribute was removed.\n const oldViewElement = elementCreator(data.attributeOldValue, conversionApi, data);\n // Create node to wrap with.\n const newViewElement = elementCreator(data.attributeNewValue, conversionApi, data);\n if (!oldViewElement && !newViewElement) {\n return;\n }\n conversionApi.consumable.consume(data.item, evt.name);\n const viewWriter = conversionApi.writer;\n const viewSelection = viewWriter.document.selection;\n if (data.item instanceof ModelSelection || data.item instanceof ModelDocumentSelection) {\n // Selection attribute conversion.\n viewWriter.wrap(viewSelection.getFirstRange(), newViewElement);\n }\n else {\n // Node attribute conversion.\n let viewRange = conversionApi.mapper.toViewRange(data.range);\n // First, unwrap the range from current wrapper.\n if (data.attributeOldValue !== null && oldViewElement) {\n viewRange = viewWriter.unwrap(viewRange, oldViewElement);\n }\n if (data.attributeNewValue !== null && newViewElement) {\n viewWriter.wrap(viewRange, newViewElement);\n }\n }\n };\n}\n/**\n * Function factory that creates a converter which converts node insertion changes from the model to the view.\n * The function passed will be provided with all the parameters of the dispatcher's\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert` event}.\n * It is expected that the function returns an {@link module:engine/view/element~Element}.\n * The result of the function will be inserted into the view.\n *\n * The converter automatically consumes the corresponding value from the consumables list and binds the model and view elements.\n *\n * ```ts\n * downcastDispatcher.on(\n * \t'insert:myElem',\n * \tinsertElement( ( modelItem, { writer } ) => {\n * \t\tconst text = writer.createText( 'myText' );\n * \t\tconst myElem = writer.createElement( 'myElem', { myAttr: 'my-' + modelItem.getAttribute( 'myAttr' ) }, text );\n *\n * \t\t// Do something fancy with `myElem` using `modelItem` or other parameters.\n *\n * \t\treturn myElem;\n * \t}\n * ) );\n * ```\n *\n * @internal\n * @param elementCreator Function returning a view element, which will be inserted.\n * @param consumer Function defining element consumption process.\n * By default this function just consume passed item insertion.\n * @returns Insert element event converter.\n */\nexport function insertElement(elementCreator, consumer = defaultConsumer) {\n return (evt, data, conversionApi) => {\n if (!consumer(data.item, conversionApi.consumable, { preflight: true })) {\n return;\n }\n const viewElement = elementCreator(data.item, conversionApi, data);\n if (!viewElement) {\n return;\n }\n // Consume an element insertion and all present attributes that are specified as a reconversion triggers.\n consumer(data.item, conversionApi.consumable);\n const viewPosition = conversionApi.mapper.toViewPosition(data.range.start);\n conversionApi.mapper.bindElements(data.item, viewElement);\n conversionApi.writer.insert(viewPosition, viewElement);\n // Convert attributes before converting children.\n conversionApi.convertAttributes(data.item);\n // Convert children or reinsert previous view elements.\n reinsertOrConvertNodes(viewElement, data.item.getChildren(), conversionApi, { reconversion: data.reconversion });\n };\n}\n/**\n * Function factory that creates a converter which converts a single model node insertion to a view structure.\n *\n * It is expected that the passed element creator function returns an {@link module:engine/view/element~Element} with attached slots\n * created with `writer.createSlot()` to indicate where child nodes should be converted.\n *\n * @see module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure\n *\n * @internal\n * @param elementCreator Function returning a view structure, which will be inserted.\n * @param consumer A callback that is expected to consume all the consumables\n * that were used by the element creator.\n * @returns Insert element event converter.\n*/\nexport function insertStructure(elementCreator, consumer) {\n return (evt, data, conversionApi) => {\n if (!consumer(data.item, conversionApi.consumable, { preflight: true })) {\n return;\n }\n const slotsMap = new Map();\n conversionApi.writer._registerSlotFactory(createSlotFactory(data.item, slotsMap, conversionApi));\n // View creation.\n const viewElement = elementCreator(data.item, conversionApi, data);\n conversionApi.writer._clearSlotFactory();\n if (!viewElement) {\n return;\n }\n // Check if all children are covered by slots and there is no child that landed in multiple slots.\n validateSlotsChildren(data.item, slotsMap, conversionApi);\n // Consume an element insertion and all present attributes that are specified as a reconversion triggers.\n consumer(data.item, conversionApi.consumable);\n const viewPosition = conversionApi.mapper.toViewPosition(data.range.start);\n conversionApi.mapper.bindElements(data.item, viewElement);\n conversionApi.writer.insert(viewPosition, viewElement);\n // Convert attributes before converting children.\n conversionApi.convertAttributes(data.item);\n // Fill view slots with previous view elements or create new ones.\n fillSlots(viewElement, slotsMap, conversionApi, { reconversion: data.reconversion });\n };\n}\n/**\n * Function factory that creates a converter which converts marker adding change to the\n * {@link module:engine/view/uielement~UIElement view UI element}.\n *\n * The view UI element that will be added to the view depends on the passed parameter. See {@link ~insertElement}.\n * In case of a non-collapsed range, the UI element will not wrap nodes but separate elements will be placed at the beginning\n * and at the end of the range.\n *\n * This converter binds created UI elements with the marker name using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.\n *\n * @internal\n * @param elementCreator A view UI element or a function returning the view element that will be inserted.\n * @returns Insert element event converter.\n */\nexport function insertUIElement(elementCreator) {\n return (evt, data, conversionApi) => {\n // Create two view elements. One will be inserted at the beginning of marker, one at the end.\n // If marker is collapsed, only \"opening\" element will be inserted.\n data.isOpening = true;\n const viewStartElement = elementCreator(data, conversionApi);\n data.isOpening = false;\n const viewEndElement = elementCreator(data, conversionApi);\n if (!viewStartElement || !viewEndElement) {\n return;\n }\n const markerRange = data.markerRange;\n // Marker that is collapsed has consumable build differently that non-collapsed one.\n // For more information see `addMarker` event description.\n // If marker's range is collapsed - check if it can be consumed.\n if (markerRange.isCollapsed && !conversionApi.consumable.consume(markerRange, evt.name)) {\n return;\n }\n // If marker's range is not collapsed - consume all items inside.\n for (const value of markerRange) {\n if (!conversionApi.consumable.consume(value.item, evt.name)) {\n return;\n }\n }\n const mapper = conversionApi.mapper;\n const viewWriter = conversionApi.writer;\n // Add \"opening\" element.\n viewWriter.insert(mapper.toViewPosition(markerRange.start), viewStartElement);\n conversionApi.mapper.bindElementToMarker(viewStartElement, data.markerName);\n // Add \"closing\" element only if range is not collapsed.\n if (!markerRange.isCollapsed) {\n viewWriter.insert(mapper.toViewPosition(markerRange.end), viewEndElement);\n conversionApi.mapper.bindElementToMarker(viewEndElement, data.markerName);\n }\n evt.stop();\n };\n}\n/**\n * Function factory that returns a default downcast converter for removing a {@link module:engine/view/uielement~UIElement UI element}\n * based on marker remove change.\n *\n * This converter unbinds elements from the marker name.\n *\n * @returns Removed UI element converter.\n */\nfunction removeUIElement() {\n return (evt, data, conversionApi) => {\n const elements = conversionApi.mapper.markerNameToElements(data.markerName);\n if (!elements) {\n return;\n }\n for (const element of elements) {\n conversionApi.mapper.unbindElementFromMarkerName(element, data.markerName);\n conversionApi.writer.clear(conversionApi.writer.createRangeOn(element), element);\n }\n conversionApi.writer.clearClonedElementsGroup(data.markerName);\n evt.stop();\n };\n}\n/**\n * Function factory that creates a default converter for model markers.\n *\n * See {@link DowncastHelpers#markerToData} for more information what type of view is generated.\n *\n * This converter binds created UI elements and affected view elements with the marker name\n * using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.\n *\n * @returns Add marker converter.\n */\nfunction insertMarkerData(viewCreator) {\n return (evt, data, conversionApi) => {\n const viewMarkerData = viewCreator(data.markerName, conversionApi);\n if (!viewMarkerData) {\n return;\n }\n const markerRange = data.markerRange;\n if (!conversionApi.consumable.consume(markerRange, evt.name)) {\n return;\n }\n // Adding closing data first to keep the proper order in the view.\n handleMarkerBoundary(markerRange, false, conversionApi, data, viewMarkerData);\n handleMarkerBoundary(markerRange, true, conversionApi, data, viewMarkerData);\n evt.stop();\n };\n}\n/**\n * Helper function for `insertMarkerData()` that marks a marker boundary at the beginning or end of given `range`.\n */\nfunction handleMarkerBoundary(range, isStart, conversionApi, data, viewMarkerData) {\n const modelPosition = isStart ? range.start : range.end;\n const elementAfter = modelPosition.nodeAfter && modelPosition.nodeAfter.is('element') ? modelPosition.nodeAfter : null;\n const elementBefore = modelPosition.nodeBefore && modelPosition.nodeBefore.is('element') ? modelPosition.nodeBefore : null;\n if (elementAfter || elementBefore) {\n let modelElement;\n let isBefore;\n // If possible, we want to add `data-group-start-before` and `data-group-end-after` attributes.\n if (isStart && elementAfter || !isStart && !elementBefore) {\n // [<elementAfter>...</elementAfter> -> <elementAfter data-group-start-before=\"...\">...</elementAfter>\n // <parent>]<elementAfter> -> <parent><elementAfter data-group-end-before=\"...\">\n modelElement = elementAfter;\n isBefore = true;\n }\n else {\n // <elementBefore>...</elementBefore>] -> <elementBefore data-group-end-after=\"...\">...</elementBefore>\n // </elementBefore>[</parent> -> </elementBefore data-group-start-after=\"...\"></parent>\n modelElement = elementBefore;\n isBefore = false;\n }\n const viewElement = conversionApi.mapper.toViewElement(modelElement);\n // In rare circumstances, the model element may be not mapped to any view element and that would cause an error.\n // One of those situations is a soft break inside code block.\n if (viewElement) {\n insertMarkerAsAttribute(viewElement, isStart, isBefore, conversionApi, data, viewMarkerData);\n return;\n }\n }\n const viewPosition = conversionApi.mapper.toViewPosition(modelPosition);\n insertMarkerAsElement(viewPosition, isStart, conversionApi, data, viewMarkerData);\n}\n/**\n * Helper function for `insertMarkerData()` that marks a marker boundary in the view as an attribute on a view element.\n */\nfunction insertMarkerAsAttribute(viewElement, isStart, isBefore, conversionApi, data, viewMarkerData) {\n const attributeName = `data-${viewMarkerData.group}-${isStart ? 'start' : 'end'}-${isBefore ? 'before' : 'after'}`;\n const markerNames = viewElement.hasAttribute(attributeName) ? viewElement.getAttribute(attributeName).split(',') : [];\n // Adding marker name at the beginning to have the same order in the attribute as there is with marker elements.\n markerNames.unshift(viewMarkerData.name);\n conversionApi.writer.setAttribute(attributeName, markerNames.join(','), viewElement);\n conversionApi.mapper.bindElementToMarker(viewElement, data.markerName);\n}\n/**\n * Helper function for `insertMarkerData()` that marks a marker boundary in the view as a separate view ui element.\n */\nfunction insertMarkerAsElement(position, isStart, conversionApi, data, viewMarkerData) {\n const viewElementName = `${viewMarkerData.group}-${isStart ? 'start' : 'end'}`;\n const attrs = viewMarkerData.name ? { 'name': viewMarkerData.name } : null;\n const viewElement = conversionApi.writer.createUIElement(viewElementName, attrs);\n conversionApi.writer.insert(position, viewElement);\n conversionApi.mapper.bindElementToMarker(viewElement, data.markerName);\n}\n/**\n * Function factory that creates a converter for removing a model marker data added by the {@link #insertMarkerData} converter.\n *\n * @returns Remove marker converter.\n */\nfunction removeMarkerData(viewCreator) {\n return (evt, data, conversionApi) => {\n const viewData = viewCreator(data.markerName, conversionApi);\n if (!viewData) {\n return;\n }\n const elements = conversionApi.mapper.markerNameToElements(data.markerName);\n if (!elements) {\n return;\n }\n for (const element of elements) {\n conversionApi.mapper.unbindElementFromMarkerName(element, data.markerName);\n if (element.is('containerElement')) {\n removeMarkerFromAttribute(`data-${viewData.group}-start-before`, element);\n removeMarkerFromAttribute(`data-${viewData.group}-start-after`, element);\n removeMarkerFromAttribute(`data-${viewData.group}-end-before`, element);\n removeMarkerFromAttribute(`data-${viewData.group}-end-after`, element);\n }\n else {\n conversionApi.writer.clear(conversionApi.writer.createRangeOn(element), element);\n }\n }\n conversionApi.writer.clearClonedElementsGroup(data.markerName);\n evt.stop();\n function removeMarkerFromAttribute(attributeName, element) {\n if (element.hasAttribute(attributeName)) {\n const markerNames = new Set(element.getAttribute(attributeName).split(','));\n markerNames.delete(viewData.name);\n if (markerNames.size == 0) {\n conversionApi.writer.removeAttribute(attributeName, element);\n }\n else {\n conversionApi.writer.setAttribute(attributeName, Array.from(markerNames).join(','), element);\n }\n }\n }\n };\n}\n/**\n * Function factory that creates a converter which converts the set/change/remove attribute changes from the model to the view.\n *\n * Attributes from the model are converted to the view element attributes in the view. You may provide a custom function to generate\n * a key-value attribute pair to add/change/remove. If not provided, model attributes will be converted to view element\n * attributes on a one-to-one basis.\n *\n * *Note:** The provided attribute creator should always return the same `key` for a given attribute from the model.\n *\n * The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n *\n * ```ts\n * modelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => {\n * \t// Change attribute key from `customAttr` to `class` in the view.\n * \tconst key = 'class';\n * \tlet value = data.attributeNewValue;\n *\n * \t// Force attribute value to 'empty' if the model element is empty.\n * \tif ( data.item.childCount === 0 ) {\n * \t\tvalue = 'empty';\n * \t}\n *\n * \t// Return the key-value pair.\n * \treturn { key, value };\n * } ) );\n * ```\n *\n * @param attributeCreator Function returning an object with two properties: `key` and `value`, which\n * represent the attribute key and attribute value to be set on a {@link module:engine/view/element~Element view element}.\n * The function is passed the model attribute value as the first parameter and additional data about the change as the second parameter.\n * @returns Set/change attribute converter.\n */\nfunction changeAttribute(attributeCreator) {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n const oldAttribute = attributeCreator(data.attributeOldValue, conversionApi, data);\n const newAttribute = attributeCreator(data.attributeNewValue, conversionApi, data);\n if (!oldAttribute && !newAttribute) {\n return;\n }\n conversionApi.consumable.consume(data.item, evt.name);\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n const viewWriter = conversionApi.writer;\n // If model item cannot be mapped to a view element, it means item is not an `Element` instance but a `TextProxy` node.\n // Only elements can have attributes in a view so do not proceed for anything else (#1587).\n if (!viewElement) {\n /**\n * This error occurs when a {@link module:engine/model/textproxy~TextProxy text node's} attribute is to be downcasted\n * by an {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `Attribute to Attribute converter`}.\n * In most cases it is caused by converters misconfiguration when only \"generic\" converter is defined:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'attribute-name',\n * \tview: 'attribute-name'\n * } ) );\n * ```\n *\n * and given attribute is used on text node, for example:\n *\n * ```ts\n * model.change( writer => {\n * \twriter.insertText( 'Foo', { 'attribute-name': 'bar' }, parent, 0 );\n * } );\n * ```\n *\n * In such cases, to convert the same attribute for both {@link module:engine/model/element~Element}\n * and {@link module:engine/model/textproxy~TextProxy `Text`} nodes, text specific\n * {@link module:engine/conversion/conversion~Conversion#attributeToElement `Attribute to Element converter`}\n * with higher {@link module:utils/priorities~PriorityString priority} must also be defined:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'attribute-name',\n * \t\tname: '$text'\n * \t},\n * \tview: ( value, { writer } ) => {\n * \t\treturn writer.createAttributeElement( 'span', { 'attribute-name': value } );\n * \t},\n * \tconverterPriority: 'high'\n * } ) );\n * ```\n *\n * @error conversion-attribute-to-attribute-on-text\n */\n throw new CKEditorError('conversion-attribute-to-attribute-on-text', conversionApi.dispatcher, data);\n }\n // First remove the old attribute if there was one.\n if (data.attributeOldValue !== null && oldAttribute) {\n if (oldAttribute.key == 'class') {\n const classes = typeof oldAttribute.value == 'string' ? oldAttribute.value.split(/\\s+/) : oldAttribute.value;\n for (const className of classes) {\n viewWriter.removeClass(className, viewElement);\n }\n }\n else if (oldAttribute.key == 'style') {\n if (typeof oldAttribute.value == 'string') {\n const styles = new StylesMap(viewWriter.document.stylesProcessor);\n styles.setTo(oldAttribute.value);\n for (const [key] of styles.getStylesEntries()) {\n viewWriter.removeStyle(key, viewElement);\n }\n }\n else {\n const keys = Object.keys(oldAttribute.value);\n for (const key of keys) {\n viewWriter.removeStyle(key, viewElement);\n }\n }\n }\n else {\n viewWriter.removeAttribute(oldAttribute.key, viewElement);\n }\n }\n // Then set the new attribute.\n if (data.attributeNewValue !== null && newAttribute) {\n if (newAttribute.key == 'class') {\n const classes = typeof newAttribute.value == 'string' ? newAttribute.value.split(/\\s+/) : newAttribute.value;\n for (const className of classes) {\n viewWriter.addClass(className, viewElement);\n }\n }\n else if (newAttribute.key == 'style') {\n if (typeof newAttribute.value == 'string') {\n const styles = new StylesMap(viewWriter.document.stylesProcessor);\n styles.setTo(newAttribute.value);\n for (const [key, value] of styles.getStylesEntries()) {\n viewWriter.setStyle(key, value, viewElement);\n }\n }\n else {\n const keys = Object.keys(newAttribute.value);\n for (const key of keys) {\n viewWriter.setStyle(key, newAttribute.value[key], viewElement);\n }\n }\n }\n else {\n viewWriter.setAttribute(newAttribute.key, newAttribute.value, viewElement);\n }\n }\n };\n}\n/**\n * Function factory that creates a converter which converts the text inside marker's range. The converter wraps the text with\n * {@link module:engine/view/attributeelement~AttributeElement} created from the provided descriptor.\n * See {link module:engine/conversion/downcasthelpers~createViewElementFromHighlightDescriptor}.\n *\n * It can also be used to convert the selection that is inside a marker. In that case, an empty attribute element will be\n * created and the selection will be put inside it.\n *\n * If the highlight descriptor does not provide the `priority` property, `10` will be used.\n *\n * If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n *\n * This converter binds the created {@link module:engine/view/attributeelement~AttributeElement attribute elemens} with the marker name\n * using the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.\n */\nfunction highlightText(highlightDescriptor) {\n return (evt, data, conversionApi) => {\n if (!data.item) {\n return;\n }\n if (!(data.item instanceof ModelSelection || data.item instanceof ModelDocumentSelection) && !data.item.is('$textProxy')) {\n return;\n }\n const descriptor = prepareDescriptor(highlightDescriptor, data, conversionApi);\n if (!descriptor) {\n return;\n }\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewElement = createViewElementFromHighlightDescriptor(viewWriter, descriptor);\n const viewSelection = viewWriter.document.selection;\n if (data.item instanceof ModelSelection || data.item instanceof ModelDocumentSelection) {\n viewWriter.wrap(viewSelection.getFirstRange(), viewElement);\n }\n else {\n const viewRange = conversionApi.mapper.toViewRange(data.range);\n const rangeAfterWrap = viewWriter.wrap(viewRange, viewElement);\n for (const element of rangeAfterWrap.getItems()) {\n if (element.is('attributeElement') && element.isSimilar(viewElement)) {\n conversionApi.mapper.bindElementToMarker(element, data.markerName);\n // One attribute element is enough, because all of them are bound together by the view writer.\n // Mapper uses this binding to get all the elements no matter how many of them are registered in the mapper.\n break;\n }\n }\n }\n };\n}\n/**\n * Converter function factory. It creates a function which applies the marker's highlight to an element inside the marker's range.\n *\n * The converter checks if an element has the `addHighlight` function stored as a\n * {@link module:engine/view/element~Element#_setCustomProperty custom property} and, if so, uses it to apply the highlight.\n * In such case the converter will consume all element's children, assuming that they were handled by the element itself.\n *\n * When the `addHighlight` custom property is not present, the element is not converted in any special way.\n * This means that converters will proceed to convert the element's child nodes.\n *\n * If the highlight descriptor does not provide the `priority` property, `10` will be used.\n *\n * If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n *\n * This converter binds altered {@link module:engine/view/containerelement~ContainerElement container elements} with the marker name using\n * the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.\n */\nfunction highlightElement(highlightDescriptor) {\n return (evt, data, conversionApi) => {\n if (!data.item) {\n return;\n }\n if (!(data.item instanceof ModelElement)) {\n return;\n }\n const descriptor = prepareDescriptor(highlightDescriptor, data, conversionApi);\n if (!descriptor) {\n return;\n }\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n if (viewElement && viewElement.getCustomProperty('addHighlight')) {\n // Consume element itself.\n conversionApi.consumable.consume(data.item, evt.name);\n // Consume all children nodes.\n for (const value of ModelRange._createIn(data.item)) {\n conversionApi.consumable.consume(value.item, evt.name);\n }\n const addHighlightCallback = viewElement.getCustomProperty('addHighlight');\n addHighlightCallback(viewElement, descriptor, conversionApi.writer);\n conversionApi.mapper.bindElementToMarker(viewElement, data.markerName);\n }\n };\n}\n/**\n * Function factory that creates a converter which converts the removing model marker to the view.\n *\n * Both text nodes and elements are handled by this converter but they are handled a bit differently.\n *\n * Text nodes are unwrapped using the {@link module:engine/view/attributeelement~AttributeElement attribute element} created from the\n * provided highlight descriptor. See {link module:engine/conversion/downcasthelpers~HighlightDescriptor}.\n *\n * For elements, the converter checks if an element has the `removeHighlight` function stored as a\n * {@link module:engine/view/element~Element#_setCustomProperty custom property}. If so, it uses it to remove the highlight.\n * In such case, the children of that element will not be converted.\n *\n * When `removeHighlight` is not present, the element is not converted in any special way.\n * The converter will proceed to convert the element's child nodes instead.\n *\n * If the highlight descriptor does not provide the `priority` property, `10` will be used.\n *\n * If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n *\n * This converter unbinds elements from the marker name.\n */\nfunction removeHighlight(highlightDescriptor) {\n return (evt, data, conversionApi) => {\n // This conversion makes sense only for non-collapsed range.\n if (data.markerRange.isCollapsed) {\n return;\n }\n const descriptor = prepareDescriptor(highlightDescriptor, data, conversionApi);\n if (!descriptor) {\n return;\n }\n // View element that will be used to unwrap `AttributeElement`s.\n const viewHighlightElement = createViewElementFromHighlightDescriptor(conversionApi.writer, descriptor);\n // Get all elements bound with given marker name.\n const elements = conversionApi.mapper.markerNameToElements(data.markerName);\n if (!elements) {\n return;\n }\n for (const element of elements) {\n conversionApi.mapper.unbindElementFromMarkerName(element, data.markerName);\n if (element.is('attributeElement')) {\n conversionApi.writer.unwrap(conversionApi.writer.createRangeOn(element), viewHighlightElement);\n }\n else {\n // if element.is( 'containerElement' ).\n const removeHighlightCallback = element.getCustomProperty('removeHighlight');\n removeHighlightCallback(element, descriptor.id, conversionApi.writer);\n }\n }\n conversionApi.writer.clearClonedElementsGroup(data.markerName);\n evt.stop();\n };\n}\n/**\n * Model element to view element conversion helper.\n *\n * See {@link ~DowncastHelpers#elementToElement `.elementToElement()` downcast helper} for examples and config params description.\n *\n * @param config Conversion configuration.\n * @param config.model The description or a name of the model element to convert.\n * @param config.model.attributes List of attributes triggering element reconversion.\n * @param config.model.children Should reconvert element if the list of model child nodes changed.\n * @returns Conversion helper.\n */\nfunction downcastElementToElement(config) {\n const model = normalizeModelElementConfig(config.model);\n const view = normalizeToElementConfig(config.view, 'container');\n // Trigger reconversion on children list change if element is a subject to any reconversion.\n // This is required to be able to trigger Differ#refreshItem() on a direct child of the reconverted element.\n if (model.attributes.length) {\n model.children = true;\n }\n return (dispatcher) => {\n dispatcher.on(`insert:${model.name}`, insertElement(view, createConsumer(model)), { priority: config.converterPriority || 'normal' });\n if (model.children || model.attributes.length) {\n dispatcher.on('reduceChanges', createChangeReducer(model), { priority: 'low' });\n }\n };\n}\n/**\n * Model element to view structure conversion helper.\n *\n * See {@link ~DowncastHelpers#elementToStructure `.elementToStructure()` downcast helper} for examples and config params description.\n *\n * @param config Conversion configuration.\n * @returns Conversion helper.\n */\nfunction downcastElementToStructure(config) {\n const model = normalizeModelElementConfig(config.model);\n const view = normalizeToElementConfig(config.view, 'container');\n // Trigger reconversion on children list change because it always needs to use slots to put children in proper places.\n // This is required to be able to trigger Differ#refreshItem() on a direct child of the reconverted element.\n model.children = true;\n return (dispatcher) => {\n if (dispatcher._conversionApi.schema.checkChild(model.name, '$text')) {\n /**\n * This error occurs when a {@link module:engine/model/element~Element model element} is downcasted\n * via {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure} helper but the element was\n * allowed to host `$text` by the {@link module:engine/model/schema~Schema model schema}.\n *\n * For instance, this may be the result of `myElement` allowing the content of\n * {@glink framework/deep-dive/schema#generic-items `$block`} in its schema definition:\n *\n * ```ts\n * // Element definition in schema.\n * schema.register( 'myElement', {\n * \tallowContentOf: '$block',\n *\n * \t// ...\n * } );\n *\n * // ...\n *\n * // Conversion of myElement with the use of elementToStructure().\n * editor.conversion.for( 'downcast' ).elementToStructure( {\n * \tmodel: 'myElement',\n * \tview: ( modelElement, { writer } ) => {\n * \t\t// ...\n * \t}\n * } );\n * ```\n *\n * In such case, {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} helper\n * can be used instead to get around this problem:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'myElement',\n * \tview: ( modelElement, { writer } ) => {\n * \t\t// ...\n * \t}\n * } );\n * ```\n *\n * @error conversion-element-to-structure-disallowed-text\n * @param {String} elementName The name of the element the structure is to be created for.\n */\n throw new CKEditorError('conversion-element-to-structure-disallowed-text', dispatcher, { elementName: model.name });\n }\n dispatcher.on(`insert:${model.name}`, insertStructure(view, createConsumer(model)), { priority: config.converterPriority || 'normal' });\n dispatcher.on('reduceChanges', createChangeReducer(model), { priority: 'low' });\n };\n}\n/**\n * Model attribute to view element conversion helper.\n *\n * See {@link ~DowncastHelpers#attributeToElement `.attributeToElement()` downcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array\n * of `String`s with possible values if the model attribute is an enumerable.\n * @param config.view A view element definition or a function that takes the model attribute value and\n * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} as parameters and returns a view attribute element.\n * If `config.model.values` is given, `config.view` should be an object assigning values from `config.model.values` to view element\n * definitions or functions.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction downcastAttributeToElement(config) {\n config = cloneDeep(config);\n let model = config.model;\n if (typeof model == 'string') {\n model = { key: model };\n }\n let eventName = `attribute:${model.key}`;\n if (model.name) {\n eventName += ':' + model.name;\n }\n if (model.values) {\n for (const modelValue of model.values) {\n config.view[modelValue] = normalizeToElementConfig(config.view[modelValue], 'attribute');\n }\n }\n else {\n config.view = normalizeToElementConfig(config.view, 'attribute');\n }\n const elementCreator = getFromAttributeCreator(config);\n return (dispatcher) => {\n dispatcher.on(eventName, wrap(elementCreator), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Model attribute to view attribute conversion helper.\n *\n * See {@link ~DowncastHelpers#attributeToAttribute `.attributeToAttribute()` downcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing\n * the attribute key, possible values and, optionally, an element name to convert from.\n * @param config.view A view attribute key, or a `{ key, value }` object or a function that takes the model attribute value and returns\n * a `{ key, value }` object.\n * If `key` is `'class'`, `value` can be a `String` or an array of `String`s. If `key` is `'style'`, `value` is an object with\n * key-value pairs. In other cases, `value` is a `String`.\n * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to\n * `{ key, value }` objects or a functions.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction downcastAttributeToAttribute(config) {\n config = cloneDeep(config);\n let model = config.model;\n if (typeof model == 'string') {\n model = { key: model };\n }\n let eventName = `attribute:${model.key}`;\n if (model.name) {\n eventName += ':' + model.name;\n }\n if (model.values) {\n for (const modelValue of model.values) {\n config.view[modelValue] = normalizeToAttributeConfig(config.view[modelValue]);\n }\n }\n else {\n config.view = normalizeToAttributeConfig(config.view);\n }\n const elementCreator = getFromAttributeCreator(config);\n return (dispatcher) => {\n dispatcher.on(eventName, changeAttribute(elementCreator), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Model marker to view element conversion helper.\n *\n * See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or model marker group) to convert.\n * @param config.view A view element definition or a function that takes the model marker data as a parameter and returns a view UI element.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction downcastMarkerToElement(config) {\n const view = normalizeToElementConfig(config.view, 'ui');\n return (dispatcher) => {\n dispatcher.on(`addMarker:${config.model}`, insertUIElement(view), { priority: config.converterPriority || 'normal' });\n dispatcher.on(`removeMarker:${config.model}`, removeUIElement(), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Model marker to view data conversion helper.\n *\n * See {@link ~DowncastHelpers#markerToData `markerToData()` downcast helper} to learn more.\n *\n * @returns Conversion helper.\n */\nfunction downcastMarkerToData(config) {\n config = cloneDeep(config);\n const group = config.model;\n let view = config.view;\n // Default conversion.\n if (!view) {\n view = markerName => ({\n group,\n name: markerName.substr(config.model.length + 1)\n });\n }\n return (dispatcher) => {\n dispatcher.on(`addMarker:${group}`, insertMarkerData(view), { priority: config.converterPriority || 'normal' });\n dispatcher.on(`removeMarker:${group}`, removeMarkerData(view), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Model marker to highlight conversion helper.\n *\n * See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or model marker group) to convert.\n * @param config.view A highlight descriptor that will be used for highlighting or a function that takes\n * the model marker data as a parameter and returns a highlight descriptor.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction downcastMarkerToHighlight(config) {\n return (dispatcher) => {\n dispatcher.on(`addMarker:${config.model}`, highlightText(config.view), { priority: config.converterPriority || 'normal' });\n dispatcher.on(`addMarker:${config.model}`, highlightElement(config.view), { priority: config.converterPriority || 'normal' });\n dispatcher.on(`removeMarker:${config.model}`, removeHighlight(config.view), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Takes `config.model`, and converts it to an object with normalized structure.\n *\n * @param model Model configuration or element name.\n */\nfunction normalizeModelElementConfig(model) {\n if (typeof model == 'string') {\n model = { name: model };\n }\n return {\n name: model.name,\n attributes: model.attributes ? toArray(model.attributes) : [],\n children: !!model.children\n };\n}\n/**\n * Takes `config.view`, and if it is an {@link module:engine/view/elementdefinition~ElementDefinition}, converts it\n * to a function (because lower level converters accept only element creator functions).\n *\n * @param view View configuration.\n * @param viewElementType View element type to create.\n * @returns Element creator function to use in lower level converters.\n */\nfunction normalizeToElementConfig(view, viewElementType) {\n if (typeof view == 'function') {\n // If `view` is already a function, don't do anything.\n return view;\n }\n return ((modelData, conversionApi) => createViewElementFromDefinition(view, conversionApi, viewElementType));\n}\n/**\n * Creates a view element instance from the provided {@link module:engine/view/elementdefinition~ElementDefinition} and class.\n */\nfunction createViewElementFromDefinition(viewElementDefinition, conversionApi, viewElementType) {\n if (typeof viewElementDefinition == 'string') {\n // If `viewElementDefinition` is given as a `String`, normalize it to an object with `name` property.\n viewElementDefinition = { name: viewElementDefinition };\n }\n let element;\n const viewWriter = conversionApi.writer;\n const attributes = Object.assign({}, viewElementDefinition.attributes);\n if (viewElementType == 'container') {\n element = viewWriter.createContainerElement(viewElementDefinition.name, attributes);\n }\n else if (viewElementType == 'attribute') {\n const options = {\n priority: viewElementDefinition.priority || ViewAttributeElement.DEFAULT_PRIORITY\n };\n element = viewWriter.createAttributeElement(viewElementDefinition.name, attributes, options);\n }\n else {\n // 'ui'.\n element = viewWriter.createUIElement(viewElementDefinition.name, attributes);\n }\n if (viewElementDefinition.styles) {\n const keys = Object.keys(viewElementDefinition.styles);\n for (const key of keys) {\n viewWriter.setStyle(key, viewElementDefinition.styles[key], element);\n }\n }\n if (viewElementDefinition.classes) {\n const classes = viewElementDefinition.classes;\n if (typeof classes == 'string') {\n viewWriter.addClass(classes, element);\n }\n else {\n for (const className of classes) {\n viewWriter.addClass(className, element);\n }\n }\n }\n return element;\n}\nfunction getFromAttributeCreator(config) {\n if (config.model.values) {\n return ((modelAttributeValue, conversionApi, data) => {\n const view = config.view[modelAttributeValue];\n if (view) {\n return view(modelAttributeValue, conversionApi, data);\n }\n return null;\n });\n }\n else {\n return config.view;\n }\n}\n/**\n * Takes the configuration, adds default parameters if they do not exist and normalizes other parameters to be used in downcast converters\n * for generating a view attribute.\n *\n * @param view View configuration.\n */\nfunction normalizeToAttributeConfig(view) {\n if (typeof view == 'string') {\n return modelAttributeValue => ({ key: view, value: modelAttributeValue });\n }\n else if (typeof view == 'object') {\n // { key, value, ... }\n if (view.value) {\n return () => view;\n }\n // { key, ... }\n else {\n return modelAttributeValue => ({ key: view.key, value: modelAttributeValue });\n }\n }\n else {\n // function.\n return view;\n }\n}\n/**\n * Helper function for `highlight`. Prepares the actual descriptor object using value passed to the converter.\n */\nfunction prepareDescriptor(highlightDescriptor, data, conversionApi) {\n // If passed descriptor is a creator function, call it. If not, just use passed value.\n const descriptor = typeof highlightDescriptor == 'function' ?\n highlightDescriptor(data, conversionApi) :\n highlightDescriptor;\n if (!descriptor) {\n return null;\n }\n // Apply default descriptor priority.\n if (!descriptor.priority) {\n descriptor.priority = 10;\n }\n // Default descriptor id is marker name.\n if (!descriptor.id) {\n descriptor.id = data.markerName;\n }\n return descriptor;\n}\n/**\n * Creates a function that checks a single differ diff item whether it should trigger reconversion.\n *\n * @param model A normalized `config.model` converter configuration.\n * @param model.name The name of element.\n * @param model.attributes The list of attribute names that should trigger reconversion.\n * @param model.children Whether the child list change should trigger reconversion.\n */\nfunction createChangeReducerCallback(model) {\n return (node, change) => {\n if (!node.is('element', model.name)) {\n return false;\n }\n if (change.type == 'attribute') {\n if (model.attributes.includes(change.attributeKey)) {\n return true;\n }\n }\n else {\n /* istanbul ignore else: This is always true because otherwise it would not register a reducer callback. -- @preserve */\n if (model.children) {\n return true;\n }\n }\n return false;\n };\n}\n/**\n * Creates a `reduceChanges` event handler for reconversion.\n *\n * @param model A normalized `config.model` converter configuration.\n * @param model.name The name of element.\n * @param model.attributes The list of attribute names that should trigger reconversion.\n * @param model.children Whether the child list change should trigger reconversion.\n */\nfunction createChangeReducer(model) {\n const shouldReplace = createChangeReducerCallback(model);\n return (evt, data) => {\n const reducedChanges = [];\n if (!data.reconvertedElements) {\n data.reconvertedElements = new Set();\n }\n for (const change of data.changes) {\n // For attribute use node affected by the change.\n // For insert or remove use parent element because we need to check if it's added/removed child.\n const node = change.type == 'attribute' ? change.range.start.nodeAfter : change.position.parent;\n if (!node || !shouldReplace(node, change)) {\n reducedChanges.push(change);\n continue;\n }\n // If it's already marked for reconversion, so skip this change, otherwise add the diff items.\n if (!data.reconvertedElements.has(node)) {\n data.reconvertedElements.add(node);\n const position = ModelPosition._createBefore(node);\n let changeIndex = reducedChanges.length;\n // We need to insert remove+reinsert before any other change on and inside the re-converted element.\n // This is important because otherwise we would remove element that had already been modified by the previous change.\n // Note that there could be some element removed before the re-converted element, so we must not break this behavior.\n for (let i = reducedChanges.length - 1; i >= 0; i--) {\n const change = reducedChanges[i];\n const changePosition = change.type == 'attribute' ? change.range.start : change.position;\n const positionRelation = changePosition.compareWith(position);\n if (positionRelation == 'before' || change.type == 'remove' && positionRelation == 'same') {\n break;\n }\n changeIndex = i;\n }\n reducedChanges.splice(changeIndex, 0, {\n type: 'remove',\n name: node.name,\n position,\n length: 1\n }, {\n type: 'reinsert',\n name: node.name,\n position,\n length: 1\n });\n }\n }\n data.changes = reducedChanges;\n };\n}\n/**\n * Creates a function that checks if an element and its watched attributes can be consumed and consumes them.\n *\n * @param model A normalized `config.model` converter configuration.\n * @param model.name The name of element.\n * @param model.attributes The list of attribute names that should trigger reconversion.\n * @param model.children Whether the child list change should trigger reconversion.\n */\nfunction createConsumer(model) {\n return (node, consumable, options = {}) => {\n const events = ['insert'];\n // Collect all set attributes that are triggering conversion.\n for (const attributeName of model.attributes) {\n if (node.hasAttribute(attributeName)) {\n events.push(`attribute:${attributeName}`);\n }\n }\n if (!events.every(event => consumable.test(node, event))) {\n return false;\n }\n if (!options.preflight) {\n events.forEach(event => consumable.consume(node, event));\n }\n return true;\n };\n}\n/**\n * Creates a function that create view slots.\n *\n * @returns Function exposed by writer as createSlot().\n */\nfunction createSlotFactory(element, slotsMap, conversionApi) {\n return (writer, modeOrFilter) => {\n const slot = writer.createContainerElement('$slot');\n let children = null;\n if (modeOrFilter === 'children') {\n children = Array.from(element.getChildren());\n }\n else if (typeof modeOrFilter == 'function') {\n children = Array.from(element.getChildren()).filter(element => modeOrFilter(element));\n }\n else {\n /**\n * Unknown slot mode was provided to `writer.createSlot()` in downcast converter.\n *\n * @error conversion-slot-mode-unknown\n */\n throw new CKEditorError('conversion-slot-mode-unknown', conversionApi.dispatcher, { modeOrFilter });\n }\n slotsMap.set(slot, children);\n return slot;\n };\n}\n/**\n * Checks if all children are covered by slots and there is no child that landed in multiple slots.\n */\nfunction validateSlotsChildren(element, slotsMap, conversionApi) {\n const childrenInSlots = Array.from(slotsMap.values()).flat();\n const uniqueChildrenInSlots = new Set(childrenInSlots);\n if (uniqueChildrenInSlots.size != childrenInSlots.length) {\n /**\n * Filters provided to `writer.createSlot()` overlap (at least two filters accept the same child element).\n *\n * @error conversion-slot-filter-overlap\n * @param {module:engine/model/element~Element} element The element of which children would not be properly\n * allocated to multiple slots.\n */\n throw new CKEditorError('conversion-slot-filter-overlap', conversionApi.dispatcher, { element });\n }\n if (uniqueChildrenInSlots.size != element.childCount) {\n /**\n * Filters provided to `writer.createSlot()` are incomplete and exclude at least one children element (one of\n * the children elements would not be assigned to any of the slots).\n *\n * @error conversion-slot-filter-incomplete\n * @param {module:engine/model/element~Element} element The element of which children would not be properly\n * allocated to multiple slots.\n */\n throw new CKEditorError('conversion-slot-filter-incomplete', conversionApi.dispatcher, { element });\n }\n}\n/**\n * Fill slots with appropriate view elements.\n */\nfunction fillSlots(viewElement, slotsMap, conversionApi, options) {\n // Set temporary position mapping to redirect child view elements into a proper slots.\n conversionApi.mapper.on('modelToViewPosition', toViewPositionMapping, { priority: 'highest' });\n let currentSlot = null;\n let currentSlotNodes = null;\n // Fill slots with nested view nodes.\n for ([currentSlot, currentSlotNodes] of slotsMap) {\n reinsertOrConvertNodes(viewElement, currentSlotNodes, conversionApi, options);\n conversionApi.writer.move(conversionApi.writer.createRangeIn(currentSlot), conversionApi.writer.createPositionBefore(currentSlot));\n conversionApi.writer.remove(currentSlot);\n }\n conversionApi.mapper.off('modelToViewPosition', toViewPositionMapping);\n function toViewPositionMapping(evt, data) {\n const element = data.modelPosition.nodeAfter;\n // Find the proper offset within the slot.\n const index = currentSlotNodes.indexOf(element);\n if (index < 0) {\n return;\n }\n data.viewPosition = data.mapper.findPositionIn(currentSlot, index);\n }\n}\n/**\n * Inserts view representation of `nodes` into the `viewElement` either by bringing back just removed view nodes\n * or by triggering conversion for them.\n */\nfunction reinsertOrConvertNodes(viewElement, modelNodes, conversionApi, options) {\n // Fill with nested view nodes.\n for (const modelChildNode of modelNodes) {\n // Try reinserting the view node for the specified model node...\n if (!reinsertNode(viewElement.root, modelChildNode, conversionApi, options)) {\n // ...or else convert the model element to the view.\n conversionApi.convertItem(modelChildNode);\n }\n }\n}\n/**\n * Checks if the view for the given model element could be reused and reinserts it to the view.\n *\n * @returns `false` if view element can't be reused.\n */\nfunction reinsertNode(viewRoot, modelNode, conversionApi, options) {\n const { writer, mapper } = conversionApi;\n // Don't reinsert if this is not a reconversion...\n if (!options.reconversion) {\n return false;\n }\n const viewChildNode = mapper.toViewElement(modelNode);\n // ...or there is no view to reinsert or it was already inserted to the view structure...\n if (!viewChildNode || viewChildNode.root == viewRoot) {\n return false;\n }\n // ...or it was strictly marked as not to be reused.\n if (!conversionApi.canReuseView(viewChildNode)) {\n return false;\n }\n // Otherwise reinsert the view node.\n writer.move(writer.createRangeOn(viewChildNode), mapper.toViewPosition(ModelPosition._createBefore(modelNode)));\n return true;\n}\n/**\n * The default consumer for insert events.\n *\n * @param item Model item.\n * @param consumable The model consumable.\n * @param options.preflight Whether should consume or just check if can be consumed.\n */\nfunction defaultConsumer(item, consumable, { preflight } = {}) {\n if (preflight) {\n return consumable.test(item, 'insert');\n }\n else {\n return consumable.consume(item, 'insert');\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/autoparagraphing\n */\n/**\n * Fixes all empty roots.\n *\n * @internal\n * @param writer The model writer.\n * @returns `true` if any change has been applied, `false` otherwise.\n */\nexport function autoParagraphEmptyRoots(writer) {\n const { schema, document } = writer.model;\n for (const root of document.getRoots()) {\n if (root.isEmpty && !schema.checkChild(root, '$text')) {\n // If paragraph element is allowed in the root, create paragraph element.\n if (schema.checkChild(root, 'paragraph')) {\n writer.insertElement('paragraph', root);\n // Other roots will get fixed in the next post-fixer round. Those will be triggered\n // in the same batch no matter if this method was triggered by the post-fixing or not\n // (the above insertElement call will trigger the post-fixers).\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.\n *\n * @internal\n * @param position The position at which to check.\n * @param nodeOrType The child node or child type to check.\n * @param schema A schema instance used for element validation.\n */\nexport function isParagraphable(position, nodeOrType, schema) {\n const context = schema.createContext(position);\n // When paragraph is allowed in this context...\n if (!schema.checkChild(context, 'paragraph')) {\n return false;\n }\n // And a node would be allowed in this paragraph...\n if (!schema.checkChild(context.push('paragraph'), nodeOrType)) {\n return false;\n }\n return true;\n}\n/**\n * Inserts a new paragraph at the given position and returns a position inside that paragraph.\n *\n * @internal\n * @param position The position where a paragraph should be inserted.\n * @param writer The model writer.\n * @returns Position inside the created paragraph.\n */\nexport function wrapInParagraph(position, writer) {\n const paragraph = writer.createElement('paragraph');\n writer.insert(paragraph, position);\n return writer.createPositionAt(paragraph, 0);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport Matcher from '../view/matcher.js';\nimport ConversionHelpers from './conversionhelpers.js';\nimport { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing.js';\nimport { priorities } from '@ckeditor/ckeditor5-utils';\nimport { cloneDeep } from 'lodash-es';\n/**\n * Contains the {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for\n * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.\n *\n * @module engine/conversion/upcasthelpers\n */\n/**\n * Upcast conversion helper functions.\n *\n * Learn more about {@glink framework/deep-dive/conversion/upcast upcast helpers}.\n *\n * @extends module:engine/conversion/conversionhelpers~ConversionHelpers\n */\nexport default class UpcastHelpers extends ConversionHelpers {\n /**\n * View element to model element conversion helper.\n *\n * This conversion results in creating a model element. For example,\n * view `<p>Foo</p>` becomes `<paragraph>Foo</paragraph>` in the model.\n *\n * Keep in mind that the element will be inserted only if it is allowed\n * by {@link module:engine/model/schema~Schema schema} configuration.\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).elementToElement( {\n * \tview: 'p',\n * \tmodel: 'paragraph'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToElement( {\n * \tview: 'p',\n * \tmodel: 'paragraph',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToElement( {\n * \tview: {\n * \t\tname: 'p',\n * \t\tclasses: 'fancy'\n * \t},\n * \tmodel: 'fancyParagraph'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToElement( {\n * \tview: {\n * \t\tname: 'p',\n * \t\tclasses: 'heading'\n * \t},\n * \tmodel: ( viewElement, conversionApi ) => {\n * \t\tconst modelWriter = conversionApi.writer;\n *\n * \t\treturn modelWriter.createElement( 'heading', { level: viewElement.getAttribute( 'data-level' ) } );\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted. If not set, the converter\n * will fire for every view element.\n * @param config.model Name of the model element, a model element instance or a function that takes a view element\n * and {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API}\n * and returns a model element. The model element will be inserted in the model.\n * @param config.converterPriority Converter priority.\n */\n elementToElement(config) {\n return this.add(upcastElementToElement(config));\n }\n /**\n * View element to model attribute conversion helper.\n *\n * This conversion results in setting an attribute on a model node. For example, view `<strong>Foo</strong>` becomes\n * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.\n *\n * This helper is meant to set a model attribute on all the elements that are inside the converted element:\n *\n * ```\n * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold=\"true\">Foo</$text></paragraph>\n * ```\n *\n * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).\n * Even though `<strong>` is over `<p>` element, `bold=\"true\"` was added to the text. See\n * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.\n *\n * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: 'strong',\n * \tmodel: 'bold'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: 'strong',\n * \tmodel: 'bold',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: {\n * \t\tname: 'span',\n * \t\tclasses: 'bold'\n * \t},\n * \tmodel: 'bold'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: {\n * \t\tname: 'span',\n * \t\tclasses: [ 'styled', 'styled-dark' ]\n * \t},\n * \tmodel: {\n * \t\tkey: 'styled',\n * \t\tvalue: 'dark'\n * \t}\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: {\n * \t\tname: 'span',\n * \t\tstyles: {\n * \t\t\t'font-size': /[\\s\\S]+/\n * \t\t}\n * \t},\n * \tmodel: {\n * \t\tkey: 'fontSize',\n * \t\tvalue: ( viewElement, conversionApi ) => {\n * \t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n * \t\t\tconst value = fontSize.substr( 0, fontSize.length - 2 );\n *\n * \t\t\tif ( value <= 10 ) {\n * \t\t\t\treturn 'small';\n * \t\t\t} else if ( value > 12 ) {\n * \t\t\t\treturn 'big';\n * \t\t\t}\n *\n * \t\t\treturn null;\n * \t\t}\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted.\n * @param config.model Model attribute key or an object with `key` and `value` properties, describing\n * the model attribute. `value` property may be set as a function that takes a view element and\n * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.\n * If `String` is given, the model attribute value will be set to `true`.\n * @param config.converterPriority Converter priority. Defaults to `low`.\n */\n elementToAttribute(config) {\n return this.add(upcastElementToAttribute(config));\n }\n /**\n * View attribute to model attribute conversion helper.\n *\n * This conversion results in setting an attribute on a model node. For example, view `<img src=\"foo.jpg\"></img>` becomes\n * `<imageBlock source=\"foo.jpg\"></imageBlock>` in the model.\n *\n * This helper is meant to convert view attributes from view elements which got converted to the model, so the view attribute\n * is set only on the corresponding model node:\n *\n * ```\n * <div class=\"dark\"><div>foo</div></div> --> <div dark=\"true\"><div>foo</div></div>\n * ```\n *\n * Above, `class=\"dark\"` attribute is added only to the `<div>` elements that has it. This is in contrast to\n * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute} which sets attributes for\n * all the children in the model:\n *\n * ```\n * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold=\"true\">Foo</$text></paragraph>\n * ```\n *\n * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).\n * Even though `<strong>` is over `<p>` element, `bold=\"true\"` was added to the text.\n *\n * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: 'src',\n * \tmodel: 'source'\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: { key: 'src' },\n * \tmodel: 'source'\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: { key: 'src' },\n * \tmodel: 'source',\n * \tconverterPriority: 'normal'\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tkey: 'data-style',\n * \t\tvalue: /[\\s\\S]+/\n * \t},\n * \tmodel: 'styled'\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tname: 'img',\n * \t\tkey: 'class',\n * \t\tvalue: 'styled-dark'\n * \t},\n * \tmodel: {\n * \t\tkey: 'styled',\n * \t\tvalue: 'dark'\n * \t}\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tkey: 'class',\n * \t\tvalue: /styled-[\\S]+/\n * \t},\n * \tmodel: {\n * \t\tkey: 'styled'\n * \t\tvalue: ( viewElement, conversionApi ) => {\n * \t\t\tconst regexp = /styled-([\\S]+)/;\n * \t\t\tconst match = viewElement.getAttribute( 'class' ).match( regexp );\n *\n * \t\t\treturn match[ 1 ];\n * \t\t}\n * \t}\n * } );\n * ```\n *\n * Converting styles works a bit differently as it requires `view.styles` to be an object and by default\n * a model attribute will be set to `true` by such a converter. You can set the model attribute to any value by providing the `value`\n * callback that returns the desired value.\n *\n * ```ts\n * // Default conversion of font-weight style will result in setting bold attribute to true.\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tstyles: {\n * \t\t\t'font-weight': 'bold'\n * \t\t}\n * \t},\n * \tmodel: 'bold'\n * } );\n *\n * // This converter will pass any style value to the `lineHeight` model attribute.\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tstyles: {\n * \t\t\t'line-height': /[\\s\\S]+/\n * \t\t}\n * \t},\n * \tmodel: {\n * \t\tkey: 'lineHeight',\n * \t\tvalue: ( viewElement, conversionApi ) => viewElement.getStyle( 'line-height' )\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view Specifies which view attribute will be converted. If a `String` is passed,\n * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,\n * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`\n * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,\n * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.\n * @param config.model Model attribute key or an object with `key` and `value` properties, describing\n * the model attribute. `value` property may be set as a function that takes a view element and\n * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.\n * If `String` is given, the model attribute value will be same as view attribute value.\n * @param config.converterPriority Converter priority. Defaults to `low`.\n */\n attributeToAttribute(config) {\n return this.add(upcastAttributeToAttribute(config));\n }\n /**\n * View element to model marker conversion helper.\n *\n * This conversion results in creating a model marker. For example, if the marker was stored in a view as an element:\n * `<p>Fo<span data-marker=\"comment\" data-comment-id=\"7\"></span>o</p><p>B<span data-marker=\"comment\" data-comment-id=\"7\"></span>ar</p>`,\n * after the conversion is done, the marker will be available in\n * {@link module:engine/model/model~Model#markers model document markers}.\n *\n * **Note**: When this helper is used in the data upcast in combination with\n * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} in the data downcast,\n * then invalid HTML code (e.g. a span between table cells) may be produced by the latter converter.\n *\n * In most of the cases, the {@link #dataToMarker} should be used instead.\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).elementToMarker( {\n * \tview: 'marker-search',\n * \tmodel: 'search'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToMarker( {\n * \tview: 'marker-search',\n * \tmodel: 'search',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToMarker( {\n * \tview: 'marker-search',\n * \tmodel: ( viewElement, conversionApi ) => 'comment:' + viewElement.getAttribute( 'data-comment-id' )\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToMarker( {\n * \tview: {\n * \t\tname: 'span',\n * \t\tattributes: {\n * \t\t\t'data-marker': 'search'\n * \t\t}\n * \t},\n * \tmodel: 'search'\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted.\n * @param config.model Name of the model marker, or a function that takes a view element and returns\n * a model marker name.\n * @param config.converterPriority Converter priority.\n */\n elementToMarker(config) {\n return this.add(upcastElementToMarker(config));\n }\n /**\n * View-to-model marker conversion helper.\n *\n * Converts view data created by {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`}\n * back to a model marker.\n *\n * This converter looks for specific view elements and view attributes that mark marker boundaries. See\n * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} to learn what view data\n * is expected by this converter.\n *\n * The `config.view` property is equal to the marker group name to convert.\n *\n * By default, this converter creates markers with the `group:name` name convention (to match the default `markerToData` conversion).\n *\n * The conversion configuration can take a function that will generate a marker name.\n * If such function is set as the `config.model` parameter, it is passed the `name` part from the view element or attribute and it is\n * expected to return a string with the marker name.\n *\n * Basic usage:\n *\n * ```ts\n * // Using the default conversion.\n * // In this case, all markers from the `comment` group will be converted.\n * // The conversion will look for `<comment-start>` and `<comment-end>` tags and\n * // `data-comment-start-before`, `data-comment-start-after`,\n * // `data-comment-end-before` and `data-comment-end-after` attributes.\n * editor.conversion.for( 'upcast' ).dataToMarker( {\n * \tview: 'comment'\n * } );\n * ```\n *\n * An example of a model that may be generated by this conversion:\n *\n * ```\n * // View:\n * <p>Foo<comment-start name=\"commentId:uid\"></comment-start>bar</p>\n * <figure data-comment-end-after=\"commentId:uid\" class=\"image\"><img src=\"abc.jpg\" /></figure>\n *\n * // Model:\n * <paragraph>Foo[bar</paragraph>\n * <imageBlock src=\"abc.jpg\"></imageBlock>]\n * ```\n *\n * Where `[]` are boundaries of a marker that will receive the `comment:commentId:uid` name.\n *\n * Other examples of usage:\n *\n * ```ts\n * // Using a custom function which is the same as the default conversion:\n * editor.conversion.for( 'upcast' ).dataToMarker( {\n * \tview: 'comment',\n * \tmodel: ( name, conversionApi ) => 'comment:' + name,\n * } );\n *\n * // Using the converter priority:\n * editor.conversion.for( 'upcast' ).dataToMarker( {\n * \tview: 'comment',\n * \tmodel: ( name, conversionApi ) => 'comment:' + name,\n * \tconverterPriority: 'high'\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view The marker group name to convert.\n * @param config.model A function that takes the `name` part from the view element or attribute and\n * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the marker name.\n * @param config.converterPriority Converter priority.\n */\n dataToMarker(config) {\n return this.add(upcastDataToMarker(config));\n }\n}\n/**\n * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}\n * or all children of {@link module:engine/view/element~Element} into\n * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.\n * This is the \"entry-point\" converter for upcast (view to model conversion). This converter starts the conversion of all children\n * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.\n *\n * This also a \"default\", last resort converter for all view elements that has not been converted by other converters.\n * When a view element is being converted to the model but it does not have converter specified, that view element\n * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.\n *\n * @returns Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and\n * {@link module:engine/view/element~Element elements} that returns\n * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.\n */\nexport function convertToModelFragment() {\n return (evt, data, conversionApi) => {\n // Second argument in `consumable.consume` is discarded for ViewDocumentFragment but is needed for ViewElement.\n if (!data.modelRange && conversionApi.consumable.consume(data.viewItem, { name: true })) {\n const { modelRange, modelCursor } = conversionApi.convertChildren(data.viewItem, data.modelCursor);\n data.modelRange = modelRange;\n data.modelCursor = modelCursor;\n }\n };\n}\n/**\n * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.\n *\n * @returns {@link module:engine/view/text~Text View text} converter.\n */\nexport function convertText() {\n return (evt, data, { schema, consumable, writer }) => {\n let position = data.modelCursor;\n // When node is already converted then do nothing.\n if (!consumable.test(data.viewItem)) {\n return;\n }\n if (!schema.checkChild(position, '$text')) {\n if (!isParagraphable(position, '$text', schema)) {\n return;\n }\n // Do not auto-paragraph whitespaces.\n if (data.viewItem.data.trim().length == 0) {\n return;\n }\n position = wrapInParagraph(position, writer);\n }\n consumable.consume(data.viewItem);\n const text = writer.createText(data.viewItem.data);\n writer.insert(text, position);\n data.modelRange = writer.createRange(position, position.getShiftedBy(text.offsetSize));\n data.modelCursor = data.modelRange.end;\n };\n}\n/**\n * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection\n * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event\n * and sets in on the {@link module:engine/model/document~Document#selection model}.\n *\n * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model\n * conversion mechanism, the callback should be set directly on view document.\n *\n * ```ts\n * view.document.on( 'selectionChange', convertSelectionChange( modelDocument, mapper ) );\n * ```\n *\n * @param model Data model.\n * @param mapper Conversion mapper.\n * @returns {@link module:engine/view/document~Document#event:selectionChange} callback function.\n */\nexport function convertSelectionChange(model, mapper) {\n return (evt, data) => {\n const viewSelection = data.newSelection;\n const ranges = [];\n for (const viewRange of viewSelection.getRanges()) {\n ranges.push(mapper.toModelRange(viewRange));\n }\n const modelSelection = model.createSelection(ranges, { backward: viewSelection.isBackward });\n if (!modelSelection.isEqual(model.document.selection)) {\n model.change(writer => {\n writer.setSelection(modelSelection);\n });\n }\n };\n}\n/**\n * View element to model element conversion helper.\n *\n * See {@link ~UpcastHelpers#elementToElement `.elementToElement()` upcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted. If not\n * set, the converter will fire for every view element.\n * @param config.model Name of the model element, a model element\n * instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction upcastElementToElement(config) {\n config = cloneDeep(config);\n const converter = prepareToElementConverter(config);\n const elementName = getViewElementNameFromConfig(config.view);\n const eventName = elementName ? `element:${elementName}` : 'element';\n return (dispatcher) => {\n dispatcher.on(eventName, converter, { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * View element to model attribute conversion helper.\n *\n * See {@link ~UpcastHelpers#elementToAttribute `.elementToAttribute()` upcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted.\n * @param config.model Model attribute key or an object with `key` and `value` properties, describing\n * the model attribute. `value` property may be set as a function that takes a view element and returns the value.\n * If `String` is given, the model attribute value will be set to `true`.\n * @param config.converterPriority Converter priority. Defaults to `low`.\n * @returns Conversion helper.\n */\nfunction upcastElementToAttribute(config) {\n config = cloneDeep(config);\n normalizeModelAttributeConfig(config);\n const converter = prepareToAttributeConverter(config, false);\n const elementName = getViewElementNameFromConfig(config.view);\n const eventName = elementName ? `element:${elementName}` : 'element';\n return (dispatcher) => {\n dispatcher.on(eventName, converter, { priority: config.converterPriority || 'low' });\n };\n}\n/**\n * View attribute to model attribute conversion helper.\n *\n * See {@link ~UpcastHelpers#attributeToAttribute `.attributeToAttribute()` upcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.view Specifies which view attribute will be converted. If a `String` is passed,\n * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,\n * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`\n * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,\n * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.\n * @param config.model Model attribute key or an object with `key` and `value` properties, describing\n * the model attribute. `value` property may be set as a function that takes a view element and returns the value.\n * If `String` is given, the model attribute value will be same as view attribute value.\n * @param config.converterPriority Converter priority. Defaults to `low`.\n * @returns Conversion helper.\n */\nfunction upcastAttributeToAttribute(config) {\n config = cloneDeep(config);\n let viewKey = null;\n if (typeof config.view == 'string' || config.view.key) {\n viewKey = normalizeViewAttributeKeyValueConfig(config);\n }\n normalizeModelAttributeConfig(config, viewKey);\n const converter = prepareToAttributeConverter(config, true);\n return (dispatcher) => {\n dispatcher.on('element', converter, { priority: config.converterPriority || 'low' });\n };\n}\n/**\n * View element to model marker conversion helper.\n *\n * See {@link ~UpcastHelpers#elementToMarker `.elementToMarker()` upcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted.\n * @param config.model Name of the model marker, or a function that takes a view element and returns\n * a model marker name.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction upcastElementToMarker(config) {\n const model = normalizeElementToMarkerModelConfig(config.model);\n return upcastElementToElement({ ...config, model });\n}\n/**\n * View data to model marker conversion helper.\n *\n * See {@link ~UpcastHelpers#dataToMarker} to learn more.\n *\n * @returns Conversion helper.\n */\nfunction upcastDataToMarker(config) {\n config = cloneDeep(config);\n // Default conversion.\n if (!config.model) {\n config.model = name => {\n return name ? config.view + ':' + name : config.view;\n };\n }\n const normalizedConfig = {\n view: config.view,\n model: config.model\n };\n const converterStart = prepareToElementConverter(normalizeDataToMarkerConfig(normalizedConfig, 'start'));\n const converterEnd = prepareToElementConverter(normalizeDataToMarkerConfig(normalizedConfig, 'end'));\n return (dispatcher) => {\n dispatcher.on(`element:${config.view}-start`, converterStart, { priority: config.converterPriority || 'normal' });\n dispatcher.on(`element:${config.view}-end`, converterEnd, { priority: config.converterPriority || 'normal' });\n // Below is a hack that is needed to properly handle `converterPriority` for both elements and attributes.\n // Attribute conversion needs to be performed *after* element conversion.\n // This converter handles both element conversion and attribute conversion, which means that if a single\n // `config.converterPriority` is used, it will lead to problems. For example, if the `'high'` priority is used,\n // the attribute conversion will be performed before a lot of element upcast converters.\n // On the other hand, we want to support `config.converterPriority` and converter overwriting.\n //\n // To make it work, we need to do some extra processing for priority for attribute converter.\n // Priority `'low'` value should be the base value and then we will change it depending on `config.converterPriority` value.\n //\n // This hack probably would not be needed if attributes are upcasted separately.\n //\n const basePriority = priorities.low;\n const maxPriority = priorities.highest;\n const priorityFactor = priorities.get(config.converterPriority) / maxPriority; // Number in range [ -1, 1 ].\n dispatcher.on('element', upcastAttributeToMarker(normalizedConfig), { priority: basePriority + priorityFactor });\n };\n}\n/**\n * Function factory, returns a callback function which converts view attributes to a model marker.\n *\n * The converter looks for elements with `data-group-start-before`, `data-group-start-after`, `data-group-end-before`\n * and `data-group-end-after` attributes and inserts `$marker` model elements before/after those elements.\n * `group` part is specified in `config.view`.\n *\n * @returns Marker converter.\n */\nfunction upcastAttributeToMarker(config) {\n return (evt, data, conversionApi) => {\n const attrName = `data-${config.view}`;\n // Check if any attribute for the given view item can be consumed before changing the conversion data\n // and consuming view items with these attributes.\n if (!conversionApi.consumable.test(data.viewItem, { attributes: attrName + '-end-after' }) &&\n !conversionApi.consumable.test(data.viewItem, { attributes: attrName + '-start-after' }) &&\n !conversionApi.consumable.test(data.viewItem, { attributes: attrName + '-end-before' }) &&\n !conversionApi.consumable.test(data.viewItem, { attributes: attrName + '-start-before' })) {\n return;\n }\n // This converter wants to add a model element, marking a marker, before/after an element (or maybe even group of elements).\n // To do that, we can use `data.modelRange` which is set on an element (or a group of elements) that has been upcasted.\n // But, if the processed view element has not been upcasted yet (it does not have been converted), we need to\n // fire conversion for its children first, then we will have `data.modelRange` available.\n if (!data.modelRange) {\n Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));\n }\n if (conversionApi.consumable.consume(data.viewItem, { attributes: attrName + '-end-after' })) {\n addMarkerElements(data.modelRange.end, data.viewItem.getAttribute(attrName + '-end-after').split(','));\n }\n if (conversionApi.consumable.consume(data.viewItem, { attributes: attrName + '-start-after' })) {\n addMarkerElements(data.modelRange.end, data.viewItem.getAttribute(attrName + '-start-after').split(','));\n }\n if (conversionApi.consumable.consume(data.viewItem, { attributes: attrName + '-end-before' })) {\n addMarkerElements(data.modelRange.start, data.viewItem.getAttribute(attrName + '-end-before').split(','));\n }\n if (conversionApi.consumable.consume(data.viewItem, { attributes: attrName + '-start-before' })) {\n addMarkerElements(data.modelRange.start, data.viewItem.getAttribute(attrName + '-start-before').split(','));\n }\n function addMarkerElements(position, markerViewNames) {\n for (const markerViewName of markerViewNames) {\n const markerName = config.model(markerViewName, conversionApi);\n const element = conversionApi.writer.createElement('$marker', { 'data-name': markerName });\n conversionApi.writer.insert(element, position);\n if (data.modelCursor.isEqual(position)) {\n data.modelCursor = data.modelCursor.getShiftedBy(1);\n }\n else {\n data.modelCursor = data.modelCursor._getTransformedByInsertion(position, 1);\n }\n data.modelRange = data.modelRange._getTransformedByInsertion(position, 1)[0];\n }\n }\n };\n}\n/**\n * Helper function for from-view-element conversion. Checks if `config.view` directly specifies converted view element's name\n * and if so, returns it.\n *\n * @param config Conversion view config.\n * @returns View element name or `null` if name is not directly set.\n */\nfunction getViewElementNameFromConfig(viewConfig) {\n if (typeof viewConfig == 'string') {\n return viewConfig;\n }\n if (typeof viewConfig == 'object' && typeof viewConfig.name == 'string') {\n return viewConfig.name;\n }\n return null;\n}\n/**\n * Helper for to-model-element conversion. Takes a config object and returns a proper converter function.\n *\n * @param config Conversion configuration.\n * @returns View to model converter.\n */\nfunction prepareToElementConverter(config) {\n const matcher = new Matcher(config.view);\n return (evt, data, conversionApi) => {\n const matcherResult = matcher.match(data.viewItem);\n if (!matcherResult) {\n return;\n }\n const match = matcherResult.match;\n // Force consuming element's name.\n match.name = true;\n if (!conversionApi.consumable.test(data.viewItem, match)) {\n return;\n }\n const modelElement = getModelElement(config.model, data.viewItem, conversionApi);\n if (!modelElement) {\n return;\n }\n if (!conversionApi.safeInsert(modelElement, data.modelCursor)) {\n return;\n }\n conversionApi.consumable.consume(data.viewItem, match);\n conversionApi.convertChildren(data.viewItem, modelElement);\n conversionApi.updateConversionResult(modelElement, data);\n };\n}\n/**\n * Helper function for upcasting-to-element converter. Takes the model configuration, the converted view element\n * and a writer instance and returns a model element instance to be inserted in the model.\n *\n * @param model Model conversion configuration.\n * @param input The converted view node.\n * @param conversionApi The upcast conversion API.\n */\nfunction getModelElement(model, input, conversionApi) {\n if (model instanceof Function) {\n return model(input, conversionApi);\n }\n else {\n return conversionApi.writer.createElement(model);\n }\n}\n/**\n * Helper function view-attribute-to-model-attribute helper. Normalizes `config.view` which was set as `String` or\n * as an `Object` with `key`, `value` and `name` properties. Normalized `config.view` has is compatible with\n * {@link module:engine/view/matcher~MatcherPattern}.\n *\n * @param config Conversion config.\n * @returns Key of the converted view attribute.\n */\nfunction normalizeViewAttributeKeyValueConfig(config) {\n if (typeof config.view == 'string') {\n config.view = { key: config.view };\n }\n const key = config.view.key;\n const value = typeof config.view.value == 'undefined' ? /[\\s\\S]*/ : config.view.value;\n let normalized;\n if (key == 'class' || key == 'style') {\n const keyName = key == 'class' ? 'classes' : 'styles';\n normalized = {\n [keyName]: value\n };\n }\n else {\n normalized = {\n attributes: {\n [key]: value\n }\n };\n }\n if (config.view.name) {\n normalized.name = config.view.name;\n }\n config.view = normalized;\n return key;\n}\n/**\n * Helper function that normalizes `config.model` in from-model-attribute conversion. `config.model` can be set\n * as a `String`, an `Object` with only `key` property or an `Object` with `key` and `value` properties. Normalized\n * `config.model` is an `Object` with `key` and `value` properties.\n *\n * @param config Conversion config.\n * @param viewAttributeKeyToCopy Key of the converted view attribute. If it is set, model attribute value\n * will be equal to view attribute value.\n */\nfunction normalizeModelAttributeConfig(config, viewAttributeKeyToCopy = null) {\n const defaultModelValue = viewAttributeKeyToCopy === null ? true :\n (viewElement) => viewElement.getAttribute(viewAttributeKeyToCopy);\n const key = typeof config.model != 'object' ? config.model : config.model.key;\n const value = typeof config.model != 'object' || typeof config.model.value == 'undefined' ? defaultModelValue : config.model.value;\n config.model = { key, value };\n}\n/**\n * Helper for to-model-attribute conversion. Takes the model attribute name and conversion configuration and returns\n * a proper converter function.\n *\n * @param config Conversion configuration. It is possible to provide multiple configurations in an array.\n * @param shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set\n * on all elements in the range.\n */\nfunction prepareToAttributeConverter(config, shallow) {\n const matcher = new Matcher(config.view);\n return (evt, data, conversionApi) => {\n // Converting an attribute of an element that has not been converted to anything does not make sense\n // because there will be nowhere to set that attribute on. At this stage, the element should've already\n // been converted (https://github.com/ckeditor/ckeditor5/issues/11000).\n if (!data.modelRange && shallow) {\n return;\n }\n const match = matcher.match(data.viewItem);\n // If there is no match, this callback should not do anything.\n if (!match) {\n return;\n }\n if (onlyViewNameIsDefined(config.view, data.viewItem)) {\n match.match.name = true;\n }\n else {\n // Do not test `name` consumable because it could get consumed already while upcasting some other attribute\n // on the same element (for example <span class=\"big\" style=\"color: red\">foo</span>).\n delete match.match.name;\n }\n // Try to consume appropriate values from consumable values list.\n if (!conversionApi.consumable.test(data.viewItem, match.match)) {\n return;\n }\n const modelKey = config.model.key;\n const modelValue = typeof config.model.value == 'function' ?\n config.model.value(data.viewItem, conversionApi) : config.model.value;\n // Do not convert if attribute building function returned falsy value.\n if (modelValue === null) {\n return;\n }\n // Since we are converting to attribute we need a range on which we will set the attribute.\n // If the range is not created yet, let's create it by converting children of the current node first.\n if (!data.modelRange) {\n // Convert children and set conversion result as a current data.\n Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));\n }\n // Set attribute on current `output`. `Schema` is checked inside this helper function.\n const attributeWasSet = setAttributeOn(data.modelRange, { key: modelKey, value: modelValue }, shallow, conversionApi);\n // It may happen that a converter will try to set an attribute that is not allowed in the given context.\n // In such a situation we cannot consume the attribute. See: https://github.com/ckeditor/ckeditor5/pull/9249#issuecomment-815658459.\n if (attributeWasSet) {\n // Verify if the element itself wasn't consumed yet. It could be consumed already while upcasting some other attribute\n // on the same element (for example <span class=\"big\" style=\"color: red\">foo</span>).\n // We need to consume it so other features (especially GHS) won't try to convert it.\n // Note that it's not tested by the other element-to-attribute converters whether an element was consumed before\n // (in case of converters that the element itself is just a context and not the primary information to convert).\n if (conversionApi.consumable.test(data.viewItem, { name: true })) {\n match.match.name = true;\n }\n conversionApi.consumable.consume(data.viewItem, match.match);\n }\n };\n}\n/**\n * Helper function that checks if element name should be consumed in attribute converters.\n *\n * @param viewConfig Conversion view config.\n */\nfunction onlyViewNameIsDefined(viewConfig, viewItem) {\n // https://github.com/ckeditor/ckeditor5-engine/issues/1786\n const configToTest = typeof viewConfig == 'function' ? viewConfig(viewItem) : viewConfig;\n if (typeof configToTest == 'object' && !getViewElementNameFromConfig(configToTest)) {\n return false;\n }\n return !configToTest.classes && !configToTest.attributes && !configToTest.styles;\n}\n/**\n * Helper function for to-model-attribute converter. Sets model attribute on given range. Checks {@link module:engine/model/schema~Schema}\n * to ensure proper model structure.\n *\n * If any node on the given range has already defined an attribute with the same name, its value will not be updated.\n *\n * @param modelRange Model range on which attribute should be set.\n * @param modelAttribute Model attribute to set.\n * @param conversionApi Conversion API.\n * @param shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set\n * on all elements in the range.\n * @returns `true` if attribute was set on at least one node from given `modelRange`.\n */\nfunction setAttributeOn(modelRange, modelAttribute, shallow, conversionApi) {\n let result = false;\n // Set attribute on each item in range according to Schema.\n for (const node of Array.from(modelRange.getItems({ shallow }))) {\n // Skip if not allowed.\n if (!conversionApi.schema.checkAttribute(node, modelAttribute.key)) {\n continue;\n }\n // Mark the node as consumed even if the attribute will not be updated because it's in a valid context (schema)\n // and would be converted if the attribute wouldn't be present. See #8921.\n result = true;\n // Do not override the attribute if it's already present.\n if (node.hasAttribute(modelAttribute.key)) {\n continue;\n }\n conversionApi.writer.setAttribute(modelAttribute.key, modelAttribute.value, node);\n }\n return result;\n}\n/**\n * Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastElementToMarker()`\n * function and converts it to a format that is supported by `upcastElementToElement()` function.\n */\nfunction normalizeElementToMarkerModelConfig(model) {\n return (viewElement, conversionApi) => {\n const markerName = typeof model == 'string' ? model : model(viewElement, conversionApi);\n return conversionApi.writer.createElement('$marker', { 'data-name': markerName });\n };\n}\n/**\n * Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastDataToMarker()`\n * function and converts it to a format that is supported by `upcastElementToElement()` function.\n */\nfunction normalizeDataToMarkerConfig(config, type) {\n const elementCreatorFunction = (viewElement, conversionApi) => {\n const viewName = viewElement.getAttribute('name');\n const markerName = config.model(viewName, conversionApi);\n return conversionApi.writer.createElement('$marker', { 'data-name': markerName });\n };\n return {\n // Upcast <markerGroup-start> and <markerGroup-end> elements.\n view: `${config.view}-${type}`,\n model: elementCreatorFunction\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/selection-post-fixer\n */\nimport Position from '../position.js';\nimport Range from '../range.js';\n/**\n * Injects selection post-fixer to the model.\n *\n * The role of the selection post-fixer is to ensure that the selection is in a correct place\n * after a {@link module:engine/model/model~Model#change `change()`} block was executed.\n *\n * The correct position means that:\n *\n * * All collapsed selection ranges are in a place where the {@link module:engine/model/schema~Schema}\n * allows a `$text`.\n * * None of the selection's non-collapsed ranges crosses a {@link module:engine/model/schema~Schema#isLimit limit element}\n * boundary (a range must be rooted within one limit element).\n * * Only {@link module:engine/model/schema~Schema#isSelectable selectable elements} can be selected from the outside\n * (e.g. `[<paragraph>foo</paragraph>]` is invalid). This rule applies independently to both selection ends, so this\n * selection is correct: `<paragraph>f[oo</paragraph><imageBlock></imageBlock>]`.\n *\n * If the position is not correct, the post-fixer will automatically correct it.\n *\n * ## Fixing a non-collapsed selection\n *\n * See as an example a selection that starts in a P1 element and ends inside the text of a TD element\n * (`[` and `]` are range boundaries and `(l)` denotes an element defined as `isLimit=true`):\n *\n * ```\n * root\n * |- element P1\n * | |- \"foo\" root\n * |- element TABLE (l) P1 TABLE P2\n * | |- element TR (l) f o[o TR TR b a r\n * | | |- element TD (l) TD TD\n * | | |- \"aaa\" a]a a b b b\n * | |- element TR (l)\n * | | |- element TD (l) ||\n * | | |- \"bbb\" ||\n * |- element P2 VV\n * | |- \"bar\"\n * root\n * P1 TABLE] P2\n * f o[o TR TR b a r\n * TD TD\n * a a a b b b\n * ```\n *\n * In the example above, the TABLE, TR and TD are defined as `isLimit=true` in the schema. The range which is not contained within\n * a single limit element must be expanded to select the outermost limit element. The range end is inside the text node of the TD element.\n * As the TD element is a child of the TR and TABLE elements, where both are defined as `isLimit=true` in the schema, the range must be\n * expanded to select the whole TABLE element.\n *\n * **Note** If the selection contains multiple ranges, the method returns a minimal set of ranges that are not intersecting after expanding\n * them to select `isLimit=true` elements.\n */\nexport function injectSelectionPostFixer(model) {\n model.document.registerPostFixer(writer => selectionPostFixer(writer, model));\n}\n/**\n * The selection post-fixer.\n */\nfunction selectionPostFixer(writer, model) {\n const selection = model.document.selection;\n const schema = model.schema;\n const ranges = [];\n let wasFixed = false;\n for (const modelRange of selection.getRanges()) {\n // Go through all ranges in selection and try fixing each of them.\n // Those ranges might overlap but will be corrected later.\n const correctedRange = tryFixingRange(modelRange, schema);\n // \"Selection fixing\" algorithms sometimes get lost. In consequence, it may happen\n // that a new range is returned but, in fact, it has the same positions as the original\n // range anyway. If this range is not discarded, a new selection will be set and that,\n // for instance, would destroy the selection attributes. Let's make sure that the post-fixer\n // actually worked first before setting a new selection.\n //\n // https://github.com/ckeditor/ckeditor5/issues/6693\n if (correctedRange && !correctedRange.isEqual(modelRange)) {\n ranges.push(correctedRange);\n wasFixed = true;\n }\n else {\n ranges.push(modelRange);\n }\n }\n // If any of ranges were corrected update the selection.\n if (wasFixed) {\n writer.setSelection(mergeIntersectingRanges(ranges), { backward: selection.isBackward });\n }\n return false;\n}\n/**\n * Tries fixing a range if it's incorrect.\n *\n * **Note:** This helper is used by the selection post-fixer and to fix the `beforeinput` target ranges.\n *\n * @returns Returns fixed range or null if range is valid.\n */\nexport function tryFixingRange(range, schema) {\n if (range.isCollapsed) {\n return tryFixingCollapsedRange(range, schema);\n }\n return tryFixingNonCollapsedRage(range, schema);\n}\n/**\n * Tries to fix collapsed ranges.\n *\n * * Fixes situation when a range is in a place where $text is not allowed\n *\n * @param range Collapsed range to fix.\n * @returns Returns fixed range or null if range is valid.\n */\nfunction tryFixingCollapsedRange(range, schema) {\n const originalPosition = range.start;\n const nearestSelectionRange = schema.getNearestSelectionRange(originalPosition);\n // This might be null, i.e. when the editor data is empty or the selection is inside a limit element\n // that doesn't allow text inside.\n // In the first case, there is no need to fix the selection range.\n // In the second, let's go up to the outer selectable element\n if (!nearestSelectionRange) {\n const ancestorObject = originalPosition.getAncestors().reverse().find((item) => schema.isObject(item));\n if (ancestorObject) {\n return Range._createOn(ancestorObject);\n }\n return null;\n }\n if (!nearestSelectionRange.isCollapsed) {\n return nearestSelectionRange;\n }\n const fixedPosition = nearestSelectionRange.start;\n // Fixed position is the same as original - no need to return corrected range.\n if (originalPosition.isEqual(fixedPosition)) {\n return null;\n }\n return new Range(fixedPosition);\n}\n/**\n * Tries to fix an expanded range.\n *\n * @param range Expanded range to fix.\n * @returns Returns fixed range or null if range is valid.\n */\nfunction tryFixingNonCollapsedRage(range, schema) {\n const { start, end } = range;\n const isTextAllowedOnStart = schema.checkChild(start, '$text');\n const isTextAllowedOnEnd = schema.checkChild(end, '$text');\n const startLimitElement = schema.getLimitElement(start);\n const endLimitElement = schema.getLimitElement(end);\n // Ranges which both end are inside the same limit element (or root) might needs only minor fix.\n if (startLimitElement === endLimitElement) {\n // Range is valid when both position allows to place a text:\n // - <block>f[oobarba]z</block>\n // This would be \"fixed\" by a next check but as it will be the same it's better to return null so the selection stays the same.\n if (isTextAllowedOnStart && isTextAllowedOnEnd) {\n return null;\n }\n // Range that is on non-limit element (or is partially) must be fixed so it is placed inside the block around $text:\n // - [<block>foo</block>] -> <block>[foo]</block>\n // - [<block>foo]</block> -> <block>[foo]</block>\n // - <block>f[oo</block>] -> <block>f[oo]</block>\n // - [<block>foo</block><selectable></selectable>] -> <block>[foo</block><selectable></selectable>]\n if (checkSelectionOnNonLimitElements(start, end, schema)) {\n const isStartBeforeSelectable = start.nodeAfter && schema.isSelectable(start.nodeAfter);\n const fixedStart = isStartBeforeSelectable ? null : schema.getNearestSelectionRange(start, 'forward');\n const isEndAfterSelectable = end.nodeBefore && schema.isSelectable(end.nodeBefore);\n const fixedEnd = isEndAfterSelectable ? null : schema.getNearestSelectionRange(end, 'backward');\n // The schema.getNearestSelectionRange might return null - if that happens use original position.\n const rangeStart = fixedStart ? fixedStart.start : start;\n const rangeEnd = fixedEnd ? fixedEnd.end : end;\n return new Range(rangeStart, rangeEnd);\n }\n }\n const isStartInLimit = startLimitElement && !startLimitElement.is('rootElement');\n const isEndInLimit = endLimitElement && !endLimitElement.is('rootElement');\n // At this point we eliminated valid positions on text nodes so if one of range positions is placed inside a limit element\n // then the range crossed limit element boundaries and needs to be fixed.\n if (isStartInLimit || isEndInLimit) {\n const bothInSameParent = (start.nodeAfter && end.nodeBefore) && start.nodeAfter.parent === end.nodeBefore.parent;\n const expandStart = isStartInLimit && (!bothInSameParent || !isSelectable(start.nodeAfter, schema));\n const expandEnd = isEndInLimit && (!bothInSameParent || !isSelectable(end.nodeBefore, schema));\n // Although we've already found limit element on start/end positions we must find the outer-most limit element.\n // as limit elements might be nested directly inside (ie table > tableRow > tableCell).\n let fixedStart = start;\n let fixedEnd = end;\n if (expandStart) {\n fixedStart = Position._createBefore(findOutermostLimitAncestor(startLimitElement, schema));\n }\n if (expandEnd) {\n fixedEnd = Position._createAfter(findOutermostLimitAncestor(endLimitElement, schema));\n }\n return new Range(fixedStart, fixedEnd);\n }\n // Range was not fixed at this point so it is valid - ie it was placed around limit element already.\n return null;\n}\n/**\n * Finds the outer-most ancestor.\n */\nfunction findOutermostLimitAncestor(startingNode, schema) {\n let isLimitNode = startingNode;\n let parent = isLimitNode;\n // Find outer most isLimit block as such blocks might be nested (ie. in tables).\n while (schema.isLimit(parent) && parent.parent) {\n isLimitNode = parent;\n parent = parent.parent;\n }\n return isLimitNode;\n}\n/**\n * Checks whether any of range boundaries is placed around non-limit elements.\n */\nfunction checkSelectionOnNonLimitElements(start, end, schema) {\n const startIsOnBlock = (start.nodeAfter && !schema.isLimit(start.nodeAfter)) || schema.checkChild(start, '$text');\n const endIsOnBlock = (end.nodeBefore && !schema.isLimit(end.nodeBefore)) || schema.checkChild(end, '$text');\n // We should fix such selection when one of those nodes needs fixing.\n return startIsOnBlock || endIsOnBlock;\n}\n/**\n * Returns a minimal non-intersecting array of ranges without duplicates.\n *\n * @param ranges Ranges to merge.\n * @returns Array of unique and non-intersecting ranges.\n */\nexport function mergeIntersectingRanges(ranges) {\n const rangesToMerge = [...ranges];\n const rangeIndexesToRemove = new Set();\n let currentRangeIndex = 1;\n while (currentRangeIndex < rangesToMerge.length) {\n const currentRange = rangesToMerge[currentRangeIndex];\n const previousRanges = rangesToMerge.slice(0, currentRangeIndex);\n for (const [previousRangeIndex, previousRange] of previousRanges.entries()) {\n if (rangeIndexesToRemove.has(previousRangeIndex)) {\n continue;\n }\n if (currentRange.isEqual(previousRange)) {\n rangeIndexesToRemove.add(previousRangeIndex);\n }\n else if (currentRange.isIntersecting(previousRange)) {\n rangeIndexesToRemove.add(previousRangeIndex);\n rangeIndexesToRemove.add(currentRangeIndex);\n const mergedRange = currentRange.getJoined(previousRange);\n rangesToMerge.push(mergedRange);\n }\n }\n currentRangeIndex++;\n }\n const nonIntersectingRanges = rangesToMerge.filter((_, index) => !rangeIndexesToRemove.has(index));\n return nonIntersectingRanges;\n}\n/**\n * Checks if node exists and if it's a selectable.\n */\nfunction isSelectable(node, schema) {\n return node && schema.isSelectable(node);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/controller/editingcontroller\n */\nimport { CKEditorError, ObservableMixin, env } from '@ckeditor/ckeditor5-utils';\nimport RootEditableElement from '../view/rooteditableelement.js';\nimport View from '../view/view.js';\nimport Mapper from '../conversion/mapper.js';\nimport DowncastDispatcher from '../conversion/downcastdispatcher.js';\nimport { cleanSelection, convertCollapsedSelection, convertRangeSelection, insertAttributesAndChildren, insertText, remove } from '../conversion/downcasthelpers.js';\nimport { convertSelectionChange } from '../conversion/upcasthelpers.js';\nimport { tryFixingRange } from '../model/utils/selection-post-fixer.js';\n// @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );\n/**\n * A controller for the editing pipeline. The editing pipeline controls the {@link ~EditingController#model model} rendering,\n * including selection handling. It also creates the {@link ~EditingController#view view} which builds a\n * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.\n */\nexport default class EditingController extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates an editing controller instance.\n *\n * @param model Editing model.\n * @param stylesProcessor The styles processor instance.\n */\n constructor(model, stylesProcessor) {\n super();\n this.model = model;\n this.view = new View(stylesProcessor);\n this.mapper = new Mapper();\n this.downcastDispatcher = new DowncastDispatcher({\n mapper: this.mapper,\n schema: model.schema\n });\n const doc = this.model.document;\n const selection = doc.selection;\n const markers = this.model.markers;\n // When plugins listen on model changes (on selection change, post fixers, etc.) and change the view as a result of\n // the model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection\n // is converted). We disable rendering for the length of the outermost model change() block to prevent that.\n //\n // See https://github.com/ckeditor/ckeditor5-engine/issues/1528\n this.listenTo(this.model, '_beforeChanges', () => {\n this.view._disableRendering(true);\n }, { priority: 'highest' });\n this.listenTo(this.model, '_afterChanges', () => {\n this.view._disableRendering(false);\n }, { priority: 'lowest' });\n // Whenever model document is changed, convert those changes to the view (using model.Document#differ).\n // Do it on 'low' priority, so changes are converted after other listeners did their job.\n // Also convert model selection.\n this.listenTo(doc, 'change', () => {\n this.view.change(writer => {\n this.downcastDispatcher.convertChanges(doc.differ, markers, writer);\n this.downcastDispatcher.convertSelection(selection, markers, writer);\n });\n }, { priority: 'low' });\n // Convert selection from the view to the model when it changes in the view.\n this.listenTo(this.view.document, 'selectionChange', convertSelectionChange(this.model, this.mapper));\n // Fix `beforeinput` target ranges so that they map to the valid model ranges.\n this.listenTo(this.view.document, 'beforeinput', fixTargetRanges(this.mapper, this.model.schema, this.view), { priority: 'high' });\n // Attach default model converters.\n this.downcastDispatcher.on('insert:$text', insertText(), { priority: 'lowest' });\n this.downcastDispatcher.on('insert', insertAttributesAndChildren(), { priority: 'lowest' });\n this.downcastDispatcher.on('remove', remove(), { priority: 'low' });\n // Attach default model selection converters.\n this.downcastDispatcher.on('cleanSelection', cleanSelection());\n this.downcastDispatcher.on('selection', convertRangeSelection(), { priority: 'low' });\n this.downcastDispatcher.on('selection', convertCollapsedSelection(), { priority: 'low' });\n // Binds {@link module:engine/view/document~Document#roots view roots collection} to\n // {@link module:engine/model/document~Document#roots model roots collection} so creating\n // model root automatically creates corresponding view root.\n this.view.document.roots.bindTo(this.model.document.roots).using(root => {\n // $graveyard is a special root that has no reflection in the view.\n if (root.rootName == '$graveyard') {\n return null;\n }\n const viewRoot = new RootEditableElement(this.view.document, root.name);\n viewRoot.rootName = root.rootName;\n this.mapper.bindElements(root, viewRoot);\n return viewRoot;\n });\n // @if CK_DEBUG_ENGINE // initDocumentDumping( this.model.document );\n // @if CK_DEBUG_ENGINE // initDocumentDumping( this.view.document );\n // @if CK_DEBUG_ENGINE // dumpTrees( this.model.document, this.model.document.version );\n // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );\n // @if CK_DEBUG_ENGINE // this.model.document.on( 'change', () => {\n // @if CK_DEBUG_ENGINE //\tdumpTrees( this.view.document, this.model.document.version );\n // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );\n }\n /**\n * Removes all event listeners attached to the `EditingController`. Destroys all objects created\n * by `EditingController` that need to be destroyed.\n */\n destroy() {\n this.view.destroy();\n this.stopListening();\n }\n /**\n * Calling this method will refresh the marker by triggering the downcast conversion for it.\n *\n * Reconverting the marker is useful when you want to change its {@link module:engine/view/element~Element view element}\n * without changing any marker data. For instance:\n *\n * ```ts\n * let isCommentActive = false;\n *\n * model.conversion.markerToHighlight( {\n * \tmodel: 'comment',\n * \tview: data => {\n * \t\tconst classes = [ 'comment-marker' ];\n *\n * \t\tif ( isCommentActive ) {\n * \t\t\tclasses.push( 'comment-marker--active' );\n * \t\t}\n *\n * \t\treturn { classes };\n * \t}\n * } );\n *\n * // ...\n *\n * // Change the property that indicates if marker is displayed as active or not.\n * isCommentActive = true;\n *\n * // Reconverting will downcast and synchronize the marker with the new isCommentActive state value.\n * editor.editing.reconvertMarker( 'comment' );\n * ```\n *\n * **Note**: If you want to reconvert a model item, use {@link #reconvertItem} instead.\n *\n * @param markerOrName Name of a marker to update, or a marker instance.\n */\n reconvertMarker(markerOrName) {\n const markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;\n const currentMarker = this.model.markers.get(markerName);\n if (!currentMarker) {\n /**\n * The marker with the provided name does not exist and cannot be reconverted.\n *\n * @error editingcontroller-reconvertmarker-marker-not-exist\n * @param {String} markerName The name of the reconverted marker.\n */\n throw new CKEditorError('editingcontroller-reconvertmarker-marker-not-exist', this, { markerName });\n }\n this.model.change(() => {\n this.model.markers._refresh(currentMarker);\n });\n }\n /**\n * Calling this method will downcast a model item on demand (by requesting a refresh in the {@link module:engine/model/differ~Differ}).\n *\n * You can use it if you want the view representation of a specific item updated as a response to external modifications. For instance,\n * when the view structure depends not only on the associated model data but also on some external state.\n *\n * **Note**: If you want to reconvert a model marker, use {@link #reconvertMarker} instead.\n *\n * @param item Item to refresh.\n */\n reconvertItem(item) {\n this.model.change(() => {\n this.model.document.differ._refreshItem(item);\n });\n }\n}\n/**\n * Checks whether the target ranges provided by the `beforeInput` event can be properly mapped to model ranges and fixes them if needed.\n *\n * This is using the same logic as the selection post-fixer.\n */\nfunction fixTargetRanges(mapper, schema, view) {\n return (evt, data) => {\n // The Renderer is disabled while composing on non-android browsers, so we can't be sure that target ranges\n // could be properly mapped to view and model because the DOM and view tree drifted apart.\n if (view.document.isComposing && !env.isAndroid) {\n return;\n }\n for (let i = 0; i < data.targetRanges.length; i++) {\n const viewRange = data.targetRanges[i];\n const modelRange = mapper.toModelRange(viewRange);\n const correctedRange = tryFixingRange(modelRange, schema);\n if (!correctedRange || correctedRange.isEqual(modelRange)) {\n continue;\n }\n data.targetRanges[i] = mapper.toViewRange(correctedRange);\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/viewconsumable\n */\nimport { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';\n/**\n * Class used for handling consumption of view {@link module:engine/view/element~Element elements},\n * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.\n * Element's name and its parts (attributes, classes and styles) can be consumed separately. Consuming an element's name\n * does not consume its attributes, classes and styles.\n * To add items for consumption use {@link module:engine/conversion/viewconsumable~ViewConsumable#add add method}.\n * To test items use {@link module:engine/conversion/viewconsumable~ViewConsumable#test test method}.\n * To consume items use {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consume method}.\n * To revert already consumed items use {@link module:engine/conversion/viewconsumable~ViewConsumable#revert revert method}.\n *\n * ```ts\n * viewConsumable.add( element, { name: true } ); // Adds element's name as ready to be consumed.\n * viewConsumable.add( textNode ); // Adds text node for consumption.\n * viewConsumable.add( docFragment ); // Adds document fragment for consumption.\n * viewConsumable.test( element, { name: true } ); // Tests if element's name can be consumed.\n * viewConsumable.test( textNode ); // Tests if text node can be consumed.\n * viewConsumable.test( docFragment ); // Tests if document fragment can be consumed.\n * viewConsumable.consume( element, { name: true } ); // Consume element's name.\n * viewConsumable.consume( textNode ); // Consume text node.\n * viewConsumable.consume( docFragment ); // Consume document fragment.\n * viewConsumable.revert( element, { name: true } ); // Revert already consumed element's name.\n * viewConsumable.revert( textNode ); // Revert already consumed text node.\n * viewConsumable.revert( docFragment ); // Revert already consumed document fragment.\n * ```\n */\nexport default class ViewConsumable {\n constructor() {\n /**\n * Map of consumable elements. If {@link module:engine/view/element~Element element} is used as a key,\n * {@link module:engine/conversion/viewconsumable~ViewElementConsumables ViewElementConsumables} instance is stored as value.\n * For {@link module:engine/view/text~Text text nodes} and\n * {@link module:engine/view/documentfragment~DocumentFragment document fragments} boolean value is stored as value.\n */\n this._consumables = new Map();\n }\n add(element, consumables) {\n let elementConsumables;\n // For text nodes and document fragments just mark them as consumable.\n if (element.is('$text') || element.is('documentFragment')) {\n this._consumables.set(element, true);\n return;\n }\n // For elements create new ViewElementConsumables or update already existing one.\n if (!this._consumables.has(element)) {\n elementConsumables = new ViewElementConsumables(element);\n this._consumables.set(element, elementConsumables);\n }\n else {\n elementConsumables = this._consumables.get(element);\n }\n elementConsumables.add(consumables);\n }\n /**\n * Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n * {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.\n * It returns `true` when all items included in method's call can be consumed. Returns `false` when\n * first already consumed item is found and `null` when first non-consumable item is found.\n *\n * ```ts\n * viewConsumable.test( p, { name: true } ); // Tests element's name.\n * viewConsumable.test( p, { attributes: 'name' } ); // Tests attribute.\n * viewConsumable.test( p, { classes: 'foobar' } ); // Tests class.\n * viewConsumable.test( p, { styles: 'color' } ); // Tests style.\n * viewConsumable.test( p, { attributes: 'name', styles: 'color' } ); // Tests attribute and style.\n * viewConsumable.test( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be tested.\n * viewConsumable.test( textNode ); // Tests text node.\n * viewConsumable.test( docFragment ); // Tests document fragment.\n * ```\n *\n * Testing classes and styles as attribute will test if all added classes/styles can be consumed.\n *\n * ```ts\n * viewConsumable.test( p, { attributes: 'class' } ); // Tests if all added classes can be consumed.\n * viewConsumable.test( p, { attributes: 'style' } ); // Tests if all added styles can be consumed.\n * ```\n *\n * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n * @param consumables.name If set to true element's name will be included.\n * @param consumables.attributes Attribute name or array of attribute names.\n * @param consumables.classes Class name or array of class names.\n * @param consumables.styles Style name or array of style names.\n * @returns Returns `true` when all items included in method's call can be consumed. Returns `false`\n * when first already consumed item is found and `null` when first non-consumable item is found.\n */\n test(element, consumables) {\n const elementConsumables = this._consumables.get(element);\n if (elementConsumables === undefined) {\n return null;\n }\n // For text nodes and document fragments return stored boolean value.\n if (element.is('$text') || element.is('documentFragment')) {\n return elementConsumables;\n }\n // For elements test consumables object.\n return elementConsumables.test(consumables);\n }\n /**\n * Consumes {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.\n *\n * ```ts\n * viewConsumable.consume( p, { name: true } ); // Consumes element's name.\n * viewConsumable.consume( p, { attributes: 'name' } ); // Consumes element's attribute.\n * viewConsumable.consume( p, { classes: 'foobar' } ); // Consumes element's class.\n * viewConsumable.consume( p, { styles: 'color' } ); // Consumes element's style.\n * viewConsumable.consume( p, { attributes: 'name', styles: 'color' } ); // Consumes attribute and style.\n * viewConsumable.consume( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be consumed.\n * viewConsumable.consume( textNode ); // Consumes text node.\n * viewConsumable.consume( docFragment ); // Consumes document fragment.\n * ```\n *\n * Consuming classes and styles as attribute will test if all added classes/styles can be consumed.\n *\n * ```ts\n * viewConsumable.consume( p, { attributes: 'class' } ); // Consume only if all added classes can be consumed.\n * viewConsumable.consume( p, { attributes: 'style' } ); // Consume only if all added styles can be consumed.\n * ```\n *\n * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n * @param consumables.name If set to true element's name will be included.\n * @param consumables.attributes Attribute name or array of attribute names.\n * @param consumables.classes Class name or array of class names.\n * @param consumables.styles Style name or array of style names.\n * @returns Returns `true` when all items included in method's call can be consumed,\n * otherwise returns `false`.\n */\n consume(element, consumables) {\n if (this.test(element, consumables)) {\n if (element.is('$text') || element.is('documentFragment')) {\n // For text nodes and document fragments set value to false.\n this._consumables.set(element, false);\n }\n else {\n // For elements - consume consumables object.\n this._consumables.get(element).consume(consumables);\n }\n return true;\n }\n return false;\n }\n /**\n * Reverts {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n * {@link module:engine/view/documentfragment~DocumentFragment document fragment} so they can be consumed once again.\n * Method does not revert items that were never previously added for consumption, even if they are included in\n * method's call.\n *\n * ```ts\n * viewConsumable.revert( p, { name: true } ); // Reverts element's name.\n * viewConsumable.revert( p, { attributes: 'name' } ); // Reverts element's attribute.\n * viewConsumable.revert( p, { classes: 'foobar' } ); // Reverts element's class.\n * viewConsumable.revert( p, { styles: 'color' } ); // Reverts element's style.\n * viewConsumable.revert( p, { attributes: 'name', styles: 'color' } ); // Reverts attribute and style.\n * viewConsumable.revert( p, { classes: [ 'baz', 'bar' ] } ); // Multiple names can be reverted.\n * viewConsumable.revert( textNode ); // Reverts text node.\n * viewConsumable.revert( docFragment ); // Reverts document fragment.\n * ```\n *\n * Reverting classes and styles as attribute will revert all classes/styles that were previously added for\n * consumption.\n *\n * ```ts\n * viewConsumable.revert( p, { attributes: 'class' } ); // Reverts all classes added for consumption.\n * viewConsumable.revert( p, { attributes: 'style' } ); // Reverts all styles added for consumption.\n * ```\n *\n * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n * @param consumables.name If set to true element's name will be included.\n * @param consumables.attributes Attribute name or array of attribute names.\n * @param consumables.classes Class name or array of class names.\n * @param consumables.styles Style name or array of style names.\n */\n revert(element, consumables) {\n const elementConsumables = this._consumables.get(element);\n if (elementConsumables !== undefined) {\n if (element.is('$text') || element.is('documentFragment')) {\n // For text nodes and document fragments - set consumable to true.\n this._consumables.set(element, true);\n }\n else {\n // For elements - revert items from consumables object.\n elementConsumables.revert(consumables);\n }\n }\n }\n /**\n * Creates consumable object from {@link module:engine/view/element~Element view element}. Consumable object will include\n * element's name and all its attributes, classes and styles.\n */\n static consumablesFromElement(element) {\n const consumables = {\n element,\n name: true,\n attributes: [],\n classes: [],\n styles: []\n };\n const attributes = element.getAttributeKeys();\n for (const attribute of attributes) {\n // Skip classes and styles - will be added separately.\n if (attribute == 'style' || attribute == 'class') {\n continue;\n }\n consumables.attributes.push(attribute);\n }\n const classes = element.getClassNames();\n for (const className of classes) {\n consumables.classes.push(className);\n }\n const styles = element.getStyleNames();\n for (const style of styles) {\n consumables.styles.push(style);\n }\n return consumables;\n }\n /**\n * Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from\n * {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n * Instance will contain all elements, child nodes, attributes, styles and classes added for consumption.\n *\n * @param from View node or document fragment from which `ViewConsumable` will be created.\n * @param instance If provided, given `ViewConsumable` instance will be used\n * to add all consumables. It will be returned instead of a new instance.\n */\n static createFrom(from, instance) {\n if (!instance) {\n instance = new ViewConsumable();\n }\n if (from.is('$text')) {\n instance.add(from);\n return instance;\n }\n // Add `from` itself, if it is an element.\n if (from.is('element')) {\n instance.add(from, ViewConsumable.consumablesFromElement(from));\n }\n if (from.is('documentFragment')) {\n instance.add(from);\n }\n for (const child of from.getChildren()) {\n instance = ViewConsumable.createFrom(child, instance);\n }\n return instance;\n }\n}\nconst CONSUMABLE_TYPES = ['attributes', 'classes', 'styles'];\n/**\n * This is a private helper-class for {@link module:engine/conversion/viewconsumable~ViewConsumable}.\n * It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.\n */\nexport class ViewElementConsumables {\n /**\n * Creates ViewElementConsumables instance.\n *\n * @param from View node or document fragment from which `ViewElementConsumables` is being created.\n */\n constructor(from) {\n this.element = from;\n this._canConsumeName = null;\n this._consumables = {\n attributes: new Map(),\n styles: new Map(),\n classes: new Map()\n };\n }\n /**\n * Adds consumable parts of the {@link module:engine/view/element~Element view element}.\n * Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and\n * styles still could be consumed):\n *\n * ```ts\n * consumables.add( { name: true } );\n * ```\n *\n * Attributes classes and styles:\n *\n * ```ts\n * consumables.add( { attributes: 'title', classes: 'foo', styles: 'color' } );\n * consumables.add( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n * ```\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`\n * attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.\n *\n * @param consumables Object describing which parts of the element can be consumed.\n * @param consumables.name If set to `true` element's name will be added as consumable.\n * @param consumables.attributes Attribute name or array of attribute names to add as consumable.\n * @param consumables.classes Class name or array of class names to add as consumable.\n * @param consumables.styles Style name or array of style names to add as consumable.\n */\n add(consumables) {\n if (consumables.name) {\n this._canConsumeName = true;\n }\n for (const type of CONSUMABLE_TYPES) {\n if (type in consumables) {\n this._add(type, consumables[type]);\n }\n }\n }\n /**\n * Tests if parts of the {@link module:engine/view/node~Node view node} can be consumed.\n *\n * Element's name can be tested:\n *\n * ```ts\n * consumables.test( { name: true } );\n * ```\n *\n * Attributes classes and styles:\n *\n * ```ts\n * consumables.test( { attributes: 'title', classes: 'foo', styles: 'color' } );\n * consumables.test( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n * ```\n *\n * @param consumables Object describing which parts of the element should be tested.\n * @param consumables.name If set to `true` element's name will be tested.\n * @param consumables.attributes Attribute name or array of attribute names to test.\n * @param consumables.classes Class name or array of class names to test.\n * @param consumables.styles Style name or array of style names to test.\n * @returns `true` when all tested items can be consumed, `null` when even one of the items\n * was never marked for consumption and `false` when even one of the items was already consumed.\n */\n test(consumables) {\n // Check if name can be consumed.\n if (consumables.name && !this._canConsumeName) {\n return this._canConsumeName;\n }\n for (const type of CONSUMABLE_TYPES) {\n if (type in consumables) {\n const value = this._test(type, consumables[type]);\n if (value !== true) {\n return value;\n }\n }\n }\n // Return true only if all can be consumed.\n return true;\n }\n /**\n * Consumes parts of {@link module:engine/view/element~Element view element}. This function does not check if consumable item\n * is already consumed - it consumes all consumable items provided.\n * Element's name can be consumed:\n *\n * ```ts\n * consumables.consume( { name: true } );\n * ```\n *\n * Attributes classes and styles:\n *\n * ```ts\n * consumables.consume( { attributes: 'title', classes: 'foo', styles: 'color' } );\n * consumables.consume( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n * ```\n *\n * @param consumables Object describing which parts of the element should be consumed.\n * @param consumables.name If set to `true` element's name will be consumed.\n * @param consumables.attributes Attribute name or array of attribute names to consume.\n * @param consumables.classes Class name or array of class names to consume.\n * @param consumables.styles Style name or array of style names to consume.\n */\n consume(consumables) {\n if (consumables.name) {\n this._canConsumeName = false;\n }\n for (const type of CONSUMABLE_TYPES) {\n if (type in consumables) {\n this._consume(type, consumables[type]);\n }\n }\n }\n /**\n * Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.\n * Element's name can be reverted:\n *\n * ```ts\n * consumables.revert( { name: true } );\n * ```\n *\n * Attributes classes and styles:\n *\n * ```ts\n * consumables.revert( { attributes: 'title', classes: 'foo', styles: 'color' } );\n * consumables.revert( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n * ```\n *\n * @param consumables Object describing which parts of the element should be reverted.\n * @param consumables.name If set to `true` element's name will be reverted.\n * @param consumables.attributes Attribute name or array of attribute names to revert.\n * @param consumables.classes Class name or array of class names to revert.\n * @param consumables.styles Style name or array of style names to revert.\n */\n revert(consumables) {\n if (consumables.name) {\n this._canConsumeName = true;\n }\n for (const type of CONSUMABLE_TYPES) {\n if (type in consumables) {\n this._revert(type, consumables[type]);\n }\n }\n }\n /**\n * Helper method that adds consumables of a given type: attribute, class or style.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`\n * type is provided - it should be handled separately by providing actual style/class type.\n *\n * @param type Type of the consumable item: `attributes`, `classes` or `styles`.\n * @param item Consumable item or array of items.\n */\n _add(type, item) {\n const items = toArray(item);\n const consumables = this._consumables[type];\n for (const name of items) {\n if (type === 'attributes' && (name === 'class' || name === 'style')) {\n /**\n * Class and style attributes should be handled separately in\n * {@link module:engine/conversion/viewconsumable~ViewConsumable#add `ViewConsumable#add()`}.\n *\n * What you have done is trying to use:\n *\n * ```ts\n * consumables.add( { attributes: [ 'class', 'style' ] } );\n * ```\n *\n * While each class and style should be registered separately:\n *\n * ```ts\n * consumables.add( { classes: 'some-class', styles: 'font-weight' } );\n * ```\n *\n * @error viewconsumable-invalid-attribute\n */\n throw new CKEditorError('viewconsumable-invalid-attribute', this);\n }\n consumables.set(name, true);\n if (type === 'styles') {\n for (const alsoName of this.element.document.stylesProcessor.getRelatedStyles(name)) {\n consumables.set(alsoName, true);\n }\n }\n }\n }\n /**\n * Helper method that tests consumables of a given type: attribute, class or style.\n *\n * @param type Type of the consumable item: `attributes`, `classes` or `styles`.\n * @param item Consumable item or array of items.\n * @returns Returns `true` if all items can be consumed, `null` when one of the items cannot be\n * consumed and `false` when one of the items is already consumed.\n */\n _test(type, item) {\n const items = toArray(item);\n const consumables = this._consumables[type];\n for (const name of items) {\n if (type === 'attributes' && (name === 'class' || name === 'style')) {\n const consumableName = name == 'class' ? 'classes' : 'styles';\n // Check all classes/styles if class/style attribute is tested.\n const value = this._test(consumableName, [...this._consumables[consumableName].keys()]);\n if (value !== true) {\n return value;\n }\n }\n else {\n const value = consumables.get(name);\n // Return null if attribute is not found.\n if (value === undefined) {\n return null;\n }\n if (!value) {\n return false;\n }\n }\n }\n return true;\n }\n /**\n * Helper method that consumes items of a given type: attribute, class or style.\n *\n * @param type Type of the consumable item: `attributes`, `classes` or `styles`.\n * @param item Consumable item or array of items.\n */\n _consume(type, item) {\n const items = toArray(item);\n const consumables = this._consumables[type];\n for (const name of items) {\n if (type === 'attributes' && (name === 'class' || name === 'style')) {\n const consumableName = name == 'class' ? 'classes' : 'styles';\n // If class or style is provided for consumption - consume them all.\n this._consume(consumableName, [...this._consumables[consumableName].keys()]);\n }\n else {\n consumables.set(name, false);\n if (type == 'styles') {\n for (const toConsume of this.element.document.stylesProcessor.getRelatedStyles(name)) {\n consumables.set(toConsume, false);\n }\n }\n }\n }\n }\n /**\n * Helper method that reverts items of a given type: attribute, class or style.\n *\n * @param type Type of the consumable item: `attributes`, `classes` or , `styles`.\n * @param item Consumable item or array of items.\n */\n _revert(type, item) {\n const items = toArray(item);\n const consumables = this._consumables[type];\n for (const name of items) {\n if (type === 'attributes' && (name === 'class' || name === 'style')) {\n const consumableName = name == 'class' ? 'classes' : 'styles';\n // If class or style is provided for reverting - revert them all.\n this._revert(consumableName, [...this._consumables[consumableName].keys()]);\n }\n else {\n const value = consumables.get(name);\n if (value === false) {\n consumables.set(name, true);\n }\n }\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/schema\n */\nimport Element from './element.js';\nimport Position from './position.js';\nimport Range from './range.js';\nimport Text from './text.js';\nimport TreeWalker from './treewalker.js';\nimport { CKEditorError, first, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The model's schema. It defines the allowed and disallowed structures of nodes as well as nodes' attributes.\n * The schema is usually defined by the features and based on them, the editing framework and features\n * make decisions on how to change and process the model.\n *\n * The instance of schema is available in {@link module:engine/model/model~Model#schema `editor.model.schema`}.\n *\n * Read more about the schema in:\n *\n * * The {@glink framework/architecture/editing-engine#schema schema section} of the\n * {@glink framework/architecture/editing-engine Introduction to the Editing engine architecture} guide.\n * * The {@glink framework/deep-dive/schema Schema deep-dive} guide.\n */\nexport default class Schema extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a schema instance.\n */\n constructor() {\n super();\n this._sourceDefinitions = {};\n /**\n * A dictionary containing attribute properties.\n */\n this._attributeProperties = {};\n /**\n * Stores additional callbacks registered for schema items, which are evaluated when {@link ~Schema#checkChild} is called.\n *\n * Keys are schema item names for which the callbacks are registered. Values are arrays with the callbacks.\n *\n * Some checks are added under {@link ~Schema#_genericCheckSymbol} key, these are evaluated for every {@link ~Schema#checkChild} call.\n */\n this._customChildChecks = new Map();\n /**\n * Stores additional callbacks registered for attribute names, which are evaluated when {@link ~Schema#checkAttribute} is called.\n *\n * Keys are schema attribute names for which the callbacks are registered. Values are arrays with the callbacks.\n *\n * Some checks are added under {@link ~Schema#_genericCheckSymbol} key, these are evaluated for every\n * {@link ~Schema#checkAttribute} call.\n */\n this._customAttributeChecks = new Map();\n this._genericCheckSymbol = Symbol('$generic');\n this.decorate('checkChild');\n this.decorate('checkAttribute');\n this.on('checkAttribute', (evt, args) => {\n args[0] = new SchemaContext(args[0]);\n }, { priority: 'highest' });\n this.on('checkChild', (evt, args) => {\n args[0] = new SchemaContext(args[0]);\n args[1] = this.getDefinition(args[1]);\n }, { priority: 'highest' });\n }\n /**\n * Registers a schema item. Can only be called once for every item name.\n *\n * ```ts\n * schema.register( 'paragraph', {\n * \tinheritAllFrom: '$block'\n * } );\n * ```\n */\n register(itemName, definition) {\n if (this._sourceDefinitions[itemName]) {\n /**\n * A single item cannot be registered twice in the schema.\n *\n * This situation may happen when:\n *\n * * Two or more plugins called {@link module:engine/model/schema~Schema#register `register()`} with the same name.\n * This will usually mean that there is a collision between plugins which try to use the same element in the model.\n * Unfortunately, the only way to solve this is by modifying one of these plugins to use a unique model element name.\n * * A single plugin was loaded twice. This happens when it is installed by npm/yarn in two versions\n * and usually means one or more of the following issues:\n * * a version mismatch (two of your dependencies require two different versions of this plugin),\n * * incorrect imports (this plugin is somehow imported twice in a way which confuses webpack),\n * * mess in `node_modules/` (`rm -rf node_modules/` may help).\n *\n * **Note:** Check the logged `itemName` to better understand which plugin was duplicated/conflicting.\n *\n * @param itemName The name of the model element that is being registered twice.\n * @error schema-cannot-register-item-twice\n */\n throw new CKEditorError('schema-cannot-register-item-twice', this, {\n itemName\n });\n }\n this._sourceDefinitions[itemName] = [\n Object.assign({}, definition)\n ];\n this._clearCache();\n }\n /**\n * Extends a {@link #register registered} item's definition.\n *\n * Extending properties such as `allowIn` will add more items to the existing properties,\n * while redefining properties such as `isBlock` will override the previously defined ones.\n *\n * ```ts\n * schema.register( 'foo', {\n * \tallowIn: '$root',\n * \tisBlock: true;\n * } );\n * schema.extend( 'foo', {\n * \tallowIn: 'blockQuote',\n * \tisBlock: false\n * } );\n *\n * schema.getDefinition( 'foo' );\n * //\t{\n * //\t\tallowIn: [ '$root', 'blockQuote' ],\n * // \t\tisBlock: false\n * //\t}\n * ```\n */\n extend(itemName, definition) {\n if (!this._sourceDefinitions[itemName]) {\n /**\n * Cannot extend an item which was not registered yet.\n *\n * This error happens when a plugin tries to extend the schema definition of an item which was not\n * {@link module:engine/model/schema~Schema#register registered} yet.\n *\n * @param itemName The name of the model element which is being extended.\n * @error schema-cannot-extend-missing-item\n */\n throw new CKEditorError('schema-cannot-extend-missing-item', this, {\n itemName\n });\n }\n this._sourceDefinitions[itemName].push(Object.assign({}, definition));\n this._clearCache();\n }\n /**\n * Returns data of all registered items.\n *\n * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,\n * checking a list of all block elements, etc).\n * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})\n * in other cases.\n */\n getDefinitions() {\n if (!this._compiledDefinitions) {\n this._compile();\n }\n return this._compiledDefinitions;\n }\n /**\n * Returns a definition of the given item or `undefined` if an item is not registered.\n *\n * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,\n * checking a list of all block elements, etc).\n * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})\n * in other cases.\n */\n getDefinition(item) {\n let itemName;\n if (typeof item == 'string') {\n itemName = item;\n }\n else if ('is' in item && (item.is('$text') || item.is('$textProxy'))) {\n itemName = '$text';\n }\n // Element or module:engine/model/schema~SchemaContextItem.\n else {\n itemName = item.name;\n }\n return this.getDefinitions()[itemName];\n }\n /**\n * Returns `true` if the given item is registered in the schema.\n *\n * ```ts\n * schema.isRegistered( 'paragraph' ); // -> true\n * schema.isRegistered( editor.model.document.getRoot() ); // -> true\n * schema.isRegistered( 'foo' ); // -> false\n * ```\n */\n isRegistered(item) {\n return !!this.getDefinition(item);\n }\n /**\n * Returns `true` if the given item is defined to be\n * a block by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isBlock` property.\n *\n * ```ts\n * schema.isBlock( 'paragraph' ); // -> true\n * schema.isBlock( '$root' ); // -> false\n *\n * const paragraphElement = writer.createElement( 'paragraph' );\n * schema.isBlock( paragraphElement ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#block-elements Block elements} section of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isBlock(item) {\n const def = this.getDefinition(item);\n return !!(def && def.isBlock);\n }\n /**\n * Returns `true` if the given item should be treated as a limit element.\n *\n * It considers an item to be a limit element if its\n * {@link module:engine/model/schema~SchemaItemDefinition}'s\n * {@link module:engine/model/schema~SchemaItemDefinition#isLimit `isLimit`} or\n * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property\n * was set to `true`.\n *\n * ```ts\n * schema.isLimit( 'paragraph' ); // -> false\n * schema.isLimit( '$root' ); // -> true\n * schema.isLimit( editor.model.document.getRoot() ); // -> true\n * schema.isLimit( 'imageBlock' ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#limit-elements Limit elements} section of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isLimit(item) {\n const def = this.getDefinition(item);\n if (!def) {\n return false;\n }\n return !!(def.isLimit || def.isObject);\n }\n /**\n * Returns `true` if the given item should be treated as an object element.\n *\n * It considers an item to be an object element if its\n * {@link module:engine/model/schema~SchemaItemDefinition}'s\n * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property\n * was set to `true`.\n *\n * ```ts\n * schema.isObject( 'paragraph' ); // -> false\n * schema.isObject( 'imageBlock' ); // -> true\n *\n * const imageElement = writer.createElement( 'imageBlock' );\n * schema.isObject( imageElement ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#object-elements Object elements} section of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isObject(item) {\n const def = this.getDefinition(item);\n if (!def) {\n return false;\n }\n // Note: Check out the implementation of #isLimit(), #isSelectable(), and #isContent()\n // to understand why these three constitute an object.\n return !!(def.isObject || (def.isLimit && def.isSelectable && def.isContent));\n }\n /**\n * Returns `true` if the given item is defined to be\n * an inline element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isInline` property.\n *\n * ```ts\n * schema.isInline( 'paragraph' ); // -> false\n * schema.isInline( 'softBreak' ); // -> true\n *\n * const text = writer.createText( 'foo' );\n * schema.isInline( text ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#inline-elements Inline elements} section of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isInline(item) {\n const def = this.getDefinition(item);\n return !!(def && def.isInline);\n }\n /**\n * Returns `true` if the given item is defined to be\n * a selectable element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isSelectable` property.\n *\n * ```ts\n * schema.isSelectable( 'paragraph' ); // -> false\n * schema.isSelectable( 'heading1' ); // -> false\n * schema.isSelectable( 'imageBlock' ); // -> true\n * schema.isSelectable( 'tableCell' ); // -> true\n *\n * const text = writer.createText( 'foo' );\n * schema.isSelectable( text ); // -> false\n * ```\n *\n * See the {@glink framework/deep-dive/schema#selectable-elements Selectable elements section} of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isSelectable(item) {\n const def = this.getDefinition(item);\n if (!def) {\n return false;\n }\n return !!(def.isSelectable || def.isObject);\n }\n /**\n * Returns `true` if the given item is defined to be\n * a content by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isContent` property.\n *\n * ```ts\n * schema.isContent( 'paragraph' ); // -> false\n * schema.isContent( 'heading1' ); // -> false\n * schema.isContent( 'imageBlock' ); // -> true\n * schema.isContent( 'horizontalLine' ); // -> true\n *\n * const text = writer.createText( 'foo' );\n * schema.isContent( text ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#content-elements Content elements section} of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isContent(item) {\n const def = this.getDefinition(item);\n if (!def) {\n return false;\n }\n return !!(def.isContent || def.isObject);\n }\n /**\n * Checks whether the given node can be a child of the given context.\n *\n * ```ts\n * schema.checkChild( model.document.getRoot(), paragraph ); // -> false\n *\n * schema.register( 'paragraph', {\n * \tallowIn: '$root'\n * } );\n *\n * schema.checkChild( model.document.getRoot(), paragraph ); // -> true\n * ```\n *\n * Both {@link module:engine/model/schema~Schema#addChildCheck callback checks} and declarative rules (added when\n * {@link module:engine/model/schema~Schema#register registering} and {@link module:engine/model/schema~Schema#extend extending} items)\n * are evaluated when this method is called.\n *\n * Note that callback checks have bigger priority than declarative rules checks and may overwrite them.\n *\n * Note that when verifying whether the given node can be a child of the given context, the schema also verifies the entire\n * context – from its root to its last element. Therefore, it is possible for `checkChild()` to return `false` even though\n * the `context` last element can contain the checked child. It happens if one of the `context` elements does not allow its child.\n * When `context` is verified, {@link module:engine/model/schema~Schema#addChildCheck custom checks} are considered as well.\n *\n * @fires checkChild\n * @param context The context in which the child will be checked.\n * @param def The child to check.\n */\n checkChild(context, def) {\n // Note: `context` and `def` are already normalized here to `SchemaContext` and `SchemaCompiledItemDefinition`.\n if (!def) {\n return false;\n }\n return this._checkContextMatch(context, def);\n }\n /**\n * Checks whether the given attribute can be applied in the given context (on the last item of the context).\n *\n * ```ts\n * schema.checkAttribute( textNode, 'bold' ); // -> false\n *\n * schema.extend( '$text', {\n * \tallowAttributes: 'bold'\n * } );\n *\n * schema.checkAttribute( textNode, 'bold' ); // -> true\n * ```\n *\n * Both {@link module:engine/model/schema~Schema#addAttributeCheck callback checks} and declarative rules (added when\n * {@link module:engine/model/schema~Schema#register registering} and {@link module:engine/model/schema~Schema#extend extending} items)\n * are evaluated when this method is called.\n *\n * Note that callback checks have bigger priority than declarative rules checks and may overwrite them.\n *\n * @fires checkAttribute\n * @param context The context in which the attribute will be checked.\n * @param attributeName Name of attribute to check in the given context.\n */\n checkAttribute(context, attributeName) {\n // Note: `context` is already normalized here to `SchemaContext`.\n const def = this.getDefinition(context.last);\n if (!def) {\n return false;\n }\n // First, check all attribute checks declared as callbacks.\n // Note that `_evaluateAttributeChecks()` will return `undefined` if neither child check was applicable (no decision was made).\n const isAllowed = this._evaluateAttributeChecks(context, attributeName);\n // If the decision was not made inside attribute check callbacks, then use declarative rules.\n return isAllowed !== undefined ? isAllowed : def.allowAttributes.includes(attributeName);\n }\n /**\n * Checks whether the given element (`elementToMerge`) can be merged with the specified base element (`positionOrBaseElement`).\n *\n * In other words – both elements are not a limit elements and whether `elementToMerge`'s children\n * {@link #checkChild are allowed} in the `positionOrBaseElement`.\n *\n * This check ensures that elements merged with {@link module:engine/model/writer~Writer#merge `Writer#merge()`}\n * will be valid.\n *\n * Instead of elements, you can pass the instance of the {@link module:engine/model/position~Position} class as the\n * `positionOrBaseElement`. It means that the elements before and after the position will be checked whether they can be merged.\n *\n * @param positionOrBaseElement The position or base element to which the `elementToMerge` will be merged.\n * @param elementToMerge The element to merge. Required if `positionOrBaseElement` is an element.\n */\n checkMerge(positionOrBaseElement, elementToMerge) {\n if (positionOrBaseElement instanceof Position) {\n const nodeBefore = positionOrBaseElement.nodeBefore;\n const nodeAfter = positionOrBaseElement.nodeAfter;\n if (!(nodeBefore instanceof Element)) {\n /**\n * The node before the merge position must be an element.\n *\n * @error schema-check-merge-no-element-before\n */\n throw new CKEditorError('schema-check-merge-no-element-before', this);\n }\n if (!(nodeAfter instanceof Element)) {\n /**\n * The node after the merge position must be an element.\n *\n * @error schema-check-merge-no-element-after\n */\n throw new CKEditorError('schema-check-merge-no-element-after', this);\n }\n return this.checkMerge(nodeBefore, nodeAfter);\n }\n if (this.isLimit(positionOrBaseElement) || this.isLimit(elementToMerge)) {\n return false;\n }\n for (const child of elementToMerge.getChildren()) {\n if (!this.checkChild(positionOrBaseElement, child)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Allows registering a callback to the {@link #checkChild} method calls.\n *\n * Callbacks allow you to implement rules which are not otherwise possible to achieve\n * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.\n *\n * Note that callback checks have bigger priority than declarative rules checks and may overwrite them.\n *\n * For example, by using this method you can disallow elements in specific contexts:\n *\n * ```ts\n * // Disallow `heading1` inside a `blockQuote` that is inside a table.\n * schema.addChildCheck( ( context, childDefinition ) => {\n * \tif ( context.endsWith( 'tableCell blockQuote' ) ) {\n * \t\treturn false;\n * \t}\n * }, 'heading1' );\n * ```\n *\n * You can skip the optional `itemName` parameter to evaluate the callback for every `checkChild()` call.\n *\n * ```ts\n * // Inside specific custom element, allow only children, which allows for a specific attribute.\n * schema.addChildCheck( ( context, childDefinition ) => {\n * \tif ( context.endsWith( 'myElement' ) ) {\n * \t\treturn childDefinition.allowAttributes.includes( 'myAttribute' );\n * \t}\n * } );\n * ```\n *\n * Please note that the generic callbacks may affect the editor performance and should be avoided if possible.\n *\n * When one of the callbacks makes a decision (returns `true` or `false`) the processing is finished and other callbacks are not fired.\n * Callbacks are fired in the order they were added, however generic callbacks are fired before callbacks added for a specified item.\n *\n * You can also use `checkChild` event, if you need even better control. The result from the example above could also be\n * achieved with following event callback:\n *\n * ```ts\n * schema.on( 'checkChild', ( evt, args ) => {\n * \tconst context = args[ 0 ];\n * \tconst childDefinition = args[ 1 ];\n *\n * \tif ( context.endsWith( 'myElement' ) ) {\n * \t\t// Prevent next listeners from being called.\n * \t\tevt.stop();\n * \t\t// Set the `checkChild()` return value.\n * \t\tevt.return = childDefinition.allowAttributes.includes( 'myAttribute' );\n * \t}\n * }, { priority: 'high' } );\n * ```\n *\n * Note that the callback checks and declarative rules checks are processed on `normal` priority.\n *\n * Adding callbacks this way can also negatively impact editor performance.\n *\n * @param callback The callback to be called. It is called with two parameters:\n * {@link module:engine/model/schema~SchemaContext} (context) instance and\n * {@link module:engine/model/schema~SchemaCompiledItemDefinition} (definition). The callback may return `true/false` to override\n * `checkChild()`'s return value. If it does not return a boolean value, the default algorithm (or other callbacks) will define\n * `checkChild()`'s return value.\n * @param itemName Name of the schema item for which the callback is registered. If specified, the callback will be run only for\n * `checkChild()` calls which `def` parameter matches the `itemName`. Otherwise, the callback will run for every `checkChild` call.\n */\n addChildCheck(callback, itemName) {\n const key = itemName !== undefined ? itemName : this._genericCheckSymbol;\n const checks = this._customChildChecks.get(key) || [];\n checks.push(callback);\n this._customChildChecks.set(key, checks);\n }\n /**\n * Allows registering a callback to the {@link #checkAttribute} method calls.\n *\n * Callbacks allow you to implement rules which are not otherwise possible to achieve\n * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.\n *\n * Note that callback checks have bigger priority than declarative rules checks and may overwrite them.\n *\n * For example, by using this method you can disallow setting attributes on nodes in specific contexts:\n *\n * ```ts\n * // Disallow setting `bold` on text inside `heading1` element:\n * schema.addAttributeCheck( context => {\n * \tif ( context.endsWith( 'heading1 $text' ) ) {\n * \t\treturn false;\n * \t}\n * }, 'bold' );\n * ```\n *\n * You can skip the optional `attributeName` parameter to evaluate the callback for every `checkAttribute()` call.\n *\n * ```ts\n * // Disallow formatting attributes on text inside custom `myTitle` element:\n * schema.addAttributeCheck( ( context, attributeName ) => {\n * \tif ( context.endsWith( 'myTitle $text' ) && schema.getAttributeProperties( attributeName ).isFormatting ) {\n * \t\treturn false;\n * \t}\n * } );\n * ```\n *\n * Please note that the generic callbacks may affect the editor performance and should be avoided if possible.\n *\n * When one of the callbacks makes a decision (returns `true` or `false`) the processing is finished and other callbacks are not fired.\n * Callbacks are fired in the order they were added, however generic callbacks are fired before callbacks added for a specified item.\n *\n * You can also use {@link #event:checkAttribute} event, if you need even better control. The result from the example above could also\n * be achieved with following event callback:\n *\n * ```ts\n * schema.on( 'checkAttribute', ( evt, args ) => {\n * \tconst context = args[ 0 ];\n * \tconst attributeName = args[ 1 ];\n *\n * \tif ( context.endsWith( 'myTitle $text' ) && schema.getAttributeProperties( attributeName ).isFormatting ) {\n * \t\t// Prevent next listeners from being called.\n * \t\tevt.stop();\n * \t\t// Set the `checkAttribute()` return value.\n * \t\tevt.return = false;\n * \t}\n * }, { priority: 'high' } );\n * ```\n *\n * Note that the callback checks and declarative rules checks are processed on `normal` priority.\n *\n * Adding callbacks this way can also negatively impact editor performance.\n *\n * @param callback The callback to be called. It is called with two parameters:\n * {@link module:engine/model/schema~SchemaContext `context`} and attribute name. The callback may return `true` or `false`, to\n * override `checkAttribute()`'s return value. If it does not return a boolean value, the default algorithm (or other callbacks)\n * will define `checkAttribute()`'s return value.\n * @param attributeName Name of the attribute for which the callback is registered. If specified, the callback will be run only for\n * `checkAttribute()` calls with matching `attributeName`. Otherwise, the callback will run for every `checkAttribute()` call.\n */\n addAttributeCheck(callback, attributeName) {\n const key = attributeName !== undefined ? attributeName : this._genericCheckSymbol;\n const checks = this._customAttributeChecks.get(key) || [];\n checks.push(callback);\n this._customAttributeChecks.set(key, checks);\n }\n /**\n * This method allows assigning additional metadata to the model attributes. For example,\n * {@link module:engine/model/schema~AttributeProperties `AttributeProperties#isFormatting` property} is\n * used to mark formatting attributes (like `bold` or `italic`).\n *\n * ```ts\n * // Mark bold as a formatting attribute.\n * schema.setAttributeProperties( 'bold', {\n * \tisFormatting: true\n * } );\n *\n * // Override code not to be considered a formatting markup.\n * schema.setAttributeProperties( 'code', {\n * \tisFormatting: false\n * } );\n * ```\n *\n * Properties are not limited to members defined in the\n * {@link module:engine/model/schema~AttributeProperties `AttributeProperties` type} and you can also use custom properties:\n *\n * ```ts\n * schema.setAttributeProperties( 'blockQuote', {\n * \tcustomProperty: 'value'\n * } );\n * ```\n *\n * Subsequent calls with the same attribute will extend its custom properties:\n *\n * ```ts\n * schema.setAttributeProperties( 'blockQuote', {\n * \tone: 1\n * } );\n *\n * schema.setAttributeProperties( 'blockQuote', {\n * \ttwo: 2\n * } );\n *\n * console.log( schema.getAttributeProperties( 'blockQuote' ) );\n * // Logs: { one: 1, two: 2 }\n * ```\n *\n * @param attributeName A name of the attribute to receive the properties.\n * @param properties A dictionary of properties.\n */\n setAttributeProperties(attributeName, properties) {\n this._attributeProperties[attributeName] = Object.assign(this.getAttributeProperties(attributeName), properties);\n }\n /**\n * Returns properties associated with a given model attribute. See {@link #setAttributeProperties `setAttributeProperties()`}.\n *\n * @param attributeName A name of the attribute.\n */\n getAttributeProperties(attributeName) {\n return this._attributeProperties[attributeName] || {};\n }\n /**\n * Returns the lowest {@link module:engine/model/schema~Schema#isLimit limit element} containing the entire\n * selection/range/position or the root otherwise.\n *\n * @param selectionOrRangeOrPosition The selection/range/position to check.\n * @returns The lowest limit element containing the entire `selectionOrRangeOrPosition`.\n */\n getLimitElement(selectionOrRangeOrPosition) {\n let element;\n if (selectionOrRangeOrPosition instanceof Position) {\n element = selectionOrRangeOrPosition.parent;\n }\n else {\n const ranges = selectionOrRangeOrPosition instanceof Range ?\n [selectionOrRangeOrPosition] :\n Array.from(selectionOrRangeOrPosition.getRanges());\n // Find the common ancestor for all selection's ranges.\n element = ranges\n .reduce((element, range) => {\n const rangeCommonAncestor = range.getCommonAncestor();\n if (!element) {\n return rangeCommonAncestor;\n }\n return element.getCommonAncestor(rangeCommonAncestor, { includeSelf: true });\n }, null);\n }\n while (!this.isLimit(element)) {\n if (element.parent) {\n element = element.parent;\n }\n else {\n break;\n }\n }\n return element;\n }\n /**\n * Checks whether the attribute is allowed in selection:\n *\n * * if the selection is not collapsed, then checks if the attribute is allowed on any of nodes in that range,\n * * if the selection is collapsed, then checks if on the selection position there's a text with the\n * specified attribute allowed.\n *\n * @param selection Selection which will be checked.\n * @param attribute The name of the attribute to check.\n */\n checkAttributeInSelection(selection, attribute) {\n if (selection.isCollapsed) {\n const firstPosition = selection.getFirstPosition();\n const context = [\n ...firstPosition.getAncestors(),\n new Text('', selection.getAttributes())\n ];\n // Check whether schema allows for a text with the attribute in the selection.\n return this.checkAttribute(context, attribute);\n }\n else {\n const ranges = selection.getRanges();\n // For all ranges, check nodes in them until you find a node that is allowed to have the attribute.\n for (const range of ranges) {\n for (const value of range) {\n if (this.checkAttribute(value.item, attribute)) {\n // If we found a node that is allowed to have the attribute, return true.\n return true;\n }\n }\n }\n }\n // If we haven't found such node, return false.\n return false;\n }\n /**\n * Transforms the given set of ranges into a set of ranges where the given attribute is allowed (and can be applied).\n *\n * @param ranges Ranges to be validated.\n * @param attribute The name of the attribute to check.\n * @returns Ranges in which the attribute is allowed.\n */\n *getValidRanges(ranges, attribute) {\n ranges = convertToMinimalFlatRanges(ranges);\n for (const range of ranges) {\n yield* this._getValidRangesForRange(range, attribute);\n }\n }\n /**\n * Basing on given `position`, finds and returns a {@link module:engine/model/range~Range range} which is\n * nearest to that `position` and is a correct range for selection.\n *\n * The correct selection range might be collapsed when it is located in a position where the text node can be placed.\n * Non-collapsed range is returned when selection can be placed around element marked as an \"object\" in\n * the {@link module:engine/model/schema~Schema schema}.\n *\n * Direction of searching for the nearest correct selection range can be specified as:\n *\n * * `both` - searching will be performed in both ways,\n * * `forward` - searching will be performed only forward,\n * * `backward` - searching will be performed only backward.\n *\n * When valid selection range cannot be found, `null` is returned.\n *\n * @param position Reference position where new selection range should be looked for.\n * @param direction Search direction.\n * @returns Nearest selection range or `null` if one cannot be found.\n */\n getNearestSelectionRange(position, direction = 'both') {\n if (position.root.rootName == '$graveyard') {\n // No valid selection range in the graveyard.\n // This is important when getting the document selection default range.\n return null;\n }\n // Return collapsed range if provided position is valid.\n if (this.checkChild(position, '$text')) {\n return new Range(position);\n }\n let backwardWalker, forwardWalker;\n // Never leave a limit element.\n const limitElement = position.getAncestors().reverse().find(item => this.isLimit(item)) ||\n position.root;\n if (direction == 'both' || direction == 'backward') {\n backwardWalker = new TreeWalker({\n boundaries: Range._createIn(limitElement),\n startPosition: position,\n direction: 'backward'\n });\n }\n if (direction == 'both' || direction == 'forward') {\n forwardWalker = new TreeWalker({\n boundaries: Range._createIn(limitElement),\n startPosition: position\n });\n }\n for (const data of combineWalkers(backwardWalker, forwardWalker)) {\n const type = (data.walker == backwardWalker ? 'elementEnd' : 'elementStart');\n const value = data.value;\n if (value.type == type && this.isObject(value.item)) {\n return Range._createOn(value.item);\n }\n if (this.checkChild(value.nextPosition, '$text')) {\n return new Range(value.nextPosition);\n }\n }\n return null;\n }\n /**\n * Tries to find position ancestors that allow to insert a given node.\n * It starts searching from the given position and goes node by node to the top of the model tree\n * as long as a {@link module:engine/model/schema~Schema#isLimit limit element}, an\n * {@link module:engine/model/schema~Schema#isObject object element} or a topmost ancestor is not reached.\n *\n * @param position The position that the search will start from.\n * @param node The node for which an allowed parent should be found or its name.\n * @returns Allowed parent or null if nothing was found.\n */\n findAllowedParent(position, node) {\n let parent = position.parent;\n while (parent) {\n if (this.checkChild(parent, node)) {\n return parent;\n }\n // Do not split limit elements.\n if (this.isLimit(parent)) {\n return null;\n }\n parent = parent.parent;\n }\n return null;\n }\n /**\n * Sets attributes allowed by the schema on a given node.\n *\n * @param node A node to set attributes on.\n * @param attributes Attributes keys and values.\n * @param writer An instance of the model writer.\n */\n setAllowedAttributes(node, attributes, writer) {\n const model = writer.model;\n for (const [attributeName, attributeValue] of Object.entries(attributes)) {\n if (model.schema.checkAttribute(node, attributeName)) {\n writer.setAttribute(attributeName, attributeValue, node);\n }\n }\n }\n /**\n * Removes attributes disallowed by the schema.\n *\n * @param nodes Nodes that will be filtered.\n */\n removeDisallowedAttributes(nodes, writer) {\n for (const node of nodes) {\n // When node is a `Text` it has no children, so just filter it out.\n if (node.is('$text')) {\n removeDisallowedAttributeFromNode(this, node, writer);\n }\n // In a case of `Element` iterates through positions between nodes inside this element\n // and filter out node before the current position, or position parent when position\n // is at start of an element. Using positions prevent from omitting merged nodes\n // see https://github.com/ckeditor/ckeditor5-engine/issues/1789.\n else {\n const rangeInNode = Range._createIn(node);\n const positionsInRange = rangeInNode.getPositions();\n for (const position of positionsInRange) {\n const item = position.nodeBefore || position.parent;\n removeDisallowedAttributeFromNode(this, item, writer);\n }\n }\n }\n }\n /**\n * Gets attributes of a node that have a given property.\n *\n * @param node Node to get attributes from.\n * @param propertyName Name of the property that attribute must have to return it.\n * @param propertyValue Desired value of the property that we want to check.\n * When `undefined` attributes will be returned if they have set a given property no matter what the value is. If specified it will\n * return attributes which given property's value is equal to this parameter.\n * @returns Object with attributes' names as key and attributes' values as value.\n */\n getAttributesWithProperty(node, propertyName, propertyValue) {\n const attributes = {};\n for (const [attributeName, attributeValue] of node.getAttributes()) {\n const attributeProperties = this.getAttributeProperties(attributeName);\n if (attributeProperties[propertyName] === undefined) {\n continue;\n }\n if (propertyValue === undefined || propertyValue === attributeProperties[propertyName]) {\n attributes[attributeName] = attributeValue;\n }\n }\n return attributes;\n }\n /**\n * Creates an instance of the schema context.\n */\n createContext(context) {\n return new SchemaContext(context);\n }\n _clearCache() {\n this._compiledDefinitions = null;\n }\n _compile() {\n const definitions = {};\n const sourceRules = this._sourceDefinitions;\n const itemNames = Object.keys(sourceRules);\n for (const itemName of itemNames) {\n definitions[itemName] = compileBaseItemRule(sourceRules[itemName], itemName);\n }\n const items = Object.values(definitions);\n // Sometimes features add rules (allows, disallows) for items that has not been registered yet. We allow that, to make it easier\n // to put the schema together. However, sometimes these items are never registered. To prevent operating\n // removeUnregisteredEntries( definitions, items );\n // 1. Propagate `childItem.allowIn` to `parentItem.allowChildren` and vice versa, so that these properties are completely mirrored\n // for all children and parents. Do the same for `disallowIn` and `disallowChildren`.\n for (const item of items) {\n propagateAllowIn(definitions, item);\n propagateAllowChildren(definitions, item);\n propagateDisallowIn(definitions, item);\n propagateDisallowChildren(definitions, item);\n }\n // 2. Remove from `allowIn` and `allowChildren` these items which where disallowed by `disallowIn` and `disallowChildren`.\n // Do the same for attributes. Now we have a clear situation where which item/attribute is allowed. Inheritance is in next steps.\n for (const item of items) {\n resolveDisallows(definitions, item);\n }\n // 3. Compile `item.allowContentOf` property. For each entry in `allowContentOf`, we want to take `allowChildren` and rewrite\n // them into `item.allowChildren`. `item.disallowChildren` is used to filter out some entries. This way \"own rules\" have higher\n // priority than \"inherited rules\". Mirroring from step 1. is maintained.\n for (const item of items) {\n compileAllowContentOf(definitions, item);\n }\n // 4. Compile `item.allowWhere` property. For each entry in `allowWhere`, we want to take `allowIn` and rewrite them into\n // `item.allowIn`. `item.disallowIn` is used to filter out some entries. This way \"own rules\" have higher priority than\n // \"inherited rules\". Mirroring from step 1. is maintained.\n for (const item of items) {\n compileAllowWhere(definitions, item);\n }\n // 5. Compile `item.allowAttributesOf`. For each entry in `allowAttributesOf`, we want to take `allowAttributes` and rewrite them\n // into `item.allowAttributes`. `item.disallowAttributes` is used to filter out some entries. This way \"own rules\" have higher\n // priority than \"inherited rules\".\n for (const item of items) {\n compileAllowAttributesOf(definitions, item);\n }\n // 6. Compile `item.inheritTypesFrom` property. For each entry in `inheritTypesFrom`, we want to take `is*` properties and\n // set them on `item` (if they are not set yet).\n for (const item of items) {\n compileInheritPropertiesFrom(definitions, item);\n }\n // Compile final definitions. Unnecessary properties are removed and some additional cleaning is applied.\n this._compiledDefinitions = compileDefinitions(definitions);\n }\n _checkContextMatch(context, def) {\n const parentItem = context.last;\n // First, check all child checks declared as callbacks.\n // Note that `_evaluateChildChecks()` will return `undefined` if neither child check was applicable (no decision was made).\n let isAllowed = this._evaluateChildChecks(context, def);\n // If the decision was not made inside child check callbacks, then use declarative rules.\n isAllowed = isAllowed !== undefined ? isAllowed : def.allowIn.includes(parentItem.name);\n // If the item is not allowed in the `context`, return `false`.\n if (!isAllowed) {\n return false;\n }\n // If the item is allowed, recursively verify the rest of the `context`.\n const parentItemDefinition = this.getDefinition(parentItem);\n const parentContext = context.trimLast();\n // One of the items in the original `context` did not have a definition specified. In this case, the whole context is disallowed.\n if (!parentItemDefinition) {\n return false;\n }\n // Whole `context` was verified and passed checks.\n if (parentContext.length == 0) {\n return true;\n }\n // Verify \"truncated\" parent context. The last item of the original context is now the definition to check.\n return this._checkContextMatch(parentContext, parentItemDefinition);\n }\n /**\n * Calls child check callbacks to decide whether `def` is allowed in `context`. It uses both generic and specific (defined for `def`\n * item) callbacks. If neither callback makes a decision, `undefined` is returned.\n *\n * Note that the first callback that makes a decision \"wins\", i.e., if any callback returns `true` or `false`, then the processing\n * is over and that result is returned.\n */\n _evaluateChildChecks(context, def) {\n const genericChecks = this._customChildChecks.get(this._genericCheckSymbol) || [];\n const childChecks = this._customChildChecks.get(def.name) || [];\n for (const check of [...genericChecks, ...childChecks]) {\n const result = check(context, def);\n if (result !== undefined) {\n return result;\n }\n }\n }\n /**\n * Calls attribute check callbacks to decide whether `attributeName` can be set on the last element of `context`. It uses both\n * generic and specific (defined for `attributeName`) callbacks. If neither callback makes a decision, `undefined` is returned.\n *\n * Note that the first callback that makes a decision \"wins\", i.e., if any callback returns `true` or `false`, then the processing\n * is over and that result is returned.\n */\n _evaluateAttributeChecks(context, attributeName) {\n const genericChecks = this._customAttributeChecks.get(this._genericCheckSymbol) || [];\n const childChecks = this._customAttributeChecks.get(attributeName) || [];\n for (const check of [...genericChecks, ...childChecks]) {\n const result = check(context, attributeName);\n if (result !== undefined) {\n return result;\n }\n }\n }\n /**\n * Takes a flat range and an attribute name. Traverses the range recursively and deeply to find and return all ranges\n * inside the given range on which the attribute can be applied.\n *\n * This is a helper function for {@link ~Schema#getValidRanges}.\n *\n * @param range The range to process.\n * @param attribute The name of the attribute to check.\n * @returns Ranges in which the attribute is allowed.\n */\n *_getValidRangesForRange(range, attribute) {\n let start = range.start;\n let end = range.start;\n for (const item of range.getItems({ shallow: true })) {\n if (item.is('element')) {\n yield* this._getValidRangesForRange(Range._createIn(item), attribute);\n }\n if (!this.checkAttribute(item, attribute)) {\n if (!start.isEqual(end)) {\n yield new Range(start, end);\n }\n start = Position._createAfter(item);\n }\n end = Position._createAfter(item);\n }\n if (!start.isEqual(end)) {\n yield new Range(start, end);\n }\n }\n /**\n * Returns a model range which is optimal (in terms of UX) for inserting a widget block.\n *\n * For instance, if a selection is in the middle of a paragraph, the collapsed range before this paragraph\n * will be returned so that it is not split. If the selection is at the end of a paragraph,\n * the collapsed range after this paragraph will be returned.\n *\n * Note: If the selection is placed in an empty block, the range in that block will be returned. If that range\n * is then passed to {@link module:engine/model/model~Model#insertContent}, the block will be fully replaced\n * by the inserted widget block.\n *\n * @internal\n * @param selection The selection based on which the insertion position should be calculated.\n * @param place The place where to look for optimal insertion range.\n * The `auto` value will determine itself the best position for insertion.\n * The `before` value will try to find a position before selection.\n * The `after` value will try to find a position after selection.\n * @returns The optimal range.\n */\n findOptimalInsertionRange(selection, place) {\n const selectedElement = selection.getSelectedElement();\n if (selectedElement && this.isObject(selectedElement) && !this.isInline(selectedElement)) {\n if (place == 'before' || place == 'after') {\n return new Range(Position._createAt(selectedElement, place));\n }\n return Range._createOn(selectedElement);\n }\n const firstBlock = first(selection.getSelectedBlocks());\n // There are no block elements within ancestors (in the current limit element).\n if (!firstBlock) {\n return new Range(selection.focus);\n }\n // If inserting into an empty block – return position in that block. It will get\n // replaced with the image by insertContent(). #42.\n if (firstBlock.isEmpty) {\n return new Range(Position._createAt(firstBlock, 0));\n }\n const positionAfter = Position._createAfter(firstBlock);\n // If selection is at the end of the block - return position after the block.\n if (selection.focus.isTouching(positionAfter)) {\n return new Range(positionAfter);\n }\n // Otherwise, return position before the block.\n return new Range(Position._createBefore(firstBlock));\n }\n}\n/**\n * A schema context – a list of ancestors of a given position in the document.\n *\n * Considering such position:\n *\n * ```xml\n * <$root>\n * \t<blockQuote>\n * \t\t<paragraph>\n * \t\t\t^\n * \t\t</paragraph>\n * \t</blockQuote>\n * </$root>\n * ```\n *\n * The context of this position is its {@link module:engine/model/position~Position#getAncestors lists of ancestors}:\n *\n *\t\t[ rootElement, blockQuoteElement, paragraphElement ]\n *\n * Contexts are used in the {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`} and\n * {@link module:engine/model/schema~Schema#event:checkAttribute `Schema#checkAttribute`} events as a definition\n * of a place in the document where the check occurs. The context instances are created based on the first arguments\n * of the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} and\n * {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} methods so when\n * using these methods you need to use {@link module:engine/model/schema~SchemaContextDefinition}s.\n */\nexport class SchemaContext {\n /**\n * Creates an instance of the context.\n */\n constructor(context) {\n if (context instanceof SchemaContext) {\n return context;\n }\n let items;\n if (typeof context == 'string') {\n items = [context];\n }\n else if (!Array.isArray(context)) {\n // `context` is item or position.\n // Position#getAncestors() doesn't accept any parameters but it works just fine here.\n items = context.getAncestors({ includeSelf: true });\n }\n else {\n items = context;\n }\n this._items = items.map(mapContextItem);\n }\n /**\n * The number of items.\n */\n get length() {\n return this._items.length;\n }\n /**\n * The last item (the lowest node).\n */\n get last() {\n return this._items[this._items.length - 1];\n }\n /**\n * Iterable interface.\n *\n * Iterates over all context items.\n */\n [Symbol.iterator]() {\n return this._items[Symbol.iterator]();\n }\n /**\n * Returns a new schema context instance with an additional item.\n *\n * Item can be added as:\n *\n * ```ts\n * const context = new SchemaContext( [ '$root' ] );\n *\n * // An element.\n * const fooElement = writer.createElement( 'fooElement' );\n * const newContext = context.push( fooElement ); // [ '$root', 'fooElement' ]\n *\n * // A text node.\n * const text = writer.createText( 'foobar' );\n * const newContext = context.push( text ); // [ '$root', '$text' ]\n *\n * // A string (element name).\n * const newContext = context.push( 'barElement' ); // [ '$root', 'barElement' ]\n * ```\n *\n * **Note** {@link module:engine/model/node~Node} that is already in the model tree will be added as the only item\n * (without ancestors).\n *\n * @param item An item that will be added to the current context.\n * @returns A new schema context instance with an additional item.\n */\n push(item) {\n const ctx = new SchemaContext([item]);\n ctx._items = [...this._items, ...ctx._items];\n return ctx;\n }\n /**\n * Returns a new schema context that is based on this context but has the last item removed.\n *\n * ```ts\n * const ctxParagraph = new SchemaContext( [ '$root', 'blockQuote', 'paragraph' ] );\n * const ctxBlockQuote = ctxParagraph.trimLast(); // Items in `ctxBlockQuote` are: `$root` an `blockQuote`.\n * const ctxRoot = ctxBlockQuote.trimLast(); // Items in `ctxRoot` are: `$root`.\n * ```\n *\n * @returns A new reduced schema context instance.\n */\n trimLast() {\n const ctx = new SchemaContext([]);\n ctx._items = this._items.slice(0, -1);\n return ctx;\n }\n /**\n * Gets an item on the given index.\n */\n getItem(index) {\n return this._items[index];\n }\n /**\n * Returns the names of items.\n */\n *getNames() {\n yield* this._items.map(item => item.name);\n }\n /**\n * Checks whether the context ends with the given nodes.\n *\n * ```ts\n * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );\n *\n * ctx.endsWith( '$text' ); // -> true\n * ctx.endsWith( 'paragraph $text' ); // -> true\n * ctx.endsWith( '$root' ); // -> false\n * ctx.endsWith( 'paragraph' ); // -> false\n * ```\n */\n endsWith(query) {\n return Array.from(this.getNames()).join(' ').endsWith(query);\n }\n /**\n * Checks whether the context starts with the given nodes.\n *\n * ```ts\n * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );\n *\n * ctx.endsWith( '$root' ); // -> true\n * ctx.endsWith( '$root paragraph' ); // -> true\n * ctx.endsWith( '$text' ); // -> false\n * ctx.endsWith( 'paragraph' ); // -> false\n * ```\n */\n startsWith(query) {\n return Array.from(this.getNames()).join(' ').startsWith(query);\n }\n}\nfunction compileBaseItemRule(sourceItemRules, itemName) {\n const itemRule = {\n name: itemName,\n allowIn: new Set(),\n allowChildren: new Set(),\n disallowIn: new Set(),\n disallowChildren: new Set(),\n allowContentOf: new Set(),\n allowWhere: new Set(),\n allowAttributes: new Set(),\n disallowAttributes: new Set(),\n allowAttributesOf: new Set(),\n inheritTypesFrom: new Set()\n };\n copyTypes(sourceItemRules, itemRule);\n copyProperty(sourceItemRules, itemRule, 'allowIn');\n copyProperty(sourceItemRules, itemRule, 'allowChildren');\n copyProperty(sourceItemRules, itemRule, 'disallowIn');\n copyProperty(sourceItemRules, itemRule, 'disallowChildren');\n copyProperty(sourceItemRules, itemRule, 'allowContentOf');\n copyProperty(sourceItemRules, itemRule, 'allowWhere');\n copyProperty(sourceItemRules, itemRule, 'allowAttributes');\n copyProperty(sourceItemRules, itemRule, 'disallowAttributes');\n copyProperty(sourceItemRules, itemRule, 'allowAttributesOf');\n copyProperty(sourceItemRules, itemRule, 'inheritTypesFrom');\n resolveInheritAll(sourceItemRules, itemRule);\n return itemRule;\n}\nfunction propagateAllowIn(definitions, item) {\n for (const parentName of item.allowIn) {\n const parentItem = definitions[parentName];\n if (parentItem) {\n parentItem.allowChildren.add(item.name);\n }\n else {\n item.allowIn.delete(parentName);\n }\n }\n}\nfunction propagateAllowChildren(definitions, item) {\n for (const childName of item.allowChildren) {\n const childItem = definitions[childName];\n if (childItem) {\n childItem.allowIn.add(item.name);\n }\n else {\n item.allowChildren.delete(childName);\n }\n }\n}\nfunction propagateDisallowIn(definitions, item) {\n for (const parentName of item.disallowIn) {\n const parentItem = definitions[parentName];\n if (parentItem) {\n parentItem.disallowChildren.add(item.name);\n }\n else {\n item.disallowIn.delete(parentName);\n }\n }\n}\nfunction propagateDisallowChildren(definitions, item) {\n for (const childName of item.disallowChildren) {\n const childItem = definitions[childName];\n if (childItem) {\n childItem.disallowIn.add(item.name);\n }\n else {\n item.disallowChildren.delete(childName);\n }\n }\n}\nfunction resolveDisallows(definitions, item) {\n for (const childName of item.disallowChildren) {\n item.allowChildren.delete(childName);\n }\n for (const parentName of item.disallowIn) {\n item.allowIn.delete(parentName);\n }\n for (const attributeName of item.disallowAttributes) {\n item.allowAttributes.delete(attributeName);\n }\n}\nfunction compileAllowContentOf(definitions, item) {\n for (const allowContentOfItemName of item.allowContentOf) {\n const baseItem = definitions[allowContentOfItemName];\n if (!baseItem) {\n continue;\n }\n // Copy `disallowChildren` to propagate this \"knowledge\" down the inheritance chain. The inheritance may involve multiple items and\n // if this is not propagated, then items down the chain may start to allow for items that were disallowed by previous base items.\n //\n // The scenarios were it is important involves multiple inherits both on parent items side and on the child items side.\n baseItem.disallowChildren.forEach(childName => {\n // Own item's rules takes precedence before inherited.\n // If the item directly allows for given child, ignore that base item disallowed that child.\n if (item.allowChildren.has(childName)) {\n return;\n }\n item.disallowChildren.add(childName);\n definitions[childName].disallowIn.add(item.name);\n });\n // Copy `allowChildren` from the base item to allow for the same items.\n baseItem.allowChildren.forEach(childName => {\n // Own item's rules takes precedence before inherited.\n // Also, `item.disallowChildren` might get some new items during inheritance process.\n if (item.disallowChildren.has(childName)) {\n return;\n }\n item.allowChildren.add(childName);\n definitions[childName].allowIn.add(item.name);\n });\n }\n}\nfunction compileAllowWhere(definitions, item) {\n for (const allowWhereItemName of item.allowWhere) {\n const baseItem = definitions[allowWhereItemName];\n if (!baseItem) {\n continue;\n }\n // Copy `disallowIn` to propagate this \"knowledge\" down the inheritance chain. The inheritance may involve multiple items and\n // if this is not propagated, then items down the chain may start to be allowed in items in which they were disallowed previously.\n //\n // The scenarios were it is important involves multiple inherits both on parent items side and on the child items side.\n baseItem.disallowIn.forEach(parentName => {\n // Own item's rules takes precedence before inherited.\n // If the item is directly allowed in given parent, ignore that base item was disallowed in it.\n if (item.allowIn.has(parentName)) {\n return;\n }\n item.disallowIn.add(parentName);\n definitions[parentName].disallowChildren.add(item.name);\n });\n // Copy `allowIn` from the base item to allow item in same parents.\n baseItem.allowIn.forEach(parentName => {\n // Own item's rules takes precedence before inherited.\n // Also, `item.disallowIn` might get some new items during inheritance process.\n if (item.disallowIn.has(parentName)) {\n return;\n }\n item.allowIn.add(parentName);\n definitions[parentName].allowChildren.add(item.name);\n });\n }\n}\nfunction compileDefinitions(definitions) {\n const finalDefinitions = {};\n for (const item of Object.values(definitions)) {\n finalDefinitions[item.name] = {\n name: item.name,\n // `is*` properties may not be set - convert `undefined` to `false`.\n isBlock: !!item.isBlock,\n isContent: !!item.isContent,\n isInline: !!item.isInline,\n isLimit: !!item.isLimit,\n isObject: !!item.isObject,\n isSelectable: !!item.isSelectable,\n // Filter out non-existing items.\n allowIn: Array.from(item.allowIn).filter(name => !!definitions[name]),\n allowChildren: Array.from(item.allowChildren).filter(name => !!definitions[name]),\n allowAttributes: Array.from(item.allowAttributes)\n };\n }\n return finalDefinitions;\n}\nfunction compileAllowAttributesOf(definitions, item) {\n for (const allowAttributeOfItemName of item.allowAttributesOf) {\n const baseItem = definitions[allowAttributeOfItemName];\n if (!baseItem) {\n return;\n }\n baseItem.allowAttributes.forEach(attributeName => {\n if (item.disallowAttributes.has(attributeName)) {\n return;\n }\n item.allowAttributes.add(attributeName);\n });\n }\n}\nfunction compileInheritPropertiesFrom(definitions, item) {\n for (const inheritPropertiesOfItemName of item.inheritTypesFrom) {\n const inheritFrom = definitions[inheritPropertiesOfItemName];\n if (inheritFrom) {\n const typeNames = Object.keys(inheritFrom).filter(name => name.startsWith('is'));\n for (const name of typeNames) {\n if (!(name in item)) {\n item[name] = inheritFrom[name];\n }\n }\n }\n }\n}\nfunction copyTypes(sourceItemRules, itemRule) {\n for (const sourceItemRule of sourceItemRules) {\n const typeNames = Object.keys(sourceItemRule).filter(name => name.startsWith('is'));\n for (const name of typeNames) {\n itemRule[name] = !!sourceItemRule[name];\n }\n }\n}\nfunction copyProperty(sourceItemRules, itemRule, propertyName) {\n for (const sourceItemRule of sourceItemRules) {\n let value = sourceItemRule[propertyName];\n // `value` can be a string, an array or undefined.\n // Convert a string to an array with one item, then handle an array. Skip undefined this way.\n if (typeof value == 'string') {\n value = [value];\n }\n if (Array.isArray(value)) {\n value.forEach(singleValue => itemRule[propertyName].add(singleValue));\n }\n }\n}\nfunction resolveInheritAll(sourceItemRules, itemRule) {\n for (const sourceItemRule of sourceItemRules) {\n const inheritFrom = sourceItemRule.inheritAllFrom;\n if (inheritFrom) {\n itemRule.allowContentOf.add(inheritFrom);\n itemRule.allowWhere.add(inheritFrom);\n itemRule.allowAttributesOf.add(inheritFrom);\n itemRule.inheritTypesFrom.add(inheritFrom);\n }\n }\n}\nfunction mapContextItem(ctxItem) {\n if (typeof ctxItem == 'string' || ctxItem.is('documentFragment')) {\n return {\n name: typeof ctxItem == 'string' ? ctxItem : '$documentFragment',\n *getAttributeKeys() { },\n getAttribute() { }\n };\n }\n else {\n return {\n // '$text' means text nodes and text proxies.\n name: ctxItem.is('element') ? ctxItem.name : '$text',\n *getAttributeKeys() {\n yield* ctxItem.getAttributeKeys();\n },\n getAttribute(key) {\n return ctxItem.getAttribute(key);\n }\n };\n }\n}\n/**\n * Generator function returning values from provided walkers, switching between them at each iteration. If only one walker\n * is provided it will return data only from that walker.\n *\n * @param backward Walker iterating in backward direction.\n * @param forward Walker iterating in forward direction.\n * @returns Object returned at each iteration contains `value` and `walker` (informing which walker returned\n * given value) fields.\n */\nfunction* combineWalkers(backward, forward) {\n let done = false;\n while (!done) {\n done = true;\n if (backward) {\n const step = backward.next();\n if (!step.done) {\n done = false;\n yield {\n walker: backward,\n value: step.value\n };\n }\n }\n if (forward) {\n const step = forward.next();\n if (!step.done) {\n done = false;\n yield {\n walker: forward,\n value: step.value\n };\n }\n }\n }\n}\n/**\n * Takes an array of non-intersecting ranges. For each of them gets minimal flat ranges covering that range and returns\n * all those minimal flat ranges.\n *\n * @param ranges Ranges to process.\n * @returns Minimal flat ranges of given `ranges`.\n */\nfunction* convertToMinimalFlatRanges(ranges) {\n for (const range of ranges) {\n yield* range.getMinimalFlatRanges();\n }\n}\nfunction removeDisallowedAttributeFromNode(schema, node, writer) {\n for (const attribute of node.getAttributeKeys()) {\n if (!schema.checkAttribute(node, attribute)) {\n writer.removeAttribute(attribute, node);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/upcastdispatcher\n */\nimport ViewConsumable from './viewconsumable.js';\nimport ModelRange from '../model/range.js';\nimport ModelPosition from '../model/position.js';\nimport { SchemaContext } from '../model/schema.js'; // eslint-disable-line no-duplicate-imports\nimport { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing.js';\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of\n * converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or\n * {@link module:engine/view/element~Element view element} into a correct model structure.\n *\n * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~Node view nodes}\n * from the converted view document fragment.\n * Special callbacks called \"converters\" should listen to these events in order to convert the view nodes.\n *\n * The second parameter of the callback is the `data` object with the following properties:\n *\n * * `data.viewItem` contains a {@link module:engine/view/node~Node view node} or a\n * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}\n * that is converted at the moment and might be handled by the callback.\n * * `data.modelRange` is used to point to the result\n * of the current conversion (e.g. the element that is being inserted)\n * and is always a {@link module:engine/model/range~Range} when the conversion succeeds.\n * * `data.modelCursor` is a {@link module:engine/model/position~Position position} on which the converter should insert\n * the newly created items.\n *\n * The third parameter of the callback is an instance of {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi}\n * which provides additional tools for converters.\n *\n * You can read more about conversion in the {@glink framework/deep-dive/conversion/upcast Upcast conversion} guide.\n *\n * Examples of event-based converters:\n *\n * ```ts\n * // A converter for links (<a>).\n * editor.data.upcastDispatcher.on( 'element:a', ( evt, data, conversionApi ) => {\n * \tif ( conversionApi.consumable.consume( data.viewItem, { name: true, attributes: [ 'href' ] } ) ) {\n * \t\t// The <a> element is inline and is represented by an attribute in the model.\n * \t\t// This is why you need to convert only children.\n * \t\tconst { modelRange } = conversionApi.convertChildren( data.viewItem, data.modelCursor );\n *\n * \t\tfor ( let item of modelRange.getItems() ) {\n * \t\t\tif ( conversionApi.schema.checkAttribute( item, 'linkHref' ) ) {\n * \t\t\t\tconversionApi.writer.setAttribute( 'linkHref', data.viewItem.getAttribute( 'href' ), item );\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n *\n * // Convert <p> element's font-size style.\n * // Note: You should use a low-priority observer in order to ensure that\n * // it is executed after the element-to-element converter.\n * editor.data.upcastDispatcher.on( 'element:p', ( evt, data, conversionApi ) => {\n * \tconst { consumable, schema, writer } = conversionApi;\n *\n * \tif ( !consumable.consume( data.viewItem, { style: 'font-size' } ) ) {\n * \t\treturn;\n * \t}\n *\n * \tconst fontSize = data.viewItem.getStyle( 'font-size' );\n *\n * \t// Do not go for the model element after data.modelCursor because it might happen\n * \t// that a single view element was converted to multiple model elements. Get all of them.\n * \tfor ( const item of data.modelRange.getItems( { shallow: true } ) ) {\n * \t\tif ( schema.checkAttribute( item, 'fontSize' ) ) {\n * \t\t\twriter.setAttribute( 'fontSize', fontSize, item );\n * \t\t}\n * \t}\n * }, { priority: 'low' } );\n *\n * // Convert all elements which have no custom converter into a paragraph (autoparagraphing).\n * editor.data.upcastDispatcher.on( 'element', ( evt, data, conversionApi ) => {\n * \t// Check if an element can be converted.\n * \tif ( !conversionApi.consumable.test( data.viewItem, { name: data.viewItem.name } ) ) {\n * \t\t// When an element is already consumed by higher priority converters, do nothing.\n * \t\treturn;\n * \t}\n *\n * \tconst paragraph = conversionApi.writer.createElement( 'paragraph' );\n *\n * \t// Try to safely insert a paragraph at the model cursor - it will find an allowed parent for the current element.\n * \tif ( !conversionApi.safeInsert( paragraph, data.modelCursor ) ) {\n * \t\t// When an element was not inserted, it means that you cannot insert a paragraph at this position.\n * \t\treturn;\n * \t}\n *\n * \t// Consume the inserted element.\n * \tconversionApi.consumable.consume( data.viewItem, { name: data.viewItem.name } ) );\n *\n * \t// Convert the children to a paragraph.\n * \tconst { modelRange } = conversionApi.convertChildren( data.viewItem, paragraph ) );\n *\n * \t// Update `modelRange` and `modelCursor` in the `data` as a conversion result.\n * \tconversionApi.updateConversionResult( paragraph, data );\n * }, { priority: 'low' } );\n * ```\n *\n * @fires viewCleanup\n * @fires element\n * @fires text\n * @fires documentFragment\n */\nexport default class UpcastDispatcher extends /* #__PURE__ */ EmitterMixin() {\n /**\n * Creates an upcast dispatcher that operates using the passed API.\n *\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi\n * @param conversionApi Additional properties for an interface that will be passed to events fired\n * by the upcast dispatcher.\n */\n constructor(conversionApi) {\n super();\n /**\n * The list of elements that were created during splitting.\n *\n * After the conversion process, the list is cleared.\n */\n this._splitParts = new Map();\n /**\n * The list of cursor parent elements that were created during splitting.\n *\n * After the conversion process the list is cleared.\n */\n this._cursorParents = new Map();\n /**\n * The position in the temporary structure where the converted content is inserted. The structure reflects the context of\n * the target position where the content will be inserted. This property is built based on the context parameter of the\n * convert method.\n */\n this._modelCursor = null;\n /**\n * The list of elements that were created during the splitting but should not get removed on conversion end even if they are empty.\n *\n * The list is cleared after the conversion process.\n */\n this._emptyElementsToKeep = new Set();\n this.conversionApi = {\n ...conversionApi,\n consumable: null,\n writer: null,\n store: null,\n convertItem: (viewItem, modelCursor) => this._convertItem(viewItem, modelCursor),\n convertChildren: (viewElement, positionOrElement) => this._convertChildren(viewElement, positionOrElement),\n safeInsert: (modelNode, position) => this._safeInsert(modelNode, position),\n updateConversionResult: (modelElement, data) => this._updateConversionResult(modelElement, data),\n // Advanced API - use only if custom position handling is needed.\n splitToAllowedParent: (modelNode, modelCursor) => this._splitToAllowedParent(modelNode, modelCursor),\n getSplitParts: modelElement => this._getSplitParts(modelElement),\n keepEmptyElement: modelElement => this._keepEmptyElement(modelElement)\n };\n }\n /**\n * Starts the conversion process. The entry point for the conversion.\n *\n * @fires element\n * @fires text\n * @fires documentFragment\n * @param viewElement The part of the view to be converted.\n * @param writer An instance of the model writer.\n * @param context Elements will be converted according to this context.\n * @returns Model data that is the result of the conversion process\n * wrapped in `DocumentFragment`. Converted marker elements will be set as the document fragment's\n * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.\n */\n convert(viewElement, writer, context = ['$root']) {\n this.fire('viewCleanup', viewElement);\n // Create context tree and set position in the top element.\n // Items will be converted according to this position.\n this._modelCursor = createContextTree(context, writer);\n // Store writer in conversion as a conversion API\n // to be sure that conversion process will use the same batch.\n this.conversionApi.writer = writer;\n // Create consumable values list for conversion process.\n this.conversionApi.consumable = ViewConsumable.createFrom(viewElement);\n // Custom data stored by converter for conversion process.\n this.conversionApi.store = {};\n // Do the conversion.\n const { modelRange } = this._convertItem(viewElement, this._modelCursor);\n // Conversion result is always a document fragment so let's create it.\n const documentFragment = writer.createDocumentFragment();\n // When there is a conversion result.\n if (modelRange) {\n // Remove all empty elements that were created while splitting.\n this._removeEmptyElements();\n // Move all items that were converted in context tree to the document fragment.\n for (const item of Array.from(this._modelCursor.parent.getChildren())) {\n writer.append(item, documentFragment);\n }\n // Extract temporary markers elements from model and set as static markers collection.\n documentFragment.markers = extractMarkersFromModelFragment(documentFragment, writer);\n }\n // Clear context position.\n this._modelCursor = null;\n // Clear split elements & parents lists.\n this._splitParts.clear();\n this._cursorParents.clear();\n this._emptyElementsToKeep.clear();\n // Clear conversion API.\n this.conversionApi.writer = null;\n this.conversionApi.store = null;\n // Return fragment as conversion result.\n return documentFragment;\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertItem\n */\n _convertItem(viewItem, modelCursor) {\n const data = { viewItem, modelCursor, modelRange: null };\n if (viewItem.is('element')) {\n this.fire(`element:${viewItem.name}`, data, this.conversionApi);\n }\n else if (viewItem.is('$text')) {\n this.fire('text', data, this.conversionApi);\n }\n else {\n this.fire('documentFragment', data, this.conversionApi);\n }\n // Handle incorrect conversion result.\n if (data.modelRange && !(data.modelRange instanceof ModelRange)) {\n /**\n * Incorrect conversion result was dropped.\n *\n * {@link module:engine/model/range~Range Model range} should be a conversion result.\n *\n * @error view-conversion-dispatcher-incorrect-result\n */\n throw new CKEditorError('view-conversion-dispatcher-incorrect-result', this);\n }\n return { modelRange: data.modelRange, modelCursor: data.modelCursor };\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertChildren\n */\n _convertChildren(viewItem, elementOrModelCursor) {\n let nextModelCursor = elementOrModelCursor.is('position') ?\n elementOrModelCursor : ModelPosition._createAt(elementOrModelCursor, 0);\n const modelRange = new ModelRange(nextModelCursor);\n for (const viewChild of Array.from(viewItem.getChildren())) {\n const result = this._convertItem(viewChild, nextModelCursor);\n if (result.modelRange instanceof ModelRange) {\n modelRange.end = result.modelRange.end;\n nextModelCursor = result.modelCursor;\n }\n }\n return { modelRange, modelCursor: nextModelCursor };\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#safeInsert\n */\n _safeInsert(modelNode, position) {\n // Find allowed parent for element that we are going to insert.\n // If current parent does not allow to insert element but one of the ancestors does\n // then split nodes to allowed parent.\n const splitResult = this._splitToAllowedParent(modelNode, position);\n // When there is no split result it means that we can't insert element to model tree, so let's skip it.\n if (!splitResult) {\n return false;\n }\n // Insert element on allowed position.\n this.conversionApi.writer.insert(modelNode, splitResult.position);\n return true;\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#updateConversionResult\n */\n _updateConversionResult(modelElement, data) {\n const parts = this._getSplitParts(modelElement);\n const writer = this.conversionApi.writer;\n // Set conversion result range - only if not set already.\n if (!data.modelRange) {\n data.modelRange = writer.createRange(writer.createPositionBefore(modelElement), writer.createPositionAfter(parts[parts.length - 1]));\n }\n const savedCursorParent = this._cursorParents.get(modelElement);\n // Now we need to check where the `modelCursor` should be.\n if (savedCursorParent) {\n // If we split parent to insert our element then we want to continue conversion in the new part of the split parent.\n //\n // before: <allowed><notAllowed>foo[]</notAllowed></allowed>\n // after: <allowed><notAllowed>foo</notAllowed> <converted></converted> <notAllowed>[]</notAllowed></allowed>\n data.modelCursor = writer.createPositionAt(savedCursorParent, 0);\n }\n else {\n // Otherwise just continue after inserted element.\n data.modelCursor = data.modelRange.end;\n }\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#splitToAllowedParent\n */\n _splitToAllowedParent(node, modelCursor) {\n const { schema, writer } = this.conversionApi;\n // Try to find allowed parent.\n let allowedParent = schema.findAllowedParent(modelCursor, node);\n if (allowedParent) {\n // When current position parent allows to insert node then return this position.\n if (allowedParent === modelCursor.parent) {\n return { position: modelCursor };\n }\n // When allowed parent is in context tree (it's outside the converted tree).\n if (this._modelCursor.parent.getAncestors().includes(allowedParent)) {\n allowedParent = null;\n }\n }\n if (!allowedParent) {\n // Check if the node wrapped with a paragraph would be accepted by the schema.\n if (!isParagraphable(modelCursor, node, schema)) {\n return null;\n }\n return {\n position: wrapInParagraph(modelCursor, writer)\n };\n }\n // Split element to allowed parent.\n const splitResult = this.conversionApi.writer.split(modelCursor, allowedParent);\n // Using the range returned by `model.Writer#split`, we will pair original elements with their split parts.\n //\n // The range returned from the writer spans \"over the split\" or, precisely saying, from the end of the original element (the one\n // that got split) to the beginning of the other part of that element:\n //\n // <limit><a><b><c>X[]Y</c></b><a></limit> ->\n // <limit><a><b><c>X[</c></b></a><a><b><c>]Y</c></b></a>\n //\n // After the split there cannot be any full node between the positions in `splitRange`. The positions are touching.\n // Also, because of how splitting works, it is easy to notice, that \"closing tags\" are in the reverse order than \"opening tags\".\n // Also, since we split all those elements, each of them has to have the other part.\n //\n // With those observations in mind, we will pair the original elements with their split parts by saving \"closing tags\" and matching\n // them with \"opening tags\" in the reverse order. For that we can use a stack.\n const stack = [];\n for (const treeWalkerValue of splitResult.range.getWalker()) {\n if (treeWalkerValue.type == 'elementEnd') {\n stack.push(treeWalkerValue.item);\n }\n else {\n // There should not be any text nodes after the element is split, so the only other value is `elementStart`.\n const originalPart = stack.pop();\n const splitPart = treeWalkerValue.item;\n this._registerSplitPair(originalPart, splitPart);\n }\n }\n const cursorParent = splitResult.range.end.parent;\n this._cursorParents.set(node, cursorParent);\n return {\n position: splitResult.position,\n cursorParent\n };\n }\n /**\n * Registers that a `splitPart` element is a split part of the `originalPart` element.\n *\n * The data set by this method is used by {@link #_getSplitParts} and {@link #_removeEmptyElements}.\n */\n _registerSplitPair(originalPart, splitPart) {\n if (!this._splitParts.has(originalPart)) {\n this._splitParts.set(originalPart, [originalPart]);\n }\n const list = this._splitParts.get(originalPart);\n this._splitParts.set(splitPart, list);\n list.push(splitPart);\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#getSplitParts\n */\n _getSplitParts(element) {\n let parts;\n if (!this._splitParts.has(element)) {\n parts = [element];\n }\n else {\n parts = this._splitParts.get(element);\n }\n return parts;\n }\n /**\n * Mark an element that were created during the splitting to not get removed on conversion end even if it is empty.\n */\n _keepEmptyElement(element) {\n this._emptyElementsToKeep.add(element);\n }\n /**\n * Checks if there are any empty elements created while splitting and removes them.\n *\n * This method works recursively to re-check empty elements again after at least one element was removed in the initial call,\n * as some elements might have become empty after other empty elements were removed from them.\n */\n _removeEmptyElements() {\n let anyRemoved = false;\n for (const element of this._splitParts.keys()) {\n if (element.isEmpty && !this._emptyElementsToKeep.has(element)) {\n this.conversionApi.writer.remove(element);\n this._splitParts.delete(element);\n anyRemoved = true;\n }\n }\n if (anyRemoved) {\n this._removeEmptyElements();\n }\n }\n}\n/**\n * Traverses given model item and searches elements which marks marker range. Found element is removed from\n * DocumentFragment but path of this element is stored in a Map which is then returned.\n *\n * @param modelItem Fragment of model.\n * @returns List of static markers.\n */\nfunction extractMarkersFromModelFragment(modelItem, writer) {\n const markerElements = new Set();\n const markers = new Map();\n // Create ModelTreeWalker.\n const range = ModelRange._createIn(modelItem).getItems();\n // Walk through DocumentFragment and collect marker elements.\n for (const item of range) {\n // Check if current element is a marker.\n if (item.is('element', '$marker')) {\n markerElements.add(item);\n }\n }\n // Walk through collected marker elements store its path and remove its from the DocumentFragment.\n for (const markerElement of markerElements) {\n const markerName = markerElement.getAttribute('data-name');\n const currentPosition = writer.createPositionBefore(markerElement);\n // When marker of given name is not stored it means that we have found the beginning of the range.\n if (!markers.has(markerName)) {\n markers.set(markerName, new ModelRange(currentPosition.clone()));\n // Otherwise is means that we have found end of the marker range.\n }\n else {\n markers.get(markerName).end = currentPosition.clone();\n }\n // Remove marker element from DocumentFragment.\n writer.remove(markerElement);\n }\n return markers;\n}\n/**\n * Creates model fragment according to given context and returns position in the bottom (the deepest) element.\n */\nfunction createContextTree(contextDefinition, writer) {\n let position;\n for (const item of new SchemaContext(contextDefinition)) {\n const attributes = {};\n for (const key of item.getAttributeKeys()) {\n attributes[key] = item.getAttribute(key);\n }\n const current = writer.createElement(item.name, attributes);\n if (position) {\n writer.insert(current, position);\n }\n position = ModelPosition._createAt(current, 0);\n }\n return position;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { global } from '@ckeditor/ckeditor5-utils';\n/**\n * Basic HTML writer. It uses the native `innerHTML` property for basic conversion\n * from a document fragment to an HTML string.\n */\nexport default class BasicHtmlWriter {\n /**\n * Returns an HTML string created from the document fragment.\n */\n getHtml(fragment) {\n const doc = global.document.implementation.createHTMLDocument('');\n const container = doc.createElement('div');\n container.appendChild(fragment);\n return container.innerHTML;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/dataprocessor/htmldataprocessor\n */\n/* globals DOMParser */\nimport BasicHtmlWriter from './basichtmlwriter.js';\nimport DomConverter from '../view/domconverter.js';\n/**\n * The HTML data processor class.\n * This data processor implementation uses HTML as input and output data.\n */\nexport default class HtmlDataProcessor {\n /**\n * Creates a new instance of the HTML data processor class.\n *\n * @param document The view document instance.\n */\n constructor(document) {\n this.skipComments = true;\n this.domParser = new DOMParser();\n this.domConverter = new DomConverter(document, { renderingMode: 'data' });\n this.htmlWriter = new BasicHtmlWriter();\n }\n /**\n * Converts a provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}\n * to data format – in this case to an HTML string.\n *\n * @returns HTML string.\n */\n toData(viewFragment) {\n // Convert view DocumentFragment to DOM DocumentFragment.\n const domFragment = this.domConverter.viewToDom(viewFragment);\n // Convert DOM DocumentFragment to HTML output.\n return this.htmlWriter.getHtml(domFragment);\n }\n /**\n * Converts the provided HTML string to a view tree.\n *\n * @param data An HTML string.\n * @returns A converted view element.\n */\n toView(data) {\n // Convert input HTML data to DOM DocumentFragment.\n const domFragment = this._toDom(data);\n // Convert DOM DocumentFragment to view DocumentFragment.\n return this.domConverter.domToView(domFragment, { skipComments: this.skipComments });\n }\n /**\n * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data\n * and not processed during the conversion from the DOM to the view elements.\n *\n * The raw data can be later accessed by a\n * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `\"$rawContent\"`.\n *\n * @param pattern Pattern matching all view elements whose content should be treated as raw data.\n */\n registerRawContentMatcher(pattern) {\n this.domConverter.registerRawContentMatcher(pattern);\n }\n /**\n * If the processor is set to use marked fillers, it will insert ` ` fillers wrapped in `<span>` elements\n * (`<span data-cke-filler=\"true\"> </span>`) instead of regular ` ` characters.\n *\n * This mode allows for a more precise handling of the block fillers (so they do not leak into the editor content) but\n * bloats the editor data with additional markup.\n *\n * This mode may be required by some features and will be turned on by them automatically.\n *\n * @param type Whether to use the default or the marked ` ` block fillers.\n */\n useFillerType(type) {\n this.domConverter.blockFillerMode = type == 'marked' ? 'markedNbsp' : 'nbsp';\n }\n /**\n * Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from\n * the provided data.\n */\n _toDom(data) {\n // Wrap data with a <body> tag so leading non-layout nodes (like <script>, <style>, HTML comment)\n // will be preserved in the body collection.\n // Do it only for data that is not a full HTML document.\n if (!data.match(/<(?:html|body|head|meta)(?:\\s[^>]*)?>/i)) {\n data = `<body>${data}</body>`;\n }\n const document = this.domParser.parseFromString(data, 'text/html');\n const fragment = document.createDocumentFragment();\n const bodyChildNodes = document.body.childNodes;\n while (bodyChildNodes.length > 0) {\n fragment.appendChild(bodyChildNodes[0]);\n }\n return fragment;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/controller/datacontroller\n */\nimport { CKEditorError, EmitterMixin, ObservableMixin, logWarning } from '@ckeditor/ckeditor5-utils';\nimport Mapper from '../conversion/mapper.js';\nimport DowncastDispatcher from '../conversion/downcastdispatcher.js';\nimport { insertAttributesAndChildren, insertText } from '../conversion/downcasthelpers.js';\nimport UpcastDispatcher from '../conversion/upcastdispatcher.js';\nimport { convertText, convertToModelFragment } from '../conversion/upcasthelpers.js';\nimport ViewDocumentFragment from '../view/documentfragment.js';\nimport ViewDocument from '../view/document.js';\nimport ViewDowncastWriter from '../view/downcastwriter.js';\nimport ModelRange from '../model/range.js';\nimport { autoParagraphEmptyRoots } from '../model/utils/autoparagraphing.js';\nimport HtmlDataProcessor from '../dataprocessor/htmldataprocessor.js';\n/**\n * Controller for the data pipeline. The data pipeline controls how data is retrieved from the document\n * and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}\n * and {@link ~DataController#set set} data of the {@link ~DataController#model model}\n * using the given:\n *\n * * {@link module:engine/dataprocessor/dataprocessor~DataProcessor data processor},\n * * downcast converters,\n * * upcast converters.\n *\n * An instance of the data controller is always available in the {@link module:core/editor/editor~Editor#data `editor.data`}\n * property:\n *\n * ```ts\n * editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'\n * ```\n */\nexport default class DataController extends /* #__PURE__ */ EmitterMixin() {\n /**\n * Creates a data controller instance.\n *\n * @param model Data model.\n * @param stylesProcessor The styles processor instance.\n */\n constructor(model, stylesProcessor) {\n super();\n this.model = model;\n this.mapper = new Mapper();\n this.downcastDispatcher = new DowncastDispatcher({\n mapper: this.mapper,\n schema: model.schema\n });\n this.downcastDispatcher.on('insert:$text', insertText(), { priority: 'lowest' });\n this.downcastDispatcher.on('insert', insertAttributesAndChildren(), { priority: 'lowest' });\n this.upcastDispatcher = new UpcastDispatcher({\n schema: model.schema\n });\n this.viewDocument = new ViewDocument(stylesProcessor);\n this.stylesProcessor = stylesProcessor;\n this.htmlProcessor = new HtmlDataProcessor(this.viewDocument);\n this.processor = this.htmlProcessor;\n this._viewWriter = new ViewDowncastWriter(this.viewDocument);\n // Define default converters for text and elements.\n //\n // Note that if there is no default converter for the element it will be skipped, for instance `<b>foo</b>` will be\n // converted to nothing. We therefore add `convertToModelFragment` as a last converter so it converts children of that\n // element to the document fragment so `<b>foo</b>` will still be converted to `foo` even if there is no converter for `<b>`.\n this.upcastDispatcher.on('text', convertText(), { priority: 'lowest' });\n this.upcastDispatcher.on('element', convertToModelFragment(), { priority: 'lowest' });\n this.upcastDispatcher.on('documentFragment', convertToModelFragment(), { priority: 'lowest' });\n ObservableMixin().prototype.decorate.call(this, 'init');\n ObservableMixin().prototype.decorate.call(this, 'set');\n ObservableMixin().prototype.decorate.call(this, 'get');\n ObservableMixin().prototype.decorate.call(this, 'toView');\n ObservableMixin().prototype.decorate.call(this, 'toModel');\n // Fire the `ready` event when the initialization has completed. Such low-level listener offers the possibility\n // to plug into the initialization pipeline without interrupting the initialization flow.\n this.on('init', () => {\n this.fire('ready');\n }, { priority: 'lowest' });\n // Fix empty roots after DataController is 'ready' (note that the init method could be decorated and stopped).\n // We need to handle this event because initial data could be empty and the post-fixer would not get triggered.\n this.on('ready', () => {\n this.model.enqueueChange({ isUndoable: false }, autoParagraphEmptyRoots);\n }, { priority: 'lowest' });\n }\n /**\n * Returns the model's data converted by downcast dispatchers attached to {@link #downcastDispatcher} and\n * formatted by the {@link #processor data processor}.\n *\n * A warning is logged when you try to retrieve data for a detached root, as most probably this is a mistake. A detached root should\n * be treated like it is removed, and you should not save its data. Note, that the detached root data is always an empty string.\n *\n * @fires get\n * @param options Additional configuration for the retrieved data. `DataController` provides two optional\n * properties: `rootName` and `trim`. Other properties of this object are specified by various editor features.\n * @param options.rootName Root name. Default 'main'.\n * @param options.trim Whether returned data should be trimmed. This option is set to `empty` by default,\n * which means whenever editor content is considered empty, an empty string will be returned. To turn off trimming completely\n * use `'none'`. In such cases the exact content will be returned (for example a `<p> </p>` for an empty editor).\n * @returns Output data.\n */\n get(options = {}) {\n const { rootName = 'main', trim = 'empty' } = options;\n if (!this._checkIfRootsExists([rootName])) {\n /**\n * Cannot get data from a non-existing root. This error is thrown when\n * {@link module:engine/controller/datacontroller~DataController#get `DataController#get()` method}\n * is called with a non-existent root name. For example, if there is an editor instance with only `main` root,\n * calling {@link module:engine/controller/datacontroller~DataController#get} like:\n *\n * ```ts\n * data.get( { rootName: 'root2' } );\n * ```\n *\n * will throw this error.\n *\n * @error datacontroller-get-non-existent-root\n */\n throw new CKEditorError('datacontroller-get-non-existent-root', this);\n }\n const root = this.model.document.getRoot(rootName);\n if (!root.isAttached()) {\n /**\n * Retrieving document data for a detached root.\n *\n * This usually indicates an error as a detached root should be considered \"removed\" and should not be included in the\n * document data.\n *\n * @error datacontroller-get-detached-root\n */\n logWarning('datacontroller-get-detached-root', this);\n }\n if (trim === 'empty' && !this.model.hasContent(root, { ignoreWhitespaces: true })) {\n return '';\n }\n return this.stringify(root, options);\n }\n /**\n * Returns the content of the given {@link module:engine/model/element~Element model's element} or\n * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters\n * attached to the {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.\n *\n * @param modelElementOrFragment The element whose content will be stringified.\n * @param options Additional configuration passed to the conversion process.\n * @returns Output data.\n */\n stringify(modelElementOrFragment, options = {}) {\n // Model -> view.\n const viewDocumentFragment = this.toView(modelElementOrFragment, options);\n // View -> data.\n return this.processor.toData(viewDocumentFragment);\n }\n /**\n * Returns the content of the given {@link module:engine/model/element~Element model element} or\n * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast\n * converters attached to {@link #downcastDispatcher} into a\n * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.\n *\n * @fires toView\n * @param modelElementOrFragment Element or document fragment whose content will be converted.\n * @param options Additional configuration that will be available through the\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.\n * @returns Output view DocumentFragment.\n */\n toView(modelElementOrFragment, options = {}) {\n const viewDocument = this.viewDocument;\n const viewWriter = this._viewWriter;\n // Clear bindings so the call to this method returns correct results.\n this.mapper.clearBindings();\n // First, convert elements.\n const modelRange = ModelRange._createIn(modelElementOrFragment);\n const viewDocumentFragment = new ViewDocumentFragment(viewDocument);\n this.mapper.bindElements(modelElementOrFragment, viewDocumentFragment);\n // Prepare list of markers.\n // For document fragment, simply take the markers assigned to this document fragment.\n // For model root, all markers in that root will be taken.\n // For model element, we need to check which markers are intersecting with this element and relatively modify the markers' ranges.\n // Collapsed markers at element boundary, although considered as not intersecting with the element, will also be returned.\n const markers = modelElementOrFragment.is('documentFragment') ?\n modelElementOrFragment.markers :\n _getMarkersRelativeToElement(modelElementOrFragment);\n this.downcastDispatcher.convert(modelRange, markers, viewWriter, options);\n return viewDocumentFragment;\n }\n /**\n * Sets the initial input data parsed by the {@link #processor data processor} and\n * converted by the {@link #upcastDispatcher view-to-model converters}.\n * Initial data can be only set to a document whose {@link module:engine/model/document~Document#version} is equal 0.\n *\n * **Note** This method is {@link module:utils/observablemixin~Observable#decorate decorated} which is\n * used by e.g. collaborative editing plugin that syncs remote data on init.\n *\n * When data is passed as a string, it is initialized on the default `main` root:\n *\n * ```ts\n * dataController.init( '<p>Foo</p>' ); // Initializes data on the `main` root only, as no other is specified.\n * ```\n *\n * To initialize data on a different root or multiple roots at once, an object containing `rootName` - `data` pairs should be passed:\n *\n * ```ts\n * dataController.init( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Initializes data on both the `main` and `title` roots.\n * ```\n *\n * @fires init\n * @param data Input data as a string or an object containing the `rootName` - `data`\n * pairs to initialize data on multiple roots at once.\n * @returns Promise that is resolved after the data is set on the editor.\n */\n init(data) {\n if (this.model.document.version) {\n /**\n * Cannot set initial data to a non-empty {@link module:engine/model/document~Document}.\n * Initial data should be set once, during the {@link module:core/editor/editor~Editor} initialization,\n * when the {@link module:engine/model/document~Document#version} is equal 0.\n *\n * @error datacontroller-init-document-not-empty\n */\n throw new CKEditorError('datacontroller-init-document-not-empty', this);\n }\n let initialData = {};\n if (typeof data === 'string') {\n initialData.main = data; // Default root is 'main'. To initiate data on a different root, object should be passed.\n }\n else {\n initialData = data;\n }\n if (!this._checkIfRootsExists(Object.keys(initialData))) {\n /**\n * Cannot init data on a non-existent root. This error is thrown when\n * {@link module:engine/controller/datacontroller~DataController#init DataController#init() method}\n * is called with non-existent root name. For example, if there is an editor instance with only `main` root,\n * calling {@link module:engine/controller/datacontroller~DataController#init} like:\n *\n * ```ts\n * data.init( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );\n * ```\n *\n * will throw this error.\n *\n * @error datacontroller-init-non-existent-root\n */\n throw new CKEditorError('datacontroller-init-non-existent-root', this);\n }\n this.model.enqueueChange({ isUndoable: false }, writer => {\n for (const rootName of Object.keys(initialData)) {\n const modelRoot = this.model.document.getRoot(rootName);\n writer.insert(this.parse(initialData[rootName], modelRoot), modelRoot, 0);\n }\n });\n return Promise.resolve();\n }\n /**\n * Sets the input data parsed by the {@link #processor data processor} and\n * converted by the {@link #upcastDispatcher view-to-model converters}.\n * This method can be used any time to replace existing editor data with the new one without clearing the\n * {@link module:engine/model/document~Document#history document history}.\n *\n * This method also creates a batch with all the changes applied. If all you need is to parse data, use\n * the {@link #parse} method.\n *\n * When data is passed as a string it is set on the default `main` root:\n *\n * ```ts\n * dataController.set( '<p>Foo</p>' ); // Sets data on the `main` root, as no other is specified.\n * ```\n *\n * To set data on a different root or multiple roots at once, an object containing `rootName` - `data` pairs should be passed:\n *\n * ```ts\n * dataController.set( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Sets data on the `main` and `title` roots as specified.\n * ```\n *\n * To set the data with a preserved undo stack and add the change to the undo stack, set `{ isUndoable: true }` as a `batchType` option.\n *\n * ```ts\n * dataController.set( '<p>Foo</p>', { batchType: { isUndoable: true } } );\n * ```\n *\n * @fires set\n * @param data Input data as a string or an object containing the `rootName` - `data`\n * pairs to set data on multiple roots at once.\n * @param options Options for setting data.\n * @param options.batchType The batch type that will be used to create a batch for the changes applied by this method.\n * By default, the batch will be set as {@link module:engine/model/batch~Batch#isUndoable not undoable} and the undo stack will be\n * cleared after the new data is applied (all undo steps will be removed). If the batch type `isUndoable` flag is be set to `true`,\n * the undo stack will be preserved instead and not cleared when new data is applied.\n */\n set(data, options = {}) {\n let newData = {};\n if (typeof data === 'string') {\n newData.main = data; // The default root is 'main'. To set data on a different root, an object should be passed.\n }\n else {\n newData = data;\n }\n if (!this._checkIfRootsExists(Object.keys(newData))) {\n /**\n * Cannot set data on a non-existent root. This error is thrown when the\n * {@link module:engine/controller/datacontroller~DataController#set DataController#set() method}\n * is called with non-existent root name. For example, if there is an editor instance with only the default `main` root,\n * calling {@link module:engine/controller/datacontroller~DataController#set} like:\n *\n * ```ts\n * data.set( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );\n * ```\n *\n * will throw this error.\n *\n * @error datacontroller-set-non-existent-root\n */\n throw new CKEditorError('datacontroller-set-non-existent-root', this);\n }\n this.model.enqueueChange(options.batchType || {}, writer => {\n writer.setSelection(null);\n writer.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());\n for (const rootName of Object.keys(newData)) {\n // Save to model.\n const modelRoot = this.model.document.getRoot(rootName);\n writer.remove(writer.createRangeIn(modelRoot));\n writer.insert(this.parse(newData[rootName], modelRoot), modelRoot, 0);\n }\n });\n }\n /**\n * Returns the data parsed by the {@link #processor data processor} and then converted by upcast converters\n * attached to the {@link #upcastDispatcher}.\n *\n * @see #set\n * @param data Data to parse.\n * @param context Base context in which the view will be converted to the model.\n * See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.\n * @returns Parsed data.\n */\n parse(data, context = '$root') {\n // data -> view\n const viewDocumentFragment = this.processor.toView(data);\n // view -> model\n return this.toModel(viewDocumentFragment, context);\n }\n /**\n * Returns the result of the given {@link module:engine/view/element~Element view element} or\n * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the\n * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.\n *\n * When marker elements were converted during the conversion process, it will be set as a document fragment's\n * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.\n *\n * @fires toModel\n * @param viewElementOrFragment The element or document fragment whose content will be converted.\n * @param context Base context in which the view will be converted to the model.\n * See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.\n * @returns Output document fragment.\n */\n toModel(viewElementOrFragment, context = '$root') {\n return this.model.change(writer => {\n return this.upcastDispatcher.convert(viewElementOrFragment, writer, context);\n });\n }\n /**\n * Adds the style processor normalization rules.\n *\n * You can implement your own rules as well as use one of the available processor rules:\n *\n * * background: {@link module:engine/view/styles/background~addBackgroundRules}\n * * border: {@link module:engine/view/styles/border~addBorderRules}\n * * margin: {@link module:engine/view/styles/margin~addMarginRules}\n * * padding: {@link module:engine/view/styles/padding~addPaddingRules}\n */\n addStyleProcessorRules(callback) {\n callback(this.stylesProcessor);\n }\n /**\n * Registers a {@link module:engine/view/matcher~MatcherPattern} on an {@link #htmlProcessor htmlProcessor}\n * and a {@link #processor processor} for view elements whose content should be treated as raw data\n * and not processed during the conversion from DOM to view elements.\n *\n * The raw data can be later accessed by the {@link module:engine/view/element~Element#getCustomProperty view element custom property}\n * `\"$rawContent\"`.\n *\n * @param pattern Pattern matching all view elements whose content should be treated as a raw data.\n */\n registerRawContentMatcher(pattern) {\n // No need to register the pattern if both the `htmlProcessor` and `processor` are the same instances.\n if (this.processor && this.processor !== this.htmlProcessor) {\n this.processor.registerRawContentMatcher(pattern);\n }\n this.htmlProcessor.registerRawContentMatcher(pattern);\n }\n /**\n * Removes all event listeners set by the DataController.\n */\n destroy() {\n this.stopListening();\n }\n /**\n * Checks whether all provided root names are actually existing editor roots.\n *\n * @param rootNames Root names to check.\n * @returns Whether all provided root names are existing editor roots.\n */\n _checkIfRootsExists(rootNames) {\n for (const rootName of rootNames) {\n if (!this.model.document.getRoot(rootName)) {\n return false;\n }\n }\n return true;\n }\n}\n/**\n * Helper function for downcast conversion.\n *\n * Takes a document element (element that is added to a model document) and checks which markers are inside it. If the marker is collapsed\n * at element boundary, it is considered as contained inside the element and marker range is returned. Otherwise, if the marker is\n * intersecting with the element, the intersection is returned.\n */\nfunction _getMarkersRelativeToElement(element) {\n const result = [];\n const doc = element.root.document;\n if (!doc) {\n return new Map();\n }\n const elementRange = ModelRange._createIn(element);\n for (const marker of doc.model.markers) {\n const markerRange = marker.getRange();\n const isMarkerCollapsed = markerRange.isCollapsed;\n const isMarkerAtElementBoundary = markerRange.start.isEqual(elementRange.start) || markerRange.end.isEqual(elementRange.end);\n if (isMarkerCollapsed && isMarkerAtElementBoundary) {\n result.push([marker.name, markerRange]);\n }\n else {\n const updatedMarkerRange = elementRange.getIntersection(markerRange);\n if (updatedMarkerRange) {\n result.push([marker.name, updatedMarkerRange]);\n }\n }\n }\n // Sort the markers in a stable fashion to ensure that the order in which they are\n // added to the model's marker collection does not affect how they are\n // downcast. One particular use case that we are targeting here, is one where\n // two markers are adjacent but not overlapping, such as an insertion/deletion\n // suggestion pair representing the replacement of a range of text. In this\n // case, putting the markers in DOM order causes the first marker's end to be\n // serialized right after the second marker's start, while putting the markers\n // in reverse DOM order causes it to be right before the second marker's\n // start. So, we sort these in a way that ensures non-intersecting ranges are in\n // reverse DOM order, and intersecting ranges are in something approximating\n // reverse DOM order (since reverse DOM order doesn't have a precise meaning\n // when working with intersecting ranges).\n result.sort(([n1, r1], [n2, r2]) => {\n if (r1.end.compareWith(r2.start) !== 'after') {\n // m1.end <= m2.start -- m1 is entirely <= m2\n return 1;\n }\n else if (r1.start.compareWith(r2.end) !== 'before') {\n // m1.start >= m2.end -- m1 is entirely >= m2\n return -1;\n }\n else {\n // they overlap, so use their start positions as the primary sort key and\n // end positions as the secondary sort key\n switch (r1.start.compareWith(r2.start)) {\n case 'before':\n return 1;\n case 'after':\n return -1;\n default:\n switch (r1.end.compareWith(r2.end)) {\n case 'before':\n return 1;\n case 'after':\n return -1;\n default:\n return n2.localeCompare(n1);\n }\n }\n }\n });\n return new Map(result);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/conversion\n */\nimport { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';\nimport UpcastHelpers from './upcasthelpers.js';\nimport DowncastHelpers from './downcasthelpers.js';\n/**\n * A utility class that helps add converters to upcast and downcast dispatchers.\n *\n * We recommend reading the {@glink framework/deep-dive/conversion/intro editor conversion} guide first to\n * understand the core concepts of the conversion mechanisms.\n *\n * An instance of the conversion manager is available in the\n * {@link module:core/editor/editor~Editor#conversion `editor.conversion`} property\n * and by default has the following groups of dispatchers (i.e. directions of conversion):\n *\n * * `downcast` (editing and data downcasts)\n * * `editingDowncast`\n * * `dataDowncast`\n * * `upcast`\n *\n * # One-way converters\n *\n * To add a converter to a specific group, use the {@link module:engine/conversion/conversion~Conversion#for `for()`}\n * method:\n *\n * ```ts\n * // Add a converter to editing downcast and data downcast.\n * editor.conversion.for( 'downcast' ).elementToElement( config ) );\n *\n * // Add a converter to the data pipepline only:\n * editor.conversion.for( 'dataDowncast' ).elementToElement( dataConversionConfig ) );\n *\n * // And a slightly different one for the editing pipeline:\n * editor.conversion.for( 'editingDowncast' ).elementToElement( editingConversionConfig ) );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `for()`} method documentation to learn more about\n * available conversion helpers and how to use your custom ones.\n *\n * # Two-way converters\n *\n * Besides using one-way converters via the `for()` method, you can also use other methods available in this\n * class to add two-way converters (upcast and downcast):\n *\n * * {@link module:engine/conversion/conversion~Conversion#elementToElement `elementToElement()`} –\n * Model element to view element and vice versa.\n * * {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement()`} –\n * Model attribute to view element and vice versa.\n * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} –\n * Model attribute to view attribute and vice versa.\n */\nexport default class Conversion {\n /**\n * Creates a new conversion instance.\n */\n constructor(downcastDispatchers, upcastDispatchers) {\n /**\n * Maps dispatchers group name to ConversionHelpers instances.\n */\n this._helpers = new Map();\n // Define default 'downcast' & 'upcast' dispatchers groups. Those groups are always available as two-way converters needs them.\n this._downcast = toArray(downcastDispatchers);\n this._createConversionHelpers({ name: 'downcast', dispatchers: this._downcast, isDowncast: true });\n this._upcast = toArray(upcastDispatchers);\n this._createConversionHelpers({ name: 'upcast', dispatchers: this._upcast, isDowncast: false });\n }\n /**\n * Define an alias for registered dispatcher.\n *\n * ```ts\n * const conversion = new Conversion(\n * \t[ dataDowncastDispatcher, editingDowncastDispatcher ],\n * \tupcastDispatcher\n * );\n *\n * conversion.addAlias( 'dataDowncast', dataDowncastDispatcher );\n * ```\n *\n * @param alias An alias of a dispatcher.\n * @param dispatcher Dispatcher which should have an alias.\n */\n addAlias(alias, dispatcher) {\n const isDowncast = this._downcast.includes(dispatcher);\n const isUpcast = this._upcast.includes(dispatcher);\n if (!isUpcast && !isDowncast) {\n /**\n * Trying to register an alias for a dispatcher that nas not been registered.\n *\n * @error conversion-add-alias-dispatcher-not-registered\n */\n throw new CKEditorError('conversion-add-alias-dispatcher-not-registered', this);\n }\n this._createConversionHelpers({ name: alias, dispatchers: [dispatcher], isDowncast });\n }\n /**\n * Provides a chainable API to assign converters to a conversion dispatchers group.\n *\n * If the given group name has not been registered, the\n * {@link module:utils/ckeditorerror~CKEditorError `conversion-for-unknown-group` error} is thrown.\n *\n * You can use conversion helpers available directly in the `for()` chain or your custom ones via\n * the {@link module:engine/conversion/conversionhelpers~ConversionHelpers#add `add()`} method.\n *\n * # Using built-in conversion helpers\n *\n * The `for()` chain comes with a set of conversion helpers which you can use like this:\n *\n * ```ts\n * editor.conversion.for( 'downcast' )\n * \t.elementToElement( config1 ) // Adds an element-to-element downcast converter.\n * \t.attributeToElement( config2 ); // Adds an attribute-to-element downcast converter.\n *\n * editor.conversion.for( 'upcast' )\n * \t.elementToAttribute( config3 ); // Adds an element-to-attribute upcast converter.\n * ```\n *\n * Refer to the documentation of built-in conversion helpers to learn about their configuration options.\n *\n * * downcast (model-to-view) conversion helpers:\n *\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`},\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement `attributeToElement()`},\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToAttribute `attributeToAttribute()`}.\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToElement `markerToElement()`}.\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToHighlight `markerToHighlight()`}.\n *\n * * upcast (view-to-model) conversion helpers:\n *\n *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToElement `elementToElement()`},\n *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute `elementToAttribute()`},\n *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute `attributeToAttribute()`}.\n *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `elementToMarker()`}.\n *\n * # Using custom conversion helpers\n *\n * If you need to implement an atypical converter, you can do so by calling:\n *\n * ```ts\n * editor.conversion.for( direction ).add( customHelper );\n * ```\n *\n * The `.add()` method takes exactly one parameter, which is a function. This function should accept one parameter that\n * is a dispatcher instance. The function should add an actual converter to the passed dispatcher instance.\n *\n * Example:\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).add( dispatcher => {\n * \tdispatcher.on( 'element:a', ( evt, data, conversionApi ) => {\n * \t\t// Do something with a view <a> element.\n * \t} );\n * } );\n * ```\n *\n * Refer to the documentation of {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}\n * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} to learn how to write\n * custom converters.\n *\n * @param groupName The name of dispatchers group to add the converters to.\n */\n for(groupName) {\n if (!this._helpers.has(groupName)) {\n /**\n * Trying to add a converter to an unknown dispatchers group.\n *\n * @error conversion-for-unknown-group\n */\n throw new CKEditorError('conversion-for-unknown-group', this);\n }\n return this._helpers.get(groupName);\n }\n /**\n * Sets up converters between the model and the view that convert a model element to a view element (and vice versa).\n * For example, the model `<paragraph>Foo</paragraph>` is turned into `<p>Foo</p>` in the view.\n *\n * ```ts\n * // A simple conversion from the `paragraph` model element to the `<p>` view element (and vice versa).\n * editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );\n *\n * // Override other converters by specifying a converter definition with a higher priority.\n * editor.conversion.elementToElement( { model: 'paragraph', view: 'div', converterPriority: 'high' } );\n *\n * // View specified as an object instead of a string.\n * editor.conversion.elementToElement( {\n * \tmodel: 'fancyParagraph',\n * \tview: {\n * \t\tname: 'p',\n * \t\tclasses: 'fancy'\n * \t}\n * } );\n *\n * // Use `upcastAlso` to define other view elements that should also be converted to a `paragraph` element.\n * editor.conversion.elementToElement( {\n * \tmodel: 'paragraph',\n * \tview: 'p',\n * \tupcastAlso: [\n * \t\t'div',\n * \t\t{\n * \t\t\t// Any element with the `display: block` style.\n * \t\t\tstyles: {\n * \t\t\t\tdisplay: 'block'\n * \t\t\t}\n * \t\t}\n * \t]\n * } );\n *\n * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.\n * editor.conversion.elementToElement( {\n * \tmodel: 'heading',\n * \tview: 'h2',\n * \t// Convert \"heading-like\" paragraphs to headings.\n * \tupcastAlso: viewElement => {\n * \t\tconst fontSize = viewElement.getStyle( 'font-size' );\n *\n * \t\tif ( !fontSize ) {\n * \t\t\treturn null;\n * \t\t}\n *\n * \t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n *\n * \t\tif ( !match ) {\n * \t\t\treturn null;\n * \t\t}\n *\n * \t\tconst size = Number( match[ 1 ] );\n *\n * \t\tif ( size > 26 ) {\n * \t\t\t// Returned value can be an object with the matched properties.\n * \t\t\t// These properties will be \"consumed\" during the conversion.\n * \t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n *\n * \t\t\treturn { name: true, styles: [ 'font-size' ] };\n * \t\t}\n *\n * \t\treturn null;\n * \t}\n * } );\n * ```\n *\n * `definition.model` is a `String` with a model element name to convert from or to.\n *\n * @param definition The converter definition.\n */\n elementToElement(definition) {\n // Set up downcast converter.\n this.for('downcast').elementToElement(definition);\n // Set up upcast converter.\n for (const { model, view } of _getAllUpcastDefinitions(definition)) {\n this.for('upcast')\n .elementToElement({\n model,\n view,\n converterPriority: definition.converterPriority\n });\n }\n }\n /**\n * Sets up converters between the model and the view that convert a model attribute to a view element (and vice versa).\n * For example, a model text node with `\"Foo\"` as data and the `bold` attribute will be turned to `<strong>Foo</strong>` in the view.\n *\n * ```ts\n * // A simple conversion from the `bold=true` attribute to the `<strong>` view element (and vice versa).\n * editor.conversion.attributeToElement( { model: 'bold', view: 'strong' } );\n *\n * // Override other converters by specifying a converter definition with a higher priority.\n * editor.conversion.attributeToElement( { model: 'bold', view: 'b', converterPriority: 'high' } );\n *\n * // View specified as an object instead of a string.\n * editor.conversion.attributeToElement( {\n * \tmodel: 'bold',\n * \tview: {\n * \t\tname: 'span',\n * \t\tclasses: 'bold'\n * \t}\n * } );\n *\n * // Use `config.model.name` to define the conversion only from a given node type, `$text` in this case.\n * // The same attribute on different elements may then be handled by a different converter.\n * editor.conversion.attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'textDecoration',\n * \t\tvalues: [ 'underline', 'lineThrough' ],\n * \t\tname: '$text'\n * \t},\n * \tview: {\n * \t\tunderline: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'text-decoration': 'underline'\n * \t\t\t}\n * \t\t},\n * \t\tlineThrough: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'text-decoration': 'line-through'\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n *\n * // Use `upcastAlso` to define other view elements that should also be converted to the `bold` attribute.\n * editor.conversion.attributeToElement( {\n * \tmodel: 'bold',\n * \tview: 'strong',\n * \tupcastAlso: [\n * \t\t'b',\n * \t\t{\n * \t\t\tname: 'span',\n * \t\t\tclasses: 'bold'\n * \t\t},\n * \t\t{\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-weight': 'bold'\n * \t\t\t}\n * \t\t},\n * \t\tviewElement => {\n * \t\t\tconst fontWeight = viewElement.getStyle( 'font-weight' );\n *\n * \t\t\tif ( viewElement.is( 'element', 'span' ) && fontWeight && /\\d+/.test() && Number( fontWeight ) > 500 ) {\n * \t\t\t\t// Returned value can be an object with the matched properties.\n * \t\t\t\t// These properties will be \"consumed\" during the conversion.\n * \t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n *\n * \t\t\t\treturn {\n * \t\t\t\t\tname: true,\n * \t\t\t\t\tstyles: [ 'font-weight' ]\n * \t\t\t\t};\n * \t\t\t}\n * \t\t}\n * \t]\n * } );\n *\n * // Conversion from and to a model attribute key whose value is an enum (`fontSize=big|small`).\n * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.\n * editor.conversion.attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'fontSize',\n * \t\tvalues: [ 'big', 'small' ]\n * \t},\n * \tview: {\n * \t\tbig: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-size': '1.2em'\n * \t\t\t}\n * \t\t},\n * \t\tsmall: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-size': '0.8em'\n * \t\t\t}\n * \t\t}\n * \t},\n * \tupcastAlso: {\n * \t\tbig: viewElement => {\n * \t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n *\n * \t\t\tif ( !fontSize ) {\n * \t\t\t\treturn null;\n * \t\t\t}\n *\n * \t\t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n *\n * \t\t\tif ( !match ) {\n * \t\t\t\treturn null;\n * \t\t\t}\n *\n * \t\t\tconst size = Number( match[ 1 ] );\n *\n * \t\t\tif ( viewElement.is( 'element', 'span' ) && size > 10 ) {\n * \t\t\t\t// Returned value can be an object with the matched properties.\n * \t\t\t\t// These properties will be \"consumed\" during the conversion.\n * \t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n *\n * \t\t\t\treturn { name: true, styles: [ 'font-size' ] };\n * \t\t\t}\n *\n * \t\t\treturn null;\n * \t\t},\n * \t\tsmall: viewElement => {\n * \t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n *\n * \t\t\tif ( !fontSize ) {\n * \t\t\t\treturn null;\n * \t\t\t}\n *\n * \t\t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n *\n * \t\t\tif ( !match ) {\n * \t\t\t\treturn null;\n * \t\t\t}\n *\n * \t\t\tconst size = Number( match[ 1 ] );\n *\n * \t\t\tif ( viewElement.is( 'element', 'span' ) && size < 10 ) {\n * \t\t\t\t// Returned value can be an object with the matched properties.\n * \t\t\t\t// These properties will be \"consumed\" during the conversion.\n * \t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n *\n * \t\t\t\treturn { name: true, styles: [ 'font-size' ] };\n * \t\t\t}\n *\n * \t\t\treturn null;\n * \t\t}\n * \t}\n * } );\n * ```\n *\n * The `definition.model` parameter specifies which model attribute should be converted from or to. It can be a `{ key, value }` object\n * describing the attribute key and value to convert or a `String` specifying just the attribute key (in such a case\n * `value` is set to `true`).\n *\n * @param definition The converter definition.\n */\n attributeToElement(definition) {\n // Set up downcast converter.\n this.for('downcast').attributeToElement(definition);\n // Set up upcast converter.\n for (const { model, view } of _getAllUpcastDefinitions(definition)) {\n this.for('upcast')\n .elementToAttribute({\n view,\n model,\n converterPriority: definition.converterPriority\n });\n }\n }\n /**\n * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa). For example,\n * `<imageBlock src='foo.jpg'></imageBlock>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).\n * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.\n * To convert the text attributes,\n * the {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}should be set up.\n *\n * ```ts\n * // A simple conversion from the `source` model attribute to the `src` view attribute (and vice versa).\n * editor.conversion.attributeToAttribute( { model: 'source', view: 'src' } );\n *\n * // Attribute values are strictly specified.\n * editor.conversion.attributeToAttribute( {\n * \tmodel: {\n * \t\tname: 'imageInline',\n * \t\tkey: 'aside',\n * \t\tvalues: [ 'aside' ]\n * \t},\n * \tview: {\n * \t\taside: {\n * \t\t\tname: 'img',\n * \t\t\tkey: 'class',\n * \t\t\tvalue: [ 'aside', 'half-size' ]\n * \t\t}\n * \t}\n * } );\n *\n * // Set the style attribute.\n * editor.conversion.attributeToAttribute( {\n * \tmodel: {\n * \t\tname: 'imageInline',\n * \t\tkey: 'aside',\n * \t\tvalues: [ 'aside' ]\n * \t},\n * \tview: {\n * \t\taside: {\n * \t\t\tname: 'img',\n * \t\t\tkey: 'style',\n * \t\t\tvalue: {\n * \t\t\t\tfloat: 'right',\n * \t\t\t\twidth: '50%',\n * \t\t\t\tmargin: '5px'\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n *\n * // Conversion from and to a model attribute key whose value is an enum (`align=right|center`).\n * // Use `upcastAlso` to define other view elements that should also be converted to the `align=right` attribute.\n * editor.conversion.attributeToAttribute( {\n * \tmodel: {\n * \t\tkey: 'align',\n * \t\tvalues: [ 'right', 'center' ]\n * \t},\n * \tview: {\n * \t\tright: {\n * \t\t\tkey: 'class',\n * \t\t\tvalue: 'align-right'\n * \t\t},\n * \t\tcenter: {\n * \t\t\tkey: 'class',\n * \t\t\tvalue: 'align-center'\n * \t\t}\n * \t},\n * \tupcastAlso: {\n * \t\tright: {\n * \t\t\tstyles: {\n * \t\t\t\t'text-align': 'right'\n * \t\t\t}\n * \t\t},\n * \t\tcenter: {\n * \t\t\tstyles: {\n * \t\t\t\t'text-align': 'center'\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n * ```\n *\n * The `definition.model` parameter specifies which model attribute should be converted from and to.\n * It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.\n * The `key` property is the model attribute key to convert from and to.\n * The `values` are the possible model attribute values. If the `values` parameter is not set, the model attribute value\n * will be the same as the view attribute value.\n * If `name` is set, the conversion will be set up only for model elements with the given name.\n *\n * The `definition.view` parameter specifies which view attribute should be converted from and to.\n * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.\n * The `key` property is the view attribute key to convert from and to.\n * The `value` is the view attribute value to convert from and to. If `definition.value` is not set, the view attribute value will be\n * the same as the model attribute value.\n * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.\n * If `key` is `'style'`, `value` is an object with key-value pairs.\n * In other cases, `value` is a `String`.\n * If `name` is set, the conversion will be set up only for model elements with the given name.\n * If `definition.model.values` is set, `definition.view` is an object that assigns values from `definition.model.values`\n * to `{ key, value, [ name ] }` objects.\n *\n * `definition.upcastAlso` specifies which other matching view elements should also be upcast to the given model configuration.\n * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`\n * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.\n *\n * **Note:** `definition.model` and `definition.view` form should be mirrored, so the same types of parameters should\n * be given in both parameters.\n *\n * @param definition The converter definition.\n * @param definition.model The model attribute to convert from and to.\n * @param definition.view The view attribute to convert from and to.\n * @param definition.upcastAlso Any view element matching `definition.upcastAlso` will also be converted to the given model attribute.\n * `definition.upcastAlso` is used only if `config.model.values` is specified.\n */\n attributeToAttribute(definition) {\n // Set up downcast converter.\n this.for('downcast').attributeToAttribute(definition);\n // Set up upcast converter.\n for (const { model, view } of _getAllUpcastDefinitions(definition)) {\n this.for('upcast')\n .attributeToAttribute({\n view,\n model\n });\n }\n }\n /**\n * Creates and caches conversion helpers for given dispatchers group.\n *\n * @param options.name Group name.\n */\n _createConversionHelpers({ name, dispatchers, isDowncast }) {\n if (this._helpers.has(name)) {\n /**\n * Trying to register a group name that has already been registered.\n *\n * @error conversion-group-exists\n */\n throw new CKEditorError('conversion-group-exists', this);\n }\n const helpers = isDowncast ?\n new DowncastHelpers(dispatchers) :\n new UpcastHelpers(dispatchers);\n this._helpers.set(name, helpers);\n }\n}\n/**\n * Helper function that creates a joint array out of an item passed in `definition.view` and items passed in\n * `definition.upcastAlso`.\n */\nfunction* _getAllUpcastDefinitions(definition) {\n if (definition.model.values) {\n for (const value of definition.model.values) {\n const model = { key: definition.model.key, value };\n const view = definition.view[value];\n const upcastAlso = definition.upcastAlso ? definition.upcastAlso[value] : undefined;\n yield* _getUpcastDefinition(model, view, upcastAlso);\n }\n }\n else {\n yield* _getUpcastDefinition(definition.model, definition.view, definition.upcastAlso);\n }\n}\nfunction* _getUpcastDefinition(model, view, upcastAlso) {\n yield { model, view };\n if (upcastAlso) {\n for (const upcastAlsoItem of toArray(upcastAlso)) {\n yield { model, view: upcastAlsoItem };\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Abstract base operation class.\n */\nexport default class Operation {\n /**\n * Base operation constructor.\n *\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(baseVersion) {\n this.baseVersion = baseVersion;\n this.isDocumentOperation = this.baseVersion !== null;\n this.batch = null;\n }\n /**\n * Checks whether the operation's parameters are correct and the operation can be correctly executed. Throws\n * an error if operation is not valid.\n *\n * @internal\n */\n _validate() {\n }\n /**\n * Custom toJSON method to solve child-parent circular dependencies.\n *\n * @returns Clone of this object with the operation property replaced with string.\n */\n toJSON() {\n // This method creates only a shallow copy, all nested objects should be defined separately.\n // See https://github.com/ckeditor/ckeditor5-engine/issues/1477.\n const json = Object.assign({}, this);\n json.__className = this.constructor.className;\n // Remove reference to the parent `Batch` to avoid circular dependencies.\n delete json.batch;\n // Only document operations are shared with other clients so it is not necessary to keep this information.\n delete json.isDocumentOperation;\n return json;\n }\n /**\n * Name of the operation class used for serialization.\n */\n static get className() {\n return 'Operation';\n }\n /**\n * Creates `Operation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param doc Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new this(json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/utils\n */\nimport Node from '../node.js';\nimport Range from '../range.js';\nimport Text from '../text.js';\nimport TextProxy from '../textproxy.js';\nimport { CKEditorError, isIterable } from '@ckeditor/ckeditor5-utils';\n/**\n * Inserts given nodes at given position.\n *\n * @internal\n * @param position Position at which nodes should be inserted.\n * @param normalizedNodes Nodes to insert.\n * @returns Range spanning over inserted elements.\n */\nexport function _insert(position, nodes) {\n const normalizedNodes = _normalizeNodes(nodes);\n // We have to count offset before inserting nodes because they can get merged and we would get wrong offsets.\n const offset = normalizedNodes.reduce((sum, node) => sum + node.offsetSize, 0);\n const parent = position.parent;\n // Insertion might be in a text node, we should split it if that's the case.\n _splitNodeAtPosition(position);\n const index = position.index;\n // Insert nodes at given index. After splitting we have a proper index and insertion is between nodes,\n // using basic `Element` API.\n parent._insertChild(index, normalizedNodes);\n // Merge text nodes, if possible. Merging is needed only at points where inserted nodes \"touch\" \"old\" nodes.\n _mergeNodesAtIndex(parent, index + normalizedNodes.length);\n _mergeNodesAtIndex(parent, index);\n return new Range(position, position.getShiftedBy(offset));\n}\n/**\n * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.\n *\n * @internal\n * @param range Range containing nodes to remove.\n */\nexport function _remove(range) {\n if (!range.isFlat) {\n /**\n * Trying to remove a range which starts and ends in different element.\n *\n * @error operation-utils-remove-range-not-flat\n */\n throw new CKEditorError('operation-utils-remove-range-not-flat', this);\n }\n const parent = range.start.parent;\n // Range may be inside text nodes, we have to split them if that's the case.\n _splitNodeAtPosition(range.start);\n _splitNodeAtPosition(range.end);\n // Remove the text nodes using basic `Element` API.\n const removed = parent._removeChildren(range.start.index, range.end.index - range.start.index);\n // Merge text nodes, if possible. After some nodes were removed, node before and after removed range will be\n // touching at the position equal to the removed range beginning. We check merging possibility there.\n _mergeNodesAtIndex(parent, range.start.index);\n return removed;\n}\n/**\n * Moves nodes in given range to given target position. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.\n *\n * @internal\n * @param sourceRange Range containing nodes to move.\n * @param targetPosition Position to which nodes should be moved.\n * @returns Range containing moved nodes.\n */\nexport function _move(sourceRange, targetPosition) {\n if (!sourceRange.isFlat) {\n /**\n * Trying to move a range which starts and ends in different element.\n *\n * @error operation-utils-move-range-not-flat\n */\n throw new CKEditorError('operation-utils-move-range-not-flat', this);\n }\n const nodes = _remove(sourceRange);\n // We have to fix `targetPosition` because model changed after nodes from `sourceRange` got removed and\n // that change might have an impact on `targetPosition`.\n targetPosition = targetPosition._getTransformedByDeletion(sourceRange.start, sourceRange.end.offset - sourceRange.start.offset);\n return _insert(targetPosition, nodes);\n}\n/**\n * Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.\n *\n * @internal\n * @param range Range containing nodes that should have the attribute set. Must be a flat range.\n * @param key Key of attribute to set.\n * @param value Attribute value.\n */\nexport function _setAttribute(range, key, value) {\n // Range might start or end in text nodes, so we have to split them.\n _splitNodeAtPosition(range.start);\n _splitNodeAtPosition(range.end);\n // Iterate over all items in the range.\n for (const item of range.getItems({ shallow: true })) {\n // Iterator will return `TextProxy` instances but we know that those text proxies will\n // always represent full text nodes (this is guaranteed thanks to splitting we did before).\n // So, we can operate on those text proxies' text nodes.\n const node = item.is('$textProxy') ? item.textNode : item;\n if (value !== null) {\n node._setAttribute(key, value);\n }\n else {\n node._removeAttribute(key);\n }\n // After attributes changing it may happen that some text nodes can be merged. Try to merge with previous node.\n _mergeNodesAtIndex(node.parent, node.index);\n }\n // Try to merge last changed node with it's previous sibling (not covered by the loop above).\n _mergeNodesAtIndex(range.end.parent, range.end.index);\n}\n/**\n * Normalizes given object or an array of objects to an array of {@link module:engine/model/node~Node nodes}. See\n * {@link ~NodeSet NodeSet} for details on how normalization is performed.\n *\n * @internal\n * @param nodes Objects to normalize.\n * @returns Normalized nodes.\n */\nexport function _normalizeNodes(nodes) {\n const normalized = [];\n function convert(nodes) {\n if (typeof nodes == 'string') {\n normalized.push(new Text(nodes));\n }\n else if (nodes instanceof TextProxy) {\n normalized.push(new Text(nodes.data, nodes.getAttributes()));\n }\n else if (nodes instanceof Node) {\n normalized.push(nodes);\n }\n else if (isIterable(nodes)) {\n for (const node of nodes) {\n convert(node);\n }\n }\n else {\n // Skip unrecognized type.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const unreachable = nodes;\n }\n }\n convert(nodes);\n // Merge text nodes.\n for (let i = 1; i < normalized.length; i++) {\n const node = normalized[i];\n const prev = normalized[i - 1];\n if (node instanceof Text && prev instanceof Text && _haveSameAttributes(node, prev)) {\n // Doing this instead changing `prev.data` because `data` is readonly.\n normalized.splice(i - 1, 2, new Text(prev.data + node.data, prev.getAttributes()));\n i--;\n }\n }\n return normalized;\n}\n/**\n * Checks if nodes before and after given index in given element are {@link module:engine/model/text~Text text nodes} and\n * merges them into one node if they have same attributes.\n *\n * Merging is done by removing two text nodes and inserting a new text node containing data from both merged text nodes.\n *\n * @param element Parent element of nodes to merge.\n * @param index Index between nodes to merge.\n */\nfunction _mergeNodesAtIndex(element, index) {\n const nodeBefore = element.getChild(index - 1);\n const nodeAfter = element.getChild(index);\n // Check if both of those nodes are text objects with same attributes.\n if (nodeBefore && nodeAfter && nodeBefore.is('$text') && nodeAfter.is('$text') && _haveSameAttributes(nodeBefore, nodeAfter)) {\n // Append text of text node after index to the before one.\n const mergedNode = new Text(nodeBefore.data + nodeAfter.data, nodeBefore.getAttributes());\n // Remove separate text nodes.\n element._removeChildren(index - 1, 2);\n // Insert merged text node.\n element._insertChild(index - 1, mergedNode);\n }\n}\n/**\n * Checks if given position is in a text node, and if so, splits the text node in two text nodes, each of them\n * containing a part of original text node.\n *\n * @param position Position at which node should be split.\n */\nfunction _splitNodeAtPosition(position) {\n const textNode = position.textNode;\n const element = position.parent;\n if (textNode) {\n const offsetDiff = position.offset - textNode.startOffset;\n const index = textNode.index;\n element._removeChildren(index, 1);\n const firstPart = new Text(textNode.data.substr(0, offsetDiff), textNode.getAttributes());\n const secondPart = new Text(textNode.data.substr(offsetDiff), textNode.getAttributes());\n element._insertChild(index, [firstPart, secondPart]);\n }\n}\n/**\n * Checks whether two given nodes have same attributes.\n *\n * @param nodeA Node to check.\n * @param nodeB Node to check.\n * @returns `true` if nodes have same attributes, `false` otherwise.\n */\nfunction _haveSameAttributes(nodeA, nodeB) {\n const iteratorA = nodeA.getAttributes();\n const iteratorB = nodeB.getAttributes();\n for (const attr of iteratorA) {\n if (attr[1] !== nodeB.getAttribute(attr[0])) {\n return false;\n }\n iteratorB.next();\n }\n return iteratorB.next().done;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/moveoperation\n */\nimport Operation from './operation.js';\nimport Position from '../position.js';\nimport Range from '../range.js';\nimport { _move } from './utils.js';\nimport { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;\n/**\n * Operation to move a range of {@link module:engine/model/item~Item model items}\n * to given {@link module:engine/model/position~Position target position}.\n */\nexport default class MoveOperation extends Operation {\n /**\n * Creates a move operation.\n *\n * @param sourcePosition Position before the first {@link module:engine/model/item~Item model item} to move.\n * @param howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at\n * `sourcePosition` with offset shifted by `howMany`.\n * @param targetPosition Position at which moved nodes will be inserted.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(sourcePosition, howMany, targetPosition, baseVersion) {\n super(baseVersion);\n this.sourcePosition = sourcePosition.clone();\n // `'toNext'` because `sourcePosition` is a bit like a start of the moved range.\n this.sourcePosition.stickiness = 'toNext';\n this.howMany = howMany;\n this.targetPosition = targetPosition.clone();\n this.targetPosition.stickiness = 'toNone';\n }\n /**\n * @inheritDoc\n */\n get type() {\n if (this.targetPosition.root.rootName == '$graveyard') {\n return 'remove';\n }\n else if (this.sourcePosition.root.rootName == '$graveyard') {\n return 'reinsert';\n }\n return 'move';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return [\n Range._createFromPositionAndShift(this.sourcePosition, this.howMany),\n Range._createFromPositionAndShift(this.targetPosition, 0)\n ];\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new MoveOperation(this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion);\n }\n /**\n * Returns the start position of the moved range after it got moved. This may be different than\n * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved\n * inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}\n * is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.\n *\n * ```\n * vv vv\n * abcdefg ===> adefbcg\n * ^ ^\n * targetPos movedRangeStart\n * offset 6 offset 4\n *```\n */\n getMovedRangeStart() {\n return this.targetPosition._getTransformedByDeletion(this.sourcePosition, this.howMany);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n const newTargetPosition = this.sourcePosition._getTransformedByInsertion(this.targetPosition, this.howMany);\n return new MoveOperation(this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const sourceElement = this.sourcePosition.parent;\n const targetElement = this.targetPosition.parent;\n const sourceOffset = this.sourcePosition.offset;\n const targetOffset = this.targetPosition.offset;\n // Validate whether move operation has correct parameters.\n // Validation is pretty complex but move operation is one of the core ways to manipulate the document state.\n // We expect that many errors might be connected with one of scenarios described below.\n if (sourceOffset + this.howMany > sourceElement.maxOffset) {\n /**\n * The nodes which should be moved do not exist.\n *\n * @error move-operation-nodes-do-not-exist\n */\n throw new CKEditorError('move-operation-nodes-do-not-exist', this);\n }\n else if (sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany) {\n /**\n * Trying to move a range of nodes into the middle of that range.\n *\n * @error move-operation-range-into-itself\n */\n throw new CKEditorError('move-operation-range-into-itself', this);\n }\n else if (this.sourcePosition.root == this.targetPosition.root) {\n if (compareArrays(this.sourcePosition.getParentPath(), this.targetPosition.getParentPath()) == 'prefix') {\n const i = this.sourcePosition.path.length - 1;\n if (this.targetPosition.path[i] >= sourceOffset && this.targetPosition.path[i] < sourceOffset + this.howMany) {\n /**\n * Trying to move a range of nodes into one of nodes from that range.\n *\n * @error move-operation-node-into-itself\n */\n throw new CKEditorError('move-operation-node-into-itself', this);\n }\n }\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n _move(Range._createFromPositionAndShift(this.sourcePosition, this.howMany), this.targetPosition);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.sourcePosition = this.sourcePosition.toJSON();\n json.targetPosition = this.targetPosition.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'MoveOperation';\n }\n /**\n * Creates `MoveOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n const sourcePosition = Position.fromJSON(json.sourcePosition, document);\n const targetPosition = Position.fromJSON(json.targetPosition, document);\n return new this(sourcePosition, json.howMany, targetPosition, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/insertoperation\n */\nimport Operation from './operation.js';\nimport Position from '../position.js';\nimport NodeList from '../nodelist.js';\nimport MoveOperation from './moveoperation.js';\nimport { _insert, _normalizeNodes } from './utils.js';\nimport Text from '../text.js';\nimport Element from '../element.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to insert one or more nodes at given position in the model.\n */\nexport default class InsertOperation extends Operation {\n /**\n * Creates an insert operation.\n *\n * @param position Position of insertion.\n * @param nodes The list of nodes to be inserted.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(position, nodes, baseVersion) {\n super(baseVersion);\n this.position = position.clone();\n this.position.stickiness = 'toNone';\n this.nodes = new NodeList(_normalizeNodes(nodes));\n this.shouldReceiveAttributes = false;\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'insert';\n }\n /**\n * Total offset size of inserted nodes.\n */\n get howMany() {\n return this.nodes.maxOffset;\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this.position.clone();\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n const nodes = new NodeList([...this.nodes].map(node => node._clone(true)));\n const insert = new InsertOperation(this.position, nodes, this.baseVersion);\n insert.shouldReceiveAttributes = this.shouldReceiveAttributes;\n return insert;\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n const graveyard = this.position.root.document.graveyard;\n const gyPosition = new Position(graveyard, [0]);\n return new MoveOperation(this.position, this.nodes.maxOffset, gyPosition, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const targetElement = this.position.parent;\n if (!targetElement || targetElement.maxOffset < this.position.offset) {\n /**\n * Insertion position is invalid.\n *\n * @error insert-operation-position-invalid\n */\n throw new CKEditorError('insert-operation-position-invalid', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n // What happens here is that we want original nodes be passed to writer because we want original nodes\n // to be inserted to the model. But in InsertOperation, we want to keep those nodes as they were added\n // to the operation, not modified. For example, text nodes can get merged or cropped while Elements can\n // get children. It is important that InsertOperation has the copy of original nodes in intact state.\n const originalNodes = this.nodes;\n this.nodes = new NodeList([...originalNodes].map(node => node._clone(true)));\n _insert(this.position, originalNodes);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.position = this.position.toJSON();\n json.nodes = this.nodes.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'InsertOperation';\n }\n /**\n * Creates `InsertOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n const children = [];\n for (const child of json.nodes) {\n if (child.name) {\n // If child has name property, it is an Element.\n children.push(Element.fromJSON(child));\n }\n else {\n // Otherwise, it is a Text node.\n children.push(Text.fromJSON(child));\n }\n }\n const insert = new InsertOperation(Position.fromJSON(json.position, document), children, json.baseVersion);\n insert.shouldReceiveAttributes = json.shouldReceiveAttributes;\n return insert;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/splitoperation\n */\nimport Operation from './operation.js';\nimport MergeOperation from './mergeoperation.js';\nimport Position from '../position.js';\nimport Range from '../range.js';\nimport { _insert, _move } from './utils.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to split {@link module:engine/model/element~Element an element} at given\n * {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,\n * both containing a part of the element's original content.\n */\nexport default class SplitOperation extends Operation {\n /**\n * Creates a split operation.\n *\n * @param splitPosition Position at which an element should be split.\n * @param howMany Total offset size of elements that are in the split element after `position`.\n * @param insertionPosition Position at which the clone of split element (or element from graveyard) will be inserted.\n * @param graveyardPosition Position in the graveyard root before the element which\n * should be used as a parent of the nodes after `position`. If it is not set, a copy of the the `position` parent will be used.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(splitPosition, howMany, insertionPosition, graveyardPosition, baseVersion) {\n super(baseVersion);\n this.splitPosition = splitPosition.clone();\n // Keep position sticking to the next node. This way any new content added at the place where the element is split\n // will be left in the original element.\n this.splitPosition.stickiness = 'toNext';\n this.howMany = howMany;\n this.insertionPosition = insertionPosition;\n this.graveyardPosition = graveyardPosition ? graveyardPosition.clone() : null;\n if (this.graveyardPosition) {\n this.graveyardPosition.stickiness = 'toNext';\n }\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'split';\n }\n /**\n * Position inside the new clone of a split element.\n *\n * This is a position where nodes that are after the split position will be moved to.\n */\n get moveTargetPosition() {\n const path = this.insertionPosition.path.slice();\n path.push(0);\n return new Position(this.insertionPosition.root, path);\n }\n /**\n * Artificial range that contains all the nodes from the split element that will be moved to the new element.\n * The range starts at {@link #splitPosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.\n */\n get movedRange() {\n const end = this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);\n return new Range(this.splitPosition, end);\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n // These could be positions but `Selectable` type only supports `Iterable<Range>`.\n const ranges = [\n Range._createFromPositionAndShift(this.splitPosition, 0),\n Range._createFromPositionAndShift(this.insertionPosition, 0)\n ];\n if (this.graveyardPosition) {\n ranges.push(Range._createFromPositionAndShift(this.graveyardPosition, 0));\n }\n return ranges;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n *\n * @returns Clone of this operation.\n */\n clone() {\n return new SplitOperation(this.splitPosition, this.howMany, this.insertionPosition, this.graveyardPosition, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n const graveyard = this.splitPosition.root.document.graveyard;\n const graveyardPosition = new Position(graveyard, [0]);\n return new MergeOperation(this.moveTargetPosition, this.howMany, this.splitPosition, graveyardPosition, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const element = this.splitPosition.parent;\n const offset = this.splitPosition.offset;\n // Validate whether split operation has correct parameters.\n if (!element || element.maxOffset < offset) {\n /**\n * Split position is invalid.\n *\n * @error split-operation-position-invalid\n */\n throw new CKEditorError('split-operation-position-invalid', this);\n }\n else if (!element.parent) {\n /**\n * Cannot split root element.\n *\n * @error split-operation-split-in-root\n */\n throw new CKEditorError('split-operation-split-in-root', this);\n }\n else if (this.howMany != element.maxOffset - this.splitPosition.offset) {\n /**\n * Split operation specifies wrong number of nodes to move.\n *\n * @error split-operation-how-many-invalid\n */\n throw new CKEditorError('split-operation-how-many-invalid', this);\n }\n else if (this.graveyardPosition && !this.graveyardPosition.nodeAfter) {\n /**\n * Graveyard position invalid.\n *\n * @error split-operation-graveyard-position-invalid\n */\n throw new CKEditorError('split-operation-graveyard-position-invalid', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n const splitElement = this.splitPosition.parent;\n if (this.graveyardPosition) {\n _move(Range._createFromPositionAndShift(this.graveyardPosition, 1), this.insertionPosition);\n }\n else {\n const newElement = splitElement._clone();\n _insert(this.insertionPosition, newElement);\n }\n const sourceRange = new Range(Position._createAt(splitElement, this.splitPosition.offset), Position._createAt(splitElement, splitElement.maxOffset));\n _move(sourceRange, this.moveTargetPosition);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.splitPosition = this.splitPosition.toJSON();\n json.insertionPosition = this.insertionPosition.toJSON();\n if (this.graveyardPosition) {\n json.graveyardPosition = this.graveyardPosition.toJSON();\n }\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'SplitOperation';\n }\n /**\n * Helper function that returns a default insertion position basing on given `splitPosition`. The default insertion\n * position is after the split element.\n */\n static getInsertionPosition(splitPosition) {\n const path = splitPosition.path.slice(0, -1);\n path[path.length - 1]++;\n return new Position(splitPosition.root, path, 'toPrevious');\n }\n /**\n * Creates `SplitOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n const splitPosition = Position.fromJSON(json.splitPosition, document);\n const insertionPosition = Position.fromJSON(json.insertionPosition, document);\n const graveyardPosition = json.graveyardPosition ? Position.fromJSON(json.graveyardPosition, document) : null;\n return new this(splitPosition, json.howMany, insertionPosition, graveyardPosition, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/mergeoperation\n */\nimport Operation from './operation.js';\nimport SplitOperation from './splitoperation.js';\nimport Position from '../position.js';\nimport Range from '../range.js';\nimport { _move } from './utils.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to merge two {@link module:engine/model/element~Element elements}.\n *\n * The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of\n * {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.\n *\n * The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.\n */\nexport default class MergeOperation extends Operation {\n /**\n * Creates a merge operation.\n *\n * @param sourcePosition Position inside the merged element. All nodes from that\n * element after that position will be moved to {@link #targetPosition}.\n * @param howMany Summary offset size of nodes which will be moved from the merged element to the new parent.\n * @param targetPosition Position which the nodes from the merged elements will be moved to.\n * @param graveyardPosition Position in graveyard to which the merged element will be moved.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(sourcePosition, howMany, targetPosition, graveyardPosition, baseVersion) {\n super(baseVersion);\n this.sourcePosition = sourcePosition.clone();\n // This is, and should always remain, the first position in its parent.\n this.sourcePosition.stickiness = 'toPrevious';\n this.howMany = howMany;\n this.targetPosition = targetPosition.clone();\n // Except of a rare scenario in `MergeOperation` x `MergeOperation` transformation,\n // this is, and should always remain, the last position in its parent.\n this.targetPosition.stickiness = 'toNext';\n this.graveyardPosition = graveyardPosition.clone();\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'merge';\n }\n /**\n * Position before the merged element (which will be deleted).\n */\n get deletionPosition() {\n return new Position(this.sourcePosition.root, this.sourcePosition.path.slice(0, -1));\n }\n /**\n * Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.\n * The range starts at {@link ~MergeOperation#sourcePosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.\n */\n get movedRange() {\n const end = this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);\n return new Range(this.sourcePosition, end);\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n const mergedElement = this.sourcePosition.parent;\n return [\n Range._createOn(mergedElement),\n // These could be positions but `Selectable` type only supports `Iterable<Range>`.\n Range._createFromPositionAndShift(this.targetPosition, 0),\n Range._createFromPositionAndShift(this.graveyardPosition, 0)\n ];\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new MergeOperation(this.sourcePosition, this.howMany, this.targetPosition, this.graveyardPosition, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n // Positions in this method are transformed by this merge operation because the split operation bases on\n // the context after this merge operation happened (because split operation reverses it).\n // So we need to acknowledge that the merge operation happened and those positions changed a little.\n const targetPosition = this.targetPosition._getTransformedByMergeOperation(this);\n const path = this.sourcePosition.path.slice(0, -1);\n const insertionPosition = new Position(this.sourcePosition.root, path)._getTransformedByMergeOperation(this);\n return new SplitOperation(targetPosition, this.howMany, insertionPosition, this.graveyardPosition, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const sourceElement = this.sourcePosition.parent;\n const targetElement = this.targetPosition.parent;\n // Validate whether merge operation has correct parameters.\n if (!sourceElement.parent) {\n /**\n * Merge source position is invalid. The element to be merged must have a parent node.\n *\n * @error merge-operation-source-position-invalid\n */\n throw new CKEditorError('merge-operation-source-position-invalid', this);\n }\n else if (!targetElement.parent) {\n /**\n * Merge target position is invalid. The element to be merged must have a parent node.\n *\n * @error merge-operation-target-position-invalid\n */\n throw new CKEditorError('merge-operation-target-position-invalid', this);\n }\n else if (this.howMany != sourceElement.maxOffset) {\n /**\n * Merge operation specifies wrong number of nodes to move.\n *\n * @error merge-operation-how-many-invalid\n */\n throw new CKEditorError('merge-operation-how-many-invalid', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n const mergedElement = this.sourcePosition.parent;\n const sourceRange = Range._createIn(mergedElement);\n _move(sourceRange, this.targetPosition);\n _move(Range._createOn(mergedElement), this.graveyardPosition);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.sourcePosition = json.sourcePosition.toJSON();\n json.targetPosition = json.targetPosition.toJSON();\n json.graveyardPosition = json.graveyardPosition.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'MergeOperation';\n }\n /**\n * Creates `MergeOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n const sourcePosition = Position.fromJSON(json.sourcePosition, document);\n const targetPosition = Position.fromJSON(json.targetPosition, document);\n const graveyardPosition = Position.fromJSON(json.graveyardPosition, document);\n return new this(sourcePosition, json.howMany, targetPosition, graveyardPosition, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/markeroperation\n */\nimport Operation from './operation.js';\nimport Range from '../range.js';\nexport default class MarkerOperation extends Operation {\n /**\n * @param name Marker name.\n * @param oldRange Marker range before the change.\n * @param newRange Marker range after the change.\n * @param markers Marker collection on which change should be executed.\n * @param affectsData Specifies whether the marker operation affects the data produced by the data pipeline\n * (is persisted in the editor's data).\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(name, oldRange, newRange, markers, affectsData, baseVersion) {\n super(baseVersion);\n this.name = name;\n this.oldRange = oldRange ? oldRange.clone() : null;\n this.newRange = newRange ? newRange.clone() : null;\n this.affectsData = affectsData;\n this._markers = markers;\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'marker';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n const ranges = [];\n if (this.oldRange) {\n ranges.push(this.oldRange.clone());\n }\n if (this.newRange) {\n if (this.oldRange) {\n ranges.push(...this.newRange.getDifference(this.oldRange));\n }\n else {\n ranges.push(this.newRange.clone());\n }\n }\n return ranges;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new MarkerOperation(this.name, this.oldRange, this.newRange, this._markers, this.affectsData, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new MarkerOperation(this.name, this.newRange, this.oldRange, this._markers, this.affectsData, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n if (this.newRange) {\n this._markers._set(this.name, this.newRange, true, this.affectsData);\n }\n else {\n this._markers._remove(this.name);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n toJSON() {\n const json = super.toJSON();\n if (this.oldRange) {\n json.oldRange = this.oldRange.toJSON();\n }\n if (this.newRange) {\n json.newRange = this.newRange.toJSON();\n }\n delete json._markers;\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'MarkerOperation';\n }\n /**\n * Creates `MarkerOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new MarkerOperation(json.name, json.oldRange ? Range.fromJSON(json.oldRange, document) : null, json.newRange ? Range.fromJSON(json.newRange, document) : null, document.model.markers, json.affectsData, json.baseVersion);\n }\n}\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/attributeoperation\n */\nimport Operation from './operation.js';\nimport { _setAttribute } from './utils.js';\nimport Range from '../range.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\nimport { isEqual } from 'lodash-es';\n/**\n * Operation to change nodes' attribute.\n *\n * Using this class you can add, remove or change value of the attribute.\n */\nexport default class AttributeOperation extends Operation {\n /**\n * Creates an operation that changes, removes or adds attributes.\n *\n * If only `newValue` is set, attribute will be added on a node. Note that all nodes in operation's range must not\n * have an attribute with the same key as the added attribute.\n *\n * If only `oldValue` is set, then attribute with given key will be removed. Note that all nodes in operation's range\n * must have an attribute with that key added.\n *\n * If both `newValue` and `oldValue` are set, then the operation will change the attribute value. Note that all nodes in\n * operation's ranges must already have an attribute with given key and `oldValue` as value\n *\n * @param range Range on which the operation should be applied. Must be a flat range.\n * @param key Key of an attribute to change or remove.\n * @param oldValue Old value of the attribute with given key or `null`, if attribute was not set before.\n * @param newValue New value of the attribute with given key or `null`, if operation should remove attribute.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(range, key, oldValue, newValue, baseVersion) {\n super(baseVersion);\n this.range = range.clone();\n this.key = key;\n this.oldValue = oldValue === undefined ? null : oldValue;\n this.newValue = newValue === undefined ? null : newValue;\n }\n /**\n * @inheritDoc\n */\n get type() {\n if (this.oldValue === null) {\n return 'addAttribute';\n }\n else if (this.newValue === null) {\n return 'removeAttribute';\n }\n else {\n return 'changeAttribute';\n }\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this.range.clone();\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new AttributeOperation(this.range, this.key, this.oldValue, this.newValue, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new AttributeOperation(this.range, this.key, this.newValue, this.oldValue, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.range = this.range.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n if (!this.range.isFlat) {\n /**\n * The range to change is not flat.\n *\n * @error attribute-operation-range-not-flat\n */\n throw new CKEditorError('attribute-operation-range-not-flat', this);\n }\n for (const item of this.range.getItems({ shallow: true })) {\n if (this.oldValue !== null && !isEqual(item.getAttribute(this.key), this.oldValue)) {\n /**\n * Changed node has different attribute value than operation's old attribute value.\n *\n * @error attribute-operation-wrong-old-value\n * @param item\n * @param key\n * @param value\n */\n throw new CKEditorError('attribute-operation-wrong-old-value', this, { item, key: this.key, value: this.oldValue });\n }\n if (this.oldValue === null && this.newValue !== null && item.hasAttribute(this.key)) {\n /**\n * The attribute with given key already exists for the given node.\n *\n * @error attribute-operation-attribute-exists\n * @param node\n * @param key\n */\n throw new CKEditorError('attribute-operation-attribute-exists', this, { node: item, key: this.key });\n }\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n // If value to set is same as old value, don't do anything.\n if (!isEqual(this.oldValue, this.newValue)) {\n // Execution.\n _setAttribute(this.range, this.key, this.newValue);\n }\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'AttributeOperation';\n }\n /**\n * Creates `AttributeOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new AttributeOperation(Range.fromJSON(json.range, document), json.key, json.oldValue, json.newValue, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/nooperation\n */\nimport Operation from './operation.js';\n/**\n * Operation which is doing nothing (\"empty operation\", \"do-nothing operation\", \"noop\"). This is an operation,\n * which when executed does not change the tree model. It still has some parameters defined for transformation purposes.\n *\n * In most cases this operation is a result of transforming operations. When transformation returns\n * {@link module:engine/model/operation/nooperation~NoOperation} it means that changes done by the transformed operation\n * have already been applied.\n */\nexport default class NoOperation extends Operation {\n get type() {\n return 'noop';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return null;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new NoOperation(this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new NoOperation(this.baseVersion + 1);\n }\n /** @internal */\n _execute() {\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'NoOperation';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/renameoperation\n */\nimport Operation from './operation.js';\nimport Element from '../element.js';\nimport Position from '../position.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to change element's name.\n *\n * Using this class you can change element's name.\n */\nexport default class RenameOperation extends Operation {\n /**\n * Creates an operation that changes element's name.\n *\n * @param position Position before an element to change.\n * @param oldName Current name of the element.\n * @param newName New name for the element.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(position, oldName, newName, baseVersion) {\n super(baseVersion);\n this.position = position;\n // This position sticks to the next node because it is a position before the node that we want to change.\n this.position.stickiness = 'toNext';\n this.oldName = oldName;\n this.newName = newName;\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'rename';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this.position.nodeAfter;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n *\n * @returns Clone of this operation.\n */\n clone() {\n return new RenameOperation(this.position.clone(), this.oldName, this.newName, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new RenameOperation(this.position.clone(), this.newName, this.oldName, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const element = this.position.nodeAfter;\n if (!(element instanceof Element)) {\n /**\n * Given position is invalid or node after it is not instance of Element.\n *\n * @error rename-operation-wrong-position\n */\n throw new CKEditorError('rename-operation-wrong-position', this);\n }\n else if (element.name !== this.oldName) {\n /**\n * Element to change has different name than operation's old name.\n *\n * @error rename-operation-wrong-name\n */\n throw new CKEditorError('rename-operation-wrong-name', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n const element = this.position.nodeAfter;\n element.name = this.newName;\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.position = this.position.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'RenameOperation';\n }\n /**\n * Creates `RenameOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new RenameOperation(Position.fromJSON(json.position, document), json.oldName, json.newName, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/rootattributeoperation\n */\nimport Operation from './operation.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.\n *\n * This operation is needed, because root elements can't be changed through\n * {@link module:engine/model/operation/attributeoperation~AttributeOperation}.\n * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}\n * requires a range to change and root element can't\n * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.\n * {@link module:engine/model/position~Position} can't be created before a root element.\n */\nexport default class RootAttributeOperation extends Operation {\n /**\n * Creates an operation that changes, removes or adds attributes on root element.\n *\n * @see module:engine/model/operation/attributeoperation~AttributeOperation\n * @param root Root element to change.\n * @param key Key of an attribute to change or remove.\n * @param oldValue Old value of the attribute with given key or `null`, if attribute was not set before.\n * @param newValue New value of the attribute with given key or `null`, if operation should remove attribute.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(root, key, oldValue, newValue, baseVersion) {\n super(baseVersion);\n this.root = root;\n this.key = key;\n this.oldValue = oldValue === undefined ? null : oldValue;\n this.newValue = newValue === undefined ? null : newValue;\n }\n /**\n * @inheritDoc\n */\n get type() {\n if (this.oldValue === null) {\n return 'addRootAttribute';\n }\n else if (this.newValue === null) {\n return 'removeRootAttribute';\n }\n else {\n return 'changeRootAttribute';\n }\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this.root;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n *\n * @returns Clone of this operation.\n */\n clone() {\n return new RootAttributeOperation(this.root, this.key, this.oldValue, this.newValue, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new RootAttributeOperation(this.root, this.key, this.newValue, this.oldValue, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n if (this.root != this.root.root || this.root.is('documentFragment')) {\n /**\n * The element to change is not a root element.\n *\n * @error rootattribute-operation-not-a-root\n * @param root\n * @param key\n * @param value\n */\n throw new CKEditorError('rootattribute-operation-not-a-root', this, { root: this.root, key: this.key });\n }\n if (this.oldValue !== null && this.root.getAttribute(this.key) !== this.oldValue) {\n /**\n * The attribute which should be removed does not exist for the given node.\n *\n * @error rootattribute-operation-wrong-old-value\n * @param root\n * @param key\n * @param value\n */\n throw new CKEditorError('rootattribute-operation-wrong-old-value', this, { root: this.root, key: this.key });\n }\n if (this.oldValue === null && this.newValue !== null && this.root.hasAttribute(this.key)) {\n /**\n * The attribute with given key already exists for the given node.\n *\n * @error rootattribute-operation-attribute-exists\n * @param root\n * @param key\n */\n throw new CKEditorError('rootattribute-operation-attribute-exists', this, { root: this.root, key: this.key });\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n if (this.newValue !== null) {\n this.root._setAttribute(this.key, this.newValue);\n }\n else {\n this.root._removeAttribute(this.key);\n }\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.root = this.root.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'RootAttributeOperation';\n }\n /**\n * Creates `RootAttributeOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n if (!document.getRoot(json.root)) {\n /**\n * Cannot create RootAttributeOperation for document. Root with specified name does not exist.\n *\n * @error rootattribute-operation-fromjson-no-root\n * @param rootName\n */\n throw new CKEditorError('rootattribute-operation-fromjson-no-root', this, { rootName: json.root });\n }\n return new RootAttributeOperation(document.getRoot(json.root), json.key, json.oldValue, json.newValue, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/rootoperation\n */\nimport Operation from './operation.js';\n/**\n * Operation that creates (or attaches) or detaches a root element.\n */\nexport default class RootOperation extends Operation {\n /**\n * Creates an operation that creates or removes a root element.\n *\n * @param rootName Root name to create or detach.\n * @param elementName Root element name.\n * @param isAdd Specifies whether the operation adds (`true`) or detaches the root (`false`).\n * @param document Document which owns the root.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation can be applied.\n */\n constructor(rootName, elementName, isAdd, document, baseVersion) {\n super(baseVersion);\n this.rootName = rootName;\n this.elementName = elementName;\n this.isAdd = isAdd;\n this._document = document;\n // Make sure that the root exists ASAP, this is important for RTC.\n // If the root was dynamically added, there will be more operations that operate on/in this root.\n // These operations will require root element instance (in operation property or in position instance).\n // If the root is not created ahead of time, instantiating such operations may fail.\n if (!this._document.getRoot(this.rootName)) {\n const root = this._document.createRoot(this.elementName, this.rootName);\n root._isAttached = false;\n }\n }\n /**\n * @inheritDoc\n */\n get type() {\n return this.isAdd ? 'addRoot' : 'detachRoot';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this._document.getRoot(this.rootName);\n }\n /**\n * @inheritDoc\n */\n clone() {\n return new RootOperation(this.rootName, this.elementName, this.isAdd, this._document, this.baseVersion);\n }\n /**\n * @inheritDoc\n */\n getReversed() {\n return new RootOperation(this.rootName, this.elementName, !this.isAdd, this._document, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n */\n _execute() {\n this._document.getRoot(this.rootName)._isAttached = this.isAdd;\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n delete json._document;\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'RootOperation';\n }\n /**\n * Creates `RootOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new RootOperation(json.rootName, json.elementName, json.isAdd, document, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/operationfactory\n */\nimport AttributeOperation from './attributeoperation.js';\nimport InsertOperation from './insertoperation.js';\nimport MarkerOperation from './markeroperation.js';\nimport MoveOperation from './moveoperation.js';\nimport NoOperation from './nooperation.js';\nimport Operation from './operation.js';\nimport RenameOperation from './renameoperation.js';\nimport RootAttributeOperation from './rootattributeoperation.js';\nimport RootOperation from './rootoperation.js';\nimport SplitOperation from './splitoperation.js';\nimport MergeOperation from './mergeoperation.js';\nconst operations = {};\noperations[AttributeOperation.className] = AttributeOperation;\noperations[InsertOperation.className] = InsertOperation;\noperations[MarkerOperation.className] = MarkerOperation;\noperations[MoveOperation.className] = MoveOperation;\noperations[NoOperation.className] = NoOperation;\noperations[Operation.className] = Operation;\noperations[RenameOperation.className] = RenameOperation;\noperations[RootAttributeOperation.className] = RootAttributeOperation;\noperations[RootOperation.className] = RootOperation;\noperations[SplitOperation.className] = SplitOperation;\noperations[MergeOperation.className] = MergeOperation;\n/**\n * A factory class for creating operations.\n */\nexport default class OperationFactory {\n /**\n * Creates an operation instance from a JSON object (parsed JSON string).\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return operations[json.__className].fromJSON(json, document);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/transform\n */\nimport InsertOperation from './insertoperation.js';\nimport AttributeOperation from './attributeoperation.js';\nimport RenameOperation from './renameoperation.js';\nimport MarkerOperation from './markeroperation.js';\nimport MoveOperation from './moveoperation.js';\nimport RootAttributeOperation from './rootattributeoperation.js';\nimport RootOperation from './rootoperation.js';\nimport MergeOperation from './mergeoperation.js';\nimport SplitOperation from './splitoperation.js';\nimport NoOperation from './nooperation.js';\nimport Range from '../range.js';\nimport Position from '../position.js';\nimport { compareArrays } from '@ckeditor/ckeditor5-utils';\nconst transformations = new Map();\n/**\n * Sets a transformation function to be be used to transform instances of class `OperationA` by instances of class `OperationB`.\n *\n * The `transformationFunction` is passed three parameters:\n *\n * * `a` - operation to be transformed, an instance of `OperationA`,\n * * `b` - operation to be transformed by, an instance of `OperationB`,\n * * {@link module:engine/model/operation/transform~TransformationContext `context`} - object with additional information about\n * transformation context.\n *\n * The `transformationFunction` should return transformation result, which is an array with one or multiple\n * {@link module:engine/model/operation/operation~Operation operation} instances.\n *\n * @param transformationFunction Function to use for transforming.\n */\nfunction setTransformation(OperationA, OperationB, transformationFunction) {\n let aGroup = transformations.get(OperationA);\n if (!aGroup) {\n aGroup = new Map();\n transformations.set(OperationA, aGroup);\n }\n aGroup.set(OperationB, transformationFunction);\n}\n/**\n * Returns a previously set transformation function for transforming an instance of `OperationA` by an instance of `OperationB`.\n *\n * If no transformation was set for given pair of operations, {@link module:engine/model/operation/transform~noUpdateTransformation}\n * is returned. This means that if no transformation was set, the `OperationA` instance will not change when transformed\n * by the `OperationB` instance.\n *\n * @returns Function set to transform an instance of `OperationA` by an instance of `OperationB`.\n */\nfunction getTransformation(OperationA, OperationB) {\n const aGroup = transformations.get(OperationA);\n if (aGroup && aGroup.has(OperationB)) {\n return aGroup.get(OperationB);\n }\n return noUpdateTransformation;\n}\n/**\n * A transformation function that only clones operation to transform, without changing it.\n */\nfunction noUpdateTransformation(a) {\n return [a];\n}\n/**\n * Transforms operation `a` by operation `b`.\n *\n * @param a Operation to be transformed.\n * @param b Operation to transform by.\n * @param context Transformation context for this transformation.\n * @returns Transformation result.\n */\nexport function transform(a, b, context = {}) {\n const transformationFunction = getTransformation(a.constructor, b.constructor);\n /* eslint-disable no-useless-catch */\n try {\n a = a.clone();\n return transformationFunction(a, b, context);\n }\n catch (e) {\n // @if CK_DEBUG // console.warn( 'Error during operation transformation!', e.message );\n // @if CK_DEBUG // console.warn( 'Transformed operation', a );\n // @if CK_DEBUG // console.warn( 'Operation transformed by', b );\n // @if CK_DEBUG // console.warn( 'context.aIsStrong', context.aIsStrong );\n // @if CK_DEBUG // console.warn( 'context.aWasUndone', context.aWasUndone );\n // @if CK_DEBUG // console.warn( 'context.bWasUndone', context.bWasUndone );\n // @if CK_DEBUG // console.warn( 'context.abRelation', context.abRelation );\n // @if CK_DEBUG // console.warn( 'context.baRelation', context.baRelation );\n throw e;\n }\n /* eslint-enable no-useless-catch */\n}\n/**\n * Performs a transformation of two sets of operations - `operationsA` and `operationsB`. The transformation is two-way -\n * both transformed `operationsA` and transformed `operationsB` are returned.\n *\n * Note, that the first operation in each set should base on the same document state (\n * {@link module:engine/model/document~Document#version document version}).\n *\n * It is assumed that `operationsA` are \"more important\" during conflict resolution between two operations.\n *\n * New copies of both passed arrays and operations inside them are returned. Passed arguments are not altered.\n *\n * Base versions of the transformed operations sets are updated accordingly. For example, assume that base versions are `4`\n * and there are `3` operations in `operationsA` and `5` operations in `operationsB`. Then:\n *\n * * transformed `operationsA` will start from base version `9` (`4` base version + `5` operations B),\n * * transformed `operationsB` will start from base version `7` (`4` base version + `3` operations A).\n *\n * If no operation was broken into two during transformation, then both sets will end up with an operation that bases on version `11`:\n *\n * * transformed `operationsA` start from `9` and there are `3` of them, so the last will have `baseVersion` equal to `11`,\n * * transformed `operationsB` start from `7` and there are `5` of them, so the last will have `baseVersion` equal to `11`.\n *\n * @param operationsA\n * @param operationsB\n * @param options Additional transformation options.\n * @param options.document Document which the operations change.\n * @param options.useRelations Whether during transformation relations should be used (used during undo for better conflict resolution).\n * @param options.padWithNoOps Whether additional {@link module:engine/model/operation/nooperation~NoOperation}s\n * should be added to the transformation results to force the same last base version for both transformed sets (in case\n * if some operations got broken into multiple operations during transformation).\n * @param options.forceWeakRemove If set to `false`, remove operation will be always stronger than move operation,\n * so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.\n * @returns Transformation result.\n */\nexport function transformSets(operationsA, operationsB, options) {\n // Create new arrays so the originally passed arguments are not changed.\n // No need to clone operations, they are cloned as they are transformed.\n operationsA = operationsA.slice();\n operationsB = operationsB.slice();\n const contextFactory = new ContextFactory(options.document, options.useRelations, options.forceWeakRemove);\n contextFactory.setOriginalOperations(operationsA);\n contextFactory.setOriginalOperations(operationsB);\n const originalOperations = contextFactory.originalOperations;\n // If one of sets is empty there is simply nothing to transform, so return sets as they are.\n if (operationsA.length == 0 || operationsB.length == 0) {\n return { operationsA, operationsB, originalOperations };\n }\n //\n // Following is a description of transformation process:\n //\n // There are `operationsA` and `operationsB` to be transformed, both by both.\n //\n // So, suppose we have sets of two operations each: `operationsA` = `[ a1, a2 ]`, `operationsB` = `[ b1, b2 ]`.\n //\n // Remember, that we can only transform operations that base on the same context. We assert that `a1` and `b1` base on\n // the same context and we transform them. Then, we get `a1'` and `b1'`. `a2` bases on a context with `a1` -- `a2`\n // is an operation that followed `a1`. Similarly, `b2` bases on a context with `b1`.\n //\n // However, since `a1'` is a result of transformation by `b1`, `a1'` now also has a context with `b1`. This means that\n // we can safely transform `a1'` by `b2`. As we finish transforming `a1`, we also transformed all `operationsB`.\n // All `operationsB` also have context including `a1`. Now, we can properly transform `a2` by those operations.\n //\n // The transformation process can be visualized on a transformation diagram (\"diamond diagram\"):\n //\n // [the initial state]\n // [common for a1 and b1]\n //\n // *\n // / \\\n // / \\\n // b1 a1\n // / \\\n // / \\\n // * *\n // / \\ / \\\n // / \\ / \\\n // b2 a1' b1' a2\n // / \\ / \\\n // / \\ / \\\n // * * *\n // \\ / \\ /\n // \\ / \\ /\n // a1'' b2' a2' b1''\n // \\ / \\ /\n // \\ / \\ /\n // * *\n // \\ /\n // \\ /\n // a2'' b2''\n // \\ /\n // \\ /\n // *\n //\n // [the final state]\n //\n // The final state can be reached from the initial state by applying `a1`, `a2`, `b1''` and `b2''`, as well as by\n // applying `b1`, `b2`, `a1''`, `a2''`. Note how the operations get to a proper common state before each pair is\n // transformed.\n //\n // Another thing to consider is that an operation during transformation can be broken into multiple operations.\n // Suppose that `a1` * `b1` = `[ a11', a12' ]` (instead of `a1'` that we considered previously).\n //\n // In that case, we leave `a12'` for later and we continue transforming `a11'` until it is transformed by all `operationsB`\n // (in our case it is just `b2`). At this point, `b1` is transformed by \"whole\" `a1`, while `b2` is only transformed\n // by `a11'`. Similarly, `a12'` is only transformed by `b1`. This leads to a conclusion that we need to start transforming `a12'`\n // from the moment just after it was broken. So, `a12'` is transformed by `b2`. Now, \"the whole\" `a1` is transformed\n // by `operationsB`, while all `operationsB` are transformed by \"the whole\" `a1`. This means that we can continue with\n // following `operationsA` (in our case it is just `a2`).\n //\n // Of course, also `operationsB` can be broken. However, since we focus on transforming operation `a` to the end,\n // the only thing to do is to store both pieces of operation `b`, so that the next transformed operation `a` will\n // be transformed by both of them.\n //\n // *\n // / \\\n // / \\\n // / \\\n // b1 a1\n // / \\\n // / \\\n // / \\\n // * *\n // / \\ / \\\n // / a11' / \\\n // / \\ / \\\n // b2 * b1' a2\n // / / \\ / \\\n // / / a12' / \\\n // / / \\ / \\\n // * b2' * *\n // \\ / / \\ /\n // a11'' / b21'' \\ /\n // \\ / / \\ /\n // * * a2' b1''\n // \\ / \\ \\ /\n // a12'' b22''\\ \\ /\n // \\ / \\ \\ /\n // * a2'' *\n // \\ \\ /\n // \\ \\ b21'''\n // \\ \\ /\n // a2''' *\n // \\ /\n // \\ b22'''\n // \\ /\n // *\n //\n // Note, how `a1` is broken and transformed into `a11'` and `a12'`, while `b2'` got broken and transformed into `b21''` and `b22''`.\n //\n // Having all that on mind, here is an outline for the transformation process algorithm:\n //\n // 1. We have `operationsA` and `operationsB` array, which we dynamically update as the transformation process goes.\n //\n // 2. We take next (or first) operation from `operationsA` and check from which operation `b` we need to start transforming it.\n // All original `operationsA` are set to be transformed starting from the first operation `b`.\n //\n // 3. We take operations from `operationsB`, one by one, starting from the correct one, and transform operation `a`\n // by operation `b` (and vice versa). We update `operationsA` and `operationsB` by replacing the original operations\n // with the transformation results.\n //\n // 4. If operation is broken into multiple operations, we save all the new operations in the place of the\n // original operation.\n //\n // 5. Additionally, if operation `a` was broken, for the \"new\" operation, we remember from which operation `b` it should\n // be transformed by.\n //\n // 6. We continue transforming \"current\" operation `a` until it is transformed by all `operationsB`. Then, go to 2.\n // unless the last operation `a` was transformed.\n //\n // The actual implementation of the above algorithm is slightly different, as only one loop (while) is used.\n // The difference is that we have \"current\" `a` operation to transform and we store the index of the next `b` operation\n // to transform by. Each loop operates on two indexes then: index pointing to currently processed `a` operation and\n // index pointing to next `b` operation. Each loop is just one `a * b` + `b * a` transformation. After each loop\n // operation `b` index is updated. If all `b` operations were visited for the current `a` operation, we change\n // current `a` operation index to the next one.\n //\n // For each operation `a`, keeps information what is the index in `operationsB` from which the transformation should start.\n const nextTransformIndex = new WeakMap();\n // For all the original `operationsA`, set that they should be transformed starting from the first of `operationsB`.\n for (const op of operationsA) {\n nextTransformIndex.set(op, 0);\n }\n // Additional data that is used for some postprocessing after the main transformation process is done.\n const data = {\n nextBaseVersionA: operationsA[operationsA.length - 1].baseVersion + 1,\n nextBaseVersionB: operationsB[operationsB.length - 1].baseVersion + 1,\n originalOperationsACount: operationsA.length,\n originalOperationsBCount: operationsB.length\n };\n // Index of currently transformed operation `a`.\n let i = 0;\n // While not all `operationsA` are transformed...\n while (i < operationsA.length) {\n // Get \"current\" operation `a`.\n const opA = operationsA[i];\n // For the \"current\" operation `a`, get the index of the next operation `b` to transform by.\n const indexB = nextTransformIndex.get(opA);\n // If operation `a` was already transformed by every operation `b`, change \"current\" operation `a` to the next one.\n if (indexB == operationsB.length) {\n i++;\n continue;\n }\n const opB = operationsB[indexB];\n // Transform `a` by `b` and `b` by `a`.\n const newOpsA = transform(opA, opB, contextFactory.getContext(opA, opB, true));\n const newOpsB = transform(opB, opA, contextFactory.getContext(opB, opA, false));\n // As a result we get one or more `newOpsA` and one or more `newOpsB` operations.\n // Update contextual information about operations.\n contextFactory.updateRelation(opA, opB);\n contextFactory.setOriginalOperations(newOpsA, opA);\n contextFactory.setOriginalOperations(newOpsB, opB);\n // For new `a` operations, update their index of the next operation `b` to transform them by.\n //\n // This is needed even if there was only one result (`a` was not broken) because that information is used\n // at the beginning of this loop every time.\n for (const newOpA of newOpsA) {\n // Acknowledge, that operation `b` also might be broken into multiple operations.\n //\n // This is why we raise `indexB` not just by 1. If `newOpsB` are multiple operations, they will be\n // spliced in the place of `opB`. So we need to change `transformBy` accordingly, so that an operation won't\n // be transformed by the same operation (part of it) again.\n nextTransformIndex.set(newOpA, indexB + newOpsB.length);\n }\n // Update `operationsA` and `operationsB` with the transformed versions.\n operationsA.splice(i, 1, ...newOpsA);\n operationsB.splice(indexB, 1, ...newOpsB);\n }\n if (options.padWithNoOps) {\n // If no-operations padding is enabled, count how many extra `a` and `b` operations were generated.\n const brokenOperationsACount = operationsA.length - data.originalOperationsACount;\n const brokenOperationsBCount = operationsB.length - data.originalOperationsBCount;\n // Then, if that number is not the same, pad `operationsA` or `operationsB` with correct number of no-ops so\n // that the base versions are equalled.\n //\n // Note that only one array will be updated, as only one of those subtractions can be greater than zero.\n padWithNoOps(operationsA, brokenOperationsBCount - brokenOperationsACount);\n padWithNoOps(operationsB, brokenOperationsACount - brokenOperationsBCount);\n }\n // Finally, update base versions of transformed operations.\n updateBaseVersions(operationsA, data.nextBaseVersionB);\n updateBaseVersions(operationsB, data.nextBaseVersionA);\n return { operationsA, operationsB, originalOperations };\n}\n/**\n * Gathers additional data about operations processed during transformation. Can be used to obtain contextual information\n * about two operations that are about to be transformed. This contextual information can be used for better conflict resolution.\n */\nclass ContextFactory {\n /**\n * Creates `ContextFactory` instance.\n *\n * @param document Document which the operations change.\n * @param useRelations Whether during transformation relations should be used (used during undo for\n * better conflict resolution).\n * @param forceWeakRemove If set to `false`, remove operation will be always stronger than move operation,\n * so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.\n */\n constructor(document, useRelations, forceWeakRemove = false) {\n // For each operation that is created during transformation process, we keep a reference to the original operation\n // which it comes from. The original operation works as a kind of \"identifier\". Every contextual information\n // gathered during transformation that we want to save for given operation, is actually saved for the original operation.\n // This way no matter if operation `a` is cloned, then transformed, even breaks, we still have access to the previously\n // gathered data through original operation reference.\n this.originalOperations = new Map();\n // `model.History` instance which information about undone operations will be taken from.\n this._history = document.history;\n // Whether additional context should be used.\n this._useRelations = useRelations;\n this._forceWeakRemove = !!forceWeakRemove;\n // Relations is a double-map structure (maps in map) where for two operations we store how those operations were related\n // to each other. Those relations are evaluated during transformation process. For every transformated pair of operations\n // we keep relations between them.\n this._relations = new Map();\n }\n /**\n * Sets \"original operation\" for given operations.\n *\n * During transformation process, operations are cloned, then changed, then processed again, sometimes broken into two\n * or multiple operations. When gathering additional data it is important that all operations can be somehow linked\n * so a cloned and transformed \"version\" still kept track of the data assigned earlier to it.\n *\n * The original operation object will be used as such an universal linking id. Throughout the transformation process\n * all cloned operations will refer to \"the original operation\" when storing and reading additional data.\n *\n * If `takeFrom` is not set, each operation from `operations` array will be assigned itself as \"the original operation\".\n * This should be used as an initialization step.\n *\n * If `takeFrom` is set, each operation from `operations` will be assigned the same original operation as assigned\n * for `takeFrom` operation. This should be used to update original operations. It should be used in a way that\n * `operations` are the result of `takeFrom` transformation to ensure proper \"original operation propagation\".\n */\n setOriginalOperations(operations, takeFrom = null) {\n const originalOperation = takeFrom ? this.originalOperations.get(takeFrom) : null;\n for (const operation of operations) {\n this.originalOperations.set(operation, originalOperation || operation);\n }\n }\n /**\n * Saves a relation between operations `opA` and `opB`.\n *\n * Relations are then later used to help solve conflicts when operations are transformed.\n */\n updateRelation(opA, opB) {\n // The use of relations is described in a bigger detail in transformation functions.\n //\n // In brief, this function, for specified pairs of operation types, checks how positions defined in those operations relate.\n // Then those relations are saved. For example, for two move operations, it is saved if one of those operations target\n // position is before the other operation source position. This kind of information gives contextual information when\n // transformation is used during undo. Similar checks are done for other pairs of operations.\n //\n if (opA instanceof MoveOperation) {\n if (opB instanceof MergeOperation) {\n if (opA.targetPosition.isEqual(opB.sourcePosition) || opB.movedRange.containsPosition(opA.targetPosition)) {\n this._setRelation(opA, opB, 'insertAtSource');\n }\n else if (opA.targetPosition.isEqual(opB.deletionPosition)) {\n this._setRelation(opA, opB, 'insertBetween');\n }\n else if (opA.targetPosition.isAfter(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'moveTargetAfter');\n }\n }\n else if (opB instanceof MoveOperation) {\n if (opA.targetPosition.isEqual(opB.sourcePosition) || opA.targetPosition.isBefore(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'insertBefore');\n }\n else {\n this._setRelation(opA, opB, 'insertAfter');\n }\n }\n }\n else if (opA instanceof SplitOperation) {\n if (opB instanceof MergeOperation) {\n if (opA.splitPosition.isBefore(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'splitBefore');\n }\n }\n else if (opB instanceof MoveOperation) {\n if (opA.splitPosition.isEqual(opB.sourcePosition) || opA.splitPosition.isBefore(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'splitBefore');\n }\n else {\n const range = Range._createFromPositionAndShift(opB.sourcePosition, opB.howMany);\n if (opA.splitPosition.hasSameParentAs(opB.sourcePosition) && range.containsPosition(opA.splitPosition)) {\n const howMany = range.end.offset - opA.splitPosition.offset;\n const offset = opA.splitPosition.offset - range.start.offset;\n this._setRelation(opA, opB, { howMany, offset });\n }\n }\n }\n }\n else if (opA instanceof MergeOperation) {\n if (opB instanceof MergeOperation) {\n if (!opA.targetPosition.isEqual(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'mergeTargetNotMoved');\n }\n if (opA.sourcePosition.isEqual(opB.targetPosition)) {\n this._setRelation(opA, opB, 'mergeSourceNotMoved');\n }\n if (opA.sourcePosition.isEqual(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'mergeSameElement');\n }\n }\n else if (opB instanceof SplitOperation) {\n if (opA.sourcePosition.isEqual(opB.splitPosition)) {\n this._setRelation(opA, opB, 'splitAtSource');\n }\n }\n else if (opB instanceof MoveOperation && opB.howMany > 0) {\n if (opA.sourcePosition.isEqual(opB.sourcePosition.getShiftedBy(opB.howMany))) {\n this._setRelation(opA, opB, 'mergeSourceAffected');\n }\n if (opA.targetPosition.isEqual(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'mergeTargetWasBefore');\n }\n }\n }\n else if (opA instanceof MarkerOperation) {\n const markerRange = opA.newRange;\n if (!markerRange) {\n return;\n }\n if (opB instanceof MoveOperation) {\n const movedRange = Range._createFromPositionAndShift(opB.sourcePosition, opB.howMany);\n const affectedLeft = movedRange.containsPosition(markerRange.start) ||\n movedRange.start.isEqual(markerRange.start);\n const affectedRight = movedRange.containsPosition(markerRange.end) ||\n movedRange.end.isEqual(markerRange.end);\n if ((affectedLeft || affectedRight) && !movedRange.containsRange(markerRange)) {\n this._setRelation(opA, opB, {\n side: affectedLeft ? 'left' : 'right',\n path: affectedLeft ? markerRange.start.path.slice() : markerRange.end.path.slice()\n });\n }\n }\n else if (opB instanceof MergeOperation) {\n const wasInLeftElement = markerRange.start.isEqual(opB.targetPosition);\n const wasStartBeforeMergedElement = markerRange.start.isEqual(opB.deletionPosition);\n const wasEndBeforeMergedElement = markerRange.end.isEqual(opB.deletionPosition);\n const wasInRightElement = markerRange.end.isEqual(opB.sourcePosition);\n if (wasInLeftElement || wasStartBeforeMergedElement || wasEndBeforeMergedElement || wasInRightElement) {\n this._setRelation(opA, opB, {\n wasInLeftElement,\n wasStartBeforeMergedElement,\n wasEndBeforeMergedElement,\n wasInRightElement\n });\n }\n }\n }\n }\n /**\n * Evaluates and returns contextual information about two given operations `opA` and `opB` which are about to be transformed.\n */\n getContext(opA, opB, aIsStrong) {\n return {\n aIsStrong,\n aWasUndone: this._wasUndone(opA),\n bWasUndone: this._wasUndone(opB),\n abRelation: this._useRelations ? this._getRelation(opA, opB) : null,\n baRelation: this._useRelations ? this._getRelation(opB, opA) : null,\n forceWeakRemove: this._forceWeakRemove\n };\n }\n /**\n * Returns whether given operation `op` has already been undone.\n *\n * Information whether an operation was undone gives more context when making a decision when two operations are in conflict.\n */\n _wasUndone(op) {\n // For `op`, get its original operation. After all, if `op` is a clone (or even transformed clone) of another\n // operation, literally `op` couldn't be undone. It was just generated. If anything, it was the operation it origins\n // from which was undone. So get that original operation.\n const originalOp = this.originalOperations.get(op);\n // And check with the document if the original operation was undone.\n return originalOp.wasUndone || this._history.isUndoneOperation(originalOp);\n }\n /**\n * Returns a relation between `opA` and an operation which is undone by `opB`. This can be `String` value if a relation\n * was set earlier or `null` if there was no relation between those operations.\n *\n * This is a little tricky to understand, so let's compare it to `ContextFactory#_wasUndone`.\n *\n * When `wasUndone( opB )` is used, we check if the `opB` has already been undone. It is obvious, that the\n * undoing operation must happen after the undone operation. So, essentially, we have `opB`, we take document history,\n * we look forward in the future and ask if in that future `opB` was undone.\n *\n * Relations is a backward process to `wasUndone()`.\n *\n * Long story short - using relations is asking what happened in the past. Looking back. This time we have an undoing\n * operation `opB` which has undone some other operation. When there is a transformation `opA` x `opB` and there is\n * a conflict to solve and `opB` is an undoing operation, we can look back in the history and see what was a relation\n * between `opA` and the operation which `opB` undone. Basing on that relation from the past, we can now make\n * a better decision when resolving a conflict between two operations, because we know more about the context of\n * those two operations.\n *\n * This is why this function does not return a relation directly between `opA` and `opB` because we need to look\n * back to search for a meaningful contextual information.\n */\n _getRelation(opA, opB) {\n // Get the original operation. Similarly as in `wasUndone()` it is used as an universal identifier for stored data.\n const origB = this.originalOperations.get(opB);\n const undoneB = this._history.getUndoneOperation(origB);\n // If `opB` is not undoing any operation, there is no relation.\n if (!undoneB) {\n return null;\n }\n const origA = this.originalOperations.get(opA);\n const relationsA = this._relations.get(origA);\n // Get all relations for `opA`, and check if there is a relation with `opB`-undone-counterpart. If so, return it.\n if (relationsA) {\n return relationsA.get(undoneB) || null;\n }\n return null;\n }\n /**\n * Helper function for `ContextFactory#updateRelations`.\n */\n _setRelation(opA, opB, relation) {\n // As always, setting is for original operations, not the clones/transformed operations.\n const origA = this.originalOperations.get(opA);\n const origB = this.originalOperations.get(opB);\n let relationsA = this._relations.get(origA);\n if (!relationsA) {\n relationsA = new Map();\n this._relations.set(origA, relationsA);\n }\n relationsA.set(origB, relation);\n }\n}\n/**\n * An utility function that updates {@link module:engine/model/operation/operation~Operation#baseVersion base versions}\n * of passed operations.\n *\n * The function simply sets `baseVersion` as a base version of the first passed operation and then increments it for\n * each following operation in `operations`.\n *\n * @param operations Operations to update.\n * @param baseVersion Base version to set for the first operation in `operations`.\n */\nfunction updateBaseVersions(operations, baseVersion) {\n for (const operation of operations) {\n operation.baseVersion = baseVersion++;\n }\n}\n/**\n * Adds `howMany` instances of {@link module:engine/model/operation/nooperation~NoOperation} to `operations` set.\n */\nfunction padWithNoOps(operations, howMany) {\n for (let i = 0; i < howMany; i++) {\n operations.push(new NoOperation(0));\n }\n}\n// -----------------------\nsetTransformation(AttributeOperation, AttributeOperation, (a, b, context) => {\n // If operations in conflict, check if their ranges intersect and manage them properly.\n //\n // Operations can be in conflict only if:\n //\n // * their key is the same (they change the same attribute), and\n // * they are in the same parent (operations for ranges [ 1 ] - [ 3 ] and [ 2, 0 ] - [ 2, 5 ] change different\n // elements and can't be in conflict).\n if (a.key === b.key && a.range.start.hasSameParentAs(b.range.start)) {\n // First, we want to apply change to the part of a range that has not been changed by the other operation.\n const operations = a.range.getDifference(b.range).map(range => {\n return new AttributeOperation(range, a.key, a.oldValue, a.newValue, 0);\n });\n // Then we take care of the common part of ranges.\n const common = a.range.getIntersection(b.range);\n if (common) {\n // If this operation is more important, we also want to apply change to the part of the\n // original range that has already been changed by the other operation. Since that range\n // got changed we also have to update `oldValue`.\n if (context.aIsStrong) {\n operations.push(new AttributeOperation(common, b.key, b.newValue, a.newValue, 0));\n }\n }\n if (operations.length == 0) {\n return [new NoOperation(0)];\n }\n return operations;\n }\n else {\n // If operations don't conflict, simply return an array containing just a clone of this operation.\n return [a];\n }\n});\nsetTransformation(AttributeOperation, InsertOperation, (a, b) => {\n // Case 1:\n //\n // The attribute operation range includes the position where nodes were inserted.\n // There are two possible scenarios: the inserted nodes were text and they should receive attributes or\n // the inserted nodes were elements and they should not receive attributes.\n //\n if (a.range.start.hasSameParentAs(b.position) && a.range.containsPosition(b.position)) {\n // If new nodes should not receive attributes, two separated ranges will be returned.\n // Otherwise, one expanded range will be returned.\n const range = a.range._getTransformedByInsertion(b.position, b.howMany, !b.shouldReceiveAttributes);\n const result = range.map(r => {\n return new AttributeOperation(r, a.key, a.oldValue, a.newValue, a.baseVersion);\n });\n if (b.shouldReceiveAttributes) {\n // `AttributeOperation#range` includes some newly inserted text.\n // The operation should also change the attribute of that text. An example:\n //\n // Bold should be applied on the following range:\n // <p>Fo[zb]ar</p>\n //\n // In meantime, new text is typed:\n // <p>Fozxxbar</p>\n //\n // Bold should be applied also on the new text:\n // <p>Fo[zxxb]ar</p>\n // <p>Fo<$text bold=\"true\">zxxb</$text>ar</p>\n //\n // There is a special case to consider here to consider.\n //\n // Consider setting an attribute with multiple possible values, for example `highlight`. The inserted text might\n // have already an attribute value applied and the `oldValue` property of the attribute operation might be wrong:\n //\n // Attribute `highlight=\"yellow\"` should be applied on the following range:\n // <p>Fo[zb]ar<p>\n //\n // In meantime, character `x` with `highlight=\"red\"` is typed:\n // <p>Fo[z<$text highlight=\"red\">x</$text>b]ar</p>\n //\n // In this case we cannot simply apply operation changing the attribute value from `null` to `\"yellow\"` for the whole range\n // because that would lead to an exception (`oldValue` is incorrect for `x`).\n //\n // We also cannot break the original range as this would mess up a scenario when there are multiple following\n // insert operations, because then only the first inserted character is included in those ranges:\n // <p>Fo[z][x][b]ar</p> --> <p>Fo[z][x]x[b]ar</p> --> <p>Fo[z][x]xx[b]ar</p>\n //\n // So, the attribute range needs be expanded, no matter what attributes are set on the inserted nodes:\n //\n // <p>Fo[z<$text highlight=\"red\">x</$text>b]ar</p> <--- Change from `null` to `yellow`, throwing an exception.\n //\n // But before that operation would be applied, we will add an additional attribute operation that will change\n // attributes on the inserted nodes in a way which would make the original operation correct:\n //\n // <p>Fo[z{<$text highlight=\"red\">}x</$text>b]ar</p> <--- Change range `{}` from `red` to `null`.\n // <p>Fo[zxb]ar</p> <--- Now change from `null` to `yellow` is completely fine.\n //\n // Generate complementary attribute operation. Be sure to add it before the original operation.\n const op = _getComplementaryAttributeOperations(b, a.key, a.oldValue);\n if (op) {\n result.unshift(op);\n }\n }\n // If nodes should not receive new attribute, we are done here.\n return result;\n }\n // If insert operation is not expanding the attribute operation range, simply transform the range.\n a.range = a.range._getTransformedByInsertion(b.position, b.howMany, false)[0];\n return [a];\n});\n/**\n * Helper function for `AttributeOperation` x `InsertOperation` (and reverse) transformation.\n *\n * For given `insertOperation` it checks the inserted node if it has an attribute `key` set to a value different\n * than `newValue`. If so, it generates an `AttributeOperation` which changes the value of `key` attribute to `newValue`.\n */\nfunction _getComplementaryAttributeOperations(insertOperation, key, newValue) {\n const nodes = insertOperation.nodes;\n // At the beginning we store the attribute value from the first node.\n const insertValue = nodes.getNode(0).getAttribute(key);\n if (insertValue == newValue) {\n return null;\n }\n const range = new Range(insertOperation.position, insertOperation.position.getShiftedBy(insertOperation.howMany));\n return new AttributeOperation(range, key, insertValue, newValue, 0);\n}\nsetTransformation(AttributeOperation, MergeOperation, (a, b) => {\n const ranges = [];\n // Case 1:\n //\n // Attribute change on the merged element. In this case, the merged element was moved to the graveyard.\n // An additional attribute operation that will change the (re)moved element needs to be generated.\n //\n if (a.range.start.hasSameParentAs(b.deletionPosition)) {\n if (a.range.containsPosition(b.deletionPosition) || a.range.start.isEqual(b.deletionPosition)) {\n ranges.push(Range._createFromPositionAndShift(b.graveyardPosition, 1));\n }\n }\n const range = a.range._getTransformedByMergeOperation(b);\n // Do not add empty (collapsed) ranges to the result. `range` may be collapsed if it contained only the merged element.\n if (!range.isCollapsed) {\n ranges.push(range);\n }\n // Create `AttributeOperation`s out of the ranges.\n return ranges.map(range => {\n return new AttributeOperation(range, a.key, a.oldValue, a.newValue, a.baseVersion);\n });\n});\nsetTransformation(AttributeOperation, MoveOperation, (a, b) => {\n const ranges = _breakRangeByMoveOperation(a.range, b);\n // Create `AttributeOperation`s out of the ranges.\n return ranges.map(range => new AttributeOperation(range, a.key, a.oldValue, a.newValue, a.baseVersion));\n});\n/**\n * Helper function for `AttributeOperation` x `MoveOperation` transformation.\n *\n * Takes the passed `range` and transforms it by move operation `moveOp` in a specific way. Only top-level nodes of `range`\n * are considered to be in the range. If move operation moves nodes deep from inside of the range, those nodes won't\n * be included in the result. In other words, top-level nodes of the ranges from the result are exactly the same as\n * top-level nodes of the original `range`.\n *\n * This is important for `AttributeOperation` because, for its range, it changes only the top-level nodes. So we need to\n * track only how those nodes have been affected by `MoveOperation`.\n */\nfunction _breakRangeByMoveOperation(range, moveOp) {\n const moveRange = Range._createFromPositionAndShift(moveOp.sourcePosition, moveOp.howMany);\n // We are transforming `range` (original range) by `moveRange` (range moved by move operation). As usual when it comes to\n // transforming a ranges, we may have a common part of the ranges and we may have a difference part (zero to two ranges).\n let common = null;\n let difference = [];\n // Let's compare the ranges.\n if (moveRange.containsRange(range, true)) {\n // If the whole original range is moved, treat it whole as a common part. There's also no difference part.\n common = range;\n }\n else if (range.start.hasSameParentAs(moveRange.start)) {\n // If the ranges are \"on the same level\" (in the same parent) then move operation may move exactly those nodes\n // that are changed by the attribute operation. In this case we get common part and difference part in the usual way.\n difference = range.getDifference(moveRange);\n common = range.getIntersection(moveRange);\n }\n else {\n // In any other situation we assume that original range is different than move range, that is that move operation\n // moves other nodes that attribute operation change. Even if the moved range is deep inside in the original range.\n //\n // Note that this is different than in `.getIntersection` (we would get a common part in that case) and different\n // than `.getDifference` (we would get two ranges).\n difference = [range];\n }\n const result = [];\n // The default behaviour of `_getTransformedByMove` might get wrong results for difference part, though, so\n // we do it by hand.\n for (let diff of difference) {\n // First, transform the range by removing moved nodes. Since this is a difference, this is safe, `null` won't be returned\n // as the range is different than the moved range.\n diff = diff._getTransformedByDeletion(moveOp.sourcePosition, moveOp.howMany);\n // Transform also `targetPosition`.\n const targetPosition = moveOp.getMovedRangeStart();\n // Spread the range only if moved nodes are inserted only between the top-level nodes of the `diff` range.\n const spread = diff.start.hasSameParentAs(targetPosition);\n // Transform by insertion of moved nodes.\n const diffs = diff._getTransformedByInsertion(targetPosition, moveOp.howMany, spread);\n result.push(...diffs);\n }\n // Common part can be simply transformed by the move operation. This is because move operation will not target to\n // that common part (the operation would have to target inside its own moved range).\n if (common) {\n result.push(common._getTransformedByMove(moveOp.sourcePosition, moveOp.targetPosition, moveOp.howMany, false)[0]);\n }\n return result;\n}\nsetTransformation(AttributeOperation, SplitOperation, (a, b) => {\n // Case 1:\n //\n // Split node is the last node in `AttributeOperation#range`.\n // `AttributeOperation#range` needs to be expanded to include the new (split) node.\n //\n // Attribute `type` to be changed to `numbered` but the `listItem` is split.\n // <listItem type=\"bulleted\">foobar</listItem>\n //\n // After split:\n // <listItem type=\"bulleted\">foo</listItem><listItem type=\"bulleted\">bar</listItem>\n //\n // After attribute change:\n // <listItem type=\"numbered\">foo</listItem><listItem type=\"numbered\">foo</listItem>\n //\n if (a.range.end.isEqual(b.insertionPosition)) {\n if (!b.graveyardPosition) {\n a.range.end.offset++;\n }\n return [a];\n }\n // Case 2:\n //\n // Split position is inside `AttributeOperation#range`, at the same level, so the nodes to change are\n // not going to make a flat range.\n //\n // Content with range-to-change and split position:\n // <p>Fo[zb^a]r</p>\n //\n // After split:\n // <p>Fozb</p><p>ar</p>\n //\n // Make two separate ranges containing all nodes to change:\n // <p>Fo[zb]</p><p>[a]r</p>\n //\n if (a.range.start.hasSameParentAs(b.splitPosition) && a.range.containsPosition(b.splitPosition)) {\n const secondPart = a.clone();\n secondPart.range = new Range(b.moveTargetPosition.clone(), a.range.end._getCombined(b.splitPosition, b.moveTargetPosition));\n a.range.end = b.splitPosition.clone();\n a.range.end.stickiness = 'toPrevious';\n return [a, secondPart];\n }\n // The default case.\n //\n a.range = a.range._getTransformedBySplitOperation(b);\n return [a];\n});\nsetTransformation(InsertOperation, AttributeOperation, (a, b) => {\n const result = [a];\n // Case 1:\n //\n // The attribute operation range includes the position where nodes were inserted.\n // There are two possible scenarios: the inserted nodes were text and they should receive attributes or\n // the inserted nodes were elements and they should not receive attributes.\n //\n // This is a mirror scenario to the one described in `AttributeOperation` x `InsertOperation` transformation,\n // although this case is a little less complicated. In this case we simply need to change attributes of the\n // inserted nodes and that's it.\n //\n if (a.shouldReceiveAttributes && a.position.hasSameParentAs(b.range.start) && b.range.containsPosition(a.position)) {\n const op = _getComplementaryAttributeOperations(a, b.key, b.newValue);\n if (op) {\n result.push(op);\n }\n }\n // The default case is: do nothing.\n // `AttributeOperation` does not change the model tree structure so `InsertOperation` does not need to be changed.\n //\n return result;\n});\nsetTransformation(InsertOperation, InsertOperation, (a, b, context) => {\n // Case 1:\n //\n // Two insert operations insert nodes at the same position. Since they are the same, it needs to be decided\n // what will be the order of inserted nodes. However, there is no additional information to help in that\n // decision. Also, when `b` will be transformed by `a`, the same order must be maintained.\n //\n // To achieve that, we will check if the operation is strong.\n // If it is, it won't get transformed. If it is not, it will be moved.\n //\n if (a.position.isEqual(b.position) && context.aIsStrong) {\n return [a];\n }\n // The default case.\n //\n a.position = a.position._getTransformedByInsertOperation(b);\n return [a];\n});\nsetTransformation(InsertOperation, MoveOperation, (a, b) => {\n // The default case.\n //\n a.position = a.position._getTransformedByMoveOperation(b);\n return [a];\n});\nsetTransformation(InsertOperation, SplitOperation, (a, b) => {\n // The default case.\n //\n a.position = a.position._getTransformedBySplitOperation(b);\n return [a];\n});\nsetTransformation(InsertOperation, MergeOperation, (a, b) => {\n a.position = a.position._getTransformedByMergeOperation(b);\n return [a];\n});\n// -----------------------\nsetTransformation(MarkerOperation, InsertOperation, (a, b) => {\n if (a.oldRange) {\n a.oldRange = a.oldRange._getTransformedByInsertOperation(b)[0];\n }\n if (a.newRange) {\n a.newRange = a.newRange._getTransformedByInsertOperation(b)[0];\n }\n return [a];\n});\nsetTransformation(MarkerOperation, MarkerOperation, (a, b, context) => {\n if (a.name == b.name) {\n if (context.aIsStrong) {\n a.oldRange = b.newRange ? b.newRange.clone() : null;\n }\n else {\n return [new NoOperation(0)];\n }\n }\n return [a];\n});\nsetTransformation(MarkerOperation, MergeOperation, (a, b) => {\n if (a.oldRange) {\n a.oldRange = a.oldRange._getTransformedByMergeOperation(b);\n }\n if (a.newRange) {\n a.newRange = a.newRange._getTransformedByMergeOperation(b);\n }\n return [a];\n});\nsetTransformation(MarkerOperation, MoveOperation, (a, b, context) => {\n if (a.oldRange) {\n a.oldRange = Range._createFromRanges(a.oldRange._getTransformedByMoveOperation(b));\n }\n if (a.newRange) {\n if (context.abRelation) {\n const aNewRange = Range._createFromRanges(a.newRange._getTransformedByMoveOperation(b));\n if (context.abRelation.side == 'left' && b.targetPosition.isEqual(a.newRange.start)) {\n a.newRange.end = aNewRange.end;\n a.newRange.start.path = context.abRelation.path;\n return [a];\n }\n else if (context.abRelation.side == 'right' && b.targetPosition.isEqual(a.newRange.end)) {\n a.newRange.start = aNewRange.start;\n a.newRange.end.path = context.abRelation.path;\n return [a];\n }\n }\n a.newRange = Range._createFromRanges(a.newRange._getTransformedByMoveOperation(b));\n }\n return [a];\n});\nsetTransformation(MarkerOperation, SplitOperation, (a, b, context) => {\n if (a.oldRange) {\n a.oldRange = a.oldRange._getTransformedBySplitOperation(b);\n }\n if (a.newRange) {\n if (context.abRelation) {\n const aNewRange = a.newRange._getTransformedBySplitOperation(b);\n if (a.newRange.start.isEqual(b.splitPosition) && context.abRelation.wasStartBeforeMergedElement) {\n a.newRange.start = Position._createAt(b.insertionPosition);\n }\n else if (a.newRange.start.isEqual(b.splitPosition) && !context.abRelation.wasInLeftElement) {\n a.newRange.start = Position._createAt(b.moveTargetPosition);\n }\n if (a.newRange.end.isEqual(b.splitPosition) && context.abRelation.wasInRightElement) {\n a.newRange.end = Position._createAt(b.moveTargetPosition);\n }\n else if (a.newRange.end.isEqual(b.splitPosition) && context.abRelation.wasEndBeforeMergedElement) {\n a.newRange.end = Position._createAt(b.insertionPosition);\n }\n else {\n a.newRange.end = aNewRange.end;\n }\n return [a];\n }\n a.newRange = a.newRange._getTransformedBySplitOperation(b);\n }\n return [a];\n});\n// -----------------------\nsetTransformation(MergeOperation, InsertOperation, (a, b) => {\n if (a.sourcePosition.hasSameParentAs(b.position)) {\n a.howMany += b.howMany;\n }\n a.sourcePosition = a.sourcePosition._getTransformedByInsertOperation(b);\n a.targetPosition = a.targetPosition._getTransformedByInsertOperation(b);\n return [a];\n});\nsetTransformation(MergeOperation, MergeOperation, (a, b, context) => {\n // Case 1:\n //\n // Same merge operations.\n //\n // Both operations have same source and target positions. So the element already got merged and there is\n // theoretically nothing to do.\n //\n if (a.sourcePosition.isEqual(b.sourcePosition) && a.targetPosition.isEqual(b.targetPosition)) {\n // There are two ways that we can provide a do-nothing operation.\n //\n // First is simply a NoOperation instance. We will use it if `b` operation was not undone.\n //\n // Second is a merge operation that has the source operation in the merged element - in the graveyard -\n // same target position and `howMany` equal to `0`. So it is basically merging an empty element from graveyard\n // which is almost the same as NoOperation.\n //\n // This way the merge operation can be later transformed by split operation\n // to provide correct undo. This will be used if `b` operation was undone (only then it is correct).\n //\n if (!context.bWasUndone) {\n return [new NoOperation(0)];\n }\n else {\n const path = b.graveyardPosition.path.slice();\n path.push(0);\n a.sourcePosition = new Position(b.graveyardPosition.root, path);\n a.howMany = 0;\n return [a];\n }\n }\n // Case 2:\n //\n // Same merge source position but different target position.\n //\n // This can happen during collaboration. For example, if one client merged a paragraph to the previous paragraph\n // and the other person removed that paragraph and merged the same paragraph to something before:\n //\n // Client A:\n // <p>Foo</p><p>Bar</p><p>[]Xyz</p>\n // <p>Foo</p><p>BarXyz</p>\n //\n // Client B:\n // <p>Foo</p>[<p>Bar</p>]<p>Xyz</p>\n // <p>Foo</p><p>[]Xyz</p>\n // <p>FooXyz</p>\n //\n // In this case we need to decide where finally \"Xyz\" will land:\n //\n // <p>FooXyz</p> graveyard: <p>Bar</p>\n // <p>Foo</p> graveyard: <p>BarXyz</p>\n //\n // Let's move it in a way so that a merge operation that does not target to graveyard is more important so that\n // nodes does not end up in the graveyard. It makes sense. Both for Client A and for Client B \"Xyz\" finally did not\n // end up in the graveyard (see above).\n //\n // If neither or both operations point to graveyard, then let `aIsStrong` decide.\n //\n if (a.sourcePosition.isEqual(b.sourcePosition) && !a.targetPosition.isEqual(b.targetPosition) &&\n !context.bWasUndone && context.abRelation != 'splitAtSource') {\n const aToGraveyard = a.targetPosition.root.rootName == '$graveyard';\n const bToGraveyard = b.targetPosition.root.rootName == '$graveyard';\n // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.\n const aIsWeak = aToGraveyard && !bToGraveyard;\n // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.\n const bIsWeak = bToGraveyard && !aToGraveyard;\n // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.\n const forceMove = bIsWeak || (!aIsWeak && context.aIsStrong);\n if (forceMove) {\n const sourcePosition = b.targetPosition._getTransformedByMergeOperation(b);\n const targetPosition = a.targetPosition._getTransformedByMergeOperation(b);\n return [new MoveOperation(sourcePosition, a.howMany, targetPosition, 0)];\n }\n else {\n return [new NoOperation(0)];\n }\n }\n // The default case.\n //\n if (a.sourcePosition.hasSameParentAs(b.targetPosition)) {\n a.howMany += b.howMany;\n }\n a.sourcePosition = a.sourcePosition._getTransformedByMergeOperation(b);\n a.targetPosition = a.targetPosition._getTransformedByMergeOperation(b);\n // Handle positions in graveyard.\n // If graveyard positions are same and `a` operation is strong - do not transform.\n if (!a.graveyardPosition.isEqual(b.graveyardPosition) || !context.aIsStrong) {\n a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation(b);\n }\n return [a];\n});\nsetTransformation(MergeOperation, MoveOperation, (a, b, context) => {\n // Case 1:\n //\n // The element to merge got removed.\n //\n // Merge operation does support merging elements which are not siblings. So it would not be a problem\n // from technical point of view. However, if the element was removed, the intention of the user deleting it\n // was to have it all deleted, together with its children. From user experience point of view, moving back the\n // removed nodes might be unexpected. This means that in this scenario we will block the merging.\n //\n // The exception of this rule would be if the remove operation was later undone.\n //\n const removedRange = Range._createFromPositionAndShift(b.sourcePosition, b.howMany);\n if (b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove) {\n if (a.deletionPosition.hasSameParentAs(b.sourcePosition) && removedRange.containsPosition(a.sourcePosition)) {\n return [new NoOperation(0)];\n }\n }\n // In most cases we want `sourcePosition` to stick to previous and `targetPosition` to stick to next.\n // Usually, `sourcePosition` is at the beginning of the merged element and `targetPosition` is at the end of the merge-target element.\n //\n // However, `sourcePosition` and `targetPosition` may end up in the middle of an element due to some OT magic that happens during undo.\n // It is expected and used in `MergeOperation` x `SplitOperation` transformation.\n //\n // But when these positions are in the middle, it messes up the regular `MergeOperation` x `MoveOperation` transformation because\n // these positions may \"follow\" some moved elements. And we want them stick in the original elements.\n //\n // This is why we add two extra cases: (1) and (2).\n //\n // But after this `MergeOperation` is transformed by \"this\" move (which is undone), we also need to define extra cases for\n // the operation undoing previous move. These are (3) and (4).\n //\n // (1). Note that this case is also added to `updateRelations()` and sets `mergeSourceAffected` relation.\n //\n // [] is move operation, } is merge source position (sticks to previous by default):\n // <p>A[b]}c</p> -> <p>A}c</p>\n //\n if (b.sourcePosition.getShiftedBy(b.howMany).isEqual(a.sourcePosition)) {\n a.sourcePosition.stickiness = 'toNone';\n }\n // (3). This is the transformation for undoing operation of the above case.\n //\n // [] is move operation, } is merge source position (sticks to previous by default):\n // <p>A}c</p> -> <p>A[b]}c</p> (instead of <p>A}[b]c</p>)\n //\n else if (b.targetPosition.isEqual(a.sourcePosition) && context.abRelation == 'mergeSourceAffected') {\n a.sourcePosition.stickiness = 'toNext';\n }\n // (2). Note that this case is also added to `updateRelations()` and sets `mergeTargetWasBefore` relation.\n //\n // [] is move operation, { is merge target position (sticks to next by default):\n // <p>A{[b]c</p> -> <p>A{c</p>\n //\n else if (b.sourcePosition.isEqual(a.targetPosition)) {\n a.targetPosition.stickiness = 'toNone';\n a.howMany -= b.howMany;\n }\n // (4). This is the transformation for undoing operation of the above case.\n //\n // [] is move operation, { is merge target position (sticks to next by default):\n // <p>A{c</p> -> <p>A{[b]c</p> (instead of <p>A[b]{c</p>)\n //\n else if (b.targetPosition.isEqual(a.targetPosition) && context.abRelation == 'mergeTargetWasBefore') {\n a.targetPosition.stickiness = 'toPrevious';\n a.howMany += b.howMany;\n }\n // The default case.\n else {\n if (a.sourcePosition.hasSameParentAs(b.targetPosition)) {\n a.howMany += b.howMany;\n }\n if (a.sourcePosition.hasSameParentAs(b.sourcePosition)) {\n a.howMany -= b.howMany;\n }\n }\n a.sourcePosition = a.sourcePosition._getTransformedByMoveOperation(b);\n a.targetPosition = a.targetPosition._getTransformedByMoveOperation(b);\n // After transformations are done, make sure to revert stickiness in case if (1) - (4) scenario happened.\n a.sourcePosition.stickiness = 'toPrevious';\n a.targetPosition.stickiness = 'toNext';\n // `MergeOperation` graveyard position is like `MoveOperation` target position. It is a position where element(s) will\n // be moved. Like in other similar cases, we need to consider the scenario when those positions are same.\n // Here, we will treat `MergeOperation` like it is always strong (see `InsertOperation` x `InsertOperation` for comparison).\n // This means that we won't transform graveyard position if it is equal to move operation target position.\n if (!a.graveyardPosition.isEqual(b.targetPosition)) {\n a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation(b);\n }\n return [a];\n});\nsetTransformation(MergeOperation, SplitOperation, (a, b, context) => {\n if (b.graveyardPosition) {\n // If `b` operation defines graveyard position, a node from graveyard will be moved. This means that we need to\n // transform `a.graveyardPosition` accordingly.\n a.graveyardPosition = a.graveyardPosition._getTransformedByDeletion(b.graveyardPosition, 1);\n // This is a scenario foreseen in `MergeOperation` x `MergeOperation`, with two identical merge operations.\n //\n // So, there was `MergeOperation` x `MergeOperation` transformation earlier. Now, `a` is a merge operation which\n // source position is in graveyard. Interestingly, split operation wants to use the node to be merged by `a`. This\n // means that `b` is undoing that merge operation from earlier, which caused `a` to be in graveyard.\n //\n // If that's the case, at this point, we will only \"fix\" `a.howMany`. It was earlier set to `0` in\n // `MergeOperation` x `MergeOperation` transformation. Later transformations in this function will change other\n // properties.\n //\n if (a.deletionPosition.isEqual(b.graveyardPosition)) {\n a.howMany = b.howMany;\n }\n }\n // Case 1:\n //\n // Merge operation moves nodes to the place where split happens.\n // This is a classic situation when there are two paragraphs, and there is a split (enter) after the first\n // paragraph and there is a merge (delete) at the beginning of the second paragraph:\n //\n // <p>Foo{}</p><p>[]Bar</p>.\n //\n // Split is after `Foo`, while merge is from `Bar` to the end of `Foo`.\n //\n // State after split:\n // <p>Foo</p><p></p><p>Bar</p>\n //\n // Now, `Bar` should be merged to the new paragraph:\n // <p>Foo</p><p>Bar</p>\n //\n // Instead of merging it to the original paragraph:\n // <p>FooBar</p><p></p>\n //\n // This means that `targetPosition` needs to be transformed. This is the default case though.\n // For example, if the split would be after `F`, `targetPosition` should also be transformed.\n //\n // There are three exceptions, though, when we want to keep `targetPosition` as it was.\n //\n // First exception is when the merge target position is inside an element (not at the end, as usual). This\n // happens when the merge operation earlier was transformed by \"the same\" merge operation. If merge operation\n // targets inside the element we want to keep the original target position (and not transform it) because\n // we have additional context telling us that we want to merge to the original element. We can check if the\n // merge operation points inside element by checking what is `SplitOperation#howMany`. Since merge target position\n // is same as split position, if `howMany` is non-zero, it means that the merge target position is inside an element.\n //\n // Second exception is when the element to merge is in the graveyard and split operation uses it. In that case\n // if target position would be transformed, the merge operation would target at the source position:\n //\n // root: <p>Foo</p>\t\t\t\tgraveyard: <p></p>\n //\n // SplitOperation: root [ 0, 3 ] using graveyard [ 0 ] (howMany = 0)\n // MergeOperation: graveyard [ 0, 0 ] -> root [ 0, 3 ] (howMany = 0)\n //\n // Since split operation moves the graveyard node back to the root, the merge operation source position changes.\n // We would like to merge from the empty <p> to the \"Foo\" <p>:\n //\n // root: <p>Foo</p><p></p>\t\t\tgraveyard:\n //\n // MergeOperation#sourcePosition = root [ 1, 0 ]\n //\n // If `targetPosition` is transformed, it would become root [ 1, 0 ] as well. It has to be kept as it was.\n //\n // Third exception is connected with relations. If this happens during undo and we have explicit information\n // that target position has not been affected by the operation which is undone by this split then this split should\n // not move the target position either.\n //\n if (a.targetPosition.isEqual(b.splitPosition)) {\n const mergeInside = b.howMany != 0;\n const mergeSplittingElement = b.graveyardPosition && a.deletionPosition.isEqual(b.graveyardPosition);\n if (mergeInside || mergeSplittingElement || context.abRelation == 'mergeTargetNotMoved') {\n a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation(b);\n return [a];\n }\n }\n // Case 2:\n //\n // Merge source is at the same position as split position. This sometimes happen, mostly during undo.\n // The decision here is mostly to choose whether merge source position should stay where it is (so it will be at the end of the\n // split element) or should be move to the beginning of the new element.\n //\n if (a.sourcePosition.isEqual(b.splitPosition)) {\n // Use context to check if `SplitOperation` is not undoing a merge operation, that didn't change the `a` operation.\n // This scenario happens the undone merge operation moved nodes at the source position of `a` operation.\n // In that case `a` operation source position should stay where it is.\n if (context.abRelation == 'mergeSourceNotMoved') {\n a.howMany = 0;\n a.targetPosition = a.targetPosition._getTransformedBySplitOperation(b);\n return [a];\n }\n // This merge operation might have been earlier transformed by a merge operation which both merged the same element.\n // See that case in `MergeOperation` x `MergeOperation` transformation. In that scenario, if the merge operation has been undone,\n // the special case is not applied.\n //\n // Now, the merge operation is transformed by the split which has undone that previous merge operation.\n // So now we are fixing situation which was skipped in `MergeOperation` x `MergeOperation` case.\n //\n if (context.abRelation == 'mergeSameElement' || a.sourcePosition.offset > 0) {\n a.sourcePosition = b.moveTargetPosition.clone();\n a.targetPosition = a.targetPosition._getTransformedBySplitOperation(b);\n return [a];\n }\n }\n // The default case.\n //\n if (a.sourcePosition.hasSameParentAs(b.splitPosition)) {\n a.howMany = b.splitPosition.offset;\n }\n a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation(b);\n a.targetPosition = a.targetPosition._getTransformedBySplitOperation(b);\n return [a];\n});\n// -----------------------\nsetTransformation(MoveOperation, InsertOperation, (a, b) => {\n const moveRange = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n const transformed = moveRange._getTransformedByInsertOperation(b, false)[0];\n a.sourcePosition = transformed.start;\n a.howMany = transformed.end.offset - transformed.start.offset;\n // See `InsertOperation` x `MoveOperation` transformation for details on this case.\n //\n // In summary, both operations point to the same place, so the order of nodes needs to be decided.\n // `MoveOperation` is considered weaker, so it is always transformed, unless there was a certain relation\n // between operations.\n //\n if (!a.targetPosition.isEqual(b.position)) {\n a.targetPosition = a.targetPosition._getTransformedByInsertOperation(b);\n }\n return [a];\n});\nsetTransformation(MoveOperation, MoveOperation, (a, b, context) => {\n //\n // Setting and evaluating some variables that will be used in special cases and default algorithm.\n //\n // Create ranges from `MoveOperations` properties.\n const rangeA = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n const rangeB = Range._createFromPositionAndShift(b.sourcePosition, b.howMany);\n // Assign `context.aIsStrong` to a different variable, because the value may change during execution of\n // this algorithm and we do not want to override original `context.aIsStrong` that will be used in later transformations.\n let aIsStrong = context.aIsStrong;\n // This will be used to decide the order of nodes if both operations target at the same position.\n // By default, use strong/weak operation mechanism.\n let insertBefore = !context.aIsStrong;\n // If the relation is set, then use it to decide nodes order.\n if (context.abRelation == 'insertBefore' || context.baRelation == 'insertAfter') {\n insertBefore = true;\n }\n else if (context.abRelation == 'insertAfter' || context.baRelation == 'insertBefore') {\n insertBefore = false;\n }\n // `a.targetPosition` could be affected by the `b` operation. We will transform it.\n let newTargetPosition;\n if (a.targetPosition.isEqual(b.targetPosition) && insertBefore) {\n newTargetPosition = a.targetPosition._getTransformedByDeletion(b.sourcePosition, b.howMany);\n }\n else {\n newTargetPosition = a.targetPosition._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n }\n //\n // Special case #1 + mirror.\n //\n // Special case when both move operations' target positions are inside nodes that are\n // being moved by the other move operation. So in other words, we move ranges into inside of each other.\n // This case can't be solved reasonably (on the other hand, it should not happen often).\n if (_moveTargetIntoMovedRange(a, b) && _moveTargetIntoMovedRange(b, a)) {\n // Instead of transforming operation, we return a reverse of the operation that we transform by.\n // So when the results of this \"transformation\" will be applied, `b` MoveOperation will get reversed.\n return [b.getReversed()];\n }\n //\n // End of special case #1.\n //\n //\n // Special case #2.\n //\n // Check if `b` operation targets inside `rangeA`.\n const bTargetsToA = rangeA.containsPosition(b.targetPosition);\n // If `b` targets to `rangeA` and `rangeA` contains `rangeB`, `b` operation has no influence on `a` operation.\n // You might say that operation `b` is captured inside operation `a`.\n if (bTargetsToA && rangeA.containsRange(rangeB, true)) {\n // There is a mini-special case here, where `rangeB` is on other level than `rangeA`. That's why\n // we need to transform `a` operation anyway.\n rangeA.start = rangeA.start._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n rangeA.end = rangeA.end._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n return _makeMoveOperationsFromRanges([rangeA], newTargetPosition);\n }\n //\n // Special case #2 mirror.\n //\n const aTargetsToB = rangeB.containsPosition(a.targetPosition);\n if (aTargetsToB && rangeB.containsRange(rangeA, true)) {\n // `a` operation is \"moved together\" with `b` operation.\n // Here, just move `rangeA` \"inside\" `rangeB`.\n rangeA.start = rangeA.start._getCombined(b.sourcePosition, b.getMovedRangeStart());\n rangeA.end = rangeA.end._getCombined(b.sourcePosition, b.getMovedRangeStart());\n return _makeMoveOperationsFromRanges([rangeA], newTargetPosition);\n }\n //\n // End of special case #2.\n //\n //\n // Special case #3 + mirror.\n //\n // `rangeA` has a node which is an ancestor of `rangeB`. In other words, `rangeB` is inside `rangeA`\n // but not on the same tree level. In such case ranges have common part but we have to treat it\n // differently, because in such case those ranges are not really conflicting and should be treated like\n // two separate ranges. Also we have to discard two difference parts.\n const aCompB = compareArrays(a.sourcePosition.getParentPath(), b.sourcePosition.getParentPath());\n if (aCompB == 'prefix' || aCompB == 'extension') {\n // Transform `rangeA` by `b` operation and make operation out of it, and that's all.\n // Note that this is a simplified version of default case, but here we treat the common part (whole `rangeA`)\n // like a one difference part.\n rangeA.start = rangeA.start._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n rangeA.end = rangeA.end._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n return _makeMoveOperationsFromRanges([rangeA], newTargetPosition);\n }\n //\n // End of special case #3.\n //\n //\n // Default case - ranges are on the same level or are not connected with each other.\n //\n // Modifier for default case.\n // Modifies `aIsStrong` flag in certain conditions.\n //\n // If only one of operations is a remove operation, we force remove operation to be the \"stronger\" one\n // to provide more expected results.\n if (a.type == 'remove' && b.type != 'remove' && !context.aWasUndone && !context.forceWeakRemove) {\n aIsStrong = true;\n }\n else if (a.type != 'remove' && b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove) {\n aIsStrong = false;\n }\n // Handle operation's source ranges - check how `rangeA` is affected by `b` operation.\n // This will aggregate transformed ranges.\n const ranges = [];\n // Get the \"difference part\" of `a` operation source range.\n // This is an array with one or two ranges. Two ranges if `rangeB` is inside `rangeA`.\n const difference = rangeA.getDifference(rangeB);\n for (const range of difference) {\n // Transform those ranges by `b` operation. For example if `b` moved range from before those ranges, fix those ranges.\n range.start = range.start._getTransformedByDeletion(b.sourcePosition, b.howMany);\n range.end = range.end._getTransformedByDeletion(b.sourcePosition, b.howMany);\n // If `b` operation targets into `rangeA` on the same level, spread `rangeA` into two ranges.\n const shouldSpread = compareArrays(range.start.getParentPath(), b.getMovedRangeStart().getParentPath()) == 'same';\n const newRanges = range._getTransformedByInsertion(b.getMovedRangeStart(), b.howMany, shouldSpread);\n ranges.push(...newRanges);\n }\n // Then, we have to manage the \"common part\" of both move ranges.\n const common = rangeA.getIntersection(rangeB);\n if (common !== null && aIsStrong) {\n // Calculate the new position of that part of original range.\n common.start = common.start._getCombined(b.sourcePosition, b.getMovedRangeStart());\n common.end = common.end._getCombined(b.sourcePosition, b.getMovedRangeStart());\n // Take care of proper range order.\n //\n // Put `common` at appropriate place. Keep in mind that we are interested in original order.\n // Basically there are only three cases: there is zero, one or two difference ranges.\n //\n // If there is zero difference ranges, just push `common` in the array.\n if (ranges.length === 0) {\n ranges.push(common);\n }\n // If there is one difference range, we need to check whether common part was before it or after it.\n else if (ranges.length == 1) {\n if (rangeB.start.isBefore(rangeA.start) || rangeB.start.isEqual(rangeA.start)) {\n ranges.unshift(common);\n }\n else {\n ranges.push(common);\n }\n }\n // If there are more ranges (which means two), put common part between them. This is the only scenario\n // where there could be two difference ranges so we don't have to make any comparisons.\n else {\n ranges.splice(1, 0, common);\n }\n }\n if (ranges.length === 0) {\n // If there are no \"source ranges\", nothing should be changed.\n // Note that this can happen only if `aIsStrong == false` and `rangeA.isEqual( rangeB )`.\n return [new NoOperation(a.baseVersion)];\n }\n return _makeMoveOperationsFromRanges(ranges, newTargetPosition);\n});\nsetTransformation(MoveOperation, SplitOperation, (a, b, context) => {\n let newTargetPosition = a.targetPosition.clone();\n // Do not transform if target position is same as split insertion position and this split comes from undo.\n // This should be done on relations but it is too much work for now as it would require relations working in collaboration.\n // We need to make a decision how we will resolve such conflict and this is less harmful way.\n if (!a.targetPosition.isEqual(b.insertionPosition) || !b.graveyardPosition || context.abRelation == 'moveTargetAfter') {\n newTargetPosition = a.targetPosition._getTransformedBySplitOperation(b);\n }\n // Case 1:\n //\n // Last element in the moved range got split.\n //\n // In this case the default range transformation will not work correctly as the element created by\n // split operation would be outside the range. The range to move needs to be fixed manually.\n //\n const moveRange = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n if (moveRange.end.isEqual(b.insertionPosition)) {\n // Do it only if this is a \"natural\" split, not a one that comes from undo.\n // If this is undo split, only `targetPosition` needs to be changed (if the move is a remove).\n if (!b.graveyardPosition) {\n a.howMany++;\n }\n a.targetPosition = newTargetPosition;\n return [a];\n }\n // Case 2:\n //\n // Split happened between the moved nodes. In this case two ranges to move need to be generated.\n //\n // Characters `ozba` are moved to the end of paragraph `Xyz` but split happened.\n // <p>F[oz|ba]r</p><p>Xyz</p>\n //\n // After split:\n // <p>F[oz</p><p>ba]r</p><p>Xyz</p>\n //\n // Correct ranges:\n // <p>F[oz]</p><p>[ba]r</p><p>Xyz</p>\n //\n // After move:\n // <p>F</p><p>r</p><p>Xyzozba</p>\n //\n if (moveRange.start.hasSameParentAs(b.splitPosition) && moveRange.containsPosition(b.splitPosition)) {\n let rightRange = new Range(b.splitPosition, moveRange.end);\n rightRange = rightRange._getTransformedBySplitOperation(b);\n const ranges = [\n new Range(moveRange.start, b.splitPosition),\n rightRange\n ];\n return _makeMoveOperationsFromRanges(ranges, newTargetPosition);\n }\n // Case 3:\n //\n // Move operation targets at the split position. We need to decide if the nodes should be inserted\n // at the end of the split element or at the beginning of the new element.\n //\n if (a.targetPosition.isEqual(b.splitPosition) && context.abRelation == 'insertAtSource') {\n newTargetPosition = b.moveTargetPosition;\n }\n // Case 4:\n //\n // Move operation targets just after the split element. We need to decide if the nodes should be inserted\n // between two parts of split element, or after the new element.\n //\n // Split at `|`, while move operation moves `<p>Xyz</p>` and targets at `^`:\n // <p>Foo|bar</p>^<p>baz</p>\n // <p>Foo</p>^<p>bar</p><p>baz</p> or <p>Foo</p><p>bar</p>^<p>baz</p>?\n //\n // If there is no contextual information between operations (for example, they come from collaborative\n // editing), we don't want to put some unrelated content (move) between parts of related content (split parts).\n // However, if the split is from undo, in the past, the moved content might be targeting between the\n // split parts, meaning that was exactly user's intention:\n //\n // <p>Foo</p>^<p>bar</p>\t\t<--- original situation, in \"past\".\n // <p>Foobar</p>^\t\t\t\t<--- after merge target position is transformed.\n // <p>Foo|bar</p>^\t\t\t\t<--- then the merge is undone, and split happens, which leads us to current situation.\n //\n // In this case it is pretty clear that the intention was to put new paragraph between those nodes,\n // so we need to transform accordingly. We can detect this scenario thanks to relations.\n //\n if (a.targetPosition.isEqual(b.insertionPosition) && context.abRelation == 'insertBetween') {\n newTargetPosition = a.targetPosition;\n }\n // The default case.\n //\n const transformed = moveRange._getTransformedBySplitOperation(b);\n const ranges = [transformed];\n // Case 5:\n //\n // Moved range contains graveyard element used by split operation. Add extra move operation to the result.\n //\n if (b.graveyardPosition) {\n const movesGraveyardElement = moveRange.start.isEqual(b.graveyardPosition) || moveRange.containsPosition(b.graveyardPosition);\n if (a.howMany > 1 && movesGraveyardElement && !context.aWasUndone) {\n ranges.push(Range._createFromPositionAndShift(b.insertionPosition, 1));\n }\n }\n return _makeMoveOperationsFromRanges(ranges, newTargetPosition);\n});\nsetTransformation(MoveOperation, MergeOperation, (a, b, context) => {\n const movedRange = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n if (b.deletionPosition.hasSameParentAs(a.sourcePosition) && movedRange.containsPosition(b.sourcePosition)) {\n if (a.type == 'remove' && !context.forceWeakRemove) {\n // Case 1:\n //\n // The element to remove got merged.\n //\n // Merge operation does support merging elements which are not siblings. So it would not be a problem\n // from technical point of view. However, if the element was removed, the intention of the user\n // deleting it was to have it all deleted. From user experience point of view, moving back the\n // removed nodes might be unexpected. This means that in this scenario we will reverse merging and remove the element.\n //\n if (!context.aWasUndone) {\n const results = [];\n let gyMoveSource = b.graveyardPosition.clone();\n let splitNodesMoveSource = b.targetPosition._getTransformedByMergeOperation(b);\n if (a.howMany > 1) {\n results.push(new MoveOperation(a.sourcePosition, a.howMany - 1, a.targetPosition, 0));\n gyMoveSource = gyMoveSource._getTransformedByMove(a.sourcePosition, a.targetPosition, a.howMany - 1);\n splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove(a.sourcePosition, a.targetPosition, a.howMany - 1);\n }\n const gyMoveTarget = b.deletionPosition._getCombined(a.sourcePosition, a.targetPosition);\n const gyMove = new MoveOperation(gyMoveSource, 1, gyMoveTarget, 0);\n const splitNodesMoveTargetPath = gyMove.getMovedRangeStart().path.slice();\n splitNodesMoveTargetPath.push(0);\n const splitNodesMoveTarget = new Position(gyMove.targetPosition.root, splitNodesMoveTargetPath);\n splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove(gyMoveSource, gyMoveTarget, 1);\n const splitNodesMove = new MoveOperation(splitNodesMoveSource, b.howMany, splitNodesMoveTarget, 0);\n results.push(gyMove);\n results.push(splitNodesMove);\n return results;\n }\n }\n else {\n // Case 2:\n //\n // The element to move got merged and it was the only element to move.\n // In this case just don't do anything, leave the node in the graveyard. Without special case\n // it would be a move operation that moves 0 nodes, so maybe it is better just to return no-op.\n //\n if (a.howMany == 1) {\n if (!context.bWasUndone) {\n return [new NoOperation(0)];\n }\n else {\n a.sourcePosition = b.graveyardPosition.clone();\n a.targetPosition = a.targetPosition._getTransformedByMergeOperation(b);\n return [a];\n }\n }\n }\n }\n // The default case.\n //\n const moveRange = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n const transformed = moveRange._getTransformedByMergeOperation(b);\n a.sourcePosition = transformed.start;\n a.howMany = transformed.end.offset - transformed.start.offset;\n a.targetPosition = a.targetPosition._getTransformedByMergeOperation(b);\n return [a];\n});\n// -----------------------\nsetTransformation(RenameOperation, InsertOperation, (a, b) => {\n a.position = a.position._getTransformedByInsertOperation(b);\n return [a];\n});\nsetTransformation(RenameOperation, MergeOperation, (a, b) => {\n // Case 1:\n //\n // Element to rename got merged, so it was moved to `b.graveyardPosition`.\n //\n if (a.position.isEqual(b.deletionPosition)) {\n a.position = b.graveyardPosition.clone();\n a.position.stickiness = 'toNext';\n return [a];\n }\n a.position = a.position._getTransformedByMergeOperation(b);\n return [a];\n});\nsetTransformation(RenameOperation, MoveOperation, (a, b) => {\n a.position = a.position._getTransformedByMoveOperation(b);\n return [a];\n});\nsetTransformation(RenameOperation, RenameOperation, (a, b, context) => {\n if (a.position.isEqual(b.position)) {\n if (context.aIsStrong) {\n a.oldName = b.newName;\n }\n else {\n return [new NoOperation(0)];\n }\n }\n return [a];\n});\nsetTransformation(RenameOperation, SplitOperation, (a, b) => {\n // Case 1:\n //\n // The element to rename has been split. In this case, the new element should be also renamed.\n //\n // User decides to change the paragraph to a list item:\n // <paragraph>Foobar</paragraph>\n //\n // However, in meantime, split happens:\n // <paragraph>Foo</paragraph><paragraph>bar</paragraph>\n //\n // As a result, rename both elements:\n // <listItem>Foo</listItem><listItem>bar</listItem>\n //\n const renamePath = a.position.path;\n const splitPath = b.splitPosition.getParentPath();\n if (compareArrays(renamePath, splitPath) == 'same' && !b.graveyardPosition) {\n const extraRename = new RenameOperation(a.position.getShiftedBy(1), a.oldName, a.newName, 0);\n return [a, extraRename];\n }\n // The default case.\n //\n a.position = a.position._getTransformedBySplitOperation(b);\n return [a];\n});\n// -----------------------\nsetTransformation(RootAttributeOperation, RootAttributeOperation, (a, b, context) => {\n if (a.root === b.root && a.key === b.key) {\n if (!context.aIsStrong || a.newValue === b.newValue) {\n return [new NoOperation(0)];\n }\n else {\n a.oldValue = b.newValue;\n }\n }\n return [a];\n});\n// -----------------------\nsetTransformation(RootOperation, RootOperation, (a, b) => {\n if (a.rootName === b.rootName && a.isAdd === b.isAdd) {\n return [new NoOperation(0)];\n }\n return [a];\n});\n// -----------------------\nsetTransformation(SplitOperation, InsertOperation, (a, b) => {\n // The default case.\n //\n if (a.splitPosition.hasSameParentAs(b.position) && a.splitPosition.offset < b.position.offset) {\n a.howMany += b.howMany;\n }\n a.splitPosition = a.splitPosition._getTransformedByInsertOperation(b);\n a.insertionPosition = a.insertionPosition._getTransformedByInsertOperation(b);\n return [a];\n});\nsetTransformation(SplitOperation, MergeOperation, (a, b, context) => {\n // Case 1:\n //\n // Split element got merged. If two different elements were merged, clients will have different content.\n //\n // Example. Merge at `{}`, split at `[]`:\n // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>\n //\n // On merge side it will look like this:\n // <heading>FooB[]ar</heading>\n // <heading>FooB</heading><heading>ar</heading>\n //\n // On split side it will look like this:\n // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>\n // <heading>FooB</heading><paragraph>ar</paragraph>\n //\n // Clearly, the second element is different for both clients.\n //\n // We could use the removed merge element from graveyard as a split element but then clients would have a different\n // model state (in graveyard), because the split side client would still have an element in graveyard (removed by merge).\n //\n // To overcome this, in `SplitOperation` x `MergeOperation` transformation we will add additional `SplitOperation`\n // in the graveyard, which will actually clone the merged-and-deleted element. Then, that cloned element will be\n // used for splitting. Example below.\n //\n // Original state:\n // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>\n //\n // Merge side client:\n //\n // After merge:\n // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph>\n //\n // Extra split:\n // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph><paragraph></paragraph>\n //\n // Use the \"cloned\" element from graveyard:\n // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>\n //\n // Split side client:\n //\n // After split:\n // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>\n //\n // After merge:\n // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>\n //\n // This special case scenario only applies if the original split operation clones the split element.\n // If the original split operation has `graveyardPosition` set, it all doesn't have sense because split operation\n // knows exactly which element it should use. So there would be no original problem with different contents.\n //\n // Additionally, the special case applies only if the merge wasn't already undone.\n //\n if (!a.graveyardPosition && !context.bWasUndone && a.splitPosition.hasSameParentAs(b.sourcePosition)) {\n const splitPath = b.graveyardPosition.path.slice();\n splitPath.push(0);\n const splitPosition = new Position(b.graveyardPosition.root, splitPath);\n const insertionPosition = SplitOperation.getInsertionPosition(new Position(b.graveyardPosition.root, splitPath));\n const additionalSplit = new SplitOperation(splitPosition, 0, insertionPosition, null, 0);\n a.splitPosition = a.splitPosition._getTransformedByMergeOperation(b);\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n a.graveyardPosition = additionalSplit.insertionPosition.clone();\n a.graveyardPosition.stickiness = 'toNext';\n return [additionalSplit, a];\n }\n // The default case.\n //\n if (a.splitPosition.hasSameParentAs(b.deletionPosition) && !a.splitPosition.isAfter(b.deletionPosition)) {\n a.howMany--;\n }\n if (a.splitPosition.hasSameParentAs(b.targetPosition)) {\n a.howMany += b.howMany;\n }\n a.splitPosition = a.splitPosition._getTransformedByMergeOperation(b);\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n if (a.graveyardPosition) {\n a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation(b);\n }\n return [a];\n});\nsetTransformation(SplitOperation, MoveOperation, (a, b, context) => {\n const rangeToMove = Range._createFromPositionAndShift(b.sourcePosition, b.howMany);\n if (a.graveyardPosition) {\n // Case 1:\n //\n // Split operation graveyard node was moved. In this case move operation is stronger. Since graveyard element\n // is already moved to the correct position, we need to only move the nodes after the split position.\n // This will be done by `MoveOperation` instead of `SplitOperation`.\n //\n const gyElementMoved = rangeToMove.start.isEqual(a.graveyardPosition) || rangeToMove.containsPosition(a.graveyardPosition);\n if (!context.bWasUndone && gyElementMoved) {\n const sourcePosition = a.splitPosition._getTransformedByMoveOperation(b);\n const newParentPosition = a.graveyardPosition._getTransformedByMoveOperation(b);\n const newTargetPath = newParentPosition.path.slice();\n newTargetPath.push(0);\n const newTargetPosition = new Position(newParentPosition.root, newTargetPath);\n const moveOp = new MoveOperation(sourcePosition, a.howMany, newTargetPosition, 0);\n return [moveOp];\n }\n a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation(b);\n }\n // Case 2:\n //\n // Split is at a position where nodes were moved.\n //\n // This is a scenario described in `MoveOperation` x `SplitOperation` transformation but from the\n // \"split operation point of view\".\n //\n const splitAtTarget = a.splitPosition.isEqual(b.targetPosition);\n if (splitAtTarget && (context.baRelation == 'insertAtSource' || context.abRelation == 'splitBefore')) {\n a.howMany += b.howMany;\n a.splitPosition = a.splitPosition._getTransformedByDeletion(b.sourcePosition, b.howMany);\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n return [a];\n }\n if (splitAtTarget && context.abRelation && context.abRelation.howMany) {\n const { howMany, offset } = context.abRelation;\n a.howMany += howMany;\n a.splitPosition = a.splitPosition.getShiftedBy(offset);\n return [a];\n }\n // Case 3:\n //\n // If the split position is inside the moved range, we need to shift the split position to a proper place.\n // The position cannot be moved together with moved range because that would result in splitting of an incorrect element.\n //\n // Characters `bc` should be moved to the second paragraph while split position is between them:\n // <paragraph>A[b|c]d</paragraph><paragraph>Xyz</paragraph>\n //\n // After move, new split position is incorrect:\n // <paragraph>Ad</paragraph><paragraph>Xb|cyz</paragraph>\n //\n // Correct split position:\n // <paragraph>A|d</paragraph><paragraph>Xbcyz</paragraph>\n //\n // After split:\n // <paragraph>A</paragraph><paragraph>d</paragraph><paragraph>Xbcyz</paragraph>\n //\n if (a.splitPosition.hasSameParentAs(b.sourcePosition) && rangeToMove.containsPosition(a.splitPosition)) {\n const howManyRemoved = b.howMany - (a.splitPosition.offset - b.sourcePosition.offset);\n a.howMany -= howManyRemoved;\n if (a.splitPosition.hasSameParentAs(b.targetPosition) && a.splitPosition.offset < b.targetPosition.offset) {\n a.howMany += b.howMany;\n }\n a.splitPosition = b.sourcePosition.clone();\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n return [a];\n }\n // The default case.\n // Don't change `howMany` if move operation does not really move anything.\n //\n if (!b.sourcePosition.isEqual(b.targetPosition)) {\n if (a.splitPosition.hasSameParentAs(b.sourcePosition) && a.splitPosition.offset <= b.sourcePosition.offset) {\n a.howMany -= b.howMany;\n }\n if (a.splitPosition.hasSameParentAs(b.targetPosition) && a.splitPosition.offset < b.targetPosition.offset) {\n a.howMany += b.howMany;\n }\n }\n // Change position stickiness to force a correct transformation.\n a.splitPosition.stickiness = 'toNone';\n a.splitPosition = a.splitPosition._getTransformedByMoveOperation(b);\n a.splitPosition.stickiness = 'toNext';\n if (a.graveyardPosition) {\n a.insertionPosition = a.insertionPosition._getTransformedByMoveOperation(b);\n }\n else {\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n }\n return [a];\n});\nsetTransformation(SplitOperation, SplitOperation, (a, b, context) => {\n // Case 1:\n //\n // Split at the same position.\n //\n // If there already was a split at the same position as in `a` operation, it means that the intention\n // conveyed by `a` operation has already been fulfilled and `a` should not do anything (to avoid double split).\n //\n // However, there is a difference if these are new splits or splits created by undo. These have different\n // intentions. Also splits moving back different elements from graveyard have different intentions. They\n // are just different operations.\n //\n // So we cancel split operation only if it was really identical.\n //\n // Also, there is additional case, where split operations aren't identical and should not be cancelled, however the\n // default transformation is incorrect too.\n //\n if (a.splitPosition.isEqual(b.splitPosition)) {\n if (!a.graveyardPosition && !b.graveyardPosition) {\n return [new NoOperation(0)];\n }\n if (a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual(b.graveyardPosition)) {\n return [new NoOperation(0)];\n }\n // Use context to know that the `a.splitPosition` should stay where it is.\n // This happens during undo when first a merge operation moved nodes to `a.splitPosition` and now `b` operation undoes that merge.\n if (context.abRelation == 'splitBefore') {\n // Since split is at the same position, there are no nodes left to split.\n a.howMany = 0;\n // Note: there was `if ( a.graveyardPosition )` here but it was uncovered in tests and I couldn't find any scenarios for now.\n // That would have to be a `SplitOperation` that didn't come from undo but is transformed by operations that were undone.\n // It could happen if `context` is enabled in collaboration.\n a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation(b);\n return [a];\n }\n }\n // Case 2:\n //\n // Same node is using to split different elements. This happens in undo when previously same element was merged to\n // two different elements. This is described in `MergeOperation` x `MergeOperation` transformation.\n //\n // In this case we will follow the same logic. We will assume that `insertionPosition` is same for both\n // split operations. This might not always be true but in the real cases that were experienced it was. After all,\n // if these splits are reverses of merge operations that were merging the same element, then the `insertionPosition`\n // should be same for both of those splits.\n //\n // Again, we will decide which operation is stronger by checking if split happens in graveyard or in non-graveyard root.\n //\n if (a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual(b.graveyardPosition)) {\n const aInGraveyard = a.splitPosition.root.rootName == '$graveyard';\n const bInGraveyard = b.splitPosition.root.rootName == '$graveyard';\n // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.\n const aIsWeak = aInGraveyard && !bInGraveyard;\n // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.\n const bIsWeak = bInGraveyard && !aInGraveyard;\n // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.\n const forceMove = bIsWeak || (!aIsWeak && context.aIsStrong);\n if (forceMove) {\n const result = [];\n // First we need to move any nodes split by `b` back to where they were.\n // Do it only if `b` actually moved something.\n if (b.howMany) {\n result.push(new MoveOperation(b.moveTargetPosition, b.howMany, b.splitPosition, 0));\n }\n // Then we need to move nodes from `a` split position to their new element.\n // Do it only if `a` actually should move something.\n if (a.howMany) {\n result.push(new MoveOperation(a.splitPosition, a.howMany, a.moveTargetPosition, 0));\n }\n return result;\n }\n else {\n return [new NoOperation(0)];\n }\n }\n if (a.graveyardPosition) {\n a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation(b);\n }\n // Case 3:\n //\n // Position where operation `b` inserted a new node after split is the same as the operation `a` split position.\n // As in similar cases, there is ambiguity if the split should be before the new node (created by `b`) or after.\n //\n if (a.splitPosition.isEqual(b.insertionPosition) && context.abRelation == 'splitBefore') {\n a.howMany++;\n return [a];\n }\n // Case 4:\n //\n // This is a mirror to the case 2. above.\n //\n if (b.splitPosition.isEqual(a.insertionPosition) && context.baRelation == 'splitBefore') {\n const newPositionPath = b.insertionPosition.path.slice();\n newPositionPath.push(0);\n const newPosition = new Position(b.insertionPosition.root, newPositionPath);\n const moveOp = new MoveOperation(a.insertionPosition, 1, newPosition, 0);\n return [a, moveOp];\n }\n // The default case.\n //\n if (a.splitPosition.hasSameParentAs(b.splitPosition) && a.splitPosition.offset < b.splitPosition.offset) {\n a.howMany -= b.howMany;\n }\n a.splitPosition = a.splitPosition._getTransformedBySplitOperation(b);\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n return [a];\n});\n/**\n * Checks whether `MoveOperation` `targetPosition` is inside a node from the moved range of the other `MoveOperation`.\n */\nfunction _moveTargetIntoMovedRange(a, b) {\n return a.targetPosition._getTransformedByDeletion(b.sourcePosition, b.howMany) === null;\n}\n/**\n * Helper function for `MoveOperation` x `MoveOperation` transformation. Converts given ranges and target position to\n * move operations and returns them.\n *\n * Ranges and target position will be transformed on-the-fly when generating operations.\n *\n * Given `ranges` should be in the order of how they were in the original transformed operation.\n *\n * Given `targetPosition` is the target position of the first range from `ranges`.\n */\nfunction _makeMoveOperationsFromRanges(ranges, targetPosition) {\n // At this moment we have some ranges and a target position, to which those ranges should be moved.\n // Order in `ranges` array is the go-to order of after transformation.\n //\n // We are almost done. We have `ranges` and `targetPosition` to make operations from.\n // Unfortunately, those operations may affect each other. Precisely, first operation after move\n // may affect source range and target position of second and third operation. Same with second\n // operation affecting third.\n //\n // We need to fix those source ranges and target positions once again, before converting `ranges` to operations.\n const operations = [];\n // Keep in mind that nothing will be transformed if there is just one range in `ranges`.\n for (let i = 0; i < ranges.length; i++) {\n // Create new operation out of a range and target position.\n const range = ranges[i];\n const op = new MoveOperation(range.start, range.end.offset - range.start.offset, targetPosition, 0);\n operations.push(op);\n // Transform other ranges by the generated operation.\n for (let j = i + 1; j < ranges.length; j++) {\n // All ranges in `ranges` array should be:\n //\n // * non-intersecting (these are part of original operation source range), and\n // * `targetPosition` does not target into them (opposite would mean that transformed operation targets \"inside itself\").\n //\n // This means that the transformation will be \"clean\" and always return one result.\n ranges[j] = ranges[j]._getTransformedByMove(op.sourcePosition, op.targetPosition, op.howMany)[0];\n }\n targetPosition = targetPosition._getTransformedByMove(op.sourcePosition, op.targetPosition, op.howMany);\n }\n return operations;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/liveposition\n */\nimport Position from './position.js';\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * `LivePosition` is a type of {@link module:engine/model/position~Position Position}\n * that updates itself as {@link module:engine/model/document~Document document}\n * is changed through operations. It may be used as a bookmark.\n *\n * **Note:** Contrary to {@link module:engine/model/position~Position}, `LivePosition` works only in roots that are\n * {@link module:engine/model/rootelement~RootElement}.\n * If {@link module:engine/model/documentfragment~DocumentFragment} is passed, error will be thrown.\n *\n * **Note:** Be very careful when dealing with `LivePosition`. Each `LivePosition` instance bind events that might\n * have to be unbound.\n * Use {@link module:engine/model/liveposition~LivePosition#detach} whenever you don't need `LivePosition` anymore.\n */\nexport default class LivePosition extends /* #__PURE__ */ EmitterMixin(Position) {\n /**\n * Creates a live position.\n *\n * @see module:engine/model/position~Position\n */\n constructor(root, path, stickiness = 'toNone') {\n super(root, path, stickiness);\n if (!this.root.is('rootElement')) {\n /**\n * LivePosition's root has to be an instance of RootElement.\n *\n * @error model-liveposition-root-not-rootelement\n */\n throw new CKEditorError('model-liveposition-root-not-rootelement', root);\n }\n bindWithDocument.call(this);\n }\n /**\n * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance\n * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was\n * referring to it).\n */\n detach() {\n this.stopListening();\n }\n /**\n * Creates a {@link module:engine/model/position~Position position instance}, which is equal to this live position.\n */\n toPosition() {\n return new Position(this.root, this.path.slice(), this.stickiness);\n }\n /**\n * Creates a `LivePosition` instance that is equal to position.\n */\n static fromPosition(position, stickiness) {\n return new this(position.root, position.path.slice(), stickiness ? stickiness : position.stickiness);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nLivePosition.prototype.is = function (type) {\n return type === 'livePosition' || type === 'model:livePosition' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type == 'position' || type === 'model:position';\n};\n/**\n * Binds this `LivePosition` to the {@link module:engine/model/document~Document document} that owns\n * this position's {@link module:engine/model/position~Position#root root}.\n */\nfunction bindWithDocument() {\n this.listenTo(this.root.document.model, 'applyOperation', (event, args) => {\n const operation = args[0];\n if (!operation.isDocumentOperation) {\n return;\n }\n transform.call(this, operation);\n }, { priority: 'low' });\n}\n/**\n * Updates this position accordingly to the updates applied to the model. Bases on change events.\n */\nfunction transform(operation) {\n const result = this.getTransformedByOperation(operation);\n if (!this.isEqual(result)) {\n const oldPosition = this.toPosition();\n this.path = result.path;\n this.root = result.root;\n this.fire('change', oldPosition);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/batch\n */\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\n/**\n * A batch instance groups model changes ({@link module:engine/model/operation/operation~Operation operations}). All operations\n * grouped in a single batch can be reverted together, so you can also think about a batch as of a single undo step. If you want\n * to extend a given undo step, you can add more changes to the batch using {@link module:engine/model/model~Model#enqueueChange}:\n *\n * ```ts\n * model.enqueueChange( batch, writer => {\n * \twriter.insertText( 'foo', paragraph, 'end' );\n * } );\n * ```\n *\n * @see module:engine/model/model~Model#enqueueChange\n * @see module:engine/model/model~Model#change\n */\nexport default class Batch {\n /**\n * Creates a batch instance.\n *\n * @see module:engine/model/model~Model#enqueueChange\n * @see module:engine/model/model~Model#change\n * @param type A set of flags that specify the type of the batch. Batch type can alter how some of the features work\n * when encountering a given `Batch` instance (for example, when a feature listens to applied operations).\n */\n constructor(type = {}) {\n if (typeof type === 'string') {\n type = type === 'transparent' ? { isUndoable: false } : {};\n /**\n * The string value for a `type` property of the `Batch` constructor has been deprecated and will be removed in the near future.\n * Please refer to the {@link module:engine/model/batch~Batch#constructor `Batch` constructor API documentation} for more\n * information.\n *\n * @error batch-constructor-deprecated-string-type\n */\n logWarning('batch-constructor-deprecated-string-type');\n }\n const { isUndoable = true, isLocal = true, isUndo = false, isTyping = false } = type;\n this.operations = [];\n this.isUndoable = isUndoable;\n this.isLocal = isLocal;\n this.isUndo = isUndo;\n this.isTyping = isTyping;\n }\n /**\n * The type of the batch.\n *\n * **This property has been deprecated and is always set to the `'default'` value.**\n *\n * It can be one of the following values:\n * * `'default'` – All \"normal\" batches. This is the most commonly used type.\n * * `'transparent'` – A batch that should be ignored by other features, i.e. an initial batch or collaborative editing\n * changes.\n *\n * @deprecated\n */\n get type() {\n /**\n * The {@link module:engine/model/batch~Batch#type `Batch#type` } property has been deprecated and will be removed in the near\n * future. Use `Batch#isLocal`, `Batch#isUndoable`, `Batch#isUndo` and `Batch#isTyping` instead.\n *\n * @error batch-type-deprecated\n */\n logWarning('batch-type-deprecated');\n return 'default';\n }\n /**\n * Returns the base version of this batch, which is equal to the base version of the first operation in the batch.\n * If there are no operations in the batch or neither operation has the base version set, it returns `null`.\n */\n get baseVersion() {\n for (const op of this.operations) {\n if (op.baseVersion !== null) {\n return op.baseVersion;\n }\n }\n return null;\n }\n /**\n * Adds an operation to the batch instance.\n *\n * @param operation An operation to add.\n * @returns The added operation.\n */\n addOperation(operation) {\n operation.batch = this;\n this.operations.push(operation);\n return operation;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/differ\n */\nimport Position from './position.js';\nimport Range from './range.js';\n/**\n * Calculates the difference between two model states.\n *\n * Receives operations that are to be applied on the model document. Marks parts of the model document tree which\n * are changed and saves the state of these elements before the change. Then, it compares saved elements with the\n * changed elements, after all changes are applied on the model document. Calculates the diff between saved\n * elements and new ones and returns a change set.\n */\nclass Differ {\n /**\n * Creates a `Differ` instance.\n *\n * @param markerCollection Model's marker collection.\n */\n constructor(markerCollection) {\n /**\n * A map that stores changes that happened in a given element.\n *\n * The keys of the map are references to the model elements.\n * The values of the map are arrays with changes that were done on this element.\n */\n this._changesInElement = new Map();\n /**\n * Stores a snapshot for these model nodes that might have changed.\n *\n * This complements {@link ~Differ#_elementChildrenSnapshots `_elementChildrenSnapshots`}.\n *\n * See also {@link ~DifferSnapshot}.\n */\n this._elementsSnapshots = new Map();\n /**\n * For each element or document fragment inside which there was a change, it stores a snapshot of the child nodes list (an array\n * of children snapshots that represent the state in the element / fragment before any change has happened).\n *\n * This complements {@link ~Differ#_elementsSnapshots `_elementsSnapshots`}.\n *\n * See also {@link ~DifferSnapshot}.\n */\n this._elementChildrenSnapshots = new Map();\n /**\n * Keeps the state for a given element, describing how the element was changed so far. It is used to evaluate the `action` property\n * of diff items returned by {@link ~Differ#getChanges}.\n *\n * Possible values, in the order from the lowest priority to the highest priority:\n *\n * * `'refresh'` - element was refreshed,\n * * `'rename'` - element was renamed,\n * * `'move'` - element was moved (or, usually, removed, that is moved to the graveyard).\n *\n * Element that was refreshed, may change its state to `'rename'` if it was later renamed, or to `'move'` if it was removed.\n * But the element cannot change its state from `'move'` to `'rename'`, or from `'rename'` to `'refresh'`.\n *\n * Only already existing elements are registered in `_elementState`. If a new element was inserted as a result of a buffered operation,\n * it is not be registered in `_elementState`.\n */\n this._elementState = new Map();\n /**\n * A map that stores all changed markers.\n *\n * The keys of the map are marker names.\n *\n * The values of the map are objects with the following properties:\n *\n * * `oldMarkerData`,\n * * `newMarkerData`.\n */\n this._changedMarkers = new Map();\n /**\n * A map that stores all roots that have been changed.\n *\n * The keys are the names of the roots while value represents the changes.\n */\n this._changedRoots = new Map();\n /**\n * Stores the number of changes that were processed. Used to order the changes chronologically. It is important\n * when changes are sorted.\n */\n this._changeCount = 0;\n /**\n * For efficiency purposes, `Differ` stores the change set returned by the differ after {@link #getChanges} call.\n * Cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will\n * return the cached value instead of calculating it again.\n *\n * This property stores those changes that did not take place in graveyard root.\n */\n this._cachedChanges = null;\n /**\n * For efficiency purposes, `Differ` stores the change set returned by the differ after the {@link #getChanges} call.\n * The cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will\n * return the cached value instead of calculating it again.\n *\n * This property stores all changes evaluated by `Differ`, including those that took place in the graveyard.\n */\n this._cachedChangesWithGraveyard = null;\n /**\n * Set of model items that were marked to get refreshed in {@link #_refreshItem}.\n */\n this._refreshedItems = new Set();\n this._markerCollection = markerCollection;\n }\n /**\n * Informs whether there are any changes buffered in `Differ`.\n */\n get isEmpty() {\n return this._changesInElement.size == 0 && this._changedMarkers.size == 0 && this._changedRoots.size == 0;\n }\n /**\n * Buffers the given operation. **An operation has to be buffered before it is executed.**\n *\n * @param operationToBuffer An operation to buffer.\n */\n bufferOperation(operationToBuffer) {\n // Below we take an operation, check its type, then use its parameters in marking (private) methods.\n // The general rule is to not mark elements inside inserted element. All inserted elements are re-rendered.\n // Marking changes in them would cause a \"double\" changing then.\n //\n const operation = operationToBuffer;\n // Note: an operation that happens inside a non-loaded root will be ignored. If the operation happens partially inside\n // a non-loaded root, that part will be ignored (this may happen for move or marker operations).\n //\n switch (operation.type) {\n case 'insert': {\n if (this._isInInsertedElement(operation.position.parent)) {\n return;\n }\n this._markInsert(operation.position.parent, operation.position.offset, operation.nodes.maxOffset);\n break;\n }\n case 'addAttribute':\n case 'removeAttribute':\n case 'changeAttribute': {\n for (const item of operation.range.getItems({ shallow: true })) {\n if (this._isInInsertedElement(item.parent)) {\n continue;\n }\n this._markAttribute(item);\n }\n break;\n }\n case 'remove':\n case 'move':\n case 'reinsert': {\n // When range is moved to the same position then not mark it as a change.\n // See: https://github.com/ckeditor/ckeditor5-engine/issues/1664.\n if (operation.sourcePosition.isEqual(operation.targetPosition) ||\n operation.sourcePosition.getShiftedBy(operation.howMany).isEqual(operation.targetPosition)) {\n return;\n }\n const sourceParentInserted = this._isInInsertedElement(operation.sourcePosition.parent);\n const targetParentInserted = this._isInInsertedElement(operation.targetPosition.parent);\n if (!sourceParentInserted) {\n this._markRemove(operation.sourcePosition.parent, operation.sourcePosition.offset, operation.howMany);\n }\n if (!targetParentInserted) {\n this._markInsert(operation.targetPosition.parent, operation.getMovedRangeStart().offset, operation.howMany);\n }\n // Remember -- operation is buffered before it is executed. So, it was not executed yet.\n const range = Range._createFromPositionAndShift(operation.sourcePosition, operation.howMany);\n for (const node of range.getItems({ shallow: true })) {\n this._setElementState(node, 'move');\n }\n break;\n }\n case 'rename': {\n if (this._isInInsertedElement(operation.position.parent)) {\n return;\n }\n this._markRemove(operation.position.parent, operation.position.offset, 1);\n this._markInsert(operation.position.parent, operation.position.offset, 1);\n const range = Range._createFromPositionAndShift(operation.position, 1);\n for (const marker of this._markerCollection.getMarkersIntersectingRange(range)) {\n const markerData = marker.getData();\n this.bufferMarkerChange(marker.name, markerData, markerData);\n }\n this._setElementState(operation.position.nodeAfter, 'rename');\n break;\n }\n case 'split': {\n const splitElement = operation.splitPosition.parent;\n // Mark that children of the split element were removed.\n if (!this._isInInsertedElement(splitElement)) {\n this._markRemove(splitElement, operation.splitPosition.offset, operation.howMany);\n // Remember -- operation is buffered before it is executed. So, it was not executed yet.\n const range = Range._createFromPositionAndShift(operation.splitPosition, operation.howMany);\n for (const node of range.getItems({ shallow: true })) {\n this._setElementState(node, 'move');\n }\n }\n // Mark that the new element (split copy) was inserted.\n if (!this._isInInsertedElement(operation.insertionPosition.parent)) {\n this._markInsert(operation.insertionPosition.parent, operation.insertionPosition.offset, 1);\n }\n // If the split took the element from the graveyard, mark that the element from the graveyard was removed.\n if (operation.graveyardPosition) {\n this._markRemove(operation.graveyardPosition.parent, operation.graveyardPosition.offset, 1);\n this._setElementState(operation.graveyardPosition.nodeAfter, 'move');\n }\n break;\n }\n case 'merge': {\n // Mark that the merged element was removed.\n const mergedElement = operation.sourcePosition.parent;\n if (!this._isInInsertedElement(mergedElement.parent)) {\n this._markRemove(mergedElement.parent, mergedElement.startOffset, 1);\n }\n // Mark that the merged element was inserted into graveyard.\n const graveyardParent = operation.graveyardPosition.parent;\n this._markInsert(graveyardParent, operation.graveyardPosition.offset, 1);\n this._setElementState(mergedElement, 'move');\n // Mark that children of merged element were inserted at new parent.\n const mergedIntoElement = operation.targetPosition.parent;\n if (!this._isInInsertedElement(mergedIntoElement)) {\n this._markInsert(mergedIntoElement, operation.targetPosition.offset, mergedElement.maxOffset);\n // Remember -- operation is buffered before it is executed. So, it was not executed yet.\n const range = Range._createFromPositionAndShift(operation.sourcePosition, operation.howMany);\n for (const node of range.getItems({ shallow: true })) {\n this._setElementState(node, 'move');\n }\n }\n break;\n }\n case 'detachRoot':\n case 'addRoot': {\n const root = operation.affectedSelectable;\n if (!root._isLoaded) {\n return;\n }\n // Don't buffer if the root state does not change.\n if (root.isAttached() == operation.isAdd) {\n return;\n }\n this._bufferRootStateChange(operation.rootName, operation.isAdd);\n break;\n }\n case 'addRootAttribute':\n case 'removeRootAttribute':\n case 'changeRootAttribute': {\n if (!operation.root._isLoaded) {\n return;\n }\n const rootName = operation.root.rootName;\n this._bufferRootAttributeChange(rootName, operation.key, operation.oldValue, operation.newValue);\n break;\n }\n }\n // Clear cache after each buffered operation as it is no longer valid.\n this._cachedChanges = null;\n }\n /**\n * Buffers a marker change.\n *\n * @param markerName The name of the marker that changed.\n * @param oldMarkerData Marker data before the change.\n * @param newMarkerData Marker data after the change.\n */\n bufferMarkerChange(markerName, oldMarkerData, newMarkerData) {\n if (oldMarkerData.range && oldMarkerData.range.root.is('rootElement') && !oldMarkerData.range.root._isLoaded) {\n oldMarkerData.range = null;\n }\n if (newMarkerData.range && newMarkerData.range.root.is('rootElement') && !newMarkerData.range.root._isLoaded) {\n newMarkerData.range = null;\n }\n let buffered = this._changedMarkers.get(markerName);\n if (!buffered) {\n buffered = { newMarkerData, oldMarkerData };\n this._changedMarkers.set(markerName, buffered);\n }\n else {\n buffered.newMarkerData = newMarkerData;\n }\n if (buffered.oldMarkerData.range == null && newMarkerData.range == null) {\n // The marker is going to be removed (`newMarkerData.range == null`) but it did not exist before the first buffered change\n // (`buffered.oldMarkerData.range == null`). In this case, do not keep the marker in buffer at all.\n this._changedMarkers.delete(markerName);\n }\n }\n /**\n * Returns all markers that should be removed as a result of buffered changes.\n *\n * @returns Markers to remove. Each array item is an object containing the `name` and `range` properties.\n */\n getMarkersToRemove() {\n const result = [];\n for (const [name, change] of this._changedMarkers) {\n if (change.oldMarkerData.range != null) {\n result.push({ name, range: change.oldMarkerData.range });\n }\n }\n return result;\n }\n /**\n * Returns all markers which should be added as a result of buffered changes.\n *\n * @returns Markers to add. Each array item is an object containing the `name` and `range` properties.\n */\n getMarkersToAdd() {\n const result = [];\n for (const [name, change] of this._changedMarkers) {\n if (change.newMarkerData.range != null) {\n result.push({ name, range: change.newMarkerData.range });\n }\n }\n return result;\n }\n /**\n * Returns all markers which changed.\n */\n getChangedMarkers() {\n return Array.from(this._changedMarkers).map(([name, change]) => ({\n name,\n data: {\n oldRange: change.oldMarkerData.range,\n newRange: change.newMarkerData.range\n }\n }));\n }\n /**\n * Checks whether some of the buffered changes affect the editor data.\n *\n * Types of changes which affect the editor data:\n *\n * * model structure changes,\n * * attribute changes,\n * * a root is added or detached,\n * * changes of markers which were defined as `affectsData`,\n * * changes of markers' `affectsData` property.\n */\n hasDataChanges() {\n if (this.getChanges().length) {\n return true;\n }\n if (this._changedRoots.size > 0) {\n return true;\n }\n for (const { newMarkerData, oldMarkerData } of this._changedMarkers.values()) {\n if (newMarkerData.affectsData !== oldMarkerData.affectsData) {\n return true;\n }\n if (newMarkerData.affectsData) {\n const markerAdded = newMarkerData.range && !oldMarkerData.range;\n const markerRemoved = !newMarkerData.range && oldMarkerData.range;\n const markerChanged = newMarkerData.range && oldMarkerData.range && !newMarkerData.range.isEqual(oldMarkerData.range);\n if (markerAdded || markerRemoved || markerChanged) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Calculates the diff between the old model tree state (the state before the first buffered operations since the last {@link #reset}\n * call) and the new model tree state (actual one). It should be called after all buffered operations are executed.\n *\n * The diff set is returned as an array of {@link module:engine/model/differ~DiffItem diff items}, each describing a change done\n * on the model. The items are sorted by the position on which the change happened. If a position\n * {@link module:engine/model/position~Position#isBefore is before} another one, it will be on an earlier index in the diff set.\n *\n * **Note**: Elements inside inserted element will not have a separate diff item, only the top most element change will be reported.\n *\n * Because calculating the diff is a costly operation, the result is cached. If no new operation was buffered since the\n * previous {@link #getChanges} call, the next call will return the cached value.\n *\n * @param options Additional options.\n * @param options.includeChangesInGraveyard If set to `true`, also changes that happened\n * in the graveyard root will be returned. By default, changes in the graveyard root are not returned.\n * @returns Diff between the old and the new model tree state.\n */\n getChanges(options = {}) {\n // If there are cached changes, just return them instead of calculating changes again.\n if (this._cachedChanges) {\n if (options.includeChangesInGraveyard) {\n return this._cachedChangesWithGraveyard.slice();\n }\n else {\n return this._cachedChanges.slice();\n }\n }\n // Will contain returned results.\n let diffSet = [];\n // Check all changed elements/roots.\n for (const element of this._changesInElement.keys()) {\n // Get changes inside this element/root and sort them.\n const changes = this._changesInElement.get(element).sort((a, b) => {\n if (a.offset === b.offset) {\n if (a.type != b.type) {\n // If there are multiple changes at the same position, \"remove\" change should be first.\n // If the order is different, for example, we would first add some nodes and then removed them\n // (instead of the nodes that we should remove).\n return a.type == 'remove' ? -1 : 1;\n }\n return 0;\n }\n return a.offset < b.offset ? -1 : 1;\n });\n // Get children of this element before any change was applied on it.\n const childrenBefore = this._elementChildrenSnapshots.get(element);\n // Get snapshot of current element's children.\n const childrenAfter = _getChildrenSnapshots(element.getChildren());\n // Generate diff instructions based on changes done in the element/root.\n const diffInstructions = _generateDiffInstructionsFromChanges(childrenBefore.length, changes);\n let i = 0; // Iterator in `childrenAfter` array -- iterates through current children of element.\n let j = 0; // Iterator in `childrenBefore` array -- iterates through old children of element.\n // Process every action.\n for (const instruction of diffInstructions) {\n if (instruction === 'i') {\n const action = this._getDiffActionForNode(childrenAfter[i].node, 'insert');\n const childSnapshotBefore = this._elementsSnapshots.get(childrenAfter[i].node);\n const diffItem = this._getInsertDiff(element, i, action, childrenAfter[i], childSnapshotBefore);\n diffSet.push(diffItem);\n i++;\n }\n else if (instruction === 'r') {\n const action = this._getDiffActionForNode(childrenBefore[j].node, 'remove');\n const diffItem = this._getRemoveDiff(element, i, action, childrenBefore[j]);\n diffSet.push(diffItem);\n j++;\n }\n else if (instruction === 'a') {\n // Take attributes from saved and current children.\n const beforeAttributes = childrenBefore[j].attributes;\n const afterAttributes = childrenAfter[i].attributes;\n let range;\n if (childrenAfter[i].name == '$text') {\n range = new Range(Position._createAt(element, i), Position._createAt(element, i + 1));\n }\n else {\n const index = element.offsetToIndex(i);\n range = new Range(Position._createAt(element, i), Position._createAt(element.getChild(index), 0));\n }\n // Generate diff items for this change (there might be multiple attributes changed and\n // there is a single diff for each of them) and insert them into the diff set.\n const diffItems = this._getAttributesDiff(range, beforeAttributes, afterAttributes);\n diffSet.push(...diffItems);\n i++;\n j++;\n }\n else {\n // `action` is 'equal'. Child not changed.\n i++;\n j++;\n }\n }\n }\n // Then, sort the changes by the position (change at position before other changes is first).\n diffSet.sort((a, b) => {\n // If the change is in different root, we don't care much, but we'd like to have all changes in given\n // root \"together\" in the array. So let's just sort them by the root name. It does not matter which root\n // will be processed first.\n if (a.position.root != b.position.root) {\n return a.position.root.rootName < b.position.root.rootName ? -1 : 1;\n }\n // If change happens at the same position...\n if (a.position.isEqual(b.position)) {\n // Keep chronological order of operations.\n return a.changeCount - b.changeCount;\n }\n // If positions differ, position \"on the left\" should be earlier in the result.\n return a.position.isBefore(b.position) ? -1 : 1;\n });\n // Glue together multiple changes (mostly on text nodes).\n for (let i = 1, prevIndex = 0; i < diffSet.length; i++) {\n const prevDiff = diffSet[prevIndex];\n const thisDiff = diffSet[i];\n // Glue remove changes if they happen on text on same position.\n const isConsecutiveTextRemove = prevDiff.type == 'remove' && thisDiff.type == 'remove' &&\n prevDiff.name == '$text' && thisDiff.name == '$text' &&\n prevDiff.position.isEqual(thisDiff.position);\n // Glue insert changes if they happen on text on consecutive fragments.\n const isConsecutiveTextAdd = prevDiff.type == 'insert' && thisDiff.type == 'insert' &&\n prevDiff.name == '$text' && thisDiff.name == '$text' &&\n prevDiff.position.parent == thisDiff.position.parent &&\n prevDiff.position.offset + prevDiff.length == thisDiff.position.offset;\n // Glue attribute changes if they happen on consecutive fragments and have same key, old value and new value.\n const isConsecutiveAttributeChange = prevDiff.type == 'attribute' && thisDiff.type == 'attribute' &&\n prevDiff.position.parent == thisDiff.position.parent &&\n prevDiff.range.isFlat && thisDiff.range.isFlat &&\n (prevDiff.position.offset + prevDiff.length) == thisDiff.position.offset &&\n prevDiff.attributeKey == thisDiff.attributeKey &&\n prevDiff.attributeOldValue == thisDiff.attributeOldValue &&\n prevDiff.attributeNewValue == thisDiff.attributeNewValue;\n if (isConsecutiveTextRemove || isConsecutiveTextAdd || isConsecutiveAttributeChange) {\n prevDiff.length++;\n if (isConsecutiveAttributeChange) {\n prevDiff.range.end = prevDiff.range.end.getShiftedBy(1);\n }\n diffSet[i] = null;\n }\n else {\n prevIndex = i;\n }\n }\n diffSet = diffSet.filter(v => v);\n // Remove `changeCount` property from diff items. It is used only for sorting and is internal thing.\n for (const item of diffSet) {\n delete item.changeCount;\n if (item.type == 'attribute') {\n delete item.position;\n delete item.length;\n }\n }\n this._changeCount = 0;\n // Cache changes.\n this._cachedChangesWithGraveyard = diffSet;\n this._cachedChanges = diffSet.filter(_changesInGraveyardFilter);\n if (options.includeChangesInGraveyard) {\n return this._cachedChangesWithGraveyard.slice();\n }\n else {\n return this._cachedChanges.slice();\n }\n }\n /**\n * Returns all roots that have changed (either were attached, or detached, or their attributes changed).\n *\n * @returns Diff between the old and the new roots state.\n */\n getChangedRoots() {\n return Array.from(this._changedRoots.values()).map(diffItem => {\n const entry = { ...diffItem };\n if (entry.state !== undefined) {\n // The root was attached or detached -- do not return its attributes changes.\n // If the root was attached, it should be handled as a whole, together with its attributes, the same way as model nodes.\n // If the root was detached, its attributes should be discarded anyway.\n //\n // Keep in mind that filtering must happen on this stage (when retrieving changes). If filtering happens on-the-fly as\n // the attributes change, it may lead to incorrect situation, e.g.: detach root, change attribute, re-attach root.\n // In this case, attribute change cannot be filtered. After the root is re-attached, the attribute change must be kept.\n delete entry.attributes;\n }\n return entry;\n });\n }\n /**\n * Returns a set of model items that were marked to get refreshed.\n */\n getRefreshedItems() {\n return new Set(this._refreshedItems);\n }\n /**\n * Resets `Differ`. Removes all buffered changes.\n */\n reset() {\n this._changesInElement.clear();\n this._elementChildrenSnapshots.clear();\n this._elementsSnapshots.clear();\n this._elementState.clear();\n this._changedMarkers.clear();\n this._changedRoots.clear();\n this._refreshedItems.clear();\n this._cachedChanges = null;\n }\n /**\n * Marks the given `item` in differ to be \"refreshed\". It means that the item will be marked as removed and inserted\n * in the differ changes set, so it will be effectively re-converted when the differ changes are handled by a dispatcher.\n *\n * @internal\n * @param item Item to refresh.\n */\n _refreshItem(item) {\n if (this._isInInsertedElement(item.parent)) {\n return;\n }\n this._markRemove(item.parent, item.startOffset, item.offsetSize);\n this._markInsert(item.parent, item.startOffset, item.offsetSize);\n this._refreshedItems.add(item);\n this._setElementState(item, 'refresh');\n const range = Range._createOn(item);\n for (const marker of this._markerCollection.getMarkersIntersectingRange(range)) {\n const markerData = marker.getData();\n this.bufferMarkerChange(marker.name, markerData, markerData);\n }\n // Clear cache after each buffered operation as it is no longer valid.\n this._cachedChanges = null;\n }\n /**\n * Buffers all the data related to given root like it was all just added to the editor.\n *\n * Following changes are buffered:\n *\n * * root is attached,\n * * all root content is inserted,\n * * all root attributes are added,\n * * all markers inside the root are added.\n *\n * @internal\n */\n _bufferRootLoad(root) {\n if (!root.isAttached()) {\n return;\n }\n this._bufferRootStateChange(root.rootName, true);\n this._markInsert(root, 0, root.maxOffset);\n // Buffering root attribute changes makes sense and is actually needed, even though we buffer root state change above.\n // Because the root state change is buffered, the root attributes changes are not returned by the differ.\n // But, if the root attribute is removed in the same change block, or the root is detached, then the differ results would be wrong.\n //\n for (const key of root.getAttributeKeys()) {\n this._bufferRootAttributeChange(root.rootName, key, null, root.getAttribute(key));\n }\n for (const marker of this._markerCollection) {\n if (marker.getRange().root == root) {\n const markerData = marker.getData();\n this.bufferMarkerChange(marker.name, { ...markerData, range: null }, markerData);\n }\n }\n }\n /**\n * Buffers the root state change after the root was attached or detached\n */\n _bufferRootStateChange(rootName, isAttached) {\n if (!this._changedRoots.has(rootName)) {\n this._changedRoots.set(rootName, { name: rootName, state: isAttached ? 'attached' : 'detached' });\n return;\n }\n const diffItem = this._changedRoots.get(rootName);\n if (diffItem.state !== undefined) {\n // Root `state` can only toggle between one of the values and no value. It cannot be any other way,\n // because if the root was originally attached it can only become detached. Then, if it is re-attached in the same batch of\n // changes, it gets back to \"no change\" (which means no value). Same if the root was originally detached.\n delete diffItem.state;\n if (diffItem.attributes === undefined) {\n // If there is no `state` change and no `attributes` change, remove the entry.\n this._changedRoots.delete(rootName);\n }\n }\n else {\n diffItem.state = isAttached ? 'attached' : 'detached';\n }\n }\n /**\n * Buffers a root attribute change.\n */\n _bufferRootAttributeChange(rootName, key, oldValue, newValue) {\n const diffItem = this._changedRoots.get(rootName) || { name: rootName };\n const attrs = diffItem.attributes || {};\n if (attrs[key]) {\n // If this attribute or metadata was already changed earlier and is changed again, check to what value it is changed.\n const attrEntry = attrs[key];\n if (newValue === attrEntry.oldValue) {\n // If it was changed back to the old value, remove the entry.\n delete attrs[key];\n }\n else {\n // If it was changed to a different value, update the entry.\n attrEntry.newValue = newValue;\n }\n }\n else {\n // If this attribute or metadata was not set earlier, add an entry.\n attrs[key] = { oldValue, newValue };\n }\n if (Object.entries(attrs).length === 0) {\n // If attributes or metadata changes set became empty, remove it from the diff item.\n delete diffItem.attributes;\n if (diffItem.state === undefined) {\n // If there is no `state` change and no `attributes` change, remove the entry.\n this._changedRoots.delete(rootName);\n }\n }\n else {\n // Make sure that, if a new object in the structure was created, it gets set.\n diffItem.attributes = attrs;\n this._changedRoots.set(rootName, diffItem);\n }\n }\n /**\n * Saves and handles an insert change.\n */\n _markInsert(parent, offset, howMany) {\n if (parent.root.is('rootElement') && !parent.root._isLoaded) {\n return;\n }\n const changeItem = { type: 'insert', offset, howMany, count: this._changeCount++ };\n this._markChange(parent, changeItem);\n }\n /**\n * Saves and handles a remove change.\n */\n _markRemove(parent, offset, howMany) {\n if (parent.root.is('rootElement') && !parent.root._isLoaded) {\n return;\n }\n const changeItem = { type: 'remove', offset, howMany, count: this._changeCount++ };\n this._markChange(parent, changeItem);\n this._removeAllNestedChanges(parent, offset, howMany);\n }\n /**\n * Saves and handles an attribute change.\n */\n _markAttribute(item) {\n if (item.root.is('rootElement') && !item.root._isLoaded) {\n return;\n }\n const changeItem = { type: 'attribute', offset: item.startOffset, howMany: item.offsetSize, count: this._changeCount++ };\n this._markChange(item.parent, changeItem);\n }\n /**\n * Saves and handles a model change.\n */\n _markChange(parent, changeItem) {\n // First, make a snapshot of the parent and its children (it will be made only if it was not made before).\n this._makeSnapshots(parent);\n // Then, get all changes that already were done on the element (empty array if this is the first change).\n const changes = this._getChangesForElement(parent);\n // Then, look through all the changes, and transform them or the new change.\n this._handleChange(changeItem, changes);\n // Add the new change.\n changes.push(changeItem);\n // Remove incorrect changes. During transformation some change might be, for example, included in another.\n // In that case, the change will have `howMany` property set to `0` or less. We need to remove those changes.\n for (let i = 0; i < changes.length; i++) {\n if (changes[i].howMany < 1) {\n changes.splice(i, 1);\n i--;\n }\n }\n }\n /**\n * Tries to set given state for given item.\n *\n * This method does simple validation (it sets the state only for model elements, not for text proxy nodes). It also follows state\n * setting rules, that is, `'refresh'` cannot overwrite `'rename'`, and `'rename'` cannot overwrite `'move'`.\n */\n _setElementState(node, state) {\n if (!node.is('element')) {\n return;\n }\n const currentStatePriority = Differ._statesPriority.indexOf(this._elementState.get(node));\n const newStatePriority = Differ._statesPriority.indexOf(state);\n if (newStatePriority > currentStatePriority) {\n this._elementState.set(node, state);\n }\n }\n /**\n * Returns a value for {@link ~DifferItemAction `action`} property for diff items returned by {@link ~Differ#getChanges}.\n * This method aims to return `'rename'` or `'refresh'` when it should, and `diffItemType` (\"default action\") in all other cases.\n *\n * It bases on a few factors:\n *\n * * for text nodes, the method always returns `diffItemType`,\n * * for newly inserted element, the method returns `diffItemType`,\n * * if {@link ~Differ#_elementState element state} was not recorded, the method returns `diffItemType`,\n * * if state was recorded, and it was `'move'` (default action), the method returns `diffItemType`,\n * * finally, if state was `'refresh'` or `'rename'`, the method returns the state value.\n */\n _getDiffActionForNode(node, diffItemType) {\n if (!node.is('element')) {\n // Text node.\n return diffItemType;\n }\n if (!this._elementsSnapshots.has(node)) {\n // Newly inserted element.\n return diffItemType;\n }\n const state = this._elementState.get(node);\n if (!state || state == 'move') {\n return diffItemType;\n }\n return state;\n }\n /**\n * Gets an array of changes that have already been saved for a given element.\n */\n _getChangesForElement(element) {\n let changes;\n if (this._changesInElement.has(element)) {\n changes = this._changesInElement.get(element);\n }\n else {\n changes = [];\n this._changesInElement.set(element, changes);\n }\n return changes;\n }\n /**\n * Creates and saves a snapshot for all children of the given element.\n */\n _makeSnapshots(element) {\n if (this._elementChildrenSnapshots.has(element)) {\n return;\n }\n const childrenSnapshots = _getChildrenSnapshots(element.getChildren());\n this._elementChildrenSnapshots.set(element, childrenSnapshots);\n for (const snapshot of childrenSnapshots) {\n this._elementsSnapshots.set(snapshot.node, snapshot);\n }\n }\n /**\n * For a given newly saved change, compares it with a change already done on the element and modifies the incoming\n * change and/or the old change.\n *\n * @param inc Incoming (new) change.\n * @param changes An array containing all the changes done on that element.\n */\n _handleChange(inc, changes) {\n // We need a helper variable that will store how many nodes are to be still handled for this change item.\n // `nodesToHandle` (how many nodes still need to be handled) and `howMany` (how many nodes were affected)\n // needs to be differentiated.\n //\n // This comes up when there are multiple changes that are affected by `inc` change item.\n //\n // For example: assume two insert changes: `{ offset: 2, howMany: 1 }` and `{ offset: 5, howMany: 1 }`.\n // Assume that `inc` change is remove `{ offset: 2, howMany: 2, nodesToHandle: 2 }`.\n //\n // Then, we:\n // - \"forget\" about first insert change (it is \"eaten\" by remove),\n // - because of that, at the end we will want to remove only one node (`nodesToHandle = 1`),\n // - but still we have to change offset of the second insert change from `5` to `3`!\n //\n // So, `howMany` does not change throughout items transformation and keeps information about how many nodes were affected,\n // while `nodesToHandle` means how many nodes need to be handled after the change item is transformed by other changes.\n inc.nodesToHandle = inc.howMany;\n for (const old of changes) {\n const incEnd = inc.offset + inc.howMany;\n const oldEnd = old.offset + old.howMany;\n if (inc.type == 'insert') {\n if (old.type == 'insert') {\n if (inc.offset <= old.offset) {\n old.offset += inc.howMany;\n }\n else if (inc.offset < oldEnd) {\n old.howMany += inc.nodesToHandle;\n inc.nodesToHandle = 0;\n }\n }\n if (old.type == 'remove') {\n if (inc.offset < old.offset) {\n old.offset += inc.howMany;\n }\n }\n if (old.type == 'attribute') {\n if (inc.offset <= old.offset) {\n old.offset += inc.howMany;\n }\n else if (inc.offset < oldEnd) {\n // This case is more complicated, because attribute change has to be split into two.\n // Example (assume that uppercase and lowercase letters mean different attributes):\n //\n // initial state:\t\tabcxyz\n // attribute change:\taBCXYz\n // incoming insert:\t\taBCfooXYz\n //\n // Change ranges cannot intersect because each item has to be described exactly (it was either\n // not changed, inserted, removed, or its attribute was changed). That's why old attribute\n // change has to be split and both parts has to be handled separately from now on.\n const howMany = old.howMany;\n old.howMany = inc.offset - old.offset;\n // Add the second part of attribute change to the beginning of processed array so it won't\n // be processed again in this loop.\n changes.unshift({\n type: 'attribute',\n offset: incEnd,\n howMany: howMany - old.howMany,\n count: this._changeCount++\n });\n }\n }\n }\n if (inc.type == 'remove') {\n if (old.type == 'insert') {\n if (incEnd <= old.offset) {\n old.offset -= inc.howMany;\n }\n else if (incEnd <= oldEnd) {\n if (inc.offset < old.offset) {\n const intersectionLength = incEnd - old.offset;\n old.offset = inc.offset;\n old.howMany -= intersectionLength;\n inc.nodesToHandle -= intersectionLength;\n }\n else {\n old.howMany -= inc.nodesToHandle;\n inc.nodesToHandle = 0;\n }\n }\n else {\n if (inc.offset <= old.offset) {\n inc.nodesToHandle -= old.howMany;\n old.howMany = 0;\n }\n else if (inc.offset < oldEnd) {\n const intersectionLength = oldEnd - inc.offset;\n old.howMany -= intersectionLength;\n inc.nodesToHandle -= intersectionLength;\n }\n }\n }\n if (old.type == 'remove') {\n if (incEnd <= old.offset) {\n old.offset -= inc.howMany;\n }\n else if (inc.offset < old.offset) {\n inc.nodesToHandle += old.howMany;\n old.howMany = 0;\n }\n }\n if (old.type == 'attribute') {\n if (incEnd <= old.offset) {\n old.offset -= inc.howMany;\n }\n else if (inc.offset < old.offset) {\n const intersectionLength = incEnd - old.offset;\n old.offset = inc.offset;\n old.howMany -= intersectionLength;\n }\n else if (inc.offset < oldEnd) {\n if (incEnd <= oldEnd) {\n // On first sight in this case we don't need to split attribute operation into two.\n // However the changes set is later converted to actions (see `_generateActionsFromChanges`).\n // For that reason, no two changes may intersect.\n // So we cannot have an attribute change that \"contains\" remove change.\n // Attribute change needs to be split.\n const howMany = old.howMany;\n old.howMany = inc.offset - old.offset;\n const howManyAfter = howMany - old.howMany - inc.nodesToHandle;\n // Add the second part of attribute change to the beginning of processed array so it won't\n // be processed again in this loop.\n changes.unshift({\n type: 'attribute',\n offset: inc.offset,\n howMany: howManyAfter,\n count: this._changeCount++\n });\n }\n else {\n old.howMany -= oldEnd - inc.offset;\n }\n }\n }\n }\n if (inc.type == 'attribute') {\n // In case of attribute change, `howMany` should be kept same as `nodesToHandle`. It's not an error.\n if (old.type == 'insert') {\n if (inc.offset < old.offset && incEnd > old.offset) {\n if (incEnd > oldEnd) {\n // This case is similar to a case described when incoming change was insert and old change was attribute.\n // See comment above.\n //\n // This time incoming change is attribute. We need to split incoming change in this case too.\n // However this time, the second part of the attribute change needs to be processed further\n // because there might be other changes that it collides with.\n const attributePart = {\n type: 'attribute',\n offset: oldEnd,\n howMany: incEnd - oldEnd,\n count: this._changeCount++\n };\n this._handleChange(attributePart, changes);\n changes.push(attributePart);\n }\n inc.nodesToHandle = old.offset - inc.offset;\n inc.howMany = inc.nodesToHandle;\n }\n else if (inc.offset >= old.offset && inc.offset < oldEnd) {\n if (incEnd > oldEnd) {\n inc.nodesToHandle = incEnd - oldEnd;\n inc.offset = oldEnd;\n }\n else {\n inc.nodesToHandle = 0;\n }\n }\n }\n if (old.type == 'remove') {\n // This is a case when attribute change \"contains\" remove change.\n // The attribute change needs to be split into two because changes cannot intersect.\n if (inc.offset < old.offset && incEnd > old.offset) {\n const attributePart = {\n type: 'attribute',\n offset: old.offset,\n howMany: incEnd - old.offset,\n count: this._changeCount++\n };\n this._handleChange(attributePart, changes);\n changes.push(attributePart);\n inc.nodesToHandle = old.offset - inc.offset;\n inc.howMany = inc.nodesToHandle;\n }\n }\n if (old.type == 'attribute') {\n // There are only two conflicting scenarios possible here:\n if (inc.offset >= old.offset && incEnd <= oldEnd) {\n // `old` change includes `inc` change, or they are the same.\n inc.nodesToHandle = 0;\n inc.howMany = 0;\n inc.offset = 0;\n }\n else if (inc.offset <= old.offset && incEnd >= oldEnd) {\n // `inc` change includes `old` change.\n old.howMany = 0;\n }\n }\n }\n }\n inc.howMany = inc.nodesToHandle;\n delete inc.nodesToHandle;\n }\n /**\n * Returns an object with a single insert change description.\n *\n * @param parent The element in which the change happened.\n * @param offset The offset at which change happened.\n * @param action Further specifies what kind of action led to generating this change.\n * @param elementSnapshot Snapshot of the inserted node after changes.\n * @param elementSnapshotBefore Snapshot of the inserted node before changes.\n * @returns The diff item.\n */\n _getInsertDiff(parent, offset, action, elementSnapshot, elementSnapshotBefore) {\n const diffItem = {\n type: 'insert',\n position: Position._createAt(parent, offset),\n name: elementSnapshot.name,\n attributes: new Map(elementSnapshot.attributes),\n length: 1,\n changeCount: this._changeCount++,\n action\n };\n if (action != 'insert' && elementSnapshotBefore) {\n diffItem.before = {\n name: elementSnapshotBefore.name,\n attributes: new Map(elementSnapshotBefore.attributes)\n };\n }\n return diffItem;\n }\n /**\n * Returns an object with a single remove change description.\n *\n * @param parent The element in which change happened.\n * @param offset The offset at which change happened.\n * @param action Further specifies what kind of action led to generating this change.\n * @param elementSnapshot The snapshot of the removed node before changes.\n * @returns The diff item.\n */\n _getRemoveDiff(parent, offset, action, elementSnapshot) {\n return {\n type: 'remove',\n action,\n position: Position._createAt(parent, offset),\n name: elementSnapshot.name,\n attributes: new Map(elementSnapshot.attributes),\n length: 1,\n changeCount: this._changeCount++\n };\n }\n /**\n * Returns an array of objects where each one is a single attribute change description.\n *\n * @param range The range where the change happened.\n * @param oldAttributes A map, map iterator or compatible object that contains attributes before the change.\n * @param newAttributes A map, map iterator or compatible object that contains attributes after the change.\n * @returns An array containing one or more diff items.\n */\n _getAttributesDiff(range, oldAttributes, newAttributes) {\n // Results holder.\n const diffs = [];\n // Clone new attributes as we will be performing changes on this object.\n newAttributes = new Map(newAttributes);\n // Look through old attributes.\n for (const [key, oldValue] of oldAttributes) {\n // Check what is the new value of the attribute (or if it was removed).\n const newValue = newAttributes.has(key) ? newAttributes.get(key) : null;\n // If values are different (or attribute was removed)...\n if (newValue !== oldValue) {\n // Add diff item.\n diffs.push({\n type: 'attribute',\n position: range.start,\n range: range.clone(),\n length: 1,\n attributeKey: key,\n attributeOldValue: oldValue,\n attributeNewValue: newValue,\n changeCount: this._changeCount++\n });\n }\n // Prevent returning two diff items for the same change.\n newAttributes.delete(key);\n }\n // Look through new attributes that weren't handled above.\n for (const [key, newValue] of newAttributes) {\n // Each of them is a new attribute. Add diff item.\n diffs.push({\n type: 'attribute',\n position: range.start,\n range: range.clone(),\n length: 1,\n attributeKey: key,\n attributeOldValue: null,\n attributeNewValue: newValue,\n changeCount: this._changeCount++\n });\n }\n return diffs;\n }\n /**\n * Checks whether given element or any of its parents is an element that is buffered as an inserted element.\n */\n _isInInsertedElement(element) {\n const parent = element.parent;\n if (!parent) {\n return false;\n }\n const changes = this._changesInElement.get(parent);\n const offset = element.startOffset;\n if (changes) {\n for (const change of changes) {\n if (change.type == 'insert' && offset >= change.offset && offset < change.offset + change.howMany) {\n return true;\n }\n }\n }\n return this._isInInsertedElement(parent);\n }\n /**\n * Removes deeply all buffered changes that are registered in elements from range specified by `parent`, `offset`\n * and `howMany`.\n */\n _removeAllNestedChanges(parent, offset, howMany) {\n const range = new Range(Position._createAt(parent, offset), Position._createAt(parent, offset + howMany));\n for (const item of range.getItems({ shallow: true })) {\n if (item.is('element')) {\n this._changesInElement.delete(item);\n this._removeAllNestedChanges(item, 0, item.maxOffset);\n }\n }\n }\n}\n/**\n * Priority of the {@link ~Differ#_elementState element states}. States on higher indexes of the array can overwrite states on the lower\n * indexes.\n */\nDiffer._statesPriority = [undefined, 'refresh', 'rename', 'move'];\nexport default Differ;\n/**\n * Returns a snapshot for the specified child node. Text node snapshots have the `name` property set to `$text`.\n */\nfunction _getSingleNodeSnapshot(node) {\n return {\n node,\n name: node.is('$text') ? '$text' : node.name,\n attributes: new Map(node.getAttributes())\n };\n}\n/**\n * Returns an array that is a copy of passed child list with the exception that text nodes are split to one or more\n * objects, each representing one character and attributes set on that character.\n */\nfunction _getChildrenSnapshots(children) {\n const snapshots = [];\n for (const child of children) {\n if (child.is('$text')) {\n for (let i = 0; i < child.data.length; ++i) {\n snapshots.push(_getSingleNodeSnapshot(child));\n }\n }\n else {\n snapshots.push(_getSingleNodeSnapshot(child));\n }\n }\n return snapshots;\n}\n/**\n * Generates array of diff instructions for given changes set.\n *\n * Generated actions are:\n *\n * - 'e' for 'equal' - when item at that position did not change,\n * - 'i' for 'insert' - when item at that position was inserted,\n * - 'r' for 'remove' - when item at that position was removed,\n * - 'a' for 'attribute' - when item at that position has it attributes changed.\n *\n * Example (assume that uppercase letters have bold attribute, compare with function code):\n *\n * children before:\tfooBAR\n * children after:\tfoxybAR\n *\n * changes: type: remove, offset: 1, howMany: 1\n *\t\t\ttype: insert, offset: 2, howMany: 2\n *\t\t\ttype: attribute, offset: 4, howMany: 1\n *\n * Expected actions: equal (f), remove (o), equal (o), insert (x), insert (y), attribute (b), equal (A), equal (R)\n *\n * Steps taken by the script:\n *\n * 1. change = \"type: remove, offset: 1, howMany: 1\"; offset = 0; oldChildrenHandled = 0\n * 1.1 between this change and the beginning is one not-changed node, fill with one equal action, one old child has been handled\n * 1.2 this change removes one node, add one remove action\n * 1.3 change last visited `offset` to 1\n * 1.4 since an old child has been removed, one more old child has been handled\n * 1.5 actions at this point are: equal, remove\n *\n * 2. change = \"type: insert, offset: 2, howMany: 2\"; offset = 1; oldChildrenHandled = 2\n * 2.1 between this change and previous change is one not-changed node, add equal action, another one old children has been handled\n * 2.2 this change inserts two nodes, add two insert actions\n * 2.3 change last visited offset to the end of the inserted range, that is 4\n * 2.4 actions at this point are: equal, remove, equal, insert, insert\n *\n * 3. change = \"type: attribute, offset: 4, howMany: 1\"; offset = 4, oldChildrenHandled = 3\n * 3.1 between this change and previous change are no not-changed nodes\n * 3.2 this change changes one node, add one attribute action\n * 3.3 change last visited `offset` to the end of change range, that is 5\n * 3.4 since an old child has been changed, one more old child has been handled\n * 3.5 actions at this point are: equal, remove, equal, insert, insert, attribute\n *\n * 4. after loop oldChildrenHandled = 4, oldChildrenLength = 6 (fooBAR is 6 characters)\n * 4.1 fill up with two equal actions\n *\n * The result actions are: equal, remove, equal, insert, insert, attribute, equal, equal.\n */\nfunction _generateDiffInstructionsFromChanges(oldChildrenLength, changes) {\n const diff = [];\n let offset = 0;\n let oldChildrenHandled = 0;\n // Go through all buffered changes.\n for (const change of changes) {\n // First, fill \"holes\" between changes with \"equal\" actions.\n if (change.offset > offset) {\n for (let i = 0; i < change.offset - offset; i++) {\n diff.push('e');\n }\n oldChildrenHandled += change.offset - offset;\n }\n // Then, fill up actions accordingly to change type.\n if (change.type == 'insert') {\n for (let i = 0; i < change.howMany; i++) {\n diff.push('i');\n }\n // The last handled offset is after inserted range.\n offset = change.offset + change.howMany;\n }\n else if (change.type == 'remove') {\n for (let i = 0; i < change.howMany; i++) {\n diff.push('r');\n }\n // The last handled offset is at the position where the nodes were removed.\n offset = change.offset;\n // We removed `howMany` old nodes, update `oldChildrenHandled`.\n oldChildrenHandled += change.howMany;\n }\n else {\n diff.push(...'a'.repeat(change.howMany).split(''));\n // The last handled offset is at the position after the changed range.\n offset = change.offset + change.howMany;\n // We changed `howMany` old nodes, update `oldChildrenHandled`.\n oldChildrenHandled += change.howMany;\n }\n }\n // Fill \"equal\" actions at the end of actions set. Use `oldChildrenHandled` to see how many children\n // has not been changed / removed at the end of their parent.\n if (oldChildrenHandled < oldChildrenLength) {\n for (let i = 0; i < oldChildrenLength - oldChildrenHandled - offset; i++) {\n diff.push('e');\n }\n }\n return diff;\n}\n/**\n * Filter callback for `Array.filter` that filters out change entries that are in graveyard.\n */\nfunction _changesInGraveyardFilter(entry) {\n const posInGy = 'position' in entry && entry.position.root.rootName == '$graveyard';\n const rangeInGy = 'range' in entry && entry.range.root.rootName == '$graveyard';\n return !posInGy && !rangeInGy;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * @module engine/model/history\n */\n/**\n * `History` keeps the track of all the operations applied to the {@link module:engine/model/document~Document document}.\n */\nexport default class History {\n constructor() {\n /**\n * Operations added to the history.\n */\n this._operations = [];\n /**\n * Holds an information which {@link module:engine/model/operation/operation~Operation operation} undoes which\n * {@link module:engine/model/operation/operation~Operation operation}.\n *\n * Keys of the map are \"undoing operations\", that is operations that undone some other operations. For each key, the\n * value is an operation that has been undone by the \"undoing operation\".\n */\n this._undoPairs = new Map();\n /**\n * Holds all undone operations.\n */\n this._undoneOperations = new Set();\n /**\n * A map that allows retrieving the operations fast based on the given base version.\n */\n this._baseVersionToOperationIndex = new Map();\n /**\n * The history version.\n */\n this._version = 0;\n /**\n * The gap pairs kept in the <from,to> format.\n *\n * Anytime the `history.version` is set to a version larger than `history.version + 1`,\n * a new <lastHistoryVersion, newHistoryVersion> entry is added to the map.\n */\n this._gaps = new Map();\n }\n /**\n * The version of the last operation in the history.\n *\n * The history version is incremented automatically when a new operation is added to the history.\n * Setting the version manually should be done only in rare circumstances when a gap is planned\n * between history versions. When doing so, a gap will be created and the history will accept adding\n * an operation with base version equal to the new history version.\n */\n get version() {\n return this._version;\n }\n set version(version) {\n // Store a gap if there are some operations already in the history and the\n // new version does not increment the latest one.\n if (this._operations.length && version > this._version + 1) {\n this._gaps.set(this._version, version);\n }\n this._version = version;\n }\n /**\n * The last history operation.\n */\n get lastOperation() {\n return this._operations[this._operations.length - 1];\n }\n /**\n * Adds an operation to the history and increments the history version.\n *\n * The operation's base version should be equal to the history version. Otherwise an error is thrown.\n */\n addOperation(operation) {\n if (operation.baseVersion !== this.version) {\n /**\n * Only operations with matching versions can be added to the history.\n *\n * @error model-document-history-addoperation-incorrect-version\n * @param errorData The operation and the current document history version.\n */\n throw new CKEditorError('model-document-history-addoperation-incorrect-version', this, {\n operation,\n historyVersion: this.version\n });\n }\n this._operations.push(operation);\n this._version++;\n this._baseVersionToOperationIndex.set(operation.baseVersion, this._operations.length - 1);\n }\n /**\n * Returns operations from the given range of operation base versions that were added to the history.\n *\n * Note that there may be gaps in operations base versions.\n *\n * @param fromBaseVersion Base version from which operations should be returned (inclusive).\n * @param toBaseVersion Base version up to which operations should be returned (exclusive).\n * @returns History operations for the given range, in chronological order.\n */\n getOperations(fromBaseVersion, toBaseVersion = this.version) {\n // When there is no operation in the history, return an empty array.\n // After that we can be sure that `firstOperation`, `lastOperation` are not nullish.\n if (!this._operations.length) {\n return [];\n }\n const firstOperation = this._operations[0];\n if (fromBaseVersion === undefined) {\n fromBaseVersion = firstOperation.baseVersion;\n }\n // Change exclusive `toBaseVersion` to inclusive, so it will refer to the actual index.\n // Thanks to that mapping from base versions to operation indexes are possible.\n let inclusiveTo = toBaseVersion - 1;\n // Check if \"from\" or \"to\" point to a gap between versions.\n // If yes, then change the incorrect position to the proper side of the gap.\n // Thanks to it, it will be possible to get index of the operation.\n for (const [gapFrom, gapTo] of this._gaps) {\n if (fromBaseVersion > gapFrom && fromBaseVersion < gapTo) {\n fromBaseVersion = gapTo;\n }\n if (inclusiveTo > gapFrom && inclusiveTo < gapTo) {\n inclusiveTo = gapFrom - 1;\n }\n }\n // If the whole range is outside of the operation versions, then return an empty array.\n if (inclusiveTo < firstOperation.baseVersion || fromBaseVersion > this.lastOperation.baseVersion) {\n return [];\n }\n let fromIndex = this._baseVersionToOperationIndex.get(fromBaseVersion);\n // If the range starts before the first operation, then use the first operation as the range's start.\n if (fromIndex === undefined) {\n fromIndex = 0;\n }\n let toIndex = this._baseVersionToOperationIndex.get(inclusiveTo);\n // If the range ends after the last operation, then use the last operation as the range's end.\n if (toIndex === undefined) {\n toIndex = this._operations.length - 1;\n }\n // Return the part of the history operations based on the calculated start index and end index.\n return this._operations.slice(fromIndex, \n // The `toIndex` should be included in the returned operations, so add `1`.\n toIndex + 1);\n }\n /**\n * Returns operation from the history that bases on given `baseVersion`.\n *\n * @param baseVersion Base version of the operation to get.\n * @returns Operation with given base version or `undefined` if there is no such operation in history.\n */\n getOperation(baseVersion) {\n const operationIndex = this._baseVersionToOperationIndex.get(baseVersion);\n if (operationIndex === undefined) {\n return;\n }\n return this._operations[operationIndex];\n }\n /**\n * Marks in history that one operation is an operation that is undoing the other operation. By marking operation this way,\n * history is keeping more context information about operations, which helps in operational transformation.\n *\n * @param undoneOperation Operation which is undone by `undoingOperation`.\n * @param undoingOperation Operation which undoes `undoneOperation`.\n */\n setOperationAsUndone(undoneOperation, undoingOperation) {\n this._undoPairs.set(undoingOperation, undoneOperation);\n this._undoneOperations.add(undoneOperation);\n }\n /**\n * Checks whether given `operation` is undoing any other operation.\n *\n * @param operation Operation to check.\n * @returns `true` if given `operation` is undoing any other operation, `false` otherwise.\n */\n isUndoingOperation(operation) {\n return this._undoPairs.has(operation);\n }\n /**\n * Checks whether given `operation` has been undone by any other operation.\n *\n * @param operation Operation to check.\n * @returns `true` if given `operation` has been undone any other operation, `false` otherwise.\n */\n isUndoneOperation(operation) {\n return this._undoneOperations.has(operation);\n }\n /**\n * For given `undoingOperation`, returns the operation which has been undone by it.\n *\n * @returns Operation that has been undone by given `undoingOperation` or `undefined`\n * if given `undoingOperation` is not undoing any other operation.\n */\n getUndoneOperation(undoingOperation) {\n return this._undoPairs.get(undoingOperation);\n }\n /**\n * Resets the history of operations.\n */\n reset() {\n this._version = 0;\n this._undoPairs = new Map();\n this._operations = [];\n this._undoneOperations = new Set();\n this._gaps = new Map();\n this._baseVersionToOperationIndex = new Map();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/rootelement\n */\nimport Element from './element.js';\n/**\n * Type of {@link module:engine/model/element~Element} that is a root of a model tree.\n */\nexport default class RootElement extends Element {\n /**\n * Creates root element.\n *\n * @param document Document that is an owner of this root.\n * @param name Node name.\n * @param rootName Unique root name used to identify this root element by {@link module:engine/model/document~Document}.\n */\n constructor(document, name, rootName = 'main') {\n super(name);\n /**\n * @internal\n */\n this._isAttached = true;\n /**\n * Informs if the root element is loaded (default).\n *\n * @internal\n */\n this._isLoaded = true;\n this._document = document;\n this.rootName = rootName;\n }\n /**\n * {@link module:engine/model/document~Document Document} that owns this root element.\n */\n get document() {\n return this._document;\n }\n /**\n * Informs if the root element is currently attached to the document, or not.\n *\n * A detached root is equivalent to being removed and cannot contain any children or markers.\n *\n * By default, a newly added root is attached. It can be detached using\n * {@link module:engine/model/writer~Writer#detachRoot `Writer#detachRoot`}. A detached root can be re-attached again using\n * {@link module:engine/model/writer~Writer#addRoot `Writer#addRoot`}.\n */\n isAttached() {\n return this._isAttached;\n }\n /**\n * Converts `RootElement` instance to `string` containing its name.\n *\n * @returns `RootElement` instance converted to `string`.\n */\n toJSON() {\n return this.rootName;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRootElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'rootElement' || type === 'model:rootElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'model:element' ||\n type === 'node' || type === 'model:node';\n }\n return name === this.name && (type === 'rootElement' || type === 'model:rootElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'model:element');\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/document\n */\nimport Differ from './differ.js';\nimport DocumentSelection from './documentselection.js';\nimport History from './history.js';\nimport RootElement from './rootelement.js';\nimport { CKEditorError, Collection, EmitterMixin, isInsideSurrogatePair, isInsideCombinedSymbol } from '@ckeditor/ckeditor5-utils';\nimport { clone } from 'lodash-es';\n// @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );\nconst graveyardName = '$graveyard';\n/**\n * Data model's document. It contains the model's structure, its selection and the history of changes.\n *\n * Read more about working with the model in\n * {@glink framework/architecture/editing-engine#model introduction to the the editing engine's architecture}.\n *\n * Usually, the document contains just one {@link module:engine/model/document~Document#roots root element}, so\n * you can retrieve it by just calling {@link module:engine/model/document~Document#getRoot} without specifying its name:\n *\n * ```ts\n * model.document.getRoot(); // -> returns the main root\n * ```\n *\n * However, the document may contain multiple roots – e.g. when the editor has multiple editable areas\n * (e.g. a title and a body of a message).\n */\nexport default class Document extends /* #__PURE__ */ EmitterMixin() {\n /**\n * Creates an empty document instance with no {@link #roots} (other than\n * the {@link #graveyard graveyard root}).\n */\n constructor(model) {\n super();\n this.model = model;\n this.history = new History();\n this.selection = new DocumentSelection(this);\n this.roots = new Collection({ idProperty: 'rootName' });\n this.differ = new Differ(model.markers);\n this.isReadOnly = false;\n this._postFixers = new Set();\n this._hasSelectionChangedFromTheLastChangeBlock = false;\n // Graveyard tree root. Document always have a graveyard root, which stores removed nodes.\n this.createRoot('$root', graveyardName);\n // Then, still before an operation is applied on model, buffer the change in differ.\n this.listenTo(model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n if (operation.isDocumentOperation) {\n this.differ.bufferOperation(operation);\n }\n }, { priority: 'high' });\n // After the operation is applied, bump document's version and add the operation to the history.\n this.listenTo(model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n if (operation.isDocumentOperation) {\n this.history.addOperation(operation);\n }\n }, { priority: 'low' });\n // Listen to selection changes. If selection changed, mark it.\n this.listenTo(this.selection, 'change', () => {\n this._hasSelectionChangedFromTheLastChangeBlock = true;\n });\n // Buffer marker changes.\n // This is not covered in buffering operations because markers may change outside of them (when they\n // are modified using `model.markers` collection, not through `MarkerOperation`).\n this.listenTo(model.markers, 'update', (evt, marker, oldRange, newRange, oldMarkerData) => {\n // Copy the `newRange` to the new marker data as during the marker removal the range is not updated.\n const newMarkerData = { ...marker.getData(), range: newRange };\n // Whenever marker is updated, buffer that change.\n this.differ.bufferMarkerChange(marker.name, oldMarkerData, newMarkerData);\n if (oldRange === null) {\n // If this is a new marker, add a listener that will buffer change whenever marker changes.\n marker.on('change', (evt, oldRange) => {\n const markerData = marker.getData();\n this.differ.bufferMarkerChange(marker.name, { ...markerData, range: oldRange }, markerData);\n });\n }\n });\n // This is a solution for a problem that may occur during real-time editing. If one client detached a root and another added\n // something there at the same moment, the OT does not solve this problem currently. In such situation, the added elements would\n // stay in the detached root.\n //\n // This is incorrect, a detached root should be empty and all elements from it should be removed. To solve this, the post-fixer will\n // remove any element that is left in a detached root.\n //\n // Similarly, markers that are created at the beginning or at the end of the detached root will not be removed as well.\n //\n // The drawback of this solution over the OT solution is that the elements removed by the post-fixer will never be brought back.\n // If the root detachment gets undone (and the root is brought back), the removed elements will not be there.\n this.registerPostFixer(writer => {\n let result = false;\n for (const root of this.roots) {\n if (!root.isAttached() && !root.isEmpty) {\n writer.remove(writer.createRangeIn(root));\n result = true;\n }\n }\n for (const marker of this.model.markers) {\n if (!marker.getRange().root.isAttached()) {\n writer.removeMarker(marker);\n result = true;\n }\n }\n return result;\n });\n }\n /**\n * The document version. Every applied operation increases the version number. It is used to\n * ensure that operations are applied on a proper document version.\n *\n * This property is equal to {@link module:engine/model/history~History#version `model.Document#history#version`}.\n *\n * If the {@link module:engine/model/operation/operation~Operation#baseVersion base version} does not match the document version,\n * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyoperation-wrong-version} error is thrown.\n */\n get version() {\n return this.history.version;\n }\n set version(version) {\n this.history.version = version;\n }\n /**\n * The graveyard tree root. A document always has a graveyard root that stores removed nodes.\n */\n get graveyard() {\n return this.getRoot(graveyardName);\n }\n /**\n * Creates a new root.\n *\n * **Note:** do not use this method after the editor has been initialized! If you want to dynamically add a root, use\n * {@link module:engine/model/writer~Writer#addRoot `model.Writer#addRoot`} instead.\n *\n * @param elementName The element name. Defaults to `'$root'` which also has some basic schema defined\n * (e.g. `$block` elements are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.\n * @param rootName A unique root name.\n * @returns The created root.\n */\n createRoot(elementName = '$root', rootName = 'main') {\n if (this.roots.get(rootName)) {\n /**\n * A root with the specified name already exists.\n *\n * @error model-document-createroot-name-exists\n */\n throw new CKEditorError('model-document-createroot-name-exists', this, { name: rootName });\n }\n const root = new RootElement(this, elementName, rootName);\n this.roots.add(root);\n return root;\n }\n /**\n * Removes all event listeners set by the document instance.\n */\n destroy() {\n this.selection.destroy();\n this.stopListening();\n }\n /**\n * Returns a root by its name.\n *\n * Detached roots are returned by this method. This is to be able to operate on the detached root (for example, to be able to create\n * a position inside such a root for undo feature purposes).\n *\n * @param name The root name of the root to return.\n * @returns The root registered under a given name or `null` when there is no root with the given name.\n */\n getRoot(name = 'main') {\n return this.roots.get(name);\n }\n /**\n * Returns an array with names of all roots added to the document (except the {@link #graveyard graveyard root}).\n *\n * Detached roots **are not** returned by this method by default. This is to make sure that all features or algorithms that operate\n * on the document data know which roots are still a part of the document and should be processed.\n *\n * @param includeDetached Specified whether detached roots should be returned as well.\n */\n getRootNames(includeDetached = false) {\n return this.getRoots(includeDetached).map(root => root.rootName);\n }\n /**\n * Returns an array with all roots added to the document (except the {@link #graveyard graveyard root}).\n *\n * Detached roots **are not** returned by this method by default. This is to make sure that all features or algorithms that operate\n * on the document data know which roots are still a part of the document and should be processed.\n *\n * @param includeDetached Specified whether detached roots should be returned as well.\n */\n getRoots(includeDetached = false) {\n return this.roots.filter(root => root != this.graveyard && (includeDetached || root.isAttached()) && root._isLoaded);\n }\n /**\n * Used to register a post-fixer callback. A post-fixer mechanism guarantees that the features\n * will operate on a correct model state.\n *\n * An execution of a feature may lead to an incorrect document tree state. The callbacks are used to fix the document tree after\n * it has changed. Post-fixers are fired just after all changes from the outermost change block were applied but\n * before the {@link module:engine/model/document~Document#event:change change event} is fired. If a post-fixer callback made\n * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should\n * not be fixed in the new document tree state.\n *\n * As a parameter, a post-fixer callback receives a {@link module:engine/model/writer~Writer writer} instance connected with the\n * executed changes block. Thanks to that, all changes done by the callback will be added to the same\n * {@link module:engine/model/batch~Batch batch} (and undo step) as the original changes. This makes post-fixer changes transparent\n * for the user.\n *\n * An example of a post-fixer is a callback that checks if all the data were removed from the editor. If so, the\n * callback should add an empty paragraph so that the editor is never empty:\n *\n * ```ts\n * document.registerPostFixer( writer => {\n * \tconst changes = document.differ.getChanges();\n *\n * \t// Check if the changes lead to an empty root in the editor.\n * \tfor ( const entry of changes ) {\n * \t\tif ( entry.type == 'remove' && entry.position.root.isEmpty ) {\n * \t\t\twriter.insertElement( 'paragraph', entry.position.root, 0 );\n *\n * \t\t\t// It is fine to return early, even if multiple roots would need to be fixed.\n * \t\t\t// All post-fixers will be fired again, so if there are more empty roots, those will be fixed, too.\n * \t\t\treturn true;\n * \t\t}\n * \t}\n *\n * \treturn false;\n * } );\n * ```\n */\n registerPostFixer(postFixer) {\n this._postFixers.add(postFixer);\n }\n /**\n * A custom `toJSON()` method to solve child-parent circular dependencies.\n *\n * @returns A clone of this object with the document property changed to a string.\n */\n toJSON() {\n const json = clone(this);\n // Due to circular references we need to remove parent reference.\n json.selection = '[engine.model.DocumentSelection]';\n json.model = '[engine.model.Model]';\n return json;\n }\n /**\n * Check if there were any changes done on document, and if so, call post-fixers,\n * fire `change` event for features and conversion and then reset the differ.\n * Fire `change:data` event when at least one operation or buffered marker changes the data.\n *\n * @internal\n * @fires change\n * @fires change:data\n * @param writer The writer on which post-fixers will be called.\n */\n _handleChangeBlock(writer) {\n if (this._hasDocumentChangedFromTheLastChangeBlock()) {\n this._callPostFixers(writer);\n // Refresh selection attributes according to the final position in the model after the change.\n this.selection.refresh();\n if (this.differ.hasDataChanges()) {\n this.fire('change:data', writer.batch);\n }\n else {\n this.fire('change', writer.batch);\n }\n // Theoretically, it is not necessary to refresh selection after change event because\n // post-fixers are the last who should change the model, but just in case...\n this.selection.refresh();\n this.differ.reset();\n }\n this._hasSelectionChangedFromTheLastChangeBlock = false;\n }\n /**\n * Returns whether there is a buffered change or if the selection has changed from the last\n * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block}\n * or {@link module:engine/model/model~Model#change `change()` block}.\n *\n * @returns Returns `true` if document has changed from the last `change()` or `enqueueChange()` block.\n */\n _hasDocumentChangedFromTheLastChangeBlock() {\n return !this.differ.isEmpty || this._hasSelectionChangedFromTheLastChangeBlock;\n }\n /**\n * Returns the default root for this document which is either the first root that was added to the document using\n * {@link #createRoot} or the {@link #graveyard graveyard root} if no other roots were created.\n *\n * @returns The default root for this document.\n */\n _getDefaultRoot() {\n const roots = this.getRoots();\n return roots.length ? roots[0] : this.graveyard;\n }\n /**\n * Returns the default range for this selection. The default range is a collapsed range that starts and ends\n * at the beginning of this selection's document {@link #_getDefaultRoot default root}.\n *\n * @internal\n */\n _getDefaultRange() {\n const defaultRoot = this._getDefaultRoot();\n const model = this.model;\n const schema = model.schema;\n // Find the first position where the selection can be put.\n const position = model.createPositionFromPath(defaultRoot, [0]);\n const nearestRange = schema.getNearestSelectionRange(position);\n // If valid selection range is not found - return range collapsed at the beginning of the root.\n return nearestRange || model.createRange(position);\n }\n /**\n * Checks whether a given {@link module:engine/model/range~Range range} is a valid range for\n * the {@link #selection document's selection}.\n *\n * @internal\n * @param range A range to check.\n * @returns `true` if `range` is valid, `false` otherwise.\n */\n _validateSelectionRange(range) {\n return validateTextNodePosition(range.start) && validateTextNodePosition(range.end);\n }\n /**\n * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.\n *\n * @param writer The writer on which post-fixer callbacks will be called.\n */\n _callPostFixers(writer) {\n let wasFixed = false;\n do {\n for (const callback of this._postFixers) {\n // Ensure selection attributes are up to date before each post-fixer.\n // https://github.com/ckeditor/ckeditor5-engine/issues/1673.\n //\n // It might be good to refresh the selection after each operation but at the moment it leads\n // to losing attributes for composition or and spell checking\n // https://github.com/ckeditor/ckeditor5-typing/issues/188\n this.selection.refresh();\n wasFixed = callback(writer);\n if (wasFixed) {\n break;\n }\n }\n } while (wasFixed);\n }\n}\n/**\n * Checks whether given range boundary position is valid for document selection, meaning that is not between\n * unicode surrogate pairs or base character and combining marks.\n */\nfunction validateTextNodePosition(rangeBoundary) {\n const textNode = rangeBoundary.textNode;\n if (textNode) {\n const data = textNode.data;\n const offset = rangeBoundary.offset - textNode.startOffset;\n return !isInsideSurrogatePair(data, offset) && !isInsideCombinedSymbol(data, offset);\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/markercollection\n */\nimport TypeCheckable from './typecheckable.js';\nimport LiveRange from './liverange.js';\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.\n * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using\n * {@link module:engine/model/markercollection~MarkerCollection#event:update} event.\n *\n * To create, change or remove makers use {@link module:engine/model/writer~Writer model writers'} methods:\n * {@link module:engine/model/writer~Writer#addMarker} or {@link module:engine/model/writer~Writer#removeMarker}. Since\n * the writer is the only proper way to change the data model it is not possible to change markers directly using this\n * collection. All markers created by the writer will be automatically added to this collection.\n *\n * By default there is one marker collection available as {@link module:engine/model/model~Model#markers model property}.\n *\n * @see module:engine/model/markercollection~Marker\n */\nexport default class MarkerCollection extends /* #__PURE__ */ EmitterMixin() {\n constructor() {\n super(...arguments);\n /**\n * Stores {@link ~Marker markers} added to the collection.\n */\n this._markers = new Map();\n }\n /**\n * Iterable interface.\n *\n * Iterates over all {@link ~Marker markers} added to the collection.\n */\n [Symbol.iterator]() {\n return this._markers.values();\n }\n /**\n * Checks if given {@link ~Marker marker} or marker name is in the collection.\n *\n * @param markerOrName Name of marker or marker instance to check.\n * @returns `true` if marker is in the collection, `false` otherwise.\n */\n has(markerOrName) {\n const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n return this._markers.has(markerName);\n }\n /**\n * Returns {@link ~Marker marker} with given `markerName`.\n *\n * @param markerName Name of marker to get.\n * @returns Marker with given name or `null` if such marker was\n * not added to the collection.\n */\n get(markerName) {\n return this._markers.get(markerName) || null;\n }\n /**\n * Creates and adds a {@link ~Marker marker} to the `MarkerCollection` with given name on given\n * {@link module:engine/model/range~Range range}.\n *\n * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in\n * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired\n * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}\n * flag has changed.\n *\n * @internal\n * @fires update\n * @param markerOrName Name of marker to set or marker instance to update.\n * @param range Marker range.\n * @param managedUsingOperations Specifies whether the marker is managed using operations.\n * @param affectsData Specifies whether the marker affects the data produced by the data pipeline\n * (is persisted in the editor's data).\n * @returns `Marker` instance which was added or updated.\n */\n _set(markerOrName, range, managedUsingOperations = false, affectsData = false) {\n const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n if (markerName.includes(',')) {\n /**\n * Marker name cannot contain the \",\" character.\n *\n * @error markercollection-incorrect-marker-name\n */\n throw new CKEditorError('markercollection-incorrect-marker-name', this);\n }\n const oldMarker = this._markers.get(markerName);\n if (oldMarker) {\n const oldMarkerData = oldMarker.getData();\n const oldRange = oldMarker.getRange();\n let hasChanged = false;\n if (!oldRange.isEqual(range)) {\n oldMarker._attachLiveRange(LiveRange.fromRange(range));\n hasChanged = true;\n }\n if (managedUsingOperations != oldMarker.managedUsingOperations) {\n oldMarker._managedUsingOperations = managedUsingOperations;\n hasChanged = true;\n }\n if (typeof affectsData === 'boolean' && affectsData != oldMarker.affectsData) {\n oldMarker._affectsData = affectsData;\n hasChanged = true;\n }\n if (hasChanged) {\n this.fire(`update:${markerName}`, oldMarker, oldRange, range, oldMarkerData);\n }\n return oldMarker;\n }\n const liveRange = LiveRange.fromRange(range);\n const marker = new Marker(markerName, liveRange, managedUsingOperations, affectsData);\n this._markers.set(markerName, marker);\n this.fire(`update:${markerName}`, marker, null, range, { ...marker.getData(), range: null });\n return marker;\n }\n /**\n * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.\n *\n * @internal\n * @fires update\n * @param markerOrName Marker or name of a marker to remove.\n * @returns `true` if marker was found and removed, `false` otherwise.\n */\n _remove(markerOrName) {\n const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n const oldMarker = this._markers.get(markerName);\n if (oldMarker) {\n this._markers.delete(markerName);\n this.fire(`update:${markerName}`, oldMarker, oldMarker.getRange(), null, oldMarker.getData());\n this._destroyMarker(oldMarker);\n return true;\n }\n return false;\n }\n /**\n * Fires an {@link module:engine/model/markercollection~MarkerCollection#event:update} event for the given {@link ~Marker marker}\n * but does not change the marker. Useful to force {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast\n * conversion} for the marker.\n *\n * @internal\n * @fires update\n * @param markerOrName Marker or name of a marker to refresh.\n */\n _refresh(markerOrName) {\n const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n const marker = this._markers.get(markerName);\n if (!marker) {\n /**\n * Marker with provided name does not exists.\n *\n * @error markercollection-refresh-marker-not-exists\n */\n throw new CKEditorError('markercollection-refresh-marker-not-exists', this);\n }\n const range = marker.getRange();\n this.fire(`update:${markerName}`, marker, range, range, marker.getData());\n }\n /**\n * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.\n */\n *getMarkersAtPosition(position) {\n for (const marker of this) {\n if (marker.getRange().containsPosition(position)) {\n yield marker;\n }\n }\n }\n /**\n * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.\n */\n *getMarkersIntersectingRange(range) {\n for (const marker of this) {\n if (marker.getRange().getIntersection(range) !== null) {\n yield marker;\n }\n }\n }\n /**\n * Destroys marker collection and all markers inside it.\n */\n destroy() {\n for (const marker of this._markers.values()) {\n this._destroyMarker(marker);\n }\n this._markers = null;\n this.stopListening();\n }\n /**\n * Iterates over all markers that starts with given `prefix`.\n *\n * ```ts\n * const markerFooA = markersCollection._set( 'foo:a', rangeFooA );\n * const markerFooB = markersCollection._set( 'foo:b', rangeFooB );\n * const markerBarA = markersCollection._set( 'bar:a', rangeBarA );\n * const markerFooBarA = markersCollection._set( 'foobar:a', rangeFooBarA );\n * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]\n * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []\n * ```\n */\n *getMarkersGroup(prefix) {\n for (const marker of this._markers.values()) {\n if (marker.name.startsWith(prefix + ':')) {\n yield marker;\n }\n }\n }\n /**\n * Destroys the marker.\n */\n _destroyMarker(marker) {\n marker.stopListening();\n marker._detachLiveRange();\n }\n}\n/**\n * `Marker` is a continuous part of the model (like a range), is named and represents some kind of information about the\n * marked part of the model document. In contrary to {@link module:engine/model/node~Node nodes}, which are building blocks of\n * the model document tree, markers are not stored directly in the document tree but in the\n * {@link module:engine/model/model~Model#markers model markers' collection}. Still, they are document data, by giving\n * additional meaning to the part of a model document between marker start and marker end.\n *\n * In this sense, markers are similar to adding and converting attributes on nodes. The difference is that attribute is\n * connected with a given node (e.g. a character is bold no matter if it gets moved or content around it changes).\n * Markers on the other hand are continuous ranges and are characterized by their start and end position. This means that\n * any character in the marker is marked by the marker. For example, if a character is moved outside of marker it stops being\n * \"special\" and the marker is shrunk. Similarly, when a character is moved into the marker from other place in document\n * model, it starts being \"special\" and the marker is enlarged.\n *\n * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes\n * and then trying to find that part of document would require traversing whole document tree. Marker gives instant access\n * to the range which it is marking at the moment.\n *\n * Markers are built from a name and a range.\n *\n * Range of the marker is updated automatically when document changes, using\n * {@link module:engine/model/liverange~LiveRange live range} mechanism.\n *\n * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by\n * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating\n * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in\n * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.\n * For instance: `model.markers.on( 'update:user', callback );` will be called whenever any `user:*` markers changes.\n *\n * There are two types of markers.\n *\n * 1. Markers managed directly, without using operations. They are added directly by {@link module:engine/model/writer~Writer}\n * to the {@link module:engine/model/markercollection~MarkerCollection} without any additional mechanism. They can be used\n * as bookmarks or visual markers. They are great for showing results of the find, or select link when the focus is in the input.\n *\n * 1. Markers managed using operations. These markers are also stored in {@link module:engine/model/markercollection~MarkerCollection}\n * but changes in these markers is managed the same way all other changes in the model structure - using operations.\n * Therefore, they are handled in the undo stack and synchronized between clients if the collaboration plugin is enabled.\n * This type of markers is useful for solutions like spell checking or comments.\n *\n * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}\n * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.\n *\n * ```ts\n * model.change( ( writer ) => {\n * \tconst marker = writer.addMarker( name, { range, usingOperation: true } );\n *\n * \t// ...\n *\n * \twriter.removeMarker( marker );\n * } );\n * ```\n *\n * See {@link module:engine/model/writer~Writer} to find more examples.\n *\n * Since markers need to track change in the document, for efficiency reasons, it is best to create and keep as little\n * markers as possible and remove them as soon as they are not needed anymore.\n *\n * Markers can be downcasted and upcasted.\n *\n * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.\n * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.\n * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.\n * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or\n * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.\n *\n * `Marker` instances are created and destroyed only by {@link ~MarkerCollection MarkerCollection}.\n */\nclass Marker extends /* #__PURE__ */ EmitterMixin(TypeCheckable) {\n /**\n * Creates a marker instance.\n *\n * @param name Marker name.\n * @param liveRange Range marked by the marker.\n * @param managedUsingOperations Specifies whether the marker is managed using operations.\n * @param affectsData Specifies whether the marker affects the data produced by the data pipeline (is persisted in the editor's data).\n */\n constructor(name, liveRange, managedUsingOperations, affectsData) {\n super();\n this.name = name;\n this._liveRange = this._attachLiveRange(liveRange);\n this._managedUsingOperations = managedUsingOperations;\n this._affectsData = affectsData;\n }\n /**\n * A value indicating if the marker is managed using operations.\n * See {@link ~Marker marker class description} to learn more about marker types.\n * See {@link module:engine/model/writer~Writer#addMarker}.\n */\n get managedUsingOperations() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._managedUsingOperations;\n }\n /**\n * A value indicating if the marker changes the data.\n */\n get affectsData() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._affectsData;\n }\n /**\n * Returns the marker data (properties defining the marker).\n */\n getData() {\n return {\n range: this.getRange(),\n affectsData: this.affectsData,\n managedUsingOperations: this.managedUsingOperations\n };\n }\n /**\n * Returns current marker start position.\n */\n getStart() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._liveRange.start.clone();\n }\n /**\n * Returns current marker end position.\n */\n getEnd() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._liveRange.end.clone();\n }\n /**\n * Returns a range that represents the current state of the marker.\n *\n * Keep in mind that returned value is a {@link module:engine/model/range~Range Range}, not a\n * {@link module:engine/model/liverange~LiveRange LiveRange}. This means that it is up-to-date and relevant only\n * until next model document change. Do not store values returned by this method. Instead, store {@link ~Marker#name}\n * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every\n * time there is a need to read marker properties. This will guarantee that the marker has not been removed and\n * that it's data is up-to-date.\n */\n getRange() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._liveRange.toRange();\n }\n /**\n * Binds new live range to the marker and detach the old one if is attached.\n *\n * @internal\n * @param liveRange Live range to attach\n * @returns Attached live range.\n */\n _attachLiveRange(liveRange) {\n if (this._liveRange) {\n this._detachLiveRange();\n }\n // Delegating does not work with namespaces. Alternatively, we could delegate all events (using `*`).\n liveRange.delegate('change:range').to(this);\n liveRange.delegate('change:content').to(this);\n this._liveRange = liveRange;\n return liveRange;\n }\n /**\n * Unbinds and destroys currently attached live range.\n *\n * @internal\n */\n _detachLiveRange() {\n this._liveRange.stopDelegating('change:range', this);\n this._liveRange.stopDelegating('change:content', this);\n this._liveRange.detach();\n this._liveRange = null;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nMarker.prototype.is = function (type) {\n return type === 'marker' || type === 'model:marker';\n};\n/**\n * Cannot use a {@link module:engine/model/markercollection~MarkerCollection#destroy destroyed marker} instance.\n *\n * @error marker-destroyed\n */\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/detachoperation\n */\nimport Operation from './operation.js';\nimport Range from '../range.js';\nimport { _remove } from './utils.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;\n/**\n * Operation to permanently remove node from detached root.\n * Note this operation is only a local operation and won't be send to the other clients.\n */\nexport default class DetachOperation extends Operation {\n /**\n * Creates an insert operation.\n *\n * @param sourcePosition Position before the first {@link module:engine/model/item~Item model item} to move.\n * @param howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at\n * `sourcePosition` with offset shifted by `howMany`.\n */\n constructor(sourcePosition, howMany) {\n super(null);\n this.sourcePosition = sourcePosition.clone();\n this.howMany = howMany;\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'detach';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return null;\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.sourcePosition = this.sourcePosition.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n if (this.sourcePosition.root.document) {\n /**\n * Cannot detach document node.\n *\n * @error detach-operation-on-document-node\n */\n throw new CKEditorError('detach-operation-on-document-node', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n _remove(Range._createFromPositionAndShift(this.sourcePosition, this.howMany));\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'DetachOperation';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/documentfragment\n */\nimport TypeCheckable from './typecheckable.js';\nimport Element from './element.js';\nimport NodeList from './nodelist.js';\nimport Text from './text.js';\nimport TextProxy from './textproxy.js';\nimport { isIterable } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { stringifyMap } = require( '../dev-utils/utils' );\n/**\n * DocumentFragment represents a part of model which does not have a common root but its top-level nodes\n * can be seen as siblings. In other words, it is a detached part of model tree, without a root.\n *\n * DocumentFragment has own {@link module:engine/model/markercollection~MarkerCollection}. Markers from this collection\n * will be set to the {@link module:engine/model/model~Model#markers model markers} by a\n * {@link module:engine/model/writer~Writer#insert} function.\n */\nexport default class DocumentFragment extends TypeCheckable {\n /**\n * Creates an empty `DocumentFragment`.\n *\n * **Note:** Constructor of this class shouldn't be used directly in the code.\n * Use the {@link module:engine/model/writer~Writer#createDocumentFragment} method instead.\n *\n * @internal\n * @param children Nodes to be contained inside the `DocumentFragment`.\n */\n constructor(children) {\n super();\n /**\n * DocumentFragment static markers map. This is a list of names and {@link module:engine/model/range~Range ranges}\n * which will be set as Markers to {@link module:engine/model/model~Model#markers model markers collection}\n * when DocumentFragment will be inserted to the document.\n */\n this.markers = new Map();\n /**\n * List of nodes contained inside the document fragment.\n */\n this._children = new NodeList();\n if (children) {\n this._insertChild(0, children);\n }\n }\n /**\n * Returns an iterator that iterates over all nodes contained inside this document fragment.\n */\n [Symbol.iterator]() {\n return this.getChildren();\n }\n /**\n * Number of this document fragment's children.\n */\n get childCount() {\n return this._children.length;\n }\n /**\n * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this document fragment's children.\n */\n get maxOffset() {\n return this._children.maxOffset;\n }\n /**\n * Is `true` if there are no nodes inside this document fragment, `false` otherwise.\n */\n get isEmpty() {\n return this.childCount === 0;\n }\n /**\n * Artificial next sibling. Returns `null`. Added for compatibility reasons.\n */\n get nextSibling() {\n return null;\n }\n /**\n * Artificial previous sibling. Returns `null`. Added for compatibility reasons.\n */\n get previousSibling() {\n return null;\n }\n /**\n * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.\n */\n get root() {\n return this;\n }\n /**\n * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n */\n get parent() {\n return null;\n }\n /**\n * Artificial owner of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n */\n get document() {\n return null;\n }\n /**\n * Returns `false` as `DocumentFragment` by definition is not attached to a document. Added for compatibility reasons.\n */\n isAttached() {\n return false;\n }\n /**\n * Returns empty array. Added for compatibility reasons.\n */\n getAncestors() {\n return [];\n }\n /**\n * Gets the child at the given index. Returns `null` if incorrect index was passed.\n *\n * @param index Index of child.\n * @returns Child node.\n */\n getChild(index) {\n return this._children.getNode(index);\n }\n /**\n * Returns an iterator that iterates over all of this document fragment's children.\n */\n getChildren() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Returns an index of the given child node. Returns `null` if given node is not a child of this document fragment.\n *\n * @param node Child node to look for.\n * @returns Child node's index.\n */\n getChildIndex(node) {\n return this._children.getNodeIndex(node);\n }\n /**\n * Returns the starting offset of given child. Starting offset is equal to the sum of\n * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if\n * given node is not a child of this document fragment.\n *\n * @param node Child node to look for.\n * @returns Child node's starting offset.\n */\n getChildStartOffset(node) {\n return this._children.getNodeStartOffset(node);\n }\n /**\n * Returns path to a `DocumentFragment`, which is an empty array. Added for compatibility reasons.\n */\n getPath() {\n return [];\n }\n /**\n * Returns a descendant node by its path relative to this element.\n *\n * ```ts\n * // <this>a<b>c</b></this>\n * this.getNodeByPath( [ 0 ] ); // -> \"a\"\n * this.getNodeByPath( [ 1 ] ); // -> <b>\n * this.getNodeByPath( [ 1, 0 ] ); // -> \"c\"\n * ```\n *\n * @param relativePath Path of the node to find, relative to this element.\n */\n getNodeByPath(relativePath) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let node = this;\n for (const index of relativePath) {\n node = node.getChild(node.offsetToIndex(index));\n }\n return node;\n }\n /**\n * Converts offset \"position\" to index \"position\".\n *\n * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is\n * too high, returns index after last child.\n *\n * ```ts\n * const textNode = new Text( 'foo' );\n * const pElement = new Element( 'p' );\n * const docFrag = new DocumentFragment( [ textNode, pElement ] );\n * docFrag.offsetToIndex( -1 ); // Returns 0, because offset is too low.\n * docFrag.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.\n * docFrag.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.\n * docFrag.offsetToIndex( 2 ); // Returns 0.\n * docFrag.offsetToIndex( 3 ); // Returns 1.\n * docFrag.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.\n * ```\n *\n * @param offset Offset to look for.\n * @returns Index of a node that occupies given offset.\n */\n offsetToIndex(offset) {\n return this._children.offsetToIndex(offset);\n }\n /**\n * Converts `DocumentFragment` instance to plain object and returns it.\n * Takes care of converting all of this document fragment's children.\n *\n * @returns `DocumentFragment` instance converted to plain object.\n */\n toJSON() {\n const json = [];\n for (const node of this._children) {\n json.push(node.toJSON());\n }\n return json;\n }\n /**\n * Creates a `DocumentFragment` instance from given plain object (i.e. parsed JSON string).\n * Converts `DocumentFragment` children to proper nodes.\n *\n * @param json Plain object to be converted to `DocumentFragment`.\n * @returns `DocumentFragment` instance created using given plain object.\n */\n static fromJSON(json) {\n const children = [];\n for (const child of json) {\n if (child.name) {\n // If child has name property, it is an Element.\n children.push(Element.fromJSON(child));\n }\n else {\n // Otherwise, it is a Text node.\n children.push(Text.fromJSON(child));\n }\n }\n return new DocumentFragment(children);\n }\n /**\n * {@link #_insertChild Inserts} one or more nodes at the end of this document fragment.\n *\n * @internal\n * @param items Items to be inserted.\n */\n _appendChild(items) {\n this._insertChild(this.childCount, items);\n }\n /**\n * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes\n * to this document fragment.\n *\n * @internal\n * @param index Index at which nodes should be inserted.\n * @param items Items to be inserted.\n */\n _insertChild(index, items) {\n const nodes = normalize(items);\n for (const node of nodes) {\n // If node that is being added to this element is already inside another element, first remove it from the old parent.\n if (node.parent !== null) {\n node._remove();\n }\n node.parent = this;\n }\n this._children._insertNodes(index, nodes);\n }\n /**\n * Removes one or more nodes starting at the given index\n * and sets {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.\n *\n * @internal\n * @param index Index of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @returns Array containing removed nodes.\n */\n _removeChildren(index, howMany = 1) {\n const nodes = this._children._removeNodes(index, howMany);\n for (const node of nodes) {\n node.parent = null;\n }\n return nodes;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nDocumentFragment.prototype.is = function (type) {\n return type === 'documentFragment' || type === 'model:documentFragment';\n};\n/**\n * Converts strings to Text and non-iterables to arrays.\n */\nfunction normalize(nodes) {\n // Separate condition because string is iterable.\n if (typeof nodes == 'string') {\n return [new Text(nodes)];\n }\n if (!isIterable(nodes)) {\n nodes = [nodes];\n }\n // Array.from to enable .map() on non-arrays.\n return Array.from(nodes)\n .map(node => {\n if (typeof node == 'string') {\n return new Text(node);\n }\n if (node instanceof TextProxy) {\n return new Text(node.data, node.getAttributes());\n }\n return node;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/writer\n */\nimport AttributeOperation from './operation/attributeoperation.js';\nimport DetachOperation from './operation/detachoperation.js';\nimport InsertOperation from './operation/insertoperation.js';\nimport MarkerOperation from './operation/markeroperation.js';\nimport MergeOperation from './operation/mergeoperation.js';\nimport MoveOperation from './operation/moveoperation.js';\nimport RenameOperation from './operation/renameoperation.js';\nimport RootAttributeOperation from './operation/rootattributeoperation.js';\nimport RootOperation from './operation/rootoperation.js';\nimport SplitOperation from './operation/splitoperation.js';\nimport DocumentFragment from './documentfragment.js';\nimport DocumentSelection from './documentselection.js';\nimport Element from './element.js';\nimport Position from './position.js';\nimport Range from './range.js';\nimport RootElement from './rootelement.js';\nimport Text from './text.js';\nimport { CKEditorError, logWarning, toMap } from '@ckeditor/ckeditor5-utils';\n/**\n * The model can only be modified by using the writer. It should be used whenever you want to create a node, modify\n * child nodes, attributes or text, set the selection's position and its attributes.\n *\n * The instance of the writer is only available in the {@link module:engine/model/model~Model#change `change()`} or\n * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`}.\n *\n * ```ts\n * model.change( writer => {\n * \twriter.insertText( 'foo', paragraph, 'end' );\n * } );\n * ```\n *\n * Note that the writer should never be stored and used outside of the `change()` and\n * `enqueueChange()` blocks.\n *\n * Note that writer's methods do not check the {@link module:engine/model/schema~Schema}. It is possible\n * to create incorrect model structures by using the writer. Read more about in\n * {@glink framework/deep-dive/schema#who-checks-the-schema \"Who checks the schema?\"}.\n *\n * @see module:engine/model/model~Model#change\n * @see module:engine/model/model~Model#enqueueChange\n */\nexport default class Writer {\n /**\n * Creates a writer instance.\n *\n * **Note:** It is not recommended to use it directly. Use {@link module:engine/model/model~Model#change `Model#change()`} or\n * {@link module:engine/model/model~Model#enqueueChange `Model#enqueueChange()`} instead.\n *\n * @internal\n */\n constructor(model, batch) {\n this.model = model;\n this.batch = batch;\n }\n /**\n * Creates a new {@link module:engine/model/text~Text text node}.\n *\n * ```ts\n * writer.createText( 'foo' );\n * writer.createText( 'foo', { bold: true } );\n * ```\n *\n * @param data Text data.\n * @param attributes Text attributes.\n * @returns {module:engine/model/text~Text} Created text node.\n */\n createText(data, attributes) {\n return new Text(data, attributes);\n }\n /**\n * Creates a new {@link module:engine/model/element~Element element}.\n *\n * ```ts\n * writer.createElement( 'paragraph' );\n * writer.createElement( 'paragraph', { alignment: 'center' } );\n * ```\n *\n * @param name Name of the element.\n * @param attributes Elements attributes.\n * @returns Created element.\n */\n createElement(name, attributes) {\n return new Element(name, attributes);\n }\n /**\n * Creates a new {@link module:engine/model/documentfragment~DocumentFragment document fragment}.\n *\n * @returns Created document fragment.\n */\n createDocumentFragment() {\n return new DocumentFragment();\n }\n /**\n * Creates a copy of the element and returns it. Created element has the same name and attributes as the original element.\n * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.\n *\n * @param element The element to clone.\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any child.\n */\n cloneElement(element, deep = true) {\n return element._clone(deep);\n }\n /**\n * Inserts item on given position.\n *\n * ```ts\n * const paragraph = writer.createElement( 'paragraph' );\n * writer.insert( paragraph, position );\n * ```\n *\n * Instead of using position you can use parent and offset:\n *\n * ```ts\n * const text = writer.createText( 'foo' );\n * writer.insert( text, paragraph, 5 );\n * ```\n *\n * You can also use `end` instead of the offset to insert at the end:\n *\n * ```ts\n * const text = writer.createText( 'foo' );\n * writer.insert( text, paragraph, 'end' );\n * ```\n *\n * Or insert before or after another element:\n *\n * ```ts\n * const paragraph = writer.createElement( 'paragraph' );\n * writer.insert( paragraph, anotherParagraph, 'after' );\n * ```\n *\n * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.\n *\n * Note that if the item already has parent it will be removed from the previous parent.\n *\n * Note that you cannot re-insert a node from a document to a different document or a document fragment. In this case,\n * `model-writer-insert-forbidden-move` is thrown.\n *\n * If you want to move {@link module:engine/model/range~Range range} instead of an\n * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.\n *\n * **Note:** For a paste-like content insertion mechanism see\n * {@link module:engine/model/model~Model#insertContent `model.insertContent()`}.\n *\n * @param item Item or document fragment to insert.\n * @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~Item model item}.\n */\n insert(item, itemOrPosition, offset = 0) {\n this._assertWriterUsedCorrectly();\n if (item instanceof Text && item.data == '') {\n return;\n }\n const position = Position._createAt(itemOrPosition, offset);\n // If item has a parent already.\n if (item.parent) {\n // We need to check if item is going to be inserted within the same document.\n if (isSameTree(item.root, position.root)) {\n // If it's we just need to move it.\n this.move(Range._createOn(item), position);\n return;\n }\n // If it isn't the same root.\n else {\n if (item.root.document) {\n /**\n * Cannot move a node from a document to a different tree.\n * It is forbidden to move a node that was already in a document outside of it.\n *\n * @error model-writer-insert-forbidden-move\n */\n throw new CKEditorError('model-writer-insert-forbidden-move', this);\n }\n else {\n // Move between two different document fragments or from document fragment to a document is possible.\n // In that case, remove the item from it's original parent.\n this.remove(item);\n }\n }\n }\n const version = position.root.document ? position.root.document.version : null;\n const insert = new InsertOperation(position, item, version);\n if (item instanceof Text) {\n insert.shouldReceiveAttributes = true;\n }\n this.batch.addOperation(insert);\n this.model.applyOperation(insert);\n // When element is a DocumentFragment we need to move its markers to Document#markers.\n if (item instanceof DocumentFragment) {\n for (const [markerName, markerRange] of item.markers) {\n // We need to migrate marker range from DocumentFragment to Document.\n const rangeRootPosition = Position._createAt(markerRange.root, 0);\n const range = new Range(markerRange.start._getCombined(rangeRootPosition, position), markerRange.end._getCombined(rangeRootPosition, position));\n const options = { range, usingOperation: true, affectsData: true };\n if (this.model.markers.has(markerName)) {\n this.updateMarker(markerName, options);\n }\n else {\n this.addMarker(markerName, options);\n }\n }\n }\n }\n insertText(text, attributes, // Too complicated when not using `any`.\n itemOrPosition, // Too complicated when not using `any`.\n offset // Too complicated when not using `any`.\n ) {\n if (attributes instanceof DocumentFragment || attributes instanceof Element || attributes instanceof Position) {\n this.insert(this.createText(text), attributes, itemOrPosition);\n }\n else {\n this.insert(this.createText(text, attributes), itemOrPosition, offset);\n }\n }\n insertElement(name, attributes, // Too complicated when not using `any`.\n itemOrPositionOrOffset, // Too complicated when not using `any`.\n offset // Too complicated when not using `any`.\n ) {\n if (attributes instanceof DocumentFragment || attributes instanceof Element || attributes instanceof Position) {\n this.insert(this.createElement(name), attributes, itemOrPositionOrOffset);\n }\n else {\n this.insert(this.createElement(name, attributes), itemOrPositionOrOffset, offset);\n }\n }\n /**\n * Inserts item at the end of the given parent.\n *\n * ```ts\n * const paragraph = writer.createElement( 'paragraph' );\n * writer.append( paragraph, root );\n * ```\n *\n * Note that if the item already has parent it will be removed from the previous parent.\n *\n * If you want to move {@link module:engine/model/range~Range range} instead of an\n * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.\n *\n * @param item Item or document fragment to insert.\n */\n append(item, parent) {\n this.insert(item, parent, 'end');\n }\n appendText(text, attributes, parent) {\n if (attributes instanceof DocumentFragment || attributes instanceof Element) {\n this.insert(this.createText(text), attributes, 'end');\n }\n else {\n this.insert(this.createText(text, attributes), parent, 'end');\n }\n }\n appendElement(name, attributes, parent) {\n if (attributes instanceof DocumentFragment || attributes instanceof Element) {\n this.insert(this.createElement(name), attributes, 'end');\n }\n else {\n this.insert(this.createElement(name, attributes), parent, 'end');\n }\n }\n /**\n * Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}\n * or on a {@link module:engine/model/range~Range range}.\n *\n * @param key Attribute key.\n * @param value Attribute new value.\n * @param itemOrRange Model item or range on which the attribute will be set.\n */\n setAttribute(key, value, itemOrRange) {\n this._assertWriterUsedCorrectly();\n if (itemOrRange instanceof Range) {\n const ranges = itemOrRange.getMinimalFlatRanges();\n for (const range of ranges) {\n setAttributeOnRange(this, key, value, range);\n }\n }\n else {\n setAttributeOnItem(this, key, value, itemOrRange);\n }\n }\n /**\n * Sets values of attributes on a {@link module:engine/model/item~Item model item}\n * or on a {@link module:engine/model/range~Range range}.\n *\n * ```ts\n * writer.setAttributes( {\n * \tbold: true,\n * \titalic: true\n * }, range );\n * ```\n *\n * @param attributes Attributes keys and values.\n * @param itemOrRange Model item or range on which the attributes will be set.\n */\n setAttributes(attributes, itemOrRange) {\n for (const [key, val] of toMap(attributes)) {\n this.setAttribute(key, val, itemOrRange);\n }\n }\n /**\n * Removes an attribute with given key from a {@link module:engine/model/item~Item model item}\n * or from a {@link module:engine/model/range~Range range}.\n *\n * @param key Attribute key.\n * @param itemOrRange Model item or range from which the attribute will be removed.\n */\n removeAttribute(key, itemOrRange) {\n this._assertWriterUsedCorrectly();\n if (itemOrRange instanceof Range) {\n const ranges = itemOrRange.getMinimalFlatRanges();\n for (const range of ranges) {\n setAttributeOnRange(this, key, null, range);\n }\n }\n else {\n setAttributeOnItem(this, key, null, itemOrRange);\n }\n }\n /**\n * Removes all attributes from all elements in the range or from the given item.\n *\n * @param itemOrRange Model item or range from which all attributes will be removed.\n */\n clearAttributes(itemOrRange) {\n this._assertWriterUsedCorrectly();\n const removeAttributesFromItem = (item) => {\n for (const attribute of item.getAttributeKeys()) {\n this.removeAttribute(attribute, item);\n }\n };\n if (!(itemOrRange instanceof Range)) {\n removeAttributesFromItem(itemOrRange);\n }\n else {\n for (const item of itemOrRange.getItems()) {\n removeAttributesFromItem(item);\n }\n }\n }\n /**\n * Moves all items in the source range to the target position.\n *\n * ```ts\n * writer.move( sourceRange, targetPosition );\n * ```\n *\n * Instead of the target position you can use parent and offset or define that range should be moved to the end\n * or before or after chosen item:\n *\n * ```ts\n * // Moves all items in the range to the paragraph at offset 5:\n * writer.move( sourceRange, paragraph, 5 );\n * // Moves all items in the range to the end of a blockquote:\n * writer.move( sourceRange, blockquote, 'end' );\n * // Moves all items in the range to a position after an image:\n * writer.move( sourceRange, image, 'after' );\n * ```\n *\n * These parameters work the same way as {@link #createPositionAt `writer.createPositionAt()`}.\n *\n * Note that items can be moved only within the same tree. It means that you can move items within the same root\n * (element or document fragment) or between {@link module:engine/model/document~Document#roots documents roots},\n * but you can not move items from document fragment to the document or from one detached element to another. Use\n * {@link module:engine/model/writer~Writer#insert} in such cases.\n *\n * @param range Source range.\n * @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~Item model item}.\n */\n move(range, itemOrPosition, offset) {\n this._assertWriterUsedCorrectly();\n if (!(range instanceof Range)) {\n /**\n * Invalid range to move.\n *\n * @error writer-move-invalid-range\n */\n throw new CKEditorError('writer-move-invalid-range', this);\n }\n if (!range.isFlat) {\n /**\n * Range to move is not flat.\n *\n * @error writer-move-range-not-flat\n */\n throw new CKEditorError('writer-move-range-not-flat', this);\n }\n const position = Position._createAt(itemOrPosition, offset);\n // Do not move anything if the move target is same as moved range start.\n if (position.isEqual(range.start)) {\n return;\n }\n // If part of the marker is removed, create additional marker operation for undo purposes.\n this._addOperationForAffectedMarkers('move', range);\n if (!isSameTree(range.root, position.root)) {\n /**\n * Range is going to be moved within not the same document. Please use\n * {@link module:engine/model/writer~Writer#insert insert} instead.\n *\n * @error writer-move-different-document\n */\n throw new CKEditorError('writer-move-different-document', this);\n }\n const version = range.root.document ? range.root.document.version : null;\n const operation = new MoveOperation(range.start, range.end.offset - range.start.offset, position, version);\n this.batch.addOperation(operation);\n this.model.applyOperation(operation);\n }\n /**\n * Removes given model {@link module:engine/model/item~Item item} or {@link module:engine/model/range~Range range}.\n *\n * @param itemOrRange Model item or range to remove.\n */\n remove(itemOrRange) {\n this._assertWriterUsedCorrectly();\n const rangeToRemove = itemOrRange instanceof Range ? itemOrRange : Range._createOn(itemOrRange);\n const ranges = rangeToRemove.getMinimalFlatRanges().reverse();\n for (const flat of ranges) {\n // If part of the marker is removed, create additional marker operation for undo purposes.\n this._addOperationForAffectedMarkers('move', flat);\n applyRemoveOperation(flat.start, flat.end.offset - flat.start.offset, this.batch, this.model);\n }\n }\n /**\n * Merges two siblings at the given position.\n *\n * Node before and after the position have to be an element. Otherwise `writer-merge-no-element-before` or\n * `writer-merge-no-element-after` error will be thrown.\n *\n * @param position Position between merged elements.\n */\n merge(position) {\n this._assertWriterUsedCorrectly();\n const nodeBefore = position.nodeBefore;\n const nodeAfter = position.nodeAfter;\n // If part of the marker is removed, create additional marker operation for undo purposes.\n this._addOperationForAffectedMarkers('merge', position);\n if (!(nodeBefore instanceof Element)) {\n /**\n * Node before merge position must be an element.\n *\n * @error writer-merge-no-element-before\n */\n throw new CKEditorError('writer-merge-no-element-before', this);\n }\n if (!(nodeAfter instanceof Element)) {\n /**\n * Node after merge position must be an element.\n *\n * @error writer-merge-no-element-after\n */\n throw new CKEditorError('writer-merge-no-element-after', this);\n }\n if (!position.root.document) {\n this._mergeDetached(position);\n }\n else {\n this._merge(position);\n }\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createPositionFromPath `Model#createPositionFromPath()`}.\n *\n * @param root Root of the position.\n * @param path Position path. See {@link module:engine/model/position~Position#path}.\n * @param stickiness Position stickiness. See {@link module:engine/model/position~PositionStickiness}.\n */\n createPositionFromPath(root, path, stickiness) {\n return this.model.createPositionFromPath(root, path, stickiness);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}.\n *\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~Item model item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return this.model.createPositionAt(itemOrPosition, offset);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createPositionAfter `Model#createPositionAfter()`}.\n *\n * @param item Item after which the position should be placed.\n */\n createPositionAfter(item) {\n return this.model.createPositionAfter(item);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createPositionBefore `Model#createPositionBefore()`}.\n *\n * @param item Item after which the position should be placed.\n */\n createPositionBefore(item) {\n return this.model.createPositionBefore(item);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createRange `Model#createRange()`}.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at `start` position.\n */\n createRange(start, end) {\n return this.model.createRange(start, end);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createRangeIn `Model#createRangeIn()`}.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return this.model.createRangeIn(element);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createRangeOn `Model#createRangeOn()`}.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeOn(element) {\n return this.model.createRangeOn(element);\n }\n createSelection(...args) {\n return this.model.createSelection(...args);\n }\n /**\n * Performs merge action in a detached tree.\n *\n * @param position Position between merged elements.\n */\n _mergeDetached(position) {\n const nodeBefore = position.nodeBefore;\n const nodeAfter = position.nodeAfter;\n this.move(Range._createIn(nodeAfter), Position._createAt(nodeBefore, 'end'));\n this.remove(nodeAfter);\n }\n /**\n * Performs merge action in a non-detached tree.\n *\n * @param position Position between merged elements.\n */\n _merge(position) {\n const targetPosition = Position._createAt(position.nodeBefore, 'end');\n const sourcePosition = Position._createAt(position.nodeAfter, 0);\n const graveyard = position.root.document.graveyard;\n const graveyardPosition = new Position(graveyard, [0]);\n const version = position.root.document.version;\n const merge = new MergeOperation(sourcePosition, position.nodeAfter.maxOffset, targetPosition, graveyardPosition, version);\n this.batch.addOperation(merge);\n this.model.applyOperation(merge);\n }\n /**\n * Renames the given element.\n *\n * @param element The element to rename.\n * @param newName New element name.\n */\n rename(element, newName) {\n this._assertWriterUsedCorrectly();\n if (!(element instanceof Element)) {\n /**\n * Trying to rename an object which is not an instance of Element.\n *\n * @error writer-rename-not-element-instance\n */\n throw new CKEditorError('writer-rename-not-element-instance', this);\n }\n const version = element.root.document ? element.root.document.version : null;\n const renameOperation = new RenameOperation(Position._createBefore(element), element.name, newName, version);\n this.batch.addOperation(renameOperation);\n this.model.applyOperation(renameOperation);\n }\n /**\n * Splits elements starting from the given position and going to the top of the model tree as long as given\n * `limitElement` is reached. When `limitElement` is not defined then only the parent of the given position will be split.\n *\n * The element needs to have a parent. It cannot be a root element nor a document fragment.\n * The `writer-split-element-no-parent` error will be thrown if you try to split an element with no parent.\n *\n * @param position Position of split.\n * @param limitElement Stop splitting when this element will be reached.\n * @returns Split result with properties:\n * * `position` - Position between split elements.\n * * `range` - Range that stars from the end of the first split element and ends at the beginning of the first copy element.\n */\n split(position, limitElement) {\n this._assertWriterUsedCorrectly();\n let splitElement = position.parent;\n if (!splitElement.parent) {\n /**\n * Element with no parent can not be split.\n *\n * @error writer-split-element-no-parent\n */\n throw new CKEditorError('writer-split-element-no-parent', this);\n }\n // When limit element is not defined lets set splitElement parent as limit.\n if (!limitElement) {\n limitElement = splitElement.parent;\n }\n if (!position.parent.getAncestors({ includeSelf: true }).includes(limitElement)) {\n /**\n * Limit element is not a position ancestor.\n *\n * @error writer-split-invalid-limit-element\n */\n throw new CKEditorError('writer-split-invalid-limit-element', this);\n }\n // We need to cache elements that will be created as a result of the first split because\n // we need to create a range from the end of the first split element to the beginning of the\n // first copy element. This should be handled by LiveRange but it doesn't work on detached nodes.\n let firstSplitElement;\n let firstCopyElement;\n do {\n const version = splitElement.root.document ? splitElement.root.document.version : null;\n const howMany = splitElement.maxOffset - position.offset;\n const insertionPosition = SplitOperation.getInsertionPosition(position);\n const split = new SplitOperation(position, howMany, insertionPosition, null, version);\n this.batch.addOperation(split);\n this.model.applyOperation(split);\n // Cache result of the first split.\n if (!firstSplitElement && !firstCopyElement) {\n firstSplitElement = splitElement;\n firstCopyElement = position.parent.nextSibling;\n }\n position = this.createPositionAfter(position.parent);\n splitElement = position.parent;\n } while (splitElement !== limitElement);\n return {\n position,\n range: new Range(Position._createAt(firstSplitElement, 'end'), Position._createAt(firstCopyElement, 0))\n };\n }\n /**\n * Wraps the given range with the given element or with a new element (if a string was passed).\n *\n * **Note:** range to wrap should be a \"flat range\" (see {@link module:engine/model/range~Range#isFlat `Range#isFlat`}).\n * If not, an error will be thrown.\n *\n * @param range Range to wrap.\n * @param elementOrString Element or name of element to wrap the range with.\n */\n wrap(range, elementOrString) {\n this._assertWriterUsedCorrectly();\n if (!range.isFlat) {\n /**\n * Range to wrap is not flat.\n *\n * @error writer-wrap-range-not-flat\n */\n throw new CKEditorError('writer-wrap-range-not-flat', this);\n }\n const element = elementOrString instanceof Element ? elementOrString : new Element(elementOrString);\n if (element.childCount > 0) {\n /**\n * Element to wrap with is not empty.\n *\n * @error writer-wrap-element-not-empty\n */\n throw new CKEditorError('writer-wrap-element-not-empty', this);\n }\n if (element.parent !== null) {\n /**\n * Element to wrap with is already attached to a tree model.\n *\n * @error writer-wrap-element-attached\n */\n throw new CKEditorError('writer-wrap-element-attached', this);\n }\n this.insert(element, range.start);\n // Shift the range-to-wrap because we just inserted an element before that range.\n const shiftedRange = new Range(range.start.getShiftedBy(1), range.end.getShiftedBy(1));\n this.move(shiftedRange, Position._createAt(element, 0));\n }\n /**\n * Unwraps children of the given element – all its children are moved before it and then the element is removed.\n * Throws error if you try to unwrap an element which does not have a parent.\n *\n * @param element Element to unwrap.\n */\n unwrap(element) {\n this._assertWriterUsedCorrectly();\n if (element.parent === null) {\n /**\n * Trying to unwrap an element which has no parent.\n *\n * @error writer-unwrap-element-no-parent\n */\n throw new CKEditorError('writer-unwrap-element-no-parent', this);\n }\n this.move(Range._createIn(element), this.createPositionAfter(element));\n this.remove(element);\n }\n /**\n * Adds a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks\n * changes in the document and updates its range automatically, when model tree changes.\n *\n * As the first parameter you can set marker name.\n *\n * The required `options.usingOperation` parameter lets you decide if the marker should be managed by operations or not. See\n * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between\n * markers managed by operations and not-managed by operations.\n *\n * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be\n * `true` when the marker change changes the data returned by the\n * {@link module:core/editor/editor~Editor#getData `editor.getData()`} method.\n * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.\n * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.\n *\n * Create marker directly base on marker's name:\n *\n * ```ts\n * addMarker( markerName, { range, usingOperation: false } );\n * ```\n *\n * Create marker using operation:\n *\n * ```ts\n * addMarker( markerName, { range, usingOperation: true } );\n * ```\n *\n * Create marker that affects the editor data:\n *\n * ```ts\n * addMarker( markerName, { range, usingOperation: false, affectsData: true } );\n * ```\n *\n * Note: For efficiency reasons, it's best to create and keep as little markers as possible.\n *\n * @see module:engine/model/markercollection~Marker\n * @param name Name of a marker to create - must be unique.\n * @param options.usingOperation Flag indicating that the marker should be added by MarkerOperation.\n * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.\n * @param options.range Marker range.\n * @param options.affectsData Flag indicating that the marker changes the editor data.\n * @returns Marker that was set.\n */\n addMarker(name, options) {\n this._assertWriterUsedCorrectly();\n if (!options || typeof options.usingOperation != 'boolean') {\n /**\n * The `options.usingOperation` parameter is required when adding a new marker.\n *\n * @error writer-addmarker-no-usingoperation\n */\n throw new CKEditorError('writer-addmarker-no-usingoperation', this);\n }\n const usingOperation = options.usingOperation;\n const range = options.range;\n const affectsData = options.affectsData === undefined ? false : options.affectsData;\n if (this.model.markers.has(name)) {\n /**\n * Marker with provided name already exists.\n *\n * @error writer-addmarker-marker-exists\n */\n throw new CKEditorError('writer-addmarker-marker-exists', this);\n }\n if (!range) {\n /**\n * Range parameter is required when adding a new marker.\n *\n * @error writer-addmarker-no-range\n */\n throw new CKEditorError('writer-addmarker-no-range', this);\n }\n if (!usingOperation) {\n return this.model.markers._set(name, range, usingOperation, affectsData);\n }\n applyMarkerOperation(this, name, null, range, affectsData);\n return this.model.markers.get(name);\n }\n /**\n * Adds, updates or refreshes a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks\n * changes in the document and updates its range automatically, when model tree changes. Still, it is possible to change the\n * marker's range directly using this method.\n *\n * As the first parameter you can set marker name or instance. If none of them is provided, new marker, with a unique\n * name is created and returned.\n *\n * **Note**: If you want to change the {@link module:engine/view/element~Element view element} of the marker while its data in the model\n * remains the same, use the dedicated {@link module:engine/controller/editingcontroller~EditingController#reconvertMarker} method.\n *\n * The `options.usingOperation` parameter lets you change if the marker should be managed by operations or not. See\n * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between\n * markers managed by operations and not-managed by operations. It is possible to change this option for an existing marker.\n *\n * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be\n * `true` when the marker change changes the data returned by\n * the {@link module:core/editor/editor~Editor#getData `editor.getData()`} method.\n * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.\n * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.\n *\n * Update marker directly base on marker's name:\n *\n * ```ts\n * updateMarker( markerName, { range } );\n * ```\n *\n * Update marker using operation:\n *\n * ```ts\n * updateMarker( marker, { range, usingOperation: true } );\n * updateMarker( markerName, { range, usingOperation: true } );\n * ```\n *\n * Change marker's option (start using operations to manage it):\n *\n * ```ts\n * updateMarker( marker, { usingOperation: true } );\n * ```\n *\n * Change marker's option (inform the engine, that the marker does not affect the data anymore):\n *\n * ```ts\n * updateMarker( markerName, { affectsData: false } );\n * ```\n *\n * @see module:engine/model/markercollection~Marker\n * @param markerOrName Name of a marker to update, or a marker instance.\n * @param options If options object is not defined then marker will be refreshed by triggering\n * downcast conversion for this marker with the same data.\n * @param options.range Marker range to update.\n * @param options.usingOperation Flag indicated whether the marker should be added by MarkerOperation.\n * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.\n * @param options.affectsData Flag indicating that the marker changes the editor data.\n */\n updateMarker(markerOrName, options) {\n this._assertWriterUsedCorrectly();\n const markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;\n const currentMarker = this.model.markers.get(markerName);\n if (!currentMarker) {\n /**\n * Marker with provided name does not exist and will not be updated.\n *\n * @error writer-updatemarker-marker-not-exists\n */\n throw new CKEditorError('writer-updatemarker-marker-not-exists', this);\n }\n if (!options) {\n /**\n * The usage of `writer.updateMarker()` only to reconvert (refresh) a\n * {@link module:engine/model/markercollection~Marker model marker} was deprecated and may not work in the future.\n * Please update your code to use\n * {@link module:engine/controller/editingcontroller~EditingController#reconvertMarker `editor.editing.reconvertMarker()`}\n * instead.\n *\n * @error writer-updatemarker-reconvert-using-editingcontroller\n * @param markerName The name of the updated marker.\n */\n logWarning('writer-updatemarker-reconvert-using-editingcontroller', { markerName });\n this.model.markers._refresh(currentMarker);\n return;\n }\n const hasUsingOperationDefined = typeof options.usingOperation == 'boolean';\n const affectsDataDefined = typeof options.affectsData == 'boolean';\n // Use previously defined marker's affectsData if the property is not provided.\n const affectsData = affectsDataDefined ? options.affectsData : currentMarker.affectsData;\n if (!hasUsingOperationDefined && !options.range && !affectsDataDefined) {\n /**\n * One of the options is required - provide range, usingOperations or affectsData.\n *\n * @error writer-updatemarker-wrong-options\n */\n throw new CKEditorError('writer-updatemarker-wrong-options', this);\n }\n const currentRange = currentMarker.getRange();\n const updatedRange = options.range ? options.range : currentRange;\n if (hasUsingOperationDefined && options.usingOperation !== currentMarker.managedUsingOperations) {\n // The marker type is changed so it's necessary to create proper operations.\n if (options.usingOperation) {\n // If marker changes to a managed one treat this as synchronizing existing marker.\n // Create `MarkerOperation` with `oldRange` set to `null`, so reverse operation will remove the marker.\n applyMarkerOperation(this, markerName, null, updatedRange, affectsData);\n }\n else {\n // If marker changes to a marker that do not use operations then we need to create additional operation\n // that removes that marker first.\n applyMarkerOperation(this, markerName, currentRange, null, affectsData);\n // Although not managed the marker itself should stay in model and its range should be preserver or changed to passed range.\n this.model.markers._set(markerName, updatedRange, undefined, affectsData);\n }\n return;\n }\n // Marker's type doesn't change so update it accordingly.\n if (currentMarker.managedUsingOperations) {\n applyMarkerOperation(this, markerName, currentRange, updatedRange, affectsData);\n }\n else {\n this.model.markers._set(markerName, updatedRange, undefined, affectsData);\n }\n }\n /**\n * Removes given {@link module:engine/model/markercollection~Marker marker} or marker with given name.\n * The marker is removed accordingly to how it has been created, so if the marker was created using operation,\n * it will be destroyed using operation.\n *\n * @param markerOrName Marker or marker name to remove.\n */\n removeMarker(markerOrName) {\n this._assertWriterUsedCorrectly();\n const name = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;\n if (!this.model.markers.has(name)) {\n /**\n * Trying to remove marker which does not exist.\n *\n * @error writer-removemarker-no-marker\n */\n throw new CKEditorError('writer-removemarker-no-marker', this);\n }\n const marker = this.model.markers.get(name);\n if (!marker.managedUsingOperations) {\n this.model.markers._remove(name);\n return;\n }\n const oldRange = marker.getRange();\n applyMarkerOperation(this, name, oldRange, null, marker.affectsData);\n }\n /**\n * Adds a new root to the document (or re-attaches a {@link #detachRoot detached root}).\n *\n * Throws an error, if trying to add a root that is already added and attached.\n *\n * @param rootName Name of the added root.\n * @param elementName The element name. Defaults to `'$root'` which also has some basic schema defined\n * (e.g. `$block` elements are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.\n * @returns The added root element.\n */\n addRoot(rootName, elementName = '$root') {\n this._assertWriterUsedCorrectly();\n const root = this.model.document.getRoot(rootName);\n if (root && root.isAttached()) {\n /**\n * Root with provided name already exists and is attached.\n *\n * @error writer-addroot-root-exists\n */\n throw new CKEditorError('writer-addroot-root-exists', this);\n }\n const document = this.model.document;\n const operation = new RootOperation(rootName, elementName, true, document, document.version);\n this.batch.addOperation(operation);\n this.model.applyOperation(operation);\n return this.model.document.getRoot(rootName);\n }\n /**\n * Detaches the root from the document.\n *\n * All content and markers are removed from the root upon detaching. New content and new markers cannot be added to the root, as long\n * as it is detached.\n *\n * A root cannot be fully removed from the document, it can be only detached. A root is permanently removed only after you\n * re-initialize the editor and do not specify the root in the initial data.\n *\n * A detached root can be re-attached using {@link #addRoot}.\n *\n * Throws an error if the root does not exist or the root is already detached.\n *\n * @param rootOrName Name of the detached root.\n */\n detachRoot(rootOrName) {\n this._assertWriterUsedCorrectly();\n const root = typeof rootOrName == 'string' ? this.model.document.getRoot(rootOrName) : rootOrName;\n if (!root || !root.isAttached()) {\n /**\n * Root with provided name does not exist or is already detached.\n *\n * @error writer-detachroot-no-root\n */\n throw new CKEditorError('writer-detachroot-no-root', this);\n }\n // First, remove all markers from the root. It is better to do it before removing stuff for undo purposes.\n // However, looking through all the markers may not be the best performance wise. But there's no better solution for now.\n for (const marker of this.model.markers) {\n if (marker.getRange().root === root) {\n this.removeMarker(marker);\n }\n }\n // Remove all attributes from the root.\n for (const key of root.getAttributeKeys()) {\n this.removeAttribute(key, root);\n }\n // Remove all contents of the root.\n this.remove(this.createRangeIn(root));\n // Finally, detach the root.\n const document = this.model.document;\n const operation = new RootOperation(root.rootName, root.name, false, document, document.version);\n this.batch.addOperation(operation);\n this.model.applyOperation(operation);\n }\n setSelection(...args) {\n this._assertWriterUsedCorrectly();\n this.model.document.selection._setTo(...args);\n }\n /**\n * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.\n *\n * The location can be specified in the same form as\n * {@link #createPositionAt `writer.createPositionAt()`} parameters.\n *\n * @param itemOrPosition\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~Item model item}.\n */\n setSelectionFocus(itemOrPosition, offset) {\n this._assertWriterUsedCorrectly();\n this.model.document.selection._setFocus(itemOrPosition, offset);\n }\n setSelectionAttribute(keyOrObjectOrIterable, value) {\n this._assertWriterUsedCorrectly();\n if (typeof keyOrObjectOrIterable === 'string') {\n this._setSelectionAttribute(keyOrObjectOrIterable, value);\n }\n else {\n for (const [key, value] of toMap(keyOrObjectOrIterable)) {\n this._setSelectionAttribute(key, value);\n }\n }\n }\n /**\n * Removes attribute(s) with given key(s) from the selection.\n *\n * Remove one attribute:\n *\n * ```ts\n * writer.removeSelectionAttribute( 'italic' );\n * ```\n *\n * Remove multiple attributes:\n *\n * ```ts\n * writer.removeSelectionAttribute( [ 'italic', 'bold' ] );\n * ```\n *\n * @param keyOrIterableOfKeys Key of the attribute to remove or an iterable of attribute keys to remove.\n */\n removeSelectionAttribute(keyOrIterableOfKeys) {\n this._assertWriterUsedCorrectly();\n if (typeof keyOrIterableOfKeys === 'string') {\n this._removeSelectionAttribute(keyOrIterableOfKeys);\n }\n else {\n for (const key of keyOrIterableOfKeys) {\n this._removeSelectionAttribute(key);\n }\n }\n }\n /**\n * Temporarily changes the {@link module:engine/model/documentselection~DocumentSelection#isGravityOverridden gravity}\n * of the selection from left to right.\n *\n * The gravity defines from which direction the selection inherits its attributes. If it's the default left gravity,\n * then the selection (after being moved by the user) inherits attributes from its left-hand side.\n * This method allows to temporarily override this behavior by forcing the gravity to the right.\n *\n * For the following model fragment:\n *\n * ```xml\n * <$text bold=\"true\" linkHref=\"url\">bar[]</$text><$text bold=\"true\">biz</$text>\n * ```\n *\n * * Default gravity: selection will have the `bold` and `linkHref` attributes.\n * * Overridden gravity: selection will have `bold` attribute.\n *\n * **Note**: It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry\n * of the process.\n *\n * @returns The unique id which allows restoring the gravity.\n */\n overrideSelectionGravity() {\n return this.model.document.selection._overrideGravity();\n }\n /**\n * Restores {@link ~Writer#overrideSelectionGravity} gravity to default.\n *\n * Restoring the gravity is only possible using the unique identifier returned by\n * {@link ~Writer#overrideSelectionGravity}. Note that the gravity remains overridden as long as won't be restored\n * the same number of times it was overridden.\n *\n * @param uid The unique id returned by {@link ~Writer#overrideSelectionGravity}.\n */\n restoreSelectionGravity(uid) {\n this.model.document.selection._restoreGravity(uid);\n }\n /**\n * @param key Key of the attribute to remove.\n * @param value Attribute value.\n */\n _setSelectionAttribute(key, value) {\n const selection = this.model.document.selection;\n // Store attribute in parent element if the selection is collapsed in an empty node.\n if (selection.isCollapsed && selection.anchor.parent.isEmpty) {\n const storeKey = DocumentSelection._getStoreAttributeKey(key);\n this.setAttribute(storeKey, value, selection.anchor.parent);\n }\n selection._setAttribute(key, value);\n }\n /**\n * @param key Key of the attribute to remove.\n */\n _removeSelectionAttribute(key) {\n const selection = this.model.document.selection;\n // Remove stored attribute from parent element if the selection is collapsed in an empty node.\n if (selection.isCollapsed && selection.anchor.parent.isEmpty) {\n const storeKey = DocumentSelection._getStoreAttributeKey(key);\n this.removeAttribute(storeKey, selection.anchor.parent);\n }\n selection._removeAttribute(key);\n }\n /**\n * Throws `writer-detached-writer-tries-to-modify-model` error when the writer is used outside of the `change()` block.\n */\n _assertWriterUsedCorrectly() {\n /**\n * Trying to use a writer outside a {@link module:engine/model/model~Model#change `change()`} or\n * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`} blocks.\n *\n * The writer can only be used inside these blocks which ensures that the model\n * can only be changed during such \"sessions\".\n *\n * @error writer-incorrect-use\n */\n if (this.model._currentWriter !== this) {\n throw new CKEditorError('writer-incorrect-use', this);\n }\n }\n /**\n * For given action `type` and `positionOrRange` where the action happens, this function finds all affected markers\n * and applies a marker operation with the new marker range equal to the current range. Thanks to this, the marker range\n * can be later correctly processed during undo.\n *\n * @param type Writer action type.\n * @param positionOrRange Position or range where the writer action happens.\n */\n _addOperationForAffectedMarkers(type, positionOrRange) {\n for (const marker of this.model.markers) {\n if (!marker.managedUsingOperations) {\n continue;\n }\n const markerRange = marker.getRange();\n let isAffected = false;\n if (type === 'move') {\n const range = positionOrRange;\n isAffected =\n range.containsPosition(markerRange.start) ||\n range.start.isEqual(markerRange.start) ||\n range.containsPosition(markerRange.end) ||\n range.end.isEqual(markerRange.end);\n }\n else {\n // if type === 'merge'.\n const position = positionOrRange;\n const elementBefore = position.nodeBefore;\n const elementAfter = position.nodeAfter;\n // Start: <p>Foo[</p><p>Bar]</p>\n // After merge: <p>Foo[Bar]</p>\n // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.\n //\n const affectedInLeftElement = markerRange.start.parent == elementBefore && markerRange.start.isAtEnd;\n // Start: <p>[Foo</p><p>]Bar</p>\n // After merge: <p>[Foo]Bar</p>\n // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.\n //\n const affectedInRightElement = markerRange.end.parent == elementAfter && markerRange.end.offset == 0;\n // Start: <p>[Foo</p>]<p>Bar</p>\n // After merge: <p>[Foo]Bar</p>\n // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.\n //\n const affectedAfterLeftElement = markerRange.end.nodeAfter == elementAfter;\n // Start: <p>Foo</p>[<p>Bar]</p>\n // After merge: <p>Foo[Bar]</p>\n // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.\n //\n const affectedBeforeRightElement = markerRange.start.nodeAfter == elementAfter;\n isAffected = affectedInLeftElement || affectedInRightElement || affectedAfterLeftElement || affectedBeforeRightElement;\n }\n if (isAffected) {\n this.updateMarker(marker.name, { range: markerRange });\n }\n }\n }\n}\n/**\n * Sets given attribute to each node in given range. When attribute value is null then attribute will be removed.\n *\n * Because attribute operation needs to have the same attribute value on the whole range, this function splits\n * the range into smaller parts.\n *\n * Given `range` must be flat.\n */\nfunction setAttributeOnRange(writer, key, value, range) {\n const model = writer.model;\n const doc = model.document;\n // Position of the last split, the beginning of the new range.\n let lastSplitPosition = range.start;\n // Currently position in the scanning range. Because we need value after the position, it is not a current\n // position of the iterator but the previous one (we need to iterate one more time to get the value after).\n let position;\n // Value before the currently position.\n let valueBefore;\n // Value after the currently position.\n let valueAfter;\n for (const val of range.getWalker({ shallow: true })) {\n valueAfter = val.item.getAttribute(key);\n // At the first run of the iterator the position in undefined. We also do not have a valueBefore, but\n // because valueAfter may be null, valueBefore may be equal valueAfter ( undefined == null ).\n if (position && valueBefore != valueAfter) {\n // if valueBefore == value there is nothing to change, so we add operation only if these values are different.\n if (valueBefore != value) {\n addOperation();\n }\n lastSplitPosition = position;\n }\n position = val.nextPosition;\n valueBefore = valueAfter;\n }\n // Because position in the loop is not the iterator position (see let position comment), the last position in\n // the while loop will be last but one position in the range. We need to check the last position manually.\n if (position instanceof Position && position != lastSplitPosition && valueBefore != value) {\n addOperation();\n }\n function addOperation() {\n const range = new Range(lastSplitPosition, position);\n const version = range.root.document ? doc.version : null;\n const operation = new AttributeOperation(range, key, valueBefore, value, version);\n writer.batch.addOperation(operation);\n model.applyOperation(operation);\n }\n}\n/**\n * Sets given attribute to the given node. When attribute value is null then attribute will be removed.\n */\nfunction setAttributeOnItem(writer, key, value, item) {\n const model = writer.model;\n const doc = model.document;\n const previousValue = item.getAttribute(key);\n let range, operation;\n if (previousValue != value) {\n const isRootChanged = item.root === item;\n if (isRootChanged) {\n // If we change attributes of root element, we have to use `RootAttributeOperation`.\n const version = item.document ? doc.version : null;\n operation = new RootAttributeOperation(item, key, previousValue, value, version);\n }\n else {\n range = new Range(Position._createBefore(item), writer.createPositionAfter(item));\n const version = range.root.document ? doc.version : null;\n operation = new AttributeOperation(range, key, previousValue, value, version);\n }\n writer.batch.addOperation(operation);\n model.applyOperation(operation);\n }\n}\n/**\n * Creates and applies marker operation to {@link module:engine/model/operation/operation~Operation operation}.\n */\nfunction applyMarkerOperation(writer, name, oldRange, newRange, affectsData) {\n const model = writer.model;\n const doc = model.document;\n const operation = new MarkerOperation(name, oldRange, newRange, model.markers, !!affectsData, doc.version);\n writer.batch.addOperation(operation);\n model.applyOperation(operation);\n}\n/**\n * Creates `MoveOperation` or `DetachOperation` that removes `howMany` nodes starting from `position`.\n * The operation will be applied on given model instance and added to given operation instance.\n *\n * @param position Position from which nodes are removed.\n * @param howMany Number of nodes to remove.\n * @param batch Batch to which the operation will be added.\n * @param model Model instance on which operation will be applied.\n */\nfunction applyRemoveOperation(position, howMany, batch, model) {\n let operation;\n if (position.root.document) {\n const doc = model.document;\n const graveyardPosition = new Position(doc.graveyard, [0]);\n operation = new MoveOperation(position, howMany, graveyardPosition, doc.version);\n }\n else {\n operation = new DetachOperation(position, howMany);\n }\n batch.addOperation(operation);\n model.applyOperation(operation);\n}\n/**\n * Returns `true` if both root elements are the same element or both are documents root elements.\n *\n * Elements in the same tree can be moved (for instance you can move element form one documents root to another, or\n * within the same document fragment), but when element supposed to be moved from document fragment to the document, or\n * to another document it should be removed and inserted to avoid problems with OT. This is because features like undo or\n * collaboration may track changes on the document but ignore changes on detached fragments and should not get\n * unexpected `move` operation.\n */\nfunction isSameTree(rootA, rootB) {\n // If it is the same root this is the same tree.\n if (rootA === rootB) {\n return true;\n }\n // If both roots are documents root it is operation within the document what we still treat as the same tree.\n if (rootA instanceof RootElement && rootB instanceof RootElement) {\n return true;\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/deletecontent\n */\nimport DocumentSelection from '../documentselection.js';\nimport LivePosition from '../liveposition.js';\nimport Range from '../range.js';\n/**\n * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.\n *\n * **Note:** Use {@link module:engine/model/model~Model#deleteContent} instead of this function.\n * This function is only exposed to be reusable in algorithms\n * which change the {@link module:engine/model/model~Model#deleteContent}\n * method's behavior.\n *\n * @param model The model in context of which the insertion should be performed.\n * @param selection Selection of which the content should be deleted.\n * @param options.leaveUnmerged Whether to merge elements after removing the content of the selection.\n *\n * For example `<heading>x[x</heading><paragraph>y]y</paragraph>` will become:\n *\n * * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)\n * * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).\n *\n * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}\n * elements will not be merged.\n *\n * @param options.doNotResetEntireContent Whether to skip replacing the entire content with a\n * paragraph when the entire content was selected.\n *\n * For example `<heading>[x</heading><paragraph>y]</paragraph>` will become:\n *\n * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)\n * * `<heading>^</heading>` with enabled (`doNotResetEntireContent == true`).\n *\n * @param options.doNotAutoparagraph Whether to create a paragraph if after content deletion selection is moved\n * to a place where text cannot be inserted.\n *\n * For example `<paragraph>x</paragraph>[<imageBlock src=\"foo.jpg\"></imageBlock>]` will become:\n *\n * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)\n * * `<paragraph>x</paragraph>[]` with the option enabled (`doNotAutoparagraph == true`).\n *\n * If you use this option you need to make sure to handle invalid selections yourself or leave\n * them to the selection post-fixer (may not always work).\n *\n * **Note:** If there is no valid position for the selection, the paragraph will always be created:\n *\n * `[<imageBlock src=\"foo.jpg\"></imageBlock>]` -> `<paragraph>[]</paragraph>`.\n */\nexport default function deleteContent(model, selection, options = {}) {\n if (selection.isCollapsed) {\n return;\n }\n const selRange = selection.getFirstRange();\n // If the selection is already removed, don't do anything.\n if (selRange.root.rootName == '$graveyard') {\n return;\n }\n const schema = model.schema;\n model.change(writer => {\n // 1. Replace the entire content with paragraph.\n // See: https://github.com/ckeditor/ckeditor5-engine/issues/1012#issuecomment-315017594.\n if (!options.doNotResetEntireContent && shouldEntireContentBeReplacedWithParagraph(schema, selection)) {\n replaceEntireContentWithParagraph(writer, selection);\n return;\n }\n // Collect attributes to copy in case of autoparagraphing.\n const attributesForAutoparagraph = {};\n if (!options.doNotAutoparagraph) {\n const selectedElement = selection.getSelectedElement();\n if (selectedElement) {\n Object.assign(attributesForAutoparagraph, schema.getAttributesWithProperty(selectedElement, 'copyOnReplace', true));\n }\n }\n // Get the live positions for the range adjusted to span only blocks selected from the user perspective.\n const [startPosition, endPosition] = getLivePositionsForSelectedBlocks(selRange);\n // 2. Remove the content if there is any.\n if (!startPosition.isTouching(endPosition)) {\n writer.remove(writer.createRange(startPosition, endPosition));\n }\n // 3. Merge elements in the right branch to the elements in the left branch.\n // The only reasonable (in terms of data and selection correctness) case in which we need to do that is:\n //\n // <heading type=1>Fo[</heading><paragraph>]ar</paragraph> => <heading type=1>Fo^ar</heading>\n //\n // However, the algorithm supports also merging deeper structures (up to the depth of the shallower branch),\n // as it's hard to imagine what should actually be the default behavior. Usually, specific features will\n // want to override that behavior anyway.\n if (!options.leaveUnmerged) {\n mergeBranches(writer, startPosition, endPosition);\n // TMP this will be replaced with a postfixer.\n // We need to check and strip disallowed attributes in all nested nodes because after merge\n // some attributes could end up in a path where are disallowed.\n //\n // e.g. bold is disallowed for <H1>\n // <h1>Fo{o</h1><p>b}a<b>r</b><p> -> <h1>Fo{}a<b>r</b><h1> -> <h1>Fo{}ar<h1>.\n schema.removeDisallowedAttributes(startPosition.parent.getChildren(), writer);\n }\n collapseSelectionAt(writer, selection, startPosition);\n // 4. Add a paragraph to set selection in it.\n // Check if a text is allowed in the new container. If not, try to create a new paragraph (if it's allowed here).\n // If autoparagraphing is off, we assume that you know what you do so we leave the selection wherever it was.\n if (!options.doNotAutoparagraph && shouldAutoparagraph(schema, startPosition)) {\n insertParagraph(writer, startPosition, selection, attributesForAutoparagraph);\n }\n startPosition.detach();\n endPosition.detach();\n });\n}\n/**\n * Returns the live positions for the range adjusted to span only blocks selected from the user perspective. Example:\n *\n * ```\n * <heading1>[foo</heading1>\n * <paragraph>bar</paragraph>\n * <heading1>]abc</heading1> <-- this block is not considered as selected\n * ```\n *\n * This is the same behavior as in Selection#getSelectedBlocks() \"special case\".\n */\nfunction getLivePositionsForSelectedBlocks(range) {\n const model = range.root.document.model;\n const startPosition = range.start;\n let endPosition = range.end;\n // If the end of selection is at the start position of last block in the selection, then\n // shrink it to not include that trailing block. Note that this should happen only for not empty selection.\n if (model.hasContent(range, { ignoreMarkers: true })) {\n const endBlock = getParentBlock(endPosition);\n if (endBlock && endPosition.isTouching(model.createPositionAt(endBlock, 0))) {\n // Create forward selection as a probe to find a valid position after excluding last block from the range.\n const selection = model.createSelection(range);\n // Modify the forward selection in backward direction to shrink it and remove first position of following block from it.\n // This is how modifySelection works and here we are making use of it.\n model.modifySelection(selection, { direction: 'backward' });\n const newEndPosition = selection.getLastPosition();\n // For such a model and selection:\n // <paragraph>A[</paragraph><imageBlock></imageBlock><paragraph>]B</paragraph>\n //\n // After modifySelection(), we would end up with this:\n // <paragraph>A[</paragraph>]<imageBlock></imageBlock><paragraph>B</paragraph>\n //\n // So we need to check if there is no content in the skipped range (because we want to include the <imageBlock>).\n const skippedRange = model.createRange(newEndPosition, endPosition);\n if (!model.hasContent(skippedRange, { ignoreMarkers: true })) {\n endPosition = newEndPosition;\n }\n }\n }\n return [\n LivePosition.fromPosition(startPosition, 'toPrevious'),\n LivePosition.fromPosition(endPosition, 'toNext')\n ];\n}\n/**\n * Finds the lowest element in position's ancestors which is a block.\n * Returns null if a limit element is encountered before reaching a block element.\n */\nfunction getParentBlock(position) {\n const element = position.parent;\n const schema = element.root.document.model.schema;\n const ancestors = element.getAncestors({ parentFirst: true, includeSelf: true });\n for (const element of ancestors) {\n if (schema.isLimit(element)) {\n return null;\n }\n if (schema.isBlock(element)) {\n return element;\n }\n }\n}\n/**\n * This function is a result of reaching the Ballmer's peak for just the right amount of time.\n * Even I had troubles documenting it after a while and after reading it again I couldn't believe that it really works.\n */\nfunction mergeBranches(writer, startPosition, endPosition) {\n const model = writer.model;\n // Verify if there is a need and possibility to merge.\n if (!checkShouldMerge(writer.model.schema, startPosition, endPosition)) {\n return;\n }\n // If the start element on the common ancestor level is empty, and the end element on the same level is not empty\n // then merge those to the right element so that it's properties are preserved (name, attributes).\n // Because of OT merging is used instead of removing elements.\n //\n // Merge left:\n // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>\n // <paragraph>]bar</paragraph> -> --^\n //\n // Merge right:\n // <heading1>[</heading1> ->\n // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>\n //\n // Merge left:\n // <blockQuote> -> <blockQuote>\n // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>\n // <paragraph>]bar</paragraph> -> --^\n // </blockQuote> -> </blockQuote>\n //\n // Merge right:\n // <blockQuote> -> <blockQuote>\n // <heading1>[</heading1> ->\n // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>\n // </blockQuote> -> </blockQuote>\n // Merging should not go deeper than common ancestor.\n const [startAncestor, endAncestor] = getAncestorsJustBelowCommonAncestor(startPosition, endPosition);\n // Branches can't be merged if one of the positions is directly inside a common ancestor.\n //\n // Example:\n // <blockQuote>\n // <paragraph>[foo</paragraph>]\n // <table> ... </table>\n // <blockQuote>\n //\n if (!startAncestor || !endAncestor) {\n return;\n }\n if (!model.hasContent(startAncestor, { ignoreMarkers: true }) && model.hasContent(endAncestor, { ignoreMarkers: true })) {\n mergeBranchesRight(writer, startPosition, endPosition, startAncestor.parent);\n }\n else {\n mergeBranchesLeft(writer, startPosition, endPosition, startAncestor.parent);\n }\n}\n/**\n * Merging blocks to the left (properties of the left block are preserved).\n * Simple example:\n *\n * ```\n * <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>]\n * <paragraph>]bar</paragraph> -> --^\n * ```\n *\n * Nested example:\n *\n * ```\n * <blockQuote> -> <blockQuote>\n * <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>\n * </blockQuote> -> </blockQuote>] ^\n * <blockBlock> -> |\n * <paragraph>]bar</paragraph> -> ---\n * </blockBlock> ->\n * ```\n */\nfunction mergeBranchesLeft(writer, startPosition, endPosition, commonAncestor) {\n const startElement = startPosition.parent;\n const endElement = endPosition.parent;\n // Merging reached the common ancestor element, stop here.\n if (startElement == commonAncestor || endElement == commonAncestor) {\n return;\n }\n // Remember next positions to merge in next recursive step (also used as modification points pointers).\n startPosition = writer.createPositionAfter(startElement);\n endPosition = writer.createPositionBefore(endElement);\n // Move endElement just after startElement if they aren't siblings.\n if (!endPosition.isEqual(startPosition)) {\n //\n // <blockQuote> -> <blockQuote>\n // <heading1>foo[</heading1> -> <heading1>foo</heading1>[<paragraph>bar</paragraph>\n // </blockQuote> -> </blockQuote> ^\n // <blockBlock> -> <blockBlock> |\n // <paragraph>]bar</paragraph> -> ] ---\n // </blockBlock> -> </blockBlock>\n //\n writer.insert(endElement, startPosition);\n }\n // Merge two siblings (nodes on sides of startPosition):\n //\n // <blockQuote> -> <blockQuote>\n // <heading1>foo</heading1>[<paragraph>bar</paragraph> -> <heading1>foo[bar</heading1>\n // </blockQuote> -> </blockQuote>\n // <blockBlock> -> <blockBlock>\n // ] -> ]\n // </blockBlock> -> </blockBlock>\n //\n // Or in simple case (without moving elements in above if):\n // <heading1>foo</heading1>[<paragraph>bar</paragraph>] -> <heading1>foo[bar</heading1>]\n //\n writer.merge(startPosition);\n // Remove empty end ancestors:\n //\n // <blockQuote> -> <blockQuote>\n // <heading1>foo[bar</heading1> -> <heading1>foo[bar</heading1>\n // </blockQuote> -> </blockQuote>\n // <blockBlock> ->\n // ] -> ]\n // </blockBlock> ->\n //\n while (endPosition.parent.isEmpty) {\n const parentToRemove = endPosition.parent;\n endPosition = writer.createPositionBefore(parentToRemove);\n writer.remove(parentToRemove);\n }\n // Verify if there is a need and possibility to merge next level.\n if (!checkShouldMerge(writer.model.schema, startPosition, endPosition)) {\n return;\n }\n // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).\n mergeBranchesLeft(writer, startPosition, endPosition, commonAncestor);\n}\n/**\n * Merging blocks to the right (properties of the right block are preserved).\n * Simple example:\n *\n * ```\n * <heading1>foo[</heading1> -> --v\n * <paragraph>]bar</paragraph> -> [<paragraph>foo]bar</paragraph>\n * ```\n *\n * Nested example:\n *\n * ```\n * <blockQuote> ->\n * <heading1>foo[</heading1> -> ---\n * </blockQuote> -> |\n * <blockBlock> -> [<blockBlock> v\n * <paragraph>]bar</paragraph> -> <paragraph>foo]bar</paragraph>\n * </blockBlock> -> </blockBlock>\n * ```\n */\nfunction mergeBranchesRight(writer, startPosition, endPosition, commonAncestor) {\n const startElement = startPosition.parent;\n const endElement = endPosition.parent;\n // Merging reached the common ancestor element, stop here.\n if (startElement == commonAncestor || endElement == commonAncestor) {\n return;\n }\n // Remember next positions to merge in next recursive step (also used as modification points pointers).\n startPosition = writer.createPositionAfter(startElement);\n endPosition = writer.createPositionBefore(endElement);\n // Move startElement just before endElement if they aren't siblings.\n if (!endPosition.isEqual(startPosition)) {\n //\n // <blockQuote> -> <blockQuote>\n // <heading1>foo[</heading1> -> [ ---\n // </blockQuote> -> </blockQuote> |\n // <blockBlock> -> <blockBlock> v\n // <paragraph>]bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>\n // </blockBlock> -> </blockBlock>\n //\n writer.insert(startElement, endPosition);\n }\n // Remove empty end ancestors:\n //\n // <blockQuote> ->\n // [ -> [\n // </blockQuote> ->\n // <blockBlock> -> <blockBlock>\n // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>\n // </blockBlock> -> </blockBlock>\n //\n while (startPosition.parent.isEmpty) {\n const parentToRemove = startPosition.parent;\n startPosition = writer.createPositionBefore(parentToRemove);\n writer.remove(parentToRemove);\n }\n // Update endPosition after inserting and removing elements.\n endPosition = writer.createPositionBefore(endElement);\n // Merge right two siblings (nodes on sides of endPosition):\n // ->\n // [ -> [\n // ->\n // <blockBlock> -> <blockBlock>\n // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <paragraph>foo]bar</paragraph>\n // </blockBlock> -> </blockBlock>\n //\n // Or in simple case (without moving elements in above if):\n // [<heading1>foo</heading1>]<paragraph>bar</paragraph> -> [<heading1>foo]bar</heading1>\n //\n mergeRight(writer, endPosition);\n // Verify if there is a need and possibility to merge next level.\n if (!checkShouldMerge(writer.model.schema, startPosition, endPosition)) {\n return;\n }\n // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).\n mergeBranchesRight(writer, startPosition, endPosition, commonAncestor);\n}\n/**\n * There is no right merge operation so we need to simulate it.\n */\nfunction mergeRight(writer, position) {\n const startElement = position.nodeBefore;\n const endElement = position.nodeAfter;\n if (startElement.name != endElement.name) {\n writer.rename(startElement, endElement.name);\n }\n writer.clearAttributes(startElement);\n writer.setAttributes(Object.fromEntries(endElement.getAttributes()), startElement);\n writer.merge(position);\n}\n/**\n * Verifies if merging is needed and possible. It's not needed if both positions are in the same element\n * and it's not possible if some element is a limit or the range crosses a limit element.\n */\nfunction checkShouldMerge(schema, startPosition, endPosition) {\n const startElement = startPosition.parent;\n const endElement = endPosition.parent;\n // If both positions ended up in the same parent, then there's nothing more to merge:\n // <$root><p>x[</p><p>]y</p></$root> => <$root><p>xy</p>[]</$root>\n if (startElement == endElement) {\n return false;\n }\n // If one of the positions is a limit element, then there's nothing to merge because we don't want to cross the limit boundaries.\n if (schema.isLimit(startElement) || schema.isLimit(endElement)) {\n return false;\n }\n // Check if operations we'll need to do won't need to cross object or limit boundaries.\n // E.g., we can't merge endElement into startElement in this case:\n // <limit><startElement>x[</startElement></limit><endElement>]</endElement>\n return isCrossingLimitElement(startPosition, endPosition, schema);\n}\n/**\n * Returns the elements that are the ancestors of the provided positions that are direct children of the common ancestor.\n */\nfunction getAncestorsJustBelowCommonAncestor(positionA, positionB) {\n const ancestorsA = positionA.getAncestors();\n const ancestorsB = positionB.getAncestors();\n let i = 0;\n while (ancestorsA[i] && ancestorsA[i] == ancestorsB[i]) {\n i++;\n }\n return [ancestorsA[i], ancestorsB[i]];\n}\nfunction shouldAutoparagraph(schema, position) {\n const isTextAllowed = schema.checkChild(position, '$text');\n const isParagraphAllowed = schema.checkChild(position, 'paragraph');\n return !isTextAllowed && isParagraphAllowed;\n}\n/**\n * Check if parents of two positions can be merged by checking if there are no limit/object\n * boundaries between those two positions.\n *\n * E.g. in <bQ><p>x[]</p></bQ><widget><caption>{}</caption></widget>\n * we'll check <p>, <bQ>, <widget> and <caption>.\n * Usually, widget and caption are marked as objects/limits in the schema, so in this case merging will be blocked.\n */\nfunction isCrossingLimitElement(leftPos, rightPos, schema) {\n const rangeToCheck = new Range(leftPos, rightPos);\n for (const value of rangeToCheck.getWalker()) {\n if (schema.isLimit(value.item)) {\n return false;\n }\n }\n return true;\n}\nfunction insertParagraph(writer, position, selection, attributes = {}) {\n const paragraph = writer.createElement('paragraph');\n writer.model.schema.setAllowedAttributes(paragraph, attributes, writer);\n writer.insert(paragraph, position);\n collapseSelectionAt(writer, selection, writer.createPositionAt(paragraph, 0));\n}\nfunction replaceEntireContentWithParagraph(writer, selection) {\n const limitElement = writer.model.schema.getLimitElement(selection);\n writer.remove(writer.createRangeIn(limitElement));\n insertParagraph(writer, writer.createPositionAt(limitElement, 0), selection);\n}\n/**\n * We want to replace the entire content with a paragraph when:\n * * the entire content is selected,\n * * selection contains at least two elements,\n * * whether the paragraph is allowed in schema in the common ancestor.\n */\nfunction shouldEntireContentBeReplacedWithParagraph(schema, selection) {\n const limitElement = schema.getLimitElement(selection);\n if (!selection.containsEntireContent(limitElement)) {\n return false;\n }\n const range = selection.getFirstRange();\n if (range.start.parent == range.end.parent) {\n return false;\n }\n return schema.checkChild(limitElement, 'paragraph');\n}\n/**\n * Helper function that sets the selection. Depending whether given `selection` is a document selection or not,\n * uses a different method to set it.\n */\nfunction collapseSelectionAt(writer, selection, positionOrRange) {\n if (selection instanceof DocumentSelection) {\n writer.setSelection(positionOrRange);\n }\n else {\n selection.setTo(positionOrRange);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/getselectedcontent\n */\n/**\n * Gets a clone of the selected content.\n *\n * For example, for the following selection:\n *\n * ```html\n * <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>\n * ```\n *\n * It will return a document fragment with such a content:\n *\n * ```html\n * <quote><h>st</h></quote><p>se</p>\n * ```\n *\n * @param model The model in context of which the selection modification should be performed.\n * @param selection The selection of which content will be returned.\n */\nexport default function getSelectedContent(model, selection) {\n return model.change(writer => {\n const frag = writer.createDocumentFragment();\n const range = selection.getFirstRange();\n if (!range || range.isCollapsed) {\n return frag;\n }\n const root = range.start.root;\n const commonPath = range.start.getCommonPath(range.end);\n const commonParent = root.getNodeByPath(commonPath);\n // ## 1st step\n //\n // First, we'll clone a fragment represented by a minimal flat range\n // containing the original range to be cloned.\n // E.g. let's consider such a range:\n //\n // <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>\n //\n // A minimal flat range containing this one is:\n //\n // <p>x</p>[<quote><p>y</p><h>first</h></quote><p>second</p>]<p>z</p>\n //\n // We can easily clone this structure, preserving e.g. the <quote> element.\n let flatSubtreeRange;\n if (range.start.parent == range.end.parent) {\n // The original range is flat, so take it.\n flatSubtreeRange = range;\n }\n else {\n flatSubtreeRange = writer.createRange(writer.createPositionAt(commonParent, range.start.path[commonPath.length]), writer.createPositionAt(commonParent, range.end.path[commonPath.length] + 1));\n }\n const howMany = flatSubtreeRange.end.offset - flatSubtreeRange.start.offset;\n // Clone the whole contents.\n for (const item of flatSubtreeRange.getItems({ shallow: true })) {\n if (item.is('$textProxy')) {\n writer.appendText(item.data, item.getAttributes(), frag);\n }\n else {\n writer.append(writer.cloneElement(item, true), frag);\n }\n }\n // ## 2nd step\n //\n // If the original range wasn't flat, then we need to remove the excess nodes from the both ends of the cloned fragment.\n //\n // For example, for the range shown in the 1st step comment, we need to remove these pieces:\n //\n // <quote>[<p>y</p>]<h>[fir]st</h></quote><p>se[cond]</p>\n //\n // So this will be the final copied content:\n //\n // <quote><h>st</h></quote><p>se</p>\n //\n // In order to do that, we remove content from these two ranges:\n //\n // [<quote><p>y</p><h>fir]st</h></quote><p>se[cond</p>]\n if (flatSubtreeRange != range) {\n // Find the position of the original range in the cloned fragment.\n const newRange = range._getTransformedByMove(flatSubtreeRange.start, writer.createPositionAt(frag, 0), howMany)[0];\n const leftExcessRange = writer.createRange(writer.createPositionAt(frag, 0), newRange.start);\n const rightExcessRange = writer.createRange(newRange.end, writer.createPositionAt(frag, 'end'));\n removeRangeContent(rightExcessRange, writer);\n removeRangeContent(leftExcessRange, writer);\n }\n return frag;\n });\n}\n// After https://github.com/ckeditor/ckeditor5-engine/issues/690 is fixed,\n// this function will, most likely, be able to rewritten using getMinimalFlatRanges().\nfunction removeRangeContent(range, writer) {\n const parentsToCheck = [];\n Array.from(range.getItems({ direction: 'backward' }))\n // We should better store ranges because text proxies will lose integrity\n // with the text nodes when we'll start removing content.\n .map(item => writer.createRangeOn(item))\n // Filter only these items which are fully contained in the passed range.\n //\n // E.g. for the following range: [<quote><p>y</p><h>fir]st</h>\n // the walker will return the entire <h> element, when only the \"fir\" item inside it is fully contained.\n .filter(itemRange => {\n // We should be able to use Range.containsRange, but https://github.com/ckeditor/ckeditor5-engine/issues/691.\n const contained = (itemRange.start.isAfter(range.start) || itemRange.start.isEqual(range.start)) &&\n (itemRange.end.isBefore(range.end) || itemRange.end.isEqual(range.end));\n return contained;\n })\n .forEach(itemRange => {\n parentsToCheck.push(itemRange.start.parent);\n writer.remove(itemRange);\n });\n // Remove ancestors of the removed items if they turned to be empty now\n // (their whole content was contained in the range).\n parentsToCheck.forEach(parentToCheck => {\n let parent = parentToCheck;\n while (parent.parent && parent.isEmpty) {\n const removeRange = writer.createRangeOn(parent);\n parent = parent.parent;\n writer.remove(removeRange);\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/insertcontent\n */\nimport DocumentSelection from '../documentselection.js';\nimport Element from '../element.js';\nimport LivePosition from '../liveposition.js';\nimport LiveRange from '../liverange.js';\nimport Position from '../position.js';\nimport Range from '../range.js';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Inserts content into the editor (specified selection) as one would expect the paste functionality to work.\n *\n * It takes care of removing the selected content, splitting elements (if needed), inserting elements and merging elements appropriately.\n *\n * Some examples:\n *\n * ```html\n * <p>x^</p> + <p>y</p> => <p>x</p><p>y</p> => <p>xy[]</p>\n * <p>x^y</p> + <p>z</p> => <p>x</p>^<p>y</p> + <p>z</p> => <p>x</p><p>z</p><p>y</p> => <p>xz[]y</p>\n * <p>x^y</p> + <img /> => <p>x</p>^<p>y</p> + <img /> => <p>x</p><img /><p>y</p>\n * <p>x</p><p>^</p><p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p> (no merging)\n * <p>x</p>[<img />]<p>z</p> + <p>y</p> => <p>x</p>^<p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p>\n * ```\n *\n * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified\n * to the insertion selection (equal to a range to be selected after insertion).\n *\n * If `selectable` is not passed, the content will be inserted using the current selection of the model document.\n *\n * **Note:** Use {@link module:engine/model/model~Model#insertContent} instead of this function.\n * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertContent}\n * method's behavior.\n *\n * @param model The model in context of which the insertion should be performed.\n * @param content The content to insert.\n * @param selectable Selection into which the content should be inserted.\n * @param placeOrOffset Sets place or offset of the selection.\n * @returns Range which contains all the performed changes. This is a range that, if removed,\n * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed\n * at the insertion position.\n */\nexport default function insertContent(model, content, selectable) {\n return model.change(writer => {\n const selection = selectable ? selectable : model.document.selection;\n if (!selection.isCollapsed) {\n model.deleteContent(selection, { doNotAutoparagraph: true });\n }\n const insertion = new Insertion(model, writer, selection.anchor);\n const fakeMarkerElements = [];\n let nodesToInsert;\n if (content.is('documentFragment')) {\n // If document fragment has any markers, these markers should be inserted into the model as well.\n if (content.markers.size) {\n const markersPosition = [];\n for (const [name, range] of content.markers) {\n const { start, end } = range;\n const isCollapsed = start.isEqual(end);\n markersPosition.push({ position: start, name, isCollapsed }, { position: end, name, isCollapsed });\n }\n // Markers position is sorted backwards to ensure that the insertion of fake markers will not change\n // the position of the next markers.\n markersPosition.sort(({ position: posA }, { position: posB }) => posA.isBefore(posB) ? 1 : -1);\n for (const { position, name, isCollapsed } of markersPosition) {\n let fakeElement = null;\n let collapsed = null;\n const isAtBeginning = position.parent === content && position.isAtStart;\n const isAtEnd = position.parent === content && position.isAtEnd;\n // We have two ways of handling markers. In general, we want to add temporary <$marker> model elements to\n // represent marker boundaries. These elements will be inserted into content together with the rest\n // of the document fragment. After insertion is done, positions for these elements will be read\n // and proper, actual markers will be created in the model and fake elements will be removed.\n //\n // However, if the <$marker> element is at the beginning or at the end of the document fragment,\n // it may affect how the inserted content is merged with current model, impacting the insertion\n // result. To avoid that, we don't add <$marker> elements at these positions. Instead, we will use\n // `Insertion#getAffectedRange()` to figure out new positions for these marker boundaries.\n if (!isAtBeginning && !isAtEnd) {\n fakeElement = writer.createElement('$marker');\n writer.insert(fakeElement, position);\n }\n else if (isCollapsed) {\n // Save whether the collapsed marker was at the beginning or at the end of document fragment\n // to know where to create it after the insertion is done.\n collapsed = isAtBeginning ? 'start' : 'end';\n }\n fakeMarkerElements.push({\n name,\n element: fakeElement,\n collapsed\n });\n }\n }\n nodesToInsert = content.getChildren();\n }\n else {\n nodesToInsert = [content];\n }\n insertion.handleNodes(nodesToInsert);\n let newRange = insertion.getSelectionRange();\n if (content.is('documentFragment') && fakeMarkerElements.length) {\n // After insertion was done, the selection was set but the model contains fake <$marker> elements.\n // These <$marker> elements will be now removed. Because of that, we will need to fix the selection.\n // We will create a live range that will automatically be update as <$marker> elements are removed.\n const selectionLiveRange = newRange ? LiveRange.fromRange(newRange) : null;\n // Marker name -> [ start position, end position ].\n const markersData = {};\n // Note: `fakeMarkerElements` are sorted backwards. However, now, we want to handle the markers\n // from the beginning, so that existing <$marker> elements do not affect markers positions.\n // This is why we iterate from the end to the start.\n for (let i = fakeMarkerElements.length - 1; i >= 0; i--) {\n const { name, element, collapsed } = fakeMarkerElements[i];\n const isStartBoundary = !markersData[name];\n if (isStartBoundary) {\n markersData[name] = [];\n }\n if (element) {\n // Read fake marker element position to learn where the marker should be created.\n const elementPosition = writer.createPositionAt(element, 'before');\n markersData[name].push(elementPosition);\n writer.remove(element);\n }\n else {\n // If the fake marker element does not exist, it means that the marker boundary was at the beginning or at the end.\n const rangeOnInsertion = insertion.getAffectedRange();\n if (!rangeOnInsertion) {\n // If affected range is `null` it means that nothing was in the document fragment or all content was filtered out.\n // Some markers that were in the filtered content may be removed (partially or totally).\n // Let's handle only those markers that were at the beginning or at the end of the document fragment.\n if (collapsed) {\n markersData[name].push(insertion.position);\n }\n continue;\n }\n if (collapsed) {\n // If the marker was collapsed at the beginning or at the end of the document fragment,\n // put both boundaries at the beginning or at the end of inserted range (to keep the marker collapsed).\n markersData[name].push(rangeOnInsertion[collapsed]);\n }\n else {\n markersData[name].push(isStartBoundary ? rangeOnInsertion.start : rangeOnInsertion.end);\n }\n }\n }\n for (const [name, [start, end]] of Object.entries(markersData)) {\n // For now, we ignore markers if they are included in the filtered-out content.\n // In the future implementation we will improve that case to create markers that are not filtered out completely.\n if (start && end && start.root === end.root && start.root.document && !writer.model.markers.has(name)) {\n writer.addMarker(name, {\n usingOperation: true,\n affectsData: true,\n range: new Range(start, end)\n });\n }\n }\n if (selectionLiveRange) {\n newRange = selectionLiveRange.toRange();\n selectionLiveRange.detach();\n }\n }\n /* istanbul ignore else -- @preserve */\n if (newRange) {\n if (selection instanceof DocumentSelection) {\n writer.setSelection(newRange);\n }\n else {\n selection.setTo(newRange);\n }\n }\n else {\n // We are not testing else because it's a safe check for unpredictable edge cases:\n // an insertion without proper range to select.\n //\n // @if CK_DEBUG // console.warn( 'Cannot determine a proper selection range after insertion.' );\n }\n const affectedRange = insertion.getAffectedRange() || model.createRange(selection.anchor);\n insertion.destroy();\n return affectedRange;\n });\n}\n/**\n * Utility class for performing content insertion.\n */\nclass Insertion {\n constructor(model, writer, position) {\n /**\n * The reference to the first inserted node.\n */\n this._firstNode = null;\n /**\n * The reference to the last inserted node.\n */\n this._lastNode = null;\n /**\n * The reference to the last auto paragraph node.\n */\n this._lastAutoParagraph = null;\n /**\n * The array of nodes that should be cleaned of not allowed attributes.\n */\n this._filterAttributesOf = [];\n /**\n * Beginning of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.\n */\n this._affectedStart = null;\n /**\n * End of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.\n */\n this._affectedEnd = null;\n this._nodeToSelect = null;\n this.model = model;\n this.writer = writer;\n this.position = position;\n this.canMergeWith = new Set([this.position.parent]);\n this.schema = model.schema;\n this._documentFragment = writer.createDocumentFragment();\n this._documentFragmentPosition = writer.createPositionAt(this._documentFragment, 0);\n }\n /**\n * Handles insertion of a set of nodes.\n *\n * @param nodes Nodes to insert.\n */\n handleNodes(nodes) {\n for (const node of Array.from(nodes)) {\n this._handleNode(node);\n }\n // Insert nodes collected in temporary DocumentFragment.\n this._insertPartialFragment();\n // If there was an auto paragraph then we might need to adjust the end of insertion.\n if (this._lastAutoParagraph) {\n this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph);\n }\n // After the content was inserted we may try to merge it with its next sibling if the selection was in it initially.\n // Merging with the previous sibling was performed just after inserting the first node to the document.\n this._mergeOnRight();\n // TMP this will become a post-fixer.\n this.schema.removeDisallowedAttributes(this._filterAttributesOf, this.writer);\n this._filterAttributesOf = [];\n }\n /**\n * Updates the last node after the auto paragraphing.\n *\n * @param node The last auto paragraphing node.\n */\n _updateLastNodeFromAutoParagraph(node) {\n const positionAfterLastNode = this.writer.createPositionAfter(this._lastNode);\n const positionAfterNode = this.writer.createPositionAfter(node);\n // If the real end was after the last auto paragraph then update relevant properties.\n if (positionAfterNode.isAfter(positionAfterLastNode)) {\n this._lastNode = node;\n /* istanbul ignore if -- @preserve */\n if (this.position.parent != node || !this.position.isAtEnd) {\n // Algorithm's correctness check. We should never end up here but it's good to know that we did.\n // At this point the insertion position should be at the end of the last auto paragraph.\n // Note: This error is documented in other place in this file.\n throw new CKEditorError('insertcontent-invalid-insertion-position', this);\n }\n this.position = positionAfterNode;\n this._setAffectedBoundaries(this.position);\n }\n }\n /**\n * Returns range to be selected after insertion.\n * Returns `null` if there is no valid range to select after insertion.\n */\n getSelectionRange() {\n if (this._nodeToSelect) {\n return Range._createOn(this._nodeToSelect);\n }\n return this.model.schema.getNearestSelectionRange(this.position);\n }\n /**\n * Returns a range which contains all the performed changes. This is a range that, if removed, would return the model to the state\n * before the insertion. Returns `null` if no changes were done.\n */\n getAffectedRange() {\n if (!this._affectedStart) {\n return null;\n }\n return new Range(this._affectedStart, this._affectedEnd);\n }\n /**\n * Destroys `Insertion` instance.\n */\n destroy() {\n if (this._affectedStart) {\n this._affectedStart.detach();\n }\n if (this._affectedEnd) {\n this._affectedEnd.detach();\n }\n }\n /**\n * Handles insertion of a single node.\n */\n _handleNode(node) {\n // Split the position.parent's branch up to a point where the node can be inserted.\n // If it isn't allowed in the whole branch, then of course don't split anything.\n if (!this._checkAndSplitToAllowedPosition(node)) {\n // Handle element children if it's not an object (strip container).\n if (!this.schema.isObject(node)) {\n this._handleDisallowedNode(node);\n }\n return;\n }\n // Add node to the current temporary DocumentFragment.\n this._appendToFragment(node);\n // Store the first and last nodes for easy access for merging with sibling nodes.\n if (!this._firstNode) {\n this._firstNode = node;\n }\n this._lastNode = node;\n }\n /**\n * Inserts the temporary DocumentFragment into the model.\n */\n _insertPartialFragment() {\n if (this._documentFragment.isEmpty) {\n return;\n }\n const livePosition = LivePosition.fromPosition(this.position, 'toNext');\n this._setAffectedBoundaries(this.position);\n // If the very first node of the whole insertion process is inserted, insert it separately for OT reasons (undo).\n // Note: there can be multiple calls to `_insertPartialFragment()` during one insertion process.\n // Note: only the very first node can be merged so we have to do separate operation only for it.\n if (this._documentFragment.getChild(0) == this._firstNode) {\n this.writer.insert(this._firstNode, this.position);\n // We must merge the first node just after inserting it to avoid problems with OT.\n // (See: https://github.com/ckeditor/ckeditor5/pull/8773#issuecomment-760945652).\n this._mergeOnLeft();\n this.position = livePosition.toPosition();\n }\n // Insert the remaining nodes from document fragment.\n if (!this._documentFragment.isEmpty) {\n this.writer.insert(this._documentFragment, this.position);\n }\n this._documentFragmentPosition = this.writer.createPositionAt(this._documentFragment, 0);\n this.position = livePosition.toPosition();\n livePosition.detach();\n }\n /**\n * @param node The disallowed node which needs to be handled.\n */\n _handleDisallowedNode(node) {\n // If the node is an element, try inserting its children (strip the parent).\n if (node.is('element')) {\n this.handleNodes(node.getChildren());\n }\n }\n /**\n * Append a node to the temporary DocumentFragment.\n *\n * @param node The node to insert.\n */\n _appendToFragment(node) {\n /* istanbul ignore if -- @preserve */\n if (!this.schema.checkChild(this.position, node)) {\n // Algorithm's correctness check. We should never end up here but it's good to know that we did.\n // Note that it would often be a silent issue if we insert node in a place where it's not allowed.\n /**\n * Given node cannot be inserted on the given position.\n *\n * @error insertcontent-wrong-position\n * @param node Node to insert.\n * @param position Position to insert the node at.\n */\n throw new CKEditorError('insertcontent-wrong-position', this, { node, position: this.position });\n }\n this.writer.insert(node, this._documentFragmentPosition);\n this._documentFragmentPosition = this._documentFragmentPosition.getShiftedBy(node.offsetSize);\n // The last inserted object should be selected because we can't put a collapsed selection after it.\n if (this.schema.isObject(node) && !this.schema.checkChild(this.position, '$text')) {\n this._nodeToSelect = node;\n }\n else {\n this._nodeToSelect = null;\n }\n this._filterAttributesOf.push(node);\n }\n /**\n * Sets `_affectedStart` and `_affectedEnd` to the given `position`. Should be used before a change is done during insertion process to\n * mark the affected range.\n *\n * This method is used before inserting a node or splitting a parent node. `_affectedStart` and `_affectedEnd` are also changed\n * during merging, but the logic there is more complicated so it is left out of this function.\n */\n _setAffectedBoundaries(position) {\n // Set affected boundaries stickiness so that those position will \"expand\" when something is inserted in between them:\n // <paragraph>Foo][bar</paragraph> -> <paragraph>Foo]xx[bar</paragraph>\n // This is why it cannot be a range but two separate positions.\n if (!this._affectedStart) {\n this._affectedStart = LivePosition.fromPosition(position, 'toPrevious');\n }\n // If `_affectedEnd` is before the new boundary position, expand `_affectedEnd`. This can happen if first inserted node was\n // inserted into the parent but the next node is moved-out of that parent:\n // (1) <paragraph>Foo][</paragraph> -> <paragraph>Foo]xx[</paragraph>\n // (2) <paragraph>Foo]xx[</paragraph> -> <paragraph>Foo]xx</paragraph><widget></widget>[\n if (!this._affectedEnd || this._affectedEnd.isBefore(position)) {\n if (this._affectedEnd) {\n this._affectedEnd.detach();\n }\n this._affectedEnd = LivePosition.fromPosition(position, 'toNext');\n }\n }\n /**\n * Merges the previous sibling of the first node if it should be merged.\n *\n * After the content was inserted we may try to merge it with its siblings.\n * This should happen only if the selection was in those elements initially.\n */\n _mergeOnLeft() {\n const node = this._firstNode;\n if (!(node instanceof Element)) {\n return;\n }\n if (!this._canMergeLeft(node)) {\n return;\n }\n const mergePosLeft = LivePosition._createBefore(node);\n mergePosLeft.stickiness = 'toNext';\n const livePosition = LivePosition.fromPosition(this.position, 'toNext');\n // If `_affectedStart` is sames as merge position, it means that the element \"marked\" by `_affectedStart` is going to be\n // removed and its contents will be moved. This won't transform `LivePosition` so `_affectedStart` needs to be moved\n // by hand to properly reflect affected range. (Due to `_affectedStart` and `_affectedEnd` stickiness, the \"range\" is\n // shown as `][`).\n //\n // Example - insert `<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>` at the end of `<paragraph>Foo^</paragraph>`:\n //\n // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->\n // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph> -->\n // <paragraph>Foo]Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph>\n //\n // Note, that if we are here then something must have been inserted, so `_affectedStart` and `_affectedEnd` have to be set.\n if (this._affectedStart.isEqual(mergePosLeft)) {\n this._affectedStart.detach();\n this._affectedStart = LivePosition._createAt(mergePosLeft.nodeBefore, 'end', 'toPrevious');\n }\n // We need to update the references to the first and last nodes if they will be merged into the previous sibling node\n // because the reference would point to the removed node.\n //\n // <p>A^A</p> + <p>X</p>\n //\n // <p>A</p>^<p>A</p>\n // <p>A</p><p>X</p><p>A</p>\n // <p>AX</p><p>A</p>\n // <p>AXA</p>\n if (this._firstNode === this._lastNode) {\n this._firstNode = mergePosLeft.nodeBefore;\n this._lastNode = mergePosLeft.nodeBefore;\n }\n this.writer.merge(mergePosLeft);\n // If only one element (the merged one) is in the \"affected range\", also move the affected range end appropriately.\n //\n // Example - insert `<paragraph>Abc</paragraph>` at the of `<paragraph>Foo^</paragraph>`:\n //\n // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->\n // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph>[<paragraph>Bar</paragraph> -->\n // <paragraph>Foo]Abc</paragraph>[<paragraph>Bar</paragraph> -->\n // <paragraph>Foo]Abc[</paragraph><paragraph>Bar</paragraph>\n if (mergePosLeft.isEqual(this._affectedEnd) && this._firstNode === this._lastNode) {\n this._affectedEnd.detach();\n this._affectedEnd = LivePosition._createAt(mergePosLeft.nodeBefore, 'end', 'toNext');\n }\n this.position = livePosition.toPosition();\n livePosition.detach();\n // After merge elements that were marked by _insert() to be filtered might be gone so\n // we need to mark the new container.\n this._filterAttributesOf.push(this.position.parent);\n mergePosLeft.detach();\n }\n /**\n * Merges the next sibling of the last node if it should be merged.\n *\n * After the content was inserted we may try to merge it with its siblings.\n * This should happen only if the selection was in those elements initially.\n */\n _mergeOnRight() {\n const node = this._lastNode;\n if (!(node instanceof Element)) {\n return;\n }\n if (!this._canMergeRight(node)) {\n return;\n }\n const mergePosRight = LivePosition._createAfter(node);\n mergePosRight.stickiness = 'toNext';\n /* istanbul ignore if -- @preserve */\n if (!this.position.isEqual(mergePosRight)) {\n // Algorithm's correctness check. We should never end up here but it's good to know that we did.\n // At this point the insertion position should be after the node we'll merge. If it isn't,\n // it should need to be secured as in the left merge case.\n /**\n * An internal error occurred when merging inserted content with its siblings.\n * The insertion position should equal the merge position.\n *\n * If you encountered this error, report it back to the CKEditor 5 team\n * with as many details as possible regarding the content being inserted and the insertion position.\n *\n * @error insertcontent-invalid-insertion-position\n */\n throw new CKEditorError('insertcontent-invalid-insertion-position', this);\n }\n // Move the position to the previous node, so it isn't moved to the graveyard on merge.\n // <p>x</p>[]<p>y</p> => <p>x[]</p><p>y</p>\n this.position = Position._createAt(mergePosRight.nodeBefore, 'end');\n // Explanation of setting position stickiness to `'toPrevious'`:\n // OK: <p>xx[]</p> + <p>yy</p> => <p>xx[]yy</p> (when sticks to previous)\n // NOK: <p>xx[]</p> + <p>yy</p> => <p>xxyy[]</p> (when sticks to next)\n const livePosition = LivePosition.fromPosition(this.position, 'toPrevious');\n // See comment in `_mergeOnLeft()` on moving `_affectedStart`.\n if (this._affectedEnd.isEqual(mergePosRight)) {\n this._affectedEnd.detach();\n this._affectedEnd = LivePosition._createAt(mergePosRight.nodeBefore, 'end', 'toNext');\n }\n // We need to update the references to the first and last nodes if they will be merged into the previous sibling node\n // because the reference would point to the removed node.\n //\n // <p>A^A</p> + <p>X</p>\n //\n // <p>A</p>^<p>A</p>\n // <p>A</p><p>X</p><p>A</p>\n // <p>AX</p><p>A</p>\n // <p>AXA</p>\n if (this._firstNode === this._lastNode) {\n this._firstNode = mergePosRight.nodeBefore;\n this._lastNode = mergePosRight.nodeBefore;\n }\n this.writer.merge(mergePosRight);\n // See comment in `_mergeOnLeft()` on moving `_affectedStart`.\n if (mergePosRight.getShiftedBy(-1).isEqual(this._affectedStart) && this._firstNode === this._lastNode) {\n this._affectedStart.detach();\n this._affectedStart = LivePosition._createAt(mergePosRight.nodeBefore, 0, 'toPrevious');\n }\n this.position = livePosition.toPosition();\n livePosition.detach();\n // After merge elements that were marked by _insert() to be filtered might be gone so\n // we need to mark the new container.\n this._filterAttributesOf.push(this.position.parent);\n mergePosRight.detach();\n }\n /**\n * Checks whether specified node can be merged with previous sibling element.\n *\n * @param node The node which could potentially be merged.\n */\n _canMergeLeft(node) {\n const previousSibling = node.previousSibling;\n return (previousSibling instanceof Element) &&\n this.canMergeWith.has(previousSibling) &&\n this.model.schema.checkMerge(previousSibling, node);\n }\n /**\n * Checks whether specified node can be merged with next sibling element.\n *\n * @param node The node which could potentially be merged.\n */\n _canMergeRight(node) {\n const nextSibling = node.nextSibling;\n return (nextSibling instanceof Element) &&\n this.canMergeWith.has(nextSibling) &&\n this.model.schema.checkMerge(node, nextSibling);\n }\n /**\n * Inserts a paragraph and moves the insertion position into it.\n */\n _insertAutoParagraph() {\n // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.\n this._insertPartialFragment();\n // Insert a paragraph and move insertion position to it.\n const paragraph = this.writer.createElement('paragraph');\n this.writer.insert(paragraph, this.position);\n this._setAffectedBoundaries(this.position);\n this._lastAutoParagraph = paragraph;\n this.position = this.writer.createPositionAt(paragraph, 0);\n }\n /**\n * @returns Whether an allowed position was found.\n * `false` is returned if the node isn't allowed at any position up in the tree, `true` if was.\n */\n _checkAndSplitToAllowedPosition(node) {\n const allowedIn = this._getAllowedIn(this.position.parent, node);\n if (!allowedIn) {\n return false;\n }\n // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.\n if (allowedIn != this.position.parent) {\n this._insertPartialFragment();\n }\n while (allowedIn != this.position.parent) {\n if (this.position.isAtStart) {\n // If insertion position is at the beginning of the parent, move it out instead of splitting.\n // <p>^Foo</p> -> ^<p>Foo</p>\n const parent = this.position.parent;\n this.position = this.writer.createPositionBefore(parent);\n // Special case – parent is empty (<p>^</p>).\n //\n // 1. parent.isEmpty\n // We can remove the element after moving insertion position out of it.\n //\n // 2. parent.parent === allowedIn\n // However parent should remain in place when allowed element is above limit element in document tree.\n // For example there shouldn't be allowed to remove empty paragraph from tableCell, when is pasted\n // content allowed in $root.\n if (parent.isEmpty && parent.parent === allowedIn) {\n this.writer.remove(parent);\n }\n }\n else if (this.position.isAtEnd) {\n // If insertion position is at the end of the parent, move it out instead of splitting.\n // <p>Foo^</p> -> <p>Foo</p>^\n this.position = this.writer.createPositionAfter(this.position.parent);\n }\n else {\n const tempPos = this.writer.createPositionAfter(this.position.parent);\n this._setAffectedBoundaries(this.position);\n this.writer.split(this.position);\n this.position = tempPos;\n this.canMergeWith.add(this.position.nodeAfter);\n }\n }\n // At this point, we split elements up to the parent in which `node` is allowed.\n // Note that `_getAllowedIn()` checks if the `node` is allowed either directly, or when auto-paragraphed.\n // So, let's check if the `node` is allowed directly. If not, we need to auto-paragraph it.\n if (!this.schema.checkChild(this.position.parent, node)) {\n this._insertAutoParagraph();\n }\n return true;\n }\n /**\n * Gets the element in which the given node is allowed. It checks the passed element and all its ancestors.\n *\n * It also verifies if auto-paragraphing could help.\n *\n * @param contextElement The element in which context the node should be checked.\n * @param childNode The node to check.\n */\n _getAllowedIn(contextElement, childNode) {\n // Check if a node can be inserted in the given context...\n if (this.schema.checkChild(contextElement, childNode)) {\n return contextElement;\n }\n // ...or it would be accepted if a paragraph would be inserted.\n if (this.schema.checkChild(contextElement, 'paragraph') && this.schema.checkChild('paragraph', childNode)) {\n return contextElement;\n }\n // If the child wasn't allowed in the context element and the element is a limit there's no point in\n // checking any further towards the root. This is it: the limit is unsplittable and there's nothing\n // we can do about it. Without this check, the algorithm will analyze parent of the limit and may create\n // an illusion of the child being allowed. There's no way to insert it down there, though. It results in\n // infinite loops.\n if (this.schema.isLimit(contextElement)) {\n return null;\n }\n return this._getAllowedIn(contextElement.parent, childNode);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/modifyselection\n */\nimport DocumentSelection from '../documentselection.js';\nimport Position from '../position.js';\nimport Range from '../range.js';\nimport TreeWalker from '../treewalker.js';\nimport { isInsideSurrogatePair, isInsideCombinedSymbol, isInsideEmojiSequence } from '@ckeditor/ckeditor5-utils';\nconst wordBoundaryCharacters = ' ,.?!:;\"-()';\n/**\n * Modifies the selection. Currently, the supported modifications are:\n *\n * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.\n * Possible values for `unit` are:\n * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one\n * character in `String` sense. However, unicode also defines \"combing marks\". These are special symbols, that combines\n * with a symbol before it (\"base character\") to create one user-perceived character. For example, `q̣̇` is a normal\n * letter `q` with two \"combining marks\": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending\n * selection by one position, it is correct to include both \"base character\" and all of it's \"combining marks\". That is\n * why `'character'` value is most natural and common method of modifying selection.\n * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert\n * selection between \"base character\" and \"combining mark\", because \"combining marks\" have their own unicode code points.\n * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by\n * two characters, called \"surrogate pairs\". Halves of \"surrogate pairs\" have a meaning only when placed next to each other.\n * For example `ð¨Ž` is represented in `String` by `\\uD862\\uDF4E`. Both `\\uD862` and `\\uDF4E` do not have any meaning\n * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection\n * extension will include whole \"surrogate pair\".\n * * `'word'` - moves selection by a whole word.\n *\n * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.\n *\n * **Note:** Use {@link module:engine/model/model~Model#modifySelection} instead of this function.\n * This function is only exposed to be reusable in algorithms\n * which change the {@link module:engine/model/model~Model#modifySelection}\n * method's behavior.\n *\n * @param model The model in context of which the selection modification should be performed.\n * @param selection The selection to modify.\n * @param options.direction The direction in which the selection should be modified. Default 'forward'.\n * @param options.unit The unit by which selection should be modified. Default 'character'.\n * @param options.treatEmojiAsSingleUnit Whether multi-characer emoji sequences should be handled as single unit.\n */\nexport default function modifySelection(model, selection, options = {}) {\n const schema = model.schema;\n const isForward = options.direction != 'backward';\n const unit = options.unit ? options.unit : 'character';\n const treatEmojiAsSingleUnit = !!options.treatEmojiAsSingleUnit;\n const focus = selection.focus;\n const walker = new TreeWalker({\n boundaries: getSearchRange(focus, isForward),\n singleCharacters: true,\n direction: isForward ? 'forward' : 'backward'\n });\n const data = { walker, schema, isForward, unit, treatEmojiAsSingleUnit };\n let next;\n while ((next = walker.next())) {\n if (next.done) {\n return;\n }\n const position = tryExtendingTo(data, next.value);\n if (position) {\n if (selection instanceof DocumentSelection) {\n model.change(writer => {\n writer.setSelectionFocus(position);\n });\n }\n else {\n selection.setFocus(position);\n }\n return;\n }\n }\n}\n/**\n * Checks whether the selection can be extended to the the walker's next value (next position).\n */\nfunction tryExtendingTo(data, value) {\n const { isForward, walker, unit, schema, treatEmojiAsSingleUnit } = data;\n const { type, item, nextPosition } = value;\n // If found text, we can certainly put the focus in it. Let's just find a correct position\n // based on the unit.\n if (type == 'text') {\n if (data.unit === 'word') {\n return getCorrectWordBreakPosition(walker, isForward);\n }\n return getCorrectPosition(walker, unit, treatEmojiAsSingleUnit);\n }\n // Entering an element.\n if (type == (isForward ? 'elementStart' : 'elementEnd')) {\n // If it's a selectable, we can select it now.\n if (schema.isSelectable(item)) {\n return Position._createAt(item, isForward ? 'after' : 'before');\n }\n // If text allowed on this position, extend to this place.\n if (schema.checkChild(nextPosition, '$text')) {\n return nextPosition;\n }\n }\n // Leaving an element.\n else {\n // If leaving a limit element, stop.\n if (schema.isLimit(item)) {\n // NOTE: Fast-forward the walker until the end.\n walker.skip(() => true);\n return;\n }\n // If text allowed on this position, extend to this place.\n if (schema.checkChild(nextPosition, '$text')) {\n return nextPosition;\n }\n }\n}\n/**\n * Finds a correct position by walking in a text node and checking whether selection can be extended to given position\n * or should be extended further.\n */\nfunction getCorrectPosition(walker, unit, treatEmojiAsSingleUnit) {\n const textNode = walker.position.textNode;\n if (textNode) {\n const data = textNode.data;\n let offset = walker.position.offset - textNode.startOffset;\n while (isInsideSurrogatePair(data, offset) ||\n (unit == 'character' && isInsideCombinedSymbol(data, offset)) ||\n (treatEmojiAsSingleUnit && isInsideEmojiSequence(data, offset))) {\n walker.next();\n offset = walker.position.offset - textNode.startOffset;\n }\n }\n return walker.position;\n}\n/**\n * Finds a correct position of a word break by walking in a text node and checking whether selection can be extended to given position\n * or should be extended further.\n */\nfunction getCorrectWordBreakPosition(walker, isForward) {\n let textNode = walker.position.textNode;\n if (!textNode) {\n textNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;\n }\n while (textNode && textNode.is('$text')) {\n const offset = walker.position.offset - textNode.startOffset;\n // Check of adjacent text nodes with different attributes (like BOLD).\n // Example : 'foofoo []bar<$text bold=\"true\">bar</$text> bazbaz'\n // should expand to : 'foofoo [bar<$text bold=\"true\">bar</$text>] bazbaz'.\n if (isAtNodeBoundary(textNode, offset, isForward)) {\n textNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;\n }\n // Check if this is a word boundary.\n else if (isAtWordBoundary(textNode.data, offset, isForward)) {\n break;\n }\n // Maybe one more character.\n else {\n walker.next();\n }\n }\n return walker.position;\n}\nfunction getSearchRange(start, isForward) {\n const root = start.root;\n const searchEnd = Position._createAt(root, isForward ? 'end' : 0);\n if (isForward) {\n return new Range(start, searchEnd);\n }\n else {\n return new Range(searchEnd, start);\n }\n}\n/**\n * Checks if selection is on word boundary.\n */\nfunction isAtWordBoundary(data, offset, isForward) {\n // The offset to check depends on direction.\n const offsetToCheck = offset + (isForward ? 0 : -1);\n return wordBoundaryCharacters.includes(data.charAt(offsetToCheck));\n}\n/**\n * Checks if selection is on node boundary.\n */\nfunction isAtNodeBoundary(textNode, offset, isForward) {\n return offset === (isForward ? textNode.offsetSize : 0);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/model\n */\nimport Batch from './batch.js';\nimport Document from './document.js';\nimport MarkerCollection from './markercollection.js';\nimport ModelPosition from './position.js';\nimport ModelRange from './range.js';\nimport ModelSelection from './selection.js';\nimport OperationFactory from './operation/operationfactory.js';\nimport DocumentSelection from './documentselection.js';\nimport Schema from './schema.js';\nimport Writer from './writer.js';\nimport Node from './node.js';\nimport { autoParagraphEmptyRoots } from './utils/autoparagraphing.js';\nimport { injectSelectionPostFixer } from './utils/selection-post-fixer.js';\nimport deleteContent from './utils/deletecontent.js';\nimport getSelectedContent from './utils/getselectedcontent.js';\nimport insertContent from './utils/insertcontent.js';\nimport insertObject from './utils/insertobject.js';\nimport modifySelection from './utils/modifyselection.js';\nimport { CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );\n// @if CK_DEBUG_ENGINE // const { OperationReplayer } = require( '../dev-utils/operationreplayer' ).default;\n/**\n * Editor's data model. Read about the model in the\n * {@glink framework/architecture/editing-engine engine architecture} guide.\n */\nexport default class Model extends /* #__PURE__ */ ObservableMixin() {\n // @if CK_DEBUG_ENGINE // private _operationLogs: Array<string>;\n // @if CK_DEBUG_ENGINE // private _appliedOperations: Array<Operation>;\n constructor() {\n super();\n this.markers = new MarkerCollection();\n this.document = new Document(this);\n this.schema = new Schema();\n this._pendingChanges = [];\n this._currentWriter = null;\n ['deleteContent', 'modifySelection', 'getSelectedContent', 'applyOperation']\n .forEach(methodName => this.decorate(methodName));\n // Adding operation validation with `highest` priority, so it is called before any other feature would like\n // to do anything with the operation. If the operation has incorrect parameters it should throw on the earliest occasion.\n this.on('applyOperation', (evt, args) => {\n const operation = args[0];\n operation._validate();\n }, { priority: 'highest' });\n // Register some default abstract entities.\n this.schema.register('$root', {\n isLimit: true\n });\n this.schema.register('$container', {\n allowIn: ['$root', '$container']\n });\n this.schema.register('$block', {\n allowIn: ['$root', '$container'],\n isBlock: true\n });\n this.schema.register('$blockObject', {\n allowWhere: '$block',\n isBlock: true,\n isObject: true\n });\n this.schema.register('$inlineObject', {\n allowWhere: '$text',\n allowAttributesOf: '$text',\n isInline: true,\n isObject: true\n });\n this.schema.register('$text', {\n allowIn: '$block',\n isInline: true,\n isContent: true\n });\n this.schema.register('$clipboardHolder', {\n allowContentOf: '$root',\n allowChildren: '$text',\n isLimit: true\n });\n this.schema.register('$documentFragment', {\n allowContentOf: '$root',\n allowChildren: '$text',\n isLimit: true\n });\n // An element needed by the `upcastElementToMarker` converter.\n // This element temporarily represents a marker boundary during the conversion process and is removed\n // at the end of the conversion. `UpcastDispatcher` or at least `Conversion` class looks like a\n // better place for this registration but both know nothing about `Schema`.\n this.schema.register('$marker');\n this.schema.addChildCheck(() => true, '$marker'); // Allow everywhere.\n injectSelectionPostFixer(this);\n // Post-fixer which takes care of adding empty paragraph elements to the empty roots.\n this.document.registerPostFixer(autoParagraphEmptyRoots);\n // The base implementation for \"decorated\" method with remapped arguments.\n this.on('insertContent', (evt, [content, selectable]) => {\n evt.return = insertContent(this, content, selectable);\n });\n // The base implementation for \"decorated\" method with remapped arguments.\n this.on('insertObject', (evt, [element, selection, options]) => {\n evt.return = insertObject(this, element, selection, options);\n });\n // The base implementation for \"decorated\" method with remapped arguments.\n this.on('canEditAt', evt => {\n const canEditAt = !this.document.isReadOnly;\n evt.return = canEditAt;\n if (!canEditAt) {\n // Prevent further processing if the selection is at non-editable place.\n evt.stop();\n }\n });\n // @if CK_DEBUG_ENGINE // initDocumentDumping( this.document );\n // @if CK_DEBUG_ENGINE // this.on( 'applyOperation', () => {\n // @if CK_DEBUG_ENGINE // \tdumpTrees( this.document, this.document.version );\n // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );\n // @if CK_DEBUG_ENGINE // this._operationLogs = [];\n // @if CK_DEBUG_ENGINE // this._appliedOperations = [];\n }\n /**\n * The `change()` method is the primary way of changing the model. You should use it to modify all document nodes\n * (including detached nodes – i.e. nodes not added to the {@link module:engine/model/model~Model#document model document}),\n * the {@link module:engine/model/document~Document#selection document's selection}, and\n * {@link module:engine/model/model~Model#markers model markers}.\n *\n * ```ts\n * model.change( writer => {\n * \twriter.insertText( 'foo', paragraph, 'end' );\n * } );\n * ```\n *\n * All changes inside the change block use the same {@link module:engine/model/batch~Batch} so they are combined\n * into a single undo step.\n *\n * ```ts\n * model.change( writer => {\n * \twriter.insertText( 'foo', paragraph, 'end' ); // foo.\n *\n * \tmodel.change( writer => {\n * \t\twriter.insertText( 'bar', paragraph, 'end' ); // foobar.\n * \t} );\n *\n * \twriter.insertText( 'bom', paragraph, 'end' ); // foobarbom.\n * } );\n * ```\n *\n * The callback of the `change()` block is executed synchronously.\n *\n * You can also return a value from the change block.\n *\n * ```ts\n * const img = model.change( writer => {\n * \treturn writer.createElement( 'img' );\n * } );\n * ```\n *\n * @see #enqueueChange\n * @typeParam TReturn The return type of the provided callback.\n * @param callback Callback function which may modify the model.\n */\n change(callback) {\n try {\n if (this._pendingChanges.length === 0) {\n // If this is the outermost block, create a new batch and start `_runPendingChanges` execution flow.\n this._pendingChanges.push({ batch: new Batch(), callback });\n return this._runPendingChanges()[0];\n }\n else {\n // If this is not the outermost block, just execute the callback.\n return callback(this._currentWriter);\n }\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n enqueueChange(batchOrType, callback) {\n try {\n if (!batchOrType) {\n batchOrType = new Batch();\n }\n else if (typeof batchOrType === 'function') {\n callback = batchOrType;\n batchOrType = new Batch();\n }\n else if (!(batchOrType instanceof Batch)) {\n batchOrType = new Batch(batchOrType);\n }\n this._pendingChanges.push({ batch: batchOrType, callback });\n if (this._pendingChanges.length == 1) {\n this._runPendingChanges();\n }\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n /**\n * {@link module:utils/observablemixin~Observable#decorate Decorated} function for applying\n * {@link module:engine/model/operation/operation~Operation operations} to the model.\n *\n * This is a low-level way of changing the model. It is exposed for very specific use cases (like the undo feature).\n * Normally, to modify the model, you will want to use {@link module:engine/model/writer~Writer `Writer`}.\n * See also {@glink framework/architecture/editing-engine#changing-the-model Changing the model} section\n * of the {@glink framework/architecture/editing-engine Editing architecture} guide.\n *\n * @param operation The operation to apply.\n */\n applyOperation(operation) {\n // @if CK_DEBUG_ENGINE // console.log( 'Applying ' + operation );\n // @if CK_DEBUG_ENGINE // this._operationLogs.push( JSON.stringify( operation ) );\n // @if CK_DEBUG_ENGINE // this._appliedOperations.push( operation );\n operation._execute();\n }\n // @if CK_DEBUG_ENGINE // public getAppliedOperation(): string {\n // @if CK_DEBUG_ENGINE // \tif ( !this._appliedOperations ) {\n // @if CK_DEBUG_ENGINE // \t\treturn '';\n // @if CK_DEBUG_ENGINE // \t}\n // @if CK_DEBUG_ENGINE // \treturn this._appliedOperations.map( operation => JSON.stringify( operation ) ).join( '-------' );\n // @if CK_DEBUG_ENGINE // }\n // @if CK_DEBUG_ENGINE // public createReplayer( stringifiedOperations: string ): typeof OperationReplayer {\n // @if CK_DEBUG_ENGINE // \treturn new OperationReplayer( this, '-------', stringifiedOperations );\n // @if CK_DEBUG_ENGINE // }\n /**\n * Inserts content at the position in the editor specified by the selection, as one would expect the paste\n * functionality to work.\n *\n * **Note**: If you want to insert an {@glink framework/deep-dive/schema#object-elements object element}\n * (e.g. a {@link module:widget/utils~toWidget widget}), see {@link #insertObject} instead.\n *\n * This is a high-level method. It takes the {@link #schema schema} into consideration when inserting\n * the content, clears the given selection's content before inserting nodes and moves the selection\n * to its target position at the end of the process.\n * It can split elements, merge them, wrap bare text nodes with paragraphs, etc. – just like the\n * pasting feature should do.\n *\n * For lower-level methods see {@link module:engine/model/writer~Writer `Writer`}.\n *\n * This method, unlike {@link module:engine/model/writer~Writer `Writer`}'s methods, does not have to be used\n * inside a {@link #change `change()` block}.\n *\n * # Conversion and schema\n *\n * Inserting elements and text nodes into the model is not enough to make CKEditor 5 render that content\n * to the user. CKEditor 5 implements a model-view-controller architecture and what `model.insertContent()` does\n * is only adding nodes to the model. Additionally, you need to define\n * {@glink framework/architecture/editing-engine#conversion converters} between the model and view\n * and define those nodes in the {@glink framework/architecture/editing-engine#schema schema}.\n *\n * So, while this method may seem similar to CKEditor 4 `editor.insertHtml()` (in fact, both methods\n * are used for paste-like content insertion), the CKEditor 5 method cannot be use to insert arbitrary HTML\n * unless converters are defined for all elements and attributes in that HTML.\n *\n * # Examples\n *\n * Using `insertContent()` with a manually created model structure:\n *\n * ```ts\n * // Let's create a document fragment containing such content as:\n * //\n * // <paragraph>foo</paragraph>\n * // <blockQuote>\n * // <paragraph>bar</paragraph>\n * // </blockQuote>\n * const docFrag = editor.model.change( writer => {\n * \tconst p1 = writer.createElement( 'paragraph' );\n * \tconst p2 = writer.createElement( 'paragraph' );\n * \tconst blockQuote = writer.createElement( 'blockQuote' );\n * \tconst docFrag = writer.createDocumentFragment();\n *\n * \twriter.append( p1, docFrag );\n * \twriter.append( blockQuote, docFrag );\n * \twriter.append( p2, blockQuote );\n * \twriter.insertText( 'foo', p1 );\n * \twriter.insertText( 'bar', p2 );\n *\n * \treturn docFrag;\n * } );\n *\n * // insertContent() does not have to be used in a change() block. It can, though,\n * // so this code could be moved to the callback defined above.\n * editor.model.insertContent( docFrag );\n * ```\n *\n * Using `insertContent()` with an HTML string converted to a model document fragment (similar to the pasting mechanism):\n *\n * ```ts\n * // You can create your own HtmlDataProcessor instance or use editor.data.processor\n * // if you have not overridden the default one (which is the HtmlDataProcessor instance).\n * const htmlDP = new HtmlDataProcessor( viewDocument );\n *\n * // Convert an HTML string to a view document fragment:\n * const viewFragment = htmlDP.toView( htmlString );\n *\n * // Convert the view document fragment to a model document fragment\n * // in the context of $root. This conversion takes the schema into\n * // account so if, for example, the view document fragment contained a bare text node,\n * // this text node cannot be a child of $root, so it will be automatically\n * // wrapped with a <paragraph>. You can define the context yourself (in the second parameter),\n * // and e.g. convert the content like it would happen in a <paragraph>.\n * // Note: The clipboard feature uses a custom context called $clipboardHolder\n * // which has a loosened schema.\n * const modelFragment = editor.data.toModel( viewFragment );\n *\n * editor.model.insertContent( modelFragment );\n * ```\n *\n * By default this method will use the document selection but it can also be used with a position, range or selection instance.\n *\n * ```ts\n * // Insert text at the current document selection position.\n * editor.model.change( writer => {\n * \teditor.model.insertContent( writer.createText( 'x' ) );\n * } );\n *\n * // Insert text at a given position - the document selection will not be modified.\n * editor.model.change( writer => {\n * \teditor.model.insertContent( writer.createText( 'x' ), doc.getRoot(), 2 );\n *\n * \t// Which is a shorthand for:\n * \teditor.model.insertContent( writer.createText( 'x' ), writer.createPositionAt( doc.getRoot(), 2 ) );\n * } );\n * ```\n *\n * If you want the document selection to be moved to the inserted content, use the\n * {@link module:engine/model/writer~Writer#setSelection `setSelection()`} method of the writer after inserting\n * the content:\n *\n * ```ts\n * editor.model.change( writer => {\n * \tconst paragraph = writer.createElement( 'paragraph' );\n *\n * \t// Insert an empty paragraph at the beginning of the root.\n * \teditor.model.insertContent( paragraph, writer.createPositionAt( editor.model.document.getRoot(), 0 ) );\n *\n * \t// Move the document selection to the inserted paragraph.\n * \twriter.setSelection( paragraph, 'in' );\n * } );\n * ```\n *\n * If an instance of the {@link module:engine/model/selection~Selection model selection} is passed as `selectable`,\n * the new content will be inserted at the passed selection (instead of document selection):\n *\n * ```ts\n * editor.model.change( writer => {\n * \t// Create a selection in a paragraph that will be used as a place of insertion.\n * \tconst selection = writer.createSelection( paragraph, 'in' );\n *\n * \t// Insert the new text at the created selection.\n * \teditor.model.insertContent( writer.createText( 'x' ), selection );\n *\n * \t// insertContent() modifies the passed selection instance so it can be used to set the document selection.\n * \t// Note: This is not necessary when you passed the document selection to insertContent().\n * \twriter.setSelection( selection );\n * } );\n * ```\n *\n * @fires insertContent\n * @param content The content to insert.\n * @param selectable The selection into which the content should be inserted.\n * If not provided the current model document selection will be used.\n * @param placeOrOffset To be used when a model item was passed as `selectable`.\n * This param defines a position in relation to that item.\n * at the insertion position.\n */\n insertContent(content, selectable, placeOrOffset, ...rest) {\n const selection = normalizeSelectable(selectable, placeOrOffset);\n // Passing all call arguments so it acts like decorated method.\n return this.fire('insertContent', [content, selection, placeOrOffset, ...rest]);\n }\n /**\n * Inserts an {@glink framework/deep-dive/schema#object-elements object element} at a specific position in the editor content.\n *\n * This is a high-level API:\n * * It takes the {@link #schema schema} into consideration,\n * * It clears the content of passed `selectable` before inserting,\n * * It can move the selection at the end of the process,\n * * It will copy the selected block's attributes to preserve them upon insertion,\n * * It can split elements or wrap inline objects with paragraphs if they are not allowed in target position,\n * * etc.\n *\n * # Notes\n *\n * * If you want to insert a non-object content, see {@link #insertContent} instead.\n * * For lower-level API, see {@link module:engine/model/writer~Writer `Writer`}.\n * * Unlike {@link module:engine/model/writer~Writer `Writer`}, this method does not have to be used inside\n * a {@link #change `change()` block}.\n * * Inserting object into the model is not enough to make CKEditor 5 render that content to the user.\n * CKEditor 5 implements a model-view-controller architecture and what `model.insertObject()` does\n * is only adding nodes to the model. Additionally, you need to define\n * {@glink framework/architecture/editing-engine#conversion converters} between the model and view\n * and define those nodes in the {@glink framework/architecture/editing-engine#schema schema}.\n *\n * # Examples\n *\n * Use the following code to insert an object at the current selection and keep the selection on the inserted element:\n *\n * ```ts\n * const rawHtmlEmbedElement = writer.createElement( 'rawHtml' );\n *\n * model.insertObject( rawHtmlEmbedElement, null, null, {\n * \tsetSelection: 'on'\n * } );\n * ```\n *\n * Use the following code to insert an object at the current selection and nudge the selection after the inserted object:\n *\n * ```ts\n * const pageBreakElement = writer.createElement( 'pageBreak' );\n *\n * model.insertObject( pageBreakElement, null, null, {\n * \tsetSelection: 'after'\n * } );\n * ```\n *\n * Use the following code to insert an object at the current selection and avoid splitting the content (non-destructive insertion):\n *\n * ```ts\n * const tableElement = writer.createElement( 'table' );\n *\n * model.insertObject( tableElement, null, null, {\n * \tfindOptimalPosition: 'auto'\n * } );\n * ```\n *\n * Use the following code to insert an object at the specific range (also: replace the content of the range):\n *\n * ```ts\n * const tableElement = writer.createElement( 'table' );\n * const range = model.createRangeOn( model.document.getRoot().getChild( 1 ) );\n *\n * model.insertObject( tableElement, range );\n * ```\n *\n * @param element An object to be inserted into the model document.\n * @param selectable A selectable where the content should be inserted. If not specified, the current\n * {@link module:engine/model/document~Document#selection document selection} will be used instead.\n * @param placeOrOffset Specifies the exact place or offset for the insertion to take place, relative to `selectable`.\n * @param options Additional options.\n * @param options.findOptimalPosition An option that, when set, adjusts the insertion position (relative to\n * `selectable` and `placeOrOffset`) so that the content of `selectable` is not split upon insertion (a.k.a. non-destructive insertion).\n * * When `'auto'`, the algorithm will decide whether to insert the object before or after `selectable` to avoid content splitting.\n * * When `'before'`, the closest position before `selectable` will be used that will not result in content splitting.\n * * When `'after'`, the closest position after `selectable` will be used that will not result in content splitting.\n *\n * Note that this option only works for block objects. Inline objects are inserted into text and do not split blocks.\n * @param options.setSelection An option that, when set, moves the\n * {@link module:engine/model/document~Document#selection document selection} after inserting the object.\n * * When `'on'`, the document selection will be set on the inserted object.\n * * When `'after'`, the document selection will move to the closest text node after the inserted object. If there is no\n * such text node, a paragraph will be created and the document selection will be moved inside it.\n * at the insertion position.\n */\n insertObject(element, selectable, placeOrOffset, options, ...rest) {\n const selection = normalizeSelectable(selectable, placeOrOffset);\n // Note that options are fired as 2 arguments for backward compatibility with the decorated method.\n // Passing all call arguments so it acts like decorated method.\n return this.fire('insertObject', [element, selection, options, options, ...rest]);\n }\n /**\n * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.\n *\n * **Note:** For the sake of predictability, the resulting selection should always be collapsed.\n * In cases where a feature wants to modify deleting behavior so selection isn't collapsed\n * (e.g. a table feature may want to keep row selection after pressing <kbd>Backspace</kbd>),\n * then that behavior should be implemented in the view's listener. At the same time, the table feature\n * will need to modify this method's behavior too, e.g. to \"delete contents and then collapse\n * the selection inside the last selected cell\" or \"delete the row and collapse selection somewhere near\".\n * That needs to be done in order to ensure that other features which use `deleteContent()` will work well with tables.\n *\n * @fires deleteContent\n * @param selection Selection of which the content should be deleted.\n * @param options.leaveUnmerged Whether to merge elements after removing the content of the selection.\n *\n * For example `<heading1>x[x</heading1><paragraph>y]y</paragraph>` will become:\n *\n * * `<heading1>x^y</heading1>` with the option disabled (`leaveUnmerged == false`)\n * * `<heading1>x^</heading1><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).\n *\n * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}\n * elements will not be merged.\n *\n * @param options.doNotResetEntireContent Whether to skip replacing the entire content with a\n * paragraph when the entire content was selected.\n *\n * For example `<heading1>[x</heading1><paragraph>y]</paragraph>` will become:\n *\n * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)\n * * `<heading1>^</heading1>` with enabled (`doNotResetEntireContent == true`)\n *\n * @param options.doNotAutoparagraph Whether to create a paragraph if after content deletion selection is moved\n * to a place where text cannot be inserted.\n *\n * For example `<paragraph>x</paragraph>[<imageBlock src=\"foo.jpg\"></imageBlock>]` will become:\n *\n * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)\n * * `<paragraph>x[]</paragraph>` with the option enabled (`doNotAutoparagraph == true`).\n *\n * **Note:** if there is no valid position for the selection, the paragraph will always be created:\n *\n * `[<imageBlock src=\"foo.jpg\"></imageBlock>]` -> `<paragraph>[]</paragraph>`.\n *\n * @param options.direction The direction in which the content is being consumed.\n * Deleting backward corresponds to using the <kbd>Backspace</kbd> key, while deleting content forward corresponds to\n * the <kbd>Shift</kbd>+<kbd>Backspace</kbd> keystroke.\n */\n deleteContent(selection, options) {\n deleteContent(this, selection, options);\n }\n /**\n * Modifies the selection. Currently, the supported modifications are:\n *\n * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.\n * Possible values for `unit` are:\n * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one\n * character in `String` sense. However, unicode also defines \"combing marks\". These are special symbols, that combines\n * with a symbol before it (\"base character\") to create one user-perceived character. For example, `q̣̇` is a normal\n * letter `q` with two \"combining marks\": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending\n * selection by one position, it is correct to include both \"base character\" and all of it's \"combining marks\". That is\n * why `'character'` value is most natural and common method of modifying selection.\n * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert\n * selection between \"base character\" and \"combining mark\", because \"combining marks\" have their own unicode code points.\n * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by\n * two characters, called \"surrogate pairs\". Halves of \"surrogate pairs\" have a meaning only when placed next to each other.\n * For example `ð¨Ž` is represented in `String` by `\\uD862\\uDF4E`. Both `\\uD862` and `\\uDF4E` do not have any meaning\n * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection\n * extension will include whole \"surrogate pair\".\n * * `'word'` - moves selection by a whole word.\n *\n * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.\n *\n * @fires modifySelection\n * @param selection The selection to modify.\n * @param options.direction The direction in which the selection should be modified.\n * @param options.unit The unit by which selection should be modified.\n * @param options.treatEmojiAsSingleUnit Whether multi-characer emoji sequences should be handled as single unit.\n */\n modifySelection(selection, options) {\n modifySelection(this, selection, options);\n }\n /**\n * Gets a clone of the selected content.\n *\n * For example, for the following selection:\n *\n * ```html\n * <paragraph>x</paragraph>\n * <blockQuote>\n * \t<paragraph>y</paragraph>\n * \t<heading1>fir[st</heading1>\n * </blockQuote>\n * <paragraph>se]cond</paragraph>\n * <paragraph>z</paragraph>\n * ```\n *\n * It will return a document fragment with such a content:\n *\n * ```html\n * <blockQuote>\n * \t<heading1>st</heading1>\n * </blockQuote>\n * <paragraph>se</paragraph>\n * ```\n *\n * @fires getSelectedContent\n * @param selection The selection of which content will be returned.\n */\n getSelectedContent(selection) {\n return getSelectedContent(this, selection);\n }\n /**\n * Checks whether the given {@link module:engine/model/range~Range range} or\n * {@link module:engine/model/element~Element element} has any meaningful content.\n *\n * Meaningful content is:\n *\n * * any text node (`options.ignoreWhitespaces` allows controlling whether this text node must also contain\n * any non-whitespace characters),\n * * or any {@link module:engine/model/schema~Schema#isContent content element},\n * * or any {@link module:engine/model/markercollection~Marker marker} which\n * {@link module:engine/model/markercollection~Marker#_affectsData affects data}.\n *\n * This means that a range containing an empty `<paragraph></paragraph>` is not considered to have a meaningful content.\n * However, a range containing an `<imageBlock></imageBlock>` (which would normally be marked in the schema as an object element)\n * is considered non-empty.\n *\n * @param rangeOrElement Range or element to check.\n * @param options.ignoreWhitespaces Whether text node with whitespaces only should be considered empty.\n * @param options.ignoreMarkers Whether markers should be ignored.\n */\n hasContent(rangeOrElement, options = {}) {\n const range = rangeOrElement instanceof ModelRange ? rangeOrElement : ModelRange._createIn(rangeOrElement);\n if (range.isCollapsed) {\n return false;\n }\n const { ignoreWhitespaces = false, ignoreMarkers = false } = options;\n // Check if there are any markers which affects data in this given range.\n if (!ignoreMarkers) {\n for (const intersectingMarker of this.markers.getMarkersIntersectingRange(range)) {\n if (intersectingMarker.affectsData) {\n return true;\n }\n }\n }\n for (const item of range.getItems()) {\n if (this.schema.isContent(item)) {\n if (item.is('$textProxy')) {\n if (!ignoreWhitespaces) {\n return true;\n }\n else if (item.data.search(/\\S/) !== -1) {\n return true;\n }\n }\n else {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Check whether given selectable is at a place in the model where it can be edited (returns `true`) or not (returns `false`).\n *\n * Should be used instead of {@link module:core/editor/editor~Editor#isReadOnly} to check whether a user action can happen at\n * given selectable. It may be decorated and used differently in different environment (e.g. multi-root editor can disable\n * a particular root).\n *\n * This method is decorated. Although this method accepts any parameter of `Selectable` type, the\n * {@link ~Model#event:canEditAt `canEditAt` event} is fired with `selectable` normalized to an instance of\n * {@link module:engine/model/selection~Selection} or {@link module:engine/model/documentselection~DocumentSelection}\n *\n * @fires canEditAt\n */\n canEditAt(selectable) {\n const selection = normalizeSelectable(selectable);\n return this.fire('canEditAt', [selection]);\n }\n /**\n * Creates a position from the given root and path in that root.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createPositionFromPath `Writer#createPositionFromPath()`}.\n *\n * @param root Root of the position.\n * @param path Position path. See {@link module:engine/model/position~Position#path}.\n * @param stickiness Position stickiness. See {@link module:engine/model/position~PositionStickiness}.\n */\n createPositionFromPath(root, path, stickiness) {\n return new ModelPosition(root, path, stickiness);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/model/position~Position position},\n * * a parent element and offset in that element,\n * * a parent element and `'end'` (the position will be set at the end of that element),\n * * a {@link module:engine/model/item~Item model item} and `'before'` or `'after'`\n * (the position will be set before or after the given model item).\n *\n * This method is a shortcut to other factory methods such as:\n *\n * * {@link module:engine/model/model~Model#createPositionBefore `createPositionBefore()`},\n * * {@link module:engine/model/model~Model#createPositionAfter `createPositionAfter()`}.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createPositionAt `Writer#createPositionAt()`},\n *\n * @param itemOrPosition\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~Item model item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return ModelPosition._createAt(itemOrPosition, offset);\n }\n /**\n * Creates a new position after the given {@link module:engine/model/item~Item model item}.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createPositionAfter `Writer#createPositionAfter()`}.\n *\n * @param item Item after which the position should be placed.\n */\n createPositionAfter(item) {\n return ModelPosition._createAfter(item);\n }\n /**\n * Creates a new position before the given {@link module:engine/model/item~Item model item}.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createPositionBefore `Writer#createPositionBefore()`}.\n *\n * @param item Item before which the position should be placed.\n */\n createPositionBefore(item) {\n return ModelPosition._createBefore(item);\n }\n /**\n * Creates a range spanning from the `start` position to the `end` position.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createRange `Writer#createRange()`}:\n *\n * ```ts\n * model.change( writer => {\n * \tconst range = writer.createRange( start, end );\n * } );\n * ```\n *\n * @param start Start position.\n * @param end End position. If not set, the range will be collapsed to the `start` position.\n */\n createRange(start, end) {\n return new ModelRange(start, end);\n }\n /**\n * Creates a range inside the given element which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createRangeIn `Writer#createRangeIn()`}:\n *\n * ```ts\n * model.change( writer => {\n * \tconst range = writer.createRangeIn( paragraph );\n * } );\n * ```\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return ModelRange._createIn(element);\n }\n /**\n * Creates a range that starts before the given {@link module:engine/model/item~Item model item} and ends after it.\n *\n * Note: This method is also available on `writer` instance as\n * {@link module:engine/model/writer~Writer#createRangeOn `Writer.createRangeOn()`}:\n *\n * ```ts\n * model.change( writer => {\n * \tconst range = writer.createRangeOn( paragraph );\n * } );\n * ```\n *\n * @param item\n */\n createRangeOn(item) {\n return ModelRange._createOn(item);\n }\n createSelection(...args) {\n return new ModelSelection(...args);\n }\n /**\n * Creates a {@link module:engine/model/batch~Batch} instance.\n *\n * **Note:** In most cases creating a batch instance is not necessary as they are created when using:\n *\n * * {@link #change `change()`},\n * * {@link #enqueueChange `enqueueChange()`}.\n *\n * @param type {@link module:engine/model/batch~Batch#constructor The type} of the batch.\n */\n createBatch(type) {\n return new Batch(type);\n }\n /**\n * Creates an operation instance from a JSON object (parsed JSON string).\n *\n * This is an alias for {@link module:engine/model/operation/operationfactory~OperationFactory.fromJSON `OperationFactory.fromJSON()`}.\n *\n * @param json Deserialized JSON object.\n */\n createOperationFromJSON(json) {\n return OperationFactory.fromJSON(json, this.document);\n }\n /**\n * Removes all events listeners set by model instance and destroys {@link module:engine/model/document~Document}.\n */\n destroy() {\n this.document.destroy();\n this.stopListening();\n }\n /**\n * Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}\n * which calls callbacks and returns array of values returned by these callbacks.\n */\n _runPendingChanges() {\n const ret = [];\n this.fire('_beforeChanges');\n try {\n while (this._pendingChanges.length) {\n // Create a new writer using batch instance created for this chain of changes.\n const currentBatch = this._pendingChanges[0].batch;\n this._currentWriter = new Writer(this, currentBatch);\n // Execute changes callback and gather the returned value.\n const callbackReturnValue = this._pendingChanges[0].callback(this._currentWriter);\n ret.push(callbackReturnValue);\n this.document._handleChangeBlock(this._currentWriter);\n this._pendingChanges.shift();\n this._currentWriter = null;\n }\n }\n finally {\n this._pendingChanges.length = 0;\n this._currentWriter = null;\n this.fire('_afterChanges');\n }\n return ret;\n }\n}\n/**\n * Normalizes a selectable to a Selection or DocumentSelection.\n */\nfunction normalizeSelectable(selectable, placeOrOffset) {\n if (!selectable) {\n return;\n }\n if (selectable instanceof ModelSelection || selectable instanceof DocumentSelection) {\n return selectable;\n }\n if (selectable instanceof Node) {\n if (placeOrOffset || placeOrOffset === 0) {\n return new ModelSelection(selectable, placeOrOffset);\n }\n else if (selectable.is('rootElement')) {\n return new ModelSelection(selectable, 'in');\n }\n else {\n return new ModelSelection(selectable, 'on');\n }\n }\n return new ModelSelection(selectable);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { CKEditorError, first } from '@ckeditor/ckeditor5-utils';\n/**\n * Inserts an {@glink framework/deep-dive/schema#object-elements object element} at a specific position in the editor content.\n *\n * **Note:** Use {@link module:engine/model/model~Model#insertObject} instead of this function.\n * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertObject}\n * method's behavior.\n *\n * **Note**: For more documentation and examples, see {@link module:engine/model/model~Model#insertObject}.\n *\n * @param model The model in context of which the insertion should be performed.\n * @param object An object to be inserted into the model document.\n * @param selectable A selectable where the content should be inserted. If not specified, the current\n * {@link module:engine/model/document~Document#selection document selection} will be used instead.\n * @param placeOrOffset Specifies the exact place or offset for the insertion to take place, relative to `selectable`.\n * @param options Additional options.\n * @param options.findOptimalPosition An option that, when set, adjusts the insertion position (relative to\n * `selectable` and `placeOrOffset`) so that the content of `selectable` is not split upon insertion (a.k.a. non-destructive insertion).\n * * When `'auto'`, the algorithm will decide whether to insert the object before or after `selectable` to avoid content splitting.\n * * When `'before'`, the closest position before `selectable` will be used that will not result in content splitting.\n * * When `'after'`, the closest position after `selectable` will be used that will not result in content splitting.\n *\n * Note that this option works only for block objects. Inline objects are inserted into text and do not split blocks.\n * @param options.setSelection An option that, when set, moves the\n * {@link module:engine/model/document~Document#selection document selection} after inserting the object.\n * * When `'on'`, the document selection will be set on the inserted object.\n * * When `'after'`, the document selection will move to the closest text node after the inserted object. If there is no\n * such text node, a paragraph will be created and the document selection will be moved inside it.\n * @returns A range which contains all the performed changes. This is a range that, if removed,\n * would return the model to the state before the insertion. If no changes were preformed by `insertObject()`, returns a range collapsed\n * at the insertion position.\n */\nexport default function insertObject(model, object, selectable, options = {}) {\n if (!model.schema.isObject(object)) {\n /**\n * Tried to insert an element with {@link module:engine/model/utils/insertobject insertObject()} function\n * that is not defined as an object in schema.\n * See {@link module:engine/model/schema~SchemaItemDefinition#isObject `SchemaItemDefinition`}.\n * If you want to insert content that is not an object you might want to use\n * {@link module:engine/model/utils/insertcontent insertContent()} function.\n * @error insertobject-element-not-an-object\n */\n throw new CKEditorError('insertobject-element-not-an-object', model, { object });\n }\n // Normalize selectable to a selection instance.\n const originalSelection = selectable ? selectable : model.document.selection;\n // Adjust the insertion selection.\n let insertionSelection = originalSelection;\n if (options.findOptimalPosition && model.schema.isBlock(object)) {\n insertionSelection = model.createSelection(model.schema.findOptimalInsertionRange(originalSelection, options.findOptimalPosition));\n }\n // Collect attributes to be copied on the inserted object.\n const firstSelectedBlock = first(originalSelection.getSelectedBlocks());\n const attributesToCopy = {};\n if (firstSelectedBlock) {\n Object.assign(attributesToCopy, model.schema.getAttributesWithProperty(firstSelectedBlock, 'copyOnReplace', true));\n }\n return model.change(writer => {\n // Remove the selected content to find out what the parent of the inserted object would be.\n // It would be removed inside model.insertContent() anyway.\n if (!insertionSelection.isCollapsed) {\n model.deleteContent(insertionSelection, { doNotAutoparagraph: true });\n }\n let elementToInsert = object;\n const insertionPositionParent = insertionSelection.anchor.parent;\n // Autoparagraphing of an inline objects.\n if (!model.schema.checkChild(insertionPositionParent, object) &&\n model.schema.checkChild(insertionPositionParent, 'paragraph') &&\n model.schema.checkChild('paragraph', object)) {\n elementToInsert = writer.createElement('paragraph');\n writer.insert(object, elementToInsert);\n }\n // Apply attributes that are allowed on the inserted object (or paragraph if autoparagraphed).\n model.schema.setAllowedAttributes(elementToInsert, attributesToCopy, writer);\n // Insert the prepared content at the optionally adjusted selection.\n const affectedRange = model.insertContent(elementToInsert, insertionSelection);\n // Nothing got inserted.\n if (affectedRange.isCollapsed) {\n return affectedRange;\n }\n if (options.setSelection) {\n updateSelection(writer, object, options.setSelection, attributesToCopy);\n }\n return affectedRange;\n });\n}\n/**\n * Updates document selection based on given `place` parameter in relation to `contextElement` element.\n *\n * @param writer An instance of the model writer.\n * @param contextElement An element to set the attributes on.\n * @param place The place where selection should be set in relation to the `contextElement` element.\n * Value `on` will set selection on the passed `contextElement`. Value `after` will set selection after `contextElement`.\n * @param attributes Attributes keys and values to set on a paragraph that this function can create when\n * `place` parameter is equal to `after` but there is no element with `$text` node to set selection in.\n */\nfunction updateSelection(writer, contextElement, place, paragraphAttributes) {\n const model = writer.model;\n if (place == 'on') {\n writer.setSelection(contextElement, 'on');\n return;\n }\n if (place != 'after') {\n /**\n * The unsupported `options.setSelection` parameter was passed\n * to the {@link module:engine/model/utils/insertobject insertObject()} function.\n * Check the {@link module:engine/model/utils/insertobject insertObject()} API documentation for allowed\n * `options.setSelection` parameter values.\n *\n * @error insertobject-invalid-place-parameter-value\n */\n throw new CKEditorError('insertobject-invalid-place-parameter-value', model);\n }\n let nextElement = contextElement.nextSibling;\n if (model.schema.isInline(contextElement)) {\n writer.setSelection(contextElement, 'after');\n return;\n }\n // Check whether an element next to the inserted element is defined and can contain a text.\n const canSetSelection = nextElement && model.schema.checkChild(nextElement, '$text');\n // If the element is missing, but a paragraph could be inserted next to the element, let's add it.\n if (!canSetSelection && model.schema.checkChild(contextElement.parent, 'paragraph')) {\n nextElement = writer.createElement('paragraph');\n model.schema.setAllowedAttributes(nextElement, paragraphAttributes, writer);\n model.insertContent(nextElement, writer.createPositionAfter(contextElement));\n }\n // Put the selection inside the element, at the beginning.\n if (nextElement) {\n writer.setSelection(nextElement, 0);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/clickobserver\n */\nimport DomEventObserver from './domeventobserver.js';\n/**\n * {@link module:engine/view/document~Document#event:click Click} event observer.\n *\n * Note that this observer is not available by default. To make it available it needs to be added to\n * {@link module:engine/view/view~View view controller} by a {@link module:engine/view/view~View#addObserver} method.\n */\nexport default class ClickObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = 'click';\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n this.fire(domEvent.type, domEvent);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/mouseobserver\n */\nimport DomEventObserver from './domeventobserver.js';\n/**\n * Mouse events observer.\n *\n * Note that this observer is not available by default. To make it available it needs to be added to\n * {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.\n */\nexport default class MouseObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = ['mousedown', 'mouseup', 'mouseover', 'mouseout'];\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n this.fire(domEvent.type, domEvent);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/upcastwriter\n */\nimport DocumentFragment from './documentfragment.js';\nimport Element from './element.js';\nimport Text from './text.js';\nimport { isPlainObject } from 'lodash-es';\nimport Position from './position.js';\nimport Range from './range.js';\nimport Selection from './selection.js';\n/**\n * View upcast writer. It provides a set of methods used to manipulate non-semantic view trees.\n *\n * It should be used only while working on a non-semantic view\n * (e.g. a view created from HTML string on paste).\n * To manipulate a view which was or is being downcasted from the the model use the\n * {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.\n *\n * Read more about changing the view in the {@glink framework/architecture/editing-engine#changing-the-view Changing the view}\n * section of the {@glink framework/architecture/editing-engine Editing engine architecture} guide.\n *\n * Unlike `DowncastWriter`, which is available in the {@link module:engine/view/view~View#change `View#change()`} block,\n * `UpcastWriter` can be created wherever you need it:\n *\n * ```ts\n * const writer = new UpcastWriter( viewDocument );\n * const text = writer.createText( 'foo!' );\n *\n * writer.appendChild( text, someViewElement );\n * ```\n */\nexport default class UpcastWriter {\n /**\n * @param document The view document instance in which this upcast writer operates.\n */\n constructor(document) {\n this.document = document;\n }\n /**\n * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.\n *\n * @param children A list of nodes to be inserted into the created document fragment.\n * @returns The created document fragment.\n */\n createDocumentFragment(children) {\n return new DocumentFragment(this.document, children);\n }\n /**\n * Creates a new {@link module:engine/view/element~Element} instance.\n *\n * Attributes can be passed in various formats:\n *\n * ```ts\n * upcastWriter.createElement( 'div', { class: 'editor', contentEditable: 'true' } ); // object\n * upcastWriter.createElement( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator\n * upcastWriter.createElement( 'div', mapOfAttributes ); // map\n * ```\n *\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n * @returns Created element.\n */\n createElement(name, attrs, children) {\n return new Element(this.document, name, attrs, children);\n }\n /**\n * Creates a new {@link module:engine/view/text~Text} instance.\n *\n * @param data The text's data.\n * @returns The created text node.\n */\n createText(data) {\n return new Text(this.document, data);\n }\n /**\n * Clones the provided element.\n *\n * @see module:engine/view/element~Element#_clone\n * @param element Element to be cloned.\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any children.\n * @returns Clone of this element.\n */\n clone(element, deep = false) {\n return element._clone(deep);\n }\n /**\n * Appends a child node or a list of child nodes at the end of this node\n * and sets the parent of these nodes to this element.\n *\n * @see module:engine/view/element~Element#_appendChild\n * @param items Items to be inserted.\n * @param element Element to which items will be appended.\n * @returns Number of appended nodes.\n */\n appendChild(items, element) {\n return element._appendChild(items);\n }\n /**\n * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to\n * this element.\n *\n * @see module:engine/view/element~Element#_insertChild\n * @param index Offset at which nodes should be inserted.\n * @param items Items to be inserted.\n * @param element Element to which items will be inserted.\n * @returns Number of inserted nodes.\n */\n insertChild(index, items, element) {\n return element._insertChild(index, items);\n }\n /**\n * Removes the given number of child nodes starting at the given index and set the parent of these nodes to `null`.\n *\n * @see module:engine/view/element~Element#_removeChildren\n * @param index Offset from which nodes will be removed.\n * @param howMany Number of nodes to remove.\n * @param element Element which children will be removed.\n * @returns The array containing removed nodes.\n */\n removeChildren(index, howMany, element) {\n return element._removeChildren(index, howMany);\n }\n /**\n * Removes given element from the view structure. Will not have effect on detached elements.\n *\n * @param element Element which will be removed.\n * @returns The array containing removed nodes.\n */\n remove(element) {\n const parent = element.parent;\n if (parent) {\n return this.removeChildren(parent.getChildIndex(element), 1, parent);\n }\n return [];\n }\n /**\n * Replaces given element with the new one in the view structure. Will not have effect on detached elements.\n *\n * @param oldElement Element which will be replaced.\n * @param newElement Element which will be inserted in the place of the old element.\n * @returns Whether old element was successfully replaced.\n */\n replace(oldElement, newElement) {\n const parent = oldElement.parent;\n if (parent) {\n const index = parent.getChildIndex(oldElement);\n this.removeChildren(index, 1, parent);\n this.insertChild(index, newElement, parent);\n return true;\n }\n return false;\n }\n /**\n * Removes given element from view structure and places its children in its position.\n * It does nothing if element has no parent.\n *\n * @param element Element to unwrap.\n */\n unwrapElement(element) {\n const parent = element.parent;\n if (parent) {\n const index = parent.getChildIndex(element);\n this.remove(element);\n this.insertChild(index, element.getChildren(), parent);\n }\n }\n /**\n * Renames element by creating a copy of a given element but with its name changed and then moving contents of the\n * old element to the new one.\n *\n * Since this function creates a new element and removes the given one, the new element is returned to keep reference.\n *\n * @param newName New element name.\n * @param element Element to be renamed.\n * @returns New element or null if the old element was not replaced (happens for detached elements).\n */\n rename(newName, element) {\n const newElement = new Element(this.document, newName, element.getAttributes(), element.getChildren());\n return this.replace(element, newElement) ? newElement : null;\n }\n /**\n * Adds or overwrites element's attribute with a specified key and value.\n *\n * ```ts\n * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );\n * ```\n *\n * @see module:engine/view/element~Element#_setAttribute\n * @param key Attribute key.\n * @param value Attribute value.\n * @param element Element for which attribute will be set.\n */\n setAttribute(key, value, element) {\n element._setAttribute(key, value);\n }\n /**\n * Removes attribute from the element.\n *\n * ```ts\n * writer.removeAttribute( 'href', linkElement );\n * ```\n *\n * @see module:engine/view/element~Element#_removeAttribute\n * @param key Attribute key.\n * @param element Element from which attribute will be removed.\n */\n removeAttribute(key, element) {\n element._removeAttribute(key);\n }\n /**\n * Adds specified class to the element.\n *\n * ```ts\n * writer.addClass( 'foo', linkElement );\n * writer.addClass( [ 'foo', 'bar' ], linkElement );\n * ```\n *\n * @see module:engine/view/element~Element#_addClass\n * @param className Single class name or array of class names which will be added.\n * @param element Element for which class will be added.\n */\n addClass(className, element) {\n element._addClass(className);\n }\n /**\n * Removes specified class from the element.\n *\n * ```ts\n * writer.removeClass( 'foo', linkElement );\n * writer.removeClass( [ 'foo', 'bar' ], linkElement );\n * ```\n *\n * @see module:engine/view/element~Element#_removeClass\n * @param className Single class name or array of class names which will be removed.\n * @param element Element from which class will be removed.\n */\n removeClass(className, element) {\n element._removeClass(className);\n }\n setStyle(property, valueOrElement, element) {\n if (isPlainObject(property) && element === undefined) {\n valueOrElement._setStyle(property);\n }\n else {\n element._setStyle(property, valueOrElement);\n }\n }\n /**\n * Removes specified style from the element.\n *\n * ```ts\n * writer.removeStyle( 'color', element ); // Removes 'color' style.\n * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.\n * ```\n *\n * **Note**: This method can work with normalized style names if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.\n *\n * @see module:engine/view/element~Element#_removeStyle\n * @param property Style property name or names to be removed.\n * @param element Element from which style will be removed.\n */\n removeStyle(property, element) {\n element._removeStyle(property);\n }\n /**\n * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,\n * so they can be used to add special data to elements.\n *\n * @see module:engine/view/element~Element#_setCustomProperty\n * @param key Custom property name/key.\n * @param value Custom property value to be stored.\n * @param element Element for which custom property will be set.\n */\n setCustomProperty(key, value, element) {\n element._setCustomProperty(key, value);\n }\n /**\n * Removes a custom property stored under the given key.\n *\n * @see module:engine/view/element~Element#_removeCustomProperty\n * @param key Name/key of the custom property to be removed.\n * @param element Element from which the custom property will be removed.\n * @returns Returns true if property was removed.\n */\n removeCustomProperty(key, element) {\n return element._removeCustomProperty(key);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link #createPositionBefore},\n * * {@link #createPositionAfter},\n *\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return Position._createAt(itemOrPosition, offset);\n }\n /**\n * Creates a new position after given view item.\n *\n * @param item View item after which the position should be located.\n */\n createPositionAfter(item) {\n return Position._createAfter(item);\n }\n /**\n * Creates a new position before given view item.\n *\n * @param item View item before which the position should be located.\n */\n createPositionBefore(item) {\n return Position._createBefore(item);\n }\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at `start` position.\n */\n createRange(start, end) {\n return new Range(start, end);\n }\n /**\n * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n */\n createRangeOn(item) {\n return Range._createOn(item);\n }\n /**\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return Range._createIn(element);\n }\n createSelection(...args) {\n return new Selection(...args);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nconst HEX_COLOR_REGEXP = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst RGB_COLOR_REGEXP = /^rgb\\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\\)$/i;\nconst RGBA_COLOR_REGEXP = /^rgba\\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\\.?[0-9]+)\\)$/i;\nconst HSL_COLOR_REGEXP = /^hsl\\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\\.?[0-9]+)?\\)$/i;\nconst HSLA_COLOR_REGEXP = /^hsla\\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\\.?[0-9]+)\\)$/i;\n// Note: This regexp hardcodes a single level of nested () for values such as `calc( var( ...) + ...)`.\n// If this gets more complex, a proper parser should be used instead.\nconst CSS_SHORTHAND_VALUE_REGEXP = /\\w+\\((?:[^()]|\\([^()]*\\))*\\)|\\S+/gi;\nconst COLOR_NAMES = new Set([\n // CSS Level 1\n 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia',\n 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua',\n // CSS Level 2 (Revision 1)\n 'orange',\n // CSS Color Module Level 3\n 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown',\n 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan',\n 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta',\n 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue',\n 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey',\n 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod',\n 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush',\n 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray',\n 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray',\n 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine',\n 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen',\n 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite',\n 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred',\n 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon',\n 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',\n 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen',\n // CSS Color Module Level 3 (System Colors)\n 'activeborder', 'activecaption', 'appworkspace', 'background', 'buttonface', 'buttonhighlight', 'buttonshadow',\n 'buttontext', 'captiontext', 'graytext', 'highlight', 'highlighttext', 'inactiveborder', 'inactivecaption',\n 'inactivecaptiontext', 'infobackground', 'infotext', 'menu', 'menutext', 'scrollbar', 'threeddarkshadow',\n 'threedface', 'threedhighlight', 'threedlightshadow', 'threedshadow', 'window', 'windowframe', 'windowtext',\n // CSS Color Module Level 4\n 'rebeccapurple',\n // Keywords\n 'currentcolor', 'transparent'\n]);\n/**\n * Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.\n *\n * ```ts\n * isColor( '#f00' );\t\t\t\t\t\t// true\n * isColor( '#AA00BB33' );\t\t\t\t\t// true\n * isColor( 'rgb(0, 0, 250)' );\t\t\t\t// true\n * isColor( 'hsla(240, 100%, 50%, .7)' );\t// true\n * isColor( 'deepskyblue' );\t\t\t\t// true\n * ```\n *\n * **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.\n */\nexport function isColor(string) {\n // As far as I was able to test checking some pre-conditions is faster than joining each test with ||.\n if (string.startsWith('#')) {\n return HEX_COLOR_REGEXP.test(string);\n }\n if (string.startsWith('rgb')) {\n return RGB_COLOR_REGEXP.test(string) || RGBA_COLOR_REGEXP.test(string);\n }\n if (string.startsWith('hsl')) {\n return HSL_COLOR_REGEXP.test(string) || HSLA_COLOR_REGEXP.test(string);\n }\n // Array check > RegExp test.\n return COLOR_NAMES.has(string.toLowerCase());\n}\nconst lineStyleValues = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'];\n/**\n * Checks if string contains [line style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) CSS value.\n */\nexport function isLineStyle(string) {\n return lineStyleValues.includes(string);\n}\nconst lengthRegExp = /^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;\n/**\n * Checks if string contains [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) CSS value.\n */\nexport function isLength(string) {\n return lengthRegExp.test(string);\n}\nconst PERCENTAGE_VALUE_REGEXP = /^[+-]?[0-9]*([.][0-9]+)?%$/;\n/**\n * Checks if string contains [percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) CSS value.\n */\nexport function isPercentage(string) {\n return PERCENTAGE_VALUE_REGEXP.test(string);\n}\nconst repeatValues = ['repeat-x', 'repeat-y', 'repeat', 'space', 'round', 'no-repeat'];\n/**\n * Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.\n */\nexport function isRepeat(string) {\n return repeatValues.includes(string);\n}\nconst positionValues = ['center', 'top', 'bottom', 'left', 'right'];\n/**\n * Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.\n */\nexport function isPosition(string) {\n return positionValues.includes(string);\n}\nconst attachmentValues = ['fixed', 'scroll', 'local'];\n/**\n * Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.\n */\nexport function isAttachment(string) {\n return attachmentValues.includes(string);\n}\nconst urlRegExp = /^url\\(/;\n/**\n * Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.\n */\nexport function isURL(string) {\n return urlRegExp.test(string);\n}\n/**\n * Parses box sides as individual values.\n */\nexport function getBoxSidesValues(value = '') {\n if (value === '') {\n return { top: undefined, right: undefined, bottom: undefined, left: undefined };\n }\n const values = getShorthandValues(value);\n const top = values[0];\n const bottom = values[2] || top;\n const right = values[1] || top;\n const left = values[3] || right;\n return { top, bottom, right, left };\n}\n/**\n * Default reducer for CSS properties that concerns edges of a box\n * [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notations:\n *\n * ```ts\n * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );\n * ```\n */\nexport function getBoxSidesValueReducer(styleShorthand) {\n return (value) => {\n const { top, right, bottom, left } = value;\n const reduced = [];\n if (![top, right, left, bottom].every(value => !!value)) {\n if (top) {\n reduced.push([styleShorthand + '-top', top]);\n }\n if (right) {\n reduced.push([styleShorthand + '-right', right]);\n }\n if (bottom) {\n reduced.push([styleShorthand + '-bottom', bottom]);\n }\n if (left) {\n reduced.push([styleShorthand + '-left', left]);\n }\n }\n else {\n reduced.push([styleShorthand, getBoxSidesShorthandValue(value)]);\n }\n return reduced;\n };\n}\n/**\n * Returns a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notation\n * of a CSS property value.\n *\n * ```ts\n * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );\n * // will return '1px 1px 2px'\n * ```\n */\nexport function getBoxSidesShorthandValue({ top, right, bottom, left }) {\n const out = [];\n if (left !== right) {\n out.push(top, right, bottom, left);\n }\n else if (bottom !== top) {\n out.push(top, right, bottom);\n }\n else if (right !== top) {\n out.push(top, right);\n }\n else {\n out.push(top);\n }\n return out.join(' ');\n}\n/**\n * Creates a normalizer for a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) 1-to-4 value.\n *\n * ```ts\n * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );\n * ```\n */\nexport function getPositionShorthandNormalizer(shorthand) {\n return (value) => {\n return {\n path: shorthand,\n value: getBoxSidesValues(value)\n };\n };\n}\n/**\n * Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).\n *\n * ```ts\n * getShorthandValues( 'red blue RGB(0, 0, 0)');\n * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]\n * ```\n */\nexport function getShorthandValues(string) {\n const matches = string.matchAll(CSS_SHORTHAND_VALUE_REGEXP);\n return Array.from(matches).map(i => i[0]);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getShorthandValues, isAttachment, isColor, isPosition, isRepeat, isURL } from './utils.js';\n/**\n * Adds a background CSS styles processing rules.\n *\n * ```ts\n * editor.data.addStyleProcessorRules( addBackgroundRules );\n * ```\n *\n * The normalized value is stored as:\n *\n * ```ts\n * const styles = {\n * \tbackground: {\n * \t\tcolor,\n * \t\trepeat,\n * \t\tposition,\n * \t\tattachment,\n * \t\timage\n * \t}\n * };\n * ````\n *\n * **Note**: Currently only `'background-color'` longhand value is parsed besides `'background'` shorthand. The reducer also supports only\n * `'background-color'` value.\n */\nexport function addBackgroundRules(stylesProcessor) {\n stylesProcessor.setNormalizer('background', getBackgroundNormalizer());\n stylesProcessor.setNormalizer('background-color', getBackgroundColorNormalizer());\n stylesProcessor.setReducer('background', getBackgroundReducer());\n stylesProcessor.setStyleRelation('background', ['background-color']);\n}\nfunction getBackgroundNormalizer() {\n return value => {\n const background = {};\n const parts = getShorthandValues(value);\n for (const part of parts) {\n if (isRepeat(part)) {\n background.repeat = background.repeat || [];\n background.repeat.push(part);\n }\n else if (isPosition(part)) {\n background.position = background.position || [];\n background.position.push(part);\n }\n else if (isAttachment(part)) {\n background.attachment = part;\n }\n else if (isColor(part)) {\n background.color = part;\n }\n else if (isURL(part)) {\n background.image = part;\n }\n }\n return {\n path: 'background',\n value: background\n };\n };\n}\nfunction getBackgroundColorNormalizer() {\n return value => ({ path: 'background.color', value });\n}\nfunction getBackgroundReducer() {\n return value => {\n const ret = [];\n ret.push(['background-color', value.color]);\n return ret;\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getShorthandValues, getBoxSidesValueReducer, getBoxSidesValues, isLength, isLineStyle } from './utils.js';\n/**\n * Adds a border CSS styles processing rules.\n *\n * ```ts\n * editor.data.addStyleProcessorRules( addBorderRules );\n * ```\n *\n * This rules merges all [border](https://developer.mozilla.org/en-US/docs/Web/CSS/border) styles notation shorthands:\n *\n * - border\n * - border-top\n * - border-right\n * - border-bottom\n * - border-left\n * - border-color\n * - border-style\n * - border-width\n *\n * and all corresponding longhand forms (like `border-top-color`, `border-top-style`, etc).\n *\n * It does not handle other shorthands (like `border-radius` or `border-image`).\n *\n * The normalized model stores border values as:\n *\n * ```ts\n * const styles = {\n * \tborder: {\n * \t\tcolor: { top, right, bottom, left },\n * \t\tstyle: { top, right, bottom, left },\n * \t\twidth: { top, right, bottom, left },\n * \t}\n * };\n * ```\n */\nexport function addBorderRules(stylesProcessor) {\n stylesProcessor.setNormalizer('border', getBorderNormalizer());\n // Border-position shorthands.\n stylesProcessor.setNormalizer('border-top', getBorderPositionNormalizer('top'));\n stylesProcessor.setNormalizer('border-right', getBorderPositionNormalizer('right'));\n stylesProcessor.setNormalizer('border-bottom', getBorderPositionNormalizer('bottom'));\n stylesProcessor.setNormalizer('border-left', getBorderPositionNormalizer('left'));\n // Border-property shorthands.\n stylesProcessor.setNormalizer('border-color', getBorderPropertyNormalizer('color'));\n stylesProcessor.setNormalizer('border-width', getBorderPropertyNormalizer('width'));\n stylesProcessor.setNormalizer('border-style', getBorderPropertyNormalizer('style'));\n // Border longhands.\n stylesProcessor.setNormalizer('border-top-color', getBorderPropertyPositionNormalizer('color', 'top'));\n stylesProcessor.setNormalizer('border-top-style', getBorderPropertyPositionNormalizer('style', 'top'));\n stylesProcessor.setNormalizer('border-top-width', getBorderPropertyPositionNormalizer('width', 'top'));\n stylesProcessor.setNormalizer('border-right-color', getBorderPropertyPositionNormalizer('color', 'right'));\n stylesProcessor.setNormalizer('border-right-style', getBorderPropertyPositionNormalizer('style', 'right'));\n stylesProcessor.setNormalizer('border-right-width', getBorderPropertyPositionNormalizer('width', 'right'));\n stylesProcessor.setNormalizer('border-bottom-color', getBorderPropertyPositionNormalizer('color', 'bottom'));\n stylesProcessor.setNormalizer('border-bottom-style', getBorderPropertyPositionNormalizer('style', 'bottom'));\n stylesProcessor.setNormalizer('border-bottom-width', getBorderPropertyPositionNormalizer('width', 'bottom'));\n stylesProcessor.setNormalizer('border-left-color', getBorderPropertyPositionNormalizer('color', 'left'));\n stylesProcessor.setNormalizer('border-left-style', getBorderPropertyPositionNormalizer('style', 'left'));\n stylesProcessor.setNormalizer('border-left-width', getBorderPropertyPositionNormalizer('width', 'left'));\n stylesProcessor.setExtractor('border-top', getBorderPositionExtractor('top'));\n stylesProcessor.setExtractor('border-right', getBorderPositionExtractor('right'));\n stylesProcessor.setExtractor('border-bottom', getBorderPositionExtractor('bottom'));\n stylesProcessor.setExtractor('border-left', getBorderPositionExtractor('left'));\n stylesProcessor.setExtractor('border-top-color', 'border.color.top');\n stylesProcessor.setExtractor('border-right-color', 'border.color.right');\n stylesProcessor.setExtractor('border-bottom-color', 'border.color.bottom');\n stylesProcessor.setExtractor('border-left-color', 'border.color.left');\n stylesProcessor.setExtractor('border-top-width', 'border.width.top');\n stylesProcessor.setExtractor('border-right-width', 'border.width.right');\n stylesProcessor.setExtractor('border-bottom-width', 'border.width.bottom');\n stylesProcessor.setExtractor('border-left-width', 'border.width.left');\n stylesProcessor.setExtractor('border-top-style', 'border.style.top');\n stylesProcessor.setExtractor('border-right-style', 'border.style.right');\n stylesProcessor.setExtractor('border-bottom-style', 'border.style.bottom');\n stylesProcessor.setExtractor('border-left-style', 'border.style.left');\n stylesProcessor.setReducer('border-color', getBoxSidesValueReducer('border-color'));\n stylesProcessor.setReducer('border-style', getBoxSidesValueReducer('border-style'));\n stylesProcessor.setReducer('border-width', getBoxSidesValueReducer('border-width'));\n stylesProcessor.setReducer('border-top', getBorderPositionReducer('top'));\n stylesProcessor.setReducer('border-right', getBorderPositionReducer('right'));\n stylesProcessor.setReducer('border-bottom', getBorderPositionReducer('bottom'));\n stylesProcessor.setReducer('border-left', getBorderPositionReducer('left'));\n stylesProcessor.setReducer('border', getBorderReducer());\n stylesProcessor.setStyleRelation('border', [\n 'border-color', 'border-style', 'border-width',\n 'border-top', 'border-right', 'border-bottom', 'border-left',\n 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',\n 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',\n 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'\n ]);\n stylesProcessor.setStyleRelation('border-color', [\n 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'\n ]);\n stylesProcessor.setStyleRelation('border-style', [\n 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'\n ]);\n stylesProcessor.setStyleRelation('border-width', [\n 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'\n ]);\n stylesProcessor.setStyleRelation('border-top', ['border-top-color', 'border-top-style', 'border-top-width']);\n stylesProcessor.setStyleRelation('border-right', ['border-right-color', 'border-right-style', 'border-right-width']);\n stylesProcessor.setStyleRelation('border-bottom', ['border-bottom-color', 'border-bottom-style', 'border-bottom-width']);\n stylesProcessor.setStyleRelation('border-left', ['border-left-color', 'border-left-style', 'border-left-width']);\n}\nfunction getBorderNormalizer() {\n return value => {\n const { color, style, width } = normalizeBorderShorthand(value);\n return {\n path: 'border',\n value: {\n color: getBoxSidesValues(color),\n style: getBoxSidesValues(style),\n width: getBoxSidesValues(width)\n }\n };\n };\n}\nfunction getBorderPositionNormalizer(side) {\n return value => {\n const { color, style, width } = normalizeBorderShorthand(value);\n const border = {};\n if (color !== undefined) {\n border.color = { [side]: color };\n }\n if (style !== undefined) {\n border.style = { [side]: style };\n }\n if (width !== undefined) {\n border.width = { [side]: width };\n }\n return {\n path: 'border',\n value: border\n };\n };\n}\nfunction getBorderPropertyNormalizer(propertyName) {\n return value => {\n return {\n path: 'border',\n value: toBorderPropertyShorthand(value, propertyName)\n };\n };\n}\nfunction toBorderPropertyShorthand(value, property) {\n return {\n [property]: getBoxSidesValues(value)\n };\n}\nfunction getBorderPropertyPositionNormalizer(property, side) {\n return value => {\n return {\n path: 'border',\n value: {\n [property]: {\n [side]: value\n }\n }\n };\n };\n}\nfunction getBorderPositionExtractor(which) {\n return (name, styles) => {\n if (styles.border) {\n return extractBorderPosition(styles.border, which);\n }\n };\n}\nfunction extractBorderPosition(border, which) {\n const value = {};\n if (border.width && border.width[which]) {\n value.width = border.width[which];\n }\n if (border.style && border.style[which]) {\n value.style = border.style[which];\n }\n if (border.color && border.color[which]) {\n value.color = border.color[which];\n }\n return value;\n}\nfunction normalizeBorderShorthand(string) {\n const result = {};\n const parts = getShorthandValues(string);\n for (const part of parts) {\n if (isLength(part) || /thin|medium|thick/.test(part)) {\n result.width = part;\n }\n else if (isLineStyle(part)) {\n result.style = part;\n }\n else {\n result.color = part;\n }\n }\n return result;\n}\n/**\n * The border reducer factory.\n *\n * It tries to produce the most optimal output for the specified styles.\n *\n * For a border style:\n *\n * ```css\n * style: {top: \"solid\", bottom: \"solid\", right: \"solid\", left: \"solid\"}\n * ```\n *\n * It will produce: `border-style: solid`.\n * For a border style and color:\n *\n * ```css\n * color: {top: \"#ff0\", bottom: \"#ff0\", right: \"#ff0\", left: \"#ff0\"}\n * style: {top: \"solid\", bottom: \"solid\", right: \"solid\", left: \"solid\"}\n * ```\n *\n * It will produce: `border-color: #ff0; border-style: solid`.\n * If all border parameters are specified:\n *\n * ```css\n * color: {top: \"#ff0\", bottom: \"#ff0\", right: \"#ff0\", left: \"#ff0\"}\n * style: {top: \"solid\", bottom: \"solid\", right: \"solid\", left: \"solid\"}\n * width: {top: \"2px\", bottom: \"2px\", right: \"2px\", left: \"2px\"}\n * ```\n *\n * It will combine everything into a single property: `border: 2px solid #ff0`.\n *\n * The definitions are merged only if all border selectors have the same values.\n */\nfunction getBorderReducer() {\n return value => {\n const topStyles = extractBorderPosition(value, 'top');\n const rightStyles = extractBorderPosition(value, 'right');\n const bottomStyles = extractBorderPosition(value, 'bottom');\n const leftStyles = extractBorderPosition(value, 'left');\n const borderStyles = [topStyles, rightStyles, bottomStyles, leftStyles];\n const borderStylesByType = {\n width: getReducedStyleValueForType(borderStyles, 'width'),\n style: getReducedStyleValueForType(borderStyles, 'style'),\n color: getReducedStyleValueForType(borderStyles, 'color')\n };\n // Try reducing to a single `border:` property.\n const reducedBorderStyle = reduceBorderPosition(borderStylesByType, 'all');\n if (reducedBorderStyle.length) {\n return reducedBorderStyle;\n }\n // Try reducing to `border-style:`, `border-width:`, `border-color:` properties.\n const reducedStyleTypes = Object.entries(borderStylesByType).reduce((reducedStyleTypes, [type, value]) => {\n if (value) {\n reducedStyleTypes.push([`border-${type}`, value]);\n // Remove it from the full set to not include it in the most specific properties later.\n borderStyles.forEach(style => delete style[type]);\n }\n return reducedStyleTypes;\n }, []);\n // The reduced properties (by type) and all that remains that could not be reduced.\n return [\n ...reducedStyleTypes,\n ...reduceBorderPosition(topStyles, 'top'),\n ...reduceBorderPosition(rightStyles, 'right'),\n ...reduceBorderPosition(bottomStyles, 'bottom'),\n ...reduceBorderPosition(leftStyles, 'left')\n ];\n };\n /**\n * @param styles The array of objects with `style`, `color`, `width` properties.\n */\n function getReducedStyleValueForType(styles, type) {\n return styles\n .map(style => style[type])\n .reduce((result, style) => result == style ? result : null);\n }\n}\nfunction getBorderPositionReducer(which) {\n return value => reduceBorderPosition(value, which);\n}\n/**\n * Returns an array with reduced border styles depending on the specified values.\n *\n * If all border properties (width, style, color) are specified, the returned selector will be\n * merged into a group: `border-*: [width] [style] [color]`.\n *\n * Otherwise, the specific definitions will be returned: `border-(width|style|color)-*: [value]`.\n *\n * @param value Styles if defined.\n * @param which The border position.\n */\nfunction reduceBorderPosition(value, which) {\n const borderTypes = [];\n if (value && (value.width)) {\n borderTypes.push('width');\n }\n if (value && (value.style)) {\n borderTypes.push('style');\n }\n if (value && (value.color)) {\n borderTypes.push('color');\n }\n if (borderTypes.length == 3) {\n const borderValue = borderTypes.map(item => value[item]).join(' ');\n return [\n which == 'all' ? ['border', borderValue] : [`border-${which}`, borderValue]\n ];\n }\n // We are unable to reduce to a single `border:` property.\n if (which == 'all') {\n return [];\n }\n return borderTypes.map(type => {\n return [`border-${which}-${type}`, value[type]];\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils.js';\n/**\n * Adds a padding CSS styles processing rules.\n *\n * ```ts\n * editor.data.addStyleProcessorRules( addPaddingRules );\n * ```\n *\n * The normalized value is stored as:\n *\n * ```ts\n * const styles = {\n * \tpadding: {\n * \t\ttop,\n * \t\tright,\n * \t\tbottom,\n * \t\tleft\n * \t}\n * };\n * ```\n */\nexport function addPaddingRules(stylesProcessor) {\n stylesProcessor.setNormalizer('padding', getPositionShorthandNormalizer('padding'));\n stylesProcessor.setNormalizer('padding-top', value => ({ path: 'padding.top', value }));\n stylesProcessor.setNormalizer('padding-right', value => ({ path: 'padding.right', value }));\n stylesProcessor.setNormalizer('padding-bottom', value => ({ path: 'padding.bottom', value }));\n stylesProcessor.setNormalizer('padding-left', value => ({ path: 'padding.left', value }));\n stylesProcessor.setReducer('padding', getBoxSidesValueReducer('padding'));\n stylesProcessor.setStyleRelation('padding', ['padding-top', 'padding-right', 'padding-bottom', 'padding-left']);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * An abstract watchdog class that handles most of the error handling process and the state of the underlying component.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and how to use it.\n *\n * @internal\n */\nexport default class Watchdog {\n /**\n * @param {module:watchdog/watchdog~WatchdogConfig} config The watchdog plugin configuration.\n */\n constructor(config) {\n /**\n * An array of crashes saved as an object with the following properties:\n *\n * * `message`: `String`,\n * * `stack`: `String`,\n * * `date`: `Number`,\n * * `filename`: `String | undefined`,\n * * `lineno`: `Number | undefined`,\n * * `colno`: `Number | undefined`,\n */\n this.crashes = [];\n /**\n * Specifies the state of the item watched by the watchdog. The state can be one of the following values:\n *\n * * `initializing` – Before the first initialization, and after crashes, before the item is ready.\n * * `ready` – A state when the user can interact with the item.\n * * `crashed` – A state when an error occurs. It quickly changes to `initializing` or `crashedPermanently`\n * depending on how many and how frequent errors have been caught recently.\n * * `crashedPermanently` – A state when the watchdog stops reacting to errors and keeps the item it is watching crashed,\n * * `destroyed` – A state when the item is manually destroyed by the user after calling `watchdog.destroy()`.\n */\n this.state = 'initializing';\n /**\n * Returns the result of the `Date.now()` call. It can be overridden in tests to mock time as some popular\n * approaches like `sinon.useFakeTimers()` do not work well with error handling.\n */\n this._now = Date.now;\n this.crashes = [];\n this._crashNumberLimit = typeof config.crashNumberLimit === 'number' ? config.crashNumberLimit : 3;\n this._minimumNonErrorTimePeriod = typeof config.minimumNonErrorTimePeriod === 'number' ? config.minimumNonErrorTimePeriod : 5000;\n this._boundErrorHandler = evt => {\n // `evt.error` is exposed by EventError while `evt.reason` is available in PromiseRejectionEvent.\n const error = 'error' in evt ? evt.error : evt.reason;\n // Note that `evt.reason` might be everything that is in the promise rejection.\n // Similarly everything that is thrown lands in `evt.error`.\n if (error instanceof Error) {\n this._handleError(error, evt);\n }\n };\n this._listeners = {};\n if (!this._restart) {\n throw new Error('The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. ' +\n 'Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.');\n }\n }\n /**\n * Destroys the watchdog and releases the resources.\n */\n destroy() {\n this._stopErrorHandling();\n this._listeners = {};\n }\n /**\n * Starts listening to a specific event name by registering a callback that will be executed\n * whenever an event with a given name fires.\n *\n * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n *\n * @param eventName The event name.\n * @param callback A callback which will be added to event listeners.\n */\n on(eventName, callback) {\n if (!this._listeners[eventName]) {\n this._listeners[eventName] = [];\n }\n this._listeners[eventName].push(callback);\n }\n /**\n * Stops listening to the specified event name by removing the callback from event listeners.\n *\n * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n *\n * @param eventName The event name.\n * @param callback A callback which will be removed from event listeners.\n */\n off(eventName, callback) {\n this._listeners[eventName] = this._listeners[eventName]\n .filter(cb => cb !== callback);\n }\n /**\n * Fires an event with a given event name and arguments.\n *\n * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n */\n _fire(eventName, ...args) {\n const callbacks = this._listeners[eventName] || [];\n for (const callback of callbacks) {\n callback.apply(this, [null, ...args]);\n }\n }\n /**\n * Starts error handling by attaching global error handlers.\n */\n _startErrorHandling() {\n window.addEventListener('error', this._boundErrorHandler);\n window.addEventListener('unhandledrejection', this._boundErrorHandler);\n }\n /**\n * Stops error handling by detaching global error handlers.\n */\n _stopErrorHandling() {\n window.removeEventListener('error', this._boundErrorHandler);\n window.removeEventListener('unhandledrejection', this._boundErrorHandler);\n }\n /**\n * Checks if an error comes from the watched item and restarts it.\n * It reacts to {@link module:utils/ckeditorerror~CKEditorError `CKEditorError` errors} only.\n *\n * @fires error\n * @param error Error.\n * @param evt An error event.\n */\n _handleError(error, evt) {\n // @if CK_DEBUG // const err = error as CKEditorError;\n // @if CK_DEBUG // if ( err.is && err.is( 'CKEditorError' ) && err.context === undefined ) {\n // @if CK_DEBUG // console.warn( 'The error is missing its context and Watchdog cannot restart the proper item.' );\n // @if CK_DEBUG // }\n if (this._shouldReactToError(error)) {\n this.crashes.push({\n message: error.message,\n stack: error.stack,\n // `evt.filename`, `evt.lineno` and `evt.colno` are available only in ErrorEvent events\n filename: evt instanceof ErrorEvent ? evt.filename : undefined,\n lineno: evt instanceof ErrorEvent ? evt.lineno : undefined,\n colno: evt instanceof ErrorEvent ? evt.colno : undefined,\n date: this._now()\n });\n const causesRestart = this._shouldRestart();\n this.state = 'crashed';\n this._fire('stateChange');\n this._fire('error', { error, causesRestart });\n if (causesRestart) {\n this._restart();\n }\n else {\n this.state = 'crashedPermanently';\n this._fire('stateChange');\n }\n }\n }\n /**\n * Checks whether an error should be handled by the watchdog.\n *\n * @param error An error that was caught by the error handling process.\n */\n _shouldReactToError(error) {\n return (error.is &&\n error.is('CKEditorError') &&\n error.context !== undefined &&\n // In some cases the watched item should not be restarted - e.g. during the item initialization.\n // That's why the `null` was introduced as a correct error context which does cause restarting.\n error.context !== null &&\n // Do not react to errors if the watchdog is in states other than `ready`.\n this.state === 'ready' &&\n this._isErrorComingFromThisItem(error));\n }\n /**\n * Checks if the watchdog should restart the underlying item.\n */\n _shouldRestart() {\n if (this.crashes.length <= this._crashNumberLimit) {\n return true;\n }\n const lastErrorTime = this.crashes[this.crashes.length - 1].date;\n const firstMeaningfulErrorTime = this.crashes[this.crashes.length - 1 - this._crashNumberLimit].date;\n const averageNonErrorTimePeriod = (lastErrorTime - firstMeaningfulErrorTime) / this._crashNumberLimit;\n return averageNonErrorTimePeriod > this._minimumNonErrorTimePeriod;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module watchdog/utils/getsubnodes\n */\n/* globals EventTarget, Event */\nexport default function getSubNodes(head, excludedProperties = new Set()) {\n const nodes = [head];\n // @if CK_DEBUG_WATCHDOG // const prevNodeMap = new Map();\n // Nodes are stored to prevent infinite looping.\n const subNodes = new Set();\n let nodeIndex = 0;\n while (nodes.length > nodeIndex) {\n // Incrementing the iterator is much faster than changing size of the array with Array.prototype.shift().\n const node = nodes[nodeIndex++];\n if (subNodes.has(node) || !shouldNodeBeIncluded(node) || excludedProperties.has(node)) {\n continue;\n }\n subNodes.add(node);\n // Handle arrays, maps, sets, custom collections that implements `[ Symbol.iterator ]()`, etc.\n if (Symbol.iterator in node) {\n // The custom editor iterators might cause some problems if the editor is crashed.\n try {\n for (const n of node) {\n nodes.push(n);\n // @if CK_DEBUG_WATCHDOG // if ( !prevNodeMap.has( n ) ) {\n // @if CK_DEBUG_WATCHDOG // \tprevNodeMap.set( n, node );\n // @if CK_DEBUG_WATCHDOG // }\n }\n }\n catch (err) {\n // Do not log errors for broken structures\n // since we are in the error handling process already.\n // eslint-disable-line no-empty\n }\n }\n else {\n for (const key in node) {\n // We share a reference via the protobuf library within the editors,\n // hence the shared value should be skipped. Although, it's not a perfect\n // solution since new places like that might occur in the future.\n if (key === 'defaultValue') {\n continue;\n }\n nodes.push(node[key]);\n // @if CK_DEBUG_WATCHDOG // if ( !prevNodeMap.has( node[ key ] ) ) {\n // @if CK_DEBUG_WATCHDOG // \tprevNodeMap.set( node[ key ], node );\n // @if CK_DEBUG_WATCHDOG // }\n }\n }\n }\n // @if CK_DEBUG_WATCHDOG // return { subNodes, prevNodeMap } as any;\n return subNodes;\n}\nfunction shouldNodeBeIncluded(node) {\n const type = Object.prototype.toString.call(node);\n const typeOfNode = typeof node;\n return !(typeOfNode === 'number' ||\n typeOfNode === 'boolean' ||\n typeOfNode === 'string' ||\n typeOfNode === 'symbol' ||\n typeOfNode === 'function' ||\n type === '[object Date]' ||\n type === '[object RegExp]' ||\n type === '[object Module]' ||\n node === undefined ||\n node === null ||\n // This flag is meant to exclude singletons shared across editor instances. So when an error is thrown in one editor,\n // the other editors connected through the reference to the same singleton are not restarted. This is a temporary workaround\n // until a better solution is found.\n // More in https://github.com/ckeditor/ckeditor5/issues/12292.\n node._watchdogExcluded ||\n // Skip native DOM objects, e.g. Window, nodes, events, etc.\n node instanceof EventTarget ||\n node instanceof Event);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module watchdog/utils/areconnectedthroughproperties\n */\n/* globals console */\nimport getSubNodes from './getsubnodes.js';\n/**\n * Traverses both structures to find out whether there is a reference that is shared between both structures.\n */\nexport default function areConnectedThroughProperties(target1, target2, excludedNodes = new Set()) {\n if (target1 === target2 && isObject(target1)) {\n return true;\n }\n // @if CK_DEBUG_WATCHDOG // return checkConnectionBetweenProps( target1, target2, excludedNodes );\n const subNodes1 = getSubNodes(target1, excludedNodes);\n const subNodes2 = getSubNodes(target2, excludedNodes);\n for (const node of subNodes1) {\n if (subNodes2.has(node)) {\n return true;\n }\n }\n return false;\n}\n/* istanbul ignore next -- @preserve */\n// eslint-disable-next-line\nfunction checkConnectionBetweenProps(target1, target2, excludedNodes) {\n const { subNodes: subNodes1, prevNodeMap: prevNodeMap1 } = getSubNodes(target1, excludedNodes.subNodes);\n const { subNodes: subNodes2, prevNodeMap: prevNodeMap2 } = getSubNodes(target2, excludedNodes.subNodes);\n for (const sharedNode of subNodes1) {\n if (subNodes2.has(sharedNode)) {\n const connection = [];\n connection.push(sharedNode);\n let node = prevNodeMap1.get(sharedNode);\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n node = prevNodeMap2.get(sharedNode);\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n console.log('--------');\n console.log({ target1 });\n console.log({ sharedNode });\n console.log({ target2 });\n console.log({ connection });\n return true;\n }\n }\n return false;\n}\nfunction isObject(structure) {\n return typeof structure === 'object' && structure !== null;\n}\n","import debounce from './debounce.js';\nimport isObject from './isObject.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nexport default throttle;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport areConnectedThroughProperties from './utils/areconnectedthroughproperties.js';\nimport Watchdog from './watchdog.js';\nimport { throttle, cloneDeepWith, isElement } from 'lodash-es';\n/**\n * A watchdog for CKEditor 5 editors.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and\n * how to use it.\n */\nexport default class EditorWatchdog extends Watchdog {\n /**\n * @param Editor The editor class.\n * @param watchdogConfig The watchdog plugin configuration.\n */\n constructor(Editor, watchdogConfig = {}) {\n super(watchdogConfig);\n /**\n * The current editor instance.\n */\n this._editor = null;\n /**\n * A promise associated with the life cycle of the editor (creation or destruction processes).\n *\n * It is used to prevent the initialization of the editor if the previous instance has not been destroyed yet,\n * and conversely, to prevent the destruction of the editor if it has not been initialized.\n */\n this._lifecyclePromise = null;\n /**\n * Specifies whether the editor was initialized using document data (`true`) or HTML elements (`false`).\n */\n this._initUsingData = true;\n /**\n * The latest record of the editor editable elements. Used to restart the editor.\n */\n this._editables = {};\n // this._editorClass = Editor;\n this._throttledSave = throttle(this._save.bind(this), typeof watchdogConfig.saveInterval === 'number' ? watchdogConfig.saveInterval : 5000);\n // Set default creator and destructor functions:\n if (Editor) {\n this._creator = ((elementOrData, config) => Editor.create(elementOrData, config));\n }\n this._destructor = editor => editor.destroy();\n }\n /**\n * The current editor instance.\n */\n get editor() {\n return this._editor;\n }\n /**\n * @internal\n */\n get _item() {\n return this._editor;\n }\n /**\n * Sets the function that is responsible for the editor creation.\n * It expects a function that should return a promise.\n *\n * ```ts\n * watchdog.setCreator( ( element, config ) => ClassicEditor.create( element, config ) );\n * ```\n */\n setCreator(creator) {\n this._creator = creator;\n }\n /**\n * Sets the function that is responsible for the editor destruction.\n * Overrides the default destruction function, which destroys only the editor instance.\n * It expects a function that should return a promise or `undefined`.\n *\n * ```ts\n * watchdog.setDestructor( editor => {\n * \t// Do something before the editor is destroyed.\n *\n * \treturn editor\n * \t\t.destroy()\n * \t\t.then( () => {\n * \t\t\t// Do something after the editor is destroyed.\n * \t\t} );\n * } );\n * ```\n */\n setDestructor(destructor) {\n this._destructor = destructor;\n }\n /**\n * Restarts the editor instance. This method is called whenever an editor error occurs. It fires the `restart` event and changes\n * the state to `initializing`.\n *\n * @fires restart\n */\n _restart() {\n return Promise.resolve()\n .then(() => {\n this.state = 'initializing';\n this._fire('stateChange');\n return this._destroy();\n })\n .catch(err => {\n console.error('An error happened during the editor destroying.', err);\n })\n .then(() => {\n // Pre-process some data from the original editor config.\n // Our goal here is to make sure that the restarted editor will be reinitialized with correct set of roots.\n // We are not interested in any data set in config or in `.create()` first parameter. It will be replaced anyway.\n // But we need to set them correctly to make sure that proper roots are created.\n //\n // Since a different set of roots will be created, `lazyRoots` and `rootsAttributes` properties must be managed too.\n // Keys are root names, values are ''. Used when the editor was initialized by setting the first parameter to document data.\n const existingRoots = {};\n // Keeps lazy roots. They may be different when compared to initial config if some of the roots were loaded.\n const lazyRoots = [];\n // Roots attributes from the old config. Will be referred when setting new attributes.\n const oldRootsAttributes = this._config.rootsAttributes || {};\n // New attributes to be set. Is filled only for roots that still exist in the document.\n const rootsAttributes = {};\n // Traverse through the roots saved when the editor crashed and set up the discussed values.\n for (const [rootName, rootData] of Object.entries(this._data.roots)) {\n if (rootData.isLoaded) {\n existingRoots[rootName] = '';\n rootsAttributes[rootName] = oldRootsAttributes[rootName] || {};\n }\n else {\n lazyRoots.push(rootName);\n }\n }\n const updatedConfig = {\n ...this._config,\n extraPlugins: this._config.extraPlugins || [],\n lazyRoots,\n rootsAttributes,\n _watchdogInitialData: this._data\n };\n // Delete `initialData` as it is not needed. Data will be set by the watchdog based on `_watchdogInitialData`.\n // First parameter of the editor `.create()` will be used to set up initial roots.\n delete updatedConfig.initialData;\n updatedConfig.extraPlugins.push(EditorWatchdogInitPlugin);\n if (this._initUsingData) {\n return this.create(existingRoots, updatedConfig, updatedConfig.context);\n }\n else {\n // Set correct editables to make sure that proper roots are created and linked with DOM elements.\n // No need to set initial data, as it would be discarded anyway.\n //\n // If one element was initially set in `elementOrData`, then use that original element to restart the editor.\n // This is for compatibility purposes with single-root editor types.\n if (isElement(this._elementOrData)) {\n return this.create(this._elementOrData, updatedConfig, updatedConfig.context);\n }\n else {\n return this.create(this._editables, updatedConfig, updatedConfig.context);\n }\n }\n })\n .then(() => {\n this._fire('restart');\n });\n }\n /**\n * Creates the editor instance and keeps it running, using the defined creator and destructor.\n *\n * @param elementOrData The editor source element or the editor data.\n * @param config The editor configuration.\n * @param context A context for the editor.\n */\n create(elementOrData = this._elementOrData, config = this._config, context) {\n this._lifecyclePromise = Promise.resolve(this._lifecyclePromise)\n .then(() => {\n super._startErrorHandling();\n this._elementOrData = elementOrData;\n // Use document data in the first parameter of the editor `.create()` call only if it was used like this originally.\n // Use document data if a string or object with strings was passed.\n this._initUsingData = typeof elementOrData == 'string' ||\n (Object.keys(elementOrData).length > 0 && typeof Object.values(elementOrData)[0] == 'string');\n // Clone configuration because it might be shared within multiple watchdog instances. Otherwise,\n // when an error occurs in one of these editors, the watchdog will restart all of them.\n this._config = this._cloneEditorConfiguration(config) || {};\n this._config.context = context;\n return this._creator(elementOrData, this._config);\n })\n .then(editor => {\n this._editor = editor;\n editor.model.document.on('change:data', this._throttledSave);\n this._lastDocumentVersion = editor.model.document.version;\n this._data = this._getData();\n if (!this._initUsingData) {\n this._editables = this._getEditables();\n }\n this.state = 'ready';\n this._fire('stateChange');\n }).finally(() => {\n this._lifecyclePromise = null;\n });\n return this._lifecyclePromise;\n }\n /**\n * Destroys the watchdog and the current editor instance. It fires the callback\n * registered in {@link #setDestructor `setDestructor()`} and uses it to destroy the editor instance.\n * It also sets the state to `destroyed`.\n */\n destroy() {\n this._lifecyclePromise = Promise.resolve(this._lifecyclePromise)\n .then(() => {\n this.state = 'destroyed';\n this._fire('stateChange');\n super.destroy();\n return this._destroy();\n }).finally(() => {\n this._lifecyclePromise = null;\n });\n return this._lifecyclePromise;\n }\n _destroy() {\n return Promise.resolve()\n .then(() => {\n this._stopErrorHandling();\n this._throttledSave.cancel();\n const editor = this._editor;\n this._editor = null;\n // Remove the `change:data` listener before destroying the editor.\n // Incorrectly written plugins may trigger firing `change:data` events during the editor destruction phase\n // causing the watchdog to call `editor.getData()` when some parts of editor are already destroyed.\n editor.model.document.off('change:data', this._throttledSave);\n return this._destructor(editor);\n });\n }\n /**\n * Saves the editor data, so it can be restored after the crash even if the data cannot be fetched at\n * the moment of the crash.\n */\n _save() {\n const version = this._editor.model.document.version;\n try {\n this._data = this._getData();\n if (!this._initUsingData) {\n this._editables = this._getEditables();\n }\n this._lastDocumentVersion = version;\n }\n catch (err) {\n console.error(err, 'An error happened during restoring editor data. ' +\n 'Editor will be restored from the previously saved data.');\n }\n }\n /**\n * @internal\n */\n _setExcludedProperties(props) {\n this._excludedProps = props;\n }\n /**\n * Gets all data that is required to reinitialize editor instance.\n */\n _getData() {\n const editor = this._editor;\n const roots = editor.model.document.roots.filter(root => root.isAttached() && root.rootName != '$graveyard');\n const { plugins } = editor;\n // `as any` to avoid linking from external private repo.\n const commentsRepository = plugins.has('CommentsRepository') && plugins.get('CommentsRepository');\n const trackChanges = plugins.has('TrackChanges') && plugins.get('TrackChanges');\n const data = {\n roots: {},\n markers: {},\n commentThreads: JSON.stringify([]),\n suggestions: JSON.stringify([])\n };\n roots.forEach(root => {\n data.roots[root.rootName] = {\n content: JSON.stringify(Array.from(root.getChildren())),\n attributes: JSON.stringify(Array.from(root.getAttributes())),\n isLoaded: root._isLoaded\n };\n });\n for (const marker of editor.model.markers) {\n if (!marker._affectsData) {\n continue;\n }\n data.markers[marker.name] = {\n rangeJSON: marker.getRange().toJSON(),\n usingOperation: marker._managedUsingOperations,\n affectsData: marker._affectsData\n };\n }\n if (commentsRepository) {\n data.commentThreads = JSON.stringify(commentsRepository.getCommentThreads({ toJSON: true, skipNotAttached: true }));\n }\n if (trackChanges) {\n data.suggestions = JSON.stringify(trackChanges.getSuggestions({ toJSON: true, skipNotAttached: true }));\n }\n return data;\n }\n /**\n * For each attached model root, returns its HTML editable element (if available).\n */\n _getEditables() {\n const editables = {};\n for (const rootName of this.editor.model.document.getRootNames()) {\n const editable = this.editor.ui.getEditableElement(rootName);\n if (editable) {\n editables[rootName] = editable;\n }\n }\n return editables;\n }\n /**\n * Traverses the error context and the current editor to find out whether these structures are connected\n * to each other via properties.\n *\n * @internal\n */\n _isErrorComingFromThisItem(error) {\n return areConnectedThroughProperties(this._editor, error.context, this._excludedProps);\n }\n /**\n * Clones the editor configuration.\n */\n _cloneEditorConfiguration(config) {\n return cloneDeepWith(config, (value, key) => {\n // Leave DOM references.\n if (isElement(value)) {\n return value;\n }\n if (key === 'context') {\n return value;\n }\n });\n }\n}\n/**\n * Internal plugin that is used to stop the default editor initialization and restoring the editor state\n * based on the `editor.config._watchdogInitialData` data.\n */\nclass EditorWatchdogInitPlugin {\n constructor(editor) {\n this.editor = editor;\n this._data = editor.config.get('_watchdogInitialData');\n }\n /**\n * @inheritDoc\n */\n init() {\n // Stops the default editor initialization and use the saved data to restore the editor state.\n // Some of data could not be initialize as a config properties. It is important to keep the data\n // in the same form as it was before the restarting.\n this.editor.data.on('init', evt => {\n evt.stop();\n this.editor.model.enqueueChange({ isUndoable: false }, writer => {\n this._restoreCollaborationData();\n this._restoreEditorData(writer);\n });\n this.editor.data.fire('ready');\n // Keep priority `'high' - 1` to be sure that RTC initialization will be first.\n }, { priority: 1000 - 1 });\n }\n /**\n * Creates a model node (element or text) based on provided JSON.\n */\n _createNode(writer, jsonNode) {\n if ('name' in jsonNode) {\n // If child has name property, it is an Element.\n const element = writer.createElement(jsonNode.name, jsonNode.attributes);\n if (jsonNode.children) {\n for (const child of jsonNode.children) {\n element._appendChild(this._createNode(writer, child));\n }\n }\n return element;\n }\n else {\n // Otherwise, it is a Text node.\n return writer.createText(jsonNode.data, jsonNode.attributes);\n }\n }\n /**\n * Restores the editor by setting the document data, roots attributes and markers.\n */\n _restoreEditorData(writer) {\n const editor = this.editor;\n Object.entries(this._data.roots).forEach(([rootName, { content, attributes }]) => {\n const parsedNodes = JSON.parse(content);\n const parsedAttributes = JSON.parse(attributes);\n const rootElement = editor.model.document.getRoot(rootName);\n for (const [key, value] of parsedAttributes) {\n writer.setAttribute(key, value, rootElement);\n }\n for (const child of parsedNodes) {\n const node = this._createNode(writer, child);\n writer.insert(node, rootElement, 'end');\n }\n });\n Object.entries(this._data.markers).forEach(([markerName, markerOptions]) => {\n const { document } = editor.model;\n const { rangeJSON: { start, end }, ...options } = markerOptions;\n const root = document.getRoot(start.root);\n const startPosition = writer.createPositionFromPath(root, start.path, start.stickiness);\n const endPosition = writer.createPositionFromPath(root, end.path, end.stickiness);\n const range = writer.createRange(startPosition, endPosition);\n writer.addMarker(markerName, {\n range,\n ...options\n });\n });\n }\n /**\n * Restores the editor collaboration data - comment threads and suggestions.\n */\n _restoreCollaborationData() {\n // `as any` to avoid linking from external private repo.\n const parsedCommentThreads = JSON.parse(this._data.commentThreads);\n const parsedSuggestions = JSON.parse(this._data.suggestions);\n parsedCommentThreads.forEach(commentThreadData => {\n const channelId = this.editor.config.get('collaboration.channelId');\n const commentsRepository = this.editor.plugins.get('CommentsRepository');\n if (commentsRepository.hasCommentThread(commentThreadData.threadId)) {\n const commentThread = commentsRepository.getCommentThread(commentThreadData.threadId);\n commentThread.remove();\n }\n commentsRepository.addCommentThread({ channelId, ...commentThreadData });\n });\n parsedSuggestions.forEach(suggestionData => {\n const trackChangesEditing = this.editor.plugins.get('TrackChangesEditing');\n if (trackChangesEditing.hasSuggestion(suggestionData.id)) {\n const suggestion = trackChangesEditing.getSuggestion(suggestionData.id);\n suggestion.attributes = suggestionData.attributes;\n }\n else {\n trackChangesEditing.addSuggestionData(suggestionData);\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport Watchdog from './watchdog.js';\nimport EditorWatchdog from './editorwatchdog.js';\nimport areConnectedThroughProperties from './utils/areconnectedthroughproperties.js';\nimport getSubNodes from './utils/getsubnodes.js';\nconst mainQueueId = Symbol('MainQueueId');\n/**\n * A watchdog for the {@link module:core/context~Context} class.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and\n * how to use it.\n */\nexport default class ContextWatchdog extends Watchdog {\n /**\n * The context watchdog class constructor.\n *\n * ```ts\n * const watchdog = new ContextWatchdog( Context );\n *\n * await watchdog.create( contextConfiguration );\n *\n * await watchdog.add( item );\n * ```\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn more how to use this feature.\n *\n * @param Context The {@link module:core/context~Context} class.\n * @param watchdogConfig The watchdog configuration.\n */\n constructor(Context, watchdogConfig = {}) {\n super(watchdogConfig);\n /**\n * A map of internal watchdogs for added items.\n */\n this._watchdogs = new Map();\n /**\n * The current context instance.\n */\n this._context = null;\n /**\n * Context properties (nodes/references) that are gathered during the initial context creation\n * and are used to distinguish the origin of an error.\n */\n this._contextProps = new Set();\n /**\n * An action queue, which is used to handle async functions queuing.\n */\n this._actionQueues = new ActionQueues();\n this._watchdogConfig = watchdogConfig;\n // Default creator and destructor.\n this._creator = contextConfig => Context.create(contextConfig);\n this._destructor = context => context.destroy();\n this._actionQueues.onEmpty(() => {\n if (this.state === 'initializing') {\n this.state = 'ready';\n this._fire('stateChange');\n }\n });\n }\n /**\n * Sets the function that is responsible for the context creation.\n * It expects a function that should return a promise (or `undefined`).\n *\n * ```ts\n * watchdog.setCreator( config => Context.create( config ) );\n * ```\n */\n setCreator(creator) {\n this._creator = creator;\n }\n /**\n * Sets the function that is responsible for the context destruction.\n * Overrides the default destruction function, which destroys only the context instance.\n * It expects a function that should return a promise (or `undefined`).\n *\n * ```ts\n * watchdog.setDestructor( context => {\n * \t// Do something before the context is destroyed.\n *\n * \treturn context\n * \t\t.destroy()\n * \t\t.then( () => {\n * \t\t\t// Do something after the context is destroyed.\n * \t\t} );\n * } );\n * ```\n */\n setDestructor(destructor) {\n this._destructor = destructor;\n }\n /**\n * The context instance. Keep in mind that this property might be changed when the context watchdog restarts,\n * so do not keep this instance internally. Always operate on the `ContextWatchdog#context` property.\n */\n get context() {\n return this._context;\n }\n /**\n * Initializes the context watchdog. Once it is created, the watchdog takes care about\n * recreating the context and the provided items, and starts the error handling mechanism.\n *\n * ```ts\n * await watchdog.create( {\n * \tplugins: []\n * } );\n * ```\n *\n * @param contextConfig The context configuration. See {@link module:core/context~Context}.\n */\n create(contextConfig = {}) {\n return this._actionQueues.enqueue(mainQueueId, () => {\n this._contextConfig = contextConfig;\n return this._create();\n });\n }\n /**\n * Returns an item instance with the given `itemId`.\n *\n * ```ts\n * const editor1 = watchdog.getItem( 'editor1' );\n * ```\n *\n * @param itemId The item ID.\n * @returns The item instance or `undefined` if an item with a given ID has not been found.\n */\n getItem(itemId) {\n const watchdog = this._getWatchdog(itemId);\n return watchdog._item;\n }\n /**\n * Gets the state of the given item. See {@link #state} for a list of available states.\n *\n * ```ts\n * const editor1State = watchdog.getItemState( 'editor1' );\n * ```\n *\n * @param itemId Item ID.\n * @returns The state of the item.\n */\n getItemState(itemId) {\n const watchdog = this._getWatchdog(itemId);\n return watchdog.state;\n }\n /**\n * Adds items to the watchdog. Once created, instances of these items will be available using the {@link #getItem} method.\n *\n * Items can be passed together as an array of objects:\n *\n * ```ts\n * await watchdog.add( [ {\n * \tid: 'editor1',\n * \ttype: 'editor',\n * \tsourceElementOrData: document.querySelector( '#editor' ),\n * \tconfig: {\n * \t\tplugins: [ Essentials, Paragraph, Bold, Italic ],\n * \t\ttoolbar: [ 'bold', 'italic', 'alignment' ]\n * \t},\n * \tcreator: ( element, config ) => ClassicEditor.create( element, config )\n * } ] );\n * ```\n *\n * Or one by one as objects:\n *\n * ```ts\n * await watchdog.add( {\n * \tid: 'editor1',\n * \ttype: 'editor',\n * \tsourceElementOrData: document.querySelector( '#editor' ),\n * \tconfig: {\n * \t\tplugins: [ Essentials, Paragraph, Bold, Italic ],\n * \t\ttoolbar: [ 'bold', 'italic', 'alignment' ]\n * \t},\n * \tcreator: ( element, config ) => ClassicEditor.create( element, config )\n * ] );\n * ```\n *\n * Then an instance can be retrieved using the {@link #getItem} method:\n *\n * ```ts\n * const editor1 = watchdog.getItem( 'editor1' );\n * ```\n *\n * Note that this method can be called multiple times, but for performance reasons it is better\n * to pass all items together.\n *\n * @param itemConfigurationOrItemConfigurations An item configuration object or an array of item configurations.\n */\n add(itemConfigurationOrItemConfigurations) {\n const itemConfigurations = toArray(itemConfigurationOrItemConfigurations);\n return Promise.all(itemConfigurations.map(item => {\n return this._actionQueues.enqueue(item.id, () => {\n if (this.state === 'destroyed') {\n throw new Error('Cannot add items to destroyed watchdog.');\n }\n if (!this._context) {\n throw new Error('Context was not created yet. You should call the `ContextWatchdog#create()` method first.');\n }\n let watchdog;\n if (this._watchdogs.has(item.id)) {\n throw new Error(`Item with the given id is already added: '${item.id}'.`);\n }\n if (item.type === 'editor') {\n watchdog = new EditorWatchdog(null, this._watchdogConfig);\n watchdog.setCreator(item.creator);\n watchdog._setExcludedProperties(this._contextProps);\n if (item.destructor) {\n watchdog.setDestructor(item.destructor);\n }\n this._watchdogs.set(item.id, watchdog);\n // Enqueue the internal watchdog errors within the main queue.\n // And propagate the internal `error` events as `itemError` event.\n watchdog.on('error', (evt, { error, causesRestart }) => {\n this._fire('itemError', { itemId: item.id, error });\n // Do not enqueue the item restart action if the item will not restart.\n if (!causesRestart) {\n return;\n }\n this._actionQueues.enqueue(item.id, () => new Promise(res => {\n const rethrowRestartEventOnce = () => {\n watchdog.off('restart', rethrowRestartEventOnce);\n this._fire('itemRestart', { itemId: item.id });\n res();\n };\n watchdog.on('restart', rethrowRestartEventOnce);\n }));\n });\n return watchdog.create(item.sourceElementOrData, item.config, this._context);\n }\n else {\n throw new Error(`Not supported item type: '${item.type}'.`);\n }\n });\n }));\n }\n /**\n * Removes and destroys item(s) with given ID(s).\n *\n * ```ts\n * await watchdog.remove( 'editor1' );\n * ```\n *\n * Or\n *\n * ```ts\n * await watchdog.remove( [ 'editor1', 'editor2' ] );\n * ```\n *\n * @param itemIdOrItemIds Item ID or an array of item IDs.\n */\n remove(itemIdOrItemIds) {\n const itemIds = toArray(itemIdOrItemIds);\n return Promise.all(itemIds.map(itemId => {\n return this._actionQueues.enqueue(itemId, () => {\n const watchdog = this._getWatchdog(itemId);\n this._watchdogs.delete(itemId);\n return watchdog.destroy();\n });\n }));\n }\n /**\n * Destroys the context watchdog and all added items.\n * Once the context watchdog is destroyed, new items cannot be added.\n *\n * ```ts\n * await watchdog.destroy();\n * ```\n */\n destroy() {\n return this._actionQueues.enqueue(mainQueueId, () => {\n this.state = 'destroyed';\n this._fire('stateChange');\n super.destroy();\n return this._destroy();\n });\n }\n /**\n * Restarts the context watchdog.\n */\n _restart() {\n return this._actionQueues.enqueue(mainQueueId, () => {\n this.state = 'initializing';\n this._fire('stateChange');\n return this._destroy()\n .catch(err => {\n console.error('An error happened during destroying the context or items.', err);\n })\n .then(() => this._create())\n .then(() => this._fire('restart'));\n });\n }\n /**\n * Initializes the context watchdog.\n */\n _create() {\n return Promise.resolve()\n .then(() => {\n this._startErrorHandling();\n return this._creator(this._contextConfig);\n })\n .then(context => {\n this._context = context;\n this._contextProps = getSubNodes(this._context);\n return Promise.all(Array.from(this._watchdogs.values())\n .map(watchdog => {\n watchdog._setExcludedProperties(this._contextProps);\n return watchdog.create(undefined, undefined, this._context);\n }));\n });\n }\n /**\n * Destroys the context instance and all added items.\n */\n _destroy() {\n return Promise.resolve()\n .then(() => {\n this._stopErrorHandling();\n const context = this._context;\n this._context = null;\n this._contextProps = new Set();\n return Promise.all(Array.from(this._watchdogs.values())\n .map(watchdog => watchdog.destroy()))\n // Context destructor destroys each editor.\n .then(() => this._destructor(context));\n });\n }\n /**\n * Returns the watchdog for a given item ID.\n *\n * @param itemId Item ID.\n */\n _getWatchdog(itemId) {\n const watchdog = this._watchdogs.get(itemId);\n if (!watchdog) {\n throw new Error(`Item with the given id was not registered: ${itemId}.`);\n }\n return watchdog;\n }\n /**\n * Checks whether an error comes from the context instance and not from the item instances.\n *\n * @internal\n */\n _isErrorComingFromThisItem(error) {\n for (const watchdog of this._watchdogs.values()) {\n if (watchdog._isErrorComingFromThisItem(error)) {\n return false;\n }\n }\n return areConnectedThroughProperties(this._context, error.context);\n }\n}\n/**\n * Manager of action queues that allows queuing async functions.\n */\nclass ActionQueues {\n constructor() {\n this._onEmptyCallbacks = [];\n this._queues = new Map();\n this._activeActions = 0;\n }\n /**\n * Used to register callbacks that will be run when the queue becomes empty.\n *\n * @param onEmptyCallback A callback that will be run whenever the queue becomes empty.\n */\n onEmpty(onEmptyCallback) {\n this._onEmptyCallbacks.push(onEmptyCallback);\n }\n /**\n * It adds asynchronous actions (functions) to the proper queue and runs them one by one.\n *\n * @param queueId The action queue ID.\n * @param action A function that should be enqueued.\n */\n enqueue(queueId, action) {\n const isMainAction = queueId === mainQueueId;\n this._activeActions++;\n if (!this._queues.get(queueId)) {\n this._queues.set(queueId, Promise.resolve());\n }\n // List all sources of actions that the current action needs to await for.\n // For the main action wait for all other actions.\n // For the item action wait only for the item queue and the main queue.\n const awaitedActions = isMainAction ?\n Promise.all(this._queues.values()) :\n Promise.all([this._queues.get(mainQueueId), this._queues.get(queueId)]);\n const queueWithAction = awaitedActions.then(action);\n // Catch all errors in the main queue to stack promises even if an error occurred in the past.\n const nonErrorQueue = queueWithAction.catch(() => { });\n this._queues.set(queueId, nonErrorQueue);\n return queueWithAction.finally(() => {\n this._activeActions--;\n if (this._queues.get(queueId) === nonErrorQueue && this._activeActions === 0) {\n this._onEmptyCallbacks.forEach(cb => cb());\n }\n });\n }\n}\n/**\n * Transforms any value to an array. If the provided value is already an array, it is returned unchanged.\n *\n * @param elementOrArray The value to transform to an array.\n * @returns An array created from data.\n */\nfunction toArray(elementOrArray) {\n return Array.isArray(elementOrArray) ? elementOrArray : [elementOrArray];\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/commandcollection\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.\n */\nexport default class CommandCollection {\n /**\n * Creates collection instance.\n */\n constructor() {\n this._commands = new Map();\n }\n /**\n * Registers a new command.\n *\n * @param commandName The name of the command.\n */\n add(commandName, command) {\n this._commands.set(commandName, command);\n }\n /**\n * Retrieves a command from the collection.\n *\n * @param commandName The name of the command.\n */\n get(commandName) {\n return this._commands.get(commandName);\n }\n /**\n * Executes a command.\n *\n * @param commandName The name of the command.\n * @param commandParams Command parameters.\n * @returns The value returned by the {@link module:core/command~Command#execute `command.execute()`}.\n */\n execute(commandName, ...commandParams) {\n const command = this.get(commandName);\n if (!command) {\n /**\n * Command does not exist.\n *\n * @error commandcollection-command-not-found\n * @param commandName Name of the command.\n */\n throw new CKEditorError('commandcollection-command-not-found', this, { commandName });\n }\n return command.execute(...commandParams);\n }\n /**\n * Returns iterator of command names.\n */\n *names() {\n yield* this._commands.keys();\n }\n /**\n * Returns iterator of command instances.\n */\n *commands() {\n yield* this._commands.values();\n }\n /**\n * Iterable interface.\n *\n * Returns `[ commandName, commandInstance ]` pairs.\n */\n [Symbol.iterator]() {\n return this._commands[Symbol.iterator]();\n }\n /**\n * Destroys all collection commands.\n */\n destroy() {\n for (const command of this.commands()) {\n command.destroy();\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editingkeystrokehandler\n */\nimport { KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\n/**\n * A keystroke handler for editor editing. Its instance is available\n * in {@link module:core/editor/editor~Editor#keystrokes} so plugins\n * can register their keystrokes.\n *\n * E.g. an undo plugin would do this:\n *\n * ```ts\n * editor.keystrokes.set( 'Ctrl+Z', 'undo' );\n * editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );\n * editor.keystrokes.set( 'Ctrl+Y', 'redo' );\n * ```\n */\nexport default class EditingKeystrokeHandler extends KeystrokeHandler {\n /**\n * Creates an instance of the keystroke handler.\n */\n constructor(editor) {\n super();\n this.editor = editor;\n }\n /**\n * Registers a handler for the specified keystroke.\n *\n * The handler can be specified as a command name or a callback.\n *\n * @param keystroke Keystroke defined in a format accepted by\n * the {@link module:utils/keyboard~parseKeystroke} function.\n * @param callback If a string is passed, then the keystroke will\n * {@link module:core/editor/editor~Editor#execute execute a command}.\n * If a function, then it will be called with the\n * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and\n * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.\n * @param options Additional options.\n * @param options.priority The priority of the keystroke callback. The higher the priority value\n * the sooner the callback will be executed. Keystrokes having the same priority\n * are called in the order they were added.\n */\n set(keystroke, callback, options = {}) {\n if (typeof callback == 'string') {\n const commandName = callback;\n callback = (evtData, cancel) => {\n this.editor.execute(commandName);\n cancel();\n };\n }\n super.set(keystroke, callback, options);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/accessibility\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\nconst DEFAULT_CATEGORY_ID = 'contentEditing';\nexport const DEFAULT_GROUP_ID = 'common';\n/**\n * A common namespace for various accessibility features of the editor.\n *\n * **Information about editor keystrokes**\n *\n * * The information about keystrokes available in the editor is stored in the {@link #keystrokeInfos} property.\n * * New info entries can be added using the {@link #addKeystrokeInfoCategory}, {@link #addKeystrokeInfoGroup},\n * and {@link #addKeystrokeInfos} methods.\n */\nexport default class Accessibility {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n /**\n * Stores information about keystrokes brought by editor features for the users to interact with the editor, mainly\n * keystroke combinations and their accessible labels.\n *\n * This information is particularly useful for screen reader and other assistive technology users. It gets displayed\n * by the {@link module:ui/editorui/accessibilityhelp/accessibilityhelp~AccessibilityHelp Accessibility help} dialog.\n *\n * Keystrokes are organized in categories and groups. They can be added using ({@link #addKeystrokeInfoCategory},\n * {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfos}) methods.\n *\n * Please note that:\n * * two categories are always available:\n * * `'contentEditing'` for keystrokes related to content creation,\n * * `'navigation'` for keystrokes related to navigation in the UI and the content.\n * * unless specified otherwise, new keystrokes are added into the `'contentEditing'` category and the `'common'`\n * keystroke group within that category while using the {@link #addKeystrokeInfos} method.\n */\n this.keystrokeInfos = new Map();\n this._editor = editor;\n const isMenuBarVisible = editor.config.get('menuBar.isVisible');\n const t = editor.locale.t;\n this.addKeystrokeInfoCategory({\n id: DEFAULT_CATEGORY_ID,\n label: t('Content editing keystrokes'),\n description: t('These keyboard shortcuts allow for quick access to content editing features.')\n });\n const navigationKeystrokes = [\n {\n label: t('Close contextual balloons, dropdowns, and dialogs'),\n keystroke: 'Esc'\n },\n {\n label: t('Open the accessibility help dialog'),\n keystroke: 'Alt+0'\n },\n {\n label: t('Move focus between form fields (inputs, buttons, etc.)'),\n keystroke: [['Tab'], ['Shift+Tab']]\n },\n {\n label: t('Move focus to the toolbar, navigate between toolbars'),\n keystroke: 'Alt+F10',\n mayRequireFn: true\n },\n {\n label: t('Navigate through the toolbar or menu bar'),\n keystroke: [['arrowup'], ['arrowright'], ['arrowdown'], ['arrowleft']]\n },\n {\n // eslint-disable-next-line max-len\n label: t('Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content.'),\n keystroke: [['Enter'], ['Space']]\n }\n ];\n if (isMenuBarVisible) {\n navigationKeystrokes.push({\n label: t('Move focus to the menu bar, navigate between menu bars'),\n keystroke: 'Alt+F9',\n mayRequireFn: true\n });\n }\n this.addKeystrokeInfoCategory({\n id: 'navigation',\n label: t('User interface and content navigation keystrokes'),\n description: t('Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.'),\n groups: [\n {\n id: 'common',\n keystrokes: navigationKeystrokes\n }\n ]\n });\n }\n /**\n * Adds a top-level category in the {@link #keystrokeInfos keystroke information database} with a label and optional description.\n *\n * Categories organize keystrokes and help users to find the right keystroke. Each category can have multiple groups\n * of keystrokes that narrow down the context in which the keystrokes are available. Every keystroke category comes\n * with a `'common'` group by default.\n *\n * By default, two categories are available:\n * * `'contentEditing'` for keystrokes related to content creation,\n * * `'navigation'` for keystrokes related to navigation in the UI and the content.\n *\n * To create a new keystroke category with new groups, use the following code:\n *\n * ```js\n * class MyPlugin extends Plugin {\n * \t// ...\n * \tinit() {\n * \t\tconst editor = this.editor;\n * \t\tconst t = editor.t;\n *\n * \t\t// ...\n *\n * \t\teditor.accessibility.addKeystrokeInfoCategory( {\n * \t\t\tid: 'myCategory',\n * \t\t\tlabel: t( 'My category' ),\n * \t\t\tdescription: t( 'My category description.' ),\n * \t\t\tgroups: [\n * \t\t\t\t{\n * \t\t\t\t\tid: 'myGroup',\n * \t\t\t\t\tlabel: t( 'My keystroke group' ),\n * \t\t\t\t\tkeystrokes: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tlabel: t( 'Keystroke label 1' ),\n * \t\t\t\t\t\t\tkeystroke: 'Ctrl+Shift+N'\n * \t\t\t\t\t\t},\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tlabel: t( 'Keystroke label 2' ),\n * \t\t\t\t\t\t\tkeystroke: 'Ctrl+Shift+M'\n * \t\t\t\t\t\t}\n * \t\t\t\t\t]\n * \t\t\t\t}\n * \t\t\t]\n * \t\t};\n * \t}\n * }\n * ```\n *\n * See {@link #keystrokeInfos}, {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfos}.\n */\n addKeystrokeInfoCategory({ id, label, description, groups }) {\n this.keystrokeInfos.set(id, {\n id,\n label,\n description,\n groups: new Map()\n });\n this.addKeystrokeInfoGroup({\n categoryId: id,\n id: DEFAULT_GROUP_ID\n });\n if (groups) {\n groups.forEach(group => {\n this.addKeystrokeInfoGroup({\n categoryId: id,\n ...group\n });\n });\n }\n }\n /**\n * Adds a group of keystrokes in a specific category to the {@link #keystrokeInfos keystroke information database}.\n *\n * Groups narrow down the context in which the keystrokes are available. When `categoryId` is not specified,\n * the group goes to the `'contentEditing'` category (default).\n *\n * To create a new group within an existing category, use the following code:\n *\n * ```js\n * class MyPlugin extends Plugin {\n * \t// ...\n * \tinit() {\n * \t\tconst editor = this.editor;\n * \t\tconst t = editor.t;\n *\n * \t\t// ...\n *\n * \t\teditor.accessibility.addKeystrokeInfoGroup( {\n * \t\t\tid: 'myGroup',\n * \t\t\tcategoryId: 'navigation',\n * \t\t\tlabel: t( 'My keystroke group' ),\n * \t\t\tkeystrokes: [\n * \t\t\t\t{\n * \t\t\t\t\tlabel: t( 'Keystroke label 1' ),\n * \t\t\t\t\tkeystroke: 'Ctrl+Shift+N'\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tlabel: t( 'Keystroke label 2' ),\n * \t\t\t\t\tkeystroke: 'Ctrl+Shift+M'\n * \t\t\t\t}\n * \t\t\t]\n * \t\t} );\n * \t}\n * }\n * ```\n *\n * See {@link #keystrokeInfos}, {@link #addKeystrokeInfoCategory}, and {@link #addKeystrokeInfos}.\n */\n addKeystrokeInfoGroup({ categoryId = DEFAULT_CATEGORY_ID, id, label, keystrokes }) {\n const category = this.keystrokeInfos.get(categoryId);\n if (!category) {\n throw new CKEditorError('accessibility-unknown-keystroke-info-category', this._editor, { groupId: id, categoryId });\n }\n category.groups.set(id, {\n id,\n label,\n keystrokes: keystrokes || []\n });\n }\n /**\n * Adds information about keystrokes to the {@link #keystrokeInfos keystroke information database}.\n *\n * Keystrokes without specified `groupId` or `categoryId` go to the `'common'` group in the `'contentEditing'` category (default).\n *\n * To add a keystroke brought by your plugin (using default group and category), use the following code:\n *\n * ```js\n * class MyPlugin extends Plugin {\n * \t// ...\n * \tinit() {\n * \t\tconst editor = this.editor;\n * \t\tconst t = editor.t;\n *\n * \t\t// ...\n *\n * \t\teditor.accessibility.addKeystrokeInfos( {\n * \t\t\tkeystrokes: [\n * \t\t\t\t{\n * \t\t\t\t\tlabel: t( 'Keystroke label' ),\n * \t\t\t\t\tkeystroke: 'CTRL+B'\n * \t\t\t\t}\n * \t\t\t]\n * \t\t} );\n * \t}\n * }\n * ```\n * To add a keystroke in a specific existing `'widget'` group in the default `'contentEditing'` category:\n *\n * ```js\n * class MyPlugin extends Plugin {\n * \t// ...\n * \tinit() {\n * \t\tconst editor = this.editor;\n * \t\tconst t = editor.t;\n *\n * \t\t// ...\n *\n * \t\teditor.accessibility.addKeystrokeInfos( {\n * \t\t\t// Add a keystroke to the existing \"widget\" group.\n * \t\t\tgroupId: 'widget',\n * \t\t\tkeystrokes: [\n * \t\t\t\t{\n * \t\t\t\t\tlabel: t( 'A an action on a selected widget' ),\n * \t\t\t\t\tkeystroke: 'Ctrl+D',\n * \t\t\t\t}\n * \t\t\t]\n * \t\t} );\n * \t}\n * }\n * ```\n *\n * To add a keystroke to another existing category (using default group):\n *\n * ```js\n * class MyPlugin extends Plugin {\n * \t// ...\n * \tinit() {\n * \t\tconst editor = this.editor;\n * \t\tconst t = editor.t;\n *\n * \t\t// ...\n *\n * \t\teditor.accessibility.addKeystrokeInfos( {\n * \t\t\t// Add keystrokes to the \"navigation\" category (one of defaults).\n * \t\t\tcategoryId: 'navigation',\n * \t\t\tkeystrokes: [\n * \t\t\t\t{\n * \t\t\t\t\tlabel: t( 'Keystroke label' ),\n * \t\t\t\t\tkeystroke: 'CTRL+B'\n * \t\t\t\t}\n * \t\t\t]\n * \t\t} );\n * \t}\n * }\n * ```\n *\n * See {@link #keystrokeInfos}, {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfoCategory}.\n */\n addKeystrokeInfos({ categoryId = DEFAULT_CATEGORY_ID, groupId = DEFAULT_GROUP_ID, keystrokes }) {\n if (!this.keystrokeInfos.has(categoryId)) {\n /**\n * Cannot add keystrokes in an unknown category. Use\n * {@link module:core/accessibility~Accessibility#addKeystrokeInfoCategory}\n * to add a new category or make sure the specified category exists.\n *\n * @error accessibility-unknown-keystroke-info-category\n * @param categoryId The id of the unknown keystroke category.\n * @param keystrokes Keystroke definitions about to be added.\n */\n throw new CKEditorError('accessibility-unknown-keystroke-info-category', this._editor, { categoryId, keystrokes });\n }\n const category = this.keystrokeInfos.get(categoryId);\n if (!category.groups.has(groupId)) {\n /**\n * Cannot add keystrokes to an unknown group.\n *\n * Use {@link module:core/accessibility~Accessibility#addKeystrokeInfoGroup}\n * to add a new group or make sure the specified group exists.\n *\n * @error accessibility-unknown-keystroke-info-group\n * @param groupId The id of the unknown keystroke group.\n * @param categoryId The id of category the unknown group should belong to.\n * @param keystrokes Keystroke definitions about to be added.\n */\n throw new CKEditorError('accessibility-unknown-keystroke-info-group', this._editor, { groupId, categoryId, keystrokes });\n }\n category.groups.get(groupId).keystrokes.push(...keystrokes);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editor/editor\n */\nimport { Config, CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';\nimport { Conversion, DataController, EditingController, Model, StylesProcessor } from '@ckeditor/ckeditor5-engine';\nimport { ContextWatchdog, EditorWatchdog } from '@ckeditor/ckeditor5-watchdog';\nimport Context from '../context.js';\nimport PluginCollection from '../plugincollection.js';\nimport CommandCollection from '../commandcollection.js';\nimport EditingKeystrokeHandler from '../editingkeystrokehandler.js';\nimport Accessibility from '../accessibility.js';\n/**\n * The class representing a basic, generic editor.\n *\n * Check out the list of its subclasses to learn about specific editor implementations.\n *\n * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or\n * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their\n * own methods and properties.\n *\n * When you are implementing a plugin, this editor represents the API\n * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.\n *\n * This API should be sufficient in order to implement the \"editing\" part of your feature\n * (schema definition, conversion, commands, keystrokes, etc.).\n * It does not define the editor UI, which is available only if\n * the specific editor implements also the {@link ~Editor#ui} property\n * (as most editor implementations do).\n */\nclass Editor extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a new instance of the editor class.\n *\n * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.\n *\n * @param config The editor configuration.\n */\n constructor(config = {}) {\n super();\n const constructor = this.constructor;\n // We don't pass translations to the config, because its behavior of splitting keys\n // with dots (e.g. `resize.width` => `resize: { width }`) breaks the translations.\n const { translations: defaultTranslations, ...defaultConfig } = constructor.defaultConfig || {};\n const { translations = defaultTranslations, ...rest } = config;\n // Prefer the language passed as the argument to the constructor instead of the constructor's `defaultConfig`, if both are set.\n const language = config.language || defaultConfig.language;\n this._context = config.context || new Context({ language, translations });\n this._context._addEditor(this, !config.context);\n // Clone the plugins to make sure that the plugin array will not be shared\n // between editors and make the watchdog feature work correctly.\n const availablePlugins = Array.from(constructor.builtinPlugins || []);\n this.config = new Config(rest, defaultConfig);\n this.config.define('plugins', availablePlugins);\n this.config.define(this._context._getEditorConfig());\n this.plugins = new PluginCollection(this, availablePlugins, this._context.plugins);\n this.locale = this._context.locale;\n this.t = this.locale.t;\n this._readOnlyLocks = new Set();\n this.commands = new CommandCollection();\n this.set('state', 'initializing');\n this.once('ready', () => (this.state = 'ready'), { priority: 'high' });\n this.once('destroy', () => (this.state = 'destroyed'), { priority: 'high' });\n this.model = new Model();\n this.on('change:isReadOnly', () => {\n this.model.document.isReadOnly = this.isReadOnly;\n });\n const stylesProcessor = new StylesProcessor();\n this.data = new DataController(this.model, stylesProcessor);\n this.editing = new EditingController(this.model, stylesProcessor);\n this.editing.view.document.bind('isReadOnly').to(this);\n this.conversion = new Conversion([this.editing.downcastDispatcher, this.data.downcastDispatcher], this.data.upcastDispatcher);\n this.conversion.addAlias('dataDowncast', this.data.downcastDispatcher);\n this.conversion.addAlias('editingDowncast', this.editing.downcastDispatcher);\n this.keystrokes = new EditingKeystrokeHandler(this);\n this.keystrokes.listenTo(this.editing.view.document);\n this.accessibility = new Accessibility(this);\n }\n /**\n * Defines whether the editor is in the read-only mode.\n *\n * In read-only mode the editor {@link #commands commands} are disabled so it is not possible\n * to modify the document by using them. Also, the editable element(s) become non-editable.\n *\n * In order to make the editor read-only, you need to call the {@link #enableReadOnlyMode} method:\n *\n * ```ts\n * editor.enableReadOnlyMode( 'feature-id' );\n * ```\n *\n * Later, to turn off the read-only mode, call {@link #disableReadOnlyMode}:\n *\n * ```ts\n * editor.disableReadOnlyMode( 'feature-id' );\n * ```\n *\n * @readonly\n * @observable\n */\n get isReadOnly() {\n return this._readOnlyLocks.size > 0;\n }\n set isReadOnly(value) {\n /**\n * The {@link module:core/editor/editor~Editor#isReadOnly Editor#isReadOnly} property is read-only since version `34.0.0`\n * and can be set only using {@link module:core/editor/editor~Editor#enableReadOnlyMode `Editor#enableReadOnlyMode( lockId )`} and\n * {@link module:core/editor/editor~Editor#disableReadOnlyMode `Editor#disableReadOnlyMode( lockId )`}.\n *\n * Usage before version `34.0.0`:\n *\n * ```ts\n * editor.isReadOnly = true;\n * editor.isReadOnly = false;\n * ```\n *\n * Usage since version `34.0.0`:\n *\n * ```ts\n * editor.enableReadOnlyMode( 'my-feature-id' );\n * editor.disableReadOnlyMode( 'my-feature-id' );\n * ```\n *\n * @error editor-isreadonly-has-no-setter\n */\n throw new CKEditorError('editor-isreadonly-has-no-setter');\n }\n /**\n * Turns on the read-only mode in the editor.\n *\n * Editor can be switched to or out of the read-only mode by many features, under various circumstances. The editor supports locking\n * mechanism for the read-only mode. It enables easy control over the read-only mode when many features wants to turn it on or off at\n * the same time, without conflicting with each other. It guarantees that you will not make the editor editable accidentally (which\n * could lead to errors).\n *\n * Each read-only mode request is identified by a unique id (also called \"lock\"). If multiple plugins requested to turn on the\n * read-only mode, then, the editor will become editable only after all these plugins turn the read-only mode off (using the same ids).\n *\n * Note, that you cannot force the editor to disable the read-only mode if other plugins set it.\n *\n * After the first `enableReadOnlyMode()` call, the {@link #isReadOnly `isReadOnly` property} will be set to `true`:\n *\n * ```ts\n * editor.isReadOnly; // `false`.\n * editor.enableReadOnlyMode( 'my-feature-id' );\n * editor.isReadOnly; // `true`.\n * ```\n *\n * You can turn off the read-only mode (\"clear the lock\") using the {@link #disableReadOnlyMode `disableReadOnlyMode()`} method:\n *\n * ```ts\n * editor.enableReadOnlyMode( 'my-feature-id' );\n * // ...\n * editor.disableReadOnlyMode( 'my-feature-id' );\n * editor.isReadOnly; // `false`.\n * ```\n *\n * All \"locks\" need to be removed to enable editing:\n *\n * ```ts\n * editor.enableReadOnlyMode( 'my-feature-id' );\n * editor.enableReadOnlyMode( 'my-other-feature-id' );\n * // ...\n * editor.disableReadOnlyMode( 'my-feature-id' );\n * editor.isReadOnly; // `true`.\n * editor.disableReadOnlyMode( 'my-other-feature-id' );\n * editor.isReadOnly; // `false`.\n * ```\n *\n * @param lockId A unique ID for setting the editor to the read-only state.\n */\n enableReadOnlyMode(lockId) {\n if (typeof lockId !== 'string' && typeof lockId !== 'symbol') {\n /**\n * The lock ID is missing or it is not a string or symbol.\n *\n * @error editor-read-only-lock-id-invalid\n */\n throw new CKEditorError('editor-read-only-lock-id-invalid', null, { lockId });\n }\n if (this._readOnlyLocks.has(lockId)) {\n return;\n }\n this._readOnlyLocks.add(lockId);\n if (this._readOnlyLocks.size === 1) {\n // Manually fire the `change:isReadOnly` event as only getter is provided.\n this.fire('change:isReadOnly', 'isReadOnly', true, false);\n }\n }\n /**\n * Removes the read-only lock from the editor with given lock ID.\n *\n * When no lock is present on the editor anymore, then the {@link #isReadOnly `isReadOnly` property} will be set to `false`.\n *\n * @param lockId The lock ID for setting the editor to the read-only state.\n */\n disableReadOnlyMode(lockId) {\n if (typeof lockId !== 'string' && typeof lockId !== 'symbol') {\n throw new CKEditorError('editor-read-only-lock-id-invalid', null, { lockId });\n }\n if (!this._readOnlyLocks.has(lockId)) {\n return;\n }\n this._readOnlyLocks.delete(lockId);\n if (this._readOnlyLocks.size === 0) {\n // Manually fire the `change:isReadOnly` event as only getter is provided.\n this.fire('change:isReadOnly', 'isReadOnly', false, true);\n }\n }\n /**\n * Sets the data in the editor.\n *\n * ```ts\n * editor.setData( '<p>This is editor!</p>' );\n * ```\n *\n * If your editor implementation uses multiple roots, you should pass an object with keys corresponding\n * to the editor root names and values equal to the data that should be set in each root:\n *\n * ```ts\n * editor.setData( {\n * header: '<p>Content for header part.</p>',\n * content: '<p>Content for main part.</p>',\n * footer: '<p>Content for footer part.</p>'\n * } );\n * ```\n *\n * By default the editor accepts HTML. This can be controlled by injecting a different data processor.\n * See the {@glink features/markdown Markdown output} guide for more details.\n *\n * @param data Input data.\n */\n setData(data) {\n this.data.set(data);\n }\n /**\n * Gets the data from the editor.\n *\n * ```ts\n * editor.getData(); // -> '<p>This is editor!</p>'\n * ```\n *\n * If your editor implementation uses multiple roots, you should pass root name as one of the options:\n *\n * ```ts\n * editor.getData( { rootName: 'header' } ); // -> '<p>Content for header part.</p>'\n * ```\n *\n * By default, the editor outputs HTML. This can be controlled by injecting a different data processor.\n * See the {@glink features/markdown Markdown output} guide for more details.\n *\n * A warning is logged when you try to retrieve data for a detached root, as most probably this is a mistake. A detached root should\n * be treated like it is removed, and you should not save its data. Note, that the detached root data is always an empty string.\n *\n * @param options Additional configuration for the retrieved data.\n * Editor features may introduce more configuration options that can be set through this parameter.\n * @param options.rootName Root name. Defaults to `'main'`.\n * @param options.trim Whether returned data should be trimmed. This option is set to `'empty'` by default,\n * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming\n * use `'none'`. In such cases exact content will be returned (for example `'<p> </p>'` for an empty editor).\n * @returns Output data.\n */\n getData(options) {\n return this.data.get(options);\n }\n /**\n * Loads and initializes plugins specified in the configuration.\n *\n * @returns A promise which resolves once the initialization is completed, providing an array of loaded plugins.\n */\n initPlugins() {\n const config = this.config;\n const plugins = config.get('plugins');\n const removePlugins = config.get('removePlugins') || [];\n const extraPlugins = config.get('extraPlugins') || [];\n const substitutePlugins = config.get('substitutePlugins') || [];\n return this.plugins.init(plugins.concat(extraPlugins), removePlugins, substitutePlugins);\n }\n /**\n * Destroys the editor instance, releasing all resources used by it.\n *\n * **Note** The editor cannot be destroyed during the initialization phase so if it is called\n * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.\n *\n * @fires destroy\n * @returns A promise that resolves once the editor instance is fully destroyed.\n */\n destroy() {\n let readyPromise = Promise.resolve();\n if (this.state == 'initializing') {\n readyPromise = new Promise(resolve => this.once('ready', resolve));\n }\n return readyPromise\n .then(() => {\n this.fire('destroy');\n this.stopListening();\n this.commands.destroy();\n })\n .then(() => this.plugins.destroy())\n .then(() => {\n this.model.destroy();\n this.data.destroy();\n this.editing.destroy();\n this.keystrokes.destroy();\n })\n // Remove the editor from the context.\n // When the context was created by this editor, the context will be destroyed.\n .then(() => this._context._removeEditor(this));\n }\n /**\n * Executes the specified command with given parameters.\n *\n * Shorthand for:\n *\n * ```ts\n * editor.commands.get( commandName ).execute( ... );\n * ```\n *\n * @param commandName The name of the command to execute.\n * @param commandParams Command parameters.\n * @returns The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.\n */\n execute(commandName, ...commandParams) {\n try {\n return this.commands.execute(commandName, ...commandParams);\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n /**\n * Focuses the editor.\n *\n * **Note** To explicitly focus the editing area of the editor, use the\n * {@link module:engine/view/view~View#focus `editor.editing.view.focus()`} method of the editing view.\n *\n * Check out the {@glink framework/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section\n * of the {@glink framework/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.\n */\n focus() {\n this.editing.view.focus();\n }\n /* istanbul ignore next -- @preserve */\n /**\n * Creates and initializes a new editor instance.\n *\n * This is an abstract method. Every editor type needs to implement its own initialization logic.\n *\n * See the `create()` methods of the existing editor types to learn how to use them:\n *\n * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}\n * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}\n * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}\n * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}\n */\n static create(...args) {\n throw new Error('This is an abstract method.');\n }\n}\n/**\n * The {@link module:core/context~Context} class.\n *\n * Exposed as static editor field for easier access in editor builds.\n */\nEditor.Context = Context;\n/**\n * The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.\n *\n * Exposed as static editor field for easier access in editor builds.\n */\nEditor.EditorWatchdog = EditorWatchdog;\n/**\n * The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.\n *\n * Exposed as static editor field for easier access in editor builds.\n */\nEditor.ContextWatchdog = ContextWatchdog;\nexport default Editor;\n/**\n * This error is thrown when trying to pass a `<textarea>` element to a `create()` function of an editor class.\n *\n * The only editor type which can be initialized on `<textarea>` elements is\n * the {@glink getting-started/setup/editor-types#classic-editor classic editor}.\n * This editor hides the passed element and inserts its own UI next to it. Other types of editors reuse the passed element as their root\n * editable element and therefore `<textarea>` is not appropriate for them. Use a `<div>` or another text container instead:\n *\n * ```html\n * <div id=\"editor\">\n * \t<p>Initial content.</p>\n * </div>\n * ```\n *\n * @error editor-wrong-element\n */\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editor/utils/elementapimixin\n */\nimport { CKEditorError, setDataInElement } from '@ckeditor/ckeditor5-utils';\n/**\n * Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.\n */\nexport default function ElementApiMixin(base) {\n class Mixin extends base {\n updateSourceElement(data) {\n if (!this.sourceElement) {\n /**\n * Cannot update the source element of a detached editor.\n *\n * The {@link module:core/editor/utils/elementapimixin~ElementApi#updateSourceElement `updateSourceElement()`}\n * method cannot be called if you did not pass an element to `Editor.create()`.\n *\n * @error editor-missing-sourceelement\n */\n throw new CKEditorError('editor-missing-sourceelement', this);\n }\n const shouldUpdateSourceElement = this.config.get('updateSourceElementOnDestroy');\n const isSourceElementTextArea = this.sourceElement instanceof HTMLTextAreaElement;\n // The data returned by the editor might be unsafe, so we want to prevent rendering\n // unsafe content inside the source element different than <textarea>, which is considered\n // secure. This behavior could be changed by setting the `updateSourceElementOnDestroy`\n // configuration option to `true`.\n if (!shouldUpdateSourceElement && !isSourceElementTextArea) {\n setDataInElement(this.sourceElement, '');\n return;\n }\n const dataToSet = typeof data === 'string' ? data : this.data.get();\n setDataInElement(this.sourceElement, dataToSet);\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`.\nElementApiMixin.updateSourceElement = ElementApiMixin(Object).prototype.updateSourceElement;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/pendingactions\n */\nimport ContextPlugin from './contextplugin.js';\nimport { CKEditorError, Collection, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The list of pending editor actions.\n *\n * This plugin should be used to synchronise plugins that execute long-lasting actions\n * (e.g. file upload) with the editor integration. It gives the developer who integrates the editor\n * an easy way to check if there are any actions pending whenever such information is needed.\n * All plugins that register a pending action also provide a message about the action that is ongoing\n * which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.\n *\n * Adding and updating a pending action:\n *\n * ```ts\n * const pendingActions = editor.plugins.get( 'PendingActions' );\n * const action = pendingActions.add( 'Upload in progress: 0%.' );\n *\n * // You can update the message:\n * action.message = 'Upload in progress: 10%.';\n * ```\n *\n * Removing a pending action:\n *\n * ```ts\n * const pendingActions = editor.plugins.get( 'PendingActions' );\n * const action = pendingActions.add( 'Unsaved changes.' );\n *\n * pendingActions.remove( action );\n * ```\n *\n * Getting pending actions:\n *\n * ```ts\n * const pendingActions = editor.plugins.get( 'PendingActions' );\n *\n * const action1 = pendingActions.add( 'Action 1' );\n * const action2 = pendingActions.add( 'Action 2' );\n *\n * pendingActions.first; // Returns action1\n * Array.from( pendingActions ); // Returns [ action1, action2 ]\n * ```\n *\n * This plugin is used by features like {@link module:upload/filerepository~FileRepository} to register their ongoing actions\n * and by features like {@link module:autosave/autosave~Autosave} to detect whether there are any ongoing actions.\n * Read more about saving the data in the\n * {@glink getting-started/setup/getting-and-setting-data Saving and getting data} guide.\n */\nexport default class PendingActions extends ContextPlugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PendingActions';\n }\n /**\n * @inheritDoc\n */\n init() {\n this.set('hasAny', false);\n this._actions = new Collection({ idProperty: '_id' });\n this._actions.delegate('add', 'remove').to(this);\n }\n /**\n * Adds an action to the list of pending actions.\n *\n * This method returns an action object with an observable message property.\n * The action object can be later used in the {@link #remove} method. It also allows you to change the message.\n *\n * @param message The action message.\n * @returns An observable object that represents a pending action.\n */\n add(message) {\n if (typeof message !== 'string') {\n /**\n * The message must be a string.\n *\n * @error pendingactions-add-invalid-message\n */\n throw new CKEditorError('pendingactions-add-invalid-message', this);\n }\n const action = new (ObservableMixin())();\n action.set('message', message);\n this._actions.add(action);\n this.hasAny = true;\n return action;\n }\n /**\n * Removes an action from the list of pending actions.\n *\n * @param action An action object.\n */\n remove(action) {\n this._actions.remove(action);\n this.hasAny = !!this._actions.length;\n }\n /**\n * Returns the first action from the list or null if the list is empty\n *\n * @returns The pending action object.\n */\n get first() {\n return this._actions.get(0);\n }\n /**\n * Iterable interface.\n */\n [Symbol.iterator]() {\n return this._actions[Symbol.iterator]();\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core\n */\nexport { default as Plugin } from './plugin.js';\nexport { default as Command } from './command.js';\nexport { default as MultiCommand } from './multicommand.js';\nexport { default as Context } from './context.js';\nexport { default as ContextPlugin } from './contextplugin.js';\nexport { default as Editor } from './editor/editor.js';\nexport { default as attachToForm } from './editor/utils/attachtoform.js';\nexport { default as DataApiMixin } from './editor/utils/dataapimixin.js';\nexport { default as ElementApiMixin } from './editor/utils/elementapimixin.js';\nexport { default as secureSourceElement } from './editor/utils/securesourceelement.js';\nexport { default as PendingActions } from './pendingactions.js';\nimport cancel from './../theme/icons/cancel.svg';\nimport caption from './../theme/icons/caption.svg';\nimport check from './../theme/icons/check.svg';\nimport cog from './../theme/icons/cog.svg';\nimport colorPalette from './../theme/icons/color-palette.svg';\nimport eraser from './../theme/icons/eraser.svg';\nimport history from './../theme/icons/history.svg';\nimport lowVision from './../theme/icons/low-vision.svg';\nimport textAlternative from './../theme/icons/text-alternative.svg';\nimport loupe from './../theme/icons/loupe.svg';\nimport previousArrow from './../theme/icons/previous-arrow.svg';\nimport nextArrow from './../theme/icons/next-arrow.svg';\nimport image from './../theme/icons/image.svg';\nimport imageUpload from './../theme/icons/image-upload.svg';\nimport imageAssetManager from './../theme/icons/image-asset-manager.svg';\nimport imageUrl from './../theme/icons/image-url.svg';\nimport alignBottom from './../theme/icons/align-bottom.svg';\nimport alignMiddle from './../theme/icons/align-middle.svg';\nimport alignTop from './../theme/icons/align-top.svg';\nimport alignLeft from './../theme/icons/align-left.svg';\nimport alignCenter from './../theme/icons/align-center.svg';\nimport alignRight from './../theme/icons/align-right.svg';\nimport alignJustify from './../theme/icons/align-justify.svg';\nimport objectBlockLeft from './../theme/icons/object-left.svg';\nimport objectCenter from './../theme/icons/object-center.svg';\nimport objectBlockRight from './../theme/icons/object-right.svg';\nimport objectFullWidth from './../theme/icons/object-full-width.svg';\nimport objectInline from './../theme/icons/object-inline.svg';\nimport objectLeft from './../theme/icons/object-inline-left.svg';\nimport objectRight from './../theme/icons/object-inline-right.svg';\nimport objectSizeFull from './../theme/icons/object-size-full.svg';\nimport objectSizeCustom from './../theme/icons/object-size-custom.svg';\nimport objectSizeLarge from './../theme/icons/object-size-large.svg';\nimport objectSizeSmall from './../theme/icons/object-size-small.svg';\nimport objectSizeMedium from './../theme/icons/object-size-medium.svg';\nimport pencil from './../theme/icons/pencil.svg';\nimport pilcrow from './../theme/icons/pilcrow.svg';\nimport quote from './../theme/icons/quote.svg';\nimport threeVerticalDots from './../theme/icons/three-vertical-dots.svg';\nimport dragIndicator from './../theme/icons/drag-indicator.svg';\nimport bold from './../theme/icons/bold.svg';\nimport paragraph from './../theme/icons/paragraph.svg';\nimport plus from './../theme/icons/plus.svg';\nimport text from './../theme/icons/text.svg';\nimport importExport from './../theme/icons/importexport.svg';\nimport redo from './../theme/icons/redo.svg';\nimport undo from './../theme/icons/undo.svg';\nimport bulletedList from './../theme/icons/bulletedlist.svg';\nimport numberedList from './../theme/icons/numberedlist.svg';\nimport todoList from './../theme/icons/todolist.svg';\nimport codeBlock from './../theme/icons/codeblock.svg';\nimport browseFiles from './../theme/icons/browse-files.svg';\nimport heading1 from './../theme/icons/heading1.svg';\nimport heading2 from './../theme/icons/heading2.svg';\nimport heading3 from './../theme/icons/heading3.svg';\nimport heading4 from './../theme/icons/heading4.svg';\nimport heading5 from './../theme/icons/heading5.svg';\nimport heading6 from './../theme/icons/heading6.svg';\nimport horizontalLine from './../theme/icons/horizontalline.svg';\nimport html from './../theme/icons/html.svg';\nimport indent from './../theme/icons/indent.svg';\nimport outdent from './../theme/icons/outdent.svg';\nimport table from './../theme/icons/table.svg';\nexport const icons = {\n bold,\n cancel,\n caption,\n check,\n cog,\n colorPalette,\n eraser,\n history,\n image,\n imageUpload,\n imageAssetManager,\n imageUrl,\n lowVision,\n textAlternative,\n loupe,\n previousArrow,\n nextArrow,\n importExport,\n paragraph,\n plus,\n text,\n alignBottom,\n alignMiddle,\n alignTop,\n alignLeft,\n alignCenter,\n alignRight,\n alignJustify,\n objectLeft,\n objectCenter,\n objectRight,\n objectFullWidth,\n objectInline,\n objectBlockLeft,\n objectBlockRight,\n objectSizeCustom,\n objectSizeFull,\n objectSizeLarge,\n objectSizeSmall,\n objectSizeMedium,\n pencil,\n pilcrow,\n quote,\n threeVerticalDots,\n dragIndicator,\n redo,\n undo,\n bulletedList,\n numberedList,\n todoList,\n codeBlock,\n browseFiles,\n heading1,\n heading2,\n heading3,\n heading4,\n heading5,\n heading6,\n horizontalLine,\n html,\n indent,\n outdent,\n table\n};\nimport './augmentation.js';\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z\\\"/><path d=\\\"M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z\\\" fill-opacity=\\\".6\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10.209 18.717A8.5 8.5 0 1 1 18.686 9.6h-.008l.002.12a3 3 0 0 1-2.866 2.997h-.268l-.046-.002v.002h-4.791a2 2 0 1 0 0 4 1 1 0 1 1-.128 1.992 8.665 8.665 0 0 1-.372.008Zm-3.918-7.01a1.25 1.25 0 1 0-2.415-.648 1.25 1.25 0 0 0 2.415.647ZM5.723 8.18a1.25 1.25 0 1 0 .647-2.414 1.25 1.25 0 0 0-.647 2.414ZM9.76 6.155a1.25 1.25 0 1 0 .647-2.415 1.25 1.25 0 0 0-.647 2.415Zm4.028 1.759a1.25 1.25 0 1 0 .647-2.415 1.25 1.25 0 0 0-.647 2.415Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z\\\"/><path d=\\\"M4 18h5.523v-1H4zm-2 0h1v-1H2z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M6.66 9.118a.693.693 0 0 1 .956.032l3.65 3.411 2.422-2.238a.695.695 0 0 1 .945 0L17.5 13.6V2.5h-15v11.1l4.16-4.482ZM17.8 1c.652 0 1.2.47 1.2 1.1v14.362c0 .64-.532 1.038-1.184 1.038H2.184C1.532 17.5 1 17.103 1 16.462V2.1C1 1.47 1.537 1 2.2 1h15.6Zm-5.655 6a2.128 2.128 0 0 1 .157-2.364A2.133 2.133 0 1 1 12.145 7Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M1.201 1C.538 1 0 1.47 0 2.1v14.363c0 .64.534 1.037 1.186 1.037h9.494a2.97 2.97 0 0 1-.414-.287 2.998 2.998 0 0 1-1.055-2.03 3.003 3.003 0 0 1 .693-2.185l.383-.455-.02.018-3.65-3.41a.695.695 0 0 0-.957-.034L1.5 13.6V2.5h15v5.535a2.97 2.97 0 0 1 1.412.932l.088.105V2.1c0-.63-.547-1.1-1.2-1.1H1.202Zm11.713 2.803a2.146 2.146 0 0 0-2.049 1.992 2.14 2.14 0 0 0 1.28 2.096 2.13 2.13 0 0 0 2.644-3.11 2.134 2.134 0 0 0-1.875-.978Z\\\"/><path d=\\\"M15.522 19.1a.79.79 0 0 0 .79-.79v-5.373l2.059 2.455a.79.79 0 1 0 1.211-1.015l-3.352-3.995a.79.79 0 0 0-.995-.179.784.784 0 0 0-.299.221l-3.35 3.99a.79.79 0 1 0 1.21 1.017l1.936-2.306v5.185c0 .436.353.79.79.79Z\\\"/><path d=\\\"M15.522 19.1a.79.79 0 0 0 .79-.79v-5.373l2.059 2.455a.79.79 0 1 0 1.211-1.015l-3.352-3.995a.79.79 0 0 0-.995-.179.784.784 0 0 0-.299.221l-3.35 3.99a.79.79 0 1 0 1.21 1.017l1.936-2.306v5.185c0 .436.353.79.79.79Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M3.035 1C2.446 1 2 1.54 2 2.098V10.5h1.5v-8h13v8H18V2.098C18 1.539 17.48 1 16.9 1H3.035Zm10.453 2.61a1.885 1.885 0 0 0-1.442.736 1.89 1.89 0 0 0 1.011 2.976 1.903 1.903 0 0 0 2.253-1.114 1.887 1.887 0 0 0-1.822-2.598ZM7.463 8.163a.611.611 0 0 0-.432.154L5.071 10.5h5.119L7.88 8.348a.628.628 0 0 0-.417-.185Zm6.236 1.059a.62.62 0 0 0-.42.164L12.07 10.5h2.969l-.92-1.113a.618.618 0 0 0-.42-.165ZM.91 11.5a.91.91 0 0 0-.91.912v6.877c0 .505.405.91.91.91h18.178a.91.91 0 0 0 .912-.91v-6.877a.908.908 0 0 0-.912-.912H.91ZM3.668 13h1.947l2.135 5.7H5.898l-.28-.946H3.601l-.278.945H1.516L3.668 13Zm4.947 0h1.801v4.3h2.7v1.4h-4.5V13h-.001Zm4.5 0h5.4v1.4h-1.798v4.3h-1.701v-4.3h-1.9V13h-.001Zm-8.517 1.457-.614 2.059h1.262l-.648-2.059Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M12.68 13.74h-.001l4.209 4.208a1 1 0 1 0 1.414-1.414l-4.267-4.268a6 6 0 1 0-1.355 1.474ZM13 9a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M19 4.5 14 0H3v12.673l.868-1.041c.185-.222.4-.402.632-.54V1.5h8v5h5v7.626a2.24 2.24 0 0 1 1.5.822V4.5ZM14 5V2l3.3 3H14Zm-3.692 12.5c.062.105.133.206.213.303L11.52 19H8v-.876a2.243 2.243 0 0 0 1.82-.624h.488Zm7.518-.657a.75.75 0 0 0-1.152-.96L15.5 17.29V12H14v5.29l-1.174-1.408a.75.75 0 0 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0l2.346-2.815Zm-15.056-.38a.75.75 0 0 1-.096-1.056l2.346-2.815a.95.95 0 0 1 1.46 0l2.346 2.815a.75.75 0 1 1-1.152.96L6.5 14.96V20H5v-5.04l-1.174 1.408a.75.75 0 0 1-1.056.096Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5zM5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10 2a1 1 0 0 0-1 1v6H3a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2h-6V3a1 1 0 0 0-1-1Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M9.816 11.5 7.038 4.785 4.261 11.5h5.555Zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13Z\\\"/><path d=\\\"m12.09 17-.534-1.292.848-1.971.545 1.319L12.113 17h-.023Zm1.142-5.187.545 1.319L15.5 9.13l1.858 4.316h-3.45l.398.965h3.467L18.887 17H20l-3.873-9h-1.254l-1.641 3.813Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z\\\"/><path d=\\\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2z\\\"/><path d=\\\"M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z\\\"/><path d=\\\"M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2z\\\"/><path d=\\\"M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1zm-1.505.5H3.504V12h12.991V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z\\\"/><path d=\\\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2z\\\"/><path d=\\\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2z\\\"/><path d=\\\"M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:v=\\\"https://vecta.io/nano\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M.95 1.43a.95.95 0 0 0-.95.95v3.1a.95.95 0 0 0 .95.95h.75v6.3H.95a.95.95 0 0 0-.95.95v3.1a.95.95 0 0 0 .95.95h3.1a.95.95 0 0 0 .95-.95v-.65h1.932l1.539-1.5H5v-.95a.95.95 0 0 0-.95-.95H3.2v-6.3h.85A.95.95 0 0 0 5 5.48v-.55h10v.55a.95.95 0 0 0 .95.95h3.1a.95.95 0 0 0 .95-.95v-3.1a.95.95 0 0 0-.95-.95h-3.1a.95.95 0 0 0-.95.95v1.05H5V2.38a.95.95 0 0 0-.95-.95H.95zm.55 3.5v-2h2v2h-2zm0 9.3v2h2v-2h-2zm15-11.3v2h2v-2h-2z\\\"/><path d=\\\"M8.139 20.004v-2.388l7.045-7.048 2.391 2.391-7.046 7.046h-2.39zm11.421-9.101a.64.64 0 0 1-.138.206l-1.165 1.168-2.391-2.391 1.167-1.163a.63.63 0 0 1 .206-.138.635.635 0 0 1 .243-.049.63.63 0 0 1 .449.187l1.491 1.488c.059.059.108.129.138.206s.049.16.049.243a.6.6 0 0 1-.049.243z\\\"/></svg>\";","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\\\"/><path d=\\\"M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2.5 16.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1ZM1 15v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 13v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 11v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 9v1H0V9h1Zm19 0v1h-1V9h1ZM1 7v1H0V7h1Zm19 0v1h-1V7h1ZM1 5v1H0V5h1Zm19 0v1h-1V5h1Zm0-2v1h-1V3h1ZM1 3v1H0V3h1Zm13.5-1.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm-8 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm8 0v1h-1v-1h1Zm-10 0v1h-1v-1h1Z\\\"/><path d=\\\"M13 5.5H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2ZM13 7a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-8A.5.5 0 0 1 2 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 0v1h-1v-1h1ZM1 11v1H0v-1h1Zm19 0v1h-1v-1h1ZM1 9v1H0V9h1Zm19 0v1h-1V9h1ZM1 7v1H0V7h1Zm19 0v1h-1V7h1ZM1 5v1H0V5h1Zm19 0v1h-1V5h1Zm0-2v1h-1V3h1ZM1 3v1H0V3h1Zm13.5-1.5v1h-1v-1h1Zm2 0v1h-1v-1h1Zm2 0v1h-1v-1h1Zm-8 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm-2 0v1h-1v-1h1Zm8 0v1h-1v-1h1Zm-10 0v1h-1v-1h1Z\\\"/><path d=\\\"M10 7.5H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2ZM10 9a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6A.5.5 0 0 1 2 9h8Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><circle cx=\\\"9.5\\\" cy=\\\"4.5\\\" r=\\\"1.5\\\"/><circle cx=\\\"9.5\\\" cy=\\\"10.5\\\" r=\\\"1.5\\\"/><circle cx=\\\"9.5\\\" cy=\\\"16.5\\\" r=\\\"1.5\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M5 3.25a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0\\\"/><path d=\\\"M12 3.25a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0\\\"/><path d=\\\"M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0\\\"/><path d=\\\"M12 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0\\\"/><path d=\\\"M5 16.75a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0\\\"/><path d=\\\"M12 16.75a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m2.315 14.705 2.224-2.24a.689.689 0 0 1 .963 0 .664.664 0 0 1 0 .949L2.865 16.07a.682.682 0 0 1-.112.089.647.647 0 0 1-.852-.051L.688 14.886a.635.635 0 0 1 0-.903.647.647 0 0 1 .91 0l.717.722zm5.185.045a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75zM2.329 5.745l2.21-2.226a.689.689 0 0 1 .963 0 .664.664 0 0 1 0 .95L2.865 7.125a.685.685 0 0 1-.496.196.644.644 0 0 1-.468-.187L.688 5.912a.635.635 0 0 1 0-.903.647.647 0 0 1 .91 0l.73.736zM7.5 5.75A.75.75 0 0 1 8.25 5h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M3 5.5v3h4v-3H3Zm0 4v3h4v-3H3Zm0 4v3h4v-3H3Zm5 3h4v-3H8v3Zm5 0h4v-3h-4v3Zm4-4v-3h-4v3h4Zm0-4v-3h-4v3h4Zm1.5 8A1.5 1.5 0 0 1 17 18H3a1.5 1.5 0 0 1-1.5-1.5V3c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13.5Zm-6.5-4v-3H8v3h4Zm0-4v-3H8v3h4Z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/viewcollection\n */\nimport { CKEditorError, Collection } from '@ckeditor/ckeditor5-utils';\n/**\n * Collects {@link module:ui/view~View} instances.\n *\n * ```ts\n * const parentView = new ParentView( locale );\n * const collection = new ViewCollection( locale );\n *\n * collection.setParent( parentView.element );\n *\n * const viewA = new ChildView( locale );\n * const viewB = new ChildView( locale );\n * ```\n *\n * View collection renders and manages view {@link module:ui/view~View#element elements}:\n *\n * ```ts\n * collection.add( viewA );\n * collection.add( viewB );\n *\n * console.log( parentView.element.firsChild ); // -> viewA.element\n * console.log( parentView.element.lastChild ); // -> viewB.element\n * ```\n *\n * It {@link module:ui/viewcollection~ViewCollection#delegate propagates} DOM events too:\n *\n * ```ts\n * // Delegate #click and #keydown events from viewA and viewB to the parentView.\n * collection.delegate( 'click' ).to( parentView );\n *\n * parentView.on( 'click', ( evt ) => {\n * \tconsole.log( `${ evt.source } has been clicked.` );\n * } );\n *\n * // This event will be delegated to the parentView.\n * viewB.fire( 'click' );\n * ```\n *\n * **Note**: A view collection can be used directly in the {@link module:ui/template~TemplateDefinition definition}\n * of a {@link module:ui/template~Template template}.\n */\nexport default class ViewCollection extends Collection {\n /**\n * Creates a new instance of the {@link module:ui/viewcollection~ViewCollection}.\n *\n * @param initialItems The initial items of the collection.\n */\n constructor(initialItems = []) {\n super(initialItems, {\n // An #id Number attribute should be legal and not break the `ViewCollection` instance.\n // https://github.com/ckeditor/ckeditor5-ui/issues/93\n idProperty: 'viewUid'\n });\n // Handle {@link module:ui/view~View#element} in DOM when a new view is added to the collection.\n this.on('add', (evt, view, index) => {\n this._renderViewIntoCollectionParent(view, index);\n });\n // Handle {@link module:ui/view~View#element} in DOM when a view is removed from the collection.\n this.on('remove', (evt, view) => {\n if (view.element && this._parentElement) {\n view.element.remove();\n }\n });\n this._parentElement = null;\n }\n /**\n * Destroys the view collection along with child views.\n * See the view {@link module:ui/view~View#destroy} method.\n */\n destroy() {\n this.map(view => view.destroy());\n }\n /**\n * Sets the parent HTML element of this collection. When parent is set, {@link #add adding} and\n * {@link #remove removing} views in the collection synchronizes their\n * {@link module:ui/view~View#element elements} in the parent element.\n *\n * @param element A new parent element.\n */\n setParent(elementOrDocFragment) {\n this._parentElement = elementOrDocFragment;\n // Take care of the initial collection items passed to the constructor.\n for (const view of this) {\n this._renderViewIntoCollectionParent(view);\n }\n }\n /**\n * Delegates selected events coming from within views in the collection to any\n * {@link module:utils/emittermixin~Emitter}.\n *\n * For the following views and collection:\n *\n * ```ts\n * const viewA = new View();\n * const viewB = new View();\n * const viewC = new View();\n *\n * const views = parentView.createCollection();\n *\n * views.delegate( 'eventX' ).to( viewB );\n * views.delegate( 'eventX', 'eventY' ).to( viewC );\n *\n * views.add( viewA );\n * ```\n *\n * the `eventX` is delegated (fired by) `viewB` and `viewC` along with `customData`:\n *\n * ```ts\n * viewA.fire( 'eventX', customData );\n * ```\n *\n * and `eventY` is delegated (fired by) `viewC` along with `customData`:\n *\n * ```ts\n * viewA.fire( 'eventY', customData );\n * ```\n *\n * See {@link module:utils/emittermixin~Emitter#delegate}.\n *\n * @param events {@link module:ui/view~View} event names to be delegated to another\n * {@link module:utils/emittermixin~Emitter}.\n * @returns Object with `to` property, a function which accepts the destination\n * of {@link module:utils/emittermixin~Emitter#delegate delegated} events.\n */\n delegate(...events) {\n if (!events.length || !isStringArray(events)) {\n /**\n * All event names must be strings.\n *\n * @error ui-viewcollection-delegate-wrong-events\n */\n throw new CKEditorError('ui-viewcollection-delegate-wrong-events', this);\n }\n return {\n to: dest => {\n // Activate delegating on existing views in this collection.\n for (const view of this) {\n for (const evtName of events) {\n view.delegate(evtName).to(dest);\n }\n }\n // Activate delegating on future views in this collection.\n this.on('add', (evt, view) => {\n for (const evtName of events) {\n view.delegate(evtName).to(dest);\n }\n });\n // Deactivate delegating when view is removed from this collection.\n this.on('remove', (evt, view) => {\n for (const evtName of events) {\n view.stopDelegating(evtName, dest);\n }\n });\n }\n };\n }\n /**\n * This method {@link module:ui/view~View#render renders} a new view added to the collection.\n *\n * If the {@link #_parentElement parent element} of the collection is set, this method also adds\n * the view's {@link module:ui/view~View#element} as a child of the parent in DOM at a specified index.\n *\n * **Note**: If index is not specified, the view's element is pushed as the last child\n * of the parent element.\n *\n * @param view A new view added to the collection.\n * @param index An index the view holds in the collection. When not specified,\n * the view is added at the end.\n */\n _renderViewIntoCollectionParent(view, index) {\n if (!view.isRendered) {\n view.render();\n }\n if (view.element && this._parentElement) {\n this._parentElement.insertBefore(view.element, this._parentElement.children[index]);\n }\n }\n /**\n * Removes a child view from the collection. If the {@link #setParent parent element} of the\n * collection has been set, the {@link module:ui/view~View#element element} of the view is also removed\n * in DOM, reflecting the order of the collection.\n *\n * See the {@link #add} method.\n *\n * @param subject The view to remove, its id or index in the collection.\n * @returns The removed view.\n */\n remove(subject) {\n return super.remove(subject);\n }\n}\n/**\n * Check if all entries of the array are of `String` type.\n *\n * @param arr An array to be checked.\n */\nfunction isStringArray(arr) {\n return arr.every(a => typeof a == 'string');\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/template\n */\n/* global document */\nimport View from './view.js';\nimport ViewCollection from './viewcollection.js';\nimport { CKEditorError, EmitterMixin, isNode, toArray } from '@ckeditor/ckeditor5-utils';\nimport { isObject, cloneDeepWith } from 'lodash-es';\nconst xhtmlNs = 'http://www.w3.org/1999/xhtml';\n/**\n * A basic Template class. It renders a DOM HTML element or text from a\n * {@link module:ui/template~TemplateDefinition definition} and supports element attributes, children,\n * bindings to {@link module:utils/observablemixin~Observable observables} and DOM event propagation.\n *\n * A simple template can look like this:\n *\n * ```ts\n * const bind = Template.bind( observable, emitter );\n *\n * new Template( {\n * \ttag: 'p',\n * \tattributes: {\n * \t\tclass: 'foo',\n * \t\tstyle: {\n * \t\t\tbackgroundColor: 'yellow'\n * \t\t}\n * \t},\n * \ton: {\n * \t\tclick: bind.to( 'clicked' )\n * \t},\n * \tchildren: [\n * \t\t'A paragraph.'\n * \t]\n * } ).render();\n * ```\n *\n * and it will render the following HTML element:\n *\n * ```html\n * <p class=\"foo\" style=\"background-color: yellow;\">A paragraph.</p>\n * ```\n *\n * Additionally, the `observable` will always fire `clicked` upon clicking `<p>` in the DOM.\n *\n * See {@link module:ui/template~TemplateDefinition} to know more about templates and complex\n * template definitions.\n */\nexport default class Template extends /* #__PURE__ */ EmitterMixin() {\n /**\n * Creates an instance of the {@link ~Template} class.\n *\n * @param def The definition of the template.\n */\n constructor(def) {\n super();\n Object.assign(this, normalize(clone(def)));\n this._isRendered = false;\n this._revertData = null;\n }\n /**\n * Renders a DOM Node (an HTML element or text) out of the template.\n *\n * ```ts\n * const domNode = new Template( { ... } ).render();\n * ```\n *\n * See: {@link #apply}.\n */\n render() {\n const node = this._renderNode({\n intoFragment: true\n });\n this._isRendered = true;\n return node;\n }\n /**\n * Applies the template to an existing DOM Node, either HTML element or text.\n *\n * **Note:** No new DOM nodes will be created. Applying extends:\n *\n * {@link module:ui/template~TemplateDefinition attributes},\n * {@link module:ui/template~TemplateDefinition event listeners}, and\n * `textContent` of {@link module:ui/template~TemplateDefinition children} only.\n *\n * **Note:** Existing `class` and `style` attributes are extended when a template\n * is applied to an HTML element, while other attributes and `textContent` are overridden.\n *\n * **Note:** The process of applying a template can be easily reverted using the\n * {@link module:ui/template~Template#revert} method.\n *\n * ```ts\n * const element = document.createElement( 'div' );\n * const observable = new Model( { divClass: 'my-div' } );\n * const emitter = Object.create( EmitterMixin );\n * const bind = Template.bind( observable, emitter );\n *\n * new Template( {\n * \tattributes: {\n * \t\tid: 'first-div',\n * \t\tclass: bind.to( 'divClass' )\n * \t},\n * \ton: {\n * \t\tclick: bind( 'elementClicked' ) // Will be fired by the observable.\n * \t},\n * \tchildren: [\n * \t\t'Div text.'\n * \t]\n * } ).apply( element );\n *\n * console.log( element.outerHTML ); // -> '<div id=\"first-div\" class=\"my-div\"></div>'\n * ```\n *\n * @see module:ui/template~Template#render\n * @see module:ui/template~Template#revert\n * @param node Root node for the template to apply.\n */\n apply(node) {\n this._revertData = getEmptyRevertData();\n this._renderNode({\n node,\n intoFragment: false,\n isApplying: true,\n revertData: this._revertData\n });\n return node;\n }\n /**\n * Reverts a template {@link module:ui/template~Template#apply applied} to a DOM node.\n *\n * @param node The root node for the template to revert. In most of the cases, it is the\n * same node used by {@link module:ui/template~Template#apply}.\n */\n revert(node) {\n if (!this._revertData) {\n /**\n * Attempting to revert a template which has not been applied yet.\n *\n * @error ui-template-revert-not-applied\n */\n throw new CKEditorError('ui-template-revert-not-applied', [this, node]);\n }\n this._revertTemplateFromNode(node, this._revertData);\n }\n /**\n * Returns an iterator which traverses the template in search of {@link module:ui/view~View}\n * instances and returns them one by one.\n *\n * ```ts\n * const viewFoo = new View();\n * const viewBar = new View();\n * const viewBaz = new View();\n * const template = new Template( {\n * \ttag: 'div',\n * \tchildren: [\n * \t\tviewFoo,\n * \t\t{\n * \t\t\ttag: 'div',\n * \t\t\tchildren: [\n * \t\t\t\tviewBar\n * \t\t\t]\n * \t\t},\n * \t\tviewBaz\n * \t]\n * } );\n *\n * // Logs: viewFoo, viewBar, viewBaz\n * for ( const view of template.getViews() ) {\n * \tconsole.log( view );\n * }\n * ```\n */\n *getViews() {\n function* search(def) {\n if (def.children) {\n for (const child of def.children) {\n if (isView(child)) {\n yield child;\n }\n else if (isTemplate(child)) {\n yield* search(child);\n }\n }\n }\n }\n yield* search(this);\n }\n /**\n * An entry point to the interface which binds DOM nodes to\n * {@link module:utils/observablemixin~Observable observables}.\n * There are two types of bindings:\n *\n * * HTML element attributes or text `textContent` synchronized with attributes of an\n * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}\n * and {@link module:ui/template~BindChain#if}.\n *\n * ```ts\n * const bind = Template.bind( observable, emitter );\n *\n * new Template( {\n * \tattributes: {\n * \t\t// Binds the element \"class\" attribute to observable#classAttribute.\n * \t\tclass: bind.to( 'classAttribute' )\n * \t}\n * } ).render();\n * ```\n *\n * * DOM events fired on HTML element propagated through\n * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}.\n *\n * ```ts\n * const bind = Template.bind( observable, emitter );\n *\n * new Template( {\n * \ton: {\n * \t\t// Will be fired by the observable.\n * \t\tclick: bind( 'elementClicked' )\n * \t}\n * } ).render();\n * ```\n *\n * Also see {@link module:ui/view~View#bindTemplate}.\n *\n * @param observable An observable which provides boundable attributes.\n * @param emitter An emitter that listens to observable attribute\n * changes or DOM Events (depending on the kind of the binding). Usually, a {@link module:ui/view~View} instance.\n */\n static bind(observable, emitter) {\n return {\n to(eventNameOrFunctionOrAttribute, callback) {\n return new TemplateToBinding({\n eventNameOrFunction: eventNameOrFunctionOrAttribute,\n attribute: eventNameOrFunctionOrAttribute,\n observable, emitter, callback\n });\n },\n if(attribute, valueIfTrue, callback) {\n return new TemplateIfBinding({\n observable, emitter, attribute, valueIfTrue, callback\n });\n }\n };\n }\n /**\n * Extends an existing {@link module:ui/template~Template} instance with some additional content\n * from another {@link module:ui/template~TemplateDefinition}.\n *\n * ```ts\n * const bind = Template.bind( observable, emitter );\n *\n * const template = new Template( {\n * \ttag: 'p',\n * \tattributes: {\n * \t\tclass: 'a',\n * \t\tdata-x: bind.to( 'foo' )\n * \t},\n * \tchildren: [\n * \t\t{\n * \t\t\ttag: 'span',\n * \t\t\tattributes: {\n * \t\t\t\tclass: 'b'\n * \t\t\t},\n * \t\t\tchildren: [\n * \t\t\t\t'Span'\n * \t\t\t]\n * \t\t}\n * \t]\n * } );\n *\n * // Instance-level extension.\n * Template.extend( template, {\n * \tattributes: {\n * \t\tclass: 'b',\n * \t\tdata-x: bind.to( 'bar' )\n * \t},\n * \tchildren: [\n * \t\t{\n * \t\t\tattributes: {\n * \t\t\t\tclass: 'c'\n * \t\t\t}\n * \t\t}\n * \t]\n * } );\n *\n * // Child extension.\n * Template.extend( template.children[ 0 ], {\n * \tattributes: {\n * \t\tclass: 'd'\n * \t}\n * } );\n * ```\n *\n * the `outerHTML` of `template.render()` is:\n *\n * ```html\n * <p class=\"a b\" data-x=\"{ observable.foo } { observable.bar }\">\n * \t<span class=\"b c d\">Span</span>\n * </p>\n * ```\n *\n * @param template An existing template instance to be extended.\n * @param def Additional definition to be applied to a template.\n */\n static extend(template, def) {\n if (template._isRendered) {\n /**\n * Extending a template after rendering may not work as expected. To make sure\n * the {@link module:ui/template~Template.extend extending} works for an element,\n * make sure it happens before {@link module:ui/template~Template#render} is called.\n *\n * @error template-extend-render\n */\n throw new CKEditorError('template-extend-render', [this, template]);\n }\n extendTemplate(template, normalize(clone(def)));\n }\n /**\n * Renders a DOM Node (either an HTML element or text) out of the template.\n *\n * @param data Rendering data.\n */\n _renderNode(data) {\n let isInvalid;\n if (data.node) {\n // When applying, a definition cannot have \"tag\" and \"text\" at the same time.\n isInvalid = this.tag && this.text;\n }\n else {\n // When rendering, a definition must have either \"tag\" or \"text\": XOR( this.tag, this.text ).\n isInvalid = this.tag ? this.text : !this.text;\n }\n if (isInvalid) {\n /**\n * Node definition cannot have the \"tag\" and \"text\" properties at the same time.\n * Node definition must have either \"tag\" or \"text\" when rendering a new Node.\n *\n * @error ui-template-wrong-syntax\n */\n throw new CKEditorError('ui-template-wrong-syntax', this);\n }\n if (this.text) {\n return this._renderText(data);\n }\n else {\n return this._renderElement(data);\n }\n }\n /**\n * Renders an HTML element out of the template.\n *\n * @param data Rendering data.\n */\n _renderElement(data) {\n let node = data.node;\n if (!node) {\n node = data.node = document.createElementNS(this.ns || xhtmlNs, this.tag);\n }\n this._renderAttributes(data);\n this._renderElementChildren(data);\n this._setUpListeners(data);\n return node;\n }\n /**\n * Renders a text node out of {@link module:ui/template~Template#text}.\n *\n * @param data Rendering data.\n */\n _renderText(data) {\n let node = data.node;\n // Save the original textContent to revert it in #revert().\n if (node) {\n data.revertData.text = node.textContent;\n }\n else {\n node = data.node = document.createTextNode('');\n }\n // Check if this Text Node is bound to Observable. Cases:\n //\n //\t\ttext: [ Template.bind( ... ).to( ... ) ]\n //\n //\t\ttext: [\n //\t\t\t'foo',\n //\t\t\tTemplate.bind( ... ).to( ... ),\n //\t\t\t...\n //\t\t]\n //\n if (hasTemplateBinding(this.text)) {\n this._bindToObservable({\n schema: this.text,\n updater: getTextUpdater(node),\n data\n });\n }\n // Simply set text. Cases:\n //\n //\t\ttext: [ 'all', 'are', 'static' ]\n //\n //\t\ttext: [ 'foo' ]\n //\n else {\n node.textContent = this.text.join('');\n }\n return node;\n }\n /**\n * Renders HTML element attributes out of {@link module:ui/template~Template#attributes}.\n *\n * @param data Rendering data.\n */\n _renderAttributes(data) {\n if (!this.attributes) {\n return;\n }\n const node = data.node;\n const revertData = data.revertData;\n for (const attrName in this.attributes) {\n // Current attribute value in DOM.\n const domAttrValue = node.getAttribute(attrName);\n // The value to be set.\n const attrValue = this.attributes[attrName];\n // Save revert data.\n if (revertData) {\n revertData.attributes[attrName] = domAttrValue;\n }\n // Detect custom namespace:\n //\n //\t\tclass: {\n //\t\t\tns: 'abc',\n //\t\t\tvalue: Template.bind( ... ).to( ... )\n //\t\t}\n //\n const attrNs = isNamespaced(attrValue) ? attrValue[0].ns : null;\n // Activate binding if one is found. Cases:\n //\n //\t\tclass: [\n //\t\t\tTemplate.bind( ... ).to( ... )\n //\t\t]\n //\n //\t\tclass: [\n //\t\t\t'bar',\n //\t\t\tTemplate.bind( ... ).to( ... ),\n //\t\t\t'baz'\n //\t\t]\n //\n //\t\tclass: {\n //\t\t\tns: 'abc',\n //\t\t\tvalue: Template.bind( ... ).to( ... )\n //\t\t}\n //\n if (hasTemplateBinding(attrValue)) {\n // Normalize attributes with additional data like namespace:\n //\n //\t\tclass: {\n //\t\t\tns: 'abc',\n //\t\t\tvalue: [ ... ]\n //\t\t}\n //\n const valueToBind = isNamespaced(attrValue) ? attrValue[0].value : attrValue;\n // Extend the original value of attributes like \"style\" and \"class\",\n // don't override them.\n if (revertData && shouldExtend(attrName)) {\n valueToBind.unshift(domAttrValue);\n }\n this._bindToObservable({\n schema: valueToBind,\n updater: getAttributeUpdater(node, attrName, attrNs),\n data\n });\n }\n // Style attribute could be an Object so it needs to be parsed in a specific way.\n //\n //\t\tstyle: {\n //\t\t\twidth: '100px',\n //\t\t\theight: Template.bind( ... ).to( ... )\n //\t\t}\n //\n else if (attrName == 'style' && typeof attrValue[0] !== 'string') {\n this._renderStyleAttribute(attrValue[0], data);\n }\n // Otherwise simply set the static attribute:\n //\n //\t\tclass: [ 'foo' ]\n //\n //\t\tclass: [ 'all', 'are', 'static' ]\n //\n //\t\tclass: [\n //\t\t\t{\n //\t\t\t\tns: 'abc',\n //\t\t\t\tvalue: [ 'foo' ]\n //\t\t\t}\n //\t\t]\n //\n else {\n // Extend the original value of attributes like \"style\" and \"class\",\n // don't override them.\n if (revertData && domAttrValue && shouldExtend(attrName)) {\n attrValue.unshift(domAttrValue);\n }\n const value = attrValue\n // Retrieve \"values\" from:\n //\n //\t\tclass: [\n //\t\t\t{\n //\t\t\t\tns: 'abc',\n //\t\t\t\tvalue: [ ... ]\n //\t\t\t}\n //\t\t]\n //\n .map((val) => val ? (val.value || val) : val)\n // Flatten the array.\n .reduce((prev, next) => prev.concat(next), [])\n // Convert into string.\n .reduce(arrayValueReducer, '');\n if (!isFalsy(value)) {\n node.setAttributeNS(attrNs, attrName, value);\n }\n }\n }\n }\n /**\n * Renders the `style` attribute of an HTML element based on\n * {@link module:ui/template~Template#attributes}.\n *\n * A style attribute is an object with static values:\n *\n * ```ts\n * attributes: {\n * \tstyle: {\n * \t\tcolor: 'red'\n * \t}\n * }\n * ```\n *\n * or values bound to {@link module:ui/model~Model} properties:\n *\n * ```ts\n * attributes: {\n * \tstyle: {\n * \t\tcolor: bind.to( ... )\n * \t}\n * }\n * ```\n *\n * Note: The `style` attribute is rendered without setting the namespace. It does not seem to be\n * needed.\n *\n * @param styles Styles located in `attributes.style` of {@link module:ui/template~TemplateDefinition}.\n * @param data Rendering data.\n */\n _renderStyleAttribute(styles, data) {\n const node = data.node;\n for (const styleName in styles) {\n const styleValue = styles[styleName];\n // Cases:\n //\n //\t\tstyle: {\n //\t\t\tcolor: bind.to( 'attribute' )\n //\t\t}\n //\n if (hasTemplateBinding(styleValue)) {\n this._bindToObservable({\n schema: [styleValue],\n updater: getStyleUpdater(node, styleName),\n data\n });\n }\n // Cases:\n //\n //\t\tstyle: {\n //\t\t\tcolor: 'red'\n //\t\t}\n //\n else {\n node.style[styleName] = styleValue;\n }\n }\n }\n /**\n * Recursively renders HTML element's children from {@link module:ui/template~Template#children}.\n *\n * @param data Rendering data.\n */\n _renderElementChildren(data) {\n const node = data.node;\n const container = data.intoFragment ? document.createDocumentFragment() : node;\n const isApplying = data.isApplying;\n let childIndex = 0;\n for (const child of this.children) {\n if (isViewCollection(child)) {\n if (!isApplying) {\n child.setParent(node);\n // Note: ViewCollection renders its children.\n for (const view of child) {\n container.appendChild(view.element);\n }\n }\n }\n else if (isView(child)) {\n if (!isApplying) {\n if (!child.isRendered) {\n child.render();\n }\n container.appendChild(child.element);\n }\n }\n else if (isNode(child)) {\n container.appendChild(child);\n }\n else {\n if (isApplying) {\n const revertData = data.revertData;\n const childRevertData = getEmptyRevertData();\n revertData.children.push(childRevertData);\n child._renderNode({\n intoFragment: false,\n node: container.childNodes[childIndex++],\n isApplying: true,\n revertData: childRevertData\n });\n }\n else {\n container.appendChild(child.render());\n }\n }\n }\n if (data.intoFragment) {\n node.appendChild(container);\n }\n }\n /**\n * Activates `on` event listeners from the {@link module:ui/template~TemplateDefinition}\n * on an HTML element.\n *\n * @param data Rendering data.\n */\n _setUpListeners(data) {\n if (!this.eventListeners) {\n return;\n }\n for (const key in this.eventListeners) {\n const revertBindings = this.eventListeners[key].map(schemaItem => {\n const [domEvtName, domSelector] = key.split('@');\n return schemaItem.activateDomEventListener(domEvtName, domSelector, data);\n });\n if (data.revertData) {\n data.revertData.bindings.push(revertBindings);\n }\n }\n }\n /**\n * For a given {@link module:ui/template~TemplateValueSchema} containing {@link module:ui/template~TemplateBinding}\n * activates the binding and sets its initial value.\n *\n * Note: {@link module:ui/template~TemplateValueSchema} can be for HTML element attributes or\n * text node `textContent`.\n *\n * @param options Binding options.\n * @param options.updater A function which updates the DOM (like attribute or text).\n * @param options.data Rendering data.\n */\n _bindToObservable({ schema, updater, data }) {\n const revertData = data.revertData;\n // Set initial values.\n syncValueSchemaValue(schema, updater, data);\n const revertBindings = schema\n // Filter \"falsy\" (false, undefined, null, '') value schema components out.\n .filter(item => !isFalsy(item))\n // Filter inactive bindings from schema, like static strings ('foo'), numbers (42), etc.\n .filter((item) => item.observable)\n // Once only the actual binding are left, let the emitter listen to observable change:attribute event.\n // TODO: Reduce the number of listeners attached as many bindings may listen\n // to the same observable attribute.\n .map(templateBinding => templateBinding.activateAttributeListener(schema, updater, data));\n if (revertData) {\n revertData.bindings.push(revertBindings);\n }\n }\n /**\n * Reverts {@link module:ui/template~RenderData#revertData template data} from a node to\n * return it to the original state.\n *\n * @param node A node to be reverted.\n * @param revertData An object that stores information about what changes have been made by\n * {@link #apply} to the node. See {@link module:ui/template~RenderData#revertData} for more information.\n */\n _revertTemplateFromNode(node, revertData) {\n for (const binding of revertData.bindings) {\n // Each binding may consist of several observable+observable#attribute.\n // like the following has 2:\n //\n //\t\tclass: [\n //\t\t\t'x',\n //\t\t\tbind.to( 'foo' ),\n //\t\t\t'y',\n //\t\t\tbind.to( 'bar' )\n //\t\t]\n //\n for (const revertBinding of binding) {\n revertBinding();\n }\n }\n if (revertData.text) {\n node.textContent = revertData.text;\n return;\n }\n const element = node;\n for (const attrName in revertData.attributes) {\n const attrValue = revertData.attributes[attrName];\n // When the attribute has **not** been set before #apply().\n if (attrValue === null) {\n element.removeAttribute(attrName);\n }\n else {\n element.setAttribute(attrName, attrValue);\n }\n }\n for (let i = 0; i < revertData.children.length; ++i) {\n this._revertTemplateFromNode(element.childNodes[i], revertData.children[i]);\n }\n }\n}\n/**\n * Describes a binding created by the {@link module:ui/template~Template.bind} interface.\n *\n * @internal\n */\nexport class TemplateBinding {\n /**\n * Creates an instance of the {@link module:ui/template~TemplateBinding} class.\n *\n * @param def The definition of the binding.\n */\n constructor(def) {\n this.attribute = def.attribute;\n this.observable = def.observable;\n this.emitter = def.emitter;\n this.callback = def.callback;\n }\n /**\n * Returns the value of the binding. It is the value of the {@link module:ui/template~TemplateBinding#attribute} in\n * {@link module:ui/template~TemplateBinding#observable}. The value may be processed by the\n * {@link module:ui/template~TemplateBinding#callback}, if such has been passed to the binding.\n *\n * @param node A native DOM node, passed to the custom {@link module:ui/template~TemplateBinding#callback}.\n * @returns The value of {@link module:ui/template~TemplateBinding#attribute} in\n * {@link module:ui/template~TemplateBinding#observable}.\n */\n getValue(node) {\n const value = this.observable[this.attribute];\n return this.callback ? this.callback(value, node) : value;\n }\n /**\n * Activates the listener which waits for changes of the {@link module:ui/template~TemplateBinding#attribute} in\n * {@link module:ui/template~TemplateBinding#observable}, then updates the DOM with the aggregated\n * value of {@link module:ui/template~TemplateValueSchema}.\n *\n * @param schema A full schema to generate an attribute or text in the DOM.\n * @param updater A DOM updater function used to update the native DOM attribute or text.\n * @param data Rendering data.\n * @returns A function to sever the listener binding.\n */\n activateAttributeListener(schema, updater, data) {\n const callback = () => syncValueSchemaValue(schema, updater, data);\n this.emitter.listenTo(this.observable, `change:${this.attribute}`, callback);\n // Allows revert of the listener.\n return () => {\n this.emitter.stopListening(this.observable, `change:${this.attribute}`, callback);\n };\n }\n}\n/**\n * Describes either:\n *\n * * a binding to an {@link module:utils/observablemixin~Observable},\n * * or a native DOM event binding.\n *\n * It is created by the {@link module:ui/template~BindChain#to} method.\n *\n * @internal\n */\nexport class TemplateToBinding extends TemplateBinding {\n constructor(def) {\n super(def);\n this.eventNameOrFunction = def.eventNameOrFunction;\n }\n /**\n * Activates the listener for the native DOM event, which when fired, is propagated by\n * the {@link module:ui/template~TemplateBinding#emitter}.\n *\n * @param domEvtName The name of the native DOM event.\n * @param domSelector The selector in the DOM to filter delegated events.\n * @param data Rendering data.\n * @returns A function to sever the listener binding.\n */\n activateDomEventListener(domEvtName, domSelector, data) {\n const callback = (evt, domEvt) => {\n if (!domSelector || domEvt.target.matches(domSelector)) {\n if (typeof this.eventNameOrFunction == 'function') {\n this.eventNameOrFunction(domEvt);\n }\n else {\n this.observable.fire(this.eventNameOrFunction, domEvt);\n }\n }\n };\n this.emitter.listenTo(data.node, domEvtName, callback);\n // Allows revert of the listener.\n return () => {\n this.emitter.stopListening(data.node, domEvtName, callback);\n };\n }\n}\n/**\n * Describes a binding to {@link module:utils/observablemixin~Observable} created by the {@link module:ui/template~BindChain#if}\n * method.\n *\n * @internal\n */\nexport class TemplateIfBinding extends TemplateBinding {\n constructor(def) {\n super(def);\n this.valueIfTrue = def.valueIfTrue;\n }\n /**\n * @inheritDoc\n */\n getValue(node) {\n const value = super.getValue(node);\n return isFalsy(value) ? false : (this.valueIfTrue || true);\n }\n}\n/**\n * Checks whether given {@link module:ui/template~TemplateValueSchema} contains a\n * {@link module:ui/template~TemplateBinding}.\n */\nfunction hasTemplateBinding(schema) {\n if (!schema) {\n return false;\n }\n // Normalize attributes with additional data like namespace:\n //\n //\t\tclass: {\n //\t\t\tns: 'abc',\n //\t\t\tvalue: [ ... ]\n //\t\t}\n //\n if (schema.value) {\n schema = schema.value;\n }\n if (Array.isArray(schema)) {\n return schema.some(hasTemplateBinding);\n }\n else if (schema instanceof TemplateBinding) {\n return true;\n }\n return false;\n}\n/**\n * Assembles the value using {@link module:ui/template~TemplateValueSchema} and stores it in a form of\n * an Array. Each entry of the Array corresponds to one of {@link module:ui/template~TemplateValueSchema}\n * items.\n *\n * @param node DOM Node updated when {@link module:utils/observablemixin~Observable} changes.\n */\nfunction getValueSchemaValue(schema, node) {\n return schema.map(schemaItem => {\n // Process {@link module:ui/template~TemplateBinding} bindings.\n if (schemaItem instanceof TemplateBinding) {\n return schemaItem.getValue(node);\n }\n // All static values like strings, numbers, and \"falsy\" values (false, null, undefined, '', etc.) just pass.\n return schemaItem;\n });\n}\n/**\n * A function executed each time the bound Observable attribute changes, which updates the DOM with a value\n * constructed from {@link module:ui/template~TemplateValueSchema}.\n *\n * @param updater A function which updates the DOM (like attribute or text).\n * @param node DOM Node updated when {@link module:utils/observablemixin~Observable} changes.\n */\nfunction syncValueSchemaValue(schema, updater, { node }) {\n const values = getValueSchemaValue(schema, node);\n let value;\n // Check if schema is a single Template.bind.if, like:\n //\n //\t\tclass: Template.bind.if( 'foo' )\n //\n if (schema.length == 1 && schema[0] instanceof TemplateIfBinding) {\n value = values[0];\n }\n else {\n value = values.reduce(arrayValueReducer, '');\n }\n if (isFalsy(value)) {\n updater.remove();\n }\n else {\n updater.set(value);\n }\n}\n/**\n * Returns an object consisting of `set` and `remove` functions, which\n * can be used in the context of DOM Node to set or reset `textContent`.\n * @see module:ui/view~View#_bindToObservable\n *\n * @param node DOM Node to be modified.\n */\nfunction getTextUpdater(node) {\n return {\n set(value) {\n node.textContent = value;\n },\n remove() {\n node.textContent = '';\n }\n };\n}\n/**\n * Returns an object consisting of `set` and `remove` functions, which\n * can be used in the context of DOM Node to set or reset an attribute.\n * @see module:ui/view~View#_bindToObservable\n *\n * @param el DOM Node to be modified.\n * @param attrName Name of the attribute to be modified.\n * @param ns Namespace to use.\n */\nfunction getAttributeUpdater(el, attrName, ns) {\n return {\n set(value) {\n el.setAttributeNS(ns, attrName, value);\n },\n remove() {\n el.removeAttributeNS(ns, attrName);\n }\n };\n}\n/**\n * Returns an object consisting of `set` and `remove` functions, which\n * can be used in the context of CSSStyleDeclaration to set or remove a style.\n * @see module:ui/view~View#_bindToObservable\n *\n * @param el DOM Node to be modified.\n * @param styleName Name of the style to be modified.\n */\nfunction getStyleUpdater(el, styleName) {\n return {\n set(value) {\n el.style[styleName] = value;\n },\n remove() {\n el.style[styleName] = null;\n }\n };\n}\n/**\n * Clones definition of the template.\n */\nfunction clone(def) {\n const clone = cloneDeepWith(def, value => {\n // Don't clone the `Template.bind`* bindings because of the references to Observable\n // and DomEmitterMixin instances inside, which would also be traversed and cloned by greedy\n // cloneDeepWith algorithm. There's no point in cloning Observable/DomEmitterMixins\n // along with the definition.\n //\n // Don't clone Template instances if provided as a child. They're simply #render()ed\n // and nothing should interfere.\n //\n // Also don't clone View instances if provided as a child of the Template. The template\n // instance will be extracted from the View during the normalization and there's no need\n // to clone it.\n if (value && (value instanceof TemplateBinding || isTemplate(value) || isView(value) || isViewCollection(value))) {\n return value;\n }\n });\n return clone;\n}\n/**\n * Normalizes given {@link module:ui/template~TemplateDefinition}.\n *\n * See:\n * * {@link normalizeAttributes}\n * * {@link normalizeListeners}\n * * {@link normalizePlainTextDefinition}\n * * {@link normalizeTextDefinition}\n *\n * @param def A template definition.\n * @returns Normalized definition.\n */\nfunction normalize(def) {\n if (typeof def == 'string') {\n def = normalizePlainTextDefinition(def);\n }\n else if (def.text) {\n normalizeTextDefinition(def);\n }\n if (def.on) {\n def.eventListeners = normalizeListeners(def.on);\n // Template mixes EmitterMixin, so delete #on to avoid collision.\n delete def.on;\n }\n if (!def.text) {\n if (def.attributes) {\n normalizeAttributes(def.attributes);\n }\n const children = [];\n if (def.children) {\n if (isViewCollection(def.children)) {\n children.push(def.children);\n }\n else {\n for (const child of def.children) {\n if (isTemplate(child) || isView(child) || isNode(child)) {\n children.push(child);\n }\n else {\n children.push(new Template(child));\n }\n }\n }\n }\n def.children = children;\n }\n return def;\n}\n/**\n * Normalizes \"attributes\" section of {@link module:ui/template~TemplateDefinition}.\n *\n * ```\n * attributes: {\n * \ta: 'bar',\n * \tb: {@link module:ui/template~TemplateBinding},\n * \tc: {\n * \t\tvalue: 'bar'\n * \t}\n * }\n * ```\n *\n * becomes\n *\n * ```\n * attributes: {\n * \ta: [ 'bar' ],\n * \tb: [ {@link module:ui/template~TemplateBinding} ],\n * \tc: {\n * \t\tvalue: [ 'bar' ]\n * \t}\n * }\n * ```\n */\nfunction normalizeAttributes(attributes) {\n for (const a in attributes) {\n if (attributes[a].value) {\n attributes[a].value = toArray(attributes[a].value);\n }\n arrayify(attributes, a);\n }\n}\n/**\n * Normalizes \"on\" section of {@link module:ui/template~TemplateDefinition}.\n *\n * ```\n * on: {\n * \ta: 'bar',\n * \tb: {@link module:ui/template~TemplateBinding},\n * \tc: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]\n * }\n * ```\n *\n * becomes\n *\n * ```\n * on: {\n * \ta: [ 'bar' ],\n * \tb: [ {@link module:ui/template~TemplateBinding} ],\n * \tc: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]\n * }\n * ```\n *\n * @returns Object containing normalized listeners.\n */\nfunction normalizeListeners(listeners) {\n for (const l in listeners) {\n arrayify(listeners, l);\n }\n return listeners;\n}\n/**\n * Normalizes \"string\" {@link module:ui/template~TemplateDefinition}.\n *\n * ```\n * \"foo\"\n * ```\n *\n * becomes\n *\n * ```\n * { text: [ 'foo' ] },\n * ```\n *\n * @returns Normalized template definition.\n */\nfunction normalizePlainTextDefinition(def) {\n return {\n text: [def]\n };\n}\n/**\n * Normalizes text {@link module:ui/template~TemplateDefinition}.\n *\n * ```\n * children: [\n * \t{ text: 'def' },\n * \t{ text: {@link module:ui/template~TemplateBinding} }\n * ]\n * ```\n *\n * becomes\n *\n * ```\n * children: [\n * \t{ text: [ 'def' ] },\n * \t{ text: [ {@link module:ui/template~TemplateBinding} ] }\n * ]\n * ```\n */\nfunction normalizeTextDefinition(def) {\n def.text = toArray(def.text);\n}\n/**\n * Wraps an entry in Object in an Array, if not already one.\n *\n * ```\n * {\n * \tx: 'y',\n * \ta: [ 'b' ]\n * }\n * ```\n *\n * becomes\n *\n * ```\n * {\n * \tx: [ 'y' ],\n * \ta: [ 'b' ]\n * }\n * ```\n */\nfunction arrayify(obj, key) {\n obj[key] = toArray(obj[key]);\n}\n/**\n * A helper which concatenates the value avoiding unwanted\n * leading white spaces.\n */\nfunction arrayValueReducer(prev, cur) {\n if (isFalsy(cur)) {\n return prev;\n }\n else if (isFalsy(prev)) {\n return cur;\n }\n else {\n return `${prev} ${cur}`;\n }\n}\n/**\n * Extends one object defined in the following format:\n *\n * ```\n * {\n * \tkey1: [Array1],\n * \tkey2: [Array2],\n * \t...\n * \tkeyN: [ArrayN]\n * }\n * ```\n *\n * with another object of the same data format.\n *\n * @param obj Base object.\n * @param ext Object extending base.\n */\nfunction extendObjectValueArray(obj, ext) {\n for (const a in ext) {\n if (obj[a]) {\n obj[a].push(...ext[a]);\n }\n else {\n obj[a] = ext[a];\n }\n }\n}\n/**\n * A helper for {@link module:ui/template~Template#extend}. Recursively extends {@link module:ui/template~Template} instance\n * with content from {@link module:ui/template~TemplateDefinition}. See {@link module:ui/template~Template#extend} to learn more.\n *\n * @param def A template instance to be extended.\n * @param def A definition which is to extend the template instance.\n * @param Error context.\n */\nfunction extendTemplate(template, def) {\n if (def.attributes) {\n if (!template.attributes) {\n template.attributes = {};\n }\n extendObjectValueArray(template.attributes, def.attributes);\n }\n if (def.eventListeners) {\n if (!template.eventListeners) {\n template.eventListeners = {};\n }\n extendObjectValueArray(template.eventListeners, def.eventListeners);\n }\n if (def.text) {\n template.text.push(...def.text);\n }\n if (def.children && def.children.length) {\n if (template.children.length != def.children.length) {\n /**\n * The number of children in extended definition does not match.\n *\n * @error ui-template-extend-children-mismatch\n */\n throw new CKEditorError('ui-template-extend-children-mismatch', template);\n }\n let childIndex = 0;\n for (const childDef of def.children) {\n extendTemplate(template.children[childIndex++], childDef);\n }\n }\n}\n/**\n * Checks if value is \"falsy\".\n * Note: 0 (Number) is not \"falsy\" in this context.\n *\n * @param value Value to be checked.\n */\nfunction isFalsy(value) {\n return !value && value !== 0;\n}\n/**\n * Checks if the item is an instance of {@link module:ui/view~View}\n *\n * @param value Value to be checked.\n */\nfunction isView(item) {\n return item instanceof View;\n}\n/**\n * Checks if the item is an instance of {@link module:ui/template~Template}\n *\n * @param value Value to be checked.\n */\nfunction isTemplate(item) {\n return item instanceof Template;\n}\n/**\n * Checks if the item is an instance of {@link module:ui/viewcollection~ViewCollection}\n *\n * @param value Value to be checked.\n */\nfunction isViewCollection(item) {\n return item instanceof ViewCollection;\n}\n/**\n * Checks if value array contains the one with namespace.\n */\nfunction isNamespaced(attrValue) {\n return isObject(attrValue[0]) && attrValue[0].ns;\n}\n/**\n * Creates an empty skeleton for {@link module:ui/template~Template#revert}\n * data.\n */\nfunction getEmptyRevertData() {\n return {\n children: [],\n bindings: [],\n attributes: {}\n };\n}\n/**\n * Checks whether an attribute should be extended when\n * {@link module:ui/template~Template#apply} is called.\n *\n * @param attrName Attribute name to check.\n */\nfunction shouldExtend(attrName) {\n return attrName == 'class' || attrName == 'style';\n}\n","\n import API from \"!../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../css-loader/dist/cjs.js!../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./globals.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../css-loader/dist/cjs.js!../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./globals.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable @typescript-eslint/no-invalid-void-type */\n/**\n * @module ui/view\n */\nimport ViewCollection from './viewcollection.js';\nimport Template from './template.js';\nimport { CKEditorError, Collection, DomEmitterMixin, ObservableMixin, isIterable } from '@ckeditor/ckeditor5-utils';\nimport '../theme/globals/globals.css';\n/**\n * The basic view class, which represents an HTML element created out of a\n * {@link module:ui/view~View#template}. Views are building blocks of the user interface and handle\n * interaction\n *\n * Views {@link module:ui/view~View#registerChild aggregate} children in\n * {@link module:ui/view~View#createCollection collections} and manage the life cycle of DOM\n * listeners e.g. by handling rendering and destruction.\n *\n * See the {@link module:ui/template~TemplateDefinition} syntax to learn more about shaping view\n * elements, attributes and listeners.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tconst bind = this.bindTemplate;\n *\n * \t\t// Views define their interface (state) using observable attributes.\n * \t\tthis.set( 'elementClass', 'bar' );\n *\n * \t\tthis.setTemplate( {\n * \t\t\ttag: 'p',\n *\n * \t\t\t// The element of the view can be defined with its children.\n * \t\t\tchildren: [\n * \t\t\t\t'Hello',\n * \t\t\t\t{\n * \t\t\t\t\ttag: 'b',\n * \t\t\t\t\tchildren: [ 'world!' ]\n * \t\t\t\t}\n * \t\t\t],\n * \t\t\tattributes: {\n * \t\t\t\tclass: [\n * \t\t\t\t\t'foo',\n *\n * \t\t\t\t\t// Observable attributes control the state of the view in DOM.\n * \t\t\t\t\tbind.to( 'elementClass' )\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\ton: {\n * \t\t\t\t// Views listen to DOM events and propagate them.\n * \t\t\t\tclick: bind.to( 'clicked' )\n * \t\t\t}\n * \t\t} );\n * \t}\n * }\n *\n * const view = new SampleView( locale );\n *\n * view.render();\n *\n * // Append <p class=\"foo bar\">Hello<b>world</b></p> to the <body>\n * document.body.appendChild( view.element );\n *\n * // Change the class attribute to <p class=\"foo baz\">Hello<b>world</b></p>\n * view.elementClass = 'baz';\n *\n * // Respond to the \"click\" event in DOM by executing a custom action.\n * view.on( 'clicked', () => {\n * \tconsole.log( 'The view has been clicked!' );\n * } );\n * ```\n */\nexport default class View extends /* #__PURE__ */ DomEmitterMixin(/* #__PURE__ */ ObservableMixin()) {\n /**\n * Creates an instance of the {@link module:ui/view~View} class.\n *\n * Also see {@link #render}.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super();\n this.element = null;\n this.isRendered = false;\n this.locale = locale;\n this.t = locale && locale.t;\n this._viewCollections = new Collection();\n this._unboundChildren = this.createCollection();\n // Pass parent locale to its children.\n this._viewCollections.on('add', (evt, collection) => {\n collection.locale = locale;\n collection.t = locale && locale.t;\n });\n this.decorate('render');\n }\n /**\n * Shorthand for {@link module:ui/template~Template.bind}, a binding\n * {@link module:ui/template~BindChain interface} pre–configured for the view instance.\n *\n * It provides {@link module:ui/template~BindChain#to `to()`} and\n * {@link module:ui/template~BindChain#if `if()`} methods that initialize bindings with\n * observable attributes and attach DOM listeners.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tconst bind = this.bindTemplate;\n *\n * \t\t// These {@link module:utils/observablemixin~Observable observable} attributes will control\n * \t\t// the state of the view in DOM.\n * \t\tthis.set( {\n * \t\t\telementClass: 'foo',\n * \t\t \tisEnabled: true\n * \t\t } );\n *\n * \t\tthis.setTemplate( {\n * \t\t\ttag: 'p',\n *\n * \t\t\tattributes: {\n * \t\t\t\t// The class HTML attribute will follow elementClass\n * \t\t\t\t// and isEnabled view attributes.\n * \t\t\t\tclass: [\n * \t\t\t\t\tbind.to( 'elementClass' )\n * \t\t\t\t\tbind.if( 'isEnabled', 'present-when-enabled' )\n * \t\t\t\t]\n * \t\t\t},\n *\n * \t\t\ton: {\n * \t\t\t\t// The view will fire the \"clicked\" event upon clicking <p> in DOM.\n * \t\t\t\tclick: bind.to( 'clicked' )\n * \t\t\t}\n * \t\t} );\n * \t}\n * }\n * ```\n */\n get bindTemplate() {\n if (this._bindTemplate) {\n return this._bindTemplate;\n }\n return (this._bindTemplate = Template.bind(this, this));\n }\n /**\n * Creates a new collection of views, which can be used as\n * {@link module:ui/template~Template#children} of this view.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tconst child = new ChildView( locale );\n * \t\tthis.items = this.createCollection( [ child ] );\n *\n * \t\tthis.setTemplate( {\n * \t\t\ttag: 'p',\n *\n * \t\t\t// `items` collection will render here.\n * \t\t\tchildren: this.items\n * \t\t} );\n * \t}\n * }\n *\n * const view = new SampleView( locale );\n * view.render();\n *\n * // It will append <p><child#element></p> to the <body>.\n * document.body.appendChild( view.element );\n * ```\n *\n * @param views Initial views of the collection.\n * @returns A new collection of view instances.\n */\n createCollection(views) {\n const collection = new ViewCollection(views);\n this._viewCollections.add(collection);\n return collection;\n }\n /**\n * Registers a new child view under the view instance. Once registered, a child\n * view is managed by its parent, including {@link #render rendering}\n * and {@link #destroy destruction}.\n *\n * To revert this, use {@link #deregisterChild}.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tthis.childA = new SomeChildView( locale );\n * \t\tthis.childB = new SomeChildView( locale );\n *\n * \t\tthis.setTemplate( { tag: 'p' } );\n *\n * \t\t// Register the children.\n * \t\tthis.registerChild( [ this.childA, this.childB ] );\n * \t}\n *\n * \trender() {\n * \t\tsuper.render();\n *\n * \t\tthis.element.appendChild( this.childA.element );\n * \t\tthis.element.appendChild( this.childB.element );\n * \t}\n * }\n *\n * const view = new SampleView( locale );\n *\n * view.render();\n *\n * // Will append <p><childA#element><b></b><childB#element></p>.\n * document.body.appendChild( view.element );\n * ```\n *\n * **Note**: There's no need to add child views if they're already referenced in the\n * {@link #template}:\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tthis.childA = new SomeChildView( locale );\n * \t\tthis.childB = new SomeChildView( locale );\n *\n * \t\tthis.setTemplate( {\n * \t\t\ttag: 'p',\n *\n * \t\t\t// These children will be added automatically. There's no\n * \t\t\t// need to call {@link #registerChild} for any of them.\n * \t\t\tchildren: [ this.childA, this.childB ]\n * \t\t} );\n * \t}\n *\n * \t// ...\n * }\n * ```\n *\n * @param children Children views to be registered.\n */\n registerChild(children) {\n if (!isIterable(children)) {\n children = [children];\n }\n for (const child of children) {\n this._unboundChildren.add(child);\n }\n }\n /**\n * The opposite of {@link #registerChild}. Removes a child view from this view instance.\n * Once removed, the child is no longer managed by its parent, e.g. it can safely\n * become a child of another parent view.\n *\n * @see #registerChild\n * @param children Child views to be removed.\n */\n deregisterChild(children) {\n if (!isIterable(children)) {\n children = [children];\n }\n for (const child of children) {\n this._unboundChildren.remove(child);\n }\n }\n /**\n * Sets the {@link #template} of the view with with given definition.\n *\n * A shorthand for:\n *\n * ```ts\n * view.setTemplate( definition );\n * ```\n *\n * @param definition Definition of view's template.\n */\n setTemplate(definition) {\n this.template = new Template(definition);\n }\n /**\n * {@link module:ui/template~Template.extend Extends} the {@link #template} of the view with\n * with given definition.\n *\n * A shorthand for:\n *\n * ```ts\n * Template.extend( view.template, definition );\n * ```\n *\n * **Note**: Is requires the {@link #template} to be already set. See {@link #setTemplate}.\n *\n * @param definition Definition which extends the {@link #template}.\n */\n extendTemplate(definition) {\n Template.extend(this.template, definition);\n }\n /**\n * Recursively renders the view.\n *\n * Once the view is rendered:\n * * the {@link #element} becomes an HTML element out of {@link #template},\n * * the {@link #isRendered} flag is set `true`.\n *\n * **Note**: The children of the view:\n * * defined directly in the {@link #template}\n * * residing in collections created by the {@link #createCollection} method,\n * * and added by {@link #registerChild}\n * are also rendered in the process.\n *\n * In general, `render()` method is the right place to keep the code which refers to the\n * {@link #element} and should be executed at the very beginning of the view's life cycle.\n *\n * It is possible to {@link module:ui/template~Template.extend} the {@link #template} before\n * the view is rendered. To allow an early customization of the view (e.g. by its parent),\n * such references should be done in `render()`.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor() {\n * \t\tthis.setTemplate( {\n * \t\t\t// ...\n * \t\t} );\n * \t},\n *\n * \trender() {\n * \t\t// View#element becomes available.\n * \t\tsuper.render();\n *\n * \t\t// The \"scroll\" listener depends on #element.\n * \t\tthis.listenTo( window, 'scroll', () => {\n * \t\t\t// A reference to #element would render the #template and make it non-extendable.\n * \t\t\tif ( window.scrollY > 0 ) {\n * \t\t\t\tthis.element.scrollLeft = 100;\n * \t\t\t} else {\n * \t\t\t\tthis.element.scrollLeft = 0;\n * \t\t\t}\n * \t\t} );\n * \t}\n * }\n *\n * const view = new SampleView();\n *\n * // Let's customize the view before it gets rendered.\n * view.extendTemplate( {\n * \tattributes: {\n * \t\tclass: [\n * \t\t\t'additional-class'\n * \t\t]\n * \t}\n * } );\n *\n * // Late rendering allows customization of the view.\n * view.render();\n * ```\n */\n render() {\n if (this.isRendered) {\n /**\n * This View has already been rendered.\n *\n * @error ui-view-render-already-rendered\n */\n throw new CKEditorError('ui-view-render-already-rendered', this);\n }\n // Render #element of the view.\n if (this.template) {\n this.element = this.template.render();\n // Auto–register view children from #template.\n this.registerChild(this.template.getViews());\n }\n this.isRendered = true;\n }\n /**\n * Recursively destroys the view instance and child views added by {@link #registerChild} and\n * residing in collections created by the {@link #createCollection}.\n *\n * Destruction disables all event listeners:\n * * created on the view, e.g. `view.on( 'event', () => {} )`,\n * * defined in the {@link #template} for DOM events.\n */\n destroy() {\n this.stopListening();\n this._viewCollections.map(c => c.destroy());\n // Template isn't obligatory for views.\n if (this.template && this.template._revertData) {\n this.template.revert(this.element);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* global document */\n/**\n * Handles clicking **outside** of a specified set of elements, then fires an action.\n *\n * **Note**: Actually, the action is executed upon `mousedown`, not `click`. It prevents\n * certain issues when the user keeps holding the mouse button and the UI cannot react\n * properly.\n *\n * @param options Configuration options.\n * @param options.emitter The emitter to which this behavior should be added.\n * @param options.activator Function returning a `Boolean`, to determine whether the handler is active.\n * @param options.contextElements Array of HTML elements or a callback returning an array of HTML elements\n * that determine the scope of the handler. Clicking any of them or their descendants will **not** fire the callback.\n * @param options.callback An action executed by the handler.\n */\nexport default function clickOutsideHandler({ emitter, activator, callback, contextElements }) {\n emitter.listenTo(document, 'mousedown', (evt, domEvt) => {\n if (!activator()) {\n return;\n }\n // Check if `composedPath` is `undefined` in case the browser does not support native shadow DOM.\n // Can be removed when all supported browsers support native shadow DOM.\n const path = typeof domEvt.composedPath == 'function' ? domEvt.composedPath() : [];\n const contextElementsList = typeof contextElements == 'function' ? contextElements() : contextElements;\n for (const contextElement of contextElementsList) {\n if (contextElement.contains(domEvt.target) || path.includes(contextElement)) {\n return;\n }\n }\n callback();\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A mixin that brings the possibility to temporarily disable CSS transitions using\n * {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen\n * when the view is first displayed but they should work normal in other cases.\n *\n * The methods to control the CSS transitions are:\n * * `disableCssTransitions()` – Adds the `.ck-transitions-disabled` class to the\n * {@link module:ui/view~View#element view element}.\n * * `enableCssTransitions()` – Removes the `.ck-transitions-disabled` class from the\n * {@link module:ui/view~View#element view element}.\n *\n * The usage comes down to:\n *\n * ```ts\n * const MyViewWithCssTransitionDisabler = CssTransitionDisablerMixin( MyView );\n * const view = new MyViewWithCssTransitionDisabler();\n *\n * // ...\n *\n * view.disableCssTransitions();\n * view.show();\n * view.enableCssTransitions();\n * ```\n *\n * @param view View instance that should get this functionality.\n */\nexport default function CssTransitionDisablerMixin(view) {\n class Mixin extends view {\n disableCssTransitions() {\n this._isCssTransitionsDisabled = true;\n }\n enableCssTransitions() {\n this._isCssTransitionsDisabled = false;\n }\n constructor(...args) {\n super(...args);\n this.set('_isCssTransitionsDisabled', false);\n this.initializeCssTransitionDisablerMixin();\n }\n initializeCssTransitionDisablerMixin() {\n this.extendTemplate({\n attributes: {\n class: [\n this.bindTemplate.if('_isCssTransitionsDisabled', 'ck-transitions-disabled')\n ]\n }\n });\n }\n }\n return Mixin;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A handler useful for {@link module:ui/view~View views} working as HTML forms. It intercepts a native DOM\n * `submit` event, prevents the default web browser behavior (navigation and page reload) and\n * fires the `submit` event on a view instead. Such a custom event can be then used by any\n * {@link module:utils/dom/emittermixin~DomEmitter emitter}, e.g. to serialize the form data.\n *\n * ```ts\n * import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler';\n *\n * // ...\n *\n * class AnyFormView extends View {\n * \tconstructor() {\n * \t\tsuper();\n *\n * \t\t// ...\n *\n * \t\tsubmitHandler( {\n * \t\t\tview: this\n * \t\t} );\n * \t}\n * }\n *\n * // ...\n *\n * const view = new AnyFormView();\n *\n * // A sample listener attached by an emitter working with the view.\n * this.listenTo( view, 'submit', () => {\n * \tsaveTheFormData();\n * \thideTheForm();\n * } );\n * ```\n *\n * @param options Configuration options.\n * @param options.view The view which DOM `submit` events should be handled.\n */\nexport default function submitHandler({ view }) {\n view.listenTo(view.element, 'submit', (evt, domEvt) => {\n domEvt.preventDefault();\n view.fire('submit');\n }, { useCapture: true });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A helper that adds a keyboard navigation support (arrow up/down/left/right) for grids.\n *\n * @param options Configuration options.\n * @param options.keystrokeHandler Keystroke handler to register navigation with arrow keys.\n * @param options.focusTracker A focus tracker for grid elements.\n * @param options.gridItems A collection of grid items.\n * @param options.numberOfColumns Number of columns in the grid. Can be specified as a function that returns\n * the number (e.g. for responsive grids).\n * @param options.uiLanguageDirection String of ui language direction.\n */\nexport default function addKeyboardHandlingForGrid({ keystrokeHandler, focusTracker, gridItems, numberOfColumns, uiLanguageDirection }) {\n const getNumberOfColumns = typeof numberOfColumns === 'number' ? () => numberOfColumns : numberOfColumns;\n keystrokeHandler.set('arrowright', getGridItemFocuser((focusedElementIndex, gridItems) => {\n return uiLanguageDirection === 'rtl' ?\n getLeftElementIndex(focusedElementIndex, gridItems.length) :\n getRightElementIndex(focusedElementIndex, gridItems.length);\n }));\n keystrokeHandler.set('arrowleft', getGridItemFocuser((focusedElementIndex, gridItems) => {\n return uiLanguageDirection === 'rtl' ?\n getRightElementIndex(focusedElementIndex, gridItems.length) :\n getLeftElementIndex(focusedElementIndex, gridItems.length);\n }));\n keystrokeHandler.set('arrowup', getGridItemFocuser((focusedElementIndex, gridItems) => {\n let nextIndex = focusedElementIndex - getNumberOfColumns();\n if (nextIndex < 0) {\n nextIndex = focusedElementIndex + getNumberOfColumns() * Math.floor(gridItems.length / getNumberOfColumns());\n if (nextIndex > gridItems.length - 1) {\n nextIndex -= getNumberOfColumns();\n }\n }\n return nextIndex;\n }));\n keystrokeHandler.set('arrowdown', getGridItemFocuser((focusedElementIndex, gridItems) => {\n let nextIndex = focusedElementIndex + getNumberOfColumns();\n if (nextIndex > gridItems.length - 1) {\n nextIndex = focusedElementIndex % getNumberOfColumns();\n }\n return nextIndex;\n }));\n function getGridItemFocuser(getIndexToFocus) {\n return (evt) => {\n const focusedElement = gridItems.find(item => item.element === focusTracker.focusedElement);\n const focusedElementIndex = gridItems.getIndex(focusedElement);\n const nextIndexToFocus = getIndexToFocus(focusedElementIndex, gridItems);\n gridItems.get(nextIndexToFocus).focus();\n evt.stopPropagation();\n evt.preventDefault();\n };\n }\n /**\n * Function returning the next index.\n *\n * ```\n * before: [ ][x][ ]\tafter: [ ][ ][x]\n * index = 1 index = 2\n * ```\n *\n * If current index is last, function returns first index.\n *\n * ```\n * before: [ ][ ][x]\tafter: [x][ ][ ]\n * index = 2 index = 0\n * ```\n *\n * @param elementIndex Number of current index.\n * @param collectionLength A count of collection items.\n */\n function getRightElementIndex(elementIndex, collectionLength) {\n if (elementIndex === collectionLength - 1) {\n return 0;\n }\n else {\n return elementIndex + 1;\n }\n }\n /**\n * Function returning the previous index.\n *\n * ```\n * before: [ ][x][ ]\tafter: [x][ ][ ]\n * index = 1 index = 0\n * ```\n *\n * If current index is first, function returns last index.\n *\n * ```\n * before: [x][ ][ ]\tafter: [ ][ ][x]\n * index = 0 index = 2\n * ```\n *\n * @param elementIndex Number of current index.\n * @param collectionLength A count of collection items.\n */\n function getLeftElementIndex(elementIndex, collectionLength) {\n if (elementIndex === 0) {\n return collectionLength - 1;\n }\n else {\n return elementIndex - 1;\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./icon.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./icon.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* global DOMParser */\n/**\n * @module ui/icon/iconview\n */\nimport View from '../view.js';\nimport '../../theme/components/icon/icon.css';\n/**\n * The icon view class.\n */\nclass IconView extends View {\n /**\n * @inheritDoc\n */\n constructor() {\n super();\n const bind = this.bindTemplate;\n this.set('content', '');\n this.set('viewBox', '0 0 20 20');\n this.set('fillColor', '');\n this.set('isColorInherited', true);\n this.set('isVisible', true);\n this.setTemplate({\n tag: 'svg',\n ns: 'http://www.w3.org/2000/svg',\n attributes: {\n class: [\n 'ck',\n 'ck-icon',\n bind.if('isVisible', 'ck-hidden', value => !value),\n // Exclude icon internals from the CSS reset to allow rich (non-monochromatic) icons\n // (https://github.com/ckeditor/ckeditor5/issues/12599).\n 'ck-reset_all-excluded',\n // The class to remove the dynamic color inheritance is toggleable\n // (https://github.com/ckeditor/ckeditor5/issues/12599).\n bind.if('isColorInherited', 'ck-icon_inherit-color')\n ],\n viewBox: bind.to('viewBox')\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this._updateXMLContent();\n this._colorFillPaths();\n // This is a hack for lack of innerHTML binding.\n // See: https://github.com/ckeditor/ckeditor5-ui/issues/99.\n this.on('change:content', () => {\n this._updateXMLContent();\n this._colorFillPaths();\n });\n this.on('change:fillColor', () => {\n this._colorFillPaths();\n });\n }\n /**\n * Updates the {@link #element} with the value of {@link #content}.\n */\n _updateXMLContent() {\n if (this.content) {\n const parsed = new DOMParser().parseFromString(this.content.trim(), 'image/svg+xml');\n const svg = parsed.querySelector('svg');\n const viewBox = svg.getAttribute('viewBox');\n if (viewBox) {\n this.viewBox = viewBox;\n }\n // Preserve presentational attributes of the <svg> element from the source.\n // They can affect rendering of the entire icon (https://github.com/ckeditor/ckeditor5/issues/12597).\n for (const { name, value } of Array.from(svg.attributes)) {\n if (IconView.presentationalAttributeNames.includes(name)) {\n this.element.setAttribute(name, value);\n }\n }\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n while (svg.childNodes.length > 0) {\n this.element.appendChild(svg.childNodes[0]);\n }\n }\n }\n /**\n * Fills all child `path.ck-icon__fill` with the `#fillColor`.\n */\n _colorFillPaths() {\n if (this.fillColor) {\n this.element.querySelectorAll('.ck-icon__fill').forEach(path => {\n path.style.fill = this.fillColor;\n });\n }\n }\n}\n/**\n * A list of presentational attributes that can be set on the `<svg>` element and should be preserved\n * when the icon {@link module:ui/icon/iconview~IconView#content content} is loaded.\n *\n * See the [specification](https://www.w3.org/TR/SVG/styling.html#TermPresentationAttribute) to learn more.\n */\nIconView.presentationalAttributeNames = [\n 'alignment-baseline', 'baseline-shift', 'clip-path', 'clip-rule', 'color', 'color-interpolation',\n 'color-interpolation-filters', 'color-rendering', 'cursor', 'direction', 'display', 'dominant-baseline', 'fill', 'fill-opacity',\n 'fill-rule', 'filter', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style',\n 'font-variant', 'font-weight', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start',\n 'mask', 'opacity', 'overflow', 'paint-order', 'pointer-events', 'shape-rendering', 'stop-color', 'stop-opacity', 'stroke',\n 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width',\n 'text-anchor', 'text-decoration', 'text-overflow', 'text-rendering', 'transform', 'unicode-bidi', 'vector-effect',\n 'visibility', 'white-space', 'word-spacing', 'writing-mode'\n];\nexport default IconView;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/button/buttonlabelview\n */\nimport View from '../view.js';\n/**\n * A default implementation of the button view's label. It comes with a dynamic text support\n * via {@link module:ui/button/buttonlabelview~ButtonLabelView#text} property.\n */\nexport default class ButtonLabelView extends View {\n /**\n * @inheritDoc\n */\n constructor() {\n super();\n this.set({\n style: undefined,\n text: undefined,\n id: undefined\n });\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-button__label'\n ],\n style: bind.to('style'),\n id: bind.to('id')\n },\n children: [\n {\n text: bind.to('text')\n }\n ]\n });\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./button.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./button.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/button/buttonview\n */\nimport View from '../view.js';\nimport IconView from '../icon/iconview.js';\nimport ButtonLabelView from './buttonlabelview.js';\nimport { env, getEnvKeystrokeText, uid, delay } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/button/button.css';\n/**\n * The button view class.\n *\n * ```ts\n * const view = new ButtonView();\n *\n * view.set( {\n * \tlabel: 'A button',\n * \tkeystroke: 'Ctrl+B',\n * \ttooltip: true,\n * \twithText: true\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n */\nexport default class ButtonView extends View {\n /**\n * Creates an instance of the button view class.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param labelView The instance of the button's label. If not provided, an instance of\n * {@link module:ui/button/buttonlabelview~ButtonLabelView} is used.\n */\n constructor(locale, labelView = new ButtonLabelView()) {\n super(locale);\n /**\n * Delayed focus function for focus handling in Safari.\n */\n this._focusDelayed = null;\n const bind = this.bindTemplate;\n const ariaLabelUid = uid();\n // Implement the Button interface.\n this.set('_ariaPressed', false);\n this.set('_ariaChecked', false);\n this.set('ariaLabel', undefined);\n this.set('ariaLabelledBy', `ck-editor__aria-label_${ariaLabelUid}`);\n this.set('class', undefined);\n this.set('labelStyle', undefined);\n this.set('icon', undefined);\n this.set('isEnabled', true);\n this.set('isOn', false);\n this.set('isVisible', true);\n this.set('isToggleable', false);\n this.set('keystroke', undefined);\n this.set('label', undefined);\n this.set('role', undefined);\n this.set('tabindex', -1);\n this.set('tooltip', false);\n this.set('tooltipPosition', 's');\n this.set('type', 'button');\n this.set('withText', false);\n this.set('withKeystroke', false);\n this.children = this.createCollection();\n this.labelView = this._setupLabelView(labelView);\n this.iconView = new IconView();\n this.iconView.extendTemplate({\n attributes: {\n class: 'ck-button__icon'\n }\n });\n this.keystrokeView = this._createKeystrokeView();\n this.bind('_tooltipString').to(this, 'tooltip', this, 'label', this, 'keystroke', this._getTooltipString.bind(this));\n const template = {\n tag: 'button',\n attributes: {\n class: [\n 'ck',\n 'ck-button',\n bind.to('class'),\n bind.if('isEnabled', 'ck-disabled', value => !value),\n bind.if('isVisible', 'ck-hidden', value => !value),\n bind.to('isOn', value => value ? 'ck-on' : 'ck-off'),\n bind.if('withText', 'ck-button_with-text'),\n bind.if('withKeystroke', 'ck-button_with-keystroke')\n ],\n role: bind.to('role'),\n type: bind.to('type', value => value ? value : 'button'),\n tabindex: bind.to('tabindex'),\n 'aria-checked': bind.to('_ariaChecked'),\n 'aria-pressed': bind.to('_ariaPressed'),\n 'aria-label': bind.to('ariaLabel'),\n 'aria-labelledby': bind.to('ariaLabelledBy'),\n 'aria-disabled': bind.if('isEnabled', true, value => !value),\n 'data-cke-tooltip-text': bind.to('_tooltipString'),\n 'data-cke-tooltip-position': bind.to('tooltipPosition')\n },\n children: this.children,\n on: {\n click: bind.to(evt => {\n // We can't make the button disabled using the disabled attribute, because it won't be focusable.\n // Though, shouldn't this condition be moved to the button controller?\n if (this.isEnabled) {\n this.fire('execute');\n }\n else {\n // Prevent the default when button is disabled, to block e.g.\n // automatic form submitting. See ckeditor/ckeditor5-link#74.\n evt.preventDefault();\n }\n })\n }\n };\n this.bind('_ariaPressed').to(this, 'isOn', this, 'isToggleable', this, 'role', (isOn, isToggleable, role) => {\n if (!isToggleable || isCheckableRole(role)) {\n return false;\n }\n return String(!!isOn);\n });\n this.bind('_ariaChecked').to(this, 'isOn', this, 'isToggleable', this, 'role', (isOn, isToggleable, role) => {\n if (!isToggleable || !isCheckableRole(role)) {\n return false;\n }\n return String(!!isOn);\n });\n // On Safari we have to force the focus on a button on click as it's the only browser\n // that doesn't do that automatically. See #12115.\n if (env.isSafari) {\n if (!this._focusDelayed) {\n this._focusDelayed = delay(() => this.focus(), 0);\n }\n template.on.mousedown = bind.to(() => {\n this._focusDelayed();\n });\n template.on.mouseup = bind.to(() => {\n this._focusDelayed.cancel();\n });\n }\n this.setTemplate(template);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n if (this.icon) {\n this.iconView.bind('content').to(this, 'icon');\n this.children.add(this.iconView);\n }\n this.children.add(this.labelView);\n if (this.withKeystroke && this.keystroke) {\n this.children.add(this.keystrokeView);\n }\n }\n /**\n * Focuses the {@link #element} of the button.\n */\n focus() {\n this.element.focus();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._focusDelayed) {\n this._focusDelayed.cancel();\n }\n super.destroy();\n }\n /**\n * Binds the label view instance it with button attributes.\n */\n _setupLabelView(labelView) {\n labelView.bind('text', 'style', 'id').to(this, 'label', 'labelStyle', 'ariaLabelledBy');\n return labelView;\n }\n /**\n * Creates a view that displays a keystroke next to a {@link #labelView label }\n * and binds it with button attributes.\n */\n _createKeystrokeView() {\n const keystrokeView = new View();\n keystrokeView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-button__keystroke'\n ]\n },\n children: [\n {\n text: this.bindTemplate.to('keystroke', text => getEnvKeystrokeText(text))\n }\n ]\n });\n return keystrokeView;\n }\n /**\n * Gets the text for the tooltip from the combination of\n * {@link #tooltip}, {@link #label} and {@link #keystroke} attributes.\n *\n * @see #tooltip\n * @see #_tooltipString\n * @param tooltip Button tooltip.\n * @param label Button label.\n * @param keystroke Button keystroke.\n */\n _getTooltipString(tooltip, label, keystroke) {\n if (tooltip) {\n if (typeof tooltip == 'string') {\n return tooltip;\n }\n else {\n if (keystroke) {\n keystroke = getEnvKeystrokeText(keystroke);\n }\n if (tooltip instanceof Function) {\n return tooltip(label, keystroke);\n }\n else {\n return `${label}${keystroke ? ` (${keystroke})` : ''}`;\n }\n }\n }\n return '';\n }\n}\n/**\n * Checks if `aria-checkbox` can be used with specified role.\n */\nfunction isCheckableRole(role) {\n switch (role) {\n case 'radio':\n case 'checkbox':\n case 'option':\n case 'switch':\n case 'menuitemcheckbox':\n case 'menuitemradio':\n return true;\n default:\n return false;\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./formheader.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./formheader.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/formheader/formheaderview\n */\nimport View from '../view.js';\nimport IconView from '../icon/iconview.js';\nimport '../../theme/components/formheader/formheader.css';\n/**\n * The class component representing a form header view. It should be used in more advanced forms to\n * describe the main purpose of the form.\n *\n * By default the component contains a bolded label view that has to be set. The label is usually a short (at most 3-word) string.\n * The component can also be extended by any other elements, like: icons, dropdowns, etc.\n *\n * It is used i.a.\n * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}.\n *\n * The latter is an example, where the component has been extended by {@link module:ui/dropdown/dropdownview~DropdownView} view.\n */\nexport default class FormHeaderView extends View {\n /**\n * Creates an instance of the form header class.\n *\n * @param locale The locale instance.\n * @param options.label A label.\n * @param options.class An additional class.\n */\n constructor(locale, options = {}) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('label', options.label || '');\n this.set('class', options.class || null);\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-form__header',\n bind.to('class')\n ]\n },\n children: this.children\n });\n if (options.icon) {\n this.iconView = new IconView();\n this.iconView.content = options.icon;\n this.children.add(this.iconView);\n }\n const label = new View(locale);\n label.setTemplate({\n tag: 'h2',\n attributes: {\n class: [\n 'ck',\n 'ck-form__header__label'\n ],\n role: 'presentation'\n },\n children: [\n { text: bind.to('label') }\n ]\n });\n this.children.add(label);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/focuscycler\n */\nimport { isVisible, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * A utility class that helps cycling over {@link module:ui/focuscycler~FocusableView focusable views} in a\n * {@link module:ui/viewcollection~ViewCollection} when the focus is tracked by the\n * {@link module:utils/focustracker~FocusTracker} instance. It helps implementing keyboard\n * navigation in HTML forms, toolbars, lists and the like.\n *\n * To work properly it requires:\n * * a collection of focusable (HTML `tabindex` attribute) views that implement the `focus()` method,\n * * an associated focus tracker to determine which view is focused.\n *\n * A simple cycler setup can look like this:\n *\n * ```ts\n * const focusables = new ViewCollection<FocusableView>();\n * const focusTracker = new FocusTracker();\n *\n * // Add focusable views to the focus tracker.\n * focusTracker.add( ... );\n * ```\n *\n * Then, the cycler can be used manually:\n *\n * ```ts\n * const cycler = new FocusCycler( { focusables, focusTracker } );\n *\n * // Will focus the first focusable view in #focusables.\n * cycler.focusFirst();\n *\n * // Will log the next focusable item in #focusables.\n * console.log( cycler.next );\n * ```\n *\n * Alternatively, it can work side by side with the {@link module:utils/keystrokehandler~KeystrokeHandler}:\n *\n * ```ts\n * const keystrokeHandler = new KeystrokeHandler();\n *\n * // Activate the keystroke handler.\n * keystrokeHandler.listenTo( sourceOfEvents );\n *\n * const cycler = new FocusCycler( {\n * \tfocusables, focusTracker, keystrokeHandler,\n * \tactions: {\n * \t\t// When arrowup of arrowleft is detected by the #keystrokeHandler,\n * \t\t// focusPrevious() will be called on the cycler.\n * \t\tfocusPrevious: [ 'arrowup', 'arrowleft' ],\n * \t}\n * } );\n * ```\n *\n * Check out the {@glink framework/deep-dive/ui/focus-tracking \"Deep dive into focus tracking\"} guide to learn more.\n */\nexport default class FocusCycler extends /* #__PURE__ */ EmitterMixin() {\n /**\n * Creates an instance of the focus cycler utility.\n *\n * @param options Configuration options.\n */\n constructor(options) {\n super();\n this.focusables = options.focusables;\n this.focusTracker = options.focusTracker;\n this.keystrokeHandler = options.keystrokeHandler;\n this.actions = options.actions;\n if (options.actions && options.keystrokeHandler) {\n for (const methodName in options.actions) {\n let actions = options.actions[methodName];\n if (typeof actions == 'string') {\n actions = [actions];\n }\n for (const keystroke of actions) {\n options.keystrokeHandler.set(keystroke, (data, cancel) => {\n this[methodName]();\n cancel();\n }, options.keystrokeHandlerOptions);\n }\n }\n }\n this.on('forwardCycle', () => this.focusFirst(), { priority: 'low' });\n this.on('backwardCycle', () => this.focusLast(), { priority: 'low' });\n }\n /**\n * Returns the first focusable view in {@link #focusables}.\n * Returns `null` if there is none.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n get first() {\n return (this.focusables.find(isDomFocusable) || null);\n }\n /**\n * Returns the last focusable view in {@link #focusables}.\n * Returns `null` if there is none.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n get last() {\n return (this.focusables.filter(isDomFocusable).slice(-1)[0] || null);\n }\n /**\n * Returns the next focusable view in {@link #focusables} based on {@link #current}.\n * Returns `null` if there is none.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n get next() {\n return this._getDomFocusableItem(1);\n }\n /**\n * Returns the previous focusable view in {@link #focusables} based on {@link #current}.\n * Returns `null` if there is none.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n get previous() {\n return this._getDomFocusableItem(-1);\n }\n /**\n * An index of the view in the {@link #focusables} which is focused according\n * to {@link #focusTracker}. Returns `null` when there is no such view.\n */\n get current() {\n let index = null;\n // There's no focused view in the focusables.\n if (this.focusTracker.focusedElement === null) {\n return null;\n }\n this.focusables.find((view, viewIndex) => {\n const focused = view.element === this.focusTracker.focusedElement;\n if (focused) {\n index = viewIndex;\n }\n return focused;\n });\n return index;\n }\n /**\n * Focuses the {@link #first} item in {@link #focusables}.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n focusFirst() {\n this._focus(this.first, 1);\n }\n /**\n * Focuses the {@link #last} item in {@link #focusables}.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n focusLast() {\n this._focus(this.last, -1);\n }\n /**\n * Focuses the {@link #next} item in {@link #focusables}.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n focusNext() {\n const next = this.next;\n // If there's only one focusable item, we need to let the outside world know\n // that the next cycle is about to happen. This may be useful\n // e.g. if you want to move the focus to the parent focus cycler.\n // Note that the focus is not actually moved in this case.\n if (next && this.focusables.getIndex(next) === this.current) {\n this.fire('forwardCycle');\n return;\n }\n if (next === this.first) {\n this.fire('forwardCycle');\n }\n else {\n this._focus(next, 1);\n }\n }\n /**\n * Focuses the {@link #previous} item in {@link #focusables}.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n focusPrevious() {\n const previous = this.previous;\n if (previous && this.focusables.getIndex(previous) === this.current) {\n this.fire('backwardCycle');\n return;\n }\n if (previous === this.last) {\n this.fire('backwardCycle');\n }\n else {\n this._focus(previous, -1);\n }\n }\n /**\n * Allows for creating continuous focus cycling across multiple focus cyclers and their collections of {@link #focusables}.\n *\n * It starts listening to the {@link module:ui/focuscycler~FocusCyclerForwardCycleEvent} and\n * {@link module:ui/focuscycler~FocusCyclerBackwardCycleEvent} events of the chained focus cycler and engages,\n * whenever the user reaches the last (forwards navigation) or first (backwards navigation) focusable view\n * and would normally start over. Instead, the navigation continues on the higher level (flattens).\n *\n * For instance, for the following nested focus navigation structure, the focus would get stuck the moment\n * the AB gets focused and its focus cycler starts managing it:\n *\n *\t ┌────────────┠┌──────────────────────────────────┠┌────────────â”\n *\t │ AA │ │ AB │ │ AC │\n *\t │ │ │ │ │ │\n *\t │ │ │ ┌─────┠┌─────┠┌─────┠│ │ │\n *\t │ │ │ ┌──► ABA ├──► ABB ├──► ABC ├───┠│ │ │\n *\t │ ├───► │ └─────┘ └─────┘ └─────┘ │ │ │ │\n *\t │ │ │ │ │ │ │ │\n *\t │ │ │ │ │ │ │ │\n *\t │ │ │ └──────────────────────────────┘ │ │ │\n *\t │ │ │ │ │ │\n *\t └────────────┘ └──────────────────────────────────┘ └────────────┘\n *\n * Chaining a focus tracker that manages AA, AB, and AC with the focus tracker that manages ABA, ABB, and ABC\n * creates a seamless navigation experience instead:\n *\n *\t ┌────────────┠┌──────────────────────────────────┠┌────────────â”\n *\t │ AA │ │ AB │ │ AC │\n *\t │ │ │ │ │ │\n *\t │ │ │ ┌─────┠┌─────┠┌─────┠│ │ │\n *\t │ │ │ ┌──► ABA ├──► ABB ├──► ABC ├──┠│ │ │\n *\t┌──► ├───┼─┘ └─────┘ └─────┘ └─────┘ └──┼───► ├──â”\n *\t│ │ │ │ │ │ │ │\n *\t│ │ │ │ │ │ │ │\n *\t│ │ │ │ │ │ │ │\n *\t│ │ │ │ │ │ │ │\n *\t│ └────────────┘ └──────────────────────────────────┘ └────────────┘ │\n *\t│ │\n *\t│ │\n *\t└──────────────────────────────────────────────────────────────────────────┘\n *\n * See {@link #unchain} to reverse the chaining.\n */\n chain(chainedFocusCycler) {\n const getCurrentFocusedView = () => {\n // This may happen when one focus cycler does not include focusables of the other (horizontal case).\n if (this.current === null) {\n return null;\n }\n return this.focusables.get(this.current);\n };\n this.listenTo(chainedFocusCycler, 'forwardCycle', evt => {\n const oldCurrent = getCurrentFocusedView();\n this.focusNext();\n // Stop the event propagation only if an attempt at focusing the view actually moved the focus.\n // If not, let the otherFocusCycler handle the event.\n if (oldCurrent !== getCurrentFocusedView()) {\n evt.stop();\n }\n // The priority is critical for cycling across multiple chain levels when there's a single view at some of them only.\n }, { priority: 'low' });\n this.listenTo(chainedFocusCycler, 'backwardCycle', evt => {\n const oldCurrent = getCurrentFocusedView();\n this.focusPrevious();\n // Stop the event propagation only if an attempt at focusing the view actually moved the focus.\n // If not, let the otherFocusCycler handle the event.\n if (oldCurrent !== getCurrentFocusedView()) {\n evt.stop();\n }\n // The priority is critical for cycling across multiple chain levels when there's a single view at some of them only.\n }, { priority: 'low' });\n }\n /**\n * Reverses a chaining made by {@link #chain}.\n */\n unchain(otherFocusCycler) {\n this.stopListening(otherFocusCycler);\n }\n /**\n * Focuses the given view if it exists.\n *\n * @param view The view to be focused\n * @param direction The direction of the focus if the view has focusable children.\n * @returns\n */\n _focus(view, direction) {\n // Don't fire focus events if the view is already focused.\n // Such attempt may occur when cycling with only one focusable item:\n // even though `focusNext()` method returns without changing focus,\n // the `forwardCycle` event is fired, triggering the `focusFirst()` method.\n if (view && this.focusTracker.focusedElement !== view.element) {\n view.focus(direction);\n }\n }\n /**\n * Returns the next or previous focusable view in {@link #focusables} with respect\n * to {@link #current}.\n *\n * @param step Either `1` for checking forward from {@link #current} or `-1` for checking backwards.\n */\n _getDomFocusableItem(step) {\n // Cache for speed.\n const collectionLength = this.focusables.length;\n if (!collectionLength) {\n return null;\n }\n const current = this.current;\n // Start from the beginning if no view is focused.\n // https://github.com/ckeditor/ckeditor5-ui/issues/206\n if (current === null) {\n return this[step === 1 ? 'first' : 'last'];\n }\n // Note: If current is the only focusable view, it will also be returned for the given step.\n let focusableItem = this.focusables.get(current);\n // Cycle in both directions.\n let index = (current + collectionLength + step) % collectionLength;\n do {\n const focusableItemCandidate = this.focusables.get(index);\n if (isDomFocusable(focusableItemCandidate)) {\n focusableItem = focusableItemCandidate;\n break;\n }\n // Cycle in both directions.\n index = (index + collectionLength + step) % collectionLength;\n } while (index !== current);\n return focusableItem;\n }\n}\n/**\n * Checks whether a view can be focused (has `focus()` method and is visible).\n *\n * @param view A view to be checked.\n */\nfunction isDomFocusable(view) {\n return isFocusable(view) && isVisible(view.element);\n}\n/**\n * Checks whether a view is {@link ~FocusableView}.\n *\n * @param view A view to be checked.\n */\nexport function isFocusable(view) {\n return !!('focus' in view && typeof view.focus == 'function');\n}\n/**\n * Checks whether a view is an instance of {@link ~ViewWithFocusCycler}.\n *\n * @param view A view to be checked.\n */\nexport function isViewWithFocusCycler(view) {\n return isFocusable(view) && 'focusCycler' in view && view.focusCycler instanceof FocusCycler;\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./dialogactions.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./dialogactions.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dialog/dialogactionsview\n */\nimport { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\nimport ButtonView from '../button/buttonview.js';\nimport View from '../view.js';\nimport ViewCollection from '../viewcollection.js';\nimport FocusCycler from '../focuscycler.js';\nimport '../../theme/components/dialog/dialogactions.css';\n/**\n * A dialog actions view class. It contains button views which are used to execute dialog actions.\n */\nexport default class DialogActionsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.children = this.createCollection();\n this.keystrokes = new KeystrokeHandler();\n this._focusTracker = new FocusTracker();\n this._focusables = new ViewCollection();\n this.focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this._focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-dialog__actions'\n ]\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.keystrokes.listenTo(this.element);\n }\n /**\n * Creates the button views based on the given definitions.\n * Then adds them to the {@link #children} collection and to the focus cycler.\n */\n setButtons(definitions) {\n for (const definition of definitions) {\n const button = new ButtonView(this.locale);\n let property;\n button.on('execute', () => definition.onExecute());\n if (definition.onCreate) {\n definition.onCreate(button);\n }\n for (property in definition) {\n if (property != 'onExecute' && property != 'onCreate') {\n button.set(property, definition[property]);\n }\n }\n this.children.add(button);\n }\n this._updateFocusCyclableItems();\n }\n /**\n * @inheritDoc\n */\n focus(direction) {\n if (direction === -1) {\n this.focusCycler.focusLast();\n }\n else {\n this.focusCycler.focusFirst();\n }\n }\n /**\n * Adds all elements from the {@link #children} collection to the {@link #_focusables} collection\n * and to the {@link #_focusTracker} instance.\n */\n _updateFocusCyclableItems() {\n Array.from(this.children).forEach(v => {\n this._focusables.add(v);\n this._focusTracker.add(v.element);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dialog/dialogcontentview\n */\nimport View from '../view.js';\n/**\n * A dialog content view class.\n */\nexport default class DialogContentView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck', 'ck-dialog__content']\n },\n children: this.children\n });\n }\n /**\n * Removes all the child views.\n */\n reset() {\n while (this.children.length) {\n this.children.remove(0);\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./dialog.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./dialog.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dialog/dialogview\n */\nimport { KeystrokeHandler, FocusTracker, Rect, global, toUnit } from '@ckeditor/ckeditor5-utils';\nimport { icons } from '@ckeditor/ckeditor5-core';\nimport ViewCollection from '../viewcollection.js';\nimport View from '../view.js';\nimport FormHeaderView from '../formheader/formheaderview.js';\nimport ButtonView from '../button/buttonview.js';\nimport FocusCycler, { isViewWithFocusCycler, isFocusable } from '../focuscycler.js';\nimport DraggableViewMixin from '../bindings/draggableviewmixin.js';\nimport DialogActionsView from './dialogactionsview.js';\nimport DialogContentView from './dialogcontentview.js';\nimport '../../theme/components/dialog/dialog.css';\n// @if CK_DEBUG_DIALOG // const RectDrawer = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' ).default;\n/**\n * Available dialog view positions:\n *\n * * `DialogViewPosition.SCREEN_CENTER` – A fixed position in the center of the screen.\n * * `DialogViewPosition.EDITOR_CENTER` – A dynamic position in the center of the editor editable area.\n * * `DialogViewPosition.EDITOR_TOP_SIDE` – A dynamic position at the top-right (for the left-to-right languages)\n * or top-left (for right-to-left languages) corner of the editor editable area.\n * * `DialogViewPosition.EDITOR_TOP_CENTER` – A dynamic position at the top-center of the editor editable area.\n * * `DialogViewPosition.EDITOR_BOTTOM_CENTER` – A dynamic position at the bottom-center of the editor editable area.\n * * `DialogViewPosition.EDITOR_ABOVE_CENTER` – A dynamic position centered above the editor editable area.\n * * `DialogViewPosition.EDITOR_BELOW_CENTER` – A dynamic position centered below the editor editable area.\n *\n * The position of a dialog is specified by a {@link module:ui/dialog/dialog~DialogDefinition#position `position` property} of a\n * definition passed to the {@link module:ui/dialog/dialog~Dialog#show} method.\n */\nexport const DialogViewPosition = {\n SCREEN_CENTER: 'screen-center',\n EDITOR_CENTER: 'editor-center',\n EDITOR_TOP_SIDE: 'editor-top-side',\n EDITOR_TOP_CENTER: 'editor-top-center',\n EDITOR_BOTTOM_CENTER: 'editor-bottom-center',\n EDITOR_ABOVE_CENTER: 'editor-above-center',\n EDITOR_BELOW_CENTER: 'editor-below-center'\n};\nconst toPx = /* #__PURE__ */ toUnit('px');\n/**\n * A dialog view class.\n */\nclass DialogView extends /* #__PURE__ */ DraggableViewMixin(View) {\n /**\n * @inheritDoc\n */\n constructor(locale, { getCurrentDomRoot, getViewportOffset }) {\n super(locale);\n /**\n * A flag indicating if the dialog was moved manually. If so, its position\n * will not be updated automatically upon window resize or document scroll.\n */\n this.wasMoved = false;\n const bind = this.bindTemplate;\n const t = locale.t;\n this.set('className', '');\n this.set('ariaLabel', t('Editor dialog'));\n this.set('isModal', false);\n this.set('position', DialogViewPosition.SCREEN_CENTER);\n this.set('_isVisible', false);\n this.set('_isTransparent', false);\n this.set('_top', 0);\n this.set('_left', 0);\n this._getCurrentDomRoot = getCurrentDomRoot;\n this._getViewportOffset = getViewportOffset;\n this.decorate('moveTo');\n this.parts = this.createCollection();\n this.keystrokes = new KeystrokeHandler();\n this.focusTracker = new FocusTracker();\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-dialog-overlay',\n bind.if('isModal', 'ck-dialog-overlay__transparent', isModal => !isModal),\n bind.if('_isVisible', 'ck-hidden', value => !value)\n ],\n // Prevent from editor losing focus when clicking on the modal overlay.\n tabindex: '-1'\n },\n children: [\n {\n tag: 'div',\n attributes: {\n tabindex: '-1',\n class: [\n 'ck',\n 'ck-dialog',\n bind.to('className')\n ],\n role: 'dialog',\n 'aria-label': bind.to('ariaLabel'),\n style: {\n top: bind.to('_top', top => toPx(top)),\n left: bind.to('_left', left => toPx(left)),\n visibility: bind.if('_isTransparent', 'hidden')\n }\n },\n children: this.parts\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.keystrokes.set('Esc', (data, cancel) => {\n this.fire('close', { source: 'escKeyPress' });\n cancel();\n });\n // Support for dragging the modal.\n this.on('drag', (evt, { deltaX, deltaY }) => {\n this.wasMoved = true;\n this.moveBy(deltaX, deltaY);\n });\n // Update dialog position upon window resize, if the position was not changed manually.\n this.listenTo(global.window, 'resize', () => {\n if (this._isVisible && !this.wasMoved) {\n this.updatePosition();\n }\n });\n // Update dialog position upon document scroll, if the position was not changed manually.\n this.listenTo(global.document, 'scroll', () => {\n if (this._isVisible && !this.wasMoved) {\n this.updatePosition();\n }\n });\n this.on('change:_isVisible', (evt, name, isVisible) => {\n if (isVisible) {\n // Let the content render first, then apply the position. Otherwise, the calculated DOM Rects\n // will not reflect the final look of the dialog. Note that we're not using #_moveOffScreen() here because\n // it causes a violent movement of the viewport on iOS (because the dialog still keeps the DOM focus).\n this._isTransparent = true;\n // FYI: RAF is too short. We need to wait a bit longer.\n setTimeout(() => {\n this.updatePosition();\n this._isTransparent = false;\n // The view must get the focus after it gets visible. But this is only possible\n // after the dialog is no longer transparent.\n this.focus();\n }, 10);\n }\n });\n this.keystrokes.listenTo(this.element);\n }\n /**\n * Returns the element that should be used as a drag handle.\n */\n get dragHandleElement() {\n if (this.headerView) {\n return this.headerView.element;\n }\n else {\n return null;\n }\n }\n /**\n * Creates the dialog parts. Which of them are created depends on the arguments passed to the method.\n * There are no rules regarding the dialog construction, that is, no part is mandatory.\n * Each part can only be created once.\n *\n * @internal\n */\n setupParts({ icon, title, hasCloseButton = true, content, actionButtons }) {\n if (title) {\n this.headerView = new FormHeaderView(this.locale, { icon });\n if (hasCloseButton) {\n this.closeButtonView = this._createCloseButton();\n this.headerView.children.add(this.closeButtonView);\n }\n this.headerView.label = title;\n this.ariaLabel = title;\n this.parts.add(this.headerView, 0);\n }\n if (content) {\n // Normalize the content specified in the arguments.\n if (content instanceof View) {\n content = [content];\n }\n this.contentView = new DialogContentView(this.locale);\n this.contentView.children.addMany(content);\n this.parts.add(this.contentView);\n }\n if (actionButtons) {\n this.actionsView = new DialogActionsView(this.locale);\n this.actionsView.setButtons(actionButtons);\n this.parts.add(this.actionsView);\n }\n this._updateFocusCyclableItems();\n }\n /**\n * Focuses the first focusable element inside the dialog.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Normalizes the passed coordinates to make sure the dialog view\n * is displayed within the visible viewport and moves it there.\n *\n * @internal\n */\n moveTo(left, top) {\n const viewportRect = this._getViewportRect();\n const dialogRect = this._getDialogRect();\n // Don't let the dialog go beyond the right edge of the viewport.\n if (left + dialogRect.width > viewportRect.right) {\n left = viewportRect.right - dialogRect.width;\n }\n // Don't let the dialog go beyond the left edge of the viewport.\n if (left < viewportRect.left) {\n left = viewportRect.left;\n }\n // Don't let the dialog go beyond the top edge of the viewport.\n if (top < viewportRect.top) {\n top = viewportRect.top;\n }\n // Note: We don't do the same for the bottom edge to allow users to resize the window vertically\n // and let the dialog to stay put instead of covering the editing root.\n this._moveTo(left, top);\n }\n /**\n * Moves the dialog to the specified coordinates.\n */\n _moveTo(left, top) {\n this._left = left;\n this._top = top;\n }\n /**\n * Moves the dialog by the specified offset.\n *\n * @internal\n */\n moveBy(left, top) {\n this.moveTo(this._left + left, this._top + top);\n }\n /**\n * Moves the dialog view to the off-screen position.\n * Used when there is no space to display the dialog.\n */\n _moveOffScreen() {\n this._moveTo(-9999, -9999);\n }\n /**\n * Recalculates the dialog according to the set position and viewport,\n * and moves it to the new position.\n */\n updatePosition() {\n if (!this.element || !this.element.parentNode) {\n return;\n }\n const viewportRect = this._getViewportRect();\n // Actual position may be different from the configured one if there's no DOM root.\n let configuredPosition = this.position;\n let domRootRect;\n if (!this._getCurrentDomRoot()) {\n configuredPosition = DialogViewPosition.SCREEN_CENTER;\n }\n else {\n domRootRect = this._getVisibleDomRootRect(viewportRect);\n }\n const defaultOffset = DialogView.defaultOffset;\n const dialogRect = this._getDialogRect();\n // @if CK_DEBUG_DIALOG // RectDrawer.clear();\n // @if CK_DEBUG_DIALOG // RectDrawer.draw( viewportRect, { outlineColor: 'blue' }, 'Viewport' );\n switch (configuredPosition) {\n case DialogViewPosition.EDITOR_TOP_SIDE: {\n // @if CK_DEBUG_DIALOG // if ( domRootRect ) {\n // @if CK_DEBUG_DIALOG // \tRectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );\n // @if CK_DEBUG_DIALOG // }\n if (domRootRect) {\n const leftCoordinate = this.locale.contentLanguageDirection === 'ltr' ?\n domRootRect.right - dialogRect.width - defaultOffset :\n domRootRect.left + defaultOffset;\n this.moveTo(leftCoordinate, domRootRect.top + defaultOffset);\n }\n else {\n this._moveOffScreen();\n }\n break;\n }\n case DialogViewPosition.EDITOR_CENTER: {\n if (domRootRect) {\n this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), Math.round(domRootRect.top + domRootRect.height / 2 - dialogRect.height / 2));\n }\n else {\n this._moveOffScreen();\n }\n break;\n }\n case DialogViewPosition.SCREEN_CENTER: {\n this.moveTo(Math.round((viewportRect.width - dialogRect.width) / 2), Math.round((viewportRect.height - dialogRect.height) / 2));\n break;\n }\n case DialogViewPosition.EDITOR_TOP_CENTER: {\n // @if CK_DEBUG_DIALOG // if ( domRootRect ) {\n // @if CK_DEBUG_DIALOG // \tRectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );\n // @if CK_DEBUG_DIALOG // }\n if (domRootRect) {\n this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), domRootRect.top + defaultOffset);\n }\n else {\n this._moveOffScreen();\n }\n break;\n }\n case DialogViewPosition.EDITOR_BOTTOM_CENTER: {\n // @if CK_DEBUG_DIALOG // if ( domRootRect ) {\n // @if CK_DEBUG_DIALOG // \tRectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );\n // @if CK_DEBUG_DIALOG // }\n if (domRootRect) {\n this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), domRootRect.bottom - dialogRect.height - defaultOffset);\n }\n else {\n this._moveOffScreen();\n }\n break;\n }\n case DialogViewPosition.EDITOR_ABOVE_CENTER: {\n // @if CK_DEBUG_DIALOG // if ( domRootRect ) {\n // @if CK_DEBUG_DIALOG // \tRectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );\n // @if CK_DEBUG_DIALOG // }\n if (domRootRect) {\n this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), domRootRect.top - dialogRect.height - defaultOffset);\n }\n else {\n this._moveOffScreen();\n }\n break;\n }\n case DialogViewPosition.EDITOR_BELOW_CENTER: {\n // @if CK_DEBUG_DIALOG // if ( domRootRect ) {\n // @if CK_DEBUG_DIALOG // \tRectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );\n // @if CK_DEBUG_DIALOG // }\n if (domRootRect) {\n this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), domRootRect.bottom + defaultOffset);\n }\n else {\n this._moveOffScreen();\n }\n break;\n }\n }\n }\n /**\n * Calculates the visible DOM root part.\n */\n _getVisibleDomRootRect(viewportRect) {\n let visibleDomRootRect = new Rect(this._getCurrentDomRoot()).getVisible();\n if (!visibleDomRootRect) {\n return null;\n }\n else {\n visibleDomRootRect = viewportRect.getIntersection(visibleDomRootRect);\n if (!visibleDomRootRect) {\n return null;\n }\n }\n return visibleDomRootRect;\n }\n /**\n * Calculates the dialog element rect.\n */\n _getDialogRect() {\n return new Rect(this.element.firstElementChild);\n }\n /**\n * Calculates the viewport rect.\n */\n _getViewportRect() {\n return getConstrainedViewportRect(this._getViewportOffset());\n }\n /**\n * Collects all focusable elements inside the dialog parts\n * and adds them to the focus tracker and focus cycler.\n */\n _updateFocusCyclableItems() {\n const focusables = [];\n if (this.contentView) {\n for (const child of this.contentView.children) {\n if (isFocusable(child)) {\n focusables.push(child);\n }\n }\n }\n if (this.actionsView) {\n focusables.push(this.actionsView);\n }\n if (this.closeButtonView) {\n focusables.push(this.closeButtonView);\n }\n focusables.forEach(focusable => {\n this._focusables.add(focusable);\n this.focusTracker.add(focusable.element);\n if (isViewWithFocusCycler(focusable)) {\n this._focusCycler.chain(focusable.focusCycler);\n }\n });\n }\n /**\n * Creates the close button view that is displayed in the header view corner.\n */\n _createCloseButton() {\n const buttonView = new ButtonView(this.locale);\n const t = this.locale.t;\n buttonView.set({\n label: t('Close'),\n tooltip: true,\n icon: icons.cancel\n });\n buttonView.on('execute', () => this.fire('close', { source: 'closeButton' }));\n return buttonView;\n }\n}\n/**\n * A default dialog element offset from the reference element (e.g. editor editable area).\n */\nDialogView.defaultOffset = 15;\nexport default DialogView;\n// Returns a viewport `Rect` shrunk by the viewport offset config from all sides.\n// TODO: This is a duplicate from position.ts module. It should either be exported there or land somewhere in utils.\nfunction getConstrainedViewportRect(viewportOffset) {\n viewportOffset = Object.assign({ top: 0, bottom: 0, left: 0, right: 0 }, viewportOffset);\n const viewportRect = new Rect(global.window);\n viewportRect.top += viewportOffset.top;\n viewportRect.height -= viewportOffset.top;\n viewportRect.bottom -= viewportOffset.bottom;\n viewportRect.height -= viewportOffset.bottom;\n viewportRect.left += viewportOffset.left;\n viewportRect.right -= viewportOffset.right;\n viewportRect.width -= viewportOffset.left + viewportOffset.right;\n return viewportRect;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { global } from '@ckeditor/ckeditor5-utils';\n/**\n * A mixin that brings the possibility to observe dragging of the view element.\n * The view has to implement the {@link ~DraggableView} interface to use it:\n *\n * ```js\n * export default class MyDraggableView extends DraggableViewMixin( View ) implements DraggableView {\n * \t\t// ...\n * }\n * ```\n *\n * Creating a class extending it attaches a set of mouse and touch listeners allowing to observe dragging of the view element:\n * * `mousedown` and `touchstart` on the view element - starting the dragging.\n * * `mousemove` and `touchmove` on the document - updating the view coordinates.\n * * `mouseup` and `touchend` on the document - stopping the dragging.\n *\n * The mixin itself does not provide a visual feedback (that is, the dragged element does not change its position) -\n * it is up to the developer to implement it.\n */\nexport default function DraggableViewMixin(view) {\n class DraggableMixin extends view {\n /**\n * @inheritDoc\n */\n constructor(...args) {\n super(...args);\n /**\n * A bound version of {@link #_onDrag}.\n */\n this._onDragBound = this._onDrag.bind(this);\n /**\n * A bound version of {@link #_onDragEnd}.\n */\n this._onDragEndBound = this._onDragEnd.bind(this);\n /**\n * The last coordinates of the view. It is updated on every mouse move.\n */\n this._lastDraggingCoordinates = { x: 0, y: 0 };\n this.on('render', () => {\n this._attachListeners();\n });\n this.set('isDragging', false);\n }\n /**\n * Attaches the listeners for the drag start.\n */\n _attachListeners() {\n this.listenTo(this.element, 'mousedown', this._onDragStart.bind(this));\n this.listenTo(this.element, 'touchstart', this._onDragStart.bind(this));\n }\n /**\n * Attaches the listeners for the dragging and drag end.\n */\n _attachDragListeners() {\n this.listenTo(global.document, 'mouseup', this._onDragEndBound);\n this.listenTo(global.document, 'touchend', this._onDragEndBound);\n this.listenTo(global.document, 'mousemove', this._onDragBound);\n this.listenTo(global.document, 'touchmove', this._onDragBound);\n }\n /**\n * Detaches the listeners after the drag end.\n */\n _detachDragListeners() {\n this.stopListening(global.document, 'mouseup', this._onDragEndBound);\n this.stopListening(global.document, 'touchend', this._onDragEndBound);\n this.stopListening(global.document, 'mousemove', this._onDragBound);\n this.stopListening(global.document, 'touchmove', this._onDragBound);\n }\n /**\n * Starts the dragging listeners and sets the initial view coordinates.\n */\n _onDragStart(evt, domEvt) {\n if (!this._isHandleElementPressed(domEvt)) {\n return;\n }\n this._attachDragListeners();\n let x = 0;\n let y = 0;\n // If dragging is performed with a mouse, there is only one set of coordinates available.\n // But when using a touch device, there may be many of them, so use the coordinates from the first touch.\n if (domEvt instanceof MouseEvent) {\n x = domEvt.clientX;\n y = domEvt.clientY;\n }\n else {\n x = domEvt.touches[0].clientX;\n y = domEvt.touches[0].clientY;\n }\n this._lastDraggingCoordinates = { x, y };\n this.isDragging = true;\n }\n /**\n * Updates the view coordinates and fires the `drag` event.\n */\n _onDrag(evt, domEvt) {\n // If dragging was stopped by some external intervention, stop listening.\n if (!this.isDragging) {\n this._detachDragListeners();\n return;\n }\n let newX = 0;\n let newY = 0;\n // If dragging is performed with a mouse, there is only one set of coordinates available.\n // But when using a touch device, there may be many of them, so use the coordinates from the first touch.\n if (domEvt instanceof MouseEvent) {\n newX = domEvt.clientX;\n newY = domEvt.clientY;\n }\n else {\n newX = domEvt.touches[0].clientX;\n newY = domEvt.touches[0].clientY;\n }\n // Prevents selection of text while dragging on Safari.\n domEvt.preventDefault();\n this.fire('drag', {\n deltaX: Math.round(newX - this._lastDraggingCoordinates.x),\n deltaY: Math.round(newY - this._lastDraggingCoordinates.y)\n });\n this._lastDraggingCoordinates = { x: newX, y: newY };\n }\n /**\n * Stops the dragging and detaches the listeners.\n */\n _onDragEnd() {\n this._detachDragListeners();\n this.isDragging = false;\n }\n /**\n * Checks if the drag handle element was pressed.\n */\n _isHandleElementPressed(domEvt) {\n if (!this.dragHandleElement) {\n return false;\n }\n return this.dragHandleElement === domEvt.target ||\n (domEvt.target instanceof HTMLElement && this.dragHandleElement.contains(domEvt.target));\n }\n }\n return DraggableMixin;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport DialogView, { DialogViewPosition } from './dialogview.js';\n/**\n * The dialog controller class. It is used to show and hide the {@link module:ui/dialog/dialogview~DialogView}.\n */\nexport default class Dialog extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Dialog';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n const t = editor.t;\n this._initShowHideListeners();\n this._initFocusToggler();\n this._initMultiRootIntegration();\n this.set({\n id: null,\n isOpen: false\n });\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n categoryId: 'navigation',\n keystrokes: [{\n label: t('Move focus in and out of an active dialog window'),\n keystroke: 'Ctrl+F6',\n mayRequireFn: true\n }]\n });\n }\n /**\n * Initiates listeners for the `show` and `hide` events emitted by this plugin.\n *\n * We could not simply decorate the {@link #show} and {@link #hide} methods to fire events,\n * because they would be fired in the wrong order – first would be `show` and then `hide`\n * (because showing the dialog actually starts with hiding the previously visible one).\n * Hence, we added private methods {@link #_show} and {@link #_hide} which are called on events\n * in the desired sequence.\n */\n _initShowHideListeners() {\n this.on('show', (evt, args) => {\n this._show(args);\n });\n // 'low' priority allows to add custom callback between `_show()` and `onShow()`.\n this.on('show', (evt, args) => {\n if (args.onShow) {\n args.onShow(this);\n }\n }, { priority: 'low' });\n this.on('hide', () => {\n if (Dialog._visibleDialogPlugin) {\n Dialog._visibleDialogPlugin._hide();\n }\n });\n // 'low' priority allows to add custom callback between `_hide()` and `onHide()`.\n this.on('hide', () => {\n if (this._onHide) {\n this._onHide(this);\n this._onHide = undefined;\n }\n }, { priority: 'low' });\n }\n /**\n * Initiates keystroke handler for toggling the focus between the editor and the dialog view.\n */\n _initFocusToggler() {\n const editor = this.editor;\n editor.keystrokes.set('Ctrl+F6', (data, cancel) => {\n if (!this.isOpen || this.view.isModal) {\n return;\n }\n if (this.view.focusTracker.isFocused) {\n editor.editing.view.focus();\n }\n else {\n this.view.focus();\n }\n cancel();\n });\n }\n /**\n * Provides an integration between the root attaching and detaching and positioning of the view.\n */\n _initMultiRootIntegration() {\n const model = this.editor.model;\n model.document.on('change:data', () => {\n if (!this.view) {\n return;\n }\n const changedRoots = model.document.differ.getChangedRoots();\n for (const changes of changedRoots) {\n if (changes.state) {\n this.view.updatePosition();\n }\n }\n });\n }\n /**\n * Displays a dialog window.\n *\n * This method requires a {@link ~DialogDefinition} that defines the dialog's content, title, icon, action buttons, etc.\n *\n * For example, the following definition will create a dialog with:\n * * A header consisting of an icon, a title, and a \"Close\" button (it is added by default).\n * * A content consisting of a view with a single paragraph.\n * * A footer consisting of two buttons: \"Yes\" and \"No\".\n *\n * ```js\n * // Create the view that will be used as the dialog's content.\n * const textView = new View( locale );\n *\n * textView.setTemplate( {\n * \ttag: 'div',\n * \tattributes: {\n * \t\tstyle: {\n * \t\t\tpadding: 'var(--ck-spacing-large)',\n * \t\t\twhiteSpace: 'initial',\n * \t\t\twidth: '100%',\n * \t\t\tmaxWidth: '500px'\n * \t\t},\n * \t\ttabindex: -1\n * \t},\n * \tchildren: [\n * \t\t'Lorem ipsum dolor sit amet...'\n * \t]\n * } );\n *\n * // Show the dialog.\n * editor.plugins.get( 'Dialog' ).show( {\n *\tid: 'myDialog',\n * \ticon: 'myIcon', // This should be an SVG string.\n * \ttitle: 'My dialog',\n * \tcontent: textView,\n * \tactionButtons: [\n *\t\t{\n *\t\t\tlabel: t( 'Yes' ),\n *\t\t\tclass: 'ck-button-action',\n *\t\t\twithText: true,\n *\t\t\tonExecute: () => dialog.hide()\n *\t\t},\n *\t\t{\n *\t\t\tlabel: t( 'No' ),\n *\t\t\twithText: true,\n *\t\t\tonExecute: () => dialog.hide()\n *\t\t}\n *\t]\n * } );\n * ```\n *\n * By specifying the {@link ~DialogDefinition#onShow} and {@link ~DialogDefinition#onHide} callbacks\n * it is also possible to add callbacks that will be called when the dialog is shown or hidden.\n *\n * For example, the callbacks in the following definition:\n * * Disable the default behavior of the <kbd>Esc</kbd> key.\n * * Fire a custom event when the dialog gets hidden.\n *\n * ```js\n * editor.plugins.get( 'Dialog' ).show( {\n * \t// ...\n * \tonShow: dialog => {\n * \t\tdialog.view.on( 'close', ( evt, data ) => {\n * \t\t\t// Only prevent the event from the \"Esc\" key - do not affect the other ways of closing the dialog.\n * \t\t\tif ( data.source === 'escKeyPress' ) {\n * \t\t\t\tevt.stop();\n * \t\t\t}\n * \t\t} );\n * \t},\n * \tonHide: dialog => {\n * \t\tdialog.fire( 'dialogDestroyed' );\n * \t}\n * } );\n * ```\n *\n * Internally, calling this method:\n * 1. Hides the currently visible dialog (if any) calling the {@link #hide} method\n * (fires the {@link ~DialogHideEvent hide event}).\n * 2. Fires the {@link ~DialogShowEvent show event} which allows for adding callbacks that customize the\n * behavior of the dialog.\n * 3. Shows the dialog.\n */\n show(dialogDefinition) {\n this.hide();\n this.fire(`show:${dialogDefinition.id}`, dialogDefinition);\n }\n /**\n * Handles creating the {@link module:ui/dialog/dialogview~DialogView} instance and making it visible.\n */\n _show({ id, icon, title, hasCloseButton = true, content, actionButtons, className, isModal, position, onHide }) {\n const editor = this.editor;\n this.view = new DialogView(editor.locale, {\n getCurrentDomRoot: () => {\n return editor.editing.view.getDomRoot(editor.model.document.selection.anchor.root.rootName);\n },\n getViewportOffset: () => {\n return editor.ui.viewportOffset;\n }\n });\n const view = this.view;\n view.on('close', () => {\n this.hide();\n });\n editor.ui.view.body.add(view);\n editor.ui.focusTracker.add(view.element);\n editor.keystrokes.listenTo(view.element);\n // Unless the user specified a position, modals should always be centered on the screen.\n // Otherwise, let's keep dialogs centered in the editing root by default.\n if (!position) {\n position = isModal ? DialogViewPosition.SCREEN_CENTER : DialogViewPosition.EDITOR_CENTER;\n }\n view.set({\n position,\n _isVisible: true,\n className,\n isModal\n });\n view.setupParts({\n icon,\n title,\n hasCloseButton,\n content,\n actionButtons\n });\n this.id = id;\n if (onHide) {\n this._onHide = onHide;\n }\n this.isOpen = true;\n Dialog._visibleDialogPlugin = this;\n }\n /**\n * Hides the dialog. This method is decorated to enable interacting on the {@link ~DialogHideEvent hide event}.\n *\n * See {@link #show}.\n */\n hide() {\n if (Dialog._visibleDialogPlugin) {\n Dialog._visibleDialogPlugin.fire(`hide:${Dialog._visibleDialogPlugin.id}`);\n }\n }\n /**\n * Destroys the {@link module:ui/dialog/dialogview~DialogView} and cleans up the stored dialog state.\n */\n _hide() {\n if (!this.view) {\n return;\n }\n const editor = this.editor;\n const view = this.view;\n // Reset the content view to prevent its children from being destroyed in the standard\n // View#destroy() (and collections) chain. If the content children were left in there,\n // they would have to be re-created by the feature using the dialog every time the dialog\n // shows up.\n if (view.contentView) {\n view.contentView.reset();\n }\n editor.ui.view.body.remove(view);\n editor.ui.focusTracker.remove(view.element);\n editor.keystrokes.stopListening(view.element);\n view.destroy();\n editor.editing.view.focus();\n this.id = null;\n this.isOpen = false;\n Dialog._visibleDialogPlugin = null;\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./listitembutton.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./listitembutton.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { icons } from '@ckeditor/ckeditor5-core';\nimport ButtonView from './buttonview.js';\nimport ButtonLabelView from './buttonlabelview.js';\nimport IconView from '../icon/iconview.js';\nimport View from '../view.js';\nimport '../../theme/components/button/listitembutton.css';\n/**\n * Button that is used as dropdown list item entry.\n */\nexport default class ListItemButtonView extends ButtonView {\n /**\n * @inheritDoc\n */\n constructor(locale, labelView = new ButtonLabelView()) {\n super(locale, labelView);\n /**\n * Holds the view for the check icon of a button list item.\n */\n this._checkIconHolderView = new CheckIconHolderView();\n this.set({\n hasCheckSpace: false,\n _hasCheck: this.isToggleable\n });\n const bind = this.bindTemplate;\n this.extendTemplate({\n attributes: {\n class: [\n 'ck-list-item-button',\n bind.if('isToggleable', 'ck-list-item-button_toggleable')\n ]\n }\n });\n this.bind('_hasCheck').to(this, 'hasCheckSpace', this, 'isToggleable', (hasCheckSpace, isToggleable) => hasCheckSpace || isToggleable);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n if (this._hasCheck) {\n this.children.add(this._checkIconHolderView, 0);\n }\n this._watchCheckIconHolderMount();\n }\n /**\n * Renders the check icon if the button is toggleable.\n */\n _watchCheckIconHolderMount() {\n this._checkIconHolderView\n .bind('isOn')\n .to(this, 'isOn', value => this.isToggleable && value);\n this.on('change:_hasCheck', (evt, propertyName, hasCheck) => {\n const { children, _checkIconHolderView } = this;\n if (hasCheck) {\n children.add(_checkIconHolderView, 0);\n }\n else {\n children.remove(_checkIconHolderView);\n }\n });\n }\n}\nexport class CheckIconHolderView extends View {\n /**\n * @inheritDoc\n */\n constructor() {\n super();\n /**\n * The view for the check icon of the button list item.\n */\n this._checkIconView = this._createCheckIconView();\n const bind = this.bindTemplate;\n this.children = this.createCollection();\n this.set('isOn', false);\n this.setTemplate({\n tag: 'span',\n children: this.children,\n attributes: {\n class: [\n 'ck',\n 'ck-list-item-button__check-holder',\n bind.to('isOn', isOn => isOn ? 'ck-on' : 'ck-off')\n ]\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n if (this.isOn) {\n this.children.add(this._checkIconView, 0);\n }\n this._watchCheckIconMount();\n }\n /**\n * Renders the check icon if the button is toggleable.\n */\n _watchCheckIconMount() {\n this.on('change:isOn', (evt, propertyName, isOn) => {\n const { children, _checkIconView } = this;\n if (isOn && !children.has(_checkIconView)) {\n children.add(_checkIconView);\n }\n else if (!isOn && children.has(_checkIconView)) {\n children.remove(_checkIconView);\n }\n });\n }\n /**\n * Creates a check icon view.\n */\n _createCheckIconView() {\n const iconView = new IconView();\n iconView.content = icons.check;\n iconView.extendTemplate({\n attributes: {\n class: 'ck-list-item-button__check-icon'\n }\n });\n return iconView;\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenulistitembutton.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenulistitembutton.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport ListItemButtonView from '../button/listitembuttonview.js';\nimport '../../theme/components/menubar/menubarmenulistitembutton.css';\n/**\n * A menu bar list button view. Buttons like this one execute user actions.\n */\nexport default class MenuBarMenuListItemButtonView extends ListItemButtonView {\n /**\n * Creates an instance of the menu bar list button view.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n this.set({\n withText: true,\n withKeystroke: true,\n tooltip: false,\n role: 'menuitem'\n });\n this.extendTemplate({\n attributes: {\n class: ['ck-menu-bar__menu__item__button']\n }\n });\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./label.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./label.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/label/labelview\n */\nimport View from '../view.js';\nimport { uid } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/label/label.css';\n/**\n * The label view class.\n */\nexport default class LabelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.set('text', undefined);\n this.set('for', undefined);\n this.id = `ck-editor__label_${uid()}`;\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'label',\n attributes: {\n class: [\n 'ck',\n 'ck-label'\n ],\n id: this.id,\n for: bind.to('for')\n },\n children: [\n {\n text: bind.to('text')\n }\n ]\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/accessibilityhelp/accessibilityhelpcontentview\n */\nimport { createElement, env, getEnvKeystrokeText } from '@ckeditor/ckeditor5-utils';\nimport View from '../../view.js';\nimport LabelView from '../../label/labelview.js';\n/**\n * The view displaying keystrokes in the Accessibility help dialog.\n */\nexport default class AccessibilityHelpContentView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale, keystrokes) {\n super(locale);\n const t = locale.t;\n const helpLabel = new LabelView();\n helpLabel.text = t('Help Contents. To close this dialog press ESC.');\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck', 'ck-accessibility-help-dialog__content'],\n 'aria-labelledby': helpLabel.id,\n role: 'document',\n tabindex: -1\n },\n children: [\n createElement(document, 'p', {}, t('Below, you can find a list of keyboard shortcuts that can be used in the editor.')),\n ...this._createCategories(Array.from(keystrokes.values())),\n helpLabel\n ]\n });\n }\n /**\n * @inheritDoc\n */\n focus() {\n this.element.focus();\n }\n /**\n * Creates `<section><h3>Category label</h3>...</section>` elements for each category of keystrokes.\n */\n _createCategories(categories) {\n return categories.map(categoryDefinition => {\n const elements = [\n // Category header.\n createElement(document, 'h3', {}, categoryDefinition.label),\n // Category definitions (<dl>) and their optional headers (<h4>).\n ...Array.from(categoryDefinition.groups.values())\n .map(groupDefinition => this._createGroup(groupDefinition))\n .flat()\n ];\n // Category description (<p>).\n if (categoryDefinition.description) {\n elements.splice(1, 0, createElement(document, 'p', {}, categoryDefinition.description));\n }\n return createElement(document, 'section', {}, elements);\n });\n }\n /**\n * Creates `[<h4>Optional label</h4>]<dl>...</dl>` elements for each group of keystrokes in a category.\n */\n _createGroup(groupDefinition) {\n const definitionAndDescriptionElements = groupDefinition.keystrokes\n .sort((a, b) => a.label.localeCompare(b.label))\n .map(keystrokeDefinition => this._createGroupRow(keystrokeDefinition))\n .flat();\n const elements = [\n createElement(document, 'dl', {}, definitionAndDescriptionElements)\n ];\n if (groupDefinition.label) {\n elements.unshift(createElement(document, 'h4', {}, groupDefinition.label));\n }\n return elements;\n }\n /**\n * Creates `<dt>Keystroke label</dt><dd>Keystroke definition</dd>` elements for each keystroke in a group.\n */\n _createGroupRow(keystrokeDefinition) {\n const t = this.locale.t;\n const dt = createElement(document, 'dt');\n const dd = createElement(document, 'dd');\n const normalizedKeystrokeDefinition = normalizeKeystrokeDefinition(keystrokeDefinition.keystroke);\n const keystrokeAlternativeHTMLs = [];\n for (const keystrokeAlternative of normalizedKeystrokeDefinition) {\n keystrokeAlternativeHTMLs.push(keystrokeAlternative.map(keystrokeToEnvKbd).join(''));\n }\n dt.innerHTML = keystrokeDefinition.label;\n dd.innerHTML = keystrokeAlternativeHTMLs.join(', ') +\n (keystrokeDefinition.mayRequireFn && env.isMac ? ` ${t('(may require <kbd>Fn</kbd>)')}` : '');\n return [dt, dd];\n }\n}\nfunction keystrokeToEnvKbd(keystroke) {\n return getEnvKeystrokeText(keystroke)\n .split('+')\n .map(part => `<kbd>${part}</kbd>`)\n .join('+');\n}\nfunction normalizeKeystrokeDefinition(definition) {\n if (typeof definition === 'string') {\n return [[definition]];\n }\n if (typeof definition[0] === 'string') {\n return [definition];\n }\n return definition;\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10 6.628a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\\\"/><path d=\\\"M8.5 9.125a.3.3 0 0 0-.253-.296L5.11 8.327a.75.75 0 1 1 .388-1.449l4.04.716c.267.072.624.08.893.009l4.066-.724a.75.75 0 1 1 .388 1.45l-3.132.5a.3.3 0 0 0-.253.296v1.357a.3.3 0 0 0 .018.102l1.615 4.438a.75.75 0 0 1-1.41.513l-1.35-3.71a.3.3 0 0 0-.281-.197h-.209a.3.3 0 0 0-.282.198l-1.35 3.711a.75.75 0 0 1-1.41-.513l1.64-4.509a.3.3 0 0 0 .019-.103V9.125Z\\\"/><path clip-rule=\\\"evenodd\\\" d=\\\"M10 18.5a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17Zm0 1.5c5.523 0 10-4.477 10-10S15.523 0 10 0 0 4.477 0 10s4.477 10 10 10Z\\\"/></svg>\";","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./accessibilityhelp.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./accessibilityhelp.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/accessibilityhelp/accessibilityhelp\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport ButtonView from '../../button/buttonview.js';\nimport Dialog from '../../dialog/dialog.js';\nimport MenuBarMenuListItemButtonView from '../../menubar/menubarmenulistitembuttonview.js';\nimport AccessibilityHelpContentView from './accessibilityhelpcontentview.js';\nimport { getEnvKeystrokeText } from '@ckeditor/ckeditor5-utils';\nimport accessibilityIcon from '../../../theme/icons/accessibility.svg';\nimport '../../../theme/components/editorui/accessibilityhelp.css';\n/**\n * A plugin that brings the accessibility help dialog to the editor available under the <kbd>Alt</kbd>+<kbd>0</kbd>\n * keystroke and via the \"Accessibility help\" toolbar button. The dialog displays a list of keystrokes that can be used\n * by the user to perform various actions in the editor.\n *\n * Keystroke information is loaded from {@link module:core/accessibility~Accessibility#keystrokeInfos}. New entries can be\n * added using the API provided by the {@link module:core/accessibility~Accessibility} class.\n */\nexport default class AccessibilityHelp extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * The view that displays the dialog content (list of keystrokes).\n * Created when the dialog is opened for the first time.\n */\n this.contentView = null;\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Dialog];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'AccessibilityHelp';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.locale.t;\n editor.ui.componentFactory.add('accessibilityHelp', () => {\n const button = this._createButton(ButtonView);\n button.set({\n tooltip: true,\n withText: false,\n label: t('Accessibility help')\n });\n return button;\n });\n editor.ui.componentFactory.add('menuBar:accessibilityHelp', () => {\n const button = this._createButton(MenuBarMenuListItemButtonView);\n button.label = t('Accessibility');\n return button;\n });\n editor.keystrokes.set('Alt+0', (evt, cancel) => {\n this._toggleDialog();\n cancel();\n });\n this._setupRootLabels();\n }\n /**\n * Creates a button to show accessibility help dialog, for use either in toolbar or in menu bar.\n */\n _createButton(ButtonClass) {\n const editor = this.editor;\n const dialog = editor.plugins.get('Dialog');\n const locale = editor.locale;\n const view = new ButtonClass(locale);\n view.set({\n keystroke: 'Alt+0',\n icon: accessibilityIcon,\n isToggleable: true\n });\n view.on('execute', () => this._toggleDialog());\n view.bind('isOn').to(dialog, 'id', id => id === 'accessibilityHelp');\n return view;\n }\n /**\n * Injects a help text into each editing root's `aria-label` attribute allowing assistive technology users\n * to discover the availability of the Accessibility help dialog.\n */\n _setupRootLabels() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const t = editor.t;\n editor.ui.on('ready', () => {\n editingView.change(writer => {\n for (const root of editingView.document.roots) {\n addAriaLabelTextToRoot(writer, root);\n }\n });\n editor.on('addRoot', (evt, modelRoot) => {\n const viewRoot = editor.editing.view.document.getRoot(modelRoot.rootName);\n editingView.change(writer => addAriaLabelTextToRoot(writer, viewRoot));\n }, { priority: 'low' });\n });\n function addAriaLabelTextToRoot(writer, viewRoot) {\n const currentAriaLabel = viewRoot.getAttribute('aria-label');\n const newAriaLabel = `${currentAriaLabel}. ${t('Press %0 for help.', [getEnvKeystrokeText('Alt+0')])}`;\n writer.setAttribute('aria-label', newAriaLabel, viewRoot);\n }\n }\n /**\n * Shows the accessibility help dialog. Also, creates {@link #contentView} on demand.\n */\n _toggleDialog() {\n const editor = this.editor;\n const dialog = editor.plugins.get('Dialog');\n const t = editor.locale.t;\n if (!this.contentView) {\n this.contentView = new AccessibilityHelpContentView(editor.locale, editor.accessibility.keystrokeInfos);\n }\n if (dialog.id === 'accessibilityHelp') {\n dialog.hide();\n }\n else {\n dialog.show({\n id: 'accessibilityHelp',\n className: 'ck-accessibility-help-dialog',\n title: t('Accessibility help'),\n icon: accessibilityIcon,\n hasCloseButton: true,\n content: this.contentView\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/bodycollection\n */\n/* globals document */\nimport Template from '../template.js';\nimport ViewCollection from '../viewcollection.js';\nimport { createElement } from '@ckeditor/ckeditor5-utils';\n/**\n * This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached\n * from the DOM structure of the editor, like panels, icons, etc.\n *\n * The body collection is available in the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.\n * Any plugin can add a {@link module:ui/view~View view} to this collection.\n * These views will render in a container placed directly in the `<body>` element.\n * The editor will detach and destroy this collection when the editor will be {@link module:core/editor/editor~Editor#destroy destroyed}.\n *\n * If you need to control the life cycle of the body collection on your own, you can create your own instance of this class.\n *\n * A body collection will render itself automatically in the DOM body element as soon as you call {@link ~BodyCollection#attachToDom}.\n * If you create multiple body collections, this class will create a special wrapper element in the DOM to limit the number of\n * elements created directly in the body and remove it when the last body collection will be\n * {@link ~BodyCollection#detachFromDom detached}.\n */\nexport default class BodyCollection extends ViewCollection {\n /**\n * Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.\n *\n * @param locale The {@link module:core/editor/editor~Editor editor's locale} instance.\n * @param initialItems The initial items of the collection.\n */\n constructor(locale, initialItems = []) {\n super(initialItems);\n this.locale = locale;\n }\n /**\n * The element holding elements of the body region.\n */\n get bodyCollectionContainer() {\n return this._bodyCollectionContainer;\n }\n /**\n * Attaches the body collection to the DOM body element. You need to execute this method to render the content of\n * the body collection.\n */\n attachToDom() {\n this._bodyCollectionContainer = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-reset_all',\n 'ck-body',\n 'ck-rounded-corners'\n ],\n dir: this.locale.uiLanguageDirection,\n role: 'application'\n },\n children: this\n }).render();\n let wrapper = document.querySelector('.ck-body-wrapper');\n if (!wrapper) {\n wrapper = createElement(document, 'div', { class: 'ck-body-wrapper' });\n document.body.appendChild(wrapper);\n }\n wrapper.appendChild(this._bodyCollectionContainer);\n }\n /**\n * Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection\n * anymore to clean-up the DOM structure.\n */\n detachFromDom() {\n super.destroy();\n if (this._bodyCollectionContainer) {\n this._bodyCollectionContainer.remove();\n }\n const wrapper = document.querySelector('.ck-body-wrapper');\n if (wrapper && wrapper.childElementCount == 0) {\n wrapper.remove();\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./switchbutton.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./switchbutton.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/button/switchbuttonview\n */\nimport View from '../view.js';\nimport ButtonView from './buttonview.js';\nimport '../../theme/components/button/switchbutton.css';\n/**\n * The switch button view class.\n *\n * ```ts\n * const view = new SwitchButtonView();\n *\n * view.set( {\n * \twithText: true,\n * \tlabel: 'Switch me!'\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n */\nexport default class SwitchButtonView extends ButtonView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.isToggleable = true;\n this.toggleSwitchView = this._createToggleView();\n this.extendTemplate({\n attributes: {\n class: 'ck-switchbutton'\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.add(this.toggleSwitchView);\n }\n /**\n * Creates a toggle child view.\n */\n _createToggleView() {\n const toggleSwitchView = new View();\n toggleSwitchView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-button__toggle'\n ]\n },\n children: [\n {\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-button__toggle__inner'\n ]\n }\n }\n ]\n });\n return toggleSwitchView;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/button/filedialogbuttonview\n */\nimport View from '../view.js';\nimport ButtonView from './buttonview.js';\nimport ListItemButtonView from './listitembuttonview.js';\n/**\n * The file dialog button view.\n *\n * This component provides a button that opens the native file selection dialog.\n * It can be used to implement the UI of a file upload feature.\n *\n * ```ts\n * const view = new FileDialogButtonView( locale );\n *\n * view.set( {\n * \tacceptedType: 'image/*',\n * \tallowMultipleFiles: true\n * \tlabel: t( 'Insert image' ),\n * \ticon: imageIcon,\n * \ttooltip: true\n * } );\n *\n * view.on( 'done', ( evt, files ) => {\n * \tfor ( const file of Array.from( files ) ) {\n * \t\tconsole.log( 'Selected file', file );\n * \t}\n * } );\n * ```\n */\nexport default class FileDialogButtonView extends /* #__PURE__ */ FileDialogViewMixin(ButtonView) {\n}\n/**\n * The file dialog button view used in a lists.\n *\n * This component provides a button that opens the native file selection dialog.\n * It can be used to implement the UI of a file upload feature.\n *\n* ```ts\n * const view = new FileDialogListItemButtonView( locale );\n *\n * view.set( {\n * \tacceptedType: 'image/*',\n * \tallowMultipleFiles: true\n * \tlabel: t( 'Insert image' ),\n * \ticon: imageIcon,\n * \ttooltip: true\n * } );\n *\n * view.on( 'done', ( evt, files ) => {\n * \tfor ( const file of Array.from( files ) ) {\n * \t\tconsole.log( 'Selected file', file );\n * \t}\n * } );\n * ```\n */\nexport class FileDialogListItemButtonView extends /* #__PURE__ */ FileDialogViewMixin(ListItemButtonView) {\n}\n/**\n * Mixin function that enhances a base button view class with file dialog functionality. It is used\n * to create a button view class that opens the native select file dialog when clicked.\n *\n * The enhanced view includes a button and a hidden file input. When the button is clicked, the file dialog is opened.\n * The mixin adds properties and methods to the base class to handle the file selection.\n *\n * @param view The base class to be enhanced with file dialog functionality.\n * @returns A new class that extends the base class and includes the file dialog functionality.\n */\nfunction FileDialogViewMixin(view) {\n class FileDialogView extends view {\n /**\n * @inheritDoc\n */\n constructor(...args) {\n super(...args);\n // For backward compatibility.\n this.buttonView = this;\n this._fileInputView = new FileInputView(this.locale);\n this._fileInputView.bind('acceptedType').to(this);\n this._fileInputView.bind('allowMultipleFiles').to(this);\n this._fileInputView.delegate('done').to(this);\n this.on('execute', () => {\n this._fileInputView.open();\n });\n this.extendTemplate({\n attributes: {\n class: 'ck-file-dialog-button'\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.add(this._fileInputView);\n }\n }\n return FileDialogView;\n}\n/**\n * The hidden file input view class.\n */\nclass FileInputView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.set('acceptedType', undefined);\n this.set('allowMultipleFiles', false);\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'input',\n attributes: {\n class: [\n 'ck-hidden'\n ],\n type: 'file',\n tabindex: '-1',\n accept: bind.to('acceptedType'),\n multiple: bind.to('allowMultipleFiles')\n },\n on: {\n // Removing from code coverage since we cannot programmatically set input element files.\n change: bind.to(/* istanbul ignore next -- @preserve */ () => {\n if (this.element && this.element.files && this.element.files.length) {\n this.fire('done', this.element.files);\n }\n this.element.value = '';\n })\n }\n });\n }\n /**\n * Opens file dialog.\n */\n open() {\n this.element.click();\n }\n}\n","export default \"<svg viewBox=\\\"0 0 10 10\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z\\\"/></svg>\";","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./collapsible.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./collapsible.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport View from '../view.js';\nimport ButtonView from '../button/buttonview.js';\nimport dropdownArrowIcon from '../../theme/icons/dropdown-arrow.svg';\nimport '../../theme/components/collapsible/collapsible.css';\n/**\n * A collapsible UI component. Consists of a labeled button and a container which can be collapsed\n * by clicking the button. The collapsible container can be a host to other UI views.\n *\n * @internal\n */\nexport default class CollapsibleView extends View {\n /**\n * Creates an instance of the collapsible view.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param childViews An optional array of initial child views to be inserted into the collapsible.\n */\n constructor(locale, childViews) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isCollapsed', false);\n this.set('label', '');\n this.buttonView = this._createButtonView();\n this.children = this.createCollection();\n this.set('_collapsibleAriaLabelUid', undefined);\n if (childViews) {\n this.children.addMany(childViews);\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-collapsible',\n bind.if('isCollapsed', 'ck-collapsible_collapsed')\n ]\n },\n children: [\n this.buttonView,\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-collapsible__children'\n ],\n role: 'region',\n hidden: bind.if('isCollapsed', 'hidden'),\n 'aria-labelledby': bind.to('_collapsibleAriaLabelUid')\n },\n children: this.children\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this._collapsibleAriaLabelUid = this.buttonView.labelView.element.id;\n }\n /**\n * Focuses the first focusable.\n */\n focus() {\n this.buttonView.focus();\n }\n /**\n * Creates the main {@link #buttonView} of the collapsible.\n */\n _createButtonView() {\n const buttonView = new ButtonView(this.locale);\n const bind = buttonView.bindTemplate;\n buttonView.set({\n withText: true,\n icon: dropdownArrowIcon\n });\n buttonView.extendTemplate({\n attributes: {\n 'aria-expanded': bind.to('isOn', value => String(value))\n }\n });\n buttonView.bind('label').to(this);\n buttonView.bind('isOn').to(this, 'isCollapsed', isCollapsed => !isCollapsed);\n buttonView.on('execute', () => {\n this.isCollapsed = !this.isCollapsed;\n });\n return buttonView;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns color configuration options as defined in `editor.config.(fontColor|fontBackgroundColor).colors` or\n * `editor.config.table.(tableProperties|tableCellProperties).(background|border).colors\n * but processed to account for editor localization in the correct language.\n *\n * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}\n * when the user configuration is defined because the editor does not exist yet.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n */\nexport function getLocalizedColorOptions(locale, options) {\n const t = locale.t;\n const localizedColorNames = {\n Black: t('Black'),\n 'Dim grey': t('Dim grey'),\n Grey: t('Grey'),\n 'Light grey': t('Light grey'),\n White: t('White'),\n Red: t('Red'),\n Orange: t('Orange'),\n Yellow: t('Yellow'),\n 'Light green': t('Light green'),\n Green: t('Green'),\n Aquamarine: t('Aquamarine'),\n Turquoise: t('Turquoise'),\n 'Light blue': t('Light blue'),\n Blue: t('Blue'),\n Purple: t('Purple')\n };\n return options.map(colorOption => {\n const label = localizedColorNames[colorOption.label];\n if (label && label != colorOption.label) {\n colorOption.label = label;\n }\n return colorOption;\n });\n}\n/**\n * Creates a unified color definition object from color configuration options.\n * The object contains the information necessary to both render the UI and initialize the conversion.\n */\nexport function normalizeColorOptions(options) {\n return options\n .map(normalizeSingleColorDefinition)\n .filter(option => !!option);\n}\n/**\n * Creates a normalized color definition from the user-defined configuration.\n * The \"normalization\" means it will create full\n * {@link module:ui/colorgrid/colorgridview~ColorDefinition `ColorDefinition-like`}\n * object for string values, and add a `view` property, for each definition.\n */\nexport function normalizeSingleColorDefinition(color) {\n if (typeof color === 'string') {\n return {\n model: color,\n label: color,\n hasBorder: false,\n view: {\n name: 'span',\n styles: {\n color\n }\n }\n };\n }\n else {\n return {\n model: color.color,\n label: color.label || color.color,\n hasBorder: color.hasBorder === undefined ? false : color.hasBorder,\n view: {\n name: 'span',\n styles: {\n color: `${color.color}`\n }\n }\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorgrid/colortileview\n */\nimport ButtonView from '../button/buttonview.js';\nimport { env } from '@ckeditor/ckeditor5-utils';\nimport checkIcon from '../../theme/icons/color-tile-check.svg';\n/**\n * This class represents a single color tile in the {@link module:ui/colorgrid/colorgridview~ColorGridView}.\n */\nexport default class ColorTileView extends ButtonView {\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('color', undefined);\n this.set('hasBorder', false);\n this.icon = checkIcon;\n this.extendTemplate({\n attributes: {\n style: {\n // https://github.com/ckeditor/ckeditor5/issues/14907\n backgroundColor: bind.to('color', color => env.isMediaForcedColors ? null : color)\n },\n class: [\n 'ck',\n 'ck-color-grid__tile',\n bind.if('hasBorder', 'ck-color-selector__color-tile_bordered')\n ]\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.iconView.fillColor = 'hsl(0, 0%, 100%)';\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path class=\\\"ck-icon__fill\\\" d=\\\"M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z\\\"/><path d=\\\"M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z\\\"/></svg>\";","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorgrid.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorgrid.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorgrid/colorgridview\n */\nimport View from '../view.js';\nimport ColorTileView from './colortileview.js';\nimport addKeyboardHandlingForGrid from '../bindings/addkeyboardhandlingforgrid.js';\nimport { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/colorgrid/colorgrid.css';\n/**\n * A grid of {@link module:ui/colorgrid/colortileview~ColorTileView color tiles}.\n */\nexport default class ColorGridView extends View {\n /**\n * Creates an instance of a color grid containing {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.\n *\n * @fires execute\n * @param locale The localization services instance.\n * @param options Component configuration\n * @param options.colorDefinitions Array with definitions\n * required to create the {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.\n * @param options.columns A number of columns to display the tiles.\n */\n constructor(locale, options) {\n super(locale);\n const colorDefinitions = options && options.colorDefinitions ? options.colorDefinitions : [];\n this.columns = options && options.columns ? options.columns : 5;\n const viewStyleAttribute = {\n gridTemplateColumns: `repeat( ${this.columns}, 1fr)`\n };\n this.set('selectedColor', undefined);\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.items.on('add', (evt, colorTile) => {\n colorTile.isOn = colorTile.color === this.selectedColor;\n });\n colorDefinitions.forEach(color => {\n const colorTile = new ColorTileView();\n colorTile.set({\n color: color.color,\n label: color.label,\n tooltip: true,\n hasBorder: color.options.hasBorder\n });\n colorTile.on('execute', () => {\n this.fire('execute', {\n value: color.color,\n hasBorder: color.options.hasBorder,\n label: color.label\n });\n });\n this.items.add(colorTile);\n });\n this.setTemplate({\n tag: 'div',\n children: this.items,\n attributes: {\n class: [\n 'ck',\n 'ck-color-grid'\n ],\n style: viewStyleAttribute\n }\n });\n this.on('change:selectedColor', (evt, name, selectedColor) => {\n for (const item of this.items) {\n item.isOn = item.color === selectedColor;\n }\n });\n }\n /**\n * Focuses the first focusable in {@link #items}.\n */\n focus() {\n if (this.items.length) {\n this.items.first.focus();\n }\n }\n /**\n * Focuses the last focusable in {@link #items}.\n */\n focusLast() {\n if (this.items.length) {\n this.items.last.focus();\n }\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Items added before rendering should be known to the #focusTracker.\n for (const item of this.items) {\n this.focusTracker.add(item.element);\n }\n this.items.on('add', (evt, item) => {\n this.focusTracker.add(item.element);\n });\n this.items.on('remove', (evt, item) => {\n this.focusTracker.remove(item.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n addKeyboardHandlingForGrid({\n keystrokeHandler: this.keystrokes,\n focusTracker: this.focusTracker,\n gridItems: this.items,\n numberOfColumns: this.columns,\n uiLanguageDirection: this.locale && this.locale.uiLanguageDirection\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n}\n","/**\r\n * @module color-parse\r\n */\r\nimport names from 'color-name'\r\n\r\nexport default parse\r\n\r\n/**\r\n * Base hues\r\n * http://dev.w3.org/csswg/css-color/#typedef-named-hue\r\n */\r\n//FIXME: use external hue detector\r\nvar baseHues = {\r\n\tred: 0,\r\n\torange: 60,\r\n\tyellow: 120,\r\n\tgreen: 180,\r\n\tblue: 240,\r\n\tpurple: 300\r\n}\r\n\r\n/**\r\n * Parse color from the string passed\r\n *\r\n * @return {Object} A space indicator `space`, an array `values` and `alpha`\r\n */\r\nfunction parse (cstr) {\r\n\tvar m, parts = [], alpha = 1, space\r\n\r\n\tif (typeof cstr === 'string') {\r\n\t\t//keyword\r\n\t\tif (names[cstr]) {\r\n\t\t\tparts = names[cstr].slice()\r\n\t\t\tspace = 'rgb'\r\n\t\t}\r\n\r\n\t\t//reserved words\r\n\t\telse if (cstr === 'transparent') {\r\n\t\t\talpha = 0\r\n\t\t\tspace = 'rgb'\r\n\t\t\tparts = [0,0,0]\r\n\t\t}\r\n\r\n\t\t//hex\r\n\t\telse if (/^#[A-Fa-f0-9]+$/.test(cstr)) {\r\n\t\t\tvar base = cstr.slice(1)\r\n\t\t\tvar size = base.length\r\n\t\t\tvar isShort = size <= 4\r\n\t\t\talpha = 1\r\n\r\n\t\t\tif (isShort) {\r\n\t\t\t\tparts = [\r\n\t\t\t\t\tparseInt(base[0] + base[0], 16),\r\n\t\t\t\t\tparseInt(base[1] + base[1], 16),\r\n\t\t\t\t\tparseInt(base[2] + base[2], 16)\r\n\t\t\t\t]\r\n\t\t\t\tif (size === 4) {\r\n\t\t\t\t\talpha = parseInt(base[3] + base[3], 16) / 255\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tparts = [\r\n\t\t\t\t\tparseInt(base[0] + base[1], 16),\r\n\t\t\t\t\tparseInt(base[2] + base[3], 16),\r\n\t\t\t\t\tparseInt(base[4] + base[5], 16)\r\n\t\t\t\t]\r\n\t\t\t\tif (size === 8) {\r\n\t\t\t\t\talpha = parseInt(base[6] + base[7], 16) / 255\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!parts[0]) parts[0] = 0\r\n\t\t\tif (!parts[1]) parts[1] = 0\r\n\t\t\tif (!parts[2]) parts[2] = 0\r\n\r\n\t\t\tspace = 'rgb'\r\n\t\t}\r\n\r\n\t\t//color space\r\n\t\telse if (m = /^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\\s*\\(([^\\)]*)\\)/.exec(cstr)) {\r\n\t\t\tvar name = m[1]\r\n\t\t\tvar isRGB = name === 'rgb'\r\n\t\t\tvar base = name.replace(/a$/, '')\r\n\t\t\tspace = base\r\n\t\t\tvar size = base === 'cmyk' ? 4 : base === 'gray' ? 1 : 3\r\n\t\t\tparts = m[2].trim()\r\n\t\t\t\t.split(/\\s*[,\\/]\\s*|\\s+/)\r\n\t\t\t\t.map(function (x, i) {\r\n\t\t\t\t\t//<percentage>\r\n\t\t\t\t\tif (/%$/.test(x)) {\r\n\t\t\t\t\t\t//alpha\r\n\t\t\t\t\t\tif (i === size)\treturn parseFloat(x) / 100\r\n\t\t\t\t\t\t//rgb\r\n\t\t\t\t\t\tif (base === 'rgb') return parseFloat(x) * 255 / 100\r\n\t\t\t\t\t\treturn parseFloat(x)\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//hue\r\n\t\t\t\t\telse if (base[i] === 'h') {\r\n\t\t\t\t\t\t//<deg>\r\n\t\t\t\t\t\tif (/deg$/.test(x)) {\r\n\t\t\t\t\t\t\treturn parseFloat(x)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//<base-hue>\r\n\t\t\t\t\t\telse if (baseHues[x] !== undefined) {\r\n\t\t\t\t\t\t\treturn baseHues[x]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn parseFloat(x)\r\n\t\t\t\t})\r\n\r\n\t\t\tif (name === base) parts.push(1)\r\n\t\t\talpha = (isRGB) ? 1 : (parts[size] === undefined) ? 1 : parts[size]\r\n\t\t\tparts = parts.slice(0, size)\r\n\t\t}\r\n\r\n\t\t//named channels case\r\n\t\telse if (cstr.length > 10 && /[0-9](?:\\s|\\/)/.test(cstr)) {\r\n\t\t\tparts = cstr.match(/([0-9]+)/g).map(function (value) {\r\n\t\t\t\treturn parseFloat(value)\r\n\t\t\t})\r\n\r\n\t\t\tspace = cstr.match(/([a-z])/ig).join('').toLowerCase()\r\n\t\t}\r\n\t}\r\n\r\n\t//numeric case\r\n\telse if (!isNaN(cstr)) {\r\n\t\tspace = 'rgb'\r\n\t\tparts = [cstr >>> 16, (cstr & 0x00ff00) >>> 8, cstr & 0x0000ff]\r\n\t}\r\n\r\n\t//array-like\r\n\telse if (Array.isArray(cstr) || cstr.length) {\r\n\t\tparts = [cstr[0], cstr[1], cstr[2]]\r\n\t\tspace = 'rgb'\r\n\t\talpha = cstr.length === 4 ? cstr[3] : 1\r\n\t}\r\n\r\n\t//object case - detects css cases of rgb and hsl\r\n\telse if (cstr instanceof Object) {\r\n\t\tif (cstr.r != null || cstr.red != null || cstr.R != null) {\r\n\t\t\tspace = 'rgb'\r\n\t\t\tparts = [\r\n\t\t\t\tcstr.r || cstr.red || cstr.R || 0,\r\n\t\t\t\tcstr.g || cstr.green || cstr.G || 0,\r\n\t\t\t\tcstr.b || cstr.blue || cstr.B || 0\r\n\t\t\t]\r\n\t\t}\r\n\t\telse {\r\n\t\t\tspace = 'hsl'\r\n\t\t\tparts = [\r\n\t\t\t\tcstr.h || cstr.hue || cstr.H || 0,\r\n\t\t\t\tcstr.s || cstr.saturation || cstr.S || 0,\r\n\t\t\t\tcstr.l || cstr.lightness || cstr.L || cstr.b || cstr.brightness\r\n\t\t\t]\r\n\t\t}\r\n\r\n\t\talpha = cstr.a || cstr.alpha || cstr.opacity || 1\r\n\r\n\t\tif (cstr.opacity != null) alpha /= 100\r\n\t}\r\n\r\n\treturn {\r\n\t\tspace: space,\r\n\t\tvalues: parts,\r\n\t\talpha: alpha\r\n\t}\r\n}\r\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorpicker/utils\n */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n// There are no available types for 'color-parse' module.\n// @ts-ignore\nimport { default as parse } from 'color-parse';\nimport * as convert from 'color-convert';\n/**\n * Parses and converts the color string to requested format. Handles variety of color spaces\n * like `hsl`, `hex` or `rgb`.\n *\n * @param color\n * @returns A color string.\n */\nexport function convertColor(color, outputFormat) {\n if (!color) {\n return '';\n }\n const colorObject = parseColorString(color);\n if (!colorObject) {\n return '';\n }\n if (colorObject.space === outputFormat) {\n return color;\n }\n if (!canConvertParsedColor(colorObject)) {\n return '';\n }\n const fromColorSpace = convert[colorObject.space];\n const toColorSpace = fromColorSpace[outputFormat];\n if (!toColorSpace) {\n return '';\n }\n const convertedColorChannels = toColorSpace(colorObject.space === 'hex' ? colorObject.hexValue : colorObject.values);\n return formatColorOutput(convertedColorChannels, outputFormat);\n}\n/**\n * Converts a color string to hex format.\n *\n * @param color\n * @returns A color string.\n */\nexport function convertToHex(color) {\n if (!color) {\n return '';\n }\n const colorObject = parseColorString(color);\n if (!colorObject) {\n return '#000';\n }\n if (colorObject.space === 'hex') {\n return colorObject.hexValue;\n }\n return convertColor(color, 'hex');\n}\n/**\n * Registers the custom element in the\n * [CustomElementsRegistry](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry).\n */\nexport function registerCustomElement(elementName, constructor) {\n if (customElements.get(elementName) === undefined) {\n customElements.define(elementName, constructor);\n }\n}\n/**\n * Formats the passed color channels according to the requested format.\n *\n * @param values\n * @param format\n * @returns A color string.\n */\nfunction formatColorOutput(values, format) {\n switch (format) {\n case 'hex': return `#${values}`;\n case 'rgb': return `rgb( ${values[0]}, ${values[1]}, ${values[2]} )`;\n case 'hsl': return `hsl( ${values[0]}, ${values[1]}%, ${values[2]}% )`;\n case 'hwb': return `hwb( ${values[0]}, ${values[1]}, ${values[2]} )`;\n case 'lab': return `lab( ${values[0]}% ${values[1]} ${values[2]} )`;\n case 'lch': return `lch( ${values[0]}% ${values[1]} ${values[2]} )`;\n default: return '';\n }\n}\nfunction parseColorString(colorString) {\n // Parser library treats `hex` format as belonging to `rgb` space | which messes up further conversion.\n // Let's parse such strings on our own.\n if (colorString.startsWith('#')) {\n const parsedHex = parse(colorString);\n return {\n space: 'hex',\n values: parsedHex.values,\n hexValue: colorString,\n alpha: parsedHex.alpha\n };\n }\n const parsed = parse(colorString);\n if (!parsed.space) {\n return null;\n }\n return parsed;\n}\nfunction canConvertParsedColor(parsedColor) {\n return Object.keys(convert).includes(parsedColor.space);\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./labeledfieldview.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./labeledfieldview.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/labeledfield/labeledfieldview\n */\nimport View from '../view.js';\nimport LabelView from '../label/labelview.js';\nimport { uid } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/labeledfield/labeledfieldview.css';\n/**\n * The labeled field view class. It can be used to enhance any view with the following features:\n *\n * * a label,\n * * (optional) an error message,\n * * (optional) an info (status) text,\n *\n * all bound logically by proper DOM attributes for UX and accessibility. It also provides an interface\n * (e.g. observable properties) that allows controlling those additional features.\n *\n * The constructor of this class requires a callback that returns a view to be labeled. The callback\n * is called with unique ids that allow binding of DOM properties:\n *\n * ```ts\n * const labeledInputView = new LabeledFieldView( locale, ( labeledFieldView, viewUid, statusUid ) => {\n * \tconst inputView = new InputTextView( labeledFieldView.locale );\n *\n * \tinputView.set( {\n * \t\tid: viewUid,\n * \t\tariaDescribedById: statusUid\n * \t} );\n *\n * \tinputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );\n * \tinputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );\n *\n * \treturn inputView;\n * } );\n *\n * labeledInputView.label = 'User name';\n * labeledInputView.infoText = 'Full name like for instance, John Doe.';\n * labeledInputView.render();\n *\n * document.body.append( labeledInputView.element );\n * ```\n *\n * See {@link module:ui/labeledfield/utils} to discover ready–to–use labeled input helpers for common\n * UI components.\n */\nexport default class LabeledFieldView extends View {\n /**\n * Creates an instance of the labeled field view class using a provided creator function\n * that provides the view to be labeled.\n *\n * @param locale The locale instance.\n * @param viewCreator A function that returns a {@link module:ui/view~View}\n * that will be labeled. The following arguments are passed to the creator function:\n *\n * * an instance of the `LabeledFieldView` to allow binding observable properties,\n * * an UID string that connects the {@link #labelView label} and the labeled field view in DOM,\n * * an UID string that connects the {@link #statusView status} and the labeled field view in DOM.\n */\n constructor(locale, viewCreator) {\n super(locale);\n const viewUid = `ck-labeled-field-view-${uid()}`;\n const statusUid = `ck-labeled-field-view-status-${uid()}`;\n this.fieldView = viewCreator(this, viewUid, statusUid);\n this.set('label', undefined);\n this.set('isEnabled', true);\n this.set('isEmpty', true);\n this.set('isFocused', false);\n this.set('errorText', null);\n this.set('infoText', null);\n this.set('class', undefined);\n this.set('placeholder', undefined);\n this.labelView = this._createLabelView(viewUid);\n this.statusView = this._createStatusView(statusUid);\n this.fieldWrapperChildren = this.createCollection([this.fieldView, this.labelView]);\n this.bind('_statusText').to(this, 'errorText', this, 'infoText', (errorText, infoText) => errorText || infoText);\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-labeled-field-view',\n bind.to('class'),\n bind.if('isEnabled', 'ck-disabled', value => !value),\n bind.if('isEmpty', 'ck-labeled-field-view_empty'),\n bind.if('isFocused', 'ck-labeled-field-view_focused'),\n bind.if('placeholder', 'ck-labeled-field-view_placeholder'),\n bind.if('errorText', 'ck-error')\n ]\n },\n children: [\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-labeled-field-view__input-wrapper'\n ]\n },\n children: this.fieldWrapperChildren\n },\n this.statusView\n ]\n });\n }\n /**\n * Creates label view class instance and bind with view.\n *\n * @param id Unique id to set as labelView#for attribute.\n */\n _createLabelView(id) {\n const labelView = new LabelView(this.locale);\n labelView.for = id;\n labelView.bind('text').to(this, 'label');\n return labelView;\n }\n /**\n * Creates the status view instance. It displays {@link #errorText} and {@link #infoText}\n * next to the {@link #fieldView}. See {@link #_statusText}.\n *\n * @param statusUid Unique id of the status, shared with the {@link #fieldView view's}\n * `aria-describedby` attribute.\n */\n _createStatusView(statusUid) {\n const statusView = new View(this.locale);\n const bind = this.bindTemplate;\n statusView.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-labeled-field-view__status',\n bind.if('errorText', 'ck-labeled-field-view__status_error'),\n bind.if('_statusText', 'ck-hidden', value => !value)\n ],\n id: statusUid,\n role: bind.if('errorText', 'alert')\n },\n children: [\n {\n text: bind.to('_statusText')\n }\n ]\n });\n return statusView;\n }\n /**\n * Focuses the {@link #fieldView}.\n */\n focus(direction) {\n this.fieldView.focus(direction);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/input/inputbase\n */\nimport View from '../view.js';\nimport { FocusTracker } from '@ckeditor/ckeditor5-utils';\n/**\n * The base input view class.\n */\nexport default class InputBase extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.set('value', undefined);\n this.set('id', undefined);\n this.set('placeholder', undefined);\n this.set('tabIndex', undefined);\n this.set('isReadOnly', false);\n this.set('hasError', false);\n this.set('ariaDescribedById', undefined);\n this.set('ariaLabel', undefined);\n this.focusTracker = new FocusTracker();\n this.bind('isFocused').to(this.focusTracker);\n this.set('isEmpty', true);\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'input',\n attributes: {\n class: [\n 'ck',\n 'ck-input',\n bind.if('isFocused', 'ck-input_focused'),\n bind.if('isEmpty', 'ck-input-text_empty'),\n bind.if('hasError', 'ck-error')\n ],\n id: bind.to('id'),\n placeholder: bind.to('placeholder'),\n tabindex: bind.to('tabIndex'),\n readonly: bind.to('isReadOnly'),\n 'aria-invalid': bind.if('hasError', true),\n 'aria-describedby': bind.to('ariaDescribedById'),\n 'aria-label': bind.to('ariaLabel')\n },\n on: {\n input: bind.to((...args) => {\n this.fire('input', ...args);\n this._updateIsEmpty();\n }),\n change: bind.to(this._updateIsEmpty.bind(this))\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.element);\n this._setDomElementValue(this.value);\n this._updateIsEmpty();\n // Bind `this.value` to the DOM element's value.\n // We cannot use `value` DOM attribute because removing it on Edge does not clear the DOM element's value property.\n this.on('change:value', (evt, name, value) => {\n this._setDomElementValue(value);\n this._updateIsEmpty();\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n }\n /**\n * Moves the focus to the input and selects the value.\n */\n select() {\n this.element.select();\n }\n /**\n * Focuses the input.\n */\n focus() {\n this.element.focus();\n }\n /**\n * Resets the value of the input\n */\n reset() {\n this.value = this.element.value = '';\n this._updateIsEmpty();\n }\n /**\n * Updates the {@link #isEmpty} property value on demand.\n */\n _updateIsEmpty() {\n this.isEmpty = isInputElementEmpty(this.element);\n }\n /**\n * Sets the `value` property of the {@link #element DOM element} on demand.\n */\n _setDomElementValue(value) {\n this.element.value = (!value && value !== 0) ? '' : value;\n }\n}\nfunction isInputElementEmpty(domElement) {\n return !domElement.value;\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./input.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./input.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport InputBase from './inputbase.js';\nimport '../../theme/components/input/input.css';\n/**\n * The input view class.\n */\nexport default class InputView extends InputBase {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.set('inputMode', 'text');\n const bind = this.bindTemplate;\n this.extendTemplate({\n attributes: {\n inputmode: bind.to('inputMode')\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/inputtext/inputtextview\n */\nimport InputView from '../input/inputview.js';\n/**\n * The text input view class.\n */\nexport default class InputTextView extends InputView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.extendTemplate({\n attributes: {\n type: 'text',\n class: [\n 'ck-input-text'\n ]\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/inputnumber/inputnumberview\n */\nimport InputView from '../input/inputview.js';\n/**\n * The number input view class.\n */\nexport default class InputNumberView extends InputView {\n /**\n * Creates an instance of the input number view.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param options The options of the input.\n * @param options.min The value of the `min` DOM attribute (the lowest accepted value).\n * @param options.max The value of the `max` DOM attribute (the highest accepted value).\n * @param options.step The value of the `step` DOM attribute.\n */\n constructor(locale, { min, max, step } = {}) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('min', min);\n this.set('max', max);\n this.set('step', step);\n this.extendTemplate({\n attributes: {\n type: 'number',\n class: [\n 'ck-input-number'\n ],\n min: bind.to('min'),\n max: bind.to('max'),\n step: bind.to('step')\n }\n });\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./textarea.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./textarea.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/dropdownpanelview\n */\nimport View from '../view.js';\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\n/**\n * The dropdown panel view class.\n *\n * See {@link module:ui/dropdown/dropdownview~DropdownView} to learn about the common usage.\n */\nexport default class DropdownPanelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isVisible', false);\n this.set('position', 'se');\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-dropdown__panel',\n bind.to('position', value => `ck-dropdown__panel_${value}`),\n bind.if('isVisible', 'ck-dropdown__panel-visible')\n ],\n tabindex: '-1'\n },\n children: this.children,\n on: {\n // Drag and drop in the panel should not break the selection in the editor.\n // https://github.com/ckeditor/ckeditor5-ui/issues/228\n selectstart: bind.to(evt => {\n if (evt.target.tagName.toLocaleLowerCase() === 'input') {\n return;\n }\n evt.preventDefault();\n })\n }\n });\n }\n /**\n * Focuses the first view in the {@link #children} collection.\n *\n * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.\n */\n focus() {\n if (this.children.length) {\n const firstChild = this.children.first;\n if (typeof firstChild.focus === 'function') {\n firstChild.focus();\n }\n else {\n /**\n * The child view of a dropdown could not be focused because it is missing the `focus()` method.\n *\n * This warning appears when a dropdown {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open} and it\n * attempts to focus the {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#children first child} of its panel\n * but the child does not implement the\n * {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable focusable interface}.\n *\n * Focusing the content of a dropdown on open greatly improves the accessibility. Please make sure the view instance\n * provides the `focus()` method for the best user experience.\n *\n * @error ui-dropdown-panel-focus-child-missing-focus\n * @param childView\n * @param dropdownPanel\n */\n logWarning('ui-dropdown-panel-focus-child-missing-focus', { childView: this.children.first, dropdownPanel: this });\n }\n }\n }\n /**\n * Focuses the view element or last item in view collection on opening dropdown's panel.\n *\n * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.\n */\n focusLast() {\n if (this.children.length) {\n const lastChild = this.children.last;\n if (typeof lastChild.focusLast === 'function') {\n lastChild.focusLast();\n }\n else {\n lastChild.focus();\n }\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./dropdown.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./dropdown.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/dropdownview\n */\nimport View from '../view.js';\nimport { KeystrokeHandler, FocusTracker, getOptimalPosition } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/dropdown/dropdown.css';\n/**\n * The dropdown view class. It manages the dropdown button and dropdown panel.\n *\n * In most cases, the easiest way to create a dropdown is by using the {@link module:ui/dropdown/utils~createDropdown}\n * util:\n *\n * ```ts\n * const dropdown = createDropdown( locale );\n *\n * // Configure dropdown's button properties:\n * dropdown.buttonView.set( {\n * \tlabel: 'A dropdown',\n * \twithText: true\n * } );\n *\n * dropdown.render();\n *\n * dropdown.panelView.element.textContent = 'Content of the panel';\n *\n * // Will render a dropdown with a panel containing a \"Content of the panel\" text.\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * If you want to add a richer content to the dropdown panel, you can use the {@link module:ui/dropdown/utils~addListToDropdown}\n * and {@link module:ui/dropdown/utils~addToolbarToDropdown} helpers. See more examples in\n * {@link module:ui/dropdown/utils~createDropdown} documentation.\n *\n * If you want to create a completely custom dropdown, then you can compose it manually:\n *\n * ```ts\n * const button = new DropdownButtonView( locale );\n * const panel = new DropdownPanelView( locale );\n * const dropdown = new DropdownView( locale, button, panel );\n *\n * button.set( {\n * \tlabel: 'A dropdown',\n * \twithText: true\n * } );\n *\n * dropdown.render();\n *\n * panel.element.textContent = 'Content of the panel';\n *\n * // Will render a dropdown with a panel containing a \"Content of the panel\" text.\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * However, dropdown created this way will contain little behavior. You will need to implement handlers for actions\n * such as {@link module:ui/bindings/clickoutsidehandler~clickOutsideHandler clicking outside an open dropdown}\n * (which should close it) and support for arrow keys inside the panel. Therefore, unless you really know what\n * you do and you really need to do it, it is recommended to use the {@link module:ui/dropdown/utils~createDropdown} helper.\n */\nclass DropdownView extends View {\n /**\n * Creates an instance of the dropdown.\n *\n * Also see {@link #render}.\n *\n * @param locale The localization services instance.\n */\n constructor(locale, buttonView, panelView) {\n super(locale);\n const bind = this.bindTemplate;\n this.buttonView = buttonView;\n this.panelView = panelView;\n this.set('isOpen', false);\n this.set('isEnabled', true);\n this.set('class', undefined);\n this.set('id', undefined);\n this.set('panelPosition', 'auto');\n // Toggle the visibility of the panel when the dropdown becomes open.\n this.panelView.bind('isVisible').to(this, 'isOpen');\n this.keystrokes = new KeystrokeHandler();\n this.focusTracker = new FocusTracker();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-dropdown',\n bind.to('class'),\n bind.if('isEnabled', 'ck-disabled', value => !value)\n ],\n id: bind.to('id'),\n 'aria-describedby': bind.to('ariaDescribedById')\n },\n children: [\n buttonView,\n panelView\n ]\n });\n buttonView.extendTemplate({\n attributes: {\n class: [\n 'ck-dropdown__button'\n ],\n 'data-cke-tooltip-disabled': bind.to('isOpen')\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.buttonView.element);\n this.focusTracker.add(this.panelView.element);\n // Toggle the dropdown when its button has been clicked.\n this.listenTo(this.buttonView, 'open', () => {\n this.isOpen = !this.isOpen;\n });\n // Let the dropdown control the position of the panel. The position must\n // be updated every time the dropdown is open.\n this.on('change:isOpen', (evt, name, isOpen) => {\n if (!isOpen) {\n return;\n }\n // If \"auto\", find the best position of the panel to fit into the viewport.\n // Otherwise, simply assign the static position.\n if (this.panelPosition === 'auto') {\n const optimalPanelPosition = DropdownView._getOptimalPosition({\n element: this.panelView.element,\n target: this.buttonView.element,\n fitInViewport: true,\n positions: this._panelPositions\n });\n this.panelView.position = (optimalPanelPosition ? optimalPanelPosition.name : this._panelPositions[0].name);\n }\n else {\n this.panelView.position = this.panelPosition;\n }\n });\n // Listen for keystrokes coming from within #element.\n this.keystrokes.listenTo(this.element);\n const closeDropdown = (data, cancel) => {\n if (this.isOpen) {\n this.isOpen = false;\n cancel();\n }\n };\n // Open the dropdown panel using the arrow down key, just like with return or space.\n this.keystrokes.set('arrowdown', (data, cancel) => {\n // Don't open if the dropdown is disabled or already open.\n if (this.buttonView.isEnabled && !this.isOpen) {\n this.isOpen = true;\n cancel();\n }\n });\n // Block the right arrow key (until nested dropdowns are implemented).\n this.keystrokes.set('arrowright', (data, cancel) => {\n if (this.isOpen) {\n cancel();\n }\n });\n // Close the dropdown using the arrow left/escape key.\n this.keystrokes.set('arrowleft', closeDropdown);\n this.keystrokes.set('esc', closeDropdown);\n }\n /**\n * Focuses the {@link #buttonView}.\n */\n focus() {\n this.buttonView.focus();\n }\n /**\n * Returns {@link #panelView panel} positions to be used by the\n * {@link module:utils/dom/position~getOptimalPosition `getOptimalPosition()`}\n * utility considering the direction of the language the UI of the editor is displayed in.\n */\n get _panelPositions() {\n const { south, north, southEast, southWest, northEast, northWest, southMiddleEast, southMiddleWest, northMiddleEast, northMiddleWest } = DropdownView.defaultPanelPositions;\n if (this.locale.uiLanguageDirection !== 'rtl') {\n return [\n southEast, southWest, southMiddleEast, southMiddleWest, south,\n northEast, northWest, northMiddleEast, northMiddleWest, north\n ];\n }\n else {\n return [\n southWest, southEast, southMiddleWest, southMiddleEast, south,\n northWest, northEast, northMiddleWest, northMiddleEast, north\n ];\n }\n }\n}\n/**\n * A set of positioning functions used by the dropdown view to determine\n * the optimal position (i.e. fitting into the browser viewport) of its\n * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel} when\n * {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition} is set to 'auto'`.\n *\n * The available positioning functions are as follow:\n *\n * **South**\n *\n * * `south`\n *\n * ```\n *\t\t\t[ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * * `southEast`\n *\n * ```\n *\t\t[ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * * `southWest`\n *\n * ```\n *\t\t [ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * * `southMiddleEast`\n *\n * ```\n *\t\t [ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * * `southMiddleWest`\n *\n * ```\n *\t\t [ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * **North**\n *\n * * `north`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t [ Button ]\n * ```\n *\n * * `northEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t[ Button ]\n * ```\n *\n * * `northWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t [ Button ]\n * ```\n *\n * * `northMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t [ Button ]\n * ```\n *\n * * `northMiddleWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t [ Button ]\n * ```\n *\n * Positioning functions are compatible with {@link module:utils/dom/position~DomPoint}.\n *\n * The name that position function returns will be reflected in dropdown panel's class that\n * controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}\n * to learn more.\n */\nDropdownView.defaultPanelPositions = {\n south: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - (panelRect.width - buttonRect.width) / 2,\n name: 's'\n };\n },\n southEast: buttonRect => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left,\n name: 'se'\n };\n },\n southWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - panelRect.width + buttonRect.width,\n name: 'sw'\n };\n },\n southMiddleEast: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - (panelRect.width - buttonRect.width) / 4,\n name: 'sme'\n };\n },\n southMiddleWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - (panelRect.width - buttonRect.width) * 3 / 4,\n name: 'smw'\n };\n },\n north: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - (panelRect.width - buttonRect.width) / 2,\n name: 'n'\n };\n },\n northEast: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left,\n name: 'ne'\n };\n },\n northWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - panelRect.width + buttonRect.width,\n name: 'nw'\n };\n },\n northMiddleEast: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - (panelRect.width - buttonRect.width) / 4,\n name: 'nme'\n };\n },\n northMiddleWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - (panelRect.width - buttonRect.width) * 3 / 4,\n name: 'nmw'\n };\n }\n};\n/**\n * A function used to calculate the optimal position for the dropdown panel.\n */\nDropdownView._getOptimalPosition = getOptimalPosition;\nexport default DropdownView;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/button/dropdownbuttonview\n */\nimport ButtonView from '../../button/buttonview.js';\nimport IconView from '../../icon/iconview.js';\nimport dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';\n/**\n * The default dropdown button view class.\n *\n * ```ts\n * const view = new DropdownButtonView();\n *\n * view.set( {\n * \tlabel: 'A button',\n * \tkeystroke: 'Ctrl+B',\n * \ttooltip: true\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n *\n * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.\n */\nexport default class DropdownButtonView extends ButtonView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.arrowView = this._createArrowView();\n this.extendTemplate({\n attributes: {\n 'aria-haspopup': true,\n 'aria-expanded': this.bindTemplate.to('isOn', value => String(value))\n }\n });\n // The DropdownButton interface expects the open event upon which will open the dropdown.\n this.delegate('execute').to(this, 'open');\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.add(this.arrowView);\n }\n /**\n * Creates a {@link module:ui/icon/iconview~IconView} instance as {@link #arrowView}.\n */\n _createArrowView() {\n const arrowView = new IconView();\n arrowView.content = dropdownArrowIcon;\n arrowView.extendTemplate({\n attributes: {\n class: 'ck-dropdown__arrow'\n }\n });\n return arrowView;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/toolbarseparatorview\n */\nimport View from '../view.js';\n/**\n * The toolbar separator view class.\n */\nexport default class ToolbarSeparatorView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-toolbar__separator'\n ]\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/toolbarlinebreakview\n */\nimport View from '../view.js';\n/**\n * The toolbar line break view class.\n */\nexport default class ToolbarLineBreakView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-toolbar__line-break'\n ]\n }\n });\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./toolbar.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./toolbar.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/toolbarview\n */\nimport View from '../view.js';\nimport FocusCycler, { isFocusable } from '../focuscycler.js';\nimport ToolbarSeparatorView from './toolbarseparatorview.js';\nimport ToolbarLineBreakView from './toolbarlinebreakview.js';\nimport preventDefault from '../bindings/preventdefault.js';\nimport { createDropdown, addToolbarToDropdown } from '../dropdown/utils.js';\nimport normalizeToolbarConfig from './normalizetoolbarconfig.js';\nimport { FocusTracker, KeystrokeHandler, Rect, ResizeObserver, global, isVisible, logWarning } from '@ckeditor/ckeditor5-utils';\nimport { icons } from '@ckeditor/ckeditor5-core';\nimport { isObject } from 'lodash-es';\nimport '../../theme/components/toolbar/toolbar.css';\nexport const NESTED_TOOLBAR_ICONS = /* #__PURE__ */ (() => ({\n alignLeft: icons.alignLeft,\n bold: icons.bold,\n importExport: icons.importExport,\n paragraph: icons.paragraph,\n plus: icons.plus,\n text: icons.text,\n threeVerticalDots: icons.threeVerticalDots,\n pilcrow: icons.pilcrow,\n dragIndicator: icons.dragIndicator\n}))();\n/**\n * The toolbar view class.\n */\nexport default class ToolbarView extends View {\n /**\n * Creates an instance of the {@link module:ui/toolbar/toolbarview~ToolbarView} class.\n *\n * Also see {@link #render}.\n *\n * @param locale The localization services instance.\n * @param options Configuration options of the toolbar.\n */\n constructor(locale, options) {\n super(locale);\n const bind = this.bindTemplate;\n const t = this.t;\n this.options = options || {};\n this.set('ariaLabel', t('Editor toolbar'));\n this.set('maxWidth', 'auto');\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.set('class', undefined);\n this.set('isCompact', false);\n this.itemsView = new ItemsView(locale);\n this.children = this.createCollection();\n this.children.add(this.itemsView);\n this.focusables = this.createCollection();\n const isRtl = locale.uiLanguageDirection === 'rtl';\n this._focusCycler = new FocusCycler({\n focusables: this.focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate toolbar items backwards using the arrow[left,up] keys.\n focusPrevious: [isRtl ? 'arrowright' : 'arrowleft', 'arrowup'],\n // Navigate toolbar items forwards using the arrow[right,down] keys.\n focusNext: [isRtl ? 'arrowleft' : 'arrowright', 'arrowdown']\n }\n });\n const classes = [\n 'ck',\n 'ck-toolbar',\n bind.to('class'),\n bind.if('isCompact', 'ck-toolbar_compact')\n ];\n if (this.options.shouldGroupWhenFull && this.options.isFloating) {\n classes.push('ck-toolbar_floating');\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: classes,\n role: 'toolbar',\n 'aria-label': bind.to('ariaLabel'),\n style: {\n maxWidth: bind.to('maxWidth')\n },\n tabindex: -1\n },\n children: this.children,\n on: {\n // https://github.com/ckeditor/ckeditor5-ui/issues/206\n mousedown: preventDefault(this)\n }\n });\n this._behavior = this.options.shouldGroupWhenFull ? new DynamicGrouping(this) : new StaticLayout(this);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.element);\n // Children added before rendering should be known to the #focusTracker.\n for (const item of this.items) {\n this.focusTracker.add(item.element);\n }\n this.items.on('add', (evt, item) => {\n this.focusTracker.add(item.element);\n });\n this.items.on('remove', (evt, item) => {\n this.focusTracker.remove(item.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n this._behavior.render(this);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this._behavior.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n return super.destroy();\n }\n /**\n * Focuses the first focusable in {@link #focusables}.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the last focusable in {@link #focusables}.\n */\n focusLast() {\n this._focusCycler.focusLast();\n }\n /**\n * A utility that expands the plain toolbar configuration into\n * {@link module:ui/toolbar/toolbarview~ToolbarView#items} using a given component factory.\n *\n * @param itemsOrConfig The toolbar items or the entire toolbar configuration object.\n * @param factory A factory producing toolbar items.\n * @param removeItems An array of items names to be removed from the configuration. When present, applies\n * to this toolbar and all nested ones as well.\n */\n fillFromConfig(itemsOrConfig, factory, removeItems) {\n this.items.addMany(this._buildItemsFromConfig(itemsOrConfig, factory, removeItems));\n }\n /**\n * A utility that expands the plain toolbar configuration into a list of view items using a given component factory.\n *\n * @param itemsOrConfig The toolbar items or the entire toolbar configuration object.\n * @param factory A factory producing toolbar items.\n * @param removeItems An array of items names to be removed from the configuration. When present, applies\n * to this toolbar and all nested ones as well.\n */\n _buildItemsFromConfig(itemsOrConfig, factory, removeItems) {\n const config = normalizeToolbarConfig(itemsOrConfig);\n const normalizedRemoveItems = removeItems || config.removeItems;\n const itemsToAdd = this._cleanItemsConfiguration(config.items, factory, normalizedRemoveItems)\n .map(item => {\n if (isObject(item)) {\n return this._createNestedToolbarDropdown(item, factory, normalizedRemoveItems);\n }\n else if (item === '|') {\n return new ToolbarSeparatorView();\n }\n else if (item === '-') {\n return new ToolbarLineBreakView();\n }\n return factory.create(item);\n })\n .filter((item) => !!item);\n return itemsToAdd;\n }\n /**\n * Cleans up the {@link module:ui/toolbar/toolbarview~ToolbarView#items} of the toolbar by removing unwanted items and\n * duplicated (obsolete) separators or line breaks.\n *\n * @param items The toolbar items configuration.\n * @param factory A factory producing toolbar items.\n * @param removeItems An array of items names to be removed from the configuration.\n * @returns Items after the clean-up.\n */\n _cleanItemsConfiguration(items, factory, removeItems) {\n const filteredItems = items\n .filter((item, idx, items) => {\n if (item === '|') {\n return true;\n }\n // Items listed in `config.removeItems` should not be added to the toolbar.\n if (removeItems.indexOf(item) !== -1) {\n return false;\n }\n if (item === '-') {\n // The toolbar line breaks must not be rendered when toolbar grouping is enabled.\n // (https://github.com/ckeditor/ckeditor5/issues/8582)\n if (this.options.shouldGroupWhenFull) {\n /**\n * The toolbar multiline breaks (`-` items) only work when the automatic button grouping\n * is disabled in the toolbar configuration.\n * To do this, set the `shouldNotGroupWhenFull` option to `true` in the editor configuration:\n *\n * ```ts\n * const config = {\n * \ttoolbar: {\n * \t\titems: [ ... ],\n * \t\tshouldNotGroupWhenFull: true\n * \t}\n * }\n * ```\n *\n * Learn more about {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.\n *\n * @error toolbarview-line-break-ignored-when-grouping-items\n */\n logWarning('toolbarview-line-break-ignored-when-grouping-items', items);\n return false;\n }\n return true;\n }\n // For the items that cannot be instantiated we are sending warning message. We also filter them out.\n if (!isObject(item) && !factory.has(item)) {\n /**\n * There was a problem processing the configuration of the toolbar. The item with the given\n * name does not exist so it was omitted when rendering the toolbar.\n *\n * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed\n * to provide a toolbar item has not been loaded or there is a typo in the\n * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.\n *\n * Make sure the plugin responsible for this toolbar item is loaded and the toolbar configuration\n * is correct, e.g. {@link module:basic-styles/bold~Bold} is loaded for the `'bold'` toolbar item.\n *\n * You can use the following snippet to retrieve all available toolbar items:\n *\n * ```ts\n * Array.from( editor.ui.componentFactory.names() );\n * ```\n *\n * @error toolbarview-item-unavailable\n * @param item The name of the component or nested toolbar definition.\n */\n logWarning('toolbarview-item-unavailable', { item });\n return false;\n }\n return true;\n });\n return this._cleanSeparatorsAndLineBreaks(filteredItems);\n }\n /**\n * Remove leading, trailing, and duplicated separators (`-` and `|`).\n *\n * @returns Toolbar items after the separator and line break clean-up.\n */\n _cleanSeparatorsAndLineBreaks(items) {\n const nonSeparatorPredicate = (item) => (item !== '-' && item !== '|');\n const count = items.length;\n // Find an index of the first item that is not a separator.\n const firstCommandItemIndex = items.findIndex(nonSeparatorPredicate);\n // Items include separators only. There is no point in displaying them.\n if (firstCommandItemIndex === -1) {\n return [];\n }\n // Search from the end of the list, then convert found index back to the original direction.\n const lastCommandItemIndex = count - items\n .slice()\n .reverse()\n .findIndex(nonSeparatorPredicate);\n return items\n // Return items without the leading and trailing separators.\n .slice(firstCommandItemIndex, lastCommandItemIndex)\n // Remove duplicated separators.\n .filter((name, idx, items) => {\n // Filter only separators.\n if (nonSeparatorPredicate(name)) {\n return true;\n }\n const isDuplicated = idx > 0 && items[idx - 1] === name;\n return !isDuplicated;\n });\n }\n /**\n * Creates a user-defined dropdown containing a toolbar with items.\n *\n * @param definition A definition of the nested toolbar dropdown.\n * @param definition.label A label of the dropdown.\n * @param definition.icon An icon of the drop-down. One of 'bold', 'plus', 'text', 'importExport', 'alignLeft',\n * 'paragraph' or an SVG string. When `false` is passed, no icon will be used.\n * @param definition.withText When set `true`, the label of the dropdown will be visible. See\n * {@link module:ui/button/buttonview~ButtonView#withText} to learn more.\n * @param definition.tooltip A tooltip of the dropdown button. See\n * {@link module:ui/button/buttonview~ButtonView#tooltip} to learn more. Defaults to `true`.\n * @param componentFactory Component factory used to create items\n * of the nested toolbar.\n */\n _createNestedToolbarDropdown(definition, componentFactory, removeItems) {\n let { label, icon, items, tooltip = true, withText = false } = definition;\n items = this._cleanItemsConfiguration(items, componentFactory, removeItems);\n // There is no point in rendering a dropdown without items.\n if (!items.length) {\n return null;\n }\n const locale = this.locale;\n const dropdownView = createDropdown(locale);\n if (!label) {\n /**\n * A dropdown definition in the toolbar configuration is missing a text label.\n *\n * Without a label, the dropdown becomes inaccessible to users relying on assistive technologies.\n * Make sure the `label` property is set in your drop-down configuration:\n *\n * ```json\n * {\n * \tlabel: 'A human-readable label',\n * \ticon: '...',\n * \titems: [ ... ]\n * },\n * ```\n *\n * Learn more about {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.\n *\n * @error toolbarview-nested-toolbar-dropdown-missing-label\n */\n logWarning('toolbarview-nested-toolbar-dropdown-missing-label', definition);\n }\n dropdownView.class = 'ck-toolbar__nested-toolbar-dropdown';\n dropdownView.buttonView.set({\n label,\n tooltip,\n withText: !!withText\n });\n // Allow disabling icon by passing false.\n if (icon !== false) {\n // A pre-defined icon picked by name, SVG string, a fallback (default) icon.\n dropdownView.buttonView.icon = NESTED_TOOLBAR_ICONS[icon] || icon || icons.threeVerticalDots;\n }\n // If the icon is disabled, display the label automatically.\n else {\n dropdownView.buttonView.withText = true;\n }\n addToolbarToDropdown(dropdownView, () => (dropdownView.toolbarView._buildItemsFromConfig(items, componentFactory, removeItems)));\n return dropdownView;\n }\n}\n/**\n * An inner block of the {@link module:ui/toolbar/toolbarview~ToolbarView} hosting its\n * {@link module:ui/toolbar/toolbarview~ToolbarView#items}.\n */\nclass ItemsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-toolbar__items'\n ]\n },\n children: this.children\n });\n }\n}\n/**\n * A toolbar behavior that makes it static and unresponsive to the changes of the environment.\n * At the same time, it also makes it possible to display a toolbar with a vertical layout\n * using the {@link module:ui/toolbar/toolbarview~ToolbarView#isVertical} property.\n */\nclass StaticLayout {\n /**\n * Creates an instance of the {@link module:ui/toolbar/toolbarview~StaticLayout} toolbar\n * behavior.\n *\n * @param view An instance of the toolbar that this behavior is added to.\n */\n constructor(view) {\n const bind = view.bindTemplate;\n // Static toolbar can be vertical when needed.\n view.set('isVertical', false);\n // 1:1 pass–through binding, all ToolbarView#items are visible.\n view.itemsView.children.bindTo(view.items).using(item => item);\n // 1:1 pass–through binding, all ToolbarView#items are focusable.\n view.focusables.bindTo(view.items).using(item => isFocusable(item) ? item : null);\n view.extendTemplate({\n attributes: {\n class: [\n // When vertical, the toolbar has an additional CSS class.\n bind.if('isVertical', 'ck-toolbar_vertical')\n ]\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() { }\n /**\n * @inheritDoc\n */\n destroy() { }\n}\n/**\n * A toolbar behavior that makes the items respond to changes in the geometry.\n *\n * In a nutshell, it groups {@link module:ui/toolbar/toolbarview~ToolbarView#items}\n * that do not fit visually into a single row of the toolbar (due to limited space).\n * Items that do not fit are aggregated in a dropdown displayed at the end of the toolbar.\n *\n * ```\n *\t┌──────────────────────────────────────── ToolbarView ──────────────────────────────────────────â”\n *\t| ┌─────────────────────────────────────── #children ─────────────────────────────────────────┠|\n *\t| | ┌─────── #itemsView ────────┠┌──────────────────────┠┌── #groupedItemsDropdown ───┠| |\n *\t| | | #ungroupedItems | | ToolbarSeparatorView | | #groupedItems | | |\n *\t| | └──────────────────────────-┘ └──────────────────────┘ └────────────────────────────┘ | |\n *\t| | \\---------- only when toolbar items overflow -------/ | |\n *\t| └───────────────────────────────────────────────────────────────────────────────────────────┘ |\n *\t└───────────────────────────────────────────────────────────────────────────────────────────────┘\n * ```\n */\nclass DynamicGrouping {\n /**\n * Creates an instance of the {@link module:ui/toolbar/toolbarview~DynamicGrouping} toolbar\n * behavior.\n *\n * @param view An instance of the toolbar that this behavior is added to.\n */\n constructor(view) {\n /**\n * An instance of the resize observer that helps dynamically determine the geometry of the toolbar\n * and manage items that do not fit into a single row.\n *\n * **Note:** Created in {@link #_enableGroupingOnResize}.\n *\n * @readonly\n */\n this.resizeObserver = null;\n /**\n * A cached value of the horizontal padding style used by {@link #_updateGrouping}\n * to manage the {@link module:ui/toolbar/toolbarview~ToolbarView#items} that do not fit into\n * a single toolbar line. This value can be reused between updates because it is unlikely that\n * the padding will change and re–using `Window.getComputedStyle()` is expensive.\n *\n * @readonly\n */\n this.cachedPadding = null;\n /**\n * A flag indicating that an items grouping update has been queued (e.g. due to the toolbar being visible)\n * and should be executed immediately the next time the toolbar shows up.\n *\n * @readonly\n */\n this.shouldUpdateGroupingOnNextResize = false;\n this.view = view;\n this.viewChildren = view.children;\n this.viewFocusables = view.focusables;\n this.viewItemsView = view.itemsView;\n this.viewFocusTracker = view.focusTracker;\n this.viewLocale = view.locale;\n this.ungroupedItems = view.createCollection();\n this.groupedItems = view.createCollection();\n this.groupedItemsDropdown = this._createGroupedItemsDropdown();\n // Only those items that were not grouped are visible to the user.\n view.itemsView.children.bindTo(this.ungroupedItems).using(item => item);\n // Make sure all #items visible in the main space of the toolbar are \"focuscyclable\".\n this.ungroupedItems.on('change', this._updateFocusCyclableItems.bind(this));\n // Make sure the #groupedItemsDropdown is also included in cycling when it appears.\n view.children.on('change', this._updateFocusCyclableItems.bind(this));\n // ToolbarView#items is dynamic. When an item is added or removed, it should be automatically\n // represented in either grouped or ungrouped items at the right index.\n // In other words #items == concat( #ungroupedItems, #groupedItems )\n // (in length and order).\n view.items.on('change', (evt, changeData) => {\n const index = changeData.index;\n const added = Array.from(changeData.added);\n // Removing.\n for (const removedItem of changeData.removed) {\n if (index >= this.ungroupedItems.length) {\n this.groupedItems.remove(removedItem);\n }\n else {\n this.ungroupedItems.remove(removedItem);\n }\n }\n // Adding.\n for (let currentIndex = index; currentIndex < index + added.length; currentIndex++) {\n const addedItem = added[currentIndex - index];\n if (currentIndex > this.ungroupedItems.length) {\n this.groupedItems.add(addedItem, currentIndex - this.ungroupedItems.length);\n }\n else {\n this.ungroupedItems.add(addedItem, currentIndex);\n }\n }\n // When new ungrouped items join in and land in #ungroupedItems, there's a chance it causes\n // the toolbar to overflow.\n // Consequently if removed from grouped or ungrouped items, there is a chance\n // some new space is available and we could do some ungrouping.\n this._updateGrouping();\n });\n view.extendTemplate({\n attributes: {\n class: [\n // To group items dynamically, the toolbar needs a dedicated CSS class.\n 'ck-toolbar_grouping'\n ]\n }\n });\n }\n /**\n * Enables dynamic items grouping based on the dimensions of the toolbar.\n *\n * @param view An instance of the toolbar that this behavior is added to.\n */\n render(view) {\n this.viewElement = view.element;\n this._enableGroupingOnResize();\n this._enableGroupingOnMaxWidthChange(view);\n }\n /**\n * Cleans up the internals used by this behavior.\n */\n destroy() {\n // The dropdown may not be in ToolbarView#children at the moment of toolbar destruction\n // so let's make sure it's actually destroyed along with the toolbar.\n this.groupedItemsDropdown.destroy();\n this.resizeObserver.destroy();\n }\n /**\n * When called, it will check if any of the {@link #ungroupedItems} do not fit into a single row of the toolbar,\n * and it will move them to the {@link #groupedItems} when it happens.\n *\n * At the same time, it will also check if there is enough space in the toolbar for the first of the\n * {@link #groupedItems} to be returned back to {@link #ungroupedItems} and still fit into a single row\n * without the toolbar wrapping.\n */\n _updateGrouping() {\n // Do no grouping–related geometry analysis when the toolbar is detached from visible DOM,\n // for instance before #render(), or after render but without a parent or a parent detached\n // from DOM. DOMRects won't work anyway and there will be tons of warning in the console and\n // nothing else. This happens, for instance, when the toolbar is detached from DOM and\n // some logic adds or removes its #items.\n if (!this.viewElement.ownerDocument.body.contains(this.viewElement)) {\n return;\n }\n // Do not update grouping when the element is invisible. Such toolbar has DOMRect filled with zeros\n // and that would cause all items to be grouped. Instead, queue the grouping so it runs next time\n // the toolbar is visible (the next ResizeObserver callback execution). This is handy because\n // the grouping could be caused by increasing the #maxWidth when the toolbar was invisible and the next\n // time it shows up, some items could actually be ungrouped (https://github.com/ckeditor/ckeditor5/issues/6575).\n if (!isVisible(this.viewElement)) {\n this.shouldUpdateGroupingOnNextResize = true;\n return;\n }\n // Remember how many items were initially grouped so at the it is possible to figure out if the number\n // of grouped items has changed. If the number has changed, geometry of the toolbar has also changed.\n const initialGroupedItemsCount = this.groupedItems.length;\n let wereItemsGrouped;\n // Group #items as long as some wrap to the next row. This will happen, for instance,\n // when the toolbar is getting narrow and there is not enough space to display all items in\n // a single row.\n while (this._areItemsOverflowing) {\n this._groupLastItem();\n wereItemsGrouped = true;\n }\n // If none were grouped now but there were some items already grouped before,\n // then, what the hell, maybe let's see if some of them can be ungrouped. This happens when,\n // for instance, the toolbar is stretching and there's more space in it than before.\n if (!wereItemsGrouped && this.groupedItems.length) {\n // Ungroup items as long as none are overflowing or there are none to ungroup left.\n while (this.groupedItems.length && !this._areItemsOverflowing) {\n this._ungroupFirstItem();\n }\n // If the ungrouping ended up with some item wrapping to the next row,\n // put it back to the group toolbar (\"undo the last ungroup\"). We don't know whether\n // an item will wrap or not until we ungroup it (that's a DOM/CSS thing) so this\n // clean–up is vital for the algorithm.\n if (this._areItemsOverflowing) {\n this._groupLastItem();\n }\n }\n if (this.groupedItems.length !== initialGroupedItemsCount) {\n this.view.fire('groupedItemsUpdate');\n }\n }\n /**\n * Returns `true` when {@link module:ui/toolbar/toolbarview~ToolbarView#element} children visually overflow,\n * for instance if the toolbar is narrower than its members. Returns `false` otherwise.\n */\n get _areItemsOverflowing() {\n // An empty toolbar cannot overflow.\n if (!this.ungroupedItems.length) {\n return false;\n }\n const element = this.viewElement;\n const uiLanguageDirection = this.viewLocale.uiLanguageDirection;\n const lastChildRect = new Rect(element.lastChild);\n const toolbarRect = new Rect(element);\n if (!this.cachedPadding) {\n const computedStyle = global.window.getComputedStyle(element);\n const paddingProperty = uiLanguageDirection === 'ltr' ? 'paddingRight' : 'paddingLeft';\n // parseInt() is essential because of quirky floating point numbers logic and DOM.\n // If the padding turned out too big because of that, the grouped items dropdown would\n // always look (from the Rect perspective) like it overflows (while it's not).\n this.cachedPadding = Number.parseInt(computedStyle[paddingProperty]);\n }\n if (uiLanguageDirection === 'ltr') {\n return lastChildRect.right > toolbarRect.right - this.cachedPadding;\n }\n else {\n return lastChildRect.left < toolbarRect.left + this.cachedPadding;\n }\n }\n /**\n * Enables the functionality that prevents {@link #ungroupedItems} from overflowing (wrapping to the next row)\n * upon resize when there is little space available. Instead, the toolbar items are moved to the\n * {@link #groupedItems} collection and displayed in a dropdown at the end of the row (which has its own nested toolbar).\n *\n * When called, the toolbar will automatically analyze the location of its {@link #ungroupedItems} and \"group\"\n * them in the dropdown if necessary. It will also observe the browser window for size changes in\n * the future and respond to them by grouping more items or reverting already grouped back, depending\n * on the visual space available.\n */\n _enableGroupingOnResize() {\n let previousWidth;\n // TODO: Consider debounce.\n this.resizeObserver = new ResizeObserver(this.viewElement, entry => {\n if (!previousWidth || previousWidth !== entry.contentRect.width || this.shouldUpdateGroupingOnNextResize) {\n this.shouldUpdateGroupingOnNextResize = false;\n this._updateGrouping();\n previousWidth = entry.contentRect.width;\n }\n });\n this._updateGrouping();\n }\n /**\n * Enables the grouping functionality, just like {@link #_enableGroupingOnResize} but the difference is that\n * it listens to the changes of {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth} instead.\n */\n _enableGroupingOnMaxWidthChange(view) {\n view.on('change:maxWidth', () => {\n this._updateGrouping();\n });\n }\n /**\n * When called, it will remove the last item from {@link #ungroupedItems} and move it back\n * to the {@link #groupedItems} collection.\n *\n * The opposite of {@link #_ungroupFirstItem}.\n */\n _groupLastItem() {\n if (!this.groupedItems.length) {\n this.viewChildren.add(new ToolbarSeparatorView());\n this.viewChildren.add(this.groupedItemsDropdown);\n this.viewFocusTracker.add(this.groupedItemsDropdown.element);\n }\n this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last), 0);\n }\n /**\n * Moves the very first item belonging to {@link #groupedItems} back\n * to the {@link #ungroupedItems} collection.\n *\n * The opposite of {@link #_groupLastItem}.\n */\n _ungroupFirstItem() {\n this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first));\n if (!this.groupedItems.length) {\n this.viewChildren.remove(this.groupedItemsDropdown);\n this.viewChildren.remove(this.viewChildren.last);\n this.viewFocusTracker.remove(this.groupedItemsDropdown.element);\n }\n }\n /**\n * Creates the {@link #groupedItemsDropdown} that hosts the members of the {@link #groupedItems}\n * collection when there is not enough space in the toolbar to display all items in a single row.\n */\n _createGroupedItemsDropdown() {\n const locale = this.viewLocale;\n const t = locale.t;\n const dropdown = createDropdown(locale);\n dropdown.class = 'ck-toolbar__grouped-dropdown';\n // Make sure the dropdown never sticks out to the left/right. It should be under the main toolbar.\n // (https://github.com/ckeditor/ckeditor5/issues/5608)\n dropdown.panelPosition = locale.uiLanguageDirection === 'ltr' ? 'sw' : 'se';\n addToolbarToDropdown(dropdown, this.groupedItems);\n dropdown.buttonView.set({\n label: t('Show more items'),\n tooltip: true,\n tooltipPosition: locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw',\n icon: icons.threeVerticalDots\n });\n return dropdown;\n }\n /**\n * Updates the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables focus–cyclable items}\n * collection so it represents the up–to–date state of the UI from the perspective of the user.\n *\n * For instance, the {@link #groupedItemsDropdown} can show up and hide but when it is visible,\n * it must be subject to focus cycling in the toolbar.\n *\n * See the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables collection} documentation\n * to learn more about the purpose of this method.\n */\n _updateFocusCyclableItems() {\n this.viewFocusables.clear();\n this.ungroupedItems.map(item => {\n if (isFocusable(item)) {\n this.viewFocusables.add(item);\n }\n });\n if (this.groupedItems.length) {\n this.viewFocusables.add(this.groupedItemsDropdown);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A helper which executes a native `Event.preventDefault()` if the target of an event equals the\n * {@link module:ui/view~View#element element of the view}. It shortens the definition of a\n * {@link module:ui/view~View#template template}.\n *\n * ```ts\n * // In a class extending View.\n * import preventDefault from '@ckeditor/ckeditor5-ui/src/bindings/preventdefault';\n *\n * // ...\n *\n * this.setTemplate( {\n * \ttag: 'div',\n *\n * \ton: {\n * \t\t// Prevent the default mousedown action on this view.\n * \t\tmousedown: preventDefault( this )\n * \t}\n * } );\n * ```\n *\n * @param view View instance that defines the template.\n */\nexport default function preventDefault(view) {\n return view.bindTemplate.to(evt => {\n if (evt.target === view.element) {\n evt.preventDefault();\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/normalizetoolbarconfig\n */\n/**\n * Normalizes the toolbar configuration (`config.toolbar`), which:\n *\n * * may be defined as an `Array`:\n *\n * ```\n * toolbar: [ 'heading', 'bold', 'italic', 'link', ... ]\n * ```\n *\n * * or an `Object`:\n *\n * ```\n * toolbar: {\n * \titems: [ 'heading', 'bold', 'italic', 'link', ... ],\n * \tremoveItems: [ 'bold' ],\n * \t...\n * }\n * ```\n *\n * * or may not be defined at all (`undefined`)\n *\n * and returns it in the object form.\n *\n * @param config The value of `config.toolbar`.\n * @returns A normalized toolbar config object.\n */\nexport default function normalizeToolbarConfig(config) {\n if (Array.isArray(config)) {\n return {\n items: config,\n removeItems: []\n };\n }\n const predefinedConfigOptions = {\n items: [],\n removeItems: []\n };\n if (!config) {\n return predefinedConfigOptions;\n }\n return {\n ...predefinedConfigOptions,\n ...config\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/list/listitemview\n */\nimport View from '../view.js';\n/**\n * The list item view class.\n */\nexport default class ListItemView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isVisible', true);\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'li',\n attributes: {\n class: [\n 'ck',\n 'ck-list__item',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ],\n role: 'presentation'\n },\n children: this.children\n });\n }\n /**\n * Focuses the list item.\n */\n focus() {\n if (this.children.first) {\n this.children.first.focus();\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/list/listseparatorview\n */\nimport View from '../view.js';\n/**\n * The list separator view class.\n */\nexport default class ListSeparatorView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'li',\n attributes: {\n class: [\n 'ck',\n 'ck-list__separator'\n ]\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/list/listitemgroupview\n */\nimport View from '../view.js';\nimport ListView from './listview.js';\nimport LabelView from '../label/labelview.js';\nimport ListSeparatorView from './listseparatorview.js';\n/**\n * The list item group view class.\n */\nexport default class ListItemGroupView extends View {\n /**\n * Creates an instance of the list item group view class.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param labelView The instance of the group's label. If not provided, an instance of\n * {@link module:ui/label/labelview~LabelView} is used.\n */\n constructor(locale, labelView = new LabelView()) {\n super(locale);\n const bind = this.bindTemplate;\n const nestedList = new ListView(locale);\n this.set({\n label: '',\n isVisible: true\n });\n this.labelView = labelView;\n this.labelView.bind('text').to(this, 'label');\n this.children = this.createCollection();\n this.children.addMany([this.labelView, nestedList]);\n nestedList.set({\n role: 'group',\n ariaLabelledBy: labelView.id\n });\n // Disable focus tracking and accessible navigation in the child list.\n nestedList.focusTracker.destroy();\n nestedList.keystrokes.destroy();\n this.items = nestedList.items;\n this.setTemplate({\n tag: 'li',\n attributes: {\n role: 'presentation',\n class: [\n 'ck',\n 'ck-list__group',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ]\n },\n children: this.children\n });\n }\n /**\n * Focuses the list item (which is not a separator).\n */\n focus() {\n if (this.items) {\n const firstListItem = this.items.find(item => !(item instanceof ListSeparatorView));\n if (firstListItem) {\n firstListItem.focus();\n }\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./list.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./list.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/list/listview\n */\nimport View from '../view.js';\nimport FocusCycler from '../focuscycler.js';\nimport ListItemView from './listitemview.js';\nimport ListItemGroupView from './listitemgroupview.js';\nimport ViewCollection from '../viewcollection.js';\nimport { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/list/list.css';\n/**\n * The list view class.\n */\nexport default class ListView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n /**\n * A cached map of {@link module:ui/list/listitemgroupview~ListItemGroupView} to `change` event listeners for their `items`.\n * Used for accessibility and keyboard navigation purposes.\n */\n this._listItemGroupToChangeListeners = new WeakMap();\n const bind = this.bindTemplate;\n this.focusables = new ViewCollection();\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this._focusCycler = new FocusCycler({\n focusables: this.focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate list items backwards using the arrowup key.\n focusPrevious: 'arrowup',\n // Navigate toolbar items forwards using the arrowdown key.\n focusNext: 'arrowdown'\n }\n });\n this.set('ariaLabel', undefined);\n this.set('ariaLabelledBy', undefined);\n this.set('role', undefined);\n this.setTemplate({\n tag: 'ul',\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-list'\n ],\n role: bind.to('role'),\n 'aria-label': bind.to('ariaLabel'),\n 'aria-labelledby': bind.to('ariaLabelledBy')\n },\n children: this.items\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Items added before rendering should be known to the #focusTracker.\n for (const item of this.items) {\n if (item instanceof ListItemGroupView) {\n this._registerFocusableItemsGroup(item);\n }\n else if (item instanceof ListItemView) {\n this._registerFocusableListItem(item);\n }\n }\n this.items.on('change', (evt, data) => {\n for (const removed of data.removed) {\n if (removed instanceof ListItemGroupView) {\n this._deregisterFocusableItemsGroup(removed);\n }\n else if (removed instanceof ListItemView) {\n this._deregisterFocusableListItem(removed);\n }\n }\n for (const added of Array.from(data.added).reverse()) {\n if (added instanceof ListItemGroupView) {\n this._registerFocusableItemsGroup(added, data.index);\n }\n else {\n this._registerFocusableListItem(added, data.index);\n }\n }\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the first focusable in {@link #items}.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the first focusable in {@link #items}.\n */\n focusFirst() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the last focusable in {@link #items}.\n */\n focusLast() {\n this._focusCycler.focusLast();\n }\n /**\n * Registers a list item view in the focus tracker.\n *\n * @param item The list item view to be registered.\n * @param index Index of the list item view in the {@link #items} collection. If not specified, the item will be added at the end.\n */\n _registerFocusableListItem(item, index) {\n this.focusTracker.add(item.element);\n this.focusables.add(item, index);\n }\n /**\n * Removes a list item view from the focus tracker.\n *\n * @param item The list item view to be removed.\n */\n _deregisterFocusableListItem(item) {\n this.focusTracker.remove(item.element);\n this.focusables.remove(item);\n }\n /**\n * Gets a callback that will be called when the `items` collection of a {@link module:ui/list/listitemgroupview~ListItemGroupView}\n * change.\n *\n * @param groupView The group view for which the callback will be created.\n * @returns The callback function to be used for the items `change` event listener in a group.\n */\n _getOnGroupItemsChangeCallback(groupView) {\n return (evt, data) => {\n for (const removed of data.removed) {\n this._deregisterFocusableListItem(removed);\n }\n for (const added of Array.from(data.added).reverse()) {\n this._registerFocusableListItem(added, this.items.getIndex(groupView) + data.index);\n }\n };\n }\n /**\n * Registers a list item group view (and its children) in the focus tracker.\n *\n * @param groupView A group view to be registered.\n * @param groupIndex Index of the group view in the {@link #items} collection. If not specified, the group will be added at the end.\n */\n _registerFocusableItemsGroup(groupView, groupIndex) {\n Array.from(groupView.items).forEach((child, childIndex) => {\n const registeredChildIndex = typeof groupIndex !== 'undefined' ? groupIndex + childIndex : undefined;\n this._registerFocusableListItem(child, registeredChildIndex);\n });\n const groupItemsChangeCallback = this._getOnGroupItemsChangeCallback(groupView);\n // Cache the reference to the callback in case the group is removed (see _deregisterFocusableItemsGroup()).\n this._listItemGroupToChangeListeners.set(groupView, groupItemsChangeCallback);\n groupView.items.on('change', groupItemsChangeCallback);\n }\n /**\n * Removes a list item group view (and its children) from the focus tracker.\n *\n * @param groupView The group view to be removed.\n */\n _deregisterFocusableItemsGroup(groupView) {\n for (const child of groupView.items) {\n this._deregisterFocusableListItem(child);\n }\n groupView.items.off('change', this._listItemGroupToChangeListeners.get(groupView));\n this._listItemGroupToChangeListeners.delete(groupView);\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./splitbutton.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./splitbutton.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/button/splitbuttonview\n */\nimport View from '../../view.js';\nimport ButtonView from '../../button/buttonview.js';\nimport { KeystrokeHandler, FocusTracker } from '@ckeditor/ckeditor5-utils';\nimport dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';\nimport '../../../theme/components/dropdown/splitbutton.css';\n/**\n * The split button view class.\n *\n * ```ts\n * const view = new SplitButtonView();\n *\n * view.set( {\n * \tlabel: 'A button',\n * \tkeystroke: 'Ctrl+B',\n * \ttooltip: true\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n *\n * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.\n */\nexport default class SplitButtonView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale, actionButton) {\n super(locale);\n const bind = this.bindTemplate;\n // Implement the Button interface.\n this.set('class', undefined);\n this.set('labelStyle', undefined);\n this.set('icon', undefined);\n this.set('isEnabled', true);\n this.set('isOn', false);\n this.set('isToggleable', false);\n this.set('isVisible', true);\n this.set('keystroke', undefined);\n this.set('withKeystroke', false);\n this.set('label', undefined);\n this.set('tabindex', -1);\n this.set('tooltip', false);\n this.set('tooltipPosition', 's');\n this.set('type', 'button');\n this.set('withText', false);\n this.children = this.createCollection();\n this.actionView = this._createActionView(actionButton);\n this.arrowView = this._createArrowView();\n this.keystrokes = new KeystrokeHandler();\n this.focusTracker = new FocusTracker();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-splitbutton',\n bind.to('class'),\n bind.if('isVisible', 'ck-hidden', value => !value),\n this.arrowView.bindTemplate.if('isOn', 'ck-splitbutton_open')\n ]\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.add(this.actionView);\n this.children.add(this.arrowView);\n this.focusTracker.add(this.actionView.element);\n this.focusTracker.add(this.arrowView.element);\n this.keystrokes.listenTo(this.element);\n // Overrides toolbar focus cycling behavior.\n this.keystrokes.set('arrowright', (evt, cancel) => {\n if (this.focusTracker.focusedElement === this.actionView.element) {\n this.arrowView.focus();\n cancel();\n }\n });\n // Overrides toolbar focus cycling behavior.\n this.keystrokes.set('arrowleft', (evt, cancel) => {\n if (this.focusTracker.focusedElement === this.arrowView.element) {\n this.actionView.focus();\n cancel();\n }\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the {@link module:ui/button/buttonview~ButtonView#element} of the action part of split button.\n */\n focus() {\n this.actionView.focus();\n }\n /**\n * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #actionView} and binds it with main split button\n * attributes.\n */\n _createActionView(actionButton) {\n const actionView = actionButton || new ButtonView();\n if (!actionButton) {\n actionView.bind('icon', 'isEnabled', 'isOn', 'isToggleable', 'keystroke', 'label', 'tabindex', 'tooltip', 'tooltipPosition', 'type', 'withText').to(this);\n }\n actionView.extendTemplate({\n attributes: {\n class: 'ck-splitbutton__action'\n }\n });\n actionView.delegate('execute').to(this);\n return actionView;\n }\n /**\n * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #arrowView} and binds it with main split button\n * attributes.\n */\n _createArrowView() {\n const arrowView = new ButtonView();\n const bind = arrowView.bindTemplate;\n arrowView.icon = dropdownArrowIcon;\n arrowView.extendTemplate({\n attributes: {\n class: [\n 'ck-splitbutton__arrow'\n ],\n 'data-cke-tooltip-disabled': bind.to('isOn'),\n 'aria-haspopup': true,\n 'aria-expanded': bind.to('isOn', value => String(value))\n }\n });\n arrowView.bind('isEnabled').to(this);\n arrowView.bind('label').to(this);\n arrowView.bind('tooltip').to(this);\n arrowView.delegate('execute').to(this, 'open');\n return arrowView;\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./toolbardropdown.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./toolbardropdown.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./listdropdown.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./listdropdown.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/utils\n */\nimport DropdownPanelView from './dropdownpanelview.js';\nimport DropdownView from './dropdownview.js';\nimport DropdownButtonView from './button/dropdownbuttonview.js';\nimport ToolbarView from '../toolbar/toolbarview.js';\nimport ListView from '../list/listview.js';\nimport ListItemView from '../list/listitemview.js';\nimport ListSeparatorView from '../list/listseparatorview.js';\nimport SplitButtonView from './button/splitbuttonview.js';\nimport SwitchButtonView from '../button/switchbuttonview.js';\nimport ViewCollection from '../viewcollection.js';\nimport clickOutsideHandler from '../bindings/clickoutsidehandler.js';\nimport { global, priorities, logWarning } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/dropdown/toolbardropdown.css';\nimport '../../theme/components/dropdown/listdropdown.css';\nimport ListItemGroupView from '../list/listitemgroupview.js';\nimport ListItemButtonView from '../button/listitembuttonview.js';\n/**\n * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},\n * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},\n * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView panel} and all standard dropdown's behaviors.\n *\n * # Creating dropdowns\n *\n * By default, the default {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView} class is used as\n * definition of the button:\n *\n * ```ts\n * const dropdown = createDropdown( model );\n *\n * // Configure dropdown's button properties:\n * dropdown.buttonView.set( {\n * \tlabel: 'A dropdown',\n * \twithText: true\n * } );\n *\n * dropdown.render();\n *\n * // Will render a dropdown labeled \"A dropdown\" with an empty panel.\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * You can also provide other button views (they need to implement the\n * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface). For instance, you can use\n * {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} to create a dropdown with a split button.\n *\n * ```ts\n * const dropdown = createDropdown( locale, SplitButtonView );\n *\n * // Configure dropdown's button properties:\n * dropdown.buttonView.set( {\n * \tlabel: 'A dropdown',\n * \twithText: true\n * } );\n *\n * dropdown.buttonView.on( 'execute', () => {\n * \t// Add the behavior of the \"action part\" of the split button.\n * \t// Split button consists of the \"action part\" and \"arrow part\".\n * \t// The arrow opens the dropdown while the action part can have some other behavior.\n * } );\n *\n * dropdown.render();\n *\n * // Will render a dropdown labeled \"A dropdown\" with an empty panel.\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * # Adding content to the dropdown's panel\n *\n * The content of the panel can be inserted directly into the `dropdown.panelView.element`:\n *\n * ```ts\n * dropdown.panelView.element.textContent = 'Content of the panel';\n * ```\n *\n * However, most of the time you will want to add there either a {@link module:ui/list/listview~ListView list of options}\n * or a list of buttons (i.e. a {@link module:ui/toolbar/toolbarview~ToolbarView toolbar}).\n * To simplify the task, you can use, respectively, {@link module:ui/dropdown/utils~addListToDropdown} or\n * {@link module:ui/dropdown/utils~addToolbarToDropdown} utils.\n *\n * @param locale The locale instance.\n * @param ButtonClassOrInstance The dropdown button view class. Needs to implement the\n * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.\n * @returns The dropdown view instance.\n */\nexport function createDropdown(locale, ButtonClassOrInstance = DropdownButtonView) {\n const buttonView = typeof ButtonClassOrInstance == 'function' ? new ButtonClassOrInstance(locale) : ButtonClassOrInstance;\n const panelView = new DropdownPanelView(locale);\n const dropdownView = new DropdownView(locale, buttonView, panelView);\n buttonView.bind('isEnabled').to(dropdownView);\n if (buttonView instanceof SplitButtonView) {\n buttonView.arrowView.bind('isOn').to(dropdownView, 'isOpen');\n }\n else {\n buttonView.bind('isOn').to(dropdownView, 'isOpen');\n }\n addDefaultBehavior(dropdownView);\n return dropdownView;\n}\n/**\n * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.\n *\n * ```ts\n * const buttonsCreator = () => {\n * \tconst buttons = [];\n *\n * \t// Either create a new ButtonView instance or create existing.\n * \tbuttons.push( new ButtonView() );\n * \tbuttons.push( editor.ui.componentFactory.create( 'someButton' ) );\n * };\n *\n * const dropdown = createDropdown( locale );\n *\n * addToolbarToDropdown( dropdown, buttonsCreator, { isVertical: true } );\n *\n * // Will render a vertical button dropdown labeled \"A button dropdown\"\n * // with a button group in the panel containing two buttons.\n * // Buttons inside the dropdown will be created on first dropdown panel open.\n * dropdown.render()\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * **Note:** To improve the accessibility, you can tell the dropdown to focus the first active button of the toolbar when the dropdown\n * {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}. See the documentation of `options` to learn more.\n *\n * **Note:** Toolbar view will be created on first open of the dropdown.\n *\n * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:ui/toolbar/toolbarview~ToolbarView}.\n *\n * @param dropdownView A dropdown instance to which `ToolbarView` will be added.\n * @param options.enableActiveItemFocusOnDropdownOpen When set `true`, the focus will automatically move to the first\n * active {@link module:ui/toolbar/toolbarview~ToolbarView#items item} of the toolbar upon\n * {@link module:ui/dropdown/dropdownview~DropdownView#isOpen opening} the dropdown. Active items are those with the `isOn` property set\n * `true` (for instance {@link module:ui/button/buttonview~ButtonView buttons}). If no active items is found, the toolbar will be focused\n * as a whole resulting in the focus moving to its first focusable item (default behavior of\n * {@link module:ui/dropdown/dropdownview~DropdownView}).\n * @param options.ariaLabel Label used by assistive technologies to describe toolbar element.\n * @param options.maxWidth The maximum width of the toolbar element.\n * Details: {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth}.\n * @param options.class An additional CSS class added to the toolbar element.\n * @param options.isCompact When set true, makes the toolbar look compact with toolbar element.\n * @param options.isVertical Controls the orientation of toolbar items.\n */\nexport function addToolbarToDropdown(dropdownView, buttonsOrCallback, options = {}) {\n dropdownView.extendTemplate({\n attributes: {\n class: ['ck-toolbar-dropdown']\n }\n });\n if (dropdownView.isOpen) {\n addToolbarToOpenDropdown(dropdownView, buttonsOrCallback, options);\n }\n else {\n dropdownView.once('change:isOpen', () => addToolbarToOpenDropdown(dropdownView, buttonsOrCallback, options), { priority: 'highest' });\n }\n if (options.enableActiveItemFocusOnDropdownOpen) {\n // Accessibility: Focus the first active button in the toolbar when the dropdown gets open.\n focusChildOnDropdownOpen(dropdownView, () => dropdownView.toolbarView.items.find((item) => item.isOn));\n }\n}\n/**\n * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.\n */\nfunction addToolbarToOpenDropdown(dropdownView, buttonsOrCallback, options) {\n const locale = dropdownView.locale;\n const t = locale.t;\n const toolbarView = dropdownView.toolbarView = new ToolbarView(locale);\n const buttons = typeof buttonsOrCallback == 'function' ? buttonsOrCallback() : buttonsOrCallback;\n toolbarView.ariaLabel = options.ariaLabel || t('Dropdown toolbar');\n if (options.maxWidth) {\n toolbarView.maxWidth = options.maxWidth;\n }\n if (options.class) {\n toolbarView.class = options.class;\n }\n if (options.isCompact) {\n toolbarView.isCompact = options.isCompact;\n }\n if (options.isVertical) {\n toolbarView.isVertical = true;\n }\n if (buttons instanceof ViewCollection) {\n toolbarView.items.bindTo(buttons).using(item => item);\n }\n else {\n toolbarView.items.addMany(buttons);\n }\n dropdownView.panelView.children.add(toolbarView);\n toolbarView.items.delegate('execute').to(dropdownView);\n}\n/**\n * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.\n *\n * ```ts\n * const items = new Collection<ListDropdownItemDefinition>();\n *\n * items.add( {\n * \ttype: 'button',\n * \tmodel: new Model( {\n * \t\twithText: true,\n * \t\tlabel: 'First item',\n * \t\tlabelStyle: 'color: red'\n * \t} )\n * } );\n *\n * items.add( {\n * \t type: 'button',\n * \t model: new Model( {\n * \t\twithText: true,\n * \t\tlabel: 'Second item',\n * \t\tlabelStyle: 'color: green',\n * \t\tclass: 'foo'\n * \t} )\n * } );\n *\n * const dropdown = createDropdown( locale );\n *\n * addListToDropdown( dropdown, items );\n *\n * // Will render a dropdown with a list in the panel containing two items.\n * dropdown.render()\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * The `items` collection passed to this methods controls the presence and attributes of respective\n * {@link module:ui/list/listitemview~ListItemView list items}.\n *\n * **Note:** To improve the accessibility, when a list is added to the dropdown using this helper the dropdown will automatically attempt\n * to focus the first active item (a host to a {@link module:ui/button/buttonview~ButtonView} with\n * {@link module:ui/button/buttonview~ButtonView#isOn} set `true`) or the very first item when none are active.\n *\n * **Note:** List view will be created on first open of the dropdown.\n *\n * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:list/list~List}.\n *\n * @param dropdownView A dropdown instance to which `ListVIew` will be added.\n * @param itemsOrCallback A collection of the list item definitions or a callback returning a list item definitions to populate the list.\n * @param options.ariaLabel Label used by assistive technologies to describe list element.\n * @param options.role Will be reflected by the `role` DOM attribute in `ListVIew` and used by assistive technologies.\n */\nexport function addListToDropdown(dropdownView, itemsOrCallback, options = {}) {\n if (dropdownView.isOpen) {\n addListToOpenDropdown(dropdownView, itemsOrCallback, options);\n }\n else {\n dropdownView.once('change:isOpen', () => addListToOpenDropdown(dropdownView, itemsOrCallback, options), { priority: 'highest' });\n }\n // Accessibility: Focus the first active button in the list when the dropdown gets open.\n focusChildOnDropdownOpen(dropdownView, () => dropdownView.listView.items.find(item => {\n if (item instanceof ListItemView) {\n return item.children.first.isOn;\n }\n return false;\n }));\n}\n/**\n * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.\n */\nfunction addListToOpenDropdown(dropdownView, itemsOrCallback, options) {\n const locale = dropdownView.locale;\n const listView = dropdownView.listView = new ListView(locale);\n const items = typeof itemsOrCallback == 'function' ? itemsOrCallback() : itemsOrCallback;\n listView.ariaLabel = options.ariaLabel;\n listView.role = options.role;\n bindViewCollectionItemsToDefinitions(dropdownView, listView.items, items, locale);\n dropdownView.panelView.children.add(listView);\n listView.items.delegate('execute').to(dropdownView);\n}\n/**\n * A helper to be used on an existing {@link module:ui/dropdown/dropdownview~DropdownView} that focuses\n * a specific child in DOM when the dropdown {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}.\n *\n * @param dropdownView A dropdown instance to which the focus behavior will be added.\n * @param childSelectorCallback A callback executed when the dropdown gets open. It should return a {@link module:ui/view~View}\n * instance (child of {@link module:ui/dropdown/dropdownview~DropdownView#panelView}) that will get focused or a falsy value.\n * If falsy value is returned, a default behavior of the dropdown will engage focusing the first focusable child in\n * the {@link module:ui/dropdown/dropdownview~DropdownView#panelView}.\n */\nexport function focusChildOnDropdownOpen(dropdownView, childSelectorCallback) {\n dropdownView.on('change:isOpen', () => {\n if (!dropdownView.isOpen) {\n return;\n }\n const childToFocus = childSelectorCallback();\n if (!childToFocus) {\n return;\n }\n if (typeof childToFocus.focus === 'function') {\n childToFocus.focus();\n }\n else {\n /**\n * The child view of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} is missing the `focus()` method\n * and could not be focused when the dropdown got {@link module:ui/dropdown/dropdownview~DropdownView#isOpen open}.\n *\n * Making the content of a dropdown focusable in this case greatly improves the accessibility. Please make the view instance\n * implements the {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable focusable interface} for the best user\n * experience.\n *\n * @error ui-dropdown-focus-child-on-open-child-missing-focus\n * @param {module:ui/view~View} view\n */\n logWarning('ui-dropdown-focus-child-on-open-child-missing-focus', { view: childToFocus });\n }\n // * Let the panel show up first (do not focus an invisible element).\n // * Execute after focusDropdownPanelOnOpen(). See focusDropdownPanelOnOpen() to learn more.\n }, { priority: priorities.low - 10 });\n}\n/**\n * Add a set of default behaviors to dropdown view.\n */\nfunction addDefaultBehavior(dropdownView) {\n closeDropdownOnClickOutside(dropdownView);\n closeDropdownOnExecute(dropdownView);\n closeDropdownOnBlur(dropdownView);\n focusDropdownContentsOnArrows(dropdownView);\n focusDropdownButtonOnClose(dropdownView);\n focusDropdownPanelOnOpen(dropdownView);\n}\n/**\n * Adds a behavior to a dropdownView that closes opened dropdown when user clicks outside the dropdown.\n */\nfunction closeDropdownOnClickOutside(dropdownView) {\n dropdownView.on('render', () => {\n clickOutsideHandler({\n emitter: dropdownView,\n activator: () => dropdownView.isOpen,\n callback: () => {\n dropdownView.isOpen = false;\n },\n contextElements: () => [\n dropdownView.element,\n ...dropdownView.focusTracker._elements\n ]\n });\n });\n}\n/**\n * Adds a behavior to a dropdownView that closes the dropdown view on \"execute\" event.\n */\nfunction closeDropdownOnExecute(dropdownView) {\n // Close the dropdown when one of the list items has been executed.\n dropdownView.on('execute', evt => {\n // Toggling a switch button view should not close the dropdown.\n if (evt.source instanceof SwitchButtonView) {\n return;\n }\n dropdownView.isOpen = false;\n });\n}\n/**\n * Adds a behavior to a dropdown view that closes opened dropdown when it loses focus.\n */\nfunction closeDropdownOnBlur(dropdownView) {\n dropdownView.focusTracker.on('change:isFocused', (evt, name, isFocused) => {\n if (dropdownView.isOpen && !isFocused) {\n dropdownView.isOpen = false;\n }\n });\n}\n/**\n * Adds a behavior to a dropdownView that focuses the dropdown's panel view contents on keystrokes.\n */\nfunction focusDropdownContentsOnArrows(dropdownView) {\n // If the dropdown panel is already open, the arrow down key should focus the first child of the #panelView.\n dropdownView.keystrokes.set('arrowdown', (data, cancel) => {\n if (dropdownView.isOpen) {\n dropdownView.panelView.focus();\n cancel();\n }\n });\n // If the dropdown panel is already open, the arrow up key should focus the last child of the #panelView.\n dropdownView.keystrokes.set('arrowup', (data, cancel) => {\n if (dropdownView.isOpen) {\n dropdownView.panelView.focusLast();\n cancel();\n }\n });\n}\n/**\n * Adds a behavior that focuses the #buttonView when the dropdown was closed but focus was within the #panelView element.\n * This makes sure the focus is never lost.\n */\nfunction focusDropdownButtonOnClose(dropdownView) {\n dropdownView.on('change:isOpen', (evt, name, isOpen) => {\n if (isOpen) {\n return;\n }\n const element = dropdownView.panelView.element;\n // If the dropdown was closed, move the focus back to the button (#12125).\n // Don't touch the focus, if it moved somewhere else (e.g. moved to the editing root on #execute) (#12178).\n // Note: Don't use the state of the DropdownView#focusTracker here. It fires #blur with the timeout.\n if (element && element.contains(global.document.activeElement)) {\n dropdownView.buttonView.focus();\n }\n });\n}\n/**\n * Adds a behavior that focuses the #panelView when dropdown gets open (accessibility).\n */\nfunction focusDropdownPanelOnOpen(dropdownView) {\n dropdownView.on('change:isOpen', (evt, name, isOpen) => {\n if (!isOpen) {\n return;\n }\n // Focus the first item in the dropdown when the dropdown opened.\n dropdownView.panelView.focus();\n // * Let the panel show up first (do not focus an invisible element).\n // * Also, execute before focusChildOnDropdownOpen() to make sure this helper does not break the\n // focus of a specific child by kicking in too late and resetting the focus in the panel.\n }, { priority: 'low' });\n}\n/**\n * This helper populates a dropdown list with items and groups according to the\n * collection of item definitions. A permanent binding is created in this process allowing\n * dynamic management of the dropdown list content.\n *\n * @param dropdownView\n * @param listItems\n * @param definitions\n * @param locale\n */\nfunction bindViewCollectionItemsToDefinitions(dropdownView, listItems, definitions, locale) {\n // List item checkboxes have a reserved space for the check icon, so we need to know if there are any checkboxes in the list\n // to adjust the layout accordingly. It'd look weird if the items on the list were not aligned horizontally.\n //\n // Possible theoretical performance problem if many items are added one by one, as this will be called for each item.\n listItems.on('change', () => {\n // Filter-map. Check all items, leave only these that have buttons and return the buttons.\n const listItemButtons = [...listItems].reduce((acc, item) => {\n if (item instanceof ListItemView && item.children.first instanceof ListItemButtonView) {\n acc.push(item.children.first);\n }\n return acc;\n }, []);\n const hasAnyCheckboxOnList = listItemButtons.some(button => button.isToggleable);\n listItemButtons.forEach(item => {\n item.hasCheckSpace = hasAnyCheckboxOnList;\n });\n });\n listItems.bindTo(definitions).using(def => {\n if (def.type === 'separator') {\n return new ListSeparatorView(locale);\n }\n else if (def.type === 'group') {\n const groupView = new ListItemGroupView(locale);\n groupView.set({ label: def.label });\n bindViewCollectionItemsToDefinitions(dropdownView, groupView.items, def.items, locale);\n groupView.items.delegate('execute').to(dropdownView);\n return groupView;\n }\n else if (def.type === 'button' || def.type === 'switchbutton') {\n const isToggleable = def.model.role === 'menuitemcheckbox' || def.model.role === 'menuitemradio';\n const listItemView = new ListItemView(locale);\n let buttonView;\n if (def.type === 'button') {\n buttonView = new ListItemButtonView(locale);\n buttonView.set({\n isToggleable\n });\n }\n else {\n buttonView = new SwitchButtonView(locale);\n }\n // Bind all model properties to the button view.\n buttonView.bind(...Object.keys(def.model)).to(def.model);\n buttonView.delegate('execute').to(listItemView);\n listItemView.children.add(buttonView);\n return listItemView;\n }\n return null;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/labeledfield/utils\n */\nimport InputTextView from '../inputtext/inputtextview.js';\nimport InputNumberView from '../inputnumber/inputnumberview.js';\nimport TextareaView from '../textarea/textareaview.js';\nimport { createDropdown } from '../dropdown/utils.js';\n/**\n * A helper for creating labeled inputs.\n *\n * It creates an instance of a {@link module:ui/inputtext/inputtextview~InputTextView input text} that is\n * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.\n *\n * The helper does the following:\n *\n * * It sets input's `id` and `ariaDescribedById` attributes.\n * * It binds input's `isReadOnly` to the labeled view.\n * * It binds input's `hasError` to the labeled view.\n * * It enables a logic that cleans up the error when user starts typing in the input.\n *\n * Usage:\n *\n * ```ts\n * const labeledInputView = new LabeledFieldView( locale, createLabeledInputText );\n * console.log( labeledInputView.fieldView ); // A text input instance.\n * ```\n *\n * @param labeledFieldView The instance of the labeled field view.\n * @param viewUid A UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.\n * @param statusUid A UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.\n * @returns The input text view instance.\n */\nconst createLabeledInputText = (labeledFieldView, viewUid, statusUid) => {\n const inputView = new InputTextView(labeledFieldView.locale);\n inputView.set({\n id: viewUid,\n ariaDescribedById: statusUid\n });\n inputView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);\n inputView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);\n inputView.on('input', () => {\n // UX: Make the error text disappear and disable the error indicator as the user\n // starts fixing the errors.\n labeledFieldView.errorText = null;\n });\n labeledFieldView.bind('isEmpty', 'isFocused', 'placeholder').to(inputView);\n return inputView;\n};\n/**\n * A helper for creating labeled number inputs.\n *\n * It creates an instance of a {@link module:ui/inputnumber/inputnumberview~InputNumberView input number} that is\n * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.\n *\n * The helper does the following:\n *\n * * It sets input's `id` and `ariaDescribedById` attributes.\n * * It binds input's `isReadOnly` to the labeled view.\n * * It binds input's `hasError` to the labeled view.\n * * It enables a logic that cleans up the error when user starts typing in the input.\n *\n * Usage:\n *\n * ```ts\n * const labeledInputView = new LabeledFieldView( locale, createLabeledInputNumber );\n * console.log( labeledInputView.fieldView ); // A number input instance.\n * ```\n *\n * @param labeledFieldView The instance of the labeled field view.\n * @param viewUid A UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.\n * @param statusUid A UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.\n * @returns The input number view instance.\n */\nconst createLabeledInputNumber = (labeledFieldView, viewUid, statusUid) => {\n const inputView = new InputNumberView(labeledFieldView.locale);\n inputView.set({\n id: viewUid,\n ariaDescribedById: statusUid,\n inputMode: 'numeric'\n });\n inputView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);\n inputView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);\n inputView.on('input', () => {\n // UX: Make the error text disappear and disable the error indicator as the user\n // starts fixing the errors.\n labeledFieldView.errorText = null;\n });\n labeledFieldView.bind('isEmpty', 'isFocused', 'placeholder').to(inputView);\n return inputView;\n};\n/**\n * A helper for creating labeled textarea.\n *\n * It creates an instance of a {@link module:ui/textarea/textareaview~TextareaView textarea} that is\n * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.\n *\n * The helper does the following:\n *\n * * It sets textarea's `id` and `ariaDescribedById` attributes.\n * * It binds textarea's `isReadOnly` to the labeled view.\n * * It binds textarea's `hasError` to the labeled view.\n * * It enables a logic that cleans up the error when user starts typing in the textarea.\n *\n * Usage:\n *\n * ```ts\n * const labeledTextarea = new LabeledFieldView( locale, createLabeledTextarea );\n * console.log( labeledTextarea.fieldView ); // A textarea instance.\n * ```\n *\n * @param labeledFieldView The instance of the labeled field view.\n * @param viewUid A UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the textarea.\n * @param statusUid A UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the textarea.\n * @returns The textarea view instance.\n */\nconst createLabeledTextarea = (labeledFieldView, viewUid, statusUid) => {\n const textareaView = new TextareaView(labeledFieldView.locale);\n textareaView.set({\n id: viewUid,\n ariaDescribedById: statusUid\n });\n textareaView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);\n textareaView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);\n textareaView.on('input', () => {\n // UX: Make the error text disappear and disable the error indicator as the user\n // starts fixing the errors.\n labeledFieldView.errorText = null;\n });\n labeledFieldView.bind('isEmpty', 'isFocused', 'placeholder').to(textareaView);\n return textareaView;\n};\n/**\n * A helper for creating labeled dropdowns.\n *\n * It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} that is\n * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled field view}.\n *\n * The helper does the following:\n *\n * * It sets dropdown's `id` and `ariaDescribedById` attributes.\n * * It binds input's `isEnabled` to the labeled view.\n *\n * Usage:\n *\n * ```ts\n * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );\n * console.log( labeledInputView.fieldView ); // A dropdown instance.\n * ```\n *\n * @param labeledFieldView The instance of the labeled field view.\n * @param viewUid A UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view label} and the dropdown.\n * @param statusUid A UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view status} and the dropdown.\n * @returns The dropdown view instance.\n */\nconst createLabeledDropdown = (labeledFieldView, viewUid, statusUid) => {\n const dropdownView = createDropdown(labeledFieldView.locale);\n dropdownView.set({\n id: viewUid,\n ariaDescribedById: statusUid\n });\n dropdownView.bind('isEnabled').to(labeledFieldView);\n return dropdownView;\n};\nexport { createLabeledInputNumber, createLabeledInputText, createLabeledTextarea, createLabeledDropdown };\n","// Clamps a value between an upper and lower bound.\n// We use ternary operators because it makes the minified code\n// 2 times shorter then `Math.min(Math.max(a,b),c)`\nexport const clamp = (number, min = 0, max = 1) => {\n return number > max ? max : number < min ? min : number;\n};\nexport const round = (number, digits = 0, base = Math.pow(10, digits)) => {\n return Math.round(base * number) / base;\n};\n//# sourceMappingURL=math.js.map","import { round } from './math.js';\n/**\n * Valid CSS <angle> units.\n * https://developer.mozilla.org/en-US/docs/Web/CSS/angle\n */\nconst angleUnits = {\n grad: 360 / 400,\n turn: 360,\n rad: 360 / (Math.PI * 2)\n};\nexport const hexToHsva = (hex) => rgbaToHsva(hexToRgba(hex));\nexport const hexToRgba = (hex) => {\n if (hex[0] === '#')\n hex = hex.substring(1);\n if (hex.length < 6) {\n return {\n r: parseInt(hex[0] + hex[0], 16),\n g: parseInt(hex[1] + hex[1], 16),\n b: parseInt(hex[2] + hex[2], 16),\n a: hex.length === 4 ? round(parseInt(hex[3] + hex[3], 16) / 255, 2) : 1\n };\n }\n return {\n r: parseInt(hex.substring(0, 2), 16),\n g: parseInt(hex.substring(2, 4), 16),\n b: parseInt(hex.substring(4, 6), 16),\n a: hex.length === 8 ? round(parseInt(hex.substring(6, 8), 16) / 255, 2) : 1\n };\n};\nexport const parseHue = (value, unit = 'deg') => {\n return Number(value) * (angleUnits[unit] || 1);\n};\nexport const hslaStringToHsva = (hslString) => {\n const matcher = /hsla?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hslString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return hslaToHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n l: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1)\n });\n};\nexport const hslStringToHsva = hslaStringToHsva;\nexport const hslaToHsva = ({ h, s, l, a }) => {\n s *= (l < 50 ? l : 100 - l) / 100;\n return {\n h: h,\n s: s > 0 ? ((2 * s) / (l + s)) * 100 : 0,\n v: l + s,\n a\n };\n};\nexport const hsvaToHex = (hsva) => rgbaToHex(hsvaToRgba(hsva));\nexport const hsvaToHsla = ({ h, s, v, a }) => {\n const hh = ((200 - s) * v) / 100;\n return {\n h: round(h),\n s: round(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0),\n l: round(hh / 2),\n a: round(a, 2)\n };\n};\nexport const hsvaToHsvString = (hsva) => {\n const { h, s, v } = roundHsva(hsva);\n return `hsv(${h}, ${s}%, ${v}%)`;\n};\nexport const hsvaToHsvaString = (hsva) => {\n const { h, s, v, a } = roundHsva(hsva);\n return `hsva(${h}, ${s}%, ${v}%, ${a})`;\n};\nexport const hsvaToHslString = (hsva) => {\n const { h, s, l } = hsvaToHsla(hsva);\n return `hsl(${h}, ${s}%, ${l}%)`;\n};\nexport const hsvaToHslaString = (hsva) => {\n const { h, s, l, a } = hsvaToHsla(hsva);\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n};\nexport const hsvaToRgba = ({ h, s, v, a }) => {\n h = (h / 360) * 6;\n s = s / 100;\n v = v / 100;\n const hh = Math.floor(h), b = v * (1 - s), c = v * (1 - (h - hh) * s), d = v * (1 - (1 - h + hh) * s), module = hh % 6;\n return {\n r: round([v, c, b, b, d, v][module] * 255),\n g: round([d, v, v, c, b, b][module] * 255),\n b: round([b, b, d, v, v, c][module] * 255),\n a: round(a, 2)\n };\n};\nexport const hsvaToRgbString = (hsva) => {\n const { r, g, b } = hsvaToRgba(hsva);\n return `rgb(${r}, ${g}, ${b})`;\n};\nexport const hsvaToRgbaString = (hsva) => {\n const { r, g, b, a } = hsvaToRgba(hsva);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n};\nexport const hsvaStringToHsva = (hsvString) => {\n const matcher = /hsva?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hsvString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return roundHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n v: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1)\n });\n};\nexport const hsvStringToHsva = hsvaStringToHsva;\nexport const rgbaStringToHsva = (rgbaString) => {\n const matcher = /rgba?\\(?\\s*(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(rgbaString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return rgbaToHsva({\n r: Number(match[1]) / (match[2] ? 100 / 255 : 1),\n g: Number(match[3]) / (match[4] ? 100 / 255 : 1),\n b: Number(match[5]) / (match[6] ? 100 / 255 : 1),\n a: match[7] === undefined ? 1 : Number(match[7]) / (match[8] ? 100 : 1)\n });\n};\nexport const rgbStringToHsva = rgbaStringToHsva;\nconst format = (number) => {\n const hex = number.toString(16);\n return hex.length < 2 ? '0' + hex : hex;\n};\nexport const rgbaToHex = ({ r, g, b, a }) => {\n const alphaHex = a < 1 ? format(round(a * 255)) : '';\n return '#' + format(r) + format(g) + format(b) + alphaHex;\n};\nexport const rgbaToHsva = ({ r, g, b, a }) => {\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n // prettier-ignore\n const hh = delta\n ? max === r\n ? (g - b) / delta\n : max === g\n ? 2 + (b - r) / delta\n : 4 + (r - g) / delta\n : 0;\n return {\n h: round(60 * (hh < 0 ? hh + 6 : hh)),\n s: round(max ? (delta / max) * 100 : 0),\n v: round((max / 255) * 100),\n a\n };\n};\nexport const roundHsva = (hsva) => ({\n h: round(hsva.h),\n s: round(hsva.s),\n v: round(hsva.v),\n a: round(hsva.a, 2)\n});\nexport const rgbaToRgb = ({ r, g, b }) => ({ r, g, b });\nexport const hslaToHsl = ({ h, s, l }) => ({ h, s, l });\nexport const hsvaToHsv = (hsva) => {\n const { h, s, v } = roundHsva(hsva);\n return { h, s, v };\n};\n//# sourceMappingURL=convert.js.map","import { hexToRgba } from './convert.js';\nexport const equalColorObjects = (first, second) => {\n if (first === second)\n return true;\n for (const prop in first) {\n // The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB)\n // with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`)\n // on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types,\n // we must cast our object to unknown (as RGB demands `r` be a key, while `Record<string, x>` does not care if\n // there is or not), and then as a type TS can iterate over.\n if (first[prop] !==\n second[prop])\n return false;\n }\n return true;\n};\nexport const equalColorString = (first, second) => {\n return first.replace(/\\s/g, '') === second.replace(/\\s/g, '');\n};\nexport const equalHex = (first, second) => {\n if (first.toLowerCase() === second.toLowerCase())\n return true;\n // To compare colors like `#FFF` and `ffffff` we convert them into RGB objects\n return equalColorObjects(hexToRgba(first), hexToRgba(second));\n};\n//# sourceMappingURL=compare.js.map","const cache = {};\nexport const tpl = (html) => {\n let template = cache[html];\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = html;\n cache[html] = template;\n }\n return template;\n};\nexport const fire = (target, type, detail) => {\n target.dispatchEvent(new CustomEvent(type, {\n bubbles: true,\n detail\n }));\n};\n//# sourceMappingURL=dom.js.map","import { fire, tpl } from '../utils/dom.js';\nimport { clamp } from '../utils/math.js';\nlet hasTouched = false;\n// Check if an event was triggered by touch\nconst isTouch = (e) => 'touches' in e;\n// Prevent mobile browsers from handling mouse events (conflicting with touch ones).\n// If we detected a touch interaction before, we prefer reacting to touch events only.\nconst isValid = (event) => {\n if (hasTouched && !isTouch(event))\n return false;\n if (!hasTouched)\n hasTouched = isTouch(event);\n return true;\n};\nconst pointerMove = (target, event) => {\n const pointer = isTouch(event) ? event.touches[0] : event;\n const rect = target.el.getBoundingClientRect();\n fire(target.el, 'move', target.getMove({\n x: clamp((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width),\n y: clamp((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height)\n }));\n};\nconst keyMove = (target, event) => {\n // We use `keyCode` instead of `key` to reduce the size of the library.\n const keyCode = event.keyCode;\n // Ignore all keys except arrow ones, Page Up, Page Down, Home and End.\n if (keyCode > 40 || (target.xy && keyCode < 37) || keyCode < 33)\n return;\n // Do not scroll page by keys when color picker element has focus.\n event.preventDefault();\n // Send relative offset to the parent component.\n fire(target.el, 'move', target.getMove({\n x: keyCode === 39 // Arrow Right\n ? 0.01\n : keyCode === 37 // Arrow Left\n ? -0.01\n : keyCode === 34 // Page Down\n ? 0.05\n : keyCode === 33 // Page Up\n ? -0.05\n : keyCode === 35 // End\n ? 1\n : keyCode === 36 // Home\n ? -1\n : 0,\n y: keyCode === 40 // Arrow down\n ? 0.01\n : keyCode === 38 // Arrow Up\n ? -0.01\n : 0\n }, true));\n};\nexport class Slider {\n constructor(root, part, aria, xy) {\n const template = tpl(`<div role=\"slider\" tabindex=\"0\" part=\"${part}\" ${aria}><div part=\"${part}-pointer\"></div></div>`);\n root.appendChild(template.content.cloneNode(true));\n const el = root.querySelector(`[part=${part}]`);\n el.addEventListener('mousedown', this);\n el.addEventListener('touchstart', this);\n el.addEventListener('keydown', this);\n this.el = el;\n this.xy = xy;\n this.nodes = [el.firstChild, el];\n }\n set dragging(state) {\n const toggleEvent = state ? document.addEventListener : document.removeEventListener;\n toggleEvent(hasTouched ? 'touchmove' : 'mousemove', this);\n toggleEvent(hasTouched ? 'touchend' : 'mouseup', this);\n }\n handleEvent(event) {\n switch (event.type) {\n case 'mousedown':\n case 'touchstart':\n event.preventDefault();\n // event.button is 0 in mousedown for left button activation\n if (!isValid(event) || (!hasTouched && event.button != 0))\n return;\n this.el.focus();\n pointerMove(this, event);\n this.dragging = true;\n break;\n case 'mousemove':\n case 'touchmove':\n event.preventDefault();\n pointerMove(this, event);\n break;\n case 'mouseup':\n case 'touchend':\n this.dragging = false;\n break;\n case 'keydown':\n keyMove(this, event);\n break;\n }\n }\n style(styles) {\n styles.forEach((style, i) => {\n for (const p in style) {\n this.nodes[i].style.setProperty(p, style[p]);\n }\n });\n }\n}\n//# sourceMappingURL=slider.js.map","import { Slider } from './slider.js';\nimport { hsvaToHslString } from '../utils/convert.js';\nimport { clamp, round } from '../utils/math.js';\nexport class Hue extends Slider {\n constructor(root) {\n super(root, 'hue', 'aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"', false);\n }\n update({ h }) {\n this.h = h;\n this.style([\n {\n left: `${(h / 360) * 100}%`,\n color: hsvaToHslString({ h, s: 100, v: 100, a: 1 })\n }\n ]);\n this.el.setAttribute('aria-valuenow', `${round(h)}`);\n }\n getMove(offset, key) {\n // Hue measured in degrees of the color circle ranging from 0 to 360\n return { h: key ? clamp(this.h + offset.x * 360, 0, 360) : 360 * offset.x };\n }\n}\n//# sourceMappingURL=hue.js.map","import { Slider } from './slider.js';\nimport { hsvaToHslString } from '../utils/convert.js';\nimport { clamp, round } from '../utils/math.js';\nexport class Saturation extends Slider {\n constructor(root) {\n super(root, 'saturation', 'aria-label=\"Color\"', true);\n }\n update(hsva) {\n this.hsva = hsva;\n this.style([\n {\n top: `${100 - hsva.v}%`,\n left: `${hsva.s}%`,\n color: hsvaToHslString(hsva)\n },\n {\n 'background-color': hsvaToHslString({ h: hsva.h, s: 100, v: 100, a: 1 })\n }\n ]);\n this.el.setAttribute('aria-valuetext', `Saturation ${round(hsva.s)}%, Brightness ${round(hsva.v)}%`);\n }\n getMove(offset, key) {\n // Saturation and brightness always fit into [0, 100] range\n return {\n s: key ? clamp(this.hsva.s + offset.x * 100, 0, 100) : offset.x * 100,\n v: key ? clamp(this.hsva.v - offset.y * 100, 0, 100) : Math.round(100 - offset.y * 100)\n };\n }\n}\n//# sourceMappingURL=saturation.js.map","export default `:host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}`;\n//# sourceMappingURL=color-picker.js.map","import { equalColorObjects } from '../utils/compare.js';\nimport { fire, tpl } from '../utils/dom.js';\nimport { Hue } from './hue.js';\nimport { Saturation } from './saturation.js';\nimport css from '../styles/color-picker.js';\nimport hueCss from '../styles/hue.js';\nimport saturationCss from '../styles/saturation.js';\nconst $isSame = Symbol('same');\nconst $color = Symbol('color');\nconst $hsva = Symbol('hsva');\nconst $update = Symbol('update');\nconst $parts = Symbol('parts');\nexport const $css = Symbol('css');\nexport const $sliders = Symbol('sliders');\nexport class ColorPicker extends HTMLElement {\n static get observedAttributes() {\n return ['color'];\n }\n get [$css]() {\n return [css, hueCss, saturationCss];\n }\n get [$sliders]() {\n return [Saturation, Hue];\n }\n get color() {\n return this[$color];\n }\n set color(newColor) {\n if (!this[$isSame](newColor)) {\n const newHsva = this.colorModel.toHsva(newColor);\n this[$update](newHsva);\n this[$color] = newColor;\n }\n }\n constructor() {\n super();\n const template = tpl(`<style>${this[$css].join('')}</style>`);\n const root = this.attachShadow({ mode: 'open' });\n root.appendChild(template.content.cloneNode(true));\n root.addEventListener('move', this);\n this[$parts] = this[$sliders].map((slider) => new slider(root));\n }\n connectedCallback() {\n // A user may set a property on an _instance_ of an element,\n // before its prototype has been connected to this class.\n // If so, we need to run it through the proper class setter.\n if (this.hasOwnProperty('color')) {\n const value = this.color;\n delete this['color'];\n this.color = value;\n }\n else if (!this.color) {\n this.color = this.colorModel.defaultColor;\n }\n }\n attributeChangedCallback(_attr, _oldVal, newVal) {\n const color = this.colorModel.fromAttr(newVal);\n if (!this[$isSame](color)) {\n this.color = color;\n }\n }\n handleEvent(event) {\n // Merge the current HSV color object with updated params.\n const oldHsva = this[$hsva];\n const newHsva = { ...oldHsva, ...event.detail };\n this[$update](newHsva);\n let newColor;\n if (!equalColorObjects(newHsva, oldHsva) &&\n !this[$isSame]((newColor = this.colorModel.fromHsva(newHsva)))) {\n this[$color] = newColor;\n fire(this, 'color-changed', { value: newColor });\n }\n }\n [$isSame](color) {\n return this.color && this.colorModel.equal(color, this.color);\n }\n [$update](hsva) {\n this[$hsva] = hsva;\n this[$parts].forEach((part) => part.update(hsva));\n }\n}\n//# sourceMappingURL=color-picker.js.map","export default `[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}`;\n//# sourceMappingURL=hue.js.map","export default `[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}`;\n//# sourceMappingURL=saturation.js.map","import { ColorPicker } from '../components/color-picker.js';\nimport { hexToHsva, hsvaToHex } from '../utils/convert.js';\nimport { equalHex } from '../utils/compare.js';\nconst colorModel = {\n defaultColor: '#000',\n toHsva: hexToHsva,\n fromHsva: ({ h, s, v }) => hsvaToHex({ h, s, v, a: 1 }),\n equal: equalHex,\n fromAttr: (color) => color\n};\nexport class HexBase extends ColorPicker {\n get colorModel() {\n return colorModel;\n }\n}\n//# sourceMappingURL=hex.js.map","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorpicker.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorpicker.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorpicker/colorpickerview\n */\nimport { convertColor, convertToHex, registerCustomElement } from './utils.js';\nimport { global, env } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\nimport View from '../view.js';\nimport LabeledFieldView from '../labeledfield/labeledfieldview.js';\nimport { createLabeledInputText } from '../labeledfield/utils.js';\n// Custom export due to https://github.com/ckeditor/ckeditor5/issues/15698.\nimport { HexBase } from 'vanilla-colorful/lib/entrypoints/hex';\nimport '../../theme/components/colorpicker/colorpicker.css';\nconst waitingTime = 150;\n/**\n * A class which represents a color picker with an input field for defining custom colors.\n */\nexport default class ColorPickerView extends View {\n /**\n * Creates a view of color picker.\n *\n * @param locale\n * @param config\n */\n constructor(locale, config = {}) {\n super(locale);\n this.set({\n color: '',\n _hexColor: ''\n });\n this.hexInputRow = this._createInputRow();\n const children = this.createCollection();\n if (!config.hideInput) {\n children.add(this.hexInputRow);\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck', 'ck-color-picker'],\n tabindex: -1\n },\n children\n });\n this._config = config;\n this._debounceColorPickerEvent = debounce((color) => {\n // At first, set the color internally in the component. It's converted to the configured output format.\n this.set('color', color);\n // Then let the outside world know that the user changed the color.\n this.fire('colorSelected', { color: this.color });\n }, waitingTime, {\n leading: true\n });\n // The `color` property holds the color in the configured output format.\n // Ensure it before actually setting the value.\n this.on('set:color', (evt, propertyName, newValue) => {\n evt.return = convertColor(newValue, this._config.format || 'hsl');\n });\n // The `_hexColor` property is bound to the `color` one, but requires conversion.\n this.on('change:color', () => {\n this._hexColor = convertColorToCommonHexFormat(this.color);\n });\n this.on('change:_hexColor', () => {\n // Update the selected color in the color picker palette when it's not focused.\n // It means the user typed the color in the input.\n if (document.activeElement !== this.picker) {\n this.picker.setAttribute('color', this._hexColor);\n }\n // There has to be two way binding between properties.\n // Extra precaution has to be taken to trigger change back only when the color really changes.\n if (convertColorToCommonHexFormat(this.color) != convertColorToCommonHexFormat(this._hexColor)) {\n this.color = this._hexColor;\n }\n });\n }\n /**\n * Renders color picker in the view.\n */\n render() {\n super.render();\n // Extracted to the helper to make it testable.\n registerCustomElement('hex-color-picker', HexBase);\n this.picker = global.document.createElement('hex-color-picker');\n this.picker.setAttribute('class', 'hex-color-picker');\n this.picker.setAttribute('tabindex', '-1');\n this._createSlidersView();\n if (this.element) {\n if (this.hexInputRow.element) {\n this.element.insertBefore(this.picker, this.hexInputRow.element);\n }\n else {\n this.element.appendChild(this.picker);\n }\n // Create custom stylesheet with a look of focused pointer in color picker and append it into the color picker shadowDom\n const styleSheetForFocusedColorPicker = document.createElement('style');\n styleSheetForFocusedColorPicker.textContent = '[role=\"slider\"]:focus [part$=\"pointer\"] {' +\n 'border: 1px solid #fff;' +\n 'outline: 1px solid var(--ck-color-focus-border);' +\n 'box-shadow: 0 0 0 2px #fff;' +\n '}';\n this.picker.shadowRoot.appendChild(styleSheetForFocusedColorPicker);\n }\n this.picker.addEventListener('color-changed', event => {\n const color = event.detail.value;\n this._debounceColorPickerEvent(color);\n });\n }\n /**\n * Focuses the first pointer in color picker.\n *\n */\n focus() {\n // In some browsers we need to move the focus to the input first.\n // Otherwise, the color picker doesn't behave as expected.\n // In FF, after selecting the color via slider, it instantly moves back to the previous color.\n // In all iOS browsers and desktop Safari, once the saturation slider is moved for the first time,\n // editor collapses the selection and doesn't apply the color change.\n // See: https://github.com/cksource/ckeditor5-internal/issues/3245, https://github.com/ckeditor/ckeditor5/issues/14119,\n // https://github.com/cksource/ckeditor5-internal/issues/3268.\n /* istanbul ignore next -- @preserve */\n if (!this._config.hideInput && (env.isGecko || env.isiOS || env.isSafari)) {\n const input = this.hexInputRow.children.get(1);\n input.focus();\n }\n const firstSlider = this.slidersView.first;\n firstSlider.focus();\n }\n /**\n * Creates collection of sliders in color picker.\n *\n * @private\n */\n _createSlidersView() {\n const colorPickersChildren = [...this.picker.shadowRoot.children];\n const sliders = colorPickersChildren.filter(item => item.getAttribute('role') === 'slider');\n const slidersView = sliders.map(slider => {\n const view = new SliderView(slider);\n return view;\n });\n this.slidersView = this.createCollection();\n slidersView.forEach(item => {\n this.slidersView.add(item);\n });\n }\n /**\n * Creates input row for defining custom colors in color picker.\n *\n * @private\n */\n _createInputRow() {\n const colorInput = this._createColorInput();\n return new ColorPickerInputRowView(this.locale, colorInput);\n }\n /**\n * Creates the input where user can type or paste the color in hex format.\n *\n * @private\n */\n _createColorInput() {\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n const { t } = this.locale;\n labeledInput.set({\n label: t('HEX'),\n class: 'color-picker-hex-input'\n });\n labeledInput.fieldView.bind('value').to(this, '_hexColor', pickerColor => {\n if (labeledInput.isFocused) {\n // Text field shouldn't be updated with color change if the text field is focused.\n // Imagine user typing hex code and getting the value of field changed.\n return labeledInput.fieldView.value;\n }\n else {\n return pickerColor.startsWith('#') ? pickerColor.substring(1) : pickerColor;\n }\n });\n // Only accept valid hex colors as input.\n labeledInput.fieldView.on('input', () => {\n const inputValue = labeledInput.fieldView.element.value;\n if (inputValue) {\n const maybeHexColor = tryParseHexColor(inputValue);\n if (maybeHexColor) {\n // If so, set the color.\n // Otherwise, do nothing.\n this._debounceColorPickerEvent(maybeHexColor);\n }\n }\n });\n return labeledInput;\n }\n /**\n * Validates the view and returns `false` when some fields are invalid.\n */\n isValid() {\n const { t } = this.locale;\n // If the input is hidden, it's always valid, because there is no way to select\n // invalid color value using diagram color picker.\n if (this._config.hideInput) {\n return true;\n }\n this.resetValidationStatus();\n // One error per field is enough.\n if (!this.hexInputRow.getParsedColor()) {\n // Apply updated error.\n this.hexInputRow.inputView.errorText = t('Please enter a valid color (e.g. \"ff0000\").');\n return false;\n }\n return true;\n }\n /**\n * Cleans up the supplementary error and information text of input inside the {@link #hexInputRow}\n * bringing them back to the state when the form has been displayed for the first time.\n *\n * See {@link #isValid}.\n */\n resetValidationStatus() {\n this.hexInputRow.inputView.errorText = null;\n }\n}\n// Converts any color format to a unified hex format.\n//\n// @param inputColor\n// @returns An unified hex string.\nfunction convertColorToCommonHexFormat(inputColor) {\n let ret = convertToHex(inputColor);\n if (!ret) {\n ret = '#000';\n }\n if (ret.length === 4) {\n // Unfold shortcut format.\n ret = '#' + [ret[1], ret[1], ret[2], ret[2], ret[3], ret[3]].join('');\n }\n return ret.toLowerCase();\n}\n// View abstraction over pointer in color picker.\nclass SliderView extends View {\n /**\n * @param element HTML element of slider in color picker.\n */\n constructor(element) {\n super();\n this.element = element;\n }\n /**\n * Focuses element.\n */\n focus() {\n this.element.focus();\n }\n}\n// View abstraction over the `#` character before color input.\nclass HashView extends View {\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-picker__hash-view'\n ]\n },\n children: '#'\n });\n }\n}\n// The class representing a row containing hex color input field.\n// **Note**: For now this class is private. When more use cases appear (beyond `ckeditor5-table` and `ckeditor5-image`),\n// it will become a component in `ckeditor5-ui`.\n//\n// @private\nclass ColorPickerInputRowView extends View {\n /**\n * Creates an instance of the form row class.\n *\n * @param locale The locale instance.\n * @param inputView Hex color input element.\n */\n constructor(locale, inputView) {\n super(locale);\n this.inputView = inputView;\n this.children = this.createCollection([\n new HashView(),\n this.inputView\n ]);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-picker__row'\n ]\n },\n children: this.children\n });\n }\n /**\n * Returns false if color input value is not in hex format.\n */\n getParsedColor() {\n return tryParseHexColor(this.inputView.fieldView.element.value);\n }\n}\n/**\n * Trim spaces from provided color and check if hex is valid.\n *\n * @param color Unsafe color string.\n * @returns Null if provided color is not hex value.\n * @export\n */\nexport function tryParseHexColor(color) {\n if (!color) {\n return null;\n }\n const hashLessColor = color.trim().replace(/^#/, '');\n // Incorrect length.\n if (![3, 4, 6, 8].includes(hashLessColor.length)) {\n return null;\n }\n // Incorrect characters.\n if (!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(hashLessColor)) {\n return null;\n }\n return `#${hashLessColor}`;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Collection, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * A collection to store document colors. It enforces colors to be unique.\n */\nexport default class DocumentColorCollection extends /* #__PURE__ */ ObservableMixin((Collection)) {\n constructor(options) {\n super(options);\n this.set('isEmpty', true);\n this.on('change', () => {\n this.set('isEmpty', this.length === 0);\n });\n }\n /**\n * Adds a color to the document color collection.\n *\n * This method ensures that no color duplicates are inserted (compared using\n * the color value of the {@link module:ui/colorgrid/colorgridview~ColorDefinition}).\n *\n * If the item does not have an ID, it will be automatically generated and set on the item.\n *\n * @param index The position of the item in the collection. The item is pushed to the collection when `index` is not specified.\n * @fires add\n * @fires change\n */\n add(item, index) {\n if (this.find(element => element.color === item.color)) {\n // No duplicates are allowed.\n return this;\n }\n return super.add(item, index);\n }\n /**\n * Checks if an object with given colors is present in the document color collection.\n */\n hasColor(color) {\n return !!this.find(item => item.color === color);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorselector/colorgridsfragmentview\n */\nimport View from '../view.js';\nimport ButtonView from '../button/buttonview.js';\nimport ColorGridView from '../colorgrid/colorgridview.js';\nimport ColorTileView from '../colorgrid/colortileview.js';\nimport Template from '../template.js';\nimport DocumentColorCollection from './documentcolorcollection.js';\nimport { icons } from '@ckeditor/ckeditor5-core';\n/**\n * One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.\n *\n * It provides a UI that allows users to select colors from the a predefined set and from existing document colors.\n *\n * It consists of the following sub–components:\n *\n * * A \"Remove color\" button,\n * * A static {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors defined in the configuration,\n * * A dynamic {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors used in the document.\n * * If color picker is configured, the \"Color Picker\" button is visible too.\n */\nexport default class ColorGridsFragmentView extends View {\n /**\n * Creates an instance of the view.\n *\n * @param locale The localization services instance.\n * @param colors An array with definitions of colors to be displayed in the table.\n * @param columns The number of columns in the color grid.\n * @param removeButtonLabel The label of the button responsible for removing the color.\n * @param colorPickerLabel The label of the button responsible for color picker appearing.\n * @param documentColorsLabel The label for the section with the document colors.\n * @param documentColorsCount The number of colors in the document colors section inside the color dropdown.\n * @param focusTracker Tracks information about the DOM focus in the list.\n * @param focusables A collection of views that can be focused in the view.\n */\n constructor(locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, focusTracker, focusables }) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isVisible', true);\n this.focusTracker = focusTracker;\n this.items = this.createCollection();\n this.colorDefinitions = colors;\n this.columns = columns;\n this.documentColors = new DocumentColorCollection();\n this.documentColorsCount = documentColorsCount;\n this._focusables = focusables;\n this._removeButtonLabel = removeButtonLabel;\n this._colorPickerLabel = colorPickerLabel;\n this._documentColorsLabel = documentColorsLabel;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck-color-grids-fragment',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ]\n },\n children: this.items\n });\n this.removeColorButtonView = this._createRemoveColorButton();\n this.items.add(this.removeColorButtonView);\n }\n /**\n * Scans through the editor model and searches for text node attributes with the given attribute name.\n * Found entries are set as document colors.\n *\n * All the previously stored document colors will be lost in the process.\n *\n * @param model The model used as a source to obtain the document colors.\n * @param attributeName Determines the name of the related model's attribute for a given dropdown.\n */\n updateDocumentColors(model, attributeName) {\n const document = model.document;\n const maxCount = this.documentColorsCount;\n this.documentColors.clear();\n for (const root of document.getRoots()) {\n const range = model.createRangeIn(root);\n for (const node of range.getItems()) {\n if (node.is('$textProxy') && node.hasAttribute(attributeName)) {\n this._addColorToDocumentColors(node.getAttribute(attributeName));\n if (this.documentColors.length >= maxCount) {\n return;\n }\n }\n }\n }\n }\n /**\n * Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgridview~ColorGridView}s\n * available in the {@link module:ui/colorselector/colorselectorview~ColorSelectorView}. It guarantees that the selection will\n * occur only in one of them.\n */\n updateSelectedColors() {\n const documentColorsGrid = this.documentColorsGrid;\n const staticColorsGrid = this.staticColorsGrid;\n const selectedColor = this.selectedColor;\n staticColorsGrid.selectedColor = selectedColor;\n if (documentColorsGrid) {\n documentColorsGrid.selectedColor = selectedColor;\n }\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.staticColorsGrid = this._createStaticColorsGrid();\n this.items.add(this.staticColorsGrid);\n if (this.documentColorsCount) {\n // Create a label for document colors.\n const bind = Template.bind(this.documentColors, this.documentColors);\n const label = new View(this.locale);\n label.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-color-grid__label',\n bind.if('isEmpty', 'ck-hidden')\n ]\n },\n children: [\n {\n text: this._documentColorsLabel\n }\n ]\n });\n this.items.add(label);\n this.documentColorsGrid = this._createDocumentColorsGrid();\n this.items.add(this.documentColorsGrid);\n }\n this._createColorPickerButton();\n this._addColorSelectorElementsToFocusTracker();\n }\n /**\n * Focuses the component.\n */\n focus() {\n this.removeColorButtonView.focus();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n }\n /**\n * Handles displaying the color picker button (if it was previously created) and making it focusable.\n */\n addColorPickerButton() {\n if (this.colorPickerButtonView) {\n this.items.add(this.colorPickerButtonView);\n this.focusTracker.add(this.colorPickerButtonView.element);\n this._focusables.add(this.colorPickerButtonView);\n }\n }\n /**\n * Adds color selector elements to focus tracker.\n */\n _addColorSelectorElementsToFocusTracker() {\n this.focusTracker.add(this.removeColorButtonView.element);\n this._focusables.add(this.removeColorButtonView);\n if (this.staticColorsGrid) {\n this.focusTracker.add(this.staticColorsGrid.element);\n this._focusables.add(this.staticColorsGrid);\n }\n if (this.documentColorsGrid) {\n this.focusTracker.add(this.documentColorsGrid.element);\n this._focusables.add(this.documentColorsGrid);\n }\n }\n /**\n * Creates the button responsible for displaying the color picker component.\n */\n _createColorPickerButton() {\n this.colorPickerButtonView = new ButtonView();\n this.colorPickerButtonView.set({\n label: this._colorPickerLabel,\n withText: true,\n icon: icons.colorPalette,\n class: 'ck-color-selector__color-picker'\n });\n this.colorPickerButtonView.on('execute', () => {\n this.fire('colorPicker:show');\n });\n }\n /**\n * Adds the remove color button as a child of the current view.\n */\n _createRemoveColorButton() {\n const buttonView = new ButtonView();\n buttonView.set({\n withText: true,\n icon: icons.eraser,\n label: this._removeButtonLabel\n });\n buttonView.class = 'ck-color-selector__remove-color';\n buttonView.on('execute', () => {\n this.fire('execute', {\n value: null,\n source: 'removeColorButton'\n });\n });\n buttonView.render();\n return buttonView;\n }\n /**\n * Creates a static color grid based on the editor configuration.\n */\n _createStaticColorsGrid() {\n const colorGrid = new ColorGridView(this.locale, {\n colorDefinitions: this.colorDefinitions,\n columns: this.columns\n });\n colorGrid.on('execute', (evt, data) => {\n this.fire('execute', {\n value: data.value,\n source: 'staticColorsGrid'\n });\n });\n return colorGrid;\n }\n /**\n * Creates the document colors section view and binds it to {@link #documentColors}.\n */\n _createDocumentColorsGrid() {\n const bind = Template.bind(this.documentColors, this.documentColors);\n const documentColorsGrid = new ColorGridView(this.locale, {\n columns: this.columns\n });\n documentColorsGrid.extendTemplate({\n attributes: {\n class: bind.if('isEmpty', 'ck-hidden')\n }\n });\n documentColorsGrid.items.bindTo(this.documentColors).using(colorObj => {\n const colorTile = new ColorTileView();\n colorTile.set({\n color: colorObj.color,\n hasBorder: colorObj.options && colorObj.options.hasBorder\n });\n if (colorObj.label) {\n colorTile.set({\n label: colorObj.label,\n tooltip: true\n });\n }\n colorTile.on('execute', () => {\n this.fire('execute', {\n value: colorObj.color,\n source: 'documentColorsGrid'\n });\n });\n return colorTile;\n });\n // Selected color should be cleared when document colors became empty.\n this.documentColors.on('change:isEmpty', (evt, name, val) => {\n if (val) {\n documentColorsGrid.selectedColor = null;\n }\n });\n return documentColorsGrid;\n }\n /**\n * Adds a given color to the document colors list. If possible, the method will attempt to use\n * data from the {@link #colorDefinitions} (label, color options).\n *\n * @param color A string that stores the value of the recently applied color.\n */\n _addColorToDocumentColors(color) {\n const predefinedColor = this.colorDefinitions\n .find(definition => definition.color === color);\n if (!predefinedColor) {\n this.documentColors.add({\n color,\n label: color,\n options: {\n hasBorder: false\n }\n });\n }\n else {\n this.documentColors.add(Object.assign({}, predefinedColor));\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorselector/colorpickerfragmentview\n */\nimport View from '../view.js';\nimport ButtonView from '../button/buttonview.js';\nimport { default as ColorPickerView } from '../colorpicker/colorpickerview.js';\nimport { icons } from '@ckeditor/ckeditor5-core';\n/**\n * One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.\n *\n * It allows users to select a color from a color picker.\n *\n * It consists of the following sub–components:\n *\n * * A color picker saturation and hue sliders,\n * * A text input accepting colors in HEX format,\n * * \"Save\" and \"Cancel\" action buttons.\n */\nexport default class ColorPickerFragmentView extends View {\n /**\n * Creates an instance of the view.\n *\n * @param locale The localization services instance.\n * @param focusTracker Tracks information about the DOM focus in the list.\n * @param focusables A collection of views that can be focused in the view..\n * @param keystrokes An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.\n * @param colorPickerViewConfig The configuration of color picker feature. If set to `false`, the color picker\n * will not be rendered.\n */\n constructor(locale, { focusTracker, focusables, keystrokes, colorPickerViewConfig }) {\n super(locale);\n this.items = this.createCollection();\n this.focusTracker = focusTracker;\n this.keystrokes = keystrokes;\n this.set('isVisible', false);\n this.set('selectedColor', undefined);\n this._focusables = focusables;\n this._colorPickerViewConfig = colorPickerViewConfig;\n const bind = this.bindTemplate;\n const { saveButtonView, cancelButtonView } = this._createActionButtons();\n this.saveButtonView = saveButtonView;\n this.cancelButtonView = cancelButtonView;\n this.actionBarView = this._createActionBarView({ saveButtonView, cancelButtonView });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck-color-picker-fragment',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ]\n },\n children: this.items\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n const colorPickerView = new ColorPickerView(this.locale, {\n ...this._colorPickerViewConfig\n });\n this.colorPickerView = colorPickerView;\n this.colorPickerView.render();\n if (this.selectedColor) {\n colorPickerView.color = this.selectedColor;\n }\n this.listenTo(this, 'change:selectedColor', (evt, name, value) => {\n colorPickerView.color = value;\n });\n this.items.add(this.colorPickerView);\n this.items.add(this.actionBarView);\n this._addColorPickersElementsToFocusTracker();\n this._stopPropagationOnArrowsKeys();\n this._executeOnEnterPress();\n this._executeUponColorChange();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n }\n /**\n * Focuses the color picker.\n */\n focus() {\n this.colorPickerView.focus();\n }\n /**\n * Reset validation messages.\n */\n resetValidationStatus() {\n this.colorPickerView.resetValidationStatus();\n }\n /**\n * When color picker is focused and \"enter\" is pressed it executes command.\n */\n _executeOnEnterPress() {\n this.keystrokes.set('enter', evt => {\n if (this.isVisible && this.focusTracker.focusedElement !== this.cancelButtonView.element && this.colorPickerView.isValid()) {\n this.fire('execute', {\n value: this.selectedColor\n });\n evt.stopPropagation();\n evt.preventDefault();\n }\n });\n }\n /**\n * Removes default behavior of arrow keys in dropdown.\n */\n _stopPropagationOnArrowsKeys() {\n const stopPropagation = (data) => data.stopPropagation();\n this.keystrokes.set('arrowright', stopPropagation);\n this.keystrokes.set('arrowleft', stopPropagation);\n this.keystrokes.set('arrowup', stopPropagation);\n this.keystrokes.set('arrowdown', stopPropagation);\n }\n /**\n * Adds color picker elements to focus tracker.\n */\n _addColorPickersElementsToFocusTracker() {\n for (const slider of this.colorPickerView.slidersView) {\n this.focusTracker.add(slider.element);\n this._focusables.add(slider);\n }\n const input = this.colorPickerView.hexInputRow.children.get(1);\n if (input.element) {\n this.focusTracker.add(input.element);\n this._focusables.add(input);\n }\n this.focusTracker.add(this.saveButtonView.element);\n this._focusables.add(this.saveButtonView);\n this.focusTracker.add(this.cancelButtonView.element);\n this._focusables.add(this.cancelButtonView);\n }\n /**\n * Creates bar containing \"Save\" and \"Cancel\" buttons.\n */\n _createActionBarView({ saveButtonView, cancelButtonView }) {\n const actionBarRow = new View();\n const children = this.createCollection();\n children.add(saveButtonView);\n children.add(cancelButtonView);\n actionBarRow.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-selector_action-bar'\n ]\n },\n children\n });\n return actionBarRow;\n }\n /**\n * Creates \"Save\" and \"Cancel\" buttons.\n */\n _createActionButtons() {\n const locale = this.locale;\n const t = locale.t;\n const saveButtonView = new ButtonView(locale);\n const cancelButtonView = new ButtonView(locale);\n saveButtonView.set({\n icon: icons.check,\n class: 'ck-button-save',\n type: 'button',\n withText: false,\n label: t('Accept')\n });\n cancelButtonView.set({\n icon: icons.cancel,\n class: 'ck-button-cancel',\n type: 'button',\n withText: false,\n label: t('Cancel')\n });\n saveButtonView.on('execute', () => {\n if (this.colorPickerView.isValid()) {\n this.fire('execute', {\n source: 'colorPickerSaveButton',\n value: this.selectedColor\n });\n }\n });\n cancelButtonView.on('execute', () => {\n this.fire('colorPicker:cancel');\n });\n return {\n saveButtonView, cancelButtonView\n };\n }\n /**\n * Fires the `execute` event if color in color picker has been changed\n * by the user.\n */\n _executeUponColorChange() {\n this.colorPickerView.on('colorSelected', (evt, data) => {\n this.fire('execute', {\n value: data.color,\n source: 'colorPicker'\n });\n this.set('selectedColor', data.color);\n });\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorselector.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorselector.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorselector/colorselectorview\n */\nimport FocusCycler from '../focuscycler.js';\nimport View from '../view.js';\nimport ViewCollection from '../viewcollection.js';\nimport { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\nimport ColorGridsFragmentView from './colorgridsfragmentview.js';\nimport ColorPickerFragmentView from './colorpickerfragmentview.js';\nimport '../../theme/components/colorselector/colorselector.css';\n/**\n * The configurable color selector view class. It allows users to select colors from a predefined set of colors as well as from\n * a color picker.\n *\n * This meta-view is is made of two components (fragments):\n *\n * * {@link module:ui/colorselector/colorselectorview~ColorSelectorView#colorGridsFragmentView},\n * * {@link module:ui/colorselector/colorselectorview~ColorSelectorView#colorPickerFragmentView}.\n *\n * ```ts\n * const colorDefinitions = [\n * \t{ color: '#000', label: 'Black', options: { hasBorder: false } },\n * \t{ color: 'rgb(255, 255, 255)', label: 'White', options: { hasBorder: true } },\n * \t{ color: 'red', label: 'Red', options: { hasBorder: false } }\n * ];\n *\n * const selectorView = new ColorSelectorView( locale, {\n * \tcolors: colorDefinitions,\n * \tcolumns: 5,\n * \tremoveButtonLabel: 'Remove color',\n * \tdocumentColorsLabel: 'Document colors',\n * \tdocumentColorsCount: 4,\n * \tcolorPickerViewConfig: {\n * \t\tformat: 'hsl'\n * \t}\n * } );\n *\n * selectorView.appendUI();\n * selectorView.selectedColor = 'red';\n * selectorView.updateSelectedColors();\n *\n * selectorView.on<ColorSelectorExecuteEvent>( 'execute', ( evt, data ) => {\n * \tconsole.log( 'Color changed', data.value, data.source );\n * } );\n *\n * selectorView.on<ColorSelectorColorPickerShowEvent>( 'colorPicker:show', ( evt ) => {\n * \tconsole.log( 'Color picker showed up', evt );\n * } );\n *\n * selectorView.on<ColorSelectorColorPickerCancelEvent>( 'colorPicker:cancel', ( evt ) => {\n * \tconsole.log( 'Color picker cancel', evt );\n * } );\n *\n * selectorView.render();\n *\n * document.body.appendChild( selectorView.element );\n * ```\n */\nexport default class ColorSelectorView extends View {\n /**\n * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.\n *\n * @param locale The localization services instance.\n * @param colors An array with definitions of colors to be displayed in the table.\n * @param columns The number of columns in the color grid.\n * @param removeButtonLabel The label of the button responsible for removing the color.\n * @param colorPickerLabel The label of the button responsible for color picker appearing.\n * @param documentColorsLabel The label for the section with the document colors.\n * @param documentColorsCount The number of colors in the document colors section inside the color dropdown.\n * @param colorPickerViewConfig The configuration of color picker feature. If set to `false`, the color picker will be hidden.\n */\n constructor(locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, colorPickerViewConfig }) {\n super(locale);\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this._focusables = new ViewCollection();\n this._colorPickerViewConfig = colorPickerViewConfig;\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate list items backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.\n focusPrevious: 'shift + tab',\n // Navigate list items forwards using the <kbd>Tab</kbd> key.\n focusNext: 'tab'\n }\n });\n this.colorGridsFragmentView = new ColorGridsFragmentView(locale, {\n colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel,\n focusTracker: this.focusTracker,\n focusables: this._focusables\n });\n this.colorPickerFragmentView = new ColorPickerFragmentView(locale, {\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokes: this.keystrokes,\n colorPickerViewConfig\n });\n this.set('_isColorGridsFragmentVisible', true);\n this.set('_isColorPickerFragmentVisible', false);\n this.set('selectedColor', undefined);\n this.colorGridsFragmentView.bind('isVisible').to(this, '_isColorGridsFragmentVisible');\n this.colorPickerFragmentView.bind('isVisible').to(this, '_isColorPickerFragmentVisible');\n /**\n * This is kind of bindings. Unfortunately we could not use this.bind() method because the same property\n * can not be bound twice. So this is work around how to bind 'selectedColor' property between components.\n */\n this.on('change:selectedColor', (evt, evtName, data) => {\n this.colorGridsFragmentView.set('selectedColor', data);\n this.colorPickerFragmentView.set('selectedColor', data);\n });\n this.colorGridsFragmentView.on('change:selectedColor', (evt, evtName, data) => {\n this.set('selectedColor', data);\n });\n this.colorPickerFragmentView.on('change:selectedColor', (evt, evtName, data) => {\n this.set('selectedColor', data);\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-selector'\n ]\n },\n children: this.items\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Renders the internals of the component on demand:\n * * {@link #colorPickerFragmentView},\n * * {@link #colorGridsFragmentView}.\n *\n * It allows for deferring component initialization to improve the performance.\n *\n * See {@link #showColorPickerFragment}, {@link #showColorGridsFragment}.\n */\n appendUI() {\n this._appendColorGridsFragment();\n if (this._colorPickerViewConfig) {\n this._appendColorPickerFragment();\n }\n }\n /**\n * Shows the {@link #colorPickerFragmentView} and hides the {@link #colorGridsFragmentView}.\n *\n * **Note**: It requires {@link #appendUI} to be called first.\n *\n * See {@link #showColorGridsFragment}, {@link ~ColorSelectorView#event:colorPicker:show}.\n */\n showColorPickerFragment() {\n if (!this.colorPickerFragmentView.colorPickerView || this._isColorPickerFragmentVisible) {\n return;\n }\n this._isColorPickerFragmentVisible = true;\n this.colorPickerFragmentView.focus();\n this.colorPickerFragmentView.resetValidationStatus();\n this._isColorGridsFragmentVisible = false;\n }\n /**\n * Shows the {@link #colorGridsFragmentView} and hides the {@link #colorPickerFragmentView}.\n *\n * See {@link #showColorPickerFragment}.\n *\n * **Note**: It requires {@link #appendUI} to be called first.\n */\n showColorGridsFragment() {\n if (this._isColorGridsFragmentVisible) {\n return;\n }\n this._isColorGridsFragmentVisible = true;\n this.colorGridsFragmentView.focus();\n this._isColorPickerFragmentVisible = false;\n }\n /**\n * Focuses the first focusable element in {@link #items}.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the last focusable element in {@link #items}.\n */\n focusLast() {\n this._focusCycler.focusLast();\n }\n /**\n * Scans through the editor model and searches for text node attributes with the given `attributeName`.\n * Found entries are set as document colors in {@link #colorGridsFragmentView}.\n *\n * All the previously stored document colors will be lost in the process.\n *\n * @param model The model used as a source to obtain the document colors.\n * @param attributeName Determines the name of the related model's attribute for a given dropdown.\n */\n updateDocumentColors(model, attributeName) {\n this.colorGridsFragmentView.updateDocumentColors(model, attributeName);\n }\n /**\n * Refreshes the state of the selected color in one or both grids located in {@link #colorGridsFragmentView}.\n *\n * It guarantees that the selection will occur only in one of them.\n */\n updateSelectedColors() {\n this.colorGridsFragmentView.updateSelectedColors();\n }\n /**\n * Appends the view containing static and document color grid views.\n */\n _appendColorGridsFragment() {\n if (this.items.length) {\n return;\n }\n this.items.add(this.colorGridsFragmentView);\n this.colorGridsFragmentView.delegate('execute').to(this);\n this.colorGridsFragmentView.delegate('colorPicker:show').to(this);\n }\n /**\n * Appends the view with the color picker.\n */\n _appendColorPickerFragment() {\n if (this.items.length === 2) {\n return;\n }\n this.items.add(this.colorPickerFragmentView);\n if (this.colorGridsFragmentView.colorPickerButtonView) {\n this.colorGridsFragmentView.colorPickerButtonView.on('execute', () => {\n this.showColorPickerFragment();\n });\n }\n this.colorGridsFragmentView.addColorPickerButton();\n this.colorPickerFragmentView.delegate('execute').to(this);\n this.colorPickerFragmentView.delegate('colorPicker:cancel').to(this);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/componentfactory\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * A helper class implementing the UI component ({@link module:ui/view~View view}) factory.\n *\n * It allows functions producing specific UI components to be registered under their unique names\n * in the factory. A registered component can be then instantiated by providing its name.\n * Note that the names are case insensitive.\n *\n * ```ts\n * // The editor provides localization tools for the factory.\n * const factory = new ComponentFactory( editor );\n *\n * factory.add( 'foo', locale => new FooView( locale ) );\n * factory.add( 'bar', locale => new BarView( locale ) );\n *\n * // An instance of FooView.\n * const fooInstance = factory.create( 'foo' );\n *\n * // Names are case insensitive so this is also allowed:\n * const barInstance = factory.create( 'Bar' );\n * ```\n *\n * The {@link module:core/editor/editor~Editor#locale editor locale} is passed to the factory\n * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.\n */\nexport default class ComponentFactory {\n /**\n * Creates an instance of the factory.\n *\n * @param editor The editor instance.\n */\n constructor(editor) {\n /**\n * Registered component factories.\n */\n this._components = new Map();\n this.editor = editor;\n }\n /**\n * Returns an iterator of registered component names. Names are returned in lower case.\n */\n *names() {\n for (const value of this._components.values()) {\n yield value.originalName;\n }\n }\n /**\n * Registers a component factory function that will be used by the\n * {@link #create create} method and called with the\n * {@link module:core/editor/editor~Editor#locale editor locale} as an argument,\n * allowing localization of the {@link module:ui/view~View view}.\n *\n * @param name The name of the component.\n * @param callback The callback that returns the component.\n */\n add(name, callback) {\n this._components.set(getNormalized(name), { callback, originalName: name });\n }\n /**\n * Creates an instance of a component registered in the factory under a specific name.\n *\n * When called, the {@link module:core/editor/editor~Editor#locale editor locale} is passed to\n * the previously {@link #add added} factory function, allowing localization of the\n * {@link module:ui/view~View view}.\n *\n * @param name The name of the component.\n * @returns The instantiated component view.\n */\n create(name) {\n if (!this.has(name)) {\n /**\n * The required component is not registered in the component factory. Please make sure\n * the provided name is correct and the component has been correctly\n * {@link module:ui/componentfactory~ComponentFactory#add added} to the factory.\n *\n * @error componentfactory-item-missing\n * @param name The name of the missing component.\n */\n throw new CKEditorError('componentfactory-item-missing', this, { name });\n }\n return this._components.get(getNormalized(name)).callback(this.editor.locale);\n }\n /**\n * Checks if a component of a given name is registered in the factory.\n *\n * @param name The name of the component.\n */\n has(name) {\n return this._components.has(getNormalized(name));\n }\n}\n/**\n * Ensures that the component name used as the key in the internal map is in lower case.\n */\nfunction getNormalized(name) {\n return String(name).toLowerCase();\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./balloonpanel.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./balloonpanel.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/panel/balloon/balloonpanelview\n */\nimport View from '../../view.js';\nimport { getOptimalPosition, global, isRange, toUnit, isVisible, ResizeObserver } from '@ckeditor/ckeditor5-utils';\nimport { isElement } from 'lodash-es';\nimport '../../../theme/components/panel/balloonpanel.css';\nconst toPx = /* #__PURE__ */ toUnit('px');\n// A static balloon panel positioning function that moves the balloon far off the viewport.\n// It is used as a fallback when there is no way to position the balloon using provided\n// positioning functions (see: `getOptimalPosition()`), for instance, when the target the\n// balloon should be attached to gets obscured by scrollable containers or the viewport.\n//\n// It prevents the balloon from being attached to the void and possible degradation of the UX.\n// At the same time, it keeps the balloon physically visible in the DOM so the focus remains\n// uninterrupted.\nconst POSITION_OFF_SCREEN = {\n top: -99999,\n left: -99999,\n name: 'arrowless',\n config: {\n withArrow: false\n }\n};\n/**\n * The balloon panel view class.\n *\n * A floating container which can\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any\n * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position\n * e.g. when the web page is scrolled.\n *\n * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and\n * the like in its {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#content} view\n * collection.\n *\n * There is a number of {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}\n * that the balloon can use, automatically switching from one to another when the viewport space becomes\n * scarce to keep the balloon visible to the user as long as it is possible. The balloon will also\n * accept any custom position set provided by the user compatible with the\n * {@link module:utils/dom/position~Options options}.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const childView = new ChildView();\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Add a child view to the panel's content collection.\n * panel.content.add( childView );\n *\n * // Start pinning the panel to an element with the \"target\" id DOM.\n * // The balloon will remain pinned until unpin() is called.\n * panel.pin( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n */\nclass BalloonPanelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('top', 0);\n this.set('left', 0);\n this.set('position', 'arrow_nw');\n this.set('isVisible', false);\n this.set('withArrow', true);\n this.set('class', undefined);\n this._pinWhenIsVisibleCallback = null;\n this._resizeObserver = null;\n this.content = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-balloon-panel',\n bind.to('position', value => `ck-balloon-panel_${value}`),\n bind.if('isVisible', 'ck-balloon-panel_visible'),\n bind.if('withArrow', 'ck-balloon-panel_with-arrow'),\n bind.to('class')\n ],\n style: {\n top: bind.to('top', toPx),\n left: bind.to('left', toPx)\n }\n },\n children: this.content\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.hide();\n super.destroy();\n }\n /**\n * Shows the panel.\n *\n * See {@link #isVisible}.\n */\n show() {\n this.isVisible = true;\n }\n /**\n * Hides the panel.\n *\n * See {@link #isVisible}.\n */\n hide() {\n this.isVisible = false;\n }\n /**\n * Attaches the panel to a specified {@link module:utils/dom/position~Options#target} with a\n * smart positioning heuristics that chooses from available positions to make sure the panel\n * is visible to the user i.e. within the limits of the viewport.\n *\n * This method accepts configuration {@link module:utils/dom/position~Options options}\n * to set the `target`, optional `limiter` and `positions` the balloon should choose from.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Attach the panel to an element with the \"target\" id DOM.\n * panel.attachTo( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n *\n * **Note**: Attaching the panel will also automatically {@link #show} it.\n *\n * **Note**: An attached panel will not follow its target when the window is scrolled or resized.\n * See the {@link #pin} method for a more permanent positioning strategy.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n * @returns Whether the balloon was shown and successfully attached or not. Attaching can fail if the target\n * provided in the options is invisible (e.g. element detached from DOM).\n */\n attachTo(options) {\n const target = getDomElement(options.target);\n if (target && !isVisible(target)) {\n return false;\n }\n this.show();\n const defaultPositions = BalloonPanelView.defaultPositions;\n const positionOptions = Object.assign({}, {\n element: this.element,\n positions: [\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthMiddleWest,\n defaultPositions.southArrowNorthMiddleEast,\n defaultPositions.southArrowNorthWest,\n defaultPositions.southArrowNorthEast,\n defaultPositions.northArrowSouth,\n defaultPositions.northArrowSouthMiddleWest,\n defaultPositions.northArrowSouthMiddleEast,\n defaultPositions.northArrowSouthWest,\n defaultPositions.northArrowSouthEast,\n defaultPositions.viewportStickyNorth\n ],\n limiter: global.document.body,\n fitInViewport: true\n }, options);\n const optimalPosition = BalloonPanelView._getOptimalPosition(positionOptions) || POSITION_OFF_SCREEN;\n // Usually browsers make some problems with super accurate values like 104.345px\n // so it is better to use int values.\n const left = parseInt(optimalPosition.left);\n const top = parseInt(optimalPosition.top);\n const position = optimalPosition.name;\n const config = optimalPosition.config || {};\n const { withArrow = true } = config;\n this.top = top;\n this.left = left;\n this.position = position;\n this.withArrow = withArrow;\n return true;\n }\n /**\n * Works the same way as the {@link #attachTo} method except that the position of the panel is\n * continuously updated when:\n *\n * * any ancestor of the {@link module:utils/dom/position~Options#target}\n * or {@link module:utils/dom/position~Options#limiter} is scrolled,\n * * the browser window gets resized or scrolled.\n *\n * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}\n * and is immune to the changing environment.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Pin the panel to an element with the \"target\" id DOM.\n * panel.pin( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n *\n * To leave the pinned state, use the {@link #unpin} method.\n *\n * **Note**: Pinning the panel will also automatically {@link #show} it.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n */\n pin(options) {\n this.unpin();\n if (!this._startPinning(options)) {\n return;\n }\n this._pinWhenIsVisibleCallback = () => {\n if (this.isVisible) {\n this._startPinning(options);\n }\n else {\n this._stopPinning();\n }\n };\n // Control the state of the listeners depending on whether the panel is visible\n // or not.\n // TODO: Use on() (https://github.com/ckeditor/ckeditor5-utils/issues/144).\n this.listenTo(this, 'change:isVisible', this._pinWhenIsVisibleCallback);\n }\n /**\n * Stops pinning the panel, as set up by {@link #pin}.\n */\n unpin() {\n if (this._pinWhenIsVisibleCallback) {\n // Deactivate listeners attached by pin().\n this._stopPinning();\n // Deactivate the panel pin() control logic.\n // TODO: Use off() (https://github.com/ckeditor/ckeditor5-utils/issues/144).\n this.stopListening(this, 'change:isVisible', this._pinWhenIsVisibleCallback);\n this._pinWhenIsVisibleCallback = null;\n this.hide();\n }\n }\n /**\n * Starts managing the pinned state of the panel. See {@link #pin}.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n * @returns Whether the balloon was shown and successfully attached or not. Attaching can fail if the target\n * provided in the options is invisible (e.g. element detached from DOM).\n */\n _startPinning(options) {\n if (!this.attachTo(options)) {\n return false;\n }\n const targetElement = getDomElement(options.target);\n const limiterElement = options.limiter ? getDomElement(options.limiter) : global.document.body;\n // Then we need to listen on scroll event of eny element in the document.\n this.listenTo(global.document, 'scroll', (evt, domEvt) => {\n const scrollTarget = domEvt.target;\n // The position needs to be updated if the positioning target is within the scrolled element.\n const isWithinScrollTarget = targetElement && scrollTarget.contains(targetElement);\n // The position needs to be updated if the positioning limiter is within the scrolled element.\n const isLimiterWithinScrollTarget = limiterElement && scrollTarget.contains(limiterElement);\n // The positioning target and/or limiter can be a Rect, object etc..\n // There's no way to optimize the listener then.\n if (isWithinScrollTarget || isLimiterWithinScrollTarget || !targetElement || !limiterElement) {\n this.attachTo(options);\n }\n }, { useCapture: true });\n // We need to listen on window resize event and update position.\n this.listenTo(global.window, 'resize', () => {\n this.attachTo(options);\n });\n // Hide the panel if the target element is no longer visible.\n if (targetElement && !this._resizeObserver) {\n const checkVisibility = () => {\n // If the target element is no longer visible, hide the panel.\n if (!isVisible(targetElement)) {\n this.unpin();\n }\n };\n // Element is being resized to 0x0 after it's parent became hidden,\n // so we need to check size in order to determine if it's visible or not.\n this._resizeObserver = new ResizeObserver(targetElement, checkVisibility);\n }\n return true;\n }\n /**\n * Stops managing the pinned state of the panel. See {@link #pin}.\n */\n _stopPinning() {\n this.stopListening(global.document, 'scroll');\n this.stopListening(global.window, 'resize');\n if (this._resizeObserver) {\n this._resizeObserver.destroy();\n this._resizeObserver = null;\n }\n }\n /**\n * Returns available {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}\n * {@link module:utils/dom/position~PositioningFunction positioning functions} adjusted by the specific offsets.\n *\n * @internal\n * @param options Options to generate positions. If not specified, this helper will simply return\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n * @param options.sideOffset A custom side offset (in pixels) of each position. If\n * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowSideOffset the default value}\n * will be used.\n * @param options.heightOffset A custom height offset (in pixels) of each position. If\n * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHeightOffset the default value}\n * will be used.\n * @param options.stickyVerticalOffset A custom offset (in pixels) of the `viewportStickyNorth` positioning function.\n * If not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset the default value}\n * will be used.\n * @param options.config Additional configuration of the balloon balloon panel view.\n * Currently only {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#withArrow} is supported. Learn more\n * about {@link module:utils/dom/position~PositioningFunction positioning functions}.\n */\n static generatePositions(options = {}) {\n const { sideOffset = BalloonPanelView.arrowSideOffset, heightOffset = BalloonPanelView.arrowHeightOffset, stickyVerticalOffset = BalloonPanelView.stickyVerticalOffset, config } = options;\n return {\n // ------- North west\n northWestArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northWestArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northWestArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northWestArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northWestArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- North\n northArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- North east\n northEastArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northEastArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northEastArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northEastArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northEastArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- South west\n southWestArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southWestArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southWestArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southWestArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southWestArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- South\n southArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * 0.25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * 0.75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- South east\n southEastArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southEastArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southEastArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southEastArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southEastArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- West\n westArrowEast: (targetRect, balloonRect) => ({\n top: targetRect.top + targetRect.height / 2 - balloonRect.height / 2,\n left: targetRect.left - balloonRect.width - heightOffset,\n name: 'arrow_e',\n ...(config && { config })\n }),\n // ------- East\n eastArrowWest: (targetRect, balloonRect) => ({\n top: targetRect.top + targetRect.height / 2 - balloonRect.height / 2,\n left: targetRect.right + heightOffset,\n name: 'arrow_w',\n ...(config && { config })\n }),\n // ------- Sticky\n viewportStickyNorth: (targetRect, balloonRect, viewportRect, limiterRect) => {\n const boundaryRect = limiterRect || viewportRect;\n if (!targetRect.getIntersection(boundaryRect)) {\n return null;\n }\n // Engage when the target top and bottom edges are close or off the boundary.\n // By close, it means there's not enough space for the balloon arrow (offset).\n if (boundaryRect.height - targetRect.height > stickyVerticalOffset) {\n return null;\n }\n return {\n top: boundaryRect.top + stickyVerticalOffset,\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrowless',\n config: {\n withArrow: false,\n ...config\n }\n };\n }\n };\n /**\n * Returns the top coordinate for positions starting with `north*`.\n *\n * @param targetRect A rect of the target.\n * @param balloonRect A rect of the balloon.\n */\n function getNorthTop(targetRect, balloonRect) {\n return targetRect.top - balloonRect.height - heightOffset;\n }\n /**\n * Returns the top coordinate for positions starting with `south*`.\n *\n * @param targetRect A rect of the target.\n */\n function getSouthTop(targetRect) {\n return targetRect.bottom + heightOffset;\n }\n }\n}\n/**\n * A side offset of the arrow tip from the edge of the balloon. Controlled by CSS.\n *\n * ```\n *\t\t ┌───────────────────────â”\n *\t\t │ │\n *\t\t │ Balloon │\n *\t\t │ Content │\n *\t\t │ │\n *\t\t └──+ +───────────────┘\n *\t\t | \\ /\n *\t\t | \\/\n *\t\t>┼─────┼< ─────────────────────── side offset\n *\n * ```\n *\n * @default 25\n */\nBalloonPanelView.arrowSideOffset = 25;\n/**\n * A height offset of the arrow from the edge of the balloon. Controlled by CSS.\n *\n * ```\n *\t\t ┌───────────────────────â”\n *\t\t │ │\n *\t\t │ Balloon │\n *\t\t │ Content │ ╱-- arrow height offset\n *\t\t │ │ V\n *\t\t └──+ +───────────────┘ --- ─┼───────\n *\t\t \\ / │\n *\t\t \\/ │\n *\t\t────────────────────────────────┼───────\n *\t\t ^\n *\n *\n *\t\t>┼────┼< arrow height offset\n *\t\t │ │\n *\t\t │ ┌────────────────────────â”\n *\t\t │ │ │\n *\t\t │ ╱ │\n *\t\t │ ╱ Balloon │\n *\t\t │ ╲ Content │\n *\t\t │ ╲ │\n *\t\t │ │ │\n *\t\t │ └────────────────────────┘\n * ```\n *\n * @default 10\n*/\nBalloonPanelView.arrowHeightOffset = 10;\n/**\n * A vertical offset of the balloon panel from the edge of the viewport if sticky.\n * It helps in accessing toolbar buttons underneath the balloon panel.\n *\n * ```\n *\t\t ┌───────────────────────────────────────────────────â”\n *\t\t │ Target │\n *\t\t │ │\n *\t\t │ /── vertical offset │\n *\t\t┌─────────────────────────────V─────────────────────────â”\n *\t\t│ Toolbar ┌─────────────┠│\n *\t\t├────────────────────│ Balloon │────────────────────┤\n *\t\t│ │ └─────────────┘ │ │\n *\t\t│ │ │ │\n *\t\t│ │ │ │\n *\t\t│ │ │ │\n *\t\t│ └───────────────────────────────────────────────────┘ │\n *\t\t│ Viewport │\n *\t\t└───────────────────────────────────────────────────────┘\n * ```\n *\n * @default 20\n */\nBalloonPanelView.stickyVerticalOffset = 20;\n/**\n * Function used to calculate the optimal position for the balloon.\n */\nBalloonPanelView._getOptimalPosition = getOptimalPosition;\n/**\n * A default set of positioning functions used by the balloon panel view\n * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.\n *\n * The available positioning functions are as follows:\n *\n * **North west**\n *\n * * `northWestArrowSouthWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthMiddleWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **North**\n *\n * * `northArrowSouthWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northArrowSouthMiddleWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n * * `northArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **North east**\n *\n * * `northEastArrowSouthWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouthMiddleWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northEastArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **South**\n *\n * * `southArrowNorthWest`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorth`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **South west**\n *\n * * `southWestArrowNorthWest`\n *\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southWestArrowNorth`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **South east**\n *\n * * `southEastArrowNorthWest`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southEastArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southEastArrowNorth`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southEastArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southEastArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **West**\n *\n * * `westArrowEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |>[ Target ]\n *\t\t+-----------------+\n * ```\n *\n * **East**\n *\n * * `eastArrowWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t[ Target ]<| Balloon |\n *\t\t +-----------------+\n * ```\n *\n * **Sticky**\n *\n * * `viewportStickyNorth`\n *\n * ```\n *\t\t +---------------------------+\n *\t\t | [ Target ] |\n *\t\t | |\n *\t\t+-----------------------------------+\n *\t\t| | +-----------------+ | |\n *\t\t| | | Balloon | | |\n *\t\t| | +-----------------+ | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| +---------------------------+ |\n *\t\t| Viewport |\n *\t\t+-----------------------------------+\n * ```\n *\n * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.\n *\n * Positioning functions must be compatible with {@link module:utils/dom/position~DomPoint}.\n *\n * Default positioning functions with customized offsets can be generated using\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.generatePositions}.\n *\n * The name that the position function returns will be reflected in the balloon panel's class that\n * controls the placement of the \"arrow\". See {@link #position} to learn more.\n */\nBalloonPanelView.defaultPositions = BalloonPanelView.generatePositions();\nexport default BalloonPanelView;\n/**\n * Returns the DOM element for given object or null, if there is none,\n * e.g. when the passed object is a Rect instance or so.\n */\nfunction getDomElement(object) {\n if (isElement(object)) {\n return object;\n }\n if (isRange(object)) {\n return object.commonAncestorContainer;\n }\n if (typeof object == 'function') {\n return getDomElement(object());\n }\n return null;\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tooltip.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tooltip.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/tooltipmanager\n */\nimport View from './view.js';\nimport BalloonPanelView from './panel/balloon/balloonpanelview.js';\nimport { DomEmitterMixin, first, global, isVisible } from '@ckeditor/ckeditor5-utils';\nimport { isElement, debounce } from 'lodash-es';\nimport '../theme/components/tooltip/tooltip.css';\nconst BALLOON_CLASS = 'ck-tooltip';\n/**\n * A tooltip manager class for the UI of the editor.\n *\n * **Note**: Most likely you do not have to use the `TooltipManager` API listed below in order to display tooltips. Popular\n * {@glink framework/architecture/ui-library UI components} support tooltips out-of-the-box via observable properties\n * (see {@link module:ui/button/buttonview~ButtonView#tooltip} and {@link module:ui/button/buttonview~ButtonView#tooltipPosition}).\n *\n * # Displaying tooltips\n *\n * To display a tooltip, set `data-cke-tooltip-text` attribute on any DOM element:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'My tooltip';\n * ```\n *\n * The tooltip will show up whenever the user moves the mouse over the element or the element gets focus in DOM.\n *\n * # Positioning tooltips\n *\n * To change the position of the tooltip, use the `data-cke-tooltip-position` attribute (`s`, `se`, `sw`, `n`, `e`, or `w`):\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Tooltip to the north';\n * domElement.dataset.ckeTooltipPosition = 'n';\n * ```\n *\n * # Disabling tooltips\n *\n * In order to disable the tooltip temporarily, use the `data-cke-tooltip-disabled` attribute:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Disabled. For now.';\n * domElement.dataset.ckeTooltipDisabled = 'true';\n * ```\n *\n * # Styling tooltips\n *\n * By default, the tooltip has `.ck-tooltip` class and its text inner `.ck-tooltip__text`.\n *\n * If your tooltip requires custom styling, using `data-cke-tooltip-class` attribute will add additional class to the balloon\n * displaying the tooltip:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Tooltip with a red text';\n * domElement.dataset.ckeTooltipClass = 'my-class';\n * ```\n *\n * ```css\n * .ck.ck-tooltip.my-class { color: red }\n * ```\n *\n * **Note**: This class is a singleton. All editor instances re-use the same instance loaded by\n * {@link module:ui/editorui/editorui~EditorUI} of the first editor.\n */\nclass TooltipManager extends /* #__PURE__ */ DomEmitterMixin() {\n /**\n * Creates an instance of the tooltip manager.\n */\n constructor(editor) {\n super();\n /**\n * Stores the reference to the DOM element the tooltip is attached to. `null` when there's no tooltip\n * in the UI.\n */\n this._currentElementWithTooltip = null;\n /**\n * Stores the current tooltip position. `null` when there's no tooltip in the UI.\n */\n this._currentTooltipPosition = null;\n /**\n * An instance of the mutation observer that keeps track on target element attributes changes.\n */\n this._mutationObserver = null;\n TooltipManager._editors.add(editor);\n // TooltipManager must be a singleton. Multiple instances would mean multiple tooltips attached\n // to the same DOM element with data-cke-tooltip-* attributes.\n if (TooltipManager._instance) {\n return TooltipManager._instance;\n }\n TooltipManager._instance = this;\n this.tooltipTextView = new View(editor.locale);\n this.tooltipTextView.set('text', '');\n this.tooltipTextView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-tooltip__text'\n ]\n },\n children: [\n {\n text: this.tooltipTextView.bindTemplate.to('text')\n }\n ]\n });\n this.balloonPanelView = new BalloonPanelView(editor.locale);\n this.balloonPanelView.class = BALLOON_CLASS;\n this.balloonPanelView.content.add(this.tooltipTextView);\n this._mutationObserver = createMutationObserver(() => {\n this._updateTooltipPosition();\n });\n this._pinTooltipDebounced = debounce(this._pinTooltip, 600);\n this._unpinTooltipDebounced = debounce(this._unpinTooltip, 400);\n this.listenTo(global.document, 'keydown', this._onKeyDown.bind(this), { useCapture: true });\n this.listenTo(global.document, 'mouseenter', this._onEnterOrFocus.bind(this), { useCapture: true });\n this.listenTo(global.document, 'mouseleave', this._onLeaveOrBlur.bind(this), { useCapture: true });\n this.listenTo(global.document, 'focus', this._onEnterOrFocus.bind(this), { useCapture: true });\n this.listenTo(global.document, 'blur', this._onLeaveOrBlur.bind(this), { useCapture: true });\n this.listenTo(global.document, 'scroll', this._onScroll.bind(this), { useCapture: true });\n // Because this class is a singleton, its only instance is shared across all editors and connects them through the reference.\n // This causes issues with the ContextWatchdog. When an error is thrown in one editor, the watchdog traverses the references\n // and (because of shared tooltip manager) figures that the error affects all editors and restarts them all.\n // This flag, excludes tooltip manager instance from the traversal and brings ContextWatchdog back to normal.\n // More in https://github.com/ckeditor/ckeditor5/issues/12292.\n this._watchdogExcluded = true;\n }\n /**\n * Destroys the tooltip manager.\n *\n * **Note**: The manager singleton cannot be destroyed until all editors that use it are destroyed.\n *\n * @param editor The editor the manager was created for.\n */\n destroy(editor) {\n const editorBodyViewCollection = editor.ui.view && editor.ui.view.body;\n TooltipManager._editors.delete(editor);\n this.stopListening(editor.ui);\n // Prevent the balloon panel from being destroyed in the EditorUI#destroy() cascade. It should be destroyed along\n // with the last editor only (https://github.com/ckeditor/ckeditor5/issues/12602).\n if (editorBodyViewCollection && editorBodyViewCollection.has(this.balloonPanelView)) {\n editorBodyViewCollection.remove(this.balloonPanelView);\n }\n if (!TooltipManager._editors.size) {\n this._unpinTooltip();\n this.balloonPanelView.destroy();\n this.stopListening();\n TooltipManager._instance = null;\n }\n }\n /**\n * Returns {@link #balloonPanelView} {@link module:utils/dom/position~PositioningFunction positioning functions} for a given position\n * name.\n *\n * @param position Name of the position (`s`, `se`, `sw`, `n`, `e`, or `w`).\n * @returns Positioning functions to be used by the {@link #balloonPanelView}.\n */\n static getPositioningFunctions(position) {\n const defaultPositions = TooltipManager.defaultBalloonPositions;\n return {\n // South is most popular. We can use positioning heuristics to avoid clipping by the viewport with the sane fallback.\n s: [\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthEast,\n defaultPositions.southArrowNorthWest\n ],\n n: [defaultPositions.northArrowSouth],\n e: [defaultPositions.eastArrowWest],\n w: [defaultPositions.westArrowEast],\n sw: [defaultPositions.southArrowNorthEast],\n se: [defaultPositions.southArrowNorthWest]\n }[position];\n }\n /**\n * Handles hiding tooltips on `keydown` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onKeyDown(evt, domEvent) {\n if (domEvent.key === 'Escape' && this._currentElementWithTooltip) {\n this._unpinTooltip();\n domEvent.stopPropagation();\n }\n }\n /**\n * Handles displaying tooltips on `mouseenter` and `focus` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onEnterOrFocus(evt, { target }) {\n const elementWithTooltipAttribute = getDescendantWithTooltip(target);\n // Abort when there's no descendant needing tooltip.\n if (!elementWithTooltipAttribute) {\n // Unpin if element is focused, regardless of whether it contains a label or not.\n // It also prevents tooltips from overlapping the menu bar\n if (evt.name === 'focus') {\n this._unpinTooltip();\n }\n return;\n }\n // Abort to avoid flashing when, for instance:\n // * a tooltip is displayed for a focused element, then the same element gets mouseentered,\n // * a tooltip is displayed for an element via mouseenter, then the focus moves to the same element.\n if (elementWithTooltipAttribute === this._currentElementWithTooltip) {\n return;\n }\n this._unpinTooltip();\n // The tooltip should be pinned immediately when the element gets focused using keyboard.\n // If it is focused using the mouse, the tooltip should be pinned after a delay to prevent flashing.\n // See https://github.com/ckeditor/ckeditor5/issues/16383\n if (evt.name === 'focus' && !elementWithTooltipAttribute.matches(':hover')) {\n this._pinTooltip(elementWithTooltipAttribute, getTooltipData(elementWithTooltipAttribute));\n }\n else {\n this._pinTooltipDebounced(elementWithTooltipAttribute, getTooltipData(elementWithTooltipAttribute));\n }\n }\n /**\n * Handles hiding tooltips on `mouseleave` and `blur` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onLeaveOrBlur(evt, { target, relatedTarget }) {\n if (evt.name === 'mouseleave') {\n // Don't act when the event does not concern a DOM element (e.g. a mouseleave out of an entire document),\n if (!isElement(target)) {\n return;\n }\n const balloonElement = this.balloonPanelView.element;\n const isEnteringBalloon = balloonElement && (balloonElement === relatedTarget || balloonElement.contains(relatedTarget));\n const isLeavingBalloon = !isEnteringBalloon && target === balloonElement;\n // Do not hide the tooltip when the user moves the cursor over it.\n if (isEnteringBalloon) {\n this._unpinTooltipDebounced.cancel();\n return;\n }\n // If a tooltip is currently visible, don't act for a targets other than the one it is attached to.\n // The only exception is leaving balloon, in this scenario tooltip should be closed.\n // For instance, a random mouseleave far away in the page should not unpin the tooltip that was pinned because\n // of a previous focus. Only leaving the same element should hide the tooltip.\n if (!isLeavingBalloon && this._currentElementWithTooltip && target !== this._currentElementWithTooltip) {\n return;\n }\n const descendantWithTooltip = getDescendantWithTooltip(target);\n const relatedDescendantWithTooltip = getDescendantWithTooltip(relatedTarget);\n // Unpin when the mouse was leaving element with a tooltip to a place which does not have or has a different tooltip.\n // Note that this should happen whether the tooltip is already visible or not, for instance,\n // it could be invisible but queued (debounced): it should get canceled.\n if (isLeavingBalloon || (descendantWithTooltip && descendantWithTooltip !== relatedDescendantWithTooltip)) {\n this._unpinTooltipDebounced();\n }\n }\n else {\n // If a tooltip is currently visible, don't act for a targets other than the one it is attached to.\n // For instance, a random blur in the web page should not unpin the tooltip that was pinned because of a previous mouseenter.\n if (this._currentElementWithTooltip && target !== this._currentElementWithTooltip) {\n return;\n }\n // Note that unpinning should happen whether the tooltip is already visible or not, for instance, it could be invisible but\n // queued (debounced): it should get canceled (e.g. quick focus then quick blur using the keyboard).\n this._unpinTooltipDebounced();\n }\n }\n /**\n * Handles hiding tooltips on `scroll` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onScroll(evt, { target }) {\n // No tooltip, no reason to react on scroll.\n if (!this._currentElementWithTooltip) {\n return;\n }\n // When scrolling a container that has both the balloon and the current element (common ancestor), the balloon can remain\n // visible (e.g. scrolling ≤body>). Otherwise, to avoid glitches (clipping, lagging) better just hide the tooltip.\n // Also, don't do anything when scrolling an unrelated DOM element that has nothing to do with the current element and the balloon.\n if (target.contains(this.balloonPanelView.element) && target.contains(this._currentElementWithTooltip)) {\n return;\n }\n this._unpinTooltip();\n }\n /**\n * Pins the tooltip to a specific DOM element.\n *\n * @param options.text Text of the tooltip to display.\n * @param options.position The position of the tooltip.\n * @param options.cssClass Additional CSS class of the balloon with the tooltip.\n */\n _pinTooltip(targetDomElement, { text, position, cssClass }) {\n this._unpinTooltip();\n // Use the body collection of the first editor.\n const bodyViewCollection = first(TooltipManager._editors.values()).ui.view.body;\n if (!bodyViewCollection.has(this.balloonPanelView)) {\n bodyViewCollection.add(this.balloonPanelView);\n }\n this.tooltipTextView.text = text;\n this.balloonPanelView.class = [BALLOON_CLASS, cssClass]\n .filter(className => className)\n .join(' ');\n // Ensure that all changes to the tooltip are set before pinning it.\n // Setting class or text after pinning can cause the tooltip to be pinned in the wrong position.\n // It happens especially often when tooltip has class modified (like adding `ck-tooltip_multi-line`).\n // See https://github.com/ckeditor/ckeditor5/issues/16365\n this.balloonPanelView.pin({\n target: targetDomElement,\n positions: TooltipManager.getPositioningFunctions(position)\n });\n this._mutationObserver.attach(targetDomElement);\n // Start responding to changes in editor UI or content layout. For instance, when collaborators change content\n // and a contextual toolbar attached to a content starts to move (and so should move the tooltip).\n // Note: Using low priority to let other listeners that position contextual toolbars etc. to react first.\n for (const editor of TooltipManager._editors) {\n this.listenTo(editor.ui, 'update', this._updateTooltipPosition.bind(this), { priority: 'low' });\n }\n this._currentElementWithTooltip = targetDomElement;\n this._currentTooltipPosition = position;\n }\n /**\n * Unpins the tooltip and cancels all queued pinning.\n */\n _unpinTooltip() {\n this._unpinTooltipDebounced.cancel();\n this._pinTooltipDebounced.cancel();\n this.balloonPanelView.unpin();\n for (const editor of TooltipManager._editors) {\n this.stopListening(editor.ui, 'update');\n }\n this._currentElementWithTooltip = null;\n this._currentTooltipPosition = null;\n this.tooltipTextView.text = '';\n this._mutationObserver.detach();\n }\n /**\n * Updates the position of the tooltip so it stays in sync with the element it is pinned to.\n *\n * Hides the tooltip when the element is no longer visible in DOM or the tooltip text was removed.\n */\n _updateTooltipPosition() {\n // The tooltip might get removed by focus listener triggered by the same UI `update` event.\n // See https://github.com/ckeditor/ckeditor5/pull/16363.\n if (!this._currentElementWithTooltip) {\n return;\n }\n const tooltipData = getTooltipData(this._currentElementWithTooltip);\n // This could happen if the tooltip was attached somewhere in a contextual content toolbar and the toolbar\n // disappeared (e.g. removed an image), or the tooltip text was removed.\n if (!isVisible(this._currentElementWithTooltip) || !tooltipData.text) {\n this._unpinTooltip();\n return;\n }\n this.balloonPanelView.pin({\n target: this._currentElementWithTooltip,\n positions: TooltipManager.getPositioningFunctions(tooltipData.position)\n });\n }\n}\n/**\n * A set of default {@link module:utils/dom/position~PositioningFunction positioning functions} used by the `TooltipManager`\n * to pin tooltips in different positions.\n */\nTooltipManager.defaultBalloonPositions = BalloonPanelView.generatePositions({\n heightOffset: 5,\n sideOffset: 13\n});\n/**\n * A set of editors the single tooltip manager instance must listen to.\n * This is mostly to handle `EditorUI#update` listeners from individual editors.\n */\nTooltipManager._editors = new Set();\n/**\n * A reference to the `TooltipManager` instance. The class is a singleton and as such,\n * successive attempts at creating instances should return this instance.\n */\nTooltipManager._instance = null;\nexport default TooltipManager;\nfunction getDescendantWithTooltip(element) {\n if (!isElement(element)) {\n return null;\n }\n return element.closest('[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])');\n}\nfunction getTooltipData(element) {\n return {\n text: element.dataset.ckeTooltipText,\n position: (element.dataset.ckeTooltipPosition || 's'),\n cssClass: element.dataset.ckeTooltipClass || ''\n };\n}\n// Creates a simple `MutationObserver` instance wrapper that observes changes in the tooltip-related attributes of the given element.\n// Used instead of the `MutationObserver` from the engine for simplicity.\nfunction createMutationObserver(callback) {\n const mutationObserver = new MutationObserver(() => {\n callback();\n });\n return {\n attach(element) {\n mutationObserver.observe(element, {\n attributes: true,\n attributeFilter: ['data-cke-tooltip-text', 'data-cke-tooltip-position']\n });\n },\n detach() {\n mutationObserver.disconnect();\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { DomEmitterMixin, Rect, verifyLicense } from '@ckeditor/ckeditor5-utils';\nimport BalloonPanelView from '../panel/balloon/balloonpanelview.js';\nimport IconView from '../icon/iconview.js';\nimport View from '../view.js';\nimport { throttle } from 'lodash-es';\nimport poweredByIcon from '../../theme/icons/project-logo.svg';\nconst ICON_WIDTH = 53;\nconst ICON_HEIGHT = 10;\n// âš Note, whenever changing the threshold, make sure to update the docs/support/managing-ckeditor-logo.md docs\n// as this information is also mentioned there âš .\nconst NARROW_ROOT_HEIGHT_THRESHOLD = 50;\nconst NARROW_ROOT_WIDTH_THRESHOLD = 350;\nconst DEFAULT_LABEL = 'Powered by';\n/**\n * A helper that enables the \"powered by\" feature in the editor and renders a link to the project's\n * webpage next to the bottom of the editable element (editor root, source editing area, etc.) when the editor is focused.\n *\n * @private\n */\nexport default class PoweredBy extends /* #__PURE__ */ DomEmitterMixin() {\n /**\n * Creates a \"powered by\" helper for a given editor. The feature is initialized on Editor#ready\n * event.\n *\n * @param editor\n */\n constructor(editor) {\n super();\n this.editor = editor;\n this._balloonView = null;\n this._lastFocusedEditableElement = null;\n this._showBalloonThrottled = throttle(this._showBalloon.bind(this), 50, { leading: true });\n editor.on('ready', this._handleEditorReady.bind(this));\n }\n /**\n * Destroys the \"powered by\" helper along with its view.\n */\n destroy() {\n const balloon = this._balloonView;\n if (balloon) {\n // Balloon gets destroyed by the body collection.\n // The powered by view gets destroyed by the balloon.\n balloon.unpin();\n this._balloonView = null;\n }\n this._showBalloonThrottled.cancel();\n this.stopListening();\n }\n /**\n * Enables \"powered by\" label once the editor (ui) is ready.\n */\n _handleEditorReady() {\n const editor = this.editor;\n const forceVisible = !!editor.config.get('ui.poweredBy.forceVisible');\n /* istanbul ignore next -- @preserve */\n if (!forceVisible && verifyLicense(editor.config.get('licenseKey')) === 'VALID') {\n return;\n }\n // No view means no body collection to append the powered by balloon to.\n if (!editor.ui.view) {\n return;\n }\n editor.ui.focusTracker.on('change:isFocused', (evt, data, isFocused) => {\n this._updateLastFocusedEditableElement();\n if (isFocused) {\n this._showBalloon();\n }\n else {\n this._hideBalloon();\n }\n });\n editor.ui.focusTracker.on('change:focusedElement', (evt, data, focusedElement) => {\n this._updateLastFocusedEditableElement();\n if (focusedElement) {\n this._showBalloon();\n }\n });\n editor.ui.on('update', () => {\n this._showBalloonThrottled();\n });\n }\n /**\n * Creates an instance of the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon panel}\n * with the \"powered by\" view inside ready for positioning.\n */\n _createBalloonView() {\n const editor = this.editor;\n const balloon = this._balloonView = new BalloonPanelView();\n const poweredByConfig = getNormalizedConfig(editor);\n const view = new PoweredByView(editor.locale, poweredByConfig.label);\n balloon.content.add(view);\n balloon.set({\n class: 'ck-powered-by-balloon'\n });\n editor.ui.view.body.add(balloon);\n editor.ui.focusTracker.add(balloon.element);\n this._balloonView = balloon;\n }\n /**\n * Attempts to display the balloon with the \"powered by\" view.\n */\n _showBalloon() {\n if (!this._lastFocusedEditableElement) {\n return;\n }\n const attachOptions = getBalloonAttachOptions(this.editor, this._lastFocusedEditableElement);\n if (attachOptions) {\n if (!this._balloonView) {\n this._createBalloonView();\n }\n this._balloonView.pin(attachOptions);\n }\n }\n /**\n * Hides the \"powered by\" balloon if already visible.\n */\n _hideBalloon() {\n if (this._balloonView) {\n this._balloonView.unpin();\n }\n }\n /**\n * Updates the {@link #_lastFocusedEditableElement} based on the state of the global focus tracker.\n */\n _updateLastFocusedEditableElement() {\n const editor = this.editor;\n const isFocused = editor.ui.focusTracker.isFocused;\n const focusedElement = editor.ui.focusTracker.focusedElement;\n if (!isFocused || !focusedElement) {\n this._lastFocusedEditableElement = null;\n return;\n }\n const editableEditorElements = Array.from(editor.ui.getEditableElementsNames()).map(name => {\n return editor.ui.getEditableElement(name);\n });\n if (editableEditorElements.includes(focusedElement)) {\n this._lastFocusedEditableElement = focusedElement;\n }\n else {\n // If it's none of the editable element, then the focus is somewhere in the UI. Let's display powered by\n // over the first element then.\n this._lastFocusedEditableElement = editableEditorElements[0];\n }\n }\n}\n/**\n * A view displaying a \"powered by\" label and project logo wrapped in a link.\n */\nclass PoweredByView extends View {\n /**\n * Created an instance of the \"powered by\" view.\n *\n * @param locale The localization services instance.\n * @param label The label text.\n */\n constructor(locale, label) {\n super(locale);\n const iconView = new IconView();\n const bind = this.bindTemplate;\n iconView.set({\n content: poweredByIcon,\n isColorInherited: false\n });\n iconView.extendTemplate({\n attributes: {\n style: {\n width: ICON_WIDTH + 'px',\n height: ICON_HEIGHT + 'px'\n }\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck', 'ck-powered-by'],\n 'aria-hidden': true\n },\n children: [\n {\n tag: 'a',\n attributes: {\n href: 'https://ckeditor.com/?utm_source=ckeditor&' +\n 'utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo',\n target: '_blank',\n tabindex: '-1'\n },\n children: [\n ...label ? [\n {\n tag: 'span',\n attributes: {\n class: ['ck', 'ck-powered-by__label']\n },\n children: [label]\n }\n ] : [],\n iconView\n ],\n on: {\n dragstart: bind.to(evt => evt.preventDefault())\n }\n }\n ]\n });\n }\n}\nfunction getBalloonAttachOptions(editor, focusedEditableElement) {\n const poweredByConfig = getNormalizedConfig(editor);\n const positioningFunction = poweredByConfig.side === 'right' ?\n getLowerRightCornerPosition(focusedEditableElement, poweredByConfig) :\n getLowerLeftCornerPosition(focusedEditableElement, poweredByConfig);\n return {\n target: focusedEditableElement,\n positions: [positioningFunction]\n };\n}\nfunction getLowerRightCornerPosition(focusedEditableElement, config) {\n return getLowerCornerPosition(focusedEditableElement, config, (rootRect, balloonRect) => {\n return rootRect.left + rootRect.width - balloonRect.width - config.horizontalOffset;\n });\n}\nfunction getLowerLeftCornerPosition(focusedEditableElement, config) {\n return getLowerCornerPosition(focusedEditableElement, config, rootRect => rootRect.left + config.horizontalOffset);\n}\nfunction getLowerCornerPosition(focusedEditableElement, config, getBalloonLeft) {\n return (visibleEditableElementRect, balloonRect) => {\n const editableElementRect = new Rect(focusedEditableElement);\n if (editableElementRect.width < NARROW_ROOT_WIDTH_THRESHOLD || editableElementRect.height < NARROW_ROOT_HEIGHT_THRESHOLD) {\n return null;\n }\n let balloonTop;\n if (config.position === 'inside') {\n balloonTop = editableElementRect.bottom - balloonRect.height;\n }\n else {\n balloonTop = editableElementRect.bottom - balloonRect.height / 2;\n }\n balloonTop -= config.verticalOffset;\n const balloonLeft = getBalloonLeft(editableElementRect, balloonRect);\n // Clone the editable element rect and place it where the balloon would be placed.\n // This will allow getVisible() to work from editable element's perspective (rect source).\n // and yield a result as if the balloon was on the same (scrollable) layer as the editable element.\n const newBalloonPositionRect = visibleEditableElementRect\n .clone()\n .moveTo(balloonLeft, balloonTop)\n .getIntersection(balloonRect.clone().moveTo(balloonLeft, balloonTop));\n const newBalloonPositionVisibleRect = newBalloonPositionRect.getVisible();\n if (!newBalloonPositionVisibleRect || newBalloonPositionVisibleRect.getArea() < balloonRect.getArea()) {\n return null;\n }\n return {\n top: balloonTop,\n left: balloonLeft,\n name: `position_${config.position}-side_${config.side}`,\n config: {\n withArrow: false\n }\n };\n };\n}\nfunction getNormalizedConfig(editor) {\n const userConfig = editor.config.get('ui.poweredBy');\n const position = userConfig && userConfig.position || 'border';\n return {\n position,\n label: DEFAULT_LABEL,\n verticalOffset: position === 'inside' ? 5 : 0,\n horizontalOffset: 5,\n side: editor.locale.contentLanguageDirection === 'ltr' ? 'right' : 'left',\n ...userConfig\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/verifylicense\n */\nimport { releaseDate } from './version.js';\n/**\n * Checks whether the given string contains information that allows you to verify the license status.\n *\n * @param token The string to check.\n * @returns String that represents the state of given `token` parameter.\n */\nexport default function verifyLicense(token) {\n // This function implements naive and partial license key check mechanism,\n // used only to decide whether to show or hide the \"Powered by CKEditor\" logo.\n //\n // You can read the reasoning behind showing the logo to unlicensed (GPL) users\n // in this thread: https://github.com/ckeditor/ckeditor5/issues/14082.\n //\n // We firmly believe in the values behind creating open-source software, even when that\n // means keeping the license verification logic open for everyone to see.\n //\n // Please keep this code intact. Thank you for your understanding.\n function oldTokenCheck(token) {\n if (token.length >= 40 && token.length <= 255) {\n return 'VALID';\n }\n else {\n return 'INVALID';\n }\n }\n // TODO: issue ci#3175\n if (!token) {\n return 'INVALID';\n }\n let decryptedData = '';\n try {\n decryptedData = atob(token);\n }\n catch (e) {\n return 'INVALID';\n }\n const splittedDecryptedData = decryptedData.split('-');\n const firstElement = splittedDecryptedData[0];\n const secondElement = splittedDecryptedData[1];\n if (!secondElement) {\n return oldTokenCheck(token);\n }\n try {\n atob(secondElement);\n }\n catch (e) {\n try {\n atob(firstElement);\n if (!atob(firstElement).length) {\n return oldTokenCheck(token);\n }\n }\n catch (e) {\n return oldTokenCheck(token);\n }\n }\n if (firstElement.length < 40 || firstElement.length > 255) {\n return 'INVALID';\n }\n let decryptedSecondElement = '';\n try {\n atob(firstElement);\n decryptedSecondElement = atob(secondElement);\n }\n catch (e) {\n return 'INVALID';\n }\n if (decryptedSecondElement.length !== 8) {\n return 'INVALID';\n }\n const year = Number(decryptedSecondElement.substring(0, 4));\n const monthIndex = Number(decryptedSecondElement.substring(4, 6)) - 1;\n const day = Number(decryptedSecondElement.substring(6, 8));\n const date = new Date(year, monthIndex, day);\n if (date < releaseDate || isNaN(Number(date))) {\n return 'INVALID';\n }\n return 'VALID';\n}\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"53\\\" height=\\\"10\\\" viewBox=\\\"0 0 53 10\\\"><path fill=\\\"#1C2331\\\" d=\\\"M31.724 1.492a15.139 15.139 0 0 0 .045 1.16 2.434 2.434 0 0 0-.687-.34 3.68 3.68 0 0 0-1.103-.166 2.332 2.332 0 0 0-1.14.255 1.549 1.549 0 0 0-.686.87c-.15.41-.225.98-.225 1.712 0 .939.148 1.659.444 2.161.297.503.792.754 1.487.754.452.015.9-.094 1.294-.316.296-.174.557-.4.771-.669l.14.852h1.282V.007h-1.623v1.485ZM31 6.496a1.77 1.77 0 0 1-.494.061.964.964 0 0 1-.521-.127.758.758 0 0 1-.296-.466 3.984 3.984 0 0 1-.093-.992 4.208 4.208 0 0 1 .098-1.052.753.753 0 0 1 .307-.477 1.08 1.08 0 0 1 .55-.122c.233-.004.466.026.69.089l.483.144v2.553c-.11.076-.213.143-.307.2a1.73 1.73 0 0 1-.417.189ZM35.68 0l-.702.004c-.322.002-.482.168-.48.497l.004.581c.002.33.164.493.486.49l.702-.004c.322-.002.481-.167.48-.496L36.165.49c-.002-.33-.164-.493-.486-.491ZM36.145 2.313l-1.612.01.034 5.482 1.613-.01-.035-5.482ZM39.623.79 37.989.8 38 2.306l-.946.056.006 1.009.949-.006.024 2.983c.003.476.143.844.419 1.106.275.26.658.39 1.148.387.132 0 .293-.01.483-.03.19-.02.38-.046.57-.08.163-.028.324-.068.482-.119l-.183-1.095-.702.004a.664.664 0 0 1-.456-.123.553.553 0 0 1-.14-.422l-.016-2.621 1.513-.01-.006-1.064-1.514.01-.01-1.503ZM46.226 2.388c-.41-.184-.956-.274-1.636-.27-.673.004-1.215.101-1.627.29-.402.179-.72.505-.888.91-.18.419-.268.979-.264 1.68.004.688.1 1.24.285 1.655.172.404.495.724.9.894.414.18.957.268 1.63.264.68-.004 1.224-.099 1.632-.284.4-.176.714-.501.878-.905.176-.418.263-.971.258-1.658-.004-.702-.097-1.261-.28-1.677a1.696 1.696 0 0 0-.888-.9Zm-.613 3.607a.77.77 0 0 1-.337.501 1.649 1.649 0 0 1-1.317.009.776.776 0 0 1-.343-.497 4.066 4.066 0 0 1-.105-1.02 4.136 4.136 0 0 1 .092-1.03.786.786 0 0 1 .337-.507 1.59 1.59 0 0 1 1.316-.008.79.79 0 0 1 .344.502c.078.337.113.683.105 1.03.012.343-.019.685-.092 1.02ZM52.114 2.07a2.67 2.67 0 0 0-1.128.278c-.39.191-.752.437-1.072.73l-.157-.846-1.273.008.036 5.572 1.623-.01-.024-3.78c.35-.124.646-.22.887-.286.26-.075.53-.114.8-.118l.45-.003.144-1.546-.286.001ZM22.083 7.426l-1.576-2.532a2.137 2.137 0 0 0-.172-.253 1.95 1.95 0 0 0-.304-.29.138.138 0 0 1 .042-.04 1.7 1.7 0 0 0 .328-.374l1.75-2.71c.01-.015.025-.028.024-.048-.01-.01-.021-.007-.031-.007L20.49 1.17a.078.078 0 0 0-.075.045l-.868 1.384c-.23.366-.46.732-.688 1.099a.108.108 0 0 1-.112.06c-.098-.005-.196-.001-.294-.002-.018 0-.038.006-.055-.007.002-.02.002-.039.005-.058a4.6 4.6 0 0 0 .046-.701V1.203c0-.02-.009-.032-.03-.03h-.033L16.93 1.17c-.084 0-.073-.01-.073.076v6.491c-.001.018.006.028.025.027h1.494c.083 0 .072.007.072-.071v-2.19c0-.055-.003-.11-.004-.166a3.366 3.366 0 0 0-.05-.417h.06c.104 0 .209.002.313-.002a.082.082 0 0 1 .084.05c.535.913 1.07 1.824 1.607 2.736a.104.104 0 0 0 .103.062c.554-.003 1.107-.002 1.66-.002l.069-.003-.019-.032-.188-.304ZM27.112 6.555c-.005-.08-.004-.08-.082-.08h-2.414c-.053 0-.106-.003-.159-.011a.279.279 0 0 1-.246-.209.558.558 0 0 1-.022-.15c0-.382 0-.762-.002-1.143 0-.032.007-.049.042-.044h2.504c.029.003.037-.012.034-.038V3.814c0-.089.013-.078-.076-.078h-2.44c-.07 0-.062.003-.062-.06v-.837c0-.047.004-.093.013-.14a.283.283 0 0 1 .241-.246.717.717 0 0 1 .146-.011h2.484c.024.002.035-.009.036-.033l.003-.038.03-.496c.01-.183.024-.365.034-.548.005-.085.003-.087-.082-.094-.218-.018-.437-.038-.655-.05a17.845 17.845 0 0 0-.657-.026 72.994 72.994 0 0 0-1.756-.016 1.7 1.7 0 0 0-.471.064 1.286 1.286 0 0 0-.817.655c-.099.196-.149.413-.145.633v3.875c0 .072.003.144.011.216a1.27 1.27 0 0 0 .711 1.029c.228.113.48.167.734.158.757-.005 1.515.002 2.272-.042.274-.016.548-.034.82-.053.03-.002.043-.008.04-.041-.008-.104-.012-.208-.019-.312a69.964 69.964 0 0 1-.05-.768ZM16.14 7.415l-.127-1.075c-.004-.03-.014-.04-.044-.037a13.125 13.125 0 0 1-.998.073c-.336.01-.672.02-1.008.016-.116-.001-.233-.014-.347-.039a.746.746 0 0 1-.45-.262c-.075-.1-.132-.211-.167-.33a3.324 3.324 0 0 1-.126-.773 9.113 9.113 0 0 1-.015-.749c0-.285.022-.57.065-.852.023-.158.066-.312.127-.46a.728.728 0 0 1 .518-.443 1.64 1.64 0 0 1 .397-.048c.628-.001 1.255.003 1.882.05.022.001.033-.006.036-.026l.003-.031.06-.55c.019-.177.036-.355.057-.532.004-.034-.005-.046-.04-.056a5.595 5.595 0 0 0-1.213-.21 10.783 10.783 0 0 0-.708-.02c-.24-.003-.48.01-.719.041a3.477 3.477 0 0 0-.625.14 1.912 1.912 0 0 0-.807.497c-.185.2-.33.433-.424.688a4.311 4.311 0 0 0-.24 1.096c-.031.286-.045.572-.042.86-.006.43.024.86.091 1.286.04.25.104.497.193.734.098.279.26.53.473.734.214.205.473.358.756.446.344.11.702.17 1.063.177a8.505 8.505 0 0 0 1.578-.083 6.11 6.11 0 0 0 .766-.18c.03-.008.047-.023.037-.057a.157.157 0 0 1-.003-.025Z\\\"/><path fill=\\\"#AFE229\\\" d=\\\"M6.016 6.69a1.592 1.592 0 0 0-.614.21c-.23.132-.422.32-.56.546-.044.072-.287.539-.287.539l-.836 1.528.009.006c.038.025.08.046.123.063.127.046.26.07.395.073.505.023 1.011-.007 1.517-.003.29.009.58.002.869-.022a.886.886 0 0 0 .395-.116.962.962 0 0 0 .312-.286c.056-.083.114-.163.164-.249.24-.408.48-.816.718-1.226.075-.128.148-.257.222-.386l.112-.192a1.07 1.07 0 0 0 .153-.518l-1.304.023s-1.258-.005-1.388.01Z\\\"/><path fill=\\\"#771BFF\\\" d=\\\"m2.848 9.044.76-1.39.184-.352c-.124-.067-.245-.14-.367-.21-.346-.204-.706-.384-1.045-.6a.984.984 0 0 1-.244-.207c-.108-.134-.136-.294-.144-.46-.021-.409-.002-.818-.009-1.227-.003-.195 0-.39.003-.585.004-.322.153-.553.427-.713l.833-.488c.22-.13.44-.257.662-.385.05-.029.105-.052.158-.077.272-.128.519-.047.76.085l.044.028c.123.06.242.125.358.196.318.178.635.357.952.537.095.056.187.117.275.184.194.144.254.35.266.578.016.284.007.569.006.853-.001.28.004.558 0 .838.592-.003 1.259 0 1.259 0l.723-.013c-.003-.292-.007-.584-.007-.876 0-.524.015-1.048-.016-1.571-.024-.42-.135-.8-.492-1.067a5.02 5.02 0 0 0-.506-.339A400.52 400.52 0 0 0 5.94.787C5.722.664 5.513.524 5.282.423 5.255.406 5.228.388 5.2.373 4.758.126 4.305-.026 3.807.21c-.097.046-.197.087-.29.14A699.896 699.896 0 0 0 .783 1.948c-.501.294-.773.717-.778 1.31-.004.36-.009.718-.001 1.077.016.754-.017 1.508.024 2.261.016.304.07.6.269.848.127.15.279.28.448.382.622.4 1.283.734 1.92 1.11l.183.109Z\\\"/></svg>\\n\";","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./arialiveannouncer.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./arialiveannouncer.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport View from './view.js';\nimport '../theme/components/arialiveannouncer/arialiveannouncer.css';\n/**\n * The politeness level of an `aria-live` announcement.\n *\n * Available keys are:\n * * `AriaLiveAnnouncerPoliteness.POLITE`,\n * * `AriaLiveAnnouncerPoliteness.ASSERTIVE`\n *\n * [Learn more](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#Politeness_levels).\n */\nexport const AriaLiveAnnouncerPoliteness = {\n POLITE: 'polite',\n ASSERTIVE: 'assertive'\n};\n/**\n * An accessibility helper that manages all ARIA live regions associated with an editor instance. ARIA live regions announce changes\n * to the state of the editor features.\n *\n * These announcements are consumed and propagated by screen readers and give users a better understanding of the current\n * state of the editor.\n *\n * To announce a state change to an editor use the {@link #announce} method:\n *\n * ```ts\n * editor.ui.ariaLiveAnnouncer.announce( 'Text of an announcement.' );\n * ```\n */\nexport default class AriaLiveAnnouncer {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n this.editor = editor;\n /**\n * Some screen readers only look at changes in the aria-live region.\n * They might not read a region that already has content when it is added.\n * To stop this problem, make sure to set up regions for all politeness settings when the editor starts.\n */\n editor.once('ready', () => {\n for (const politeness of Object.values(AriaLiveAnnouncerPoliteness)) {\n this.announce('', politeness);\n }\n });\n }\n /**\n * Sets an announcement text to an aria region that is then announced by a screen reader to the user.\n *\n * If the aria region of a specified politeness does not exist, it will be created and can be re-used later.\n *\n * The default announcement politeness level is `'polite'`.\n *\n * ```ts\n * // Most screen readers will queue announcements from multiple aria-live regions and read them out in the order they were emitted.\n * editor.ui.ariaLiveAnnouncer.announce( 'Image uploaded.' );\n * editor.ui.ariaLiveAnnouncer.announce( 'Connection lost. Reconnecting.' );\n * ```\n */\n announce(announcement, attributes = AriaLiveAnnouncerPoliteness.POLITE) {\n const editor = this.editor;\n if (!editor.ui.view) {\n return;\n }\n if (!this.view) {\n this.view = new AriaLiveAnnouncerView(editor.locale);\n editor.ui.view.body.add(this.view);\n }\n const { politeness, isUnsafeHTML } = typeof attributes === 'string' ? {\n politeness: attributes\n } : attributes;\n let politenessRegionView = this.view.regionViews.find(view => view.politeness === politeness);\n if (!politenessRegionView) {\n politenessRegionView = new AriaLiveAnnouncerRegionView(editor, politeness);\n this.view.regionViews.add(politenessRegionView);\n }\n politenessRegionView.announce({\n announcement,\n isUnsafeHTML\n });\n }\n}\n/**\n * The view that aggregates all `aria-live` regions.\n */\nexport class AriaLiveAnnouncerView extends View {\n constructor(locale) {\n super(locale);\n this.regionViews = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-aria-live-announcer'\n ]\n },\n children: this.regionViews\n });\n }\n}\n/**\n * The view that represents a single `aria-live`.\n */\nexport class AriaLiveAnnouncerRegionView extends View {\n constructor(editor, politeness) {\n super(editor.locale);\n this.setTemplate({\n tag: 'div',\n attributes: {\n 'aria-live': politeness,\n 'aria-relevant': 'additions'\n },\n children: [\n {\n tag: 'ul',\n attributes: {\n class: [\n 'ck',\n 'ck-aria-live-region-list'\n ]\n }\n }\n ]\n });\n editor.on('destroy', () => {\n if (this._pruneAnnouncementsInterval !== null) {\n clearInterval(this._pruneAnnouncementsInterval);\n this._pruneAnnouncementsInterval = null;\n }\n });\n this.politeness = politeness;\n this._domConverter = editor.data.htmlProcessor.domConverter;\n this._pruneAnnouncementsInterval = setInterval(() => {\n if (this.element && this._listElement.firstChild) {\n this._listElement.firstChild.remove();\n }\n }, 5000);\n }\n /**\n * Appends new announcement to region.\n */\n announce({ announcement, isUnsafeHTML }) {\n if (!announcement.trim().length) {\n return;\n }\n const messageListItem = document.createElement('li');\n if (isUnsafeHTML) {\n this._domConverter.setContentOf(messageListItem, announcement);\n }\n else {\n messageListItem.innerText = announcement;\n }\n this._listElement.appendChild(messageListItem);\n }\n /**\n * Return current announcements list HTML element.\n */\n get _listElement() {\n return this.element.querySelector('ul');\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenulistitem.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenulistitem.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport ListItemView from '../list/listitemview.js';\nimport '../../theme/components/menubar/menubarmenulistitem.css';\n/**\n * A menu bar list item view, a child of {@link module:ui/menubar/menubarmenulistview~MenuBarMenuListView}.\n *\n * Populate this item with a {@link module:ui/menubar/menubarmenulistitembuttonview~MenuBarMenuListItemButtonView} instance\n * or a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instance to create a sub-menu.\n */\nexport default class MenuBarMenuListItemView extends ListItemView {\n /**\n * Creates an instance of the list item view.\n *\n * @param locale The localization services instance.\n */\n constructor(locale, parentMenuView) {\n super(locale);\n const bind = this.bindTemplate;\n this.extendTemplate({\n attributes: {\n class: [\n 'ck-menu-bar__menu__item'\n ]\n },\n on: {\n 'mouseenter': bind.to('mouseenter')\n }\n });\n this.delegate('mouseenter').to(parentMenuView);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/menubar/utils\n */\nimport MenuBarMenuListItemView from './menubarmenulistitemview.js';\nimport clickOutsideHandler from '../bindings/clickoutsidehandler.js';\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\nimport { cloneDeep } from 'lodash-es';\nconst NESTED_PANEL_HORIZONTAL_OFFSET = 5;\n/**\n * Behaviors of the {@link module:ui/menubar/menubarview~MenuBarView} component.\n */\nexport const MenuBarBehaviors = {\n /**\n * When the bar is already open:\n * * Opens the menu when the user hovers over its button.\n * * Closes open menu when another menu's button gets hovered.\n */\n toggleMenusAndFocusItemsOnHover(menuBarView) {\n menuBarView.on('menu:mouseenter', evt => {\n // This behavior should be activated when one of condition is present:\n // 1. The user opened any submenu of menubar and hover over items in the menu bar.\n // 2. The user focused whole menubar using keyboard interaction and enabled focus borders and hover over items in the menu bar.\n if (!menuBarView.isFocusBorderEnabled && !menuBarView.isOpen) {\n return;\n }\n if (menuBarView.isOpen) {\n for (const menuView of menuBarView.menus) {\n // @if CK_DEBUG_MENU_BAR // const wasOpen = menuView.isOpen;\n const pathLeaf = evt.path[0];\n const isListItemContainingMenu = pathLeaf instanceof MenuBarMenuListItemView && pathLeaf.children.first === menuView;\n menuView.isOpen = (evt.path.includes(menuView) || isListItemContainingMenu) && menuView.isEnabled;\n // @if CK_DEBUG_MENU_BAR // if ( wasOpen !== menuView.isOpen ) {\n // @if CK_DEBUG_MENU_BAR // console.log( '[BEHAVIOR] toggleMenusAndFocusItemsOnHover(): Toggle',\n // @if CK_DEBUG_MENU_BAR // \tlogMenu( menuView ), 'isOpen', menuView.isOpen\n // @if CK_DEBUG_MENU_BAR // );\n // @if CK_DEBUG_MENU_BAR // }\n }\n }\n evt.source.focus();\n });\n },\n /**\n * Moves between top-level menus using the arrow left and right keys.\n *\n * If the menubar has already been open, the arrow keys move focus between top-level menu buttons and open them.\n * If the menubar is closed, the arrow keys only move focus between top-level menu buttons.\n */\n focusCycleMenusOnArrows(menuBarView) {\n const isContentRTL = menuBarView.locale.uiLanguageDirection === 'rtl';\n menuBarView.on('menu:arrowright', evt => {\n cycleTopLevelMenus(evt.source, isContentRTL ? -1 : 1);\n });\n menuBarView.on('menu:arrowleft', evt => {\n cycleTopLevelMenus(evt.source, isContentRTL ? 1 : -1);\n });\n function cycleTopLevelMenus(currentMenuView, step) {\n const currentIndex = menuBarView.children.getIndex(currentMenuView);\n const isCurrentMenuViewOpen = currentMenuView.isOpen;\n const menusCount = menuBarView.children.length;\n const menuViewToOpen = menuBarView.children.get((currentIndex + menusCount + step) % menusCount);\n currentMenuView.isOpen = false;\n if (isCurrentMenuViewOpen) {\n menuViewToOpen.isOpen = true;\n }\n menuViewToOpen.buttonView.focus();\n }\n },\n /**\n * Closes the entire sub-menu structure when the bar is closed. This prevents sub-menus from being open if the user\n * closes the entire bar, and then re-opens some top-level menu.\n */\n closeMenusWhenTheBarCloses(menuBarView) {\n menuBarView.on('change:isOpen', () => {\n if (!menuBarView.isOpen) {\n menuBarView.menus.forEach(menuView => {\n menuView.isOpen = false;\n // @if CK_DEBUG_MENU_BAR // console.log( '[BEHAVIOR] closeMenusWhenTheBarCloses(): Closing', logMenu( menuView ) );\n });\n }\n });\n },\n /**\n * Handles the following case:\n * 1. Hover to open a sub-menu (A). The button has focus.\n * 2. Press arrow up/down to move focus to another sub-menu (B) button.\n * 3. Press arrow right to open the sub-menu (B).\n * 4. The sub-menu (A) should close as it would with `toggleMenusAndFocusItemsOnHover()`.\n */\n closeMenuWhenAnotherOnTheSameLevelOpens(menuBarView) {\n menuBarView.on('menu:change:isOpen', (evt, name, isOpen) => {\n if (isOpen) {\n menuBarView.menus\n .filter(menuView => {\n return evt.source.parentMenuView === menuView.parentMenuView &&\n evt.source !== menuView &&\n menuView.isOpen;\n }).forEach(menuView => {\n menuView.isOpen = false;\n // @if CK_DEBUG_MENU_BAR // console.log( '[BEHAVIOR] closeMenuWhenAnotherOpens(): Closing', logMenu( menuView ) );\n });\n }\n });\n },\n /**\n * Closes the bar when the user clicked outside of it (page body, editor root, etc.).\n */\n closeOnClickOutside(menuBarView) {\n clickOutsideHandler({\n emitter: menuBarView,\n activator: () => menuBarView.isOpen,\n callback: () => menuBarView.close(),\n contextElements: () => menuBarView.children.map(child => child.element)\n });\n },\n /**\n * Tracks the keyboard focus interaction on the menu bar view. It is used to determine if the nested items\n * of the menu bar should render focus rings after first interaction with the keyboard.\n */\n enableFocusHighlightOnInteraction(menuBarView) {\n let isKeyPressed = false;\n menuBarView.on('change:isOpen', (_, evt, isOpen) => {\n if (!isOpen) {\n menuBarView.isFocusBorderEnabled = false;\n // Reset the flag when the menu bar is closed, menu items tend to intercept `keyup` event\n // and sometimes, after pressing `enter` on focused item, `isKeyPressed` stuck in `true` state.\n isKeyPressed = false;\n }\n });\n // After clicking menu bar list item the focus is moved to the newly opened submenu.\n // We need to enable focus border for the submenu items because after pressing arrow down it will\n // focus second item instead of first which is not super intuitive.\n menuBarView.listenTo(menuBarView.element, 'click', () => {\n if (menuBarView.isOpen && menuBarView.element.matches(':focus-within')) {\n menuBarView.isFocusBorderEnabled = true;\n }\n }, { useCapture: true });\n menuBarView.listenTo(menuBarView.element, 'keydown', () => {\n isKeyPressed = true;\n }, { useCapture: true });\n menuBarView.listenTo(menuBarView.element, 'keyup', () => {\n isKeyPressed = false;\n }, { useCapture: true });\n menuBarView.listenTo(menuBarView.element, 'focus', () => {\n if (isKeyPressed) {\n menuBarView.isFocusBorderEnabled = true;\n }\n }, { useCapture: true });\n }\n};\n/**\n * Behaviors of the {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} component.\n */\nexport const MenuBarMenuBehaviors = {\n /**\n * If the button of the menu is focused, pressing the arrow down key should open the panel and focus it.\n * This is analogous to the {@link module:ui/dropdown/dropdownview~DropdownView}.\n */\n openAndFocusPanelOnArrowDownKey(menuView) {\n menuView.keystrokes.set('arrowdown', (data, cancel) => {\n if (menuView.focusTracker.focusedElement === menuView.buttonView.element) {\n if (!menuView.isOpen) {\n menuView.isOpen = true;\n }\n menuView.panelView.focus();\n cancel();\n }\n });\n },\n /**\n * Open the menu on the right arrow key press. This allows for navigating to sub-menus using the keyboard.\n */\n openOnArrowRightKey(menuView) {\n const keystroke = menuView.locale.uiLanguageDirection === 'rtl' ? 'arrowleft' : 'arrowright';\n menuView.keystrokes.set(keystroke, (data, cancel) => {\n if (menuView.focusTracker.focusedElement !== menuView.buttonView.element || !menuView.isEnabled) {\n return;\n }\n // @if CK_DEBUG_MENU_BAR // console.log( '[BEHAVIOR] openOnArrowRightKey(): Opening', logMenu( menuView ) );\n if (!menuView.isOpen) {\n menuView.isOpen = true;\n }\n menuView.panelView.focus();\n cancel();\n });\n },\n /**\n * Opens the menu on its button click. Note that this behavior only opens but never closes the menu (unlike\n * {@link module:ui/dropdown/dropdownview~DropdownView}).\n */\n openOnButtonClick(menuView) {\n menuView.buttonView.on('execute', () => {\n menuView.isOpen = true;\n if (menuView.parentMenuView) {\n menuView.panelView.focus();\n }\n });\n },\n /**\n * Toggles the menu on its button click. This behavior is analogous to {@link module:ui/dropdown/dropdownview~DropdownView}.\n */\n toggleOnButtonClick(menuView) {\n menuView.buttonView.on('execute', () => {\n menuView.isOpen = !menuView.isOpen;\n });\n },\n /**\n * Closes the menu on the right left key press. This allows for navigating to sub-menus using the keyboard.\n */\n closeOnArrowLeftKey(menuView) {\n const keystroke = menuView.locale.uiLanguageDirection === 'rtl' ? 'arrowright' : 'arrowleft';\n menuView.keystrokes.set(keystroke, (data, cancel) => {\n if (menuView.isOpen) {\n menuView.isOpen = false;\n menuView.focus();\n cancel();\n }\n });\n },\n /**\n * Closes the menu on the esc key press. This allows for navigating to sub-menus using the keyboard.\n */\n closeOnEscKey(menuView) {\n menuView.keystrokes.set('esc', (data, cancel) => {\n if (menuView.isOpen) {\n menuView.isOpen = false;\n menuView.focus();\n cancel();\n }\n });\n },\n /**\n * Closes the menu when its parent menu also closed. This prevents from orphaned open menus when the parent menu re-opens.\n */\n closeOnParentClose(menuView) {\n menuView.parentMenuView.on('change:isOpen', (evt, name, isOpen) => {\n if (!isOpen && evt.source === menuView.parentMenuView) {\n // @if CK_DEBUG_MENU_BAR // console.log( '[BEHAVIOR] closeOnParentClose(): Closing', logMenu( menuView ) );\n menuView.isOpen = false;\n }\n });\n }\n};\n// @if CK_DEBUG_MENU_BAR // function logMenu( menuView: MenuBarMenuView ) {\n// @if CK_DEBUG_MENU_BAR //\treturn `\"${ menuView.buttonView.label }\"`;\n// @if CK_DEBUG_MENU_BAR // }\n/**\n * Contains every positioning function used by {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} that decides where the\n * {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView} should be placed.\n *\n * Top-level menu positioning functions:\n *\n *\t┌──────â”\n *\t│ │\n *\t├──────┴────────â”\n *\t│ │\n *\t│ │\n *\t│ │\n *\t│ SE │\n *\t└───────────────┘\n *\n *\t ┌──────â”\n *\t │ │\n *\t┌────────┴──────┤\n *\t│ │\n *\t│ │\n *\t│ │\n *\t│ SW │\n *\t└───────────────┘\n *\n *\t┌───────────────â”\n *\t│ NW │\n *\t│ │\n *\t│ │\n *\t│ │\n *\t└────────┬──────┤\n *\t │ │\n *\t └──────┘\n *\n *\t┌───────────────â”\n *\t│ NE │\n *\t│ │\n *\t│ │\n *\t│ │\n *\t├──────┬────────┘\n *\t│ │\n *\t└──────┘\n *\n * Sub-menu positioning functions:\n *\n *\t┌──────┬───────────────â”\n *\t│ │ │\n *\t└──────┤ │\n *\t │ │\n *\t │ ES │\n *\t └───────────────┘\n *\n *\t┌───────────────┬──────â”\n *\t│ │ │\n *\t│ ├──────┘\n *\t│ │\n *\t│ WS │\n *\t└───────────────┘\n *\n *\t ┌───────────────â”\n *\t │ EN │\n *\t │ │\n *\t┌──────┤ │\n *\t│ │ │\n *\t└──────┴───────────────┘\n *\n *\t┌───────────────â”\n *\t│ WN │\n *\t│ │\n *\t│ ├──────â”\n *\t│ │ │\n *\t└───────────────┴──────┘\n */\nexport const MenuBarMenuViewPanelPositioningFunctions = {\n southEast: buttonRect => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left,\n name: 'se'\n };\n },\n southWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - panelRect.width + buttonRect.width,\n name: 'sw'\n };\n },\n northEast: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left,\n name: 'ne'\n };\n },\n northWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - panelRect.width + buttonRect.width,\n name: 'nw'\n };\n },\n eastSouth: buttonRect => {\n return {\n top: buttonRect.top,\n left: buttonRect.right - NESTED_PANEL_HORIZONTAL_OFFSET,\n name: 'es'\n };\n },\n eastNorth: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.right - NESTED_PANEL_HORIZONTAL_OFFSET,\n name: 'en'\n };\n },\n westSouth: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top,\n left: buttonRect.left - panelRect.width + NESTED_PANEL_HORIZONTAL_OFFSET,\n name: 'ws'\n };\n },\n westNorth: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - panelRect.width + NESTED_PANEL_HORIZONTAL_OFFSET,\n name: 'wn'\n };\n }\n};\n/**\n * The default items {@link module:core/editor/editorconfig~EditorConfig#menuBar configuration} of the\n * {@link module:ui/menubar/menubarview~MenuBarView} component. It contains names of all menu bar components\n * registered in the {@link module:ui/componentfactory~ComponentFactory component factory} (available in the project).\n *\n * **Note**: Menu bar component names provided by core editor features are prefixed with `menuBar:` in order to distinguish\n * them from components referenced by the {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}, for instance,\n * `'menuBar:bold'` is a menu bar button but `'bold'` is a toolbar button.\n *\n * Below is the preset menu bar structure (the default value of `config.menuBar.items` property):\n *\n * ```ts\n * [\n * \t{\n * \t\tmenuId: 'file',\n * \t\tlabel: 'File',\n * \t\tgroups: [\n * \t\t\t{\n * \t\t\t\tgroupId: 'export',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:exportPdf',\n * \t\t\t\t\t'menuBar:exportWord'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'import',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:importWord'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'revisionHistory',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:revisionHistory'\n * \t\t\t\t]\n * \t\t\t}\n * \t\t]\n * \t},\n * \t{\n * \t\tmenuId: 'edit',\n * \t\tlabel: 'Edit',\n * \t\tgroups: [\n * \t\t\t{\n * \t\t\t\tgroupId: 'undo',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:undo',\n * \t\t\t\t\t'menuBar:redo'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'selectAll',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:selectAll'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'findAndReplace',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:findAndReplace'\n * \t\t\t\t]\n * \t\t\t}\n * \t\t]\n * \t},\n * \t{\n * \t\tmenuId: 'view',\n * \t\tlabel: 'View',\n * \t\tgroups: [\n * \t\t\t{\n * \t\t\t\tgroupId: 'sourceEditing',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:sourceEditing'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'showBlocks',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:showBlocks'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'previewMergeFields',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:previewMergeFields'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'restrictedEditingException',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:restrictedEditingException'\n * \t\t\t\t]\n * \t\t\t}\n * \t\t]\n * \t},\n * \t{\n * \t\tmenuId: 'insert',\n * \t\tlabel: 'Insert',\n * \t\tgroups: [\n * \t\t\t{\n * \t\t\t\tgroupId: 'insertMainWidgets',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:insertImage',\n * \t\t\t\t\t'menuBar:ckbox',\n * \t\t\t\t\t'menuBar:ckfinder',\n * \t\t\t\t\t'menuBar:insertTable'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'insertInline',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:link',\n * \t\t\t\t\t'menuBar:comment',\n * \t\t\t\t\t'menuBar:insertMergeField'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'insertMinorWidgets',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:mediaEmbed',\n * \t\t\t\t\t'menuBar:insertTemplate',\n * \t\t\t\t\t'menuBar:blockQuote',\n * \t\t\t\t\t'menuBar:codeBlock',\n * \t\t\t\t\t'menuBar:htmlEmbed'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'insertStructureWidgets',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:horizontalLine',\n * \t\t\t\t\t'menuBar:pageBreak',\n * \t\t\t\t\t'menuBar:tableOfContents'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'restrictedEditing',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:restrictedEditing'\n * \t\t\t\t]\n * \t\t\t}\n * \t\t]\n * \t},\n * \t{\n * \t\tmenuId: 'format',\n * \t\tlabel: 'Format',\n * \t\tgroups: [\n * \t\t\t{\n * \t\t\t\tgroupId: 'textAndFont',\n * \t\t\t\titems: [\n * \t\t\t\t\t{\n * \t\t\t\t\t\tmenuId: 'text',\n * \t\t\t\t\t\tlabel: 'Text',\n * \t\t\t\t\t\tgroups: [\n * \t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\tgroupId: 'basicStyles',\n * \t\t\t\t\t\t\t\titems: [\n * \t\t\t\t\t\t\t\t\t'menuBar:bold',\n * \t\t\t\t\t\t\t\t\t'menuBar:italic',\n * \t\t\t\t\t\t\t\t\t'menuBar:underline',\n * \t\t\t\t\t\t\t\t\t'menuBar:strikethrough',\n * \t\t\t\t\t\t\t\t\t'menuBar:superscript',\n * \t\t\t\t\t\t\t\t\t'menuBar:subscript',\n * \t\t\t\t\t\t\t\t\t'menuBar:code'\n * \t\t\t\t\t\t\t\t]\n * \t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\tgroupId: 'textPartLanguage',\n * \t\t\t\t\t\t\t\titems: [\n * \t\t\t\t\t\t\t\t\t'menuBar:textPartLanguage'\n * \t\t\t\t\t\t\t\t]\n * \t\t\t\t\t\t\t}\n * \t\t\t\t\t\t]\n * \t\t\t\t\t},\n * \t\t\t\t\t{\n * \t\t\t\t\t\tmenuId: 'font',\n * \t\t\t\t\t\tlabel: 'Font',\n * \t\t\t\t\t\tgroups: [\n * \t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\tgroupId: 'fontProperties',\n * \t\t\t\t\t\t\t\titems: [\n * \t\t\t\t\t\t\t\t\t'menuBar:fontSize',\n * \t\t\t\t\t\t\t\t\t'menuBar:fontFamily'\n * \t\t\t\t\t\t\t\t]\n * \t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\tgroupId: 'fontColors',\n * \t\t\t\t\t\t\t\titems: [\n * \t\t\t\t\t\t\t\t\t'menuBar:fontColor',\n * \t\t\t\t\t\t\t\t\t'menuBar:fontBackgroundColor'\n * \t\t\t\t\t\t\t\t]\n * \t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\tgroupId: 'highlight',\n * \t\t\t\t\t\t\t\titems: [\n * \t\t\t\t\t\t\t\t\t'menuBar:highlight'\n * \t\t\t\t\t\t\t\t]\n * \t\t\t\t\t\t\t}\n * \t\t\t\t\t\t]\n * \t\t\t\t\t},\n * \t\t\t\t\t'menuBar:heading'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'list',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:bulletedList',\n * \t\t\t\t\t'menuBar:numberedList',\n * \t\t\t\t\t'menuBar:multiLevelList',\n * \t\t\t\t\t'menuBar:todoList'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'indent',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:alignment',\n * \t\t\t\t\t'menuBar:indent',\n * \t\t\t\t\t'menuBar:outdent'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'caseChange',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:caseChange'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'removeFormat',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:removeFormat'\n * \t\t\t\t]\n * \t\t\t}\n * \t\t]\n * \t},\n * \t{\n * \t\tmenuId: 'tools',\n * \t\tlabel: 'Tools',\n * \t\tgroups: [\n * \t\t\t{\n * \t\t\t\tgroupId: 'aiTools',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:aiAssistant',\n * \t\t\t\t\t'menuBar:aiCommands'\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\t{\n * \t\t\t\tgroupId: 'tools',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:trackChanges',\n * \t\t\t\t\t'menuBar:commentsArchive'\n * \t\t\t\t]\n * \t\t\t}\n * \t\t]\n * \t},\n * \t{\n * \t\tmenuId: 'help',\n * \t\tlabel: 'Help',\n * \t\tgroups: [\n * \t\t\t{\n * \t\t\t\tgroupId: 'help',\n * \t\t\t\titems: [\n * \t\t\t\t\t'menuBar:accessibilityHelp'\n * \t\t\t\t]\n * \t\t\t}\n * \t\t]\n * \t}\n * ];\n * ```\n *\n * The menu bar can be customized using the `config.menuBar.removeItems` and `config.menuBar.addItems` properties.\n */\n// **NOTE: Whenever you make changes to this value, reflect it in the documentation above!**\nexport const DefaultMenuBarItems = [\n {\n menuId: 'file',\n label: 'File',\n groups: [\n {\n groupId: 'export',\n items: [\n 'menuBar:exportPdf',\n 'menuBar:exportWord'\n ]\n },\n {\n groupId: 'import',\n items: [\n 'menuBar:importWord'\n ]\n },\n {\n groupId: 'revisionHistory',\n items: [\n 'menuBar:revisionHistory'\n ]\n }\n ]\n },\n {\n menuId: 'edit',\n label: 'Edit',\n groups: [\n {\n groupId: 'undo',\n items: [\n 'menuBar:undo',\n 'menuBar:redo'\n ]\n },\n {\n groupId: 'selectAll',\n items: [\n 'menuBar:selectAll'\n ]\n },\n {\n groupId: 'findAndReplace',\n items: [\n 'menuBar:findAndReplace'\n ]\n }\n ]\n },\n {\n menuId: 'view',\n label: 'View',\n groups: [\n {\n groupId: 'sourceEditing',\n items: [\n 'menuBar:sourceEditing'\n ]\n },\n {\n groupId: 'showBlocks',\n items: [\n 'menuBar:showBlocks'\n ]\n },\n {\n groupId: 'previewMergeFields',\n items: [\n 'menuBar:previewMergeFields'\n ]\n },\n {\n groupId: 'restrictedEditing',\n items: [\n 'menuBar:restrictedEditing'\n ]\n }\n ]\n },\n {\n menuId: 'insert',\n label: 'Insert',\n groups: [\n {\n groupId: 'insertMainWidgets',\n items: [\n 'menuBar:insertImage',\n 'menuBar:ckbox',\n 'menuBar:ckfinder',\n 'menuBar:insertTable'\n ]\n },\n {\n groupId: 'insertInline',\n items: [\n 'menuBar:link',\n 'menuBar:comment',\n 'menuBar:insertMergeField'\n ]\n },\n {\n groupId: 'insertMinorWidgets',\n items: [\n 'menuBar:mediaEmbed',\n 'menuBar:insertTemplate',\n 'menuBar:specialCharacters',\n 'menuBar:blockQuote',\n 'menuBar:codeBlock',\n 'menuBar:htmlEmbed'\n ]\n },\n {\n groupId: 'insertStructureWidgets',\n items: [\n 'menuBar:horizontalLine',\n 'menuBar:pageBreak',\n 'menuBar:tableOfContents'\n ]\n },\n {\n groupId: 'restrictedEditingException',\n items: [\n 'menuBar:restrictedEditingException'\n ]\n }\n ]\n },\n {\n menuId: 'format',\n label: 'Format',\n groups: [\n {\n groupId: 'textAndFont',\n items: [\n {\n menuId: 'text',\n label: 'Text',\n groups: [\n {\n groupId: 'basicStyles',\n items: [\n 'menuBar:bold',\n 'menuBar:italic',\n 'menuBar:underline',\n 'menuBar:strikethrough',\n 'menuBar:superscript',\n 'menuBar:subscript',\n 'menuBar:code'\n ]\n },\n {\n groupId: 'textPartLanguage',\n items: [\n 'menuBar:textPartLanguage'\n ]\n }\n ]\n },\n {\n menuId: 'font',\n label: 'Font',\n groups: [\n {\n groupId: 'fontProperties',\n items: [\n 'menuBar:fontSize',\n 'menuBar:fontFamily'\n ]\n },\n {\n groupId: 'fontColors',\n items: [\n 'menuBar:fontColor',\n 'menuBar:fontBackgroundColor'\n ]\n },\n {\n groupId: 'highlight',\n items: [\n 'menuBar:highlight'\n ]\n }\n ]\n },\n 'menuBar:heading'\n ]\n },\n {\n groupId: 'list',\n items: [\n 'menuBar:bulletedList',\n 'menuBar:numberedList',\n 'menuBar:multiLevelList',\n 'menuBar:todoList'\n ]\n },\n {\n groupId: 'indent',\n items: [\n 'menuBar:alignment',\n 'menuBar:indent',\n 'menuBar:outdent'\n ]\n },\n {\n groupId: 'caseChange',\n items: [\n 'menuBar:caseChange'\n ]\n },\n {\n groupId: 'removeFormat',\n items: [\n 'menuBar:removeFormat'\n ]\n }\n ]\n },\n {\n menuId: 'tools',\n label: 'Tools',\n groups: [\n {\n groupId: 'aiTools',\n items: [\n 'menuBar:aiAssistant',\n 'menuBar:aiCommands'\n ]\n },\n {\n groupId: 'tools',\n items: [\n 'menuBar:trackChanges',\n 'menuBar:commentsArchive'\n ]\n }\n ]\n },\n {\n menuId: 'help',\n label: 'Help',\n groups: [\n {\n groupId: 'help',\n items: [\n 'menuBar:accessibilityHelp'\n ]\n }\n ]\n }\n];\n/**\n * Performs a cleanup and normalization of the menu bar configuration.\n */\nexport function normalizeMenuBarConfig(config) {\n let configObject;\n // The integrator specified the config as an object but without items. Let's give them defaults but respect their\n // additions and removals.\n if (!('items' in config) || !config.items) {\n configObject = {\n items: cloneDeep(DefaultMenuBarItems),\n addItems: [],\n removeItems: [],\n isVisible: true,\n isUsingDefaultConfig: true,\n ...config\n };\n }\n // The integrator specified the config as an object and there are items there. Let's take it as it is.\n else {\n configObject = {\n items: config.items,\n removeItems: [],\n addItems: [],\n isVisible: true,\n isUsingDefaultConfig: false,\n ...config\n };\n }\n return configObject;\n}\n/**\n * Processes a normalized menu bar config and returns a config clone with the following modifications:\n *\n * * Removed components that are not available in the component factory,\n * * Removed obsolete separators,\n * * Purged empty menus,\n * * Localized top-level menu labels.\n */\nexport function processMenuBarConfig({ normalizedConfig, locale, componentFactory, extraItems }) {\n const configClone = cloneDeep(normalizedConfig);\n handleAdditions(normalizedConfig, configClone, extraItems);\n handleRemovals(normalizedConfig, configClone);\n handleAdditions(normalizedConfig, configClone, configClone.addItems);\n purgeUnavailableComponents(normalizedConfig, configClone, componentFactory);\n purgeEmptyMenus(normalizedConfig, configClone);\n localizeMenuLabels(configClone, locale);\n return configClone;\n}\n/**\n * Removes items from the menu bar config based on user `removeItems` configuration. Users can remove\n * individual items, groups, or entire menus. For each removed item, a warning is logged if the item\n * was not found in the configuration.\n */\nfunction handleRemovals(originalConfig, config) {\n const itemsToBeRemoved = config.removeItems;\n const successfullyRemovedItems = [];\n // Remove top-level menus.\n config.items = config.items.filter(({ menuId }) => {\n if (itemsToBeRemoved.includes(menuId)) {\n successfullyRemovedItems.push(menuId);\n return false;\n }\n return true;\n });\n walkConfigMenus(config.items, menuDefinition => {\n // Remove groups from menus.\n menuDefinition.groups = menuDefinition.groups.filter(({ groupId }) => {\n if (itemsToBeRemoved.includes(groupId)) {\n successfullyRemovedItems.push(groupId);\n return false;\n }\n return true;\n });\n // Remove sub-menus and items from groups.\n for (const groupDefinition of menuDefinition.groups) {\n groupDefinition.items = groupDefinition.items.filter(item => {\n const itemId = getIdFromGroupItem(item);\n if (itemsToBeRemoved.includes(itemId)) {\n successfullyRemovedItems.push(itemId);\n return false;\n }\n return true;\n });\n }\n });\n for (const itemName of itemsToBeRemoved) {\n if (!successfullyRemovedItems.includes(itemName)) {\n /**\n * There was a problem processing the configuration of the menu bar. The item with the given\n * name does could not be removed from the menu bar configuration.\n *\n * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed\n * to provide a menu bar item has not been loaded or there is a typo in the\n * {@link module:core/editor/editorconfig~EditorConfig#menuBar menu bar configuration}.\n *\n * @error menu-bar-item-could-not-be-removed\n * @param menuBarConfig The full configuration of the menu bar.\n * @param itemName The name of the item that was not removed from the menu bar.\n */\n logWarning('menu-bar-item-could-not-be-removed', {\n menuBarConfig: originalConfig,\n itemName\n });\n }\n }\n}\n/**\n * Adds provided items to config. It allows for adding menus, groups, and items at arbitrary\n * positions in the menu bar. If the position does not exist, a warning is logged.\n */\nfunction handleAdditions(originalConfig, config, items) {\n const successFullyAddedItems = [];\n if (items.length == 0) {\n return;\n }\n for (const itemToAdd of items) {\n const relation = getRelationFromPosition(itemToAdd.position);\n const relativeId = getRelativeIdFromPosition(itemToAdd.position);\n // Adding a menu.\n if (isMenuBarMenuAddition(itemToAdd)) {\n if (!relativeId) {\n // Adding a top-level menu at the beginning of the menu bar.\n if (relation === 'start') {\n config.items.unshift(itemToAdd.menu);\n successFullyAddedItems.push(itemToAdd);\n }\n // Adding a top-level menu at the end of the menu bar.\n else if (relation === 'end') {\n config.items.push(itemToAdd.menu);\n successFullyAddedItems.push(itemToAdd);\n }\n }\n else {\n const topLevelMenuDefinitionIndex = config.items.findIndex(menuDefinition => menuDefinition.menuId === relativeId);\n // Adding a top-level menu somewhere between existing menu bar menus.\n if (topLevelMenuDefinitionIndex != -1) {\n if (relation === 'before') {\n config.items.splice(topLevelMenuDefinitionIndex, 0, itemToAdd.menu);\n successFullyAddedItems.push(itemToAdd);\n }\n else if (relation === 'after') {\n config.items.splice(topLevelMenuDefinitionIndex + 1, 0, itemToAdd.menu);\n successFullyAddedItems.push(itemToAdd);\n }\n }\n // Adding a sub-menu to an existing items group.\n else {\n const wasAdded = addMenuOrItemToGroup(config, itemToAdd.menu, relativeId, relation);\n if (wasAdded) {\n successFullyAddedItems.push(itemToAdd);\n }\n }\n }\n }\n // Adding a group.\n else if (isMenuBarMenuGroupAddition(itemToAdd)) {\n walkConfigMenus(config.items, menuDefinition => {\n if (menuDefinition.menuId === relativeId) {\n // Add a group at the start of a menu.\n if (relation === 'start') {\n menuDefinition.groups.unshift(itemToAdd.group);\n successFullyAddedItems.push(itemToAdd);\n }\n // Add a group at the end of a menu.\n else if (relation === 'end') {\n menuDefinition.groups.push(itemToAdd.group);\n successFullyAddedItems.push(itemToAdd);\n }\n }\n else {\n const relativeGroupIndex = menuDefinition.groups.findIndex(group => group.groupId === relativeId);\n if (relativeGroupIndex !== -1) {\n // Add a group before an existing group in a menu.\n if (relation === 'before') {\n menuDefinition.groups.splice(relativeGroupIndex, 0, itemToAdd.group);\n successFullyAddedItems.push(itemToAdd);\n }\n // Add a group after an existing group in a menu.\n else if (relation === 'after') {\n menuDefinition.groups.splice(relativeGroupIndex + 1, 0, itemToAdd.group);\n successFullyAddedItems.push(itemToAdd);\n }\n }\n }\n });\n }\n // Adding an item to an existing items group.\n else {\n const wasAdded = addMenuOrItemToGroup(config, itemToAdd.item, relativeId, relation);\n if (wasAdded) {\n successFullyAddedItems.push(itemToAdd);\n }\n }\n }\n for (const addedItemConfig of items) {\n if (!successFullyAddedItems.includes(addedItemConfig)) {\n /**\n * There was a problem processing the configuration of the menu bar. The configured item could not be added\n * because the position it was supposed to be added to does not exist.\n *\n * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed\n * to provide a menu bar item has not been loaded or there is a typo in the\n * {@link module:core/editor/editorconfig~EditorConfig#menuBar menu bar configuration}.\n *\n * @error menu-bar-item-could-not-be-removed\n * @param menuBarConfig The full configuration of the menu bar.\n * @param itemName The name of the item that was not removed from the menu bar.\n */\n logWarning('menu-bar-item-could-not-be-added', {\n menuBarConfig: originalConfig,\n addedItemConfig\n });\n }\n }\n}\n/**\n * Handles adding a sub-menu or an item into a group. The logic is the same for both cases.\n */\nfunction addMenuOrItemToGroup(config, itemOrMenuToAdd, relativeId, relation) {\n let wasAdded = false;\n walkConfigMenus(config.items, menuDefinition => {\n for (const { groupId, items: groupItems } of menuDefinition.groups) {\n // Avoid infinite loops.\n if (wasAdded) {\n return;\n }\n if (groupId === relativeId) {\n // Adding an item/menu at the beginning of a group.\n if (relation === 'start') {\n groupItems.unshift(itemOrMenuToAdd);\n wasAdded = true;\n }\n // Adding an item/menu at the end of a group.\n else if (relation === 'end') {\n groupItems.push(itemOrMenuToAdd);\n wasAdded = true;\n }\n }\n else {\n // Adding an item/menu relative to an existing item/menu.\n const relativeItemIndex = groupItems.findIndex(groupItem => {\n return getIdFromGroupItem(groupItem) === relativeId;\n });\n if (relativeItemIndex !== -1) {\n if (relation === 'before') {\n groupItems.splice(relativeItemIndex, 0, itemOrMenuToAdd);\n wasAdded = true;\n }\n else if (relation === 'after') {\n groupItems.splice(relativeItemIndex + 1, 0, itemOrMenuToAdd);\n wasAdded = true;\n }\n }\n }\n }\n });\n return wasAdded;\n}\n/**\n * Removes components from the menu bar configuration that are not available in the factory and would\n * not be instantiated. Warns about missing components if the menu bar configuration was specified by the user.\n */\nfunction purgeUnavailableComponents(originalConfig, config, componentFactory) {\n walkConfigMenus(config.items, menuDefinition => {\n for (const groupDefinition of menuDefinition.groups) {\n groupDefinition.items = groupDefinition.items.filter(item => {\n const isItemUnavailable = typeof item === 'string' && !componentFactory.has(item);\n // The default configuration contains all possible editor features. But integrators' editors rarely load\n // every possible feature. This is why we do not want to log warnings about unavailable items for the default config\n // because they would show up in almost every integration. If the configuration has been provided by\n // the integrator, on the other hand, then these warnings bring value.\n if (isItemUnavailable && !config.isUsingDefaultConfig) {\n /**\n * There was a problem processing the configuration of the menu bar. The item with the given\n * name does not exist so it was omitted when rendering the menu bar.\n *\n * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed\n * to provide a menu bar item has not been loaded or there is a typo in the\n * {@link module:core/editor/editorconfig~EditorConfig#menuBar menu bar configuration}.\n *\n * Make sure the plugin responsible for this menu bar item is loaded and the menu bar configuration\n * is correct, e.g. {@link module:basic-styles/bold/boldui~BoldUI} is loaded for the `'menuBar:bold'`\n * menu bar item.\n *\n * @error menu-bar-item-unavailable\n * @param menuBarConfig The full configuration of the menu bar.\n * @param parentMenuConfig The config of the menu the unavailable component was defined in.\n * @param componentName The name of the unavailable component.\n */\n logWarning('menu-bar-item-unavailable', {\n menuBarConfig: originalConfig,\n parentMenuConfig: cloneDeep(menuDefinition),\n componentName: item\n });\n }\n return !isItemUnavailable;\n });\n }\n });\n}\n/**\n * Removes empty menus from the menu bar configuration to improve the visual UX. Such menus can occur\n * when some plugins responsible for providing menu bar items have not been loaded and some part of\n * the configuration populated menus using these components exclusively.\n */\nfunction purgeEmptyMenus(originalConfig, config) {\n const isUsingDefaultConfig = config.isUsingDefaultConfig;\n let wasSubMenuPurged = false;\n // Purge top-level menus.\n config.items = config.items.filter(menuDefinition => {\n if (!menuDefinition.groups.length) {\n warnAboutEmptyMenu(originalConfig, menuDefinition, isUsingDefaultConfig);\n return false;\n }\n return true;\n });\n // Warn if there were no top-level menus left in the menu bar after purging.\n if (!config.items.length) {\n warnAboutEmptyMenu(originalConfig, originalConfig, isUsingDefaultConfig);\n return;\n }\n // Purge sub-menus and groups.\n walkConfigMenus(config.items, menuDefinition => {\n // Get rid of empty groups.\n menuDefinition.groups = menuDefinition.groups.filter(groupDefinition => {\n if (!groupDefinition.items.length) {\n wasSubMenuPurged = true;\n return false;\n }\n return true;\n });\n // Get rid of empty sub-menus.\n for (const groupDefinition of menuDefinition.groups) {\n groupDefinition.items = groupDefinition.items.filter(item => {\n // If no groups were left after removing empty ones.\n if (isMenuDefinition(item) && !item.groups.length) {\n warnAboutEmptyMenu(originalConfig, item, isUsingDefaultConfig);\n wasSubMenuPurged = true;\n return false;\n }\n return true;\n });\n }\n });\n if (wasSubMenuPurged) {\n // The config is walked from the root to the leaves so if anything gets removed, we need to re-run the\n // whole process because it could've affected parents.\n purgeEmptyMenus(originalConfig, config);\n }\n}\nfunction warnAboutEmptyMenu(originalConfig, emptyMenuConfig, isUsingDefaultConfig) {\n if (isUsingDefaultConfig) {\n return;\n }\n /**\n * There was a problem processing the configuration of the menu bar. One of the menus\n * is empty so it was omitted when rendering the menu bar.\n *\n * This warning usually shows up when some {@link module:core/plugin~Plugin plugins} responsible for\n * providing menu bar items have not been loaded and the\n * {@link module:core/editor/editorconfig~EditorConfig#menuBar menu bar configuration} was not updated.\n *\n * Make sure all necessary editor plugins are loaded and/or update the menu bar configuration\n * to account for the missing menu items.\n *\n * @error menu-bar-menu-empty\n * @param menuBarConfig The full configuration of the menu bar.\n * @param emptyMenuConfig The definition of the menu that has no child items.\n */\n logWarning('menu-bar-menu-empty', {\n menuBarConfig: originalConfig,\n emptyMenuConfig\n });\n}\n/**\n * Localizes the user-config using pre-defined localized category labels.\n */\nfunction localizeMenuLabels(config, locale) {\n const t = locale.t;\n const localizedCategoryLabels = {\n // Top-level categories.\n 'File': t({\n string: 'File',\n id: 'MENU_BAR_MENU_FILE'\n }),\n 'Edit': t({\n string: 'Edit',\n id: 'MENU_BAR_MENU_EDIT'\n }),\n 'View': t({\n string: 'View',\n id: 'MENU_BAR_MENU_VIEW'\n }),\n 'Insert': t({\n string: 'Insert',\n id: 'MENU_BAR_MENU_INSERT'\n }),\n 'Format': t({\n string: 'Format',\n id: 'MENU_BAR_MENU_FORMAT'\n }),\n 'Tools': t({\n string: 'Tools',\n id: 'MENU_BAR_MENU_TOOLS'\n }),\n 'Help': t({\n string: 'Help',\n id: 'MENU_BAR_MENU_HELP'\n }),\n // Sub-menus.\n 'Text': t({\n string: 'Text',\n id: 'MENU_BAR_MENU_TEXT'\n }),\n 'Font': t({\n string: 'Font',\n id: 'MENU_BAR_MENU_FONT'\n })\n };\n walkConfigMenus(config.items, definition => {\n if (definition.label in localizedCategoryLabels) {\n definition.label = localizedCategoryLabels[definition.label];\n }\n });\n}\n/**\n * Recursively visits all menu definitions in the config and calls the callback for each of them.\n */\nfunction walkConfigMenus(definition, callback) {\n if (Array.isArray(definition)) {\n for (const topLevelMenuDefinition of definition) {\n walk(topLevelMenuDefinition);\n }\n }\n function walk(menuDefinition) {\n callback(menuDefinition);\n for (const groupDefinition of menuDefinition.groups) {\n for (const groupItem of groupDefinition.items) {\n if (isMenuDefinition(groupItem)) {\n walk(groupItem);\n }\n }\n }\n }\n}\nfunction isMenuBarMenuAddition(definition) {\n return typeof definition === 'object' && 'menu' in definition;\n}\nfunction isMenuBarMenuGroupAddition(definition) {\n return typeof definition === 'object' && 'group' in definition;\n}\nfunction getRelationFromPosition(position) {\n if (position.startsWith('start')) {\n return 'start';\n }\n else if (position.startsWith('end')) {\n return 'end';\n }\n else if (position.startsWith('after')) {\n return 'after';\n }\n else {\n return 'before';\n }\n}\nfunction getRelativeIdFromPosition(position) {\n const match = position.match(/^[^:]+:(.+)/);\n if (match) {\n return match[1];\n }\n return null;\n}\nfunction getIdFromGroupItem(item) {\n return typeof item === 'string' ? item : item.menuId;\n}\nfunction isMenuDefinition(definition) {\n return typeof definition === 'object' && 'menuId' in definition;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/editorui\n */\n/* globals console */\nimport ComponentFactory from '../componentfactory.js';\nimport TooltipManager from '../tooltipmanager.js';\nimport PoweredBy from './poweredby.js';\nimport AriaLiveAnnouncer from '../arialiveannouncer.js';\nimport { ObservableMixin, isVisible, FocusTracker } from '@ckeditor/ckeditor5-utils';\nimport { normalizeMenuBarConfig } from '../menubar/utils.js';\n/**\n * A class providing the minimal interface that is required to successfully bootstrap any editor UI.\n */\nexport default class EditorUI extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates an instance of the editor UI class.\n *\n * @param editor The editor instance.\n */\n constructor(editor) {\n super();\n /**\n * Indicates the UI is ready. Set `true` after {@link #event:ready} event is fired.\n *\n * @readonly\n * @default false\n */\n this.isReady = false;\n /**\n * Stores all editable elements used by the editor instance.\n */\n this._editableElementsMap = new Map();\n /**\n * All available & focusable toolbars.\n */\n this._focusableToolbarDefinitions = [];\n /**\n * All additional menu bar items, groups or menus that have their default location defined.\n */\n this._extraMenuBarElements = [];\n /**\n * The last focused element to which focus should return on `Esc` press.\n */\n this._lastFocusedForeignElement = null;\n const editingView = editor.editing.view;\n this.editor = editor;\n this.componentFactory = new ComponentFactory(editor);\n this.focusTracker = new FocusTracker();\n this.tooltipManager = new TooltipManager(editor);\n this.poweredBy = new PoweredBy(editor);\n this.ariaLiveAnnouncer = new AriaLiveAnnouncer(editor);\n this.set('viewportOffset', this._readViewportOffsetFromConfig());\n this.once('ready', () => {\n this.isReady = true;\n });\n // Informs UI components that should be refreshed after layout change.\n this.listenTo(editingView.document, 'layoutChanged', this.update.bind(this));\n this.listenTo(editingView, 'scrollToTheSelection', this._handleScrollToTheSelection.bind(this));\n this._initFocusTracking();\n }\n /**\n * The main (outermost) DOM element of the editor UI.\n *\n * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `<div>` which\n * wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}\n * it is the editable element itself (as there is no other wrapper). However, in\n * {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not\n * come with a single \"main\" HTML element (its editable element and toolbar are separate).\n *\n * This property can be understood as a shorthand for retrieving the element that a specific editor integration\n * considers to be its main DOM element.\n */\n get element() {\n return null;\n }\n /**\n * Fires the {@link module:ui/editorui/editorui~EditorUI#event:update `update`} event.\n *\n * This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to\n * some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).\n */\n update() {\n this.fire('update');\n }\n /**\n * Destroys the UI.\n */\n destroy() {\n this.stopListening();\n this.focusTracker.destroy();\n this.tooltipManager.destroy(this.editor);\n this.poweredBy.destroy();\n // Clean–up the references to the CKEditor instance stored in the native editable DOM elements.\n for (const domElement of this._editableElementsMap.values()) {\n domElement.ckeditorInstance = null;\n this.editor.keystrokes.stopListening(domElement);\n }\n this._editableElementsMap = new Map();\n this._focusableToolbarDefinitions = [];\n }\n /**\n * Stores the native DOM editable element used by the editor under a unique name.\n *\n * Also, registers the element in the editor to maintain the accessibility of the UI. When the user is editing text in a focusable\n * editable area, they can use the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke to navigate over editor toolbars. See {@link #addToolbar}.\n *\n * @param rootName The unique name of the editable element.\n * @param domElement The native DOM editable element.\n */\n setEditableElement(rootName, domElement) {\n this._editableElementsMap.set(rootName, domElement);\n // Put a reference to the CKEditor instance in the editable native DOM element.\n // It helps 3rd–party software (browser extensions, other libraries) access and recognize\n // CKEditor 5 instances (editing roots) and use their API (there is no global editor\n // instance registry).\n if (!domElement.ckeditorInstance) {\n domElement.ckeditorInstance = this.editor;\n }\n // Register the element, so it becomes available for Alt+F10 and Esc navigation.\n this.focusTracker.add(domElement);\n const setUpKeystrokeHandler = () => {\n // The editing view of the editor is already listening to keystrokes from DOM roots (see: KeyObserver).\n // Do not duplicate listeners.\n if (this.editor.editing.view.getDomRoot(rootName)) {\n return;\n }\n this.editor.keystrokes.listenTo(domElement);\n };\n // For editable elements set by features after EditorUI is ready (e.g. source editing).\n if (this.isReady) {\n setUpKeystrokeHandler();\n }\n // For editable elements set while the editor is being created (e.g. DOM roots).\n else {\n this.once('ready', setUpKeystrokeHandler);\n }\n }\n /**\n * Removes the editable from the editor UI. Removes all handlers added by {@link #setEditableElement}.\n *\n * @param rootName The name of the editable element to remove.\n */\n removeEditableElement(rootName) {\n const domElement = this._editableElementsMap.get(rootName);\n if (!domElement) {\n return;\n }\n this._editableElementsMap.delete(rootName);\n this.editor.keystrokes.stopListening(domElement);\n this.focusTracker.remove(domElement);\n domElement.ckeditorInstance = null;\n }\n /**\n * Returns the editable editor element with the given name or null if editable does not exist.\n *\n * @param rootName The editable name.\n */\n getEditableElement(rootName = 'main') {\n return this._editableElementsMap.get(rootName);\n }\n /**\n * Returns array of names of all editor editable elements.\n */\n getEditableElementsNames() {\n return this._editableElementsMap.keys();\n }\n /**\n * Adds a toolbar to the editor UI. Used primarily to maintain the accessibility of the UI.\n *\n * Focusable toolbars can be accessed (focused) by users by pressing the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke.\n * Successive keystroke presses navigate over available toolbars.\n *\n * @param toolbarView A instance of the toolbar to be registered.\n */\n addToolbar(toolbarView, options = {}) {\n if (toolbarView.isRendered) {\n this.focusTracker.add(toolbarView.element);\n this.editor.keystrokes.listenTo(toolbarView.element);\n }\n else {\n toolbarView.once('render', () => {\n this.focusTracker.add(toolbarView.element);\n this.editor.keystrokes.listenTo(toolbarView.element);\n });\n }\n this._focusableToolbarDefinitions.push({ toolbarView, options });\n }\n /**\n * Registers an extra menu bar element, which could be a single item, a group of items, or a menu containing groups.\n *\n * ```ts\n * // Register a new menu bar item.\n * editor.ui.extendMenuBar( {\n * item: 'menuBar:customFunctionButton',\n * position: 'after:menuBar:bold'\n * } );\n *\n * // Register a new menu bar group.\n * editor.ui.extendMenuBar( {\n * group: {\n * groupId: 'customGroup',\n * items: [\n * 'menuBar:customFunctionButton'\n * ]\n * },\n * position: 'start:help'\n * } );\n *\n * // Register a new menu bar menu.\n * editor.ui.extendMenuBar( {\n * menu: {\n * menuId: 'customMenu',\n * label: 'customMenu',\n * groups: [\n * {\n * groupId: 'customGroup',\n * items: [\n * 'menuBar:customFunctionButton'\n * ]\n * }\n * ]\n * },\n * position: 'after:help'\n * } );\n * ```\n */\n extendMenuBar(config) {\n this._extraMenuBarElements.push(config);\n }\n /**\n * Stores all editable elements used by the editor instance.\n *\n * @deprecated\n */\n get _editableElements() {\n /**\n * The {@link module:ui/editorui/editorui~EditorUI#_editableElements `EditorUI#_editableElements`} property has been\n * deprecated and will be removed in the near future. Please use\n * {@link module:ui/editorui/editorui~EditorUI#setEditableElement `setEditableElement()`} and\n * {@link module:ui/editorui/editorui~EditorUI#getEditableElement `getEditableElement()`} methods instead.\n *\n * @error editor-ui-deprecated-editable-elements\n * @param editorUI Editor UI instance the deprecated property belongs to.\n */\n console.warn('editor-ui-deprecated-editable-elements: ' +\n 'The EditorUI#_editableElements property has been deprecated and will be removed in the near future.', { editorUI: this });\n return this._editableElementsMap;\n }\n /**\n * Initializes menu bar.\n */\n _initMenuBar(menuBarView) {\n const menuBarViewElement = menuBarView.element;\n this.focusTracker.add(menuBarViewElement);\n this.editor.keystrokes.listenTo(menuBarViewElement);\n const normalizedMenuBarConfig = normalizeMenuBarConfig(this.editor.config.get('menuBar') || {});\n menuBarView.fillFromConfig(normalizedMenuBarConfig, this.componentFactory, this._extraMenuBarElements);\n this.editor.keystrokes.set('Esc', (data, cancel) => {\n if (!menuBarViewElement.contains(this.editor.ui.focusTracker.focusedElement)) {\n return;\n }\n // Bring focus back to where it came from before focusing the toolbar:\n // If it came from outside the engine view (e.g. source editing), move it there.\n if (this._lastFocusedForeignElement) {\n this._lastFocusedForeignElement.focus();\n this._lastFocusedForeignElement = null;\n }\n // Else just focus the view editing.\n else {\n this.editor.editing.view.focus();\n }\n cancel();\n });\n this.editor.keystrokes.set('Alt+F9', (data, cancel) => {\n // If menu bar is already focused do nothing.\n if (menuBarViewElement.contains(this.editor.ui.focusTracker.focusedElement)) {\n return;\n }\n this._saveLastFocusedForeignElement();\n menuBarView.isFocusBorderEnabled = true;\n menuBarView.focus();\n cancel();\n });\n }\n /**\n * Returns viewport offsets object:\n *\n * ```js\n * {\n * \ttop: Number,\n * \tright: Number,\n * \tbottom: Number,\n * \tleft: Number\n * }\n * ```\n *\n * Only top property is currently supported.\n */\n _readViewportOffsetFromConfig() {\n const editor = this.editor;\n const viewportOffsetConfig = editor.config.get('ui.viewportOffset');\n if (viewportOffsetConfig) {\n return viewportOffsetConfig;\n }\n // Not present in EditorConfig type, because it's legacy. Hence the `as` expression.\n const legacyOffsetConfig = editor.config.get('toolbar.viewportTopOffset');\n // Fall back to deprecated toolbar config.\n if (legacyOffsetConfig) {\n /**\n * The {@link module:core/editor/editorconfig~EditorConfig#toolbar `EditorConfig#toolbar.viewportTopOffset`}\n * property has been deprecated and will be removed in the near future. Please use\n * {@link module:core/editor/editorconfig~EditorConfig#ui `EditorConfig#ui.viewportOffset`} instead.\n *\n * @error editor-ui-deprecated-viewport-offset-config\n */\n console.warn('editor-ui-deprecated-viewport-offset-config: ' +\n 'The `toolbar.vieportTopOffset` configuration option is deprecated. ' +\n 'It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead.');\n return { top: legacyOffsetConfig };\n }\n // More keys to come in the future.\n return { top: 0 };\n }\n /**\n * Starts listening for <kbd>Alt</kbd> + <kbd>F10</kbd> and <kbd>Esc</kbd> keystrokes in the context of focusable\n * {@link #setEditableElement editable elements} and {@link #addToolbar toolbars}\n * to allow users navigate across the UI.\n */\n _initFocusTracking() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n let candidateDefinitions;\n // Focus the next focusable toolbar on <kbd>Alt</kbd> + <kbd>F10</kbd>.\n editor.keystrokes.set('Alt+F10', (data, cancel) => {\n this._saveLastFocusedForeignElement();\n const currentFocusedToolbarDefinition = this._getCurrentFocusedToolbarDefinition();\n // * When focusing a toolbar for the first time, set the array of definitions for successive presses of Alt+F10.\n // This ensures, the navigation works always the same and no pair of toolbars takes over\n // (e.g. image and table toolbars when a selected image is inside a cell).\n // * It could be that the focus went to the toolbar by clicking a toolbar item (e.g. a dropdown). In this case,\n // there were no candidates so they must be obtained (#12339).\n if (!currentFocusedToolbarDefinition || !candidateDefinitions) {\n candidateDefinitions = this._getFocusableCandidateToolbarDefinitions();\n }\n // In a single Alt+F10 press, check all candidates but if none were focused, don't go any further.\n // This prevents an infinite loop.\n for (let i = 0; i < candidateDefinitions.length; i++) {\n const candidateDefinition = candidateDefinitions.shift();\n // Put the first definition to the back of the array. This allows circular navigation over all toolbars\n // on successive presses of Alt+F10.\n candidateDefinitions.push(candidateDefinition);\n // Don't focus the same toolbar again. If you did, this would move focus from the nth focused toolbar item back to the\n // first item as per ToolbarView#focus() if the user navigated inside the toolbar.\n if (candidateDefinition !== currentFocusedToolbarDefinition &&\n this._focusFocusableCandidateToolbar(candidateDefinition)) {\n // Clean up after a current visible toolbar when switching to the next one.\n if (currentFocusedToolbarDefinition && currentFocusedToolbarDefinition.options.afterBlur) {\n currentFocusedToolbarDefinition.options.afterBlur();\n }\n break;\n }\n }\n cancel();\n });\n // Blur the focused toolbar on <kbd>Esc</kbd> and bring the focus back to its origin.\n editor.keystrokes.set('Esc', (data, cancel) => {\n const focusedToolbarDef = this._getCurrentFocusedToolbarDefinition();\n if (!focusedToolbarDef) {\n return;\n }\n // Bring focus back to where it came from before focusing the toolbar:\n // 1. If it came from outside the engine view (e.g. source editing), move it there.\n if (this._lastFocusedForeignElement) {\n this._lastFocusedForeignElement.focus();\n this._lastFocusedForeignElement = null;\n }\n // 2. There are two possibilities left:\n // 2.1. It could be that the focus went from an editable element in the view (root or nested).\n // 2.2. It could be the focus went straight to the toolbar before even focusing the editing area.\n // In either case, just focus the view editing. The focus will land where it belongs.\n else {\n editor.editing.view.focus();\n }\n // Clean up after the toolbar if there is anything to do there.\n if (focusedToolbarDef.options.afterBlur) {\n focusedToolbarDef.options.afterBlur();\n }\n cancel();\n });\n }\n /**\n * Saves last focused element that doen not belong to editing view to restore focus on `Esc`.\n */\n _saveLastFocusedForeignElement() {\n const focusedElement = this.focusTracker.focusedElement;\n // Focus moved out of a DOM element that\n // * is not a toolbar,\n // * does not belong to the editing view (e.g. source editing).\n if (Array.from(this._editableElementsMap.values()).includes(focusedElement) &&\n !Array.from(this.editor.editing.view.domRoots.values()).includes(focusedElement)) {\n this._lastFocusedForeignElement = focusedElement;\n }\n }\n /**\n * Returns definitions of toolbars that could potentially be focused, sorted by their importance for the user.\n *\n * Focusable toolbars candidates are either:\n * * already visible,\n * * have `beforeFocus()` set in their {@link module:ui/editorui/editorui~FocusableToolbarDefinition definition} that suggests that\n * they might show up when called. Keep in mind that determining whether a toolbar will show up (and become focusable) is impossible\n * at this stage because it depends on its implementation, that in turn depends on the editing context (selection).\n *\n * **Note**: Contextual toolbars take precedence over regular toolbars.\n */\n _getFocusableCandidateToolbarDefinitions() {\n const definitions = [];\n for (const toolbarDef of this._focusableToolbarDefinitions) {\n const { toolbarView, options } = toolbarDef;\n if (isVisible(toolbarView.element) || options.beforeFocus) {\n definitions.push(toolbarDef);\n }\n }\n // Contextual and already visible toolbars have higher priority. If both are true, the toolbar will always focus first.\n // For instance, a selected widget toolbar vs inline editor toolbar: both are visible but the widget toolbar is contextual.\n definitions.sort((defA, defB) => getToolbarDefinitionWeight(defA) - getToolbarDefinitionWeight(defB));\n return definitions;\n }\n /**\n * Returns a definition of the toolbar that is currently visible and focused (one of its children has focus).\n *\n * `null` is returned when no toolbar is currently focused.\n */\n _getCurrentFocusedToolbarDefinition() {\n for (const definition of this._focusableToolbarDefinitions) {\n if (definition.toolbarView.element && definition.toolbarView.element.contains(this.focusTracker.focusedElement)) {\n return definition;\n }\n }\n return null;\n }\n /**\n * Focuses a focusable toolbar candidate using its definition.\n *\n * @param candidateToolbarDefinition A definition of the toolbar to focus.\n * @returns `true` when the toolbar candidate was focused. `false` otherwise.\n */\n _focusFocusableCandidateToolbar(candidateToolbarDefinition) {\n const { toolbarView, options: { beforeFocus } } = candidateToolbarDefinition;\n if (beforeFocus) {\n beforeFocus();\n }\n // If it didn't show up after beforeFocus(), it's not focusable at all.\n if (!isVisible(toolbarView.element)) {\n return false;\n }\n toolbarView.focus();\n return true;\n }\n /**\n * Provides an integration between {@link #viewportOffset} and {@link module:utils/dom/scroll~scrollViewportToShowTarget}.\n * It allows the UI-agnostic engine method to consider user-configured viewport offsets specific for the integration.\n *\n * @param evt The `scrollToTheSelection` event info.\n * @param data The payload carried by the `scrollToTheSelection` event.\n */\n _handleScrollToTheSelection(evt, data) {\n const configuredViewportOffset = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n ...this.viewportOffset\n };\n data.viewportOffset.top += configuredViewportOffset.top;\n data.viewportOffset.bottom += configuredViewportOffset.bottom;\n data.viewportOffset.left += configuredViewportOffset.left;\n data.viewportOffset.right += configuredViewportOffset.right;\n }\n}\n/**\n * Returns a number (weight) for a toolbar definition. Visible toolbars have a higher priority and so do\n * contextual toolbars (displayed in the context of a content, for instance, an image toolbar).\n *\n * A standard invisible toolbar is the heaviest. A visible contextual toolbar is the lightest.\n *\n * @param toolbarDef A toolbar definition to be weighted.\n */\nfunction getToolbarDefinitionWeight(toolbarDef) {\n const { toolbarView, options } = toolbarDef;\n let weight = 10;\n // Prioritize already visible toolbars. They should get focused first.\n if (isVisible(toolbarView.element)) {\n weight--;\n }\n // Prioritize contextual toolbars. They are displayed at the selection.\n if (options.isContextual) {\n weight--;\n }\n return weight;\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./editorui.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./editorui.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/editoruiview\n */\nimport View from '../view.js';\nimport BodyCollection from './bodycollection.js';\nimport '../../theme/components/editorui/editorui.css';\n/**\n * The editor UI view class. Base class for the editor main views.\n */\nexport default class EditorUIView extends View {\n /**\n * Creates an instance of the editor UI view class.\n *\n * @param locale The locale instance.\n */\n constructor(locale) {\n super(locale);\n this.body = new BodyCollection(locale);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.body.attachToDom();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.body.detachFromDom();\n return super.destroy();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editableui/editableuiview\n */\nimport View from '../view.js';\n/**\n * The editable UI view class.\n */\nexport default class EditableUIView extends View {\n /**\n * Creates an instance of EditableUIView class.\n *\n * @param locale The locale instance.\n * @param editingView The editing view instance the editable is related to.\n * @param editableElement The editable element. If not specified, this view\n * should create it. Otherwise, the existing element should be used.\n */\n constructor(locale, editingView, editableElement) {\n super(locale);\n /**\n * The name of the editable UI view.\n */\n this.name = null;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-content',\n 'ck-editor__editable',\n 'ck-rounded-corners'\n ],\n lang: locale.contentLanguage,\n dir: locale.contentLanguageDirection\n }\n });\n this.set('isFocused', false);\n this._editableElement = editableElement;\n this._hasExternalElement = !!this._editableElement;\n this._editingView = editingView;\n }\n /**\n * Renders the view by either applying the {@link #template} to the existing\n * {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement} or assigning {@link #element}\n * as {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement}.\n */\n render() {\n super.render();\n if (this._hasExternalElement) {\n this.template.apply(this.element = this._editableElement);\n }\n else {\n this._editableElement = this.element;\n }\n this.on('change:isFocused', () => this._updateIsFocusedClasses());\n this._updateIsFocusedClasses();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._hasExternalElement) {\n this.template.revert(this._editableElement);\n }\n super.destroy();\n }\n /**\n * Whether an external {@link #_editableElement} was passed into the constructor, which also means\n * the view will not render its {@link #template}.\n */\n get hasExternalElement() {\n return this._hasExternalElement;\n }\n /**\n * Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to\n * the {@link #isFocused} property value using the {@link #_editingView editing view} API.\n */\n _updateIsFocusedClasses() {\n const editingView = this._editingView;\n if (editingView.isRenderingInProgress) {\n updateAfterRender(this);\n }\n else {\n update(this);\n }\n function update(view) {\n editingView.change(writer => {\n const viewRoot = editingView.document.getRoot(view.name);\n writer.addClass(view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot);\n writer.removeClass(view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot);\n });\n }\n // In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).\n // While executing one callback the `isRenderingInProgress` observable is changing what causes executing another\n // callback and render is called inside the already pending render.\n // We need to be sure that callback is executed only when the value has changed from `true` to `false`.\n // See https://github.com/ckeditor/ckeditor5/issues/1676.\n function updateAfterRender(view) {\n editingView.once('change:isRenderingInProgress', (evt, name, value) => {\n if (!value) {\n update(view);\n }\n else {\n updateAfterRender(view);\n }\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editableui/inline/inlineeditableuiview\n */\nimport EditableUIView from '../editableuiview.js';\n/**\n * The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.\n */\nexport default class InlineEditableUIView extends EditableUIView {\n /**\n * Creates an instance of the InlineEditableUIView class.\n *\n * @param locale The locale instance.\n * @param editingView The editing view instance the editable is related to.\n * @param editableElement The editable element. If not specified, the\n * {@link module:ui/editableui/editableuiview~EditableUIView}\n * will create it. Otherwise, the existing element will be used.\n * @param options Additional configuration of the view.\n * @param options.label A function that gets called with the instance of this view as an argument\n * and should return a string that represents the label of the editable for assistive technologies. If not provided,\n * a default label generator is used.\n */\n constructor(locale, editingView, editableElement, options = {}) {\n super(locale, editingView, editableElement);\n const t = locale.t;\n this.extendTemplate({\n attributes: {\n role: 'textbox',\n class: 'ck-editor__editable_inline'\n }\n });\n this._generateLabel = options.label || (() => t('Editor editing area: %0', this.name));\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n const editingView = this._editingView;\n editingView.change(writer => {\n const viewRoot = editingView.document.getRoot(this.name);\n writer.setAttribute('aria-label', this._generateLabel(this), viewRoot);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/notification/notification\n */\n/* globals window */\nimport { ContextPlugin } from '@ckeditor/ckeditor5-core';\n/**\n * The Notification plugin.\n *\n * This plugin sends a few types of notifications: `success`, `info` and `warning`. The notifications need to be\n * handled and displayed by a plugin responsible for showing the UI of the notifications. Using this plugin for dispatching\n * notifications makes it possible to switch the notifications UI.\n *\n * Note that every unhandled and not stopped `warning` notification will be displayed as a system alert.\n * See {@link module:ui/notification/notification~Notification#showWarning}.\n */\nexport default class Notification extends ContextPlugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Notification';\n }\n /**\n * @inheritDoc\n */\n init() {\n // Each unhandled and not stopped `show:warning` event is displayed as a system alert.\n this.on('show:warning', (evt, data) => {\n window.alert(data.message); // eslint-disable-line no-alert\n }, { priority: 'lowest' });\n }\n /**\n * Shows a success notification.\n *\n * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended\n * using the `data.namespace` option. For example:\n *\n * ```ts\n * showSuccess( 'Image is uploaded.', {\n * \tnamespace: 'upload:image'\n * } );\n * ```\n *\n * will fire the `show:success:upload:image` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showSuccess( 'Image is uploaded.', {\n * \ttitle: 'Image upload success'\n * } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showSuccess(message, data = {}) {\n this._showNotification({\n message,\n type: 'success',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Shows an information notification.\n *\n * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended\n * using the `data.namespace` option. For example:\n *\n * ```ts\n * showInfo( 'Editor is offline.', {\n * \tnamespace: 'editor:status'\n * } );\n * ```\n *\n * will fire the `show:info:editor:status` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showInfo( 'Editor is offline.', {\n * \ttitle: 'Network information'\n * } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showInfo(message, data = {}) {\n this._showNotification({\n message,\n type: 'info',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Shows a warning notification.\n *\n * By default, it fires the {@link #event:show:warning `show:warning` event}\n * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:\n *\n * ```ts\n * showWarning( 'Image upload error.', {\n * \tnamespace: 'upload:image'\n * } );\n * ```\n *\n * will fire the `show:warning:upload:image` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showWarning( 'Image upload error.', {\n * \ttitle: 'Upload failed'\n * } );\n * ```\n *\n * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.\n * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:\n *\n * ```ts\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Do something with the data.\n *\n * \t// Stop this event to prevent displaying it as an alert.\n * \tevt.stop();\n * } );\n * ```\n *\n * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:\n *\n * ```ts\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Show the warning in the UI, but do not stop it.\n * } );\n *\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Log the warning to some error tracker.\n *\n * \t// Stop this event to prevent displaying it as an alert.\n * \tevt.stop();\n * }, { priority: 'low' } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showWarning(message, data = {}) {\n this._showNotification({\n message,\n type: 'warning',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Fires the `show` event with the specified type, namespace and message.\n *\n * @param data The message data.\n * @param data.message The content of the notification.\n * @param data.type The type of the message.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n _showNotification(data) {\n const event = data.namespace ?\n `show:${data.type}:${data.namespace}` :\n `show:${data.type}`;\n this.fire(event, {\n message: data.message,\n type: data.type,\n title: data.title || ''\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/model\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\nimport { extend } from 'lodash-es';\n/**\n * The base MVC model class.\n */\nexport default class Model extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a new Model instance.\n *\n * @param attributes The model state attributes to be defined during the instance creation.\n * @param properties The (out of state) properties to be appended to the instance during creation.\n */\n constructor(attributes, properties) {\n super();\n // Extend this instance with the additional (out of state) properties.\n if (properties) {\n extend(this, properties);\n }\n // Initialize the attributes.\n if (attributes) {\n this.set(attributes);\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./balloonrotator.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./balloonrotator.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./fakepanel.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./fakepanel.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/panel/balloon/contextualballoon\n */\nimport BalloonPanelView from './balloonpanelview.js';\nimport View from '../../view.js';\nimport ButtonView from '../../button/buttonview.js';\nimport { Plugin, icons } from '@ckeditor/ckeditor5-core';\nimport { CKEditorError, FocusTracker, Rect, toUnit } from '@ckeditor/ckeditor5-utils';\nimport '../../../theme/components/panel/balloonrotator.css';\nimport '../../../theme/components/panel/fakepanel.css';\nconst toPx = /* #__PURE__ */ toUnit('px');\n/**\n * Provides the common contextual balloon for the editor.\n *\n * The role of this plugin is to unify the contextual balloons logic, simplify views management and help\n * avoid the unnecessary complexity of handling multiple {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}\n * instances in the editor.\n *\n * This plugin allows for creating single or multiple panel stacks.\n *\n * Each stack may have multiple views, with the one on the top being visible. When the visible view is removed from the stack,\n * the previous view becomes visible.\n *\n * It might be useful to implement nested navigation in a balloon. For instance, a toolbar view may contain a link button.\n * When you click it, a link view (which lets you set the URL) is created and put on top of the toolbar view, so the link panel\n * is displayed. When you finish editing the link and close (remove) the link view, the toolbar view is visible again.\n *\n * However, there are cases when there are multiple independent balloons to be displayed, for instance, if the selection\n * is inside two inline comments at the same time. For such cases, you can create two independent panel stacks.\n * The contextual balloon plugin will create a navigation bar to let the users switch between these panel stacks using the \"Next\"\n * and \"Previous\" buttons.\n *\n * If there are no views in the current stack, the balloon panel will try to switch to the next stack. If there are no\n * panels in any stack, the balloon panel will be hidden.\n *\n * **Note**: To force the balloon panel to show only one view, even if there are other stacks, use the `singleViewMode=true` option\n * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} a view to a panel.\n *\n * From the implementation point of view, the contextual ballon plugin is reusing a single\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} instance to display multiple contextual balloon\n * panels in the editor. It also creates a special {@link module:ui/panel/balloon/contextualballoon~RotatorView rotator view},\n * used to manage multiple panel stacks. Rotator view is a child of the balloon panel view and the parent of the specific\n * view you want to display. If there is more than one panel stack to be displayed, the rotator view will add a\n * navigation bar. If there is only one stack, the rotator view is transparent (it does not add any UI elements).\n */\nexport default class ContextualBalloon extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ContextualBalloon';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * The map of views and their stacks.\n */\n this._viewToStack = new Map();\n /**\n * The map of IDs and stacks.\n */\n this._idToStack = new Map();\n /**\n * The common balloon panel view.\n */\n this._view = null;\n /**\n * Rotator view embedded in the contextual balloon.\n * Displays the currently visible view in the balloon and provides navigation for switching stacks.\n */\n this._rotatorView = null;\n /**\n * Displays fake panels under the balloon panel view when multiple stacks are added to the balloon.\n */\n this._fakePanelsView = null;\n this.positionLimiter = () => {\n const view = this.editor.editing.view;\n const viewDocument = view.document;\n const editableElement = viewDocument.selection.editableElement;\n if (editableElement) {\n return view.domConverter.mapViewToDom(editableElement.root);\n }\n return null;\n };\n this.set('visibleView', null);\n this.set('_numberOfStacks', 0);\n this.set('_singleViewMode', false);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n if (this._view) {\n this._view.destroy();\n }\n if (this._rotatorView) {\n this._rotatorView.destroy();\n }\n if (this._fakePanelsView) {\n this._fakePanelsView.destroy();\n }\n }\n /**\n * The common balloon panel view.\n */\n get view() {\n if (!this._view) {\n this._createPanelView();\n }\n return this._view;\n }\n /**\n * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.\n */\n hasView(view) {\n return Array.from(this._viewToStack.keys()).includes(view);\n }\n /**\n * Adds a new view to the stack and makes it visible if the current stack is visible\n * or it is the first view in the balloon.\n *\n * @param data The configuration of the view.\n * @param data.stackId The ID of the stack that the view is added to. Defaults to `'main'`.\n * @param data.view The content of the balloon.\n * @param data.position Positioning options.\n * @param data.balloonClassName An additional CSS class added to the {@link #view balloon} when visible.\n * @param data.withArrow Whether the {@link #view balloon} should be rendered with an arrow. Defaults to `true`.\n * @param data.singleViewMode Whether the view should be the only visible view even if other stacks were added. Defaults to `false`.\n */\n add(data) {\n if (!this._view) {\n this._createPanelView();\n }\n if (this.hasView(data.view)) {\n /**\n * Trying to add configuration of the same view more than once.\n *\n * @error contextualballoon-add-view-exist\n */\n throw new CKEditorError('contextualballoon-add-view-exist', [this, data]);\n }\n const stackId = data.stackId || 'main';\n // If new stack is added, creates it and show view from this stack.\n if (!this._idToStack.has(stackId)) {\n this._idToStack.set(stackId, new Map([[data.view, data]]));\n this._viewToStack.set(data.view, this._idToStack.get(stackId));\n this._numberOfStacks = this._idToStack.size;\n if (!this._visibleStack || data.singleViewMode) {\n this.showStack(stackId);\n }\n return;\n }\n const stack = this._idToStack.get(stackId);\n if (data.singleViewMode) {\n this.showStack(stackId);\n }\n // Add new view to the stack.\n stack.set(data.view, data);\n this._viewToStack.set(data.view, stack);\n // And display it if is added to the currently visible stack.\n if (stack === this._visibleStack) {\n this._showView(data);\n }\n }\n /**\n * Removes the given view from the stack. If the removed view was visible,\n * the view preceding it in the stack will become visible instead.\n * When there is no view in the stack, the next stack will be displayed.\n * When there are no more stacks, the balloon will hide.\n *\n * @param view A view to be removed from the balloon.\n */\n remove(view) {\n if (!this.hasView(view)) {\n /**\n * Trying to remove the configuration of the view not defined in the stack.\n *\n * @error contextualballoon-remove-view-not-exist\n */\n throw new CKEditorError('contextualballoon-remove-view-not-exist', [this, view]);\n }\n const stack = this._viewToStack.get(view);\n if (this._singleViewMode && this.visibleView === view) {\n this._singleViewMode = false;\n }\n // When visible view will be removed we need to show a preceding view or next stack\n // if a view is the only view in the stack.\n if (this.visibleView === view) {\n if (stack.size === 1) {\n if (this._idToStack.size > 1) {\n this._showNextStack();\n }\n else {\n this.view.hide();\n this.visibleView = null;\n this._rotatorView.hideView();\n }\n }\n else {\n this._showView(Array.from(stack.values())[stack.size - 2]);\n }\n }\n if (stack.size === 1) {\n this._idToStack.delete(this._getStackId(stack));\n this._numberOfStacks = this._idToStack.size;\n }\n else {\n stack.delete(view);\n }\n this._viewToStack.delete(view);\n }\n /**\n * Updates the position of the balloon using the position data of the first visible view in the stack.\n * When new position data is given, the position data of the currently visible view will be updated.\n *\n * @param position Position options.\n */\n updatePosition(position) {\n if (position) {\n this._visibleStack.get(this.visibleView).position = position;\n }\n this.view.pin(this._getBalloonPosition());\n this._fakePanelsView.updatePosition();\n }\n /**\n * Shows the last view from the stack of a given ID.\n */\n showStack(id) {\n this.visibleStack = id;\n const stack = this._idToStack.get(id);\n if (!stack) {\n /**\n * Trying to show a stack that does not exist.\n *\n * @error contextualballoon-showstack-stack-not-exist\n */\n throw new CKEditorError('contextualballoon-showstack-stack-not-exist', this);\n }\n if (this._visibleStack === stack) {\n return;\n }\n this._showView(Array.from(stack.values()).pop());\n }\n /**\n * Initializes view instances.\n */\n _createPanelView() {\n this._view = new BalloonPanelView(this.editor.locale);\n this.editor.ui.view.body.add(this._view);\n this.editor.ui.focusTracker.add(this._view.element);\n this._rotatorView = this._createRotatorView();\n this._fakePanelsView = this._createFakePanelsView();\n }\n /**\n * Returns the stack of the currently visible view.\n */\n get _visibleStack() {\n return this._viewToStack.get(this.visibleView);\n }\n /**\n * Returns the ID of the given stack.\n */\n _getStackId(stack) {\n const entry = Array.from(this._idToStack.entries()).find(entry => entry[1] === stack);\n return entry[0];\n }\n /**\n * Shows the last view from the next stack.\n */\n _showNextStack() {\n const stacks = Array.from(this._idToStack.values());\n let nextIndex = stacks.indexOf(this._visibleStack) + 1;\n if (!stacks[nextIndex]) {\n nextIndex = 0;\n }\n this.showStack(this._getStackId(stacks[nextIndex]));\n }\n /**\n * Shows the last view from the previous stack.\n */\n _showPrevStack() {\n const stacks = Array.from(this._idToStack.values());\n let nextIndex = stacks.indexOf(this._visibleStack) - 1;\n if (!stacks[nextIndex]) {\n nextIndex = stacks.length - 1;\n }\n this.showStack(this._getStackId(stacks[nextIndex]));\n }\n /**\n * Creates a rotator view.\n */\n _createRotatorView() {\n const view = new RotatorView(this.editor.locale);\n const t = this.editor.locale.t;\n this.view.content.add(view);\n // Hide navigation when there is only a one stack & not in single view mode.\n view.bind('isNavigationVisible').to(this, '_numberOfStacks', this, '_singleViewMode', (value, isSingleViewMode) => {\n return !isSingleViewMode && value > 1;\n });\n // Update balloon position after toggling navigation.\n view.on('change:isNavigationVisible', () => (this.updatePosition()), { priority: 'low' });\n // Update stacks counter value.\n view.bind('counter').to(this, 'visibleView', this, '_numberOfStacks', (visibleView, numberOfStacks) => {\n if (numberOfStacks < 2) {\n return '';\n }\n const current = Array.from(this._idToStack.values()).indexOf(this._visibleStack) + 1;\n return t('%0 of %1', [current, numberOfStacks]);\n });\n view.buttonNextView.on('execute', () => {\n // When current view has a focus then move focus to the editable before removing it,\n // otherwise editor will lost focus.\n if (view.focusTracker.isFocused) {\n this.editor.editing.view.focus();\n }\n this._showNextStack();\n });\n view.buttonPrevView.on('execute', () => {\n // When current view has a focus then move focus to the editable before removing it,\n // otherwise editor will lost focus.\n if (view.focusTracker.isFocused) {\n this.editor.editing.view.focus();\n }\n this._showPrevStack();\n });\n return view;\n }\n /**\n * Creates a fake panels view.\n */\n _createFakePanelsView() {\n const view = new FakePanelsView(this.editor.locale, this.view);\n view.bind('numberOfPanels').to(this, '_numberOfStacks', this, '_singleViewMode', (number, isSingleViewMode) => {\n const showPanels = !isSingleViewMode && number >= 2;\n return showPanels ? Math.min(number - 1, 2) : 0;\n });\n view.listenTo(this.view, 'change:top', () => view.updatePosition());\n view.listenTo(this.view, 'change:left', () => view.updatePosition());\n this.editor.ui.view.body.add(view);\n return view;\n }\n /**\n * Sets the view as the content of the balloon and attaches the balloon using position\n * options of the first view.\n *\n * @param data Configuration.\n * @param data.view The view to show in the balloon.\n * @param data.balloonClassName Additional class name which will be added to the {@link #view balloon}.\n * @param data.withArrow Whether the {@link #view balloon} should be rendered with an arrow.\n */\n _showView({ view, balloonClassName = '', withArrow = true, singleViewMode = false }) {\n this.view.class = balloonClassName;\n this.view.withArrow = withArrow;\n this._rotatorView.showView(view);\n this.visibleView = view;\n this.view.pin(this._getBalloonPosition());\n this._fakePanelsView.updatePosition();\n if (singleViewMode) {\n this._singleViewMode = true;\n }\n }\n /**\n * Returns position options of the last view in the stack.\n * This keeps the balloon in the same position when the view is changed.\n */\n _getBalloonPosition() {\n let position = Array.from(this._visibleStack.values()).pop().position;\n if (position) {\n // Use the default limiter if none has been specified.\n if (!position.limiter) {\n // Don't modify the original options object.\n position = Object.assign({}, position, {\n limiter: this.positionLimiter\n });\n }\n // Don't modify the original options object.\n position = Object.assign({}, position, {\n viewportOffsetConfig: this.editor.ui.viewportOffset\n });\n }\n return position;\n }\n}\n/**\n * Rotator view is a helper class for the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon}.\n * It is used for displaying the last view from the current stack and providing navigation buttons for switching stacks.\n * See the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.\n */\nexport class RotatorView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const t = locale.t;\n const bind = this.bindTemplate;\n this.set('isNavigationVisible', true);\n this.focusTracker = new FocusTracker();\n this.buttonPrevView = this._createButtonView(t('Previous'), icons.previousArrow);\n this.buttonNextView = this._createButtonView(t('Next'), icons.nextArrow);\n this.content = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-balloon-rotator'\n ],\n 'z-index': '-1'\n },\n children: [\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck-balloon-rotator__navigation',\n bind.to('isNavigationVisible', value => value ? '' : 'ck-hidden')\n ]\n },\n children: [\n this.buttonPrevView,\n {\n tag: 'span',\n attributes: {\n class: [\n 'ck-balloon-rotator__counter'\n ]\n },\n children: [\n {\n text: bind.to('counter')\n }\n ]\n },\n this.buttonNextView\n ]\n },\n {\n tag: 'div',\n attributes: {\n class: 'ck-balloon-rotator__content'\n },\n children: this.content\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n }\n /**\n * Shows a given view.\n *\n * @param view The view to show.\n */\n showView(view) {\n this.hideView();\n this.content.add(view);\n }\n /**\n * Hides the currently displayed view.\n */\n hideView() {\n this.content.clear();\n }\n /**\n * Creates a navigation button view.\n *\n * @param label The button label.\n * @param icon The button icon.\n */\n _createButtonView(label, icon) {\n const view = new ButtonView(this.locale);\n view.set({\n label,\n icon,\n tooltip: true\n });\n return view;\n }\n}\n/**\n * Displays additional layers under the balloon when multiple stacks are added to the balloon.\n */\nclass FakePanelsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale, balloonPanelView) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('top', 0);\n this.set('left', 0);\n this.set('height', 0);\n this.set('width', 0);\n this.set('numberOfPanels', 0);\n this.content = this.createCollection();\n this._balloonPanelView = balloonPanelView;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck-fake-panel',\n bind.to('numberOfPanels', number => number ? '' : 'ck-hidden')\n ],\n style: {\n top: bind.to('top', toPx),\n left: bind.to('left', toPx),\n width: bind.to('width', toPx),\n height: bind.to('height', toPx)\n }\n },\n children: this.content\n });\n this.on('change:numberOfPanels', (evt, name, next, prev) => {\n if (next > prev) {\n this._addPanels(next - prev);\n }\n else {\n this._removePanels(prev - next);\n }\n this.updatePosition();\n });\n }\n _addPanels(number) {\n while (number--) {\n const view = new View();\n view.setTemplate({ tag: 'div' });\n this.content.add(view);\n this.registerChild(view);\n }\n }\n _removePanels(number) {\n while (number--) {\n const view = this.content.last;\n this.content.remove(view);\n this.deregisterChild(view);\n view.destroy();\n }\n }\n /**\n * Updates coordinates of fake panels.\n */\n updatePosition() {\n if (this.numberOfPanels) {\n const { top, left } = this._balloonPanelView;\n const { width, height } = new Rect(this._balloonPanelView.element);\n Object.assign(this, { top, left, width, height });\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./stickypanel.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./stickypanel.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/search/text/searchtextqueryview\n */\nimport ButtonView from '../../button/buttonview.js';\nimport IconView from '../../icon/iconview.js';\nimport LabeledFieldView from '../../labeledfield/labeledfieldview.js';\nimport { createLabeledInputText } from '../../labeledfield/utils.js';\nimport { icons } from '@ckeditor/ckeditor5-core';\n/**\n * A search input field for the {@link module:ui/search/text/searchtextview~SearchTextView} component.\n *\n * @internal\n * @extends module:ui/labeledfield/labeledfieldview~LabeledFieldView\n */\nexport default class SearchTextQueryView extends LabeledFieldView {\n /**\n * @inheritDoc\n */\n constructor(locale, config) {\n const t = locale.t;\n const viewConfig = Object.assign({}, {\n showResetButton: true,\n showIcon: true,\n creator: createLabeledInputText\n }, config);\n super(locale, viewConfig.creator);\n this.label = config.label;\n this._viewConfig = viewConfig;\n if (this._viewConfig.showIcon) {\n this.iconView = new IconView();\n this.iconView.content = icons.loupe;\n this.fieldWrapperChildren.add(this.iconView, 0);\n this.extendTemplate({\n attributes: {\n class: 'ck-search__query_with-icon'\n }\n });\n }\n if (this._viewConfig.showResetButton) {\n this.resetButtonView = new ButtonView(locale);\n this.resetButtonView.set({\n label: t('Clear'),\n icon: icons.cancel,\n class: 'ck-search__reset',\n isVisible: false,\n tooltip: true\n });\n this.resetButtonView.on('execute', () => {\n this.reset();\n this.focus();\n this.fire('reset');\n });\n this.resetButtonView.bind('isVisible').to(this.fieldView, 'isEmpty', isEmpty => !isEmpty);\n this.fieldWrapperChildren.add(this.resetButtonView);\n this.extendTemplate({\n attributes: {\n class: 'ck-search__query_with-reset'\n }\n });\n }\n }\n /**\n * Resets the search field to its default state.\n */\n reset() {\n this.fieldView.reset();\n if (this._viewConfig.showResetButton) {\n this.resetButtonView.isVisible = false;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport View from '../view.js';\n/**\n * A view displaying an information text related to different states of {@link module:ui/search/text/searchtextview~SearchTextView}.\n *\n * @internal\n */\nexport default class SearchInfoView extends View {\n /**\n * @inheritDoc\n */\n constructor() {\n super();\n const bind = this.bindTemplate;\n this.set({\n isVisible: false,\n primaryText: '',\n secondaryText: ''\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-search__info',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ],\n tabindex: -1\n },\n children: [\n {\n tag: 'span',\n children: [\n {\n text: [bind.to('primaryText')]\n }\n ]\n },\n {\n tag: 'span',\n children: [\n {\n text: [bind.to('secondaryText')]\n }\n ]\n }\n ]\n });\n }\n /**\n * Focuses the view\n */\n focus() {\n this.element.focus();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/search/searchresultsview\n */\nimport View from '../view.js';\nimport { FocusTracker } from '@ckeditor/ckeditor5-utils';\nimport { default as FocusCycler } from '../focuscycler.js';\n/**\n * A sub-component of {@link module:ui/search/text/searchtextview~SearchTextView}. It hosts the filtered and the information views.\n */\nexport default class SearchResultsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.children = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-search__results'\n ],\n tabindex: -1\n },\n children: this.children\n });\n this._focusCycler = new FocusCycler({\n focusables: this.children,\n focusTracker: this.focusTracker\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n for (const child of this.children) {\n this.focusTracker.add(child.element);\n }\n }\n /**\n * Focuses the view.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the first child view.\n */\n focusFirst() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the last child view.\n */\n focusLast() {\n this._focusCycler.focusLast();\n }\n}\n","import toString from './toString.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n/**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\nfunction escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n}\n\nexport default escapeRegExp;\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./search.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./search.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/search/text/searchtextview\n*/\nimport { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\nimport View from '../../view.js';\nimport { default as SearchTextQueryView } from './searchtextqueryview.js';\nimport SearchInfoView from '../searchinfoview.js';\nimport SearchResultsView from '../searchresultsview.js';\nimport FocusCycler from '../../focuscycler.js';\nimport { escapeRegExp } from 'lodash-es';\nimport '../../../theme/components/search/search.css';\n/**\n * A search component that allows filtering of an arbitrary view based on a search query\n * specified by the user in a text field.\n *\n *```ts\n * // This view must specify the `filter()` and `focus()` methods.\n * const filteredView = ...;\n *\n * const searchView = new SearchTextView( locale, {\n * \tsearchFieldLabel: 'Search list items',\n * \tfilteredView\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n */\nexport default class SearchTextView extends View {\n /**\n * Creates an instance of the {@link module:ui/search/text/searchtextview~SearchTextView} class.\n *\n * @param locale The localization services instance.\n * @param config Configuration of the view.\n */\n constructor(locale, config) {\n super(locale);\n this._config = config;\n this.filteredView = config.filteredView;\n this.queryView = this._createSearchTextQueryView();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.resultsView = new SearchResultsView(locale);\n this.children = this.createCollection();\n this.focusableChildren = this.createCollection([this.queryView, this.resultsView]);\n this.set('isEnabled', true);\n this.set('resultsCount', 0);\n this.set('totalItemsCount', 0);\n if (config.infoView && config.infoView.instance) {\n this.infoView = config.infoView.instance;\n }\n else {\n this.infoView = new SearchInfoView();\n this._enableDefaultInfoViewBehavior();\n this.on('render', () => {\n // Initial search that determines if there are any searchable items\n // and displays the corresponding info text.\n this.search('');\n });\n }\n this.resultsView.children.addMany([this.infoView, this.filteredView]);\n this.focusCycler = new FocusCycler({\n focusables: this.focusableChildren,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.on('search', (evt, { resultsCount, totalItemsCount }) => {\n this.resultsCount = resultsCount;\n this.totalItemsCount = totalItemsCount;\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-search',\n config.class || null\n ],\n tabindex: '-1'\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.addMany([\n this.queryView,\n this.resultsView\n ]);\n const stopPropagation = (data) => data.stopPropagation();\n for (const focusableChild of this.focusableChildren) {\n this.focusTracker.add(focusableChild.element);\n }\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n // Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's\n // keystroke handler would take over the key management in the URL input. We need to prevent\n // this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible.\n this.keystrokes.set('arrowright', stopPropagation);\n this.keystrokes.set('arrowleft', stopPropagation);\n this.keystrokes.set('arrowup', stopPropagation);\n this.keystrokes.set('arrowdown', stopPropagation);\n }\n /**\n * Focuses the {@link #queryView}.\n */\n focus() {\n this.queryView.focus();\n }\n /**\n * Resets the component to its initial state.\n */\n reset() {\n this.queryView.reset();\n this.search('');\n this.filteredView.element.scrollTo(0, 0);\n }\n /**\n * Searches the {@link #filteredView} for the given query.\n *\n * @internal\n * @param query The search query string.\n */\n search(query) {\n const regExp = query ? new RegExp(escapeRegExp(query), 'ig') : null;\n const filteringResults = this.filteredView.filter(regExp);\n this.fire('search', { query, ...filteringResults });\n }\n /**\n * Creates a search field view based on configured creator..\n */\n _createSearchTextQueryView() {\n const queryView = new SearchTextQueryView(this.locale, this._config.queryView);\n this.listenTo(queryView.fieldView, 'input', () => {\n this.search(queryView.fieldView.element.value);\n });\n queryView.on('reset', () => this.reset());\n queryView.bind('isEnabled').to(this);\n return queryView;\n }\n /**\n * Initializes the default {@link #infoView} behavior with default text labels when no custom info view\n * was specified in the view config.\n */\n _enableDefaultInfoViewBehavior() {\n const t = this.locale.t;\n const infoView = this.infoView;\n this.on('search', (evt, data) => {\n if (!data.resultsCount) {\n const defaultTextConfig = this._config.infoView && this._config.infoView.text;\n let primaryText, secondaryText;\n if (data.totalItemsCount) {\n if (defaultTextConfig && defaultTextConfig.notFound) {\n primaryText = defaultTextConfig.notFound.primary;\n secondaryText = defaultTextConfig.notFound.secondary;\n }\n else {\n primaryText = t('No results found');\n secondaryText = '';\n }\n }\n else {\n if (defaultTextConfig && defaultTextConfig.noSearchableItems) {\n primaryText = defaultTextConfig.noSearchableItems.primary;\n secondaryText = defaultTextConfig.noSearchableItems.secondary;\n }\n else {\n primaryText = t('No searchable items');\n secondaryText = '';\n }\n }\n infoView.set({\n primaryText: normalizeInfoText(primaryText, data),\n secondaryText: normalizeInfoText(secondaryText, data),\n isVisible: true\n });\n }\n else {\n infoView.set({\n isVisible: false\n });\n }\n });\n function normalizeInfoText(text, { query, resultsCount, totalItemsCount }) {\n return typeof text === 'function' ? text(query, resultsCount, totalItemsCount) : text;\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./autocomplete.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./autocomplete.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/autocomplete/autocompleteview\n*/\nimport { getOptimalPosition, global, toUnit, Rect } from '@ckeditor/ckeditor5-utils';\nimport SearchTextView from '../search/text/searchtextview.js';\nimport '../../theme/components/autocomplete/autocomplete.css';\n/**\n * The autocomplete component's view class. It extends the {@link module:ui/search/text/searchtextview~SearchTextView} class\n * with a floating {@link #resultsView} that shows up when the user starts typing and hides when they blur\n * the component.\n */\nclass AutocompleteView extends SearchTextView {\n /**\n * @inheritDoc\n */\n constructor(locale, config) {\n super(locale, config);\n this._config = config;\n const toPx = toUnit('px');\n this.extendTemplate({\n attributes: {\n class: ['ck-autocomplete']\n }\n });\n const bindResultsView = this.resultsView.bindTemplate;\n this.resultsView.set('isVisible', false);\n this.resultsView.set('_position', 's');\n this.resultsView.set('_width', 0);\n this.resultsView.extendTemplate({\n attributes: {\n class: [\n bindResultsView.if('isVisible', 'ck-hidden', value => !value),\n bindResultsView.to('_position', value => `ck-search__results_${value}`)\n ],\n style: {\n width: bindResultsView.to('_width', toPx)\n }\n }\n });\n // Update the visibility of the results view when the user focuses or blurs the component.\n // This is also integration for the `resetOnBlur` configuration.\n this.focusTracker.on('change:isFocused', (evt, name, isFocused) => {\n this._updateResultsVisibility();\n if (isFocused) {\n // Reset the scroll position of the results view whenever the autocomplete reopens.\n this.resultsView.element.scrollTop = 0;\n }\n else if (config.resetOnBlur) {\n this.queryView.reset();\n }\n });\n // Update the visibility of the results view when the user types in the query field.\n // This is an integration for `queryMinChars` configuration.\n // This is an integration for search results changing length and the #resultsView requiring to be repositioned.\n this.on('search', () => {\n this._updateResultsVisibility();\n this._updateResultsViewWidthAndPosition();\n });\n // Hide the results view when the user presses the ESC key.\n this.keystrokes.set('esc', (evt, cancel) => {\n // Let the DOM event pass through if the focus is in the query view.\n if (!this.resultsView.isVisible) {\n return;\n }\n // Focus the query view first and only then close the results view. Otherwise, if the focus\n // was in the results view, it will get lost.\n this.queryView.focus();\n this.resultsView.isVisible = false;\n cancel();\n });\n // Update the position of the results view when the user scrolls the page.\n // TODO: This needs to be debounced down the road.\n this.listenTo(global.document, 'scroll', () => {\n this._updateResultsViewWidthAndPosition();\n });\n // Hide the results when the component becomes disabled.\n this.on('change:isEnabled', () => {\n this._updateResultsVisibility();\n });\n // Update the value of the query field when the user selects a result.\n this.filteredView.on('execute', (evt, { value }) => {\n // Focus the query view first to avoid losing the focus.\n this.focus();\n // Resetting the view will ensure that the #queryView will update its empty state correctly.\n // This prevents bugs related to dynamic labels or auto-grow when re-setting the same value\n // to #queryView.fieldView.value (which does not trigger empty state change) to an\n // #queryView.fieldView.element that has been changed by the user.\n this.reset();\n // Update the value of the query field.\n this.queryView.fieldView.value = this.queryView.fieldView.element.value = value;\n // Finally, hide the results view. The focus has been moved earlier so this is safe.\n this.resultsView.isVisible = false;\n });\n // Update the position and width of the results view when it becomes visible.\n this.resultsView.on('change:isVisible', () => {\n this._updateResultsViewWidthAndPosition();\n });\n }\n /**\n * Updates the position of the results view on demand.\n */\n _updateResultsViewWidthAndPosition() {\n if (!this.resultsView.isVisible) {\n return;\n }\n this.resultsView._width = new Rect(this.queryView.fieldView.element).width;\n const optimalResultsPosition = AutocompleteView._getOptimalPosition({\n element: this.resultsView.element,\n target: this.queryView.element,\n fitInViewport: true,\n positions: AutocompleteView.defaultResultsPositions\n });\n // _getOptimalPosition will return null if there is no optimal position found (e.g. target is off the viewport).\n this.resultsView._position = optimalResultsPosition ? optimalResultsPosition.name : 's';\n }\n /**\n * Updates the visibility of the results view on demand.\n */\n _updateResultsVisibility() {\n const queryMinChars = typeof this._config.queryMinChars === 'undefined' ? 0 : this._config.queryMinChars;\n const queryLength = this.queryView.fieldView.element.value.length;\n this.resultsView.isVisible = this.focusTracker.isFocused && this.isEnabled && queryLength >= queryMinChars;\n }\n}\n/**\n * Positions for the autocomplete results view. Two positions are defined by default:\n * * `s` - below the search field,\n * * `n` - above the search field.\n */\nAutocompleteView.defaultResultsPositions = [\n (fieldRect => {\n return {\n top: fieldRect.bottom,\n left: fieldRect.left,\n name: 's'\n };\n }),\n ((fieldRect, resultsRect) => {\n return {\n top: fieldRect.top - resultsRect.height,\n left: fieldRect.left,\n name: 'n'\n };\n })\n];\n/**\n * A function used to calculate the optimal position for the dropdown panel.\n */\nAutocompleteView._getOptimalPosition = getOptimalPosition;\nexport default AutocompleteView;\n","import escapeHtmlChar from './_escapeHtmlChar.js';\nimport toString from './toString.js';\n\n/** Used to match HTML entities and HTML characters. */\nvar reUnescapedHtml = /[&<>\"']/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\nfunction escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n}\n\nexport default escape;\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./highlightedtext.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./highlightedtext.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./spinner.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./spinner.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./blocktoolbar.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./blocktoolbar.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenubutton.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenubutton.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/menubar/menubarmenubuttonview\n */\nimport IconView from '../icon/iconview.js';\nimport ListItemButtonView from '../button/listitembuttonview.js';\nimport dropdownArrowIcon from '../../theme/icons/dropdown-arrow.svg';\nimport '../../theme/components/menubar/menubarmenubutton.css';\n/**\n * A menu {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#buttonView} class. Buttons like this one\n * open both top-level bar menus as well as sub-menus.\n */\nexport default class MenuBarMenuButtonView extends ListItemButtonView {\n /**\n * Creates an instance of the menu bar button view.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set({\n withText: true,\n role: 'menuitem'\n });\n this.arrowView = this._createArrowView();\n this.extendTemplate({\n attributes: {\n class: [\n 'ck-menu-bar__menu__button'\n ],\n 'aria-haspopup': true,\n 'aria-expanded': this.bindTemplate.to('isOn', value => String(value)),\n 'data-cke-tooltip-disabled': bind.to('isOn')\n },\n on: {\n 'mouseenter': bind.to('mouseenter')\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.add(this.arrowView);\n }\n /**\n * Creates the {@link #arrowView} instance.\n */\n _createArrowView() {\n const arrowView = new IconView();\n arrowView.content = dropdownArrowIcon;\n arrowView.extendTemplate({\n attributes: {\n class: 'ck-menu-bar__menu__button__arrow'\n }\n });\n return arrowView;\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenupanel.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenupanel.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport View from '../view.js';\nimport '../../theme/components/menubar/menubarmenupanel.css';\n/**\n * A view representing a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView} of a menu.\n */\nexport default class MenuBarMenuPanelView extends View {\n /**\n * Creates an instance of the menu panel view.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isVisible', false);\n this.set('position', 'se');\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-menu-bar__menu__panel',\n bind.to('position', value => `ck-menu-bar__menu__panel_position_${value}`),\n bind.if('isVisible', 'ck-hidden', value => !value)\n ],\n tabindex: '-1'\n },\n children: this.children,\n on: {\n // Drag and drop in the panel should not break the selection in the editor.\n // https://github.com/ckeditor/ckeditor5-ui/issues/228\n selectstart: bind.to(evt => {\n if (evt.target.tagName.toLocaleLowerCase() === 'input') {\n return;\n }\n evt.preventDefault();\n })\n }\n });\n }\n /**\n * Focuses the first child of the panel (default) or the last one if the `direction` is `-1`.\n */\n focus(direction = 1) {\n if (this.children.length) {\n if (direction === 1) {\n this.children.first.focus();\n }\n else {\n this.children.last.focus();\n }\n }\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenu.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubarmenu.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/menubar/menubarmenuview\n */\nimport { FocusTracker, KeystrokeHandler, getOptimalPosition } from '@ckeditor/ckeditor5-utils';\nimport MenuBarMenuButtonView from './menubarmenubuttonview.js';\nimport { MenuBarMenuBehaviors, MenuBarMenuViewPanelPositioningFunctions } from './utils.js';\nimport View from '../view.js';\nimport { default as MenuBarMenuPanelView } from './menubarmenupanelview.js';\nimport '../../theme/components/menubar/menubarmenu.css';\n/**\n * A menu view for the {@link module:ui/menubar/menubarview~MenuBarView}. Menus are building blocks of the menu bar,\n * they host other sub-menus and menu items (buttons) that users can interact with.\n */\nclass MenuBarMenuView extends View {\n /**\n * Creates an instance of the menu view.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.buttonView = new MenuBarMenuButtonView(locale);\n this.buttonView.delegate('mouseenter').to(this);\n this.buttonView.bind('isOn', 'isEnabled').to(this, 'isOpen', 'isEnabled');\n this.panelView = new MenuBarMenuPanelView(locale);\n this.panelView.bind('isVisible').to(this, 'isOpen');\n this.keystrokes = new KeystrokeHandler();\n this.focusTracker = new FocusTracker();\n this.set('isOpen', false);\n this.set('isEnabled', true);\n this.set('panelPosition', 'w');\n this.set('class', undefined);\n this.set('parentMenuView', null);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-menu-bar__menu',\n bind.to('class'),\n bind.if('isEnabled', 'ck-disabled', value => !value),\n bind.if('parentMenuView', 'ck-menu-bar__menu_top-level', value => !value)\n ]\n },\n children: [\n this.buttonView,\n this.panelView\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.buttonView.element);\n this.focusTracker.add(this.panelView.element);\n // Listen for keystrokes coming from within #element.\n this.keystrokes.listenTo(this.element);\n MenuBarMenuBehaviors.closeOnEscKey(this);\n this._repositionPanelOnOpen();\n }\n // For now, this method cannot be called in the render process because the `parentMenuView` may be assigned\n // after the rendering process.\n //\n // TODO: We should reconsider the way we handle this logic.\n /**\n * Attach all keyboard behaviors for the menu bar view.\n *\n * @internal\n */\n _attachBehaviors() {\n // Top-level menus.\n if (!this.parentMenuView) {\n this._propagateArrowKeystrokeEvents();\n MenuBarMenuBehaviors.openAndFocusPanelOnArrowDownKey(this);\n MenuBarMenuBehaviors.toggleOnButtonClick(this);\n }\n else {\n MenuBarMenuBehaviors.openOnButtonClick(this);\n MenuBarMenuBehaviors.openOnArrowRightKey(this);\n MenuBarMenuBehaviors.closeOnArrowLeftKey(this);\n MenuBarMenuBehaviors.closeOnParentClose(this);\n }\n }\n /**\n * Fires `arrowright` and `arrowleft` events when the user pressed corresponding arrow keys.\n */\n _propagateArrowKeystrokeEvents() {\n this.keystrokes.set('arrowright', (data, cancel) => {\n this.fire('arrowright');\n cancel();\n });\n this.keystrokes.set('arrowleft', (data, cancel) => {\n this.fire('arrowleft');\n cancel();\n });\n }\n /**\n * Sets the position of the panel when the menu opens. The panel is positioned\n * so that it optimally uses the available space in the viewport.\n */\n _repositionPanelOnOpen() {\n // Let the menu control the position of the panel. The position must be updated every time the menu is open.\n this.on('change:isOpen', (evt, name, isOpen) => {\n if (!isOpen) {\n return;\n }\n const optimalPanelPosition = MenuBarMenuView._getOptimalPosition({\n element: this.panelView.element,\n target: this.buttonView.element,\n fitInViewport: true,\n positions: this._panelPositions\n });\n this.panelView.position = (optimalPanelPosition ? optimalPanelPosition.name : this._panelPositions[0].name);\n });\n }\n /**\n * @inheritDoc\n */\n focus() {\n this.buttonView.focus();\n }\n /**\n * Positioning functions for the {@link #panelView} . They change depending on the role of the menu (top-level vs sub-menu) in\n * the {@link module:ui/menubar/menubarview~MenuBarView menu bar} and the UI language direction.\n */\n get _panelPositions() {\n const { southEast, southWest, northEast, northWest, westSouth, eastSouth, westNorth, eastNorth } = MenuBarMenuViewPanelPositioningFunctions;\n if (this.locale.uiLanguageDirection === 'ltr') {\n if (this.parentMenuView) {\n return [eastSouth, eastNorth, westSouth, westNorth];\n }\n else {\n return [southEast, southWest, northEast, northWest];\n }\n }\n else {\n if (this.parentMenuView) {\n return [westSouth, westNorth, eastSouth, eastNorth];\n }\n else {\n return [southWest, southEast, northWest, northEast];\n }\n }\n }\n}\n/**\n * A function used to calculate the optimal position for the dropdown panel.\n *\n * Referenced for unit testing purposes.\n */\nMenuBarMenuView._getOptimalPosition = getOptimalPosition;\nexport default MenuBarMenuView;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport ListItemView from '../list/listitemview.js';\nimport ListView from '../list/listview.js';\nimport ListItemButtonView from '../button/listitembuttonview.js';\nimport ButtonView from '../button/buttonview.js';\n/**\n * A list of menu bar items, a child of {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView}.\n *\n * Use this class to create a list of items (options, buttons) to be displayed in a menu bar.\n *\n * To populate this list, use {@link module:ui/menubar/menubarmenulistitemview~MenuBarMenuListItemView} instances.\n */\nexport default class MenuBarMenuListView extends ListView {\n /**\n * Creates an instance of the list view.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n this.role = 'menu';\n this.items.on('change', this._setItemsCheckSpace.bind(this));\n }\n /**\n * This method adds empty space if there is any toggleable item in the list.\n * It makes the list properly aligned.\n */\n _setItemsCheckSpace() {\n const hasAnyToggleableItem = (Array\n .from(this.items)\n .some(item => {\n const listButtonView = pickListButtonMenuViewIfPresent(item);\n return listButtonView && listButtonView.isToggleable;\n }));\n this.items.forEach(item => {\n const listButtonView = pickListButtonMenuViewIfPresent(item);\n if (listButtonView) {\n listButtonView.hasCheckSpace = hasAnyToggleableItem;\n }\n });\n }\n}\n/**\n * Picks the first button menu view from the given item if present.\n *\n * @param item The item to check for a button menu view.\n * @returns The first button menu view found in the item, or `null` if not found.\n */\nfunction pickListButtonMenuViewIfPresent(item) {\n if (!(item instanceof ListItemView)) {\n return null;\n }\n return item\n .children\n .map(child => isNestedMenuLikeView(child) ? child.buttonView : child)\n .find(item => item instanceof ListItemButtonView);\n}\n/**\n * Checks if the given item is a nested menu-like view. `MenuBarMenuView` imports this file\n * so to avoid circular dependencies, this function is defined in more generic way.\n *\n * @param item The item to check.\n * @returns `true` if the item is a nested menu-like view, `false` otherwise.\n */\nfunction isNestedMenuLikeView(item) {\n return (typeof item === 'object' &&\n 'buttonView' in item &&\n item.buttonView instanceof ButtonView);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { FileDialogListItemButtonView } from '../button/filedialogbuttonview.js';\nimport '../../theme/components/menubar/menubarmenulistitembutton.css';\n/**\n * A menu bar list file dialog button view. Buttons like this one execute user actions.\n *\n * This component provides a button that opens the native file selection dialog.\n */\nexport default class MenuBarMenuListItemFileDialogButtonView extends FileDialogListItemButtonView {\n /**\n * Creates an instance of the menu bar list button view.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n this.set({\n withText: true,\n withKeystroke: true,\n tooltip: false,\n role: 'menuitem'\n });\n this.extendTemplate({\n attributes: {\n class: ['ck-menu-bar__menu__item__button']\n }\n });\n }\n}\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubar.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./menubar.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/menubar/menubarview\n */\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\nimport View from '../view.js';\nimport { isObject } from 'lodash-es';\nimport ListItemView from '../list/listitemview.js';\nimport ListSeparatorView from '../list/listseparatorview.js';\nimport MenuBarMenuView from './menubarmenuview.js';\nimport MenuBarMenuListView from './menubarmenulistview.js';\nimport MenuBarMenuListItemView from './menubarmenulistitemview.js';\nimport MenuBarMenuListItemButtonView from './menubarmenulistitembuttonview.js';\nimport MenuBarMenuListItemFileDialogButtonView from './menubarmenulistitemfiledialogbuttonview.js';\nimport { MenuBarBehaviors, processMenuBarConfig } from './utils.js';\nconst EVENT_NAME_DELEGATES = ['mouseenter', 'arrowleft', 'arrowright', 'change:isOpen'];\nimport '../../theme/components/menubar/menubar.css';\n/**\n * The application menu bar component. It brings a set of top-level menus (and sub-menus) that can be used\n * to organize and access a large number of buttons.\n */\nexport default class MenuBarView extends View {\n /**\n * Creates an instance of the menu bar view.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n /**\n * A list of {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instances registered in the menu bar.\n *\n * @observable\n */\n this.menus = [];\n const t = locale.t;\n const bind = this.bindTemplate;\n this.set({\n isOpen: false,\n isFocusBorderEnabled: false\n });\n this._setupIsOpenUpdater();\n this.children = this.createCollection();\n // @if CK_DEBUG_MENU_BAR // // Logs events in the main event bus of the component.\n // @if CK_DEBUG_MENU_BAR // this.on( 'menu', ( evt, data ) => {\n // @if CK_DEBUG_MENU_BAR // \tconsole.log( `MenuBarView:${ evt.name }`, evt.path.map( view => view.element ) );\n // @if CK_DEBUG_MENU_BAR // } );\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-menu-bar',\n bind.if('isFocusBorderEnabled', 'ck-menu-bar_focus-border-enabled')\n ],\n 'aria-label': t('Editor menu bar'),\n role: 'menubar'\n },\n children: this.children\n });\n }\n /**\n * A utility that expands a plain menu bar configuration into a structure of menus (also: sub-menus)\n * and items using a given {@link module:ui/componentfactory~ComponentFactory component factory}.\n *\n * See the {@link module:core/editor/editorconfig~EditorConfig#menuBar menu bar} in the editor\n * configuration reference to learn how to configure the menu bar.\n */\n fillFromConfig(config, componentFactory, extraItems = []) {\n const locale = this.locale;\n const processedConfig = processMenuBarConfig({\n normalizedConfig: config,\n locale,\n componentFactory,\n extraItems\n });\n const topLevelCategoryMenuViews = processedConfig.items.map(menuDefinition => this._createMenu({\n componentFactory,\n menuDefinition\n }));\n this.children.addMany(topLevelCategoryMenuViews);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n MenuBarBehaviors.toggleMenusAndFocusItemsOnHover(this);\n MenuBarBehaviors.closeMenusWhenTheBarCloses(this);\n MenuBarBehaviors.closeMenuWhenAnotherOnTheSameLevelOpens(this);\n MenuBarBehaviors.focusCycleMenusOnArrows(this);\n MenuBarBehaviors.closeOnClickOutside(this);\n MenuBarBehaviors.enableFocusHighlightOnInteraction(this);\n }\n /**\n * Focuses the menu bar.\n */\n focus() {\n if (this.children.first) {\n this.children.first.focus();\n }\n }\n /**\n * Closes all menus in the bar.\n */\n close() {\n for (const topLevelCategoryMenuView of this.children) {\n topLevelCategoryMenuView.isOpen = false;\n }\n }\n /**\n * Registers a menu view in the menu bar. Every {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instance must be registered\n * in the menu bar to be properly managed.\n */\n registerMenu(menuView, parentMenuView = null) {\n if (parentMenuView) {\n menuView.delegate(...EVENT_NAME_DELEGATES).to(parentMenuView);\n menuView.parentMenuView = parentMenuView;\n }\n else {\n menuView.delegate(...EVENT_NAME_DELEGATES).to(this, name => 'menu:' + name);\n }\n menuView._attachBehaviors();\n this.menus.push(menuView);\n }\n /**\n * Creates a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} based on the given definition.\n */\n _createMenu({ componentFactory, menuDefinition, parentMenuView }) {\n const locale = this.locale;\n const menuView = new MenuBarMenuView(locale);\n this.registerMenu(menuView, parentMenuView);\n menuView.buttonView.set({\n label: menuDefinition.label\n });\n // Defer the creation of the menu structure until it gets open. This is a performance optimization\n // that shortens the time needed to create the editor.\n menuView.once('change:isOpen', () => {\n const listView = new MenuBarMenuListView(locale);\n listView.ariaLabel = menuDefinition.label;\n menuView.panelView.children.add(listView);\n listView.items.addMany(this._createMenuItems({ menuDefinition, parentMenuView: menuView, componentFactory }));\n });\n return menuView;\n }\n /**\n * Creates a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} items based on the given definition.\n */\n _createMenuItems({ menuDefinition, parentMenuView, componentFactory }) {\n const locale = this.locale;\n const items = [];\n for (const menuGroupDefinition of menuDefinition.groups) {\n for (const itemDefinition of menuGroupDefinition.items) {\n const menuItemView = new MenuBarMenuListItemView(locale, parentMenuView);\n if (isObject(itemDefinition)) {\n menuItemView.children.add(this._createMenu({\n componentFactory,\n menuDefinition: itemDefinition,\n parentMenuView\n }));\n }\n else {\n const componentView = this._createMenuItemContentFromFactory({\n componentName: itemDefinition,\n componentFactory,\n parentMenuView\n });\n if (!componentView) {\n continue;\n }\n menuItemView.children.add(componentView);\n }\n items.push(menuItemView);\n }\n // Separate groups with a separator.\n if (menuGroupDefinition !== menuDefinition.groups[menuDefinition.groups.length - 1]) {\n items.push(new ListSeparatorView(locale));\n }\n }\n return items;\n }\n /**\n * Uses the component factory to create a content of the menu item (a button or a sub-menu).\n */\n _createMenuItemContentFromFactory({ componentName, parentMenuView, componentFactory }) {\n const componentView = componentFactory.create(componentName);\n if (!(componentView instanceof MenuBarMenuView ||\n componentView instanceof MenuBarMenuListItemButtonView ||\n componentView instanceof MenuBarMenuListItemFileDialogButtonView)) {\n /**\n * Adding unsupported components to the {@link module:ui/menubar/menubarview~MenuBarView} is not possible.\n *\n * A component should be either a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} (sub-menu) or a\n * {@link module:ui/menubar/menubarmenulistitembuttonview~MenuBarMenuListItemButtonView} (button).\n *\n * @error menu-bar-component-unsupported\n * @param componentName A name of the unsupported component used in the configuration.\n * @param componentView An unsupported component view.\n */\n logWarning('menu-bar-component-unsupported', {\n componentName,\n componentView\n });\n return null;\n }\n this._registerMenuTree(componentView, parentMenuView);\n // Close the whole menu bar when a component is executed.\n componentView.on('execute', () => {\n this.close();\n });\n return componentView;\n }\n /**\n * Checks component and its children recursively and calls {@link #registerMenu}\n * for each item that is {@link module:ui/menubar/menubarmenuview~MenuBarMenuView}.\n *\n * @internal\n */\n _registerMenuTree(componentView, parentMenuView) {\n if (!(componentView instanceof MenuBarMenuView)) {\n componentView.delegate('mouseenter').to(parentMenuView);\n return;\n }\n this.registerMenu(componentView, parentMenuView);\n const menuBarItemsList = componentView.panelView.children\n .filter(child => child instanceof MenuBarMenuListView)[0];\n if (!menuBarItemsList) {\n componentView.delegate('mouseenter').to(parentMenuView);\n return;\n }\n const nonSeparatorItems = menuBarItemsList.items.filter(item => item instanceof ListItemView);\n for (const item of nonSeparatorItems) {\n this._registerMenuTree(item.children.get(0), componentView);\n }\n }\n /**\n * Manages the state of the {@link #isOpen} property of the menu bar. Because the state is a sum of individual\n * top-level menus' states, it's necessary to listen to their changes and update the state accordingly.\n *\n * Additionally, it prevents from unnecessary changes of `isOpen` when one top-level menu opens and another closes\n * (regardless of in which order), maintaining a stable `isOpen === true` in that situation.\n */\n _setupIsOpenUpdater() {\n let closeTimeout;\n // TODO: This is not the prettiest approach but at least it's simple.\n this.on('menu:change:isOpen', (evt, name, isOpen) => {\n clearTimeout(closeTimeout);\n if (isOpen) {\n this.isOpen = true;\n }\n else {\n closeTimeout = setTimeout(() => {\n this.isOpen = Array.from(this.children).some(menuView => menuView.isOpen);\n }, 0);\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { EditorUI } from 'ckeditor5/src/ui.js';\nimport { enablePlaceholder } from 'ckeditor5/src/engine.js';\n/**\n * The decoupled editor UI class.\n */\nexport default class DecoupledEditorUI extends EditorUI {\n /**\n * Creates an instance of the decoupled editor UI class.\n *\n * @param editor The editor instance.\n * @param view The view of the UI.\n */\n constructor(editor, view) {\n super(editor);\n this.view = view;\n }\n /**\n * Initializes the UI.\n */\n init() {\n const editor = this.editor;\n const view = this.view;\n const editingView = editor.editing.view;\n const editable = view.editable;\n const editingRoot = editingView.document.getRoot();\n // The editable UI and editing root should share the same name. Then name is used\n // to recognize the particular editable, for instance in ARIA attributes.\n editable.name = editingRoot.rootName;\n view.render();\n // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.\n // But it can be available earlier if a DOM element has been passed to DecoupledEditor.create().\n const editableElement = editable.element;\n // Register the editable UI view in the editor. A single editor instance can aggregate multiple\n // editable areas (roots) but the decoupled editor has only one.\n this.setEditableElement(editable.name, editableElement);\n // Let the editable UI element respond to the changes in the global editor focus\n // tracker. It has been added to the same tracker a few lines above but, in reality, there are\n // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long\n // as they have focus, the editable should act like it is focused too (although technically\n // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.\n // Doing otherwise will result in editable focus styles disappearing, once e.g. the\n // toolbar gets focused.\n view.editable.bind('isFocused').to(this.focusTracker);\n // Bind the editable UI element to the editing view, making it an end– and entry–point\n // of the editor's engine. This is where the engine meets the UI.\n editingView.attachDomRoot(editableElement);\n this._initPlaceholder();\n this._initToolbar();\n this._initMenuBar(this.view.menuBarView);\n this.fire('ready');\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n const view = this.view;\n const editingView = this.editor.editing.view;\n editingView.detachDomRoot(view.editable.name);\n view.destroy();\n }\n /**\n * Initializes the inline editor toolbar and its panel.\n */\n _initToolbar() {\n const editor = this.editor;\n const view = this.view;\n const toolbar = view.toolbar;\n toolbar.fillFromConfig(editor.config.get('toolbar'), this.componentFactory);\n // Register the toolbar so it becomes available for Alt+F10 and Esc navigation.\n this.addToolbar(view.toolbar);\n }\n /**\n * Enable the placeholder text on the editing root.\n */\n _initPlaceholder() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const editingRoot = editingView.document.getRoot();\n const placeholder = editor.config.get('placeholder');\n if (placeholder) {\n const placeholderText = typeof placeholder === 'string' ? placeholder : placeholder[editingRoot.rootName];\n if (placeholderText) {\n editingRoot.placeholder = placeholderText;\n }\n }\n enablePlaceholder({\n view: editingView,\n element: editingRoot,\n isDirectHost: false,\n keepOnFocus: true\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module editor-decoupled/decouplededitoruiview\n */\nimport { EditorUIView, InlineEditableUIView, MenuBarView, ToolbarView } from 'ckeditor5/src/ui.js';\n/**\n * The decoupled editor UI view. It is a virtual view providing an inline\n * {@link module:editor-decoupled/decouplededitoruiview~DecoupledEditorUIView#editable},\n * {@link module:editor-decoupled/decouplededitoruiview~DecoupledEditorUIView#toolbar}, and a\n * {@link module:editor-decoupled/decouplededitoruiview~DecoupledEditorUIView#menuBarView} but without any\n * specific arrangement of the components in the DOM.\n *\n * See {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}\n * to learn more about this view.\n */\nexport default class DecoupledEditorUIView extends EditorUIView {\n /**\n * Creates an instance of the decoupled editor UI view.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param editingView The editing view instance this view is related to.\n * @param options Configuration options for the view instance.\n * @param options.editableElement The editable element. If not specified, it will be automatically created by\n * {@link module:ui/editableui/editableuiview~EditableUIView}. Otherwise, the given element will be used.\n * @param options.shouldToolbarGroupWhenFull When set `true` enables automatic items grouping\n * in the main {@link module:editor-decoupled/decouplededitoruiview~DecoupledEditorUIView#toolbar toolbar}.\n * See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.\n */\n constructor(locale, editingView, options = {}) {\n super(locale);\n const t = locale.t;\n this.toolbar = new ToolbarView(locale, {\n shouldGroupWhenFull: options.shouldToolbarGroupWhenFull\n });\n this.menuBarView = new MenuBarView(locale);\n this.editable = new InlineEditableUIView(locale, editingView, options.editableElement, {\n label: editableView => {\n return t('Rich Text Editor. Editing area: %0', editableView.name);\n }\n });\n // This toolbar may be placed anywhere in the page so things like font size need to be reset in it.\n // Because of the above, make sure the toolbar supports rounded corners.\n // Also, make sure the toolbar has the proper dir attribute because its ancestor may not have one\n // and some toolbar item styles depend on this attribute.\n this.toolbar.extendTemplate({\n attributes: {\n class: [\n 'ck-reset_all',\n 'ck-rounded-corners'\n ],\n dir: locale.uiLanguageDirection\n }\n });\n this.menuBarView.extendTemplate({\n attributes: {\n class: [\n 'ck-reset_all',\n 'ck-rounded-corners'\n ],\n dir: locale.uiLanguageDirection\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.registerChild([this.menuBarView, this.toolbar, this.editable]);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module editor-decoupled/decouplededitor\n */\nimport { Editor, ElementApiMixin, secureSourceElement } from 'ckeditor5/src/core.js';\nimport { CKEditorError, getDataFromElement } from 'ckeditor5/src/utils.js';\nimport DecoupledEditorUI from './decouplededitorui.js';\nimport DecoupledEditorUIView from './decouplededitoruiview.js';\nimport { isElement as _isElement } from 'lodash-es';\n/**\n * The decoupled editor implementation. It provides an inline editable and a toolbar. However, unlike other editors,\n * it does not render these components anywhere in the DOM unless configured.\n *\n * This type of an editor is dedicated to integrations which require a customized UI with an open\n * structure, allowing developers to specify the exact location of the interface.\n *\n * See the document editor {@glink examples/builds/document-editor demo} to learn about possible use cases\n * for the decoupled editor.\n *\n * In order to create a decoupled editor instance, use the static\n * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`} method.\n *\n * Note that you will need to attach the editor toolbar and menu bar to your web page manually, in a desired place,\n * after the editor is initialized.\n */\nexport default class DecoupledEditor extends /* #__PURE__ */ ElementApiMixin(Editor) {\n /**\n * Creates an instance of the decoupled editor.\n *\n * **Note:** Do not use the constructor to create editor instances. Use the static\n * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`} method instead.\n *\n * @param sourceElementOrData The DOM element that will be the source for the created editor\n * (on which the editor will be initialized) or initial data for the editor. For more information see\n * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.\n * @param config The editor configuration.\n */\n constructor(sourceElementOrData, config = {}) {\n // If both `config.initialData` is set and initial data is passed as the constructor parameter, then throw.\n if (!isElement(sourceElementOrData) && config.initialData !== undefined) {\n // Documented in core/editor/editorconfig.jsdoc.\n // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message\n throw new CKEditorError('editor-create-initial-data', null);\n }\n super(config);\n if (this.config.get('initialData') === undefined) {\n this.config.set('initialData', getInitialData(sourceElementOrData));\n }\n if (isElement(sourceElementOrData)) {\n this.sourceElement = sourceElementOrData;\n secureSourceElement(this, sourceElementOrData);\n }\n this.model.document.createRoot();\n const shouldToolbarGroupWhenFull = !this.config.get('toolbar.shouldNotGroupWhenFull');\n const view = new DecoupledEditorUIView(this.locale, this.editing.view, {\n editableElement: this.sourceElement,\n shouldToolbarGroupWhenFull\n });\n this.ui = new DecoupledEditorUI(this, view);\n }\n /**\n * Destroys the editor instance, releasing all resources used by it.\n *\n * Updates the original editor element with the data if the\n * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}\n * configuration option is set to `true`.\n *\n * **Note**: The decoupled editor does not remove the toolbar and editable when destroyed. You can\n * do that yourself in the destruction chain:\n *\n * ```ts\n * editor.destroy()\n * \t.then( () => {\n * \t\t// Remove the toolbar from DOM.\n * \t\teditor.ui.view.toolbar.element.remove();\n *\n * \t\t// Remove the editable from DOM.\n * \t\teditor.ui.view.editable.element.remove();\n *\n * \t\tconsole.log( 'Editor was destroyed' );\n * \t} );\n * ```\n */\n destroy() {\n // Cache the data, then destroy.\n // It's safe to assume that the model->view conversion will not work after super.destroy().\n const data = this.getData();\n this.ui.destroy();\n return super.destroy()\n .then(() => {\n if (this.sourceElement) {\n this.updateSourceElement(data);\n }\n });\n }\n /**\n * Creates a new decoupled editor instance.\n *\n * **Note:** remember that `DecoupledEditor` does not append the toolbar element to your web page, so you have to do it manually\n * after the editor has been initialized.\n *\n * There are two ways how the editor can be initialized.\n *\n * # Using an existing DOM element (and loading data from it)\n *\n * You can initialize the editor using an existing DOM element:\n *\n * ```ts\n * DecoupledEditor\n * \t.create( document.querySelector( '#editor' ) )\n * \t.then( editor => {\n * \t\tconsole.log( 'Editor was initialized', editor );\n *\n * \t\t// Append the toolbar to the <body> element.\n * \t\tdocument.body.appendChild( editor.ui.view.toolbar.element );\n * \t} )\n * \t.catch( err => {\n * \t\tconsole.error( err.stack );\n * \t} );\n * ```\n *\n * The element's content will be used as the editor data and the element will become the editable element.\n *\n * # Creating a detached editor\n *\n * Alternatively, you can initialize the editor by passing the initial data directly as a string.\n * In this case, you will have to manually append both the toolbar element and the editable element to your web page.\n *\n * ```ts\n * DecoupledEditor\n * \t.create( '<p>Hello world!</p>' )\n * \t.then( editor => {\n * \t\tconsole.log( 'Editor was initialized', editor );\n *\n * \t\t// Append the toolbar to the <body> element.\n * \t\tdocument.body.appendChild( editor.ui.view.toolbar.element );\n *\n * \t\t// Initial data was provided so the editor UI element needs to be added manually to the DOM.\n * \t\tdocument.body.appendChild( editor.ui.getEditableElement() );\n * \t} )\n * \t.catch( err => {\n * \t\tconsole.error( err.stack );\n * \t} );\n * ```\n *\n * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your\n * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.\n *\n * # Using an existing DOM element (and data provided in `config.initialData`)\n *\n * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:\n *\n * ```ts\n * DecoupledEditor\n * \t.create( document.querySelector( '#editor' ), {\n * \t\tinitialData: '<h2>Initial data</h2><p>Foo bar.</p>'\n * \t} )\n * \t.then( editor => {\n * \t\tconsole.log( 'Editor was initialized', editor );\n *\n * \t\t// Append the toolbar to the <body> element.\n * \t\tdocument.body.appendChild( editor.ui.view.toolbar.element );\n * \t} )\n * \t.catch( err => {\n * \t\tconsole.error( err.stack );\n * \t} );\n * ```\n *\n * This method can be used to initialize the editor on an existing element with the specified content in case if your integration\n * makes it difficult to set the content of the source element.\n *\n * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.\n *\n * # Configuring the editor\n *\n * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about\n * customizing plugins, toolbar and more.\n *\n * @param sourceElementOrData The DOM element that will be the source for the created editor\n * or the editor's initial data.\n *\n * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.\n * The editor data will be set back to the original element once the editor is destroyed only if the\n * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}\n * option is set to `true`.\n *\n * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.\n * It is available via\n * {@link module:editor-decoupled/decouplededitorui~DecoupledEditorUI#getEditableElement `editor.ui.getEditableElement()`}.\n *\n * @param config The editor configuration.\n * @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.\n */\n static create(sourceElementOrData, config = {}) {\n return new Promise(resolve => {\n if (isElement(sourceElementOrData) && sourceElementOrData.tagName === 'TEXTAREA') {\n // Documented in core/editor/editor.js\n // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message\n throw new CKEditorError('editor-wrong-element', null);\n }\n const editor = new this(sourceElementOrData, config);\n resolve(editor.initPlugins()\n .then(() => editor.ui.init())\n .then(() => editor.data.init(editor.config.get('initialData')))\n .then(() => editor.fire('ready'))\n .then(() => editor));\n });\n }\n}\nfunction getInitialData(sourceElementOrData) {\n return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;\n}\nfunction isElement(value) {\n return _isElement(value);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals HTMLTextAreaElement */\n/**\n * @module utils/dom/getdatafromelement\n */\n/**\n * Gets data from a given source element.\n *\n * @param el The element from which the data will be retrieved.\n * @returns The data string.\n */\nexport default function getDataFromElement(el) {\n if (el instanceof HTMLTextAreaElement) {\n return el.value;\n }\n return el.innerHTML;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editor/utils/securesourceelement\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Marks the source element on which the editor was initialized. This prevents other editor instances from using this element.\n *\n * Running multiple editor instances on the same source element causes various issues and it is\n * crucial this helper is called as soon as the source element is known to prevent collisions.\n *\n * @param editor Editor instance.\n * @param sourceElement Element to bind with the editor instance.\n */\nexport default function secureSourceElement(editor, sourceElement) {\n if (sourceElement.ckeditorInstance) {\n /**\n * A DOM element used to create the editor (e.g.\n * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`})\n * has already been used to create another editor instance. Make sure each editor is\n * created with an unique DOM element.\n *\n * @error editor-source-element-already-used\n * @param element DOM element that caused the collision.\n */\n throw new CKEditorError('editor-source-element-already-used', editor);\n }\n sourceElement.ckeditorInstance = editor;\n editor.once('destroy', () => {\n delete sourceElement.ckeditorInstance;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/highlightstack\n */\nimport { EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Class used to handle the correct order of highlights on elements.\n *\n * When different highlights are applied to same element the correct order should be preserved:\n *\n * * highlight with highest priority should be applied,\n * * if two highlights have same priority - sort by CSS class provided in\n * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.\n *\n * This way, highlight will be applied with the same rules it is applied on texts.\n */\nexport default class HighlightStack extends /* #__PURE__ */ EmitterMixin() {\n constructor() {\n super(...arguments);\n this._stack = [];\n }\n /**\n * Adds highlight descriptor to the stack.\n *\n * @fires change:top\n */\n add(descriptor, writer) {\n const stack = this._stack;\n // Save top descriptor and insert new one. If top is changed - fire event.\n const oldTop = stack[0];\n this._insertDescriptor(descriptor);\n const newTop = stack[0];\n // When new object is at the top and stores different information.\n if (oldTop !== newTop && !compareDescriptors(oldTop, newTop)) {\n this.fire('change:top', {\n oldDescriptor: oldTop,\n newDescriptor: newTop,\n writer\n });\n }\n }\n /**\n * Removes highlight descriptor from the stack.\n *\n * @fires change:top\n * @param id Id of the descriptor to remove.\n */\n remove(id, writer) {\n const stack = this._stack;\n const oldTop = stack[0];\n this._removeDescriptor(id);\n const newTop = stack[0];\n // When new object is at the top and stores different information.\n if (oldTop !== newTop && !compareDescriptors(oldTop, newTop)) {\n this.fire('change:top', {\n oldDescriptor: oldTop,\n newDescriptor: newTop,\n writer\n });\n }\n }\n /**\n * Inserts a given descriptor in correct place in the stack. It also takes care about updating information\n * when descriptor with same id is already present.\n */\n _insertDescriptor(descriptor) {\n const stack = this._stack;\n const index = stack.findIndex(item => item.id === descriptor.id);\n // Inserting exact same descriptor - do nothing.\n if (compareDescriptors(descriptor, stack[index])) {\n return;\n }\n // If descriptor with same id but with different information is on the stack - remove it.\n if (index > -1) {\n stack.splice(index, 1);\n }\n // Find correct place to insert descriptor in the stack.\n // It has different information (for example priority) so it must be re-inserted in correct place.\n let i = 0;\n while (stack[i] && shouldABeBeforeB(stack[i], descriptor)) {\n i++;\n }\n stack.splice(i, 0, descriptor);\n }\n /**\n * Removes descriptor with given id from the stack.\n *\n * @param id Descriptor's id.\n */\n _removeDescriptor(id) {\n const stack = this._stack;\n const index = stack.findIndex(item => item.id === id);\n // If descriptor with same id is on the list - remove it.\n if (index > -1) {\n stack.splice(index, 1);\n }\n }\n}\n/**\n * Compares two descriptors by checking their priority and class list.\n *\n * @returns Returns true if both descriptors are defined and have same priority and classes.\n */\nfunction compareDescriptors(a, b) {\n return a && b && a.priority == b.priority && classesToString(a.classes) == classesToString(b.classes);\n}\n/**\n * Checks whenever first descriptor should be placed in the stack before second one.\n */\nfunction shouldABeBeforeB(a, b) {\n if (a.priority > b.priority) {\n return true;\n }\n else if (a.priority < b.priority) {\n return false;\n }\n // When priorities are equal and names are different - use classes to compare.\n return classesToString(a.classes) > classesToString(b.classes);\n}\n/**\n * Converts CSS classes passed with {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} to\n * sorted string.\n */\nfunction classesToString(classes) {\n return Array.isArray(classes) ? classes.sort().join(',') : classes;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgettypearound/utils\n */\nimport { isWidget } from '../utils.js';\n/**\n * The name of the type around model selection attribute responsible for\n * displaying a fake caret next to a selected widget.\n */\nexport const TYPE_AROUND_SELECTION_ATTRIBUTE = 'widget-type-around';\n/**\n * Checks if an element is a widget that qualifies to get the widget type around UI.\n */\nexport function isTypeAroundWidget(viewElement, modelElement, schema) {\n return !!viewElement && isWidget(viewElement) && !schema.isInline(modelElement);\n}\n/**\n * For the passed HTML element, this helper finds the closest widget type around button ancestor.\n */\nexport function getClosestTypeAroundDomButton(domElement) {\n return domElement.closest('.ck-widget__type-around__button');\n}\n/**\n * For the passed widget type around button element, this helper determines at which position\n * the paragraph would be inserted into the content if, for instance, the button was\n * clicked by the user.\n *\n * @returns The position of the button.\n */\nexport function getTypeAroundButtonPosition(domElement) {\n return domElement.classList.contains('ck-widget__type-around__button_before') ? 'before' : 'after';\n}\n/**\n * For the passed HTML element, this helper returns the closest view widget ancestor.\n */\nexport function getClosestWidgetViewElement(domElement, domConverter) {\n const widgetDomElement = domElement.closest('.ck-widget');\n return domConverter.mapDomToView(widgetDomElement);\n}\n/**\n * For the passed selection instance, it returns the position of the fake caret displayed next to a widget.\n *\n * **Note**: If the fake caret is not currently displayed, `null` is returned.\n *\n * @returns The position of the fake caret or `null` when none is present.\n */\nexport function getTypeAroundFakeCaretPosition(selection) {\n return selection.getAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n}\n","export default \"<svg viewBox=\\\"0 0 16 16\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z\\\"/><path fill-opacity=\\\".256\\\" d=\\\"M1 1h14v14H1z\\\"/><g class=\\\"ck-icon__selected-indicator\\\"><path d=\\\"M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z\\\"/><path fill-opacity=\\\".254\\\" d=\\\"M1 1h14v14H1z\\\"/></g></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/utils\n */\nimport { Rect, CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';\nimport { IconView } from '@ckeditor/ckeditor5-ui';\nimport HighlightStack from './highlightstack.js';\nimport { getTypeAroundFakeCaretPosition } from './widgettypearound/utils.js';\nimport dragHandleIcon from '../theme/icons/drag-handle.svg';\n/**\n * CSS class added to each widget element.\n */\nexport const WIDGET_CLASS_NAME = 'ck-widget';\n/**\n * CSS class added to currently selected widget element.\n */\nexport const WIDGET_SELECTED_CLASS_NAME = 'ck-widget_selected';\n/**\n * Returns `true` if given {@link module:engine/view/node~Node} is an {@link module:engine/view/element~Element} and a widget.\n */\nexport function isWidget(node) {\n if (!node.is('element')) {\n return false;\n }\n return !!node.getCustomProperty('widget');\n}\n/**\n * Converts the given {@link module:engine/view/element~Element} to a widget in the following way:\n *\n * * sets the `contenteditable` attribute to `\"false\"`,\n * * adds the `ck-widget` CSS class,\n * * adds a custom {@link module:engine/view/element~Element#getFillerOffset `getFillerOffset()`} method returning `null`,\n * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},\n * * implements the {@link ~setHighlightHandling view highlight on widgets}.\n *\n * This function needs to be used in conjunction with\n * {@link module:engine/conversion/downcasthelpers~DowncastHelpers downcast conversion helpers}\n * like {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.\n * Moreover, typically you will want to use `toWidget()` only for `editingDowncast`, while keeping the `dataDowncast` clean.\n *\n * For example, in order to convert a `<widget>` model element to `<div class=\"widget\">` in the view, you can define\n * such converters:\n *\n * ```ts\n * editor.conversion.for( 'editingDowncast' )\n * \t.elementToElement( {\n * \t\tmodel: 'widget',\n * \t\tview: ( modelItem, { writer } ) => {\n * \t\t\tconst div = writer.createContainerElement( 'div', { class: 'widget' } );\n *\n * \t\t\treturn toWidget( div, writer, { label: 'some widget' } );\n * \t\t}\n * \t} );\n *\n * editor.conversion.for( 'dataDowncast' )\n * \t.elementToElement( {\n * \t\tmodel: 'widget',\n * \t\tview: ( modelItem, { writer } ) => {\n * \t\t\treturn writer.createContainerElement( 'div', { class: 'widget' } );\n * \t\t}\n * \t} );\n * ```\n *\n * See the full source code of the widget (with a nested editable) schema definition and converters in\n * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).\n *\n * @param options Additional options.\n * @param options.label Element's label provided to the {@link ~setLabel} function. It can be passed as\n * a plain string or a function returning a string. It represents the widget for assistive technologies (like screen readers).\n * @param options.hasSelectionHandle If `true`, the widget will have a selection handle added.\n * @returns Returns the same element.\n */\nexport function toWidget(element, writer, options = {}) {\n if (!element.is('containerElement')) {\n /**\n * The element passed to `toWidget()` must be a {@link module:engine/view/containerelement~ContainerElement}\n * instance.\n *\n * @error widget-to-widget-wrong-element-type\n * @param element The view element passed to `toWidget()`.\n */\n throw new CKEditorError('widget-to-widget-wrong-element-type', null, { element });\n }\n writer.setAttribute('contenteditable', 'false', element);\n writer.addClass(WIDGET_CLASS_NAME, element);\n writer.setCustomProperty('widget', true, element);\n element.getFillerOffset = getFillerOffset;\n writer.setCustomProperty('widgetLabel', [], element);\n if (options.label) {\n setLabel(element, options.label);\n }\n if (options.hasSelectionHandle) {\n addSelectionHandle(element, writer);\n }\n setHighlightHandling(element, writer);\n return element;\n}\n/**\n * Default handler for adding a highlight on a widget.\n * It adds CSS class and attributes basing on the given highlight descriptor.\n */\nfunction addHighlight(element, descriptor, writer) {\n if (descriptor.classes) {\n writer.addClass(toArray(descriptor.classes), element);\n }\n if (descriptor.attributes) {\n for (const key in descriptor.attributes) {\n writer.setAttribute(key, descriptor.attributes[key], element);\n }\n }\n}\n/**\n * Default handler for removing a highlight from a widget.\n * It removes CSS class and attributes basing on the given highlight descriptor.\n */\nfunction removeHighlight(element, descriptor, writer) {\n if (descriptor.classes) {\n writer.removeClass(toArray(descriptor.classes), element);\n }\n if (descriptor.attributes) {\n for (const key in descriptor.attributes) {\n writer.removeAttribute(key, element);\n }\n }\n}\n/**\n * Sets highlight handling methods. Uses {@link module:widget/highlightstack~HighlightStack} to\n * properly determine which highlight descriptor should be used at given time.\n */\nexport function setHighlightHandling(element, writer, add = addHighlight, remove = removeHighlight) {\n const stack = new HighlightStack();\n stack.on('change:top', (evt, data) => {\n if (data.oldDescriptor) {\n remove(element, data.oldDescriptor, data.writer);\n }\n if (data.newDescriptor) {\n add(element, data.newDescriptor, data.writer);\n }\n });\n const addHighlightCallback = (element, descriptor, writer) => stack.add(descriptor, writer);\n const removeHighlightCallback = (element, id, writer) => stack.remove(id, writer);\n writer.setCustomProperty('addHighlight', addHighlightCallback, element);\n writer.setCustomProperty('removeHighlight', removeHighlightCallback, element);\n}\n/**\n * Sets label for given element.\n * It can be passed as a plain string or a function returning a string. Function will be called each time label is retrieved by\n * {@link ~getLabel `getLabel()`}.\n */\nexport function setLabel(element, labelOrCreator) {\n const widgetLabel = element.getCustomProperty('widgetLabel');\n widgetLabel.push(labelOrCreator);\n}\n/**\n * Returns the label of the provided element.\n */\nexport function getLabel(element) {\n const widgetLabel = element.getCustomProperty('widgetLabel');\n return widgetLabel.reduce((prev, current) => {\n if (typeof current === 'function') {\n return prev ? prev + '. ' + current() : current();\n }\n else {\n return prev ? prev + '. ' + current : current;\n }\n }, '');\n}\n/**\n * Adds functionality to the provided {@link module:engine/view/editableelement~EditableElement} to act as a widget's editable:\n *\n * * sets the `contenteditable` attribute to `true` when {@link module:engine/view/editableelement~EditableElement#isReadOnly} is `false`,\n * otherwise sets it to `false`,\n * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,\n * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.\n * * implements the {@link ~setHighlightHandling view highlight on widget's editable}.\n *\n * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually\n * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.\n *\n * For example, in order to convert a `<nested>` model element to `<div class=\"nested\">` in the view, you can define\n * such converters:\n *\n * ```ts\n * editor.conversion.for( 'editingDowncast' )\n * \t.elementToElement( {\n * \t\tmodel: 'nested',\n * \t\tview: ( modelItem, { writer } ) => {\n * \t\t\tconst div = writer.createEditableElement( 'div', { class: 'nested' } );\n *\n * \t\t\treturn toWidgetEditable( nested, writer, { label: 'label for editable' } );\n * \t\t}\n * \t} );\n *\n * editor.conversion.for( 'dataDowncast' )\n * \t.elementToElement( {\n * \t\tmodel: 'nested',\n * \t\tview: ( modelItem, { writer } ) => {\n * \t\t\treturn writer.createContainerElement( 'div', { class: 'nested' } );\n * \t\t}\n * \t} );\n * ```\n *\n * See the full source code of the widget (with nested editable) schema definition and converters in\n * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).\n *\n * @param options Additional options.\n * @param options.label Editable's label used by assistive technologies (e.g. screen readers).\n * @returns Returns the same element that was provided in the `editable` parameter\n */\nexport function toWidgetEditable(editable, writer, options = {}) {\n writer.addClass(['ck-editor__editable', 'ck-editor__nested-editable'], editable);\n writer.setAttribute('role', 'textbox', editable);\n writer.setAttribute('tabindex', '-1', editable);\n if (options.label) {\n writer.setAttribute('aria-label', options.label, editable);\n }\n // Set initial contenteditable value.\n writer.setAttribute('contenteditable', editable.isReadOnly ? 'false' : 'true', editable);\n // Bind the contenteditable property to element#isReadOnly.\n editable.on('change:isReadOnly', (evt, property, is) => {\n writer.setAttribute('contenteditable', is ? 'false' : 'true', editable);\n });\n editable.on('change:isFocused', (evt, property, is) => {\n if (is) {\n writer.addClass('ck-editor__nested-editable_focused', editable);\n }\n else {\n writer.removeClass('ck-editor__nested-editable_focused', editable);\n }\n });\n setHighlightHandling(editable, writer);\n return editable;\n}\n/**\n * Returns a model range which is optimal (in terms of UX) for inserting a widget block.\n *\n * For instance, if a selection is in the middle of a paragraph, the collapsed range before this paragraph\n * will be returned so that it is not split. If the selection is at the end of a paragraph,\n * the collapsed range after this paragraph will be returned.\n *\n * Note: If the selection is placed in an empty block, the range in that block will be returned. If that range\n * is then passed to {@link module:engine/model/model~Model#insertContent}, the block will be fully replaced\n * by the inserted widget block.\n *\n * @param selection The selection based on which the insertion position should be calculated.\n * @param model Model instance.\n * @returns The optimal range.\n */\nexport function findOptimalInsertionRange(selection, model) {\n const selectedElement = selection.getSelectedElement();\n if (selectedElement) {\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(selection);\n // If the WidgetTypeAround \"fake caret\" is displayed, use its position for the insertion\n // to provide the most predictable UX (https://github.com/ckeditor/ckeditor5/issues/7438).\n if (typeAroundFakeCaretPosition) {\n return model.createRange(model.createPositionAt(selectedElement, typeAroundFakeCaretPosition));\n }\n }\n return model.schema.findOptimalInsertionRange(selection);\n}\n/**\n * A util to be used in order to map view positions to correct model positions when implementing a widget\n * which renders non-empty view element for an empty model element.\n *\n * For example:\n *\n * ```\n * // Model:\n * <placeholder type=\"name\"></placeholder>\n *\n * // View:\n * <span class=\"placeholder\">name</span>\n * ```\n *\n * In such case, view positions inside `<span>` cannot be correctly mapped to the model (because the model element is empty).\n * To handle mapping positions inside `<span class=\"placeholder\">` to the model use this util as follows:\n *\n * ```ts\n * editor.editing.mapper.on(\n * \t'viewToModelPosition',\n * \tviewToModelPositionOutsideModelElement( model, viewElement => viewElement.hasClass( 'placeholder' ) )\n * );\n * ```\n *\n * The callback will try to map the view offset of selection to an expected model position.\n *\n * 1. When the position is at the end (or in the middle) of the inline widget:\n *\n * ```\n * // View:\n * <p>foo <span class=\"placeholder\">name|</span> bar</p>\n *\n * // Model:\n * <paragraph>foo <placeholder type=\"name\"></placeholder>| bar</paragraph>\n * ```\n *\n * 2. When the position is at the beginning of the inline widget:\n *\n * ```\n * // View:\n * <p>foo <span class=\"placeholder\">|name</span> bar</p>\n *\n * // Model:\n * <paragraph>foo |<placeholder type=\"name\"></placeholder> bar</paragraph>\n * ```\n *\n * @param model Model instance on which the callback operates.\n * @param viewElementMatcher Function that is passed a view element and should return `true` if the custom mapping\n * should be applied to the given view element.\n */\nexport function viewToModelPositionOutsideModelElement(model, viewElementMatcher) {\n return (evt, data) => {\n const { mapper, viewPosition } = data;\n const viewParent = mapper.findMappedViewAncestor(viewPosition);\n if (!viewElementMatcher(viewParent)) {\n return;\n }\n const modelParent = mapper.toModelElement(viewParent);\n data.modelPosition = model.createPositionAt(modelParent, viewPosition.isAtStart ? 'before' : 'after');\n };\n}\n/**\n * Default filler offset function applied to all widget elements.\n */\nfunction getFillerOffset() {\n return null;\n}\n/**\n * Adds a drag handle to the widget.\n */\nfunction addSelectionHandle(widgetElement, writer) {\n const selectionHandle = writer.createUIElement('div', { class: 'ck ck-widget__selection-handle' }, function (domDocument) {\n const domElement = this.toDomElement(domDocument);\n // Use the IconView from the ui library.\n const icon = new IconView();\n icon.set('content', dragHandleIcon);\n // Render the icon view right away to append its #element to the selectionHandle DOM element.\n icon.render();\n domElement.appendChild(icon.element);\n return domElement;\n });\n // Append the selection handle into the widget wrapper.\n writer.insert(writer.createPositionAt(widgetElement, 0), selectionHandle);\n writer.addClass(['ck-widget_with-selection-handle'], widgetElement);\n}\n/**\n * Starting from a DOM resize host element (an element that receives dimensions as a result of resizing),\n * this helper returns the width of the found ancestor element.\n *\n *\t* It searches up to 5 levels of ancestors only.\n *\n * @param domResizeHost Resize host DOM element that receives dimensions as a result of resizing.\n * @returns Width of ancestor element in pixels or 0 if no ancestor with a computed width has been found.\n */\nexport function calculateResizeHostAncestorWidth(domResizeHost) {\n const getElementComputedWidth = (element) => {\n const { width, paddingLeft, paddingRight } = element.ownerDocument.defaultView.getComputedStyle(element);\n return parseFloat(width) - (parseFloat(paddingLeft) || 0) - (parseFloat(paddingRight) || 0);\n };\n const domResizeHostParent = domResizeHost.parentElement;\n if (!domResizeHostParent) {\n return 0;\n }\n // Need to use computed style as it properly excludes parent's paddings from the returned value.\n let parentWidth = getElementComputedWidth(domResizeHostParent);\n // Sometimes parent width cannot be accessed. If that happens we should go up in the elements tree\n // and try to get width from next ancestor.\n // https://github.com/ckeditor/ckeditor5/issues/10776\n const ancestorLevelLimit = 5;\n let currentLevel = 0;\n let checkedElement = domResizeHostParent;\n while (isNaN(parentWidth)) {\n checkedElement = checkedElement.parentElement;\n if (++currentLevel > ancestorLevelLimit) {\n return 0;\n }\n parentWidth = getElementComputedWidth(checkedElement);\n }\n return parentWidth;\n}\n/**\n * Calculates a relative width of a `domResizeHost` compared to its ancestor in percents.\n *\n * @param domResizeHost Resize host DOM element.\n * @returns Percentage value between 0 and 100.\n */\nexport function calculateResizeHostPercentageWidth(domResizeHost, resizeHostRect = new Rect(domResizeHost)) {\n const parentWidth = calculateResizeHostAncestorWidth(domResizeHost);\n if (!parentWidth) {\n return 0;\n }\n return resizeHostRect.width / parentWidth * 100;\n}\n","import { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n\nimport { toWidget } from '@ckeditor/ckeditor5-widget/src/utils';\n\nexport default class OPMacroTocPlugin extends Plugin {\n\n\tstatic get pluginName() {\n\t\treturn 'OPMacroToc';\n\t}\n\n\tstatic get buttonName() {\n\t\treturn 'insertToc';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\t\tconst conversion = editor.conversion;\n\n\t\t// Schema.\n\t\tmodel.schema.register( 'op-macro-toc', {\n\t\t\tallowWhere: '$block',\n\t\t\tisBlock: true,\n\t\t isLimit: true\n\t\t});\n\n\t\tconversion.for( 'upcast' )\n\t\t\t.elementToElement( {\n\t\t\t\tview: {\n\t\t\t\t\tname: 'macro',\n\t\t\t\t\tclasses: 'toc'\n\t\t\t\t},\n\t\t\t\tmodel: 'op-macro-toc'\n\t\t\t} );\n\n\n\t\tconversion.for( 'editingDowncast' ).elementToElement( {\n\t\t\tmodel: 'op-macro-toc',\n\t\t\tview: (modelElement, {writer: viewWriter}) => {\n\t\t\t\treturn toWidget(this.createTocViewElement(viewWriter), viewWriter, { label: this.label } )\n\t\t\t}\n\t } );\n\n\t\tconversion.for('dataDowncast').elementToElement({\n\t\t\tmodel: 'op-macro-toc',\n\t\t\tview: (modelElement, {writer: viewWriter}) => {\n\t\t\t\treturn this.createTocDataElement(viewWriter)\n\t\t\t}\n\t\t});\n\n\t\teditor.ui.componentFactory.add( OPMacroTocPlugin.buttonName, locale => {\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: this.label,\n\t\t\t\twithText: true,\n\t\t\t} );\n\n\t\t\t// Callback executed once the image is clicked.\n\t\t\tview.on( 'execute', () => {\n\t\t\t\teditor.model.change( writer => {\n\t\t\t\t\tconst tocElement = writer.createElement( 'op-macro-toc', {});\n\n\t\t\t\t\t// Insert the image in the current selection location.\n\t\t\t\t\teditor.model.insertContent( tocElement, editor.model.document.selection );\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\t}\n\n\tget label() {\n\t\treturn window.I18n.t('js.editor.macro.toc');\n\t}\n\n\tcreateTocViewElement(writer) {\n\t\tconst placeholder = writer.createText( this.label );\n\t\tconst container = writer.createContainerElement( 'div');\n\n\t\twriter.insert( writer.createPositionAt( container, 0 ), placeholder );\n\t\treturn container;\n\t}\n\n\tcreateTocDataElement(writer) {\n\t\treturn writer.createContainerElement('macro', { class: 'toc' } );\n\t}\n\n}\n","const embeddedTableSymbol = Symbol( 'isOPEmbeddedTable' );\nimport {toWidget, isWidget} from '@ckeditor/ckeditor5-widget/src/utils';\n\nexport function toEmbeddedTableWidget( viewElement, writer, label ) {\n\twriter.setCustomProperty( embeddedTableSymbol, true, viewElement );\n\treturn toWidget( viewElement, writer, { label: 'your label here' } );\n}\n\n\nexport function isEmbeddedTableWidget( viewElement ) {\n\treturn !!viewElement.getCustomProperty( embeddedTableSymbol ) && isWidget( viewElement );\n}\n\n\nexport function isEmbeddedTableWidgetSelected( selection ) {\n\tconst viewElement = selection.getSelectedElement();\n\n\treturn !!( viewElement && isEmbeddedTableWidget( viewElement ) );\n}\n","export function getOP(editor) {\n\treturn _.get(editor.config, '_config.openProject');\n}\n\nexport function getOPResource(editor) {\n\treturn _.get(editor.config, '_config.openProject.context.resource');\n}\n\nexport function getOPFieldName(editor) {\n\treturn _.get(editor.config, '_config.openProject.context.field');\n}\n\nexport function getOPPreviewContext(editor) {\n\treturn _.get(editor.config, '_config.openProject.context.previewContext');\n}\n\nexport function getPluginContext(editor) {\n\treturn _.get(editor.config, '_config.openProject.pluginContext');\n}\n\nexport function getOPService(editor, name) {\n\treturn getPluginContext(editor).services[name];\n}\n\nexport function getOPHelper(editor, name) {\n\treturn getPluginContext(editor).helpers[name];\n}\n\nexport function getOPPath(editor) {\n\treturn getOPService(editor,'pathHelperService');\n}\n\nexport function getOPI18n(editor) {\n\treturn getOPService(editor,'i18n');\n}\n","import { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n\nimport {toEmbeddedTableWidget} from './utils';\nimport { ViewPosition } from '@ckeditor/ckeditor5-engine';\nimport {getPluginContext} from '../op-context/op-context';\n\nexport default class EmbeddedTableEditing extends Plugin {\n\n\tstatic get pluginName() {\n\t\treturn 'EmbeddedTableEditing';\n\t}\n\n\tstatic get buttonName() {\n\t\treturn 'insertEmbeddedTable';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\t\tconst conversion = editor.conversion;\n\t\tconst pluginContext = getPluginContext(editor);\n\n\t\tthis.text = {\n\t\t\tbutton: window.I18n.t('js.editor.macro.embedded_table.button'),\n\t\t\tmacro_text: window.I18n.t('js.editor.macro.embedded_table.text'),\n\t\t};\n\n\t\t// Schema.\n\t\tmodel.schema.register( 'op-macro-embedded-table', {\n\t\t\tallowWhere: '$block',\n\t\t\tallowAttributes: ['opEmbeddedTableQuery'],\n\t\t\tisBlock: true,\n\t\t\tisObject: true\n\t\t});\n\n\t\tconversion.for( 'upcast' )\n\t\t\t.elementToElement( {\n\t\t\t\tview: {\n\t\t\t\t\tname: 'macro',\n\t\t\t\t\tclasses: 'embedded-table',\n\t\t\t\t},\n\t\t\t\tmodel: ( viewElement, {writer:modelWriter} ) => {\n\t\t\t\t\tconst queryProps = viewElement.getAttribute( 'data-query-props' );\n\t\t\t\t\treturn modelWriter.createElement(\n\t\t\t\t\t\t'op-macro-embedded-table',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\topEmbeddedTableQuery: queryProps ? JSON.parse(queryProps) : {}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\n\t\tconversion.for( 'editingDowncast' ).elementToElement( {\n\t\t\tmodel: 'op-macro-embedded-table',\n\t\t\tview: (modelElement, {writer:viewWriter}) => {\n\t\t\t\treturn toEmbeddedTableWidget(this.createEmbeddedTableView(viewWriter), viewWriter, { label: this.label } )\n\t\t\t}\n\t } );\n\n\t\tconversion.for('dataDowncast').elementToElement({\n\t\t\tmodel: 'op-macro-embedded-table',\n\t\t\tview: (modelElement, {writer:viewWriter}) => {\n\t\t\t\treturn this.createEmbeddedTableDataElement(modelElement, viewWriter)\n\t\t\t}\n\t\t});\n\n\t\teditor.ui.componentFactory.add( EmbeddedTableEditing.buttonName, locale => {\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: this.text.button,\n\t\t\t\twithText: true\n\t\t\t} );\n\n\t\t\t// Callback executed once the widget is clicked.\n\t\t\tview.on( 'execute', () => pluginContext.runInZone(() => {\n\t\t\t\tconst externalQueryConfiguration = pluginContext.services.externalQueryConfiguration;\n\t\t\t\tconst currentQuery = {}; // Initial query currently empty, we may want to provide context here.\n\n\t\t\t\texternalQueryConfiguration.show({\n\t\t\t\t\tcurrentQuery: currentQuery,\n\t\t\t\t\tcallback: (newQuery) => editor.model.change(writer => {\n\t\t\t\t\t\tconst element = writer.createElement('op-macro-embedded-table', {opEmbeddedTableQuery: newQuery});\n\n\t\t\t\t\t\t// Insert the widget in the current selection location.\n\t\t\t\t\t\teditor.model.insertContent(element, editor.model.document.selection);\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t} ) );\n\n\t\t\treturn view;\n\t\t} );\n\t}\n\n\tcreateEmbeddedTableView(writer) {\n\t\tconst placeholder = writer.createText( this.text.macro_text );\n\t\tconst container = writer.createContainerElement( 'div' );\n\n\t\twriter.insert( writer.createPositionAt( container, 0 ), placeholder );\n\t\treturn container;\n\n\t\t// The following doesnt work when removing the widget...\n\t\t// let that = this;\n\t\t// return writer.createUIElement( 'div', { class: 'macro -embedded-table' }, function(containerDocument) {\n\t\t// \tconst containerElement = this.toDomElement(containerDocument);\n\t\t// \tcontainerElement.innerHTML = imageIcon + '<div class=\"macro--description\">' + that.text.macro_text + '</div>';\n\n\t\t// \treturn containerElement;\n\t\t// } );\n\t}\n\n\tcreateEmbeddedTableDataElement(modelElement, writer) {\n\t\tconst queryProps = modelElement.getAttribute('opEmbeddedTableQuery') || {};\n\t\tconst element = writer.createContainerElement(\n\t\t\t'macro',\n\t\t\t{\n\t\t\t\t'class': 'embedded-table',\n\t\t\t\t'data-query-props': JSON.stringify(queryProps)\n\t\t\t}\n\t\t);\n\n\t\treturn element;\n\t}\n\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Change buffer allows to group atomic changes (like characters that have been typed) into\n * {@link module:engine/model/batch~Batch batches}.\n *\n * Batches represent single undo steps, hence changes added to one single batch are undone together.\n *\n * The buffer has a configurable limit of atomic changes that it can accommodate. After the limit was\n * exceeded (see {@link ~ChangeBuffer#input}), a new batch is created in {@link ~ChangeBuffer#batch}.\n *\n * To use the change buffer you need to let it know about the number of changes that were added to the batch:\n *\n * ```ts\n * const buffer = new ChangeBuffer( model, LIMIT );\n *\n * // Later on in your feature:\n * buffer.batch.insert( pos, insertedCharacters );\n * buffer.input( insertedCharacters.length );\n * ```\n */\nexport default class ChangeBuffer {\n /**\n * Creates a new instance of the change buffer.\n *\n * @param limit The maximum number of atomic changes which can be contained in one batch.\n */\n constructor(model, limit = 20) {\n /**\n * The current batch instance.\n */\n this._batch = null;\n this.model = model;\n this._size = 0;\n this.limit = limit;\n this._isLocked = false;\n // The function to be called in order to notify the buffer about batches which appeared in the document.\n // The callback will check whether it is a new batch and in that case the buffer will be flushed.\n //\n // The reason why the buffer needs to be flushed whenever a new batch appears is that the changes added afterwards\n // should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,\n // the characters typed after inserting the image should be added to a different batch than the characters typed before.\n this._changeCallback = (evt, batch) => {\n if (batch.isLocal && batch.isUndoable && batch !== this._batch) {\n this._reset(true);\n }\n };\n this._selectionChangeCallback = () => {\n this._reset();\n };\n this.model.document.on('change', this._changeCallback);\n this.model.document.selection.on('change:range', this._selectionChangeCallback);\n this.model.document.selection.on('change:attribute', this._selectionChangeCallback);\n }\n /**\n * The current batch to which a feature should add its operations. Once the {@link #size}\n * is reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.\n */\n get batch() {\n if (!this._batch) {\n this._batch = this.model.createBatch({ isTyping: true });\n }\n return this._batch;\n }\n /**\n * The number of atomic changes in the buffer. Once it exceeds the {@link #limit},\n * the {@link #batch batch} is set to a new one.\n */\n get size() {\n return this._size;\n }\n /**\n * The input number of changes into the buffer. Once the {@link #size} is\n * reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.\n *\n * @param changeCount The number of atomic changes to input.\n */\n input(changeCount) {\n this._size += changeCount;\n if (this._size >= this.limit) {\n this._reset(true);\n }\n }\n /**\n * Whether the buffer is locked. A locked buffer cannot be reset unless it gets unlocked.\n */\n get isLocked() {\n return this._isLocked;\n }\n /**\n * Locks the buffer.\n */\n lock() {\n this._isLocked = true;\n }\n /**\n * Unlocks the buffer.\n */\n unlock() {\n this._isLocked = false;\n }\n /**\n * Destroys the buffer.\n */\n destroy() {\n this.model.document.off('change', this._changeCallback);\n this.model.document.selection.off('change:range', this._selectionChangeCallback);\n this.model.document.selection.off('change:attribute', this._selectionChangeCallback);\n }\n /**\n * Resets the change buffer.\n *\n * @param ignoreLock Whether internal lock {@link #isLocked} should be ignored.\n */\n _reset(ignoreLock = false) {\n if (!this.isLocked || ignoreLock) {\n this._batch = null;\n this._size = 0;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/inserttextcommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport ChangeBuffer from './utils/changebuffer.js';\n/**\n * The insert text command. Used by the {@link module:typing/input~Input input feature} to handle typing.\n */\nexport default class InsertTextCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param undoStepSize The maximum number of atomic changes\n * which can be contained in one batch in the command buffer.\n */\n constructor(editor, undoStepSize) {\n super(editor);\n this._buffer = new ChangeBuffer(editor.model, undoStepSize);\n // Since this command may execute on different selectable than selection, it should be checked directly in execute block.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * The current change buffer.\n */\n get buffer() {\n return this._buffer;\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._buffer.destroy();\n }\n /**\n * Executes the input command. It replaces the content within the given range with the given text.\n * Replacing is a two step process, first the content within the range is removed and then the new text is inserted\n * at the beginning of the range (which after the removal is a collapsed range).\n *\n * @fires execute\n * @param options The command options.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const doc = model.document;\n const text = options.text || '';\n const textInsertions = text.length;\n let selection = doc.selection;\n if (options.selection) {\n selection = options.selection;\n }\n else if (options.range) {\n selection = model.createSelection(options.range);\n }\n // Stop executing if selectable is in non-editable place.\n if (!model.canEditAt(selection)) {\n return;\n }\n const resultRange = options.resultRange;\n model.enqueueChange(this._buffer.batch, writer => {\n this._buffer.lock();\n // Store selection attributes before deleting old content to preserve formatting and link.\n // This unifies the behavior between DocumentSelection and Selection provided as input option.\n const selectionAttributes = Array.from(doc.selection.getAttributes());\n model.deleteContent(selection);\n if (text) {\n model.insertContent(writer.createText(text, selectionAttributes), selection);\n }\n if (resultRange) {\n writer.setSelection(resultRange);\n }\n else if (!selection.is('documentSelection')) {\n writer.setSelection(selection);\n }\n this._buffer.unlock();\n this._buffer.input(textInsertions);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/inserttextobserver\n */\nimport { env, EventInfo } from '@ckeditor/ckeditor5-utils';\nimport { DomEventData, Observer, FocusObserver } from '@ckeditor/ckeditor5-engine';\nconst TYPING_INPUT_TYPES = [\n // For collapsed range:\n //\t- This one is a regular typing (all browsers, all systems).\n //\t- This one is used by Chrome when typing accented letter – 2nd step when the user selects the accent (Mac).\n // For non-collapsed range:\n //\t- This one is used by Chrome when typing accented letter – when the selection box first appears (Mac).\n //\t- This one is used by Safari when accepting spell check suggestions from the context menu (Mac).\n 'insertText',\n // This one is used by Safari when typing accented letter (Mac).\n // This one is used by Safari when accepting spell check suggestions from the autocorrection pop-up (Mac).\n 'insertReplacementText'\n];\nconst TYPING_INPUT_TYPES_ANDROID = [\n ...TYPING_INPUT_TYPES,\n 'insertCompositionText'\n];\n/**\n * Text insertion observer introduces the {@link module:engine/view/document~Document#event:insertText} event.\n */\nexport default class InsertTextObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n this.focusObserver = view.getObserver(FocusObserver);\n // On Android composition events should immediately be applied to the model. Rendering is not disabled.\n // On non-Android the model is updated only on composition end.\n // On Android we can't rely on composition start/end to update model.\n const typingInputTypes = env.isAndroid ? TYPING_INPUT_TYPES_ANDROID : TYPING_INPUT_TYPES;\n const viewDocument = view.document;\n viewDocument.on('beforeinput', (evt, data) => {\n if (!this.isEnabled) {\n return;\n }\n const { data: text, targetRanges, inputType, domEvent } = data;\n if (!typingInputTypes.includes(inputType)) {\n return;\n }\n // Mark the latest focus change as complete (we are typing in editable after the focus\n // so the selection is in the focused element).\n this.focusObserver.flush();\n const eventInfo = new EventInfo(viewDocument, 'insertText');\n viewDocument.fire(eventInfo, new DomEventData(view, domEvent, {\n text,\n selection: view.createSelection(targetRanges)\n }));\n // Stop the beforeinput event if `delete` event was stopped.\n // https://github.com/ckeditor/ckeditor5/issues/753\n if (eventInfo.stop.called) {\n evt.stop();\n }\n });\n // On Android composition events are immediately applied to the model.\n // On non-Android the model is updated only on composition end.\n // On Android we can't rely on composition start/end to update model.\n if (!env.isAndroid) {\n // Note: The priority must be lower than the CompositionObserver handler to call it after the renderer is unblocked.\n // This is important for view to DOM position mapping.\n // This causes the effect of first remove composed DOM and then reapply it after model modification.\n viewDocument.on('compositionend', (evt, { data, domEvent }) => {\n if (!this.isEnabled) {\n return;\n }\n // In case of aborted composition.\n if (!data) {\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( `%c[InsertTextObserver]%c Fire insertText event, %c${ JSON.stringify( data ) }`,\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-weight: bold', 'color: blue'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // How do we know where to insert the composed text?\n // 1. The SelectionObserver is blocked and the view is not updated with the composition changes.\n // 2. The last moment before it's locked is the `compositionstart` event.\n // 3. The `SelectionObserver` is listening for `compositionstart` event and immediately converts\n // the selection. Handles this at the lowest priority so after the rendering is blocked.\n viewDocument.fire('insertText', new DomEventData(view, domEvent, {\n text: data\n }));\n }, { priority: 'lowest' });\n }\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/input\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { env } from '@ckeditor/ckeditor5-utils';\nimport InsertTextCommand from './inserttextcommand.js';\nimport InsertTextObserver from './inserttextobserver.js';\nimport { LiveRange } from '@ckeditor/ckeditor5-engine';\nimport { debounce } from 'lodash-es';\n/**\n * Handles text input coming from the keyboard or other input methods.\n */\nexport default class Input extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Input';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const mapper = editor.editing.mapper;\n const modelSelection = model.document.selection;\n this._compositionQueue = new CompositionQueue(editor);\n view.addObserver(InsertTextObserver);\n // TODO The above default configuration value should be defined using editor.config.define() once it's fixed.\n const insertTextCommand = new InsertTextCommand(editor, editor.config.get('typing.undoStep') || 20);\n // Register `insertText` command and add `input` command as an alias for backward compatibility.\n editor.commands.add('insertText', insertTextCommand);\n editor.commands.add('input', insertTextCommand);\n this.listenTo(view.document, 'insertText', (evt, data) => {\n // Rendering is disabled while composing so prevent events that will be rendered by the engine\n // and should not be applied by the browser.\n if (!view.document.isComposing) {\n data.preventDefault();\n }\n // Flush queue on the next beforeinput event because it could happen\n // that the mutation observer does not notice the DOM change in time.\n if (env.isAndroid && view.document.isComposing) {\n this._compositionQueue.flush('next beforeinput');\n }\n const { text, selection: viewSelection } = data;\n let modelRanges;\n // If view selection was specified, translate it to model selection.\n if (viewSelection) {\n modelRanges = Array.from(viewSelection.getRanges()).map(viewRange => mapper.toModelRange(viewRange));\n }\n else {\n modelRanges = Array.from(modelSelection.getRanges());\n }\n let insertText = text;\n // Typing in English on Android is firing composition events for the whole typed word.\n // We need to check the target range text to only apply the difference.\n if (env.isAndroid) {\n const selectedText = Array.from(modelRanges[0].getItems()).reduce((rangeText, node) => {\n return rangeText + (node.is('$textProxy') ? node.data : '');\n }, '');\n if (selectedText) {\n if (selectedText.length <= insertText.length) {\n if (insertText.startsWith(selectedText)) {\n insertText = insertText.substring(selectedText.length);\n modelRanges[0].start = modelRanges[0].start.getShiftedBy(selectedText.length);\n }\n }\n else {\n if (selectedText.startsWith(insertText)) {\n // TODO this should be mapped as delete?\n modelRanges[0].start = modelRanges[0].start.getShiftedBy(insertText.length);\n insertText = '';\n }\n }\n }\n if (insertText.length == 0 && modelRanges[0].isCollapsed) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[Input]%c Ignore insertion of an empty data to the collapsed range.',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-style: italic'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n return;\n }\n }\n const commandData = {\n text: insertText,\n selection: model.createSelection(modelRanges)\n };\n // This is a composition event and those are not cancellable, so we need to wait until browser updates the DOM\n // and we could apply changes to the model and verify if the DOM is valid.\n // The browser applies changes to the DOM not immediately on beforeinput event.\n // We just wait for mutation observer to notice changes or as a fallback a timeout.\n if (env.isAndroid && view.document.isComposing) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( `%c[Input]%c Queue insertText:%c \"${ commandData.text }\"%c ` +\n // @if CK_DEBUG_TYPING // \t\t`[${ commandData.selection.getFirstPosition().path }]-` +\n // @if CK_DEBUG_TYPING // \t\t`[${ commandData.selection.getLastPosition().path }]` +\n // @if CK_DEBUG_TYPING // \t\t` queue size: ${ this._compositionQueue.length + 1 }`,\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-weight: bold', 'color: blue', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n this._compositionQueue.push(commandData);\n }\n else {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( `%c[Input]%c Execute insertText:%c \"${ commandData.text }\"%c ` +\n // @if CK_DEBUG_TYPING // \t\t`[${ commandData.selection.getFirstPosition().path }]-` +\n // @if CK_DEBUG_TYPING // \t\t`[${ commandData.selection.getLastPosition().path }]`,\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-weight: bold', 'color: blue', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n editor.execute('insertText', commandData);\n view.scrollToTheSelection();\n }\n });\n // Delete selected content on composition start.\n if (env.isAndroid) {\n // On Android with English keyboard, the composition starts just by putting caret\n // at the word end or by selecting a table column. This is not a real composition started.\n // Trigger delete content on first composition key pressed.\n this.listenTo(view.document, 'keydown', (evt, data) => {\n if (modelSelection.isCollapsed || data.keyCode != 229 || !view.document.isComposing) {\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconst firstPositionPath = modelSelection.getFirstPosition()!.path;\n // @if CK_DEBUG_TYPING // \tconst lastPositionPath = modelSelection.getLastPosition()!.path;\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[Input]%c KeyDown 229%c -> model.deleteContent() ' +\n // @if CK_DEBUG_TYPING // \t\t`[${ firstPositionPath }]-[${ lastPositionPath }]`,\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-weight: bold', '',\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n deleteSelectionContent(model, insertTextCommand);\n });\n }\n else {\n // Note: The priority must precede the CompositionObserver handler to call it before\n // the renderer is blocked, because we want to render this change.\n this.listenTo(view.document, 'compositionstart', () => {\n if (modelSelection.isCollapsed) {\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconst firstPositionPath = modelSelection.getFirstPosition()!.path;\n // @if CK_DEBUG_TYPING // \tconst lastPositionPath = modelSelection.getLastPosition()!.path;\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[Input]%c Composition start%c -> model.deleteContent() ' +\n // @if CK_DEBUG_TYPING // \t\t`[${ firstPositionPath }]-[${ lastPositionPath }]`,\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-weight: bold', '',\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n deleteSelectionContent(model, insertTextCommand);\n });\n }\n // Apply composed changes to the model.\n if (env.isAndroid) {\n // Apply changes to the model as they are applied to the DOM by the browser.\n // On beforeinput event, the DOM is not yet modified. We wait for detected mutations to apply model changes.\n this.listenTo(view.document, 'mutations', (evt, { mutations }) => {\n if (!view.document.isComposing) {\n return;\n }\n // Check if mutations are relevant for queued changes.\n for (const { node } of mutations) {\n const viewElement = findMappedViewAncestor(node, mapper);\n const modelElement = mapper.toModelElement(viewElement);\n if (this._compositionQueue.isComposedElement(modelElement)) {\n this._compositionQueue.flush('mutations');\n return;\n }\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[Input]%c Mutations not related to the composition.',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-style: italic'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n });\n // Make sure that all changes are applied to the model before the end of composition.\n this.listenTo(view.document, 'compositionend', () => {\n this._compositionQueue.flush('composition end');\n });\n // Trigger mutations check after the composition completes to fix all DOM changes that got ignored during composition.\n // On Android the Renderer is not disabled while composing. While updating DOM nodes we ignore some changes\n // that are not that important (like NBSP vs plain space character) and could break the composition flow.\n // After composition is completed we trigger additional `mutations` event for elements affected by the composition\n // so the Renderer can adjust the DOM to the expected structure without breaking the composition.\n this.listenTo(view.document, 'compositionend', () => {\n const mutations = [];\n for (const element of this._compositionQueue.flushComposedElements()) {\n const viewElement = mapper.toViewElement(element);\n if (!viewElement) {\n continue;\n }\n mutations.push({ type: 'children', node: viewElement });\n }\n if (mutations.length) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Input]%c Fire post-composition mutation fixes.',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green', 'font-weight: bold', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n view.document.fire('mutations', { mutations });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n }, { priority: 'lowest' });\n }\n else {\n // After composition end we need to verify if there are no left-overs.\n // Listening at the lowest priority so after the `InsertTextObserver` added above (all composed text\n // should already be applied to the model, view, and DOM).\n // On non-Android the `Renderer` is blocked while user is composing but the `MutationObserver` still collects\n // mutated nodes and fires `mutations` events.\n // Those events are recorded by the `Renderer` but not applied to the DOM while composing.\n // We need to trigger those checks (and fixes) once again but this time without specifying the exact mutations\n // since they are already recorded by the `Renderer`.\n // It in the most cases just clears the internal record of mutated text nodes\n // since all changes should already be applied to the DOM.\n // This is especially needed when user cancels composition, so we can clear nodes marked to sync.\n this.listenTo(view.document, 'compositionend', () => {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Input]%c Force render after composition end.',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green', 'font-weight: bold', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n view.document.fire('mutations', { mutations: [] });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }, { priority: 'lowest' });\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._compositionQueue.destroy();\n }\n}\n/**\n * The queue of `insertText` command executions that are waiting for the DOM to get updated after beforeinput event.\n */\nclass CompositionQueue {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n /**\n * Debounced queue flush as a safety mechanism for cases of mutation observer not triggering.\n */\n this.flushDebounced = debounce(() => this.flush('timeout'), 50);\n /**\n * The queue of `insertText` command executions that are waiting for the DOM to get updated after beforeinput event.\n */\n this._queue = [];\n /**\n * A set of model elements. The composition happened in those elements. It's used for mutations check.\n */\n this._compositionElements = new Set();\n this.editor = editor;\n }\n /**\n * Destroys the helper object.\n */\n destroy() {\n this.flushDebounced.cancel();\n this._compositionElements.clear();\n while (this._queue.length) {\n this.shift();\n }\n }\n /**\n * Returns the size of the queue.\n */\n get length() {\n return this._queue.length;\n }\n /**\n * Push next insertText command data to the queue.\n */\n push(commandData) {\n const commandLiveData = {\n text: commandData.text\n };\n if (commandData.selection) {\n commandLiveData.selectionRanges = [];\n for (const range of commandData.selection.getRanges()) {\n commandLiveData.selectionRanges.push(LiveRange.fromRange(range));\n // Keep reference to the model element for later mutation checks.\n this._compositionElements.add(range.start.parent);\n }\n }\n this._queue.push(commandLiveData);\n this.flushDebounced();\n }\n /**\n * Shift the first item from the insertText command data queue.\n */\n shift() {\n const commandLiveData = this._queue.shift();\n const commandData = {\n text: commandLiveData.text\n };\n if (commandLiveData.selectionRanges) {\n const ranges = commandLiveData.selectionRanges\n .map(liveRange => detachLiveRange(liveRange))\n .filter((range) => !!range);\n if (ranges.length) {\n commandData.selection = this.editor.model.createSelection(ranges);\n }\n }\n return commandData;\n }\n /**\n * Applies all queued insertText command executions.\n *\n * @param reason Used only for debugging.\n */\n flush(reason) {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n this.flushDebounced.cancel();\n if (!this._queue.length) {\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( `%c[Input]%c Flush insertText queue on ${ reason }.`,\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-weight: bold'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n const insertTextCommand = editor.commands.get('insertText');\n const buffer = insertTextCommand.buffer;\n model.enqueueChange(buffer.batch, () => {\n buffer.lock();\n while (this._queue.length) {\n const commandData = this.shift();\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[Input]%c Execute queued insertText:%c ' +\n // @if CK_DEBUG_TYPING // \t\t`\"${ commandData.text }\"%c ` +\n // @if CK_DEBUG_TYPING // \t\t`[${ commandData.selection.getFirstPosition().path }]-` +\n // @if CK_DEBUG_TYPING // \t\t`[${ commandData.selection.getLastPosition().path }]`,\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', 'font-weight: bold', 'color: blue', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n editor.execute('insertText', commandData);\n }\n buffer.unlock();\n });\n view.scrollToTheSelection();\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n /**\n * Returns `true` if the given model element is related to recent composition.\n */\n isComposedElement(element) {\n return this._compositionElements.has(element);\n }\n /**\n * Returns an array of composition-related elements and clears the internal list.\n */\n flushComposedElements() {\n const result = Array.from(this._compositionElements);\n this._compositionElements.clear();\n return result;\n }\n}\n/**\n * Deletes the content selected by the document selection at the start of composition.\n */\nfunction deleteSelectionContent(model, insertTextCommand) {\n // By relying on the state of the input command we allow disabling the entire input easily\n // by just disabling the input command. We could’ve used here the delete command but that\n // would mean requiring the delete feature which would block loading one without the other.\n // We could also check the editor.isReadOnly property, but that wouldn't allow to block\n // the input without blocking other features.\n if (!insertTextCommand.isEnabled) {\n return;\n }\n const buffer = insertTextCommand.buffer;\n buffer.lock();\n model.enqueueChange(buffer.batch, () => {\n model.deleteContent(model.document.selection);\n });\n buffer.unlock();\n}\n/**\n * Detaches a LiveRange and returns the static range from it.\n */\nfunction detachLiveRange(liveRange) {\n const range = liveRange.toRange();\n liveRange.detach();\n if (range.root.rootName == '$graveyard') {\n return null;\n }\n return range;\n}\n/**\n * For the given `viewNode`, finds and returns the closest ancestor of this node that has a mapping to the model.\n */\nfunction findMappedViewAncestor(viewNode, mapper) {\n let node = (viewNode.is('$text') ? viewNode.parent : viewNode);\n while (!mapper.toModelElement(node)) {\n node = node.parent;\n }\n return node;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/deletecommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { count } from '@ckeditor/ckeditor5-utils';\nimport ChangeBuffer from './utils/changebuffer.js';\n/**\n * The delete command. Used by the {@link module:typing/delete~Delete delete feature} to handle the <kbd>Delete</kbd> and\n * <kbd>Backspace</kbd> keys.\n */\nexport default class DeleteCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param direction The directionality of the delete describing in what direction it\n * should consume the content when the selection is collapsed.\n */\n constructor(editor, direction) {\n super(editor);\n this.direction = direction;\n this._buffer = new ChangeBuffer(editor.model, editor.config.get('typing.undoStep'));\n // Since this command may execute on different selectable than selection, it should be checked directly in execute block.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * The current change buffer.\n */\n get buffer() {\n return this._buffer;\n }\n /**\n * Executes the delete command. Depending on whether the selection is collapsed or not, deletes its content\n * or a piece of content in the {@link #direction defined direction}.\n *\n * @fires execute\n * @param options The command options.\n * @param options.unit See {@link module:engine/model/utils/modifyselection~modifySelection}'s options.\n * @param options.sequence A number describing which subsequent delete event it is without the key being released.\n * See the {@link module:engine/view/document~Document#event:delete} event data.\n * @param options.selection Selection to remove. If not set, current model selection will be used.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const doc = model.document;\n model.enqueueChange(this._buffer.batch, writer => {\n this._buffer.lock();\n const selection = writer.createSelection(options.selection || doc.selection);\n // Don't execute command when selection is in non-editable place.\n if (!model.canEditAt(selection)) {\n return;\n }\n const sequence = options.sequence || 1;\n // Do not replace the whole selected content if selection was collapsed.\n // This prevents such situation:\n //\n // <h1></h1><p>[]</p>\t--> <h1>[</h1><p>]</p> \t\t--> <p></p>\n // starting content\t\t--> after `modifySelection`\t--> after `deleteContent`.\n const doNotResetEntireContent = selection.isCollapsed;\n // Try to extend the selection in the specified direction.\n if (selection.isCollapsed) {\n model.modifySelection(selection, {\n direction: this.direction,\n unit: options.unit,\n treatEmojiAsSingleUnit: true\n });\n }\n // Check if deleting in an empty editor. See #61.\n if (this._shouldEntireContentBeReplacedWithParagraph(sequence)) {\n this._replaceEntireContentWithParagraph(writer);\n return;\n }\n // Check if deleting in the first empty block.\n // See https://github.com/ckeditor/ckeditor5/issues/8137.\n if (this._shouldReplaceFirstBlockWithParagraph(selection, sequence)) {\n this.editor.execute('paragraph', { selection });\n return;\n }\n // If selection is still collapsed, then there's nothing to delete.\n if (selection.isCollapsed) {\n return;\n }\n let changeCount = 0;\n selection.getFirstRange().getMinimalFlatRanges().forEach(range => {\n changeCount += count(range.getWalker({ singleCharacters: true, ignoreElementEnd: true, shallow: true }));\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[DeleteCommand]%c Delete content',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', '',\n // @if CK_DEBUG_TYPING // \t\t`[${ selection.getFirstPosition()!.path }]-[${ selection.getLastPosition()!.path }]`, options\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n model.deleteContent(selection, {\n doNotResetEntireContent,\n direction: this.direction\n });\n this._buffer.input(changeCount);\n writer.setSelection(selection);\n this._buffer.unlock();\n });\n }\n /**\n * If the user keeps <kbd>Backspace</kbd> or <kbd>Delete</kbd> key pressed, the content of the current\n * editable will be cleared. However, this will not yet lead to resetting the remaining block to a paragraph\n * (which happens e.g. when the user does <kbd>Ctrl</kbd> + <kbd>A</kbd>, <kbd>Backspace</kbd>).\n *\n * But, if the user pressed the key in an empty editable for the first time,\n * we want to replace the entire content with a paragraph if:\n *\n * * the current limit element is empty,\n * * the paragraph is allowed in the limit element,\n * * the limit doesn't already have a paragraph inside.\n *\n * See https://github.com/ckeditor/ckeditor5-typing/issues/61.\n *\n * @param sequence A number describing which subsequent delete event it is without the key being released.\n */\n _shouldEntireContentBeReplacedWithParagraph(sequence) {\n // Does nothing if user pressed and held the \"Backspace\" or \"Delete\" key.\n if (sequence > 1) {\n return false;\n }\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const limitElement = model.schema.getLimitElement(selection);\n // If a collapsed selection contains the whole content it means that the content is empty\n // (from the user perspective).\n const limitElementIsEmpty = selection.isCollapsed && selection.containsEntireContent(limitElement);\n if (!limitElementIsEmpty) {\n return false;\n }\n if (!model.schema.checkChild(limitElement, 'paragraph')) {\n return false;\n }\n const limitElementFirstChild = limitElement.getChild(0);\n // Does nothing if the limit element already contains only a paragraph.\n // We ignore the case when paragraph might have some inline elements (<p><inlineWidget>[]</inlineWidget></p>)\n // because we don't support such cases yet and it's unclear whether inlineWidget shouldn't be a limit itself.\n if (limitElementFirstChild && limitElementFirstChild.is('element', 'paragraph')) {\n return false;\n }\n return true;\n }\n /**\n * The entire content is replaced with the paragraph. Selection is moved inside the paragraph.\n *\n * @param writer The model writer.\n */\n _replaceEntireContentWithParagraph(writer) {\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const limitElement = model.schema.getLimitElement(selection);\n const paragraph = writer.createElement('paragraph');\n writer.remove(writer.createRangeIn(limitElement));\n writer.insert(paragraph, limitElement);\n writer.setSelection(paragraph, 0);\n }\n /**\n * Checks if the selection is inside an empty element that is the first child of the limit element\n * and should be replaced with a paragraph.\n *\n * @param selection The selection.\n * @param sequence A number describing which subsequent delete event it is without the key being released.\n */\n _shouldReplaceFirstBlockWithParagraph(selection, sequence) {\n const model = this.editor.model;\n // Does nothing if user pressed and held the \"Backspace\" key or it was a \"Delete\" button.\n if (sequence > 1 || this.direction != 'backward') {\n return false;\n }\n if (!selection.isCollapsed) {\n return false;\n }\n const position = selection.getFirstPosition();\n const limitElement = model.schema.getLimitElement(position);\n const limitElementFirstChild = limitElement.getChild(0);\n // Only elements that are direct children of the limit element can be replaced.\n // Unwrapping from a block quote should be handled in a dedicated feature.\n if (position.parent != limitElementFirstChild) {\n return false;\n }\n // A block should be replaced only if it was empty.\n if (!selection.containsEntireContent(limitElementFirstChild)) {\n return false;\n }\n // Replace with a paragraph only if it's allowed there.\n if (!model.schema.checkChild(limitElement, 'paragraph')) {\n return false;\n }\n // Does nothing if the limit element already contains only a paragraph.\n if (limitElementFirstChild.name == 'paragraph') {\n return false;\n }\n return true;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/deleteobserver\n */\nimport { env, keyCodes, isInsideCombinedSymbol, isInsideEmojiSequence, isInsideSurrogatePair } from '@ckeditor/ckeditor5-utils';\nimport { BubblingEventInfo, DomEventData, Observer } from '@ckeditor/ckeditor5-engine';\nconst DELETE_CHARACTER = 'character';\nconst DELETE_WORD = 'word';\nconst DELETE_CODE_POINT = 'codePoint';\nconst DELETE_SELECTION = 'selection';\nconst DELETE_BACKWARD = 'backward';\nconst DELETE_FORWARD = 'forward';\nconst DELETE_EVENT_TYPES = {\n // --------------------------------------- Backward delete types -----------------------------------------------------\n // This happens in Safari on Mac when some content is selected and Ctrl + K is pressed.\n deleteContent: {\n unit: DELETE_SELECTION,\n // According to the Input Events Level 2 spec, this delete type has no direction\n // but to keep things simple, let's default to backward.\n direction: DELETE_BACKWARD\n },\n // Chrome and Safari on Mac: Backspace or Ctrl + H\n deleteContentBackward: {\n // This kind of deletions must be done on the code point-level instead of target range provided by the DOM beforeinput event.\n // Take for instance \"👨â€ðŸ‘©â€ðŸ‘§â€ðŸ‘§\", it equals:\n //\n //\t* [ \"👨\", \"ZERO WIDTH JOINER\", \"👩\", \"ZERO WIDTH JOINER\", \"👧\", \"ZERO WIDTH JOINER\", \"👧\" ]\n //\t* or simply \"\\u{1F468}\\u200D\\u{1F469}\\u200D\\u{1F467}\\u200D\\u{1F467}\"\n //\n // The range provided by the browser would cause the entire multi-byte grapheme to disappear while the user\n // intention when deleting backwards (\"👨â€ðŸ‘©â€ðŸ‘§â€ðŸ‘§[]\", then backspace) is gradual \"decomposition\" (first to \"👨â€ðŸ‘©â€ðŸ‘§â€[]\",\n // then to \"👨â€ðŸ‘©â€[]\", etc.).\n //\n //\t* \"👨â€ðŸ‘©â€ðŸ‘§â€ðŸ‘§[]\" + backward delete (by code point) -> results in \"👨â€ðŸ‘©â€ðŸ‘§[]\", removed the last \"👧\" ðŸ‘\n //\t* \"👨â€ðŸ‘©â€ðŸ‘§â€ðŸ‘§[]\" + backward delete (by character) -> results in \"[]\", removed the whole grapheme 👎\n //\n // Deleting by code-point is simply a better UX. See \"deleteContentForward\" to learn more.\n unit: DELETE_CODE_POINT,\n direction: DELETE_BACKWARD\n },\n // On Mac: Option + Backspace.\n // On iOS: Hold the backspace for a while and the whole words will start to disappear.\n deleteWordBackward: {\n unit: DELETE_WORD,\n direction: DELETE_BACKWARD\n },\n // Safari on Mac: Cmd + Backspace\n deleteHardLineBackward: {\n unit: DELETE_SELECTION,\n direction: DELETE_BACKWARD\n },\n // Chrome on Mac: Cmd + Backspace.\n deleteSoftLineBackward: {\n unit: DELETE_SELECTION,\n direction: DELETE_BACKWARD\n },\n // --------------------------------------- Forward delete types -----------------------------------------------------\n // Chrome on Mac: Fn + Backspace or Ctrl + D\n // Safari on Mac: Ctrl + K or Ctrl + D\n deleteContentForward: {\n // Unlike backward delete, this delete must be performed by character instead of by code point, which\n // provides the best UX for working with accented letters.\n // Take, for example \"bÌ‚\" (\"\\u0062\\u0302\", or [ \"LATIN SMALL LETTER B\", \"COMBINING CIRCUMFLEX ACCENT\" ]):\n //\n //\t* \"bÌ‚[]\" + backward delete (by code point) -> results in \"b[]\", removed the combining mark ðŸ‘\n //\t* \"[]bÌ‚\" + forward delete (by code point) -> results in \"[]^\", a bare combining mark does that not make sense when alone 👎\n //\t* \"[]bÌ‚\" + forward delete (by character) -> results in \"[]\", removed both \"b\" and the combining mark ðŸ‘\n //\n // See: \"deleteContentBackward\" to learn more.\n unit: DELETE_CHARACTER,\n direction: DELETE_FORWARD\n },\n // On Mac: Fn + Option + Backspace.\n deleteWordForward: {\n unit: DELETE_WORD,\n direction: DELETE_FORWARD\n },\n // Chrome on Mac: Ctrl + K (you have to disable the Link plugin first, though, because it uses the same keystroke)\n // This is weird that it does not work in Safari on Mac despite being listed in the official shortcuts listing\n // on Apple's webpage.\n deleteHardLineForward: {\n unit: DELETE_SELECTION,\n direction: DELETE_FORWARD\n },\n // At this moment there is no known way to trigger this event type but let's keep it for the symmetry with\n // deleteSoftLineBackward.\n deleteSoftLineForward: {\n unit: DELETE_SELECTION,\n direction: DELETE_FORWARD\n }\n};\n/**\n * Delete observer introduces the {@link module:engine/view/document~Document#event:delete} event.\n */\nexport default class DeleteObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n const document = view.document;\n // It matters how many subsequent deletions were made, e.g. when the backspace key was pressed and held\n // by the user for some time. For instance, if such scenario ocurred and the heading the selection was\n // anchored to was the only content of the editor, it will not be converted into a paragraph (the user\n // wanted to clean it up, not remove it, it's about UX). Check out the DeleteCommand implementation to learn more.\n //\n // Fun fact: Safari on Mac won't fire beforeinput for backspace in an empty heading (only content).\n let sequence = 0;\n document.on('keydown', () => {\n sequence++;\n });\n document.on('keyup', () => {\n sequence = 0;\n });\n document.on('beforeinput', (evt, data) => {\n if (!this.isEnabled) {\n return;\n }\n const { targetRanges, domEvent, inputType } = data;\n const deleteEventSpec = DELETE_EVENT_TYPES[inputType];\n if (!deleteEventSpec) {\n return;\n }\n const deleteData = {\n direction: deleteEventSpec.direction,\n unit: deleteEventSpec.unit,\n sequence\n };\n if (deleteData.unit == DELETE_SELECTION) {\n deleteData.selectionToRemove = view.createSelection(targetRanges[0]);\n }\n // The default deletion unit for deleteContentBackward is a single code point\n // but if the browser provides a wider target range then we should use it.\n if (inputType === 'deleteContentBackward') {\n // On Android, deleteContentBackward has sequence 1 by default.\n if (env.isAndroid) {\n deleteData.sequence = 1;\n }\n // The beforeInput event wants more than a single character to be removed.\n if (shouldUseTargetRanges(targetRanges)) {\n deleteData.unit = DELETE_SELECTION;\n deleteData.selectionToRemove = view.createSelection(targetRanges);\n }\n }\n const eventInfo = new BubblingEventInfo(document, 'delete', targetRanges[0]);\n document.fire(eventInfo, new DomEventData(view, domEvent, deleteData));\n // Stop the beforeinput event if `delete` event was stopped.\n // https://github.com/ckeditor/ckeditor5/issues/753\n if (eventInfo.stop.called) {\n evt.stop();\n }\n });\n // TODO: to be removed when https://bugs.chromium.org/p/chromium/issues/detail?id=1365311 is solved.\n if (env.isBlink) {\n enableChromeWorkaround(this);\n }\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n/**\n * Enables workaround for the issue https://github.com/ckeditor/ckeditor5/issues/11904.\n */\nfunction enableChromeWorkaround(observer) {\n const view = observer.view;\n const document = view.document;\n let pressedKeyCode = null;\n let beforeInputReceived = false;\n document.on('keydown', (evt, { keyCode }) => {\n pressedKeyCode = keyCode;\n beforeInputReceived = false;\n });\n document.on('keyup', (evt, { keyCode, domEvent }) => {\n const selection = document.selection;\n const shouldFireDeleteEvent = observer.isEnabled &&\n keyCode == pressedKeyCode &&\n isDeleteKeyCode(keyCode) &&\n !selection.isCollapsed &&\n !beforeInputReceived;\n pressedKeyCode = null;\n if (shouldFireDeleteEvent) {\n const targetRange = selection.getFirstRange();\n const eventInfo = new BubblingEventInfo(document, 'delete', targetRange);\n const deleteData = {\n unit: DELETE_SELECTION,\n direction: getDeleteDirection(keyCode),\n selectionToRemove: selection\n };\n document.fire(eventInfo, new DomEventData(view, domEvent, deleteData));\n }\n });\n document.on('beforeinput', (evt, { inputType }) => {\n const deleteEventSpec = DELETE_EVENT_TYPES[inputType];\n const isMatchingBeforeInput = isDeleteKeyCode(pressedKeyCode) &&\n deleteEventSpec &&\n deleteEventSpec.direction == getDeleteDirection(pressedKeyCode);\n if (isMatchingBeforeInput) {\n beforeInputReceived = true;\n }\n }, { priority: 'high' });\n document.on('beforeinput', (evt, { inputType, data }) => {\n const shouldIgnoreBeforeInput = pressedKeyCode == keyCodes.delete &&\n inputType == 'insertText' &&\n data == '\\x7f'; // Delete character :P\n if (shouldIgnoreBeforeInput) {\n evt.stop();\n }\n }, { priority: 'high' });\n function isDeleteKeyCode(keyCode) {\n return keyCode == keyCodes.backspace || keyCode == keyCodes.delete;\n }\n function getDeleteDirection(keyCode) {\n return keyCode == keyCodes.backspace ? DELETE_BACKWARD : DELETE_FORWARD;\n }\n}\n/**\n * Verifies whether the given target ranges cover more than a single character and should be used instead of a single code-point deletion.\n */\nfunction shouldUseTargetRanges(targetRanges) {\n // The collapsed target range could happen for example while deleting inside an inline filler\n // (it's mapped to collapsed position before an inline filler).\n if (targetRanges.length != 1 || targetRanges[0].isCollapsed) {\n return false;\n }\n const walker = targetRanges[0].getWalker({\n direction: 'backward',\n singleCharacters: true,\n ignoreElementEnd: true\n });\n let count = 0;\n for (const { nextPosition, item } of walker) {\n if (nextPosition.parent.is('$text')) {\n const data = nextPosition.parent.data;\n const offset = nextPosition.offset;\n // Count combined symbols and emoji sequences as a single character.\n if (isInsideSurrogatePair(data, offset) ||\n isInsideCombinedSymbol(data, offset) ||\n isInsideEmojiSequence(data, offset)) {\n continue;\n }\n count++;\n }\n else if (item.is('containerElement') || item.is('emptyElement')) {\n count++;\n }\n if (count > 1) {\n return true;\n }\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/delete\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport DeleteCommand from './deletecommand.js';\nimport DeleteObserver from './deleteobserver.js';\n/**\n * The delete and backspace feature. Handles keys such as <kbd>Delete</kbd> and <kbd>Backspace</kbd>, other\n * keystrokes and user actions that result in deleting content in the editor.\n */\nexport default class Delete extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Delete';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const modelDocument = editor.model.document;\n view.addObserver(DeleteObserver);\n this._undoOnBackspace = false;\n const deleteForwardCommand = new DeleteCommand(editor, 'forward');\n // Register `deleteForward` command and add `forwardDelete` command as an alias for backward compatibility.\n editor.commands.add('deleteForward', deleteForwardCommand);\n editor.commands.add('forwardDelete', deleteForwardCommand);\n editor.commands.add('delete', new DeleteCommand(editor, 'backward'));\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n // When not in composition, we handle the action, so prevent the default one.\n // When in composition, it's the browser who modify the DOM (renderer is disabled).\n if (!viewDocument.isComposing) {\n data.preventDefault();\n }\n const { direction, sequence, selectionToRemove, unit } = data;\n const commandName = direction === 'forward' ? 'deleteForward' : 'delete';\n const commandData = { sequence };\n if (unit == 'selection') {\n const modelRanges = Array.from(selectionToRemove.getRanges()).map(viewRange => {\n return editor.editing.mapper.toModelRange(viewRange);\n });\n commandData.selection = editor.model.createSelection(modelRanges);\n }\n else {\n commandData.unit = unit;\n }\n editor.execute(commandName, commandData);\n view.scrollToTheSelection();\n }, { priority: 'low' });\n if (this.editor.plugins.has('UndoEditing')) {\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n if (this._undoOnBackspace && data.direction == 'backward' && data.sequence == 1 && data.unit == 'codePoint') {\n this._undoOnBackspace = false;\n editor.execute('undo');\n data.preventDefault();\n evt.stop();\n }\n }, { context: '$capture' });\n this.listenTo(modelDocument, 'change', () => {\n this._undoOnBackspace = false;\n });\n }\n }\n /**\n * If the next user action after calling this method is pressing backspace, it would undo the last change.\n *\n * Requires {@link module:undo/undoediting~UndoEditing} plugin. If not loaded, does nothing.\n */\n requestUndoOnBackspace() {\n if (this.editor.plugins.has('UndoEditing')) {\n this._undoOnBackspace = true;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/typing\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport Input from './input.js';\nimport Delete from './delete.js';\n/**\n * The typing feature. It handles typing.\n *\n * This is a \"glue\" plugin which loads the {@link module:typing/input~Input} and {@link module:typing/delete~Delete}\n * plugins.\n */\nexport default class Typing extends Plugin {\n static get requires() {\n return [Input, Delete];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Typing';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns the last text line from the given range.\n *\n * \"The last text line\" is understood as text (from one or more text nodes) which is limited either by a parent block\n * or by inline elements (e.g. `<softBreak>`).\n *\n * ```ts\n * const rangeToCheck = model.createRange(\n * \tmodel.createPositionAt( paragraph, 0 ),\n * \tmodel.createPositionAt( paragraph, 'end' )\n * );\n *\n * const { text, range } = getLastTextLine( rangeToCheck, model );\n * ```\n *\n * For model below, the returned `text` will be \"Foo bar baz\" and `range` will be set on whole `<paragraph>` content:\n *\n * ```xml\n * <paragraph>Foo bar baz<paragraph>\n * ```\n *\n * However, in below case, `text` will be set to \"baz\" and `range` will be set only on \"baz\".\n *\n * ```xml\n * <paragraph>Foo<softBreak></softBreak>bar<softBreak></softBreak>baz<paragraph>\n * ```\n */\nexport default function getLastTextLine(range, model) {\n let start = range.start;\n const text = Array.from(range.getWalker({ ignoreElementEnd: false })).reduce((rangeText, { item }) => {\n // Trim text to a last occurrence of an inline element and update range start.\n if (!(item.is('$text') || item.is('$textProxy'))) {\n start = model.createPositionAfter(item);\n return '';\n }\n return rangeText + item.data;\n }, '');\n return { text, range: model.createRange(start, range.end) };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/textwatcher\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\nimport getLastTextLine from './utils/getlasttextline.js';\n/**\n * The text watcher feature.\n *\n * Fires the {@link module:typing/textwatcher~TextWatcher#event:matched:data `matched:data`},\n * {@link module:typing/textwatcher~TextWatcher#event:matched:selection `matched:selection`} and\n * {@link module:typing/textwatcher~TextWatcher#event:unmatched `unmatched`} events on typing or selection changes.\n */\nexport default class TextWatcher extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a text watcher instance.\n *\n * @param testCallback See {@link module:typing/textwatcher~TextWatcher#testCallback}.\n */\n constructor(model, testCallback) {\n super();\n this.model = model;\n this.testCallback = testCallback;\n this._hasMatch = false;\n this.set('isEnabled', true);\n // Toggle text watching on isEnabled state change.\n this.on('change:isEnabled', () => {\n if (this.isEnabled) {\n this._startListening();\n }\n else {\n this.stopListening(model.document.selection);\n this.stopListening(model.document);\n }\n });\n this._startListening();\n }\n /**\n * Flag indicating whether there is a match currently.\n */\n get hasMatch() {\n return this._hasMatch;\n }\n /**\n * Starts listening to the editor for typing and selection events.\n */\n _startListening() {\n const model = this.model;\n const document = model.document;\n this.listenTo(document.selection, 'change:range', (evt, { directChange }) => {\n // Indirect changes (i.e. when the user types or external changes are applied) are handled in the document's change event.\n if (!directChange) {\n return;\n }\n // Act only on collapsed selection.\n if (!document.selection.isCollapsed) {\n if (this.hasMatch) {\n this.fire('unmatched');\n this._hasMatch = false;\n }\n return;\n }\n this._evaluateTextBeforeSelection('selection');\n });\n this.listenTo(document, 'change:data', (evt, batch) => {\n if (batch.isUndo || !batch.isLocal) {\n return;\n }\n this._evaluateTextBeforeSelection('data', { batch });\n });\n }\n /**\n * Checks the editor content for matched text.\n *\n * @fires matched:data\n * @fires matched:selection\n * @fires unmatched\n *\n * @param suffix A suffix used for generating the event name.\n * @param data Data object for event.\n */\n _evaluateTextBeforeSelection(suffix, data = {}) {\n const model = this.model;\n const document = model.document;\n const selection = document.selection;\n const rangeBeforeSelection = model.createRange(model.createPositionAt(selection.focus.parent, 0), selection.focus);\n const { text, range } = getLastTextLine(rangeBeforeSelection, model);\n const testResult = this.testCallback(text);\n if (!testResult && this.hasMatch) {\n this.fire('unmatched');\n }\n this._hasMatch = !!testResult;\n if (testResult) {\n const eventData = Object.assign(data, { text, range });\n // If the test callback returns an object with additional data, assign the data as well.\n if (typeof testResult == 'object') {\n Object.assign(eventData, testResult);\n }\n this.fire(`matched:${suffix}`, eventData);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/twostepcaretmovement\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { keyCodes } from '@ckeditor/ckeditor5-utils';\nimport { MouseObserver } from '@ckeditor/ckeditor5-engine';\n/**\n * This plugin enables the two-step caret (phantom) movement behavior for\n * {@link module:typing/twostepcaretmovement~TwoStepCaretMovement#registerAttribute registered attributes}\n * on arrow right (<kbd>→</kbd>) and left (<kbd>â†</kbd>) key press.\n *\n * Thanks to this (phantom) caret movement the user is able to type before/after as well as at the\n * beginning/end of an attribute.\n *\n * **Note:** This plugin support right–to–left (Arabic, Hebrew, etc.) content by mirroring its behavior\n * but for the sake of simplicity examples showcase only left–to–right use–cases.\n *\n * # Forward movement\n *\n * ## \"Entering\" an attribute:\n *\n * When this plugin is enabled and registered for the `a` attribute and the selection is right before it\n * (at the attribute boundary), pressing the right arrow key will not move the selection but update its\n * attributes accordingly:\n *\n * * When enabled:\n *\n * ```xml\n * foo{}<$text a=\"true\">bar</$text>\n * ```\n *\n * \t<kbd>→</kbd>\n *\n * ```xml\n * foo<$text a=\"true\">{}bar</$text>\n * ```\n *\n * * When disabled:\n *\n * ```xml\n * foo{}<$text a=\"true\">bar</$text>\n * ```\n *\n * \t<kbd>→</kbd>\n *\n * ```xml\n * foo<$text a=\"true\">b{}ar</$text>\n * ```\n *\n *\n * ## \"Leaving\" an attribute:\n *\n * * When enabled:\n *\n * ```xml\n * <$text a=\"true\">bar{}</$text>baz\n * ```\n *\n * \t<kbd>→</kbd>\n *\n * ```xml\n * <$text a=\"true\">bar</$text>{}baz\n * ```\n *\n * * When disabled:\n *\n * ```xml\n * <$text a=\"true\">bar{}</$text>baz\n * ```\n *\n * \t<kbd>→</kbd>\n *\n * ```xml\n * <$text a=\"true\">bar</$text>b{}az\n * ```\n *\n * # Backward movement\n *\n * * When enabled:\n *\n * ```xml\n * <$text a=\"true\">bar</$text>{}baz\n * ```\n *\n * \t<kbd>â†</kbd>\n *\n * ```xml\n * <$text a=\"true\">bar{}</$text>baz\n * ```\n *\n * * When disabled:\n *\n * ```xml\n * <$text a=\"true\">bar</$text>{}baz\n * ```\n *\n * \t<kbd>â†</kbd>\n *\n * ```xml\n * <$text a=\"true\">ba{}r</$text>b{}az\n * ```\n *\n * # Multiple attributes\n *\n * * When enabled and many attributes starts or ends at the same position:\n *\n * ```xml\n * <$text a=\"true\" b=\"true\">bar</$text>{}baz\n * ```\n *\n * \t<kbd>â†</kbd>\n *\n * ```xml\n * <$text a=\"true\" b=\"true\">bar{}</$text>baz\n * ```\n *\n * * When enabled and one procedes another:\n *\n * ```xml\n * <$text a=\"true\">bar</$text><$text b=\"true\">{}bar</$text>\n * ```\n *\n * \t<kbd>â†</kbd>\n *\n * ```xml\n * <$text a=\"true\">bar{}</$text><$text b=\"true\">bar</$text>\n * ```\n *\n */\nexport default class TwoStepCaretMovement extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TwoStepCaretMovement';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * A flag indicating that the automatic gravity restoration should not happen upon the next\n * gravity restoration.\n * {@link module:engine/model/selection~Selection#event:change:range} event.\n */\n this._isNextGravityRestorationSkipped = false;\n this.attributes = new Set();\n this._overrideUid = null;\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const locale = editor.locale;\n const modelSelection = model.document.selection;\n // Listen to keyboard events and handle the caret movement according to the 2-step caret logic.\n this.listenTo(view.document, 'arrowKey', (evt, data) => {\n // This implementation works only for collapsed selection.\n if (!modelSelection.isCollapsed) {\n return;\n }\n // When user tries to expand the selection or jump over the whole word or to the beginning/end then\n // two-steps movement is not necessary.\n if (data.shiftKey || data.altKey || data.ctrlKey) {\n return;\n }\n const arrowRightPressed = data.keyCode == keyCodes.arrowright;\n const arrowLeftPressed = data.keyCode == keyCodes.arrowleft;\n // When neither left or right arrow has been pressed then do noting.\n if (!arrowRightPressed && !arrowLeftPressed) {\n return;\n }\n const contentDirection = locale.contentLanguageDirection;\n let isMovementHandled = false;\n if ((contentDirection === 'ltr' && arrowRightPressed) || (contentDirection === 'rtl' && arrowLeftPressed)) {\n isMovementHandled = this._handleForwardMovement(data);\n }\n else {\n isMovementHandled = this._handleBackwardMovement(data);\n }\n // Stop the keydown event if the two-step caret movement handled it. Avoid collisions\n // with other features which may also take over the caret movement (e.g. Widget).\n if (isMovementHandled === true) {\n evt.stop();\n }\n }, { context: '$text', priority: 'highest' });\n // The automatic gravity restoration logic.\n this.listenTo(modelSelection, 'change:range', (evt, data) => {\n // Skipping the automatic restoration is needed if the selection should change\n // but the gravity must remain overridden afterwards. See the #handleBackwardMovement\n // to learn more.\n if (this._isNextGravityRestorationSkipped) {\n this._isNextGravityRestorationSkipped = false;\n return;\n }\n // Skip automatic restore when the gravity is not overridden — simply, there's nothing to restore\n // at this moment.\n if (!this._isGravityOverridden) {\n return;\n }\n // Skip automatic restore when the change is indirect AND the selection is at the attribute boundary.\n // It means that e.g. if the change was external (collaboration) and the user had their\n // selection around the link, its gravity should remain intact in this change:range event.\n if (!data.directChange && isBetweenDifferentAttributes(modelSelection.getFirstPosition(), this.attributes)) {\n return;\n }\n this._restoreGravity();\n });\n // Handle a click at the beginning/end of a two-step element.\n this._enableClickingAfterNode();\n // Change the attributes of the selection in certain situations after the two-step node was inserted into the document.\n this._enableInsertContentSelectionAttributesFixer();\n // Handle removing the content after the two-step node.\n this._handleDeleteContentAfterNode();\n }\n /**\n * Registers a given attribute for the two-step caret movement.\n *\n * @param attribute Name of the attribute to handle.\n */\n registerAttribute(attribute) {\n this.attributes.add(attribute);\n }\n /**\n * Updates the document selection and the view according to the two–step caret movement state\n * when moving **forwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.\n *\n * @param data Data of the key press.\n * @returns `true` when the handler prevented caret movement.\n */\n _handleForwardMovement(data) {\n const attributes = this.attributes;\n const model = this.editor.model;\n const selection = model.document.selection;\n const position = selection.getFirstPosition();\n // DON'T ENGAGE 2-SCM if gravity is already overridden. It means that we just entered\n //\n // \t\t<paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>\n //\n // or left the attribute\n //\n // \t\t<paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>\n //\n // and the gravity will be restored automatically.\n if (this._isGravityOverridden) {\n return false;\n }\n // DON'T ENGAGE 2-SCM when the selection is at the beginning of the block AND already has the\n // attribute:\n // * when the selection was initially set there using the mouse,\n // * when the editor has just started\n //\n //\t\t<paragraph><$text attribute>{}bar</$text>baz</paragraph>\n //\n if (position.isAtStart && hasAnyAttribute(selection, attributes)) {\n return false;\n }\n // ENGAGE 2-SCM When at least one of the observed attributes changes its value (incl. starts, ends).\n //\n //\t\t<paragraph>foo<$text attribute>bar{}</$text>baz</paragraph>\n //\t\t<paragraph>foo<$text attribute>bar{}</$text><$text otherAttribute>baz</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute=1>bar{}</$text><$text attribute=2>baz</$text></paragraph>\n //\t\t<paragraph>foo{}<$text attribute>bar</$text>baz</paragraph>\n //\n if (isBetweenDifferentAttributes(position, attributes)) {\n preventCaretMovement(data);\n // CLEAR 2-SCM attributes if we are at the end of one 2-SCM and before\n // the next one with a different value of the same attribute.\n //\n //\t\t<paragraph>foo<$text attribute=1>bar{}</$text><$text attribute=2>bar</$text>baz</paragraph>\n //\n if (hasAnyAttribute(selection, attributes) &&\n isBetweenDifferentAttributes(position, attributes, true)) {\n clearSelectionAttributes(model, attributes);\n }\n else {\n this._overrideGravity();\n }\n return true;\n }\n return false;\n }\n /**\n * Updates the document selection and the view according to the two–step caret movement state\n * when moving **backwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.\n *\n * @param data Data of the key press.\n * @returns `true` when the handler prevented caret movement\n */\n _handleBackwardMovement(data) {\n const attributes = this.attributes;\n const model = this.editor.model;\n const selection = model.document.selection;\n const position = selection.getFirstPosition();\n // When the gravity is already overridden (by this plugin), it means we are on the two-step position.\n // Prevent the movement, restore the gravity and update selection attributes.\n //\n //\t\t<paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>{}baz</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute>bar</$text><$text otherAttribute>{}baz</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>\n //\t\t<paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>\n //\n if (this._isGravityOverridden) {\n preventCaretMovement(data);\n this._restoreGravity();\n // CLEAR 2-SCM attributes if we are at the end of one 2-SCM and before\n // the next one with a different value of the same attribute.\n //\n //\t\t<paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>{}bar</$text>baz</paragraph>\n //\n if (isBetweenDifferentAttributes(position, attributes, true)) {\n clearSelectionAttributes(model, attributes);\n }\n else {\n setSelectionAttributesFromTheNodeBefore(model, attributes, position);\n }\n return true;\n }\n else {\n // REMOVE SELECTION ATTRIBUTE when restoring gravity towards a non-existent content at the\n // beginning of the block.\n //\n // \t\t<paragraph>{}<$text attribute>bar</$text></paragraph>\n //\n if (position.isAtStart) {\n if (hasAnyAttribute(selection, attributes)) {\n preventCaretMovement(data);\n setSelectionAttributesFromTheNodeBefore(model, attributes, position);\n return true;\n }\n return false;\n }\n // SET 2-SCM attributes if we are between nodes with the same attribute but with different values.\n //\n //\t\t<paragraph>foo<$text attribute=1>bar</$text>[]<$text attribute=2>bar</$text>baz</paragraph>\n //\n if (!hasAnyAttribute(selection, attributes) &&\n isBetweenDifferentAttributes(position, attributes, true)) {\n preventCaretMovement(data);\n setSelectionAttributesFromTheNodeBefore(model, attributes, position);\n return true;\n }\n // When we are moving from natural gravity, to the position of the 2SCM, we need to override the gravity,\n // and make sure it won't be restored. Unless it's at the end of the block and an observed attribute.\n // We need to check if the caret is a one position before the attribute boundary:\n //\n //\t\t<paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>b{}az</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute>bar</$text><$text otherAttribute>b{}az</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute>b{}ar</$text>baz</paragraph>\n //\t\t<paragraph>foo<$text attribute>bar</$text>b{}az</paragraph>\n //\n if (isStepAfterAnyAttributeBoundary(position, attributes)) {\n // ENGAGE 2-SCM if the selection has no attribute. This may happen when the user\n // left the attribute using a FORWARD 2-SCM.\n //\n // \t\t<paragraph><$text attribute>bar</$text>{}</paragraph>\n //\n if (position.isAtEnd &&\n !hasAnyAttribute(selection, attributes) &&\n isBetweenDifferentAttributes(position, attributes)) {\n preventCaretMovement(data);\n setSelectionAttributesFromTheNodeBefore(model, attributes, position);\n return true;\n }\n // Skip the automatic gravity restore upon the next selection#change:range event.\n // If not skipped, it would automatically restore the gravity, which should remain\n // overridden.\n this._isNextGravityRestorationSkipped = true;\n this._overrideGravity();\n // Don't return \"true\" here because we didn't call _preventCaretMovement.\n // Returning here will destabilize the filler logic, which also listens to\n // keydown (and the event would be stopped).\n return false;\n }\n }\n return false;\n }\n /**\n * Starts listening to {@link module:engine/view/document~Document#event:mousedown} and\n * {@link module:engine/view/document~Document#event:selectionChange} and puts the selection before/after a 2-step node\n * if clicked at the beginning/ending of the 2-step node.\n *\n * The purpose of this action is to allow typing around the 2-step node directly after a click.\n *\n * See https://github.com/ckeditor/ckeditor5/issues/1016.\n */\n _enableClickingAfterNode() {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n const document = editor.editing.view.document;\n editor.editing.view.addObserver(MouseObserver);\n let clicked = false;\n // Detect the click.\n this.listenTo(document, 'mousedown', () => {\n clicked = true;\n });\n // When the selection has changed...\n this.listenTo(document, 'selectionChange', () => {\n const attributes = this.attributes;\n if (!clicked) {\n return;\n }\n // ...and it was caused by the click...\n clicked = false;\n // ...and no text is selected...\n if (!selection.isCollapsed) {\n return;\n }\n // ...and clicked text is the 2-step node...\n if (!hasAnyAttribute(selection, attributes)) {\n return;\n }\n const position = selection.getFirstPosition();\n if (!isBetweenDifferentAttributes(position, attributes)) {\n return;\n }\n // The selection at the start of a block would use surrounding attributes\n // from text after the selection so just clear 2-SCM attributes.\n //\n // Also, clear attributes for selection between same attribute with different values.\n if (position.isAtStart ||\n isBetweenDifferentAttributes(position, attributes, true)) {\n clearSelectionAttributes(model, attributes);\n }\n else if (!this._isGravityOverridden) {\n this._overrideGravity();\n }\n });\n }\n /**\n * Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model\n * selection attributes if the selection is at the end of a two-step node after inserting the content.\n *\n * The purpose of this action is to improve the overall UX because the user is no longer \"trapped\" by the\n * two-step attribute of the selection, and they can type a \"clean\" (`linkHref`–less) text right away.\n *\n * See https://github.com/ckeditor/ckeditor5/issues/6053.\n */\n _enableInsertContentSelectionAttributesFixer() {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n const attributes = this.attributes;\n this.listenTo(model, 'insertContent', () => {\n const position = selection.getFirstPosition();\n if (hasAnyAttribute(selection, attributes) &&\n isBetweenDifferentAttributes(position, attributes)) {\n clearSelectionAttributes(model, attributes);\n }\n }, { priority: 'low' });\n }\n /**\n * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether\n * removing a content right after the tow-step attribute.\n *\n * If so, the selection should not preserve the two-step attribute. However, if\n * the {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is active and\n * the selection has the two-step attribute due to overridden gravity (at the end), the two-step attribute should stay untouched.\n *\n * The purpose of this action is to allow removing the link text and keep the selection outside the link.\n *\n * See https://github.com/ckeditor/ckeditor5/issues/7521.\n */\n _handleDeleteContentAfterNode() {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n const view = editor.editing.view;\n let isBackspace = false;\n let shouldPreserveAttributes = false;\n // Detect pressing `Backspace`.\n this.listenTo(view.document, 'delete', (evt, data) => {\n isBackspace = data.direction === 'backward';\n }, { priority: 'high' });\n // Before removing the content, check whether the selection is inside a two-step attribute.\n // If so, we want to preserve those attributes.\n this.listenTo(model, 'deleteContent', () => {\n if (!isBackspace) {\n return;\n }\n const position = selection.getFirstPosition();\n shouldPreserveAttributes = hasAnyAttribute(selection, this.attributes) &&\n !isStepAfterAnyAttributeBoundary(position, this.attributes);\n }, { priority: 'high' });\n // After removing the content, check whether the current selection should preserve the `linkHref` attribute.\n this.listenTo(model, 'deleteContent', () => {\n if (!isBackspace) {\n return;\n }\n isBackspace = false;\n // Do not escape two-step attribute if it was inside it before content deletion.\n if (shouldPreserveAttributes) {\n return;\n }\n // Use `model.enqueueChange()` in order to execute the callback at the end of the changes process.\n editor.model.enqueueChange(() => {\n const position = selection.getFirstPosition();\n if (hasAnyAttribute(selection, this.attributes) &&\n isBetweenDifferentAttributes(position, this.attributes)) {\n if (position.isAtStart || isBetweenDifferentAttributes(position, this.attributes, true)) {\n clearSelectionAttributes(model, this.attributes);\n }\n else if (!this._isGravityOverridden) {\n this._overrideGravity();\n }\n }\n });\n }, { priority: 'low' });\n }\n /**\n * `true` when the gravity is overridden for the plugin.\n */\n get _isGravityOverridden() {\n return !!this._overrideUid;\n }\n /**\n * Overrides the gravity using the {@link module:engine/model/writer~Writer model writer}\n * and stores the information about this fact in the {@link #_overrideUid}.\n *\n * A shorthand for {@link module:engine/model/writer~Writer#overrideSelectionGravity}.\n */\n _overrideGravity() {\n this._overrideUid = this.editor.model.change(writer => {\n return writer.overrideSelectionGravity();\n });\n }\n /**\n * Restores the gravity using the {@link module:engine/model/writer~Writer model writer}.\n *\n * A shorthand for {@link module:engine/model/writer~Writer#restoreSelectionGravity}.\n */\n _restoreGravity() {\n this.editor.model.change(writer => {\n writer.restoreSelectionGravity(this._overrideUid);\n this._overrideUid = null;\n });\n }\n}\n/**\n * Checks whether the selection has any of given attributes.\n */\nfunction hasAnyAttribute(selection, attributes) {\n for (const observedAttribute of attributes) {\n if (selection.hasAttribute(observedAttribute)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Applies the given attributes to the current selection using using the\n * values from the node before the current position. Uses\n * the {@link module:engine/model/writer~Writer model writer}.\n */\nfunction setSelectionAttributesFromTheNodeBefore(model, attributes, position) {\n const nodeBefore = position.nodeBefore;\n model.change(writer => {\n if (nodeBefore) {\n const attributes = [];\n const isInlineObject = model.schema.isObject(nodeBefore) && model.schema.isInline(nodeBefore);\n for (const [key, value] of nodeBefore.getAttributes()) {\n if (model.schema.checkAttribute('$text', key) &&\n (!isInlineObject || model.schema.getAttributeProperties(key).copyFromObject !== false)) {\n attributes.push([key, value]);\n }\n }\n writer.setSelectionAttribute(attributes);\n }\n else {\n writer.removeSelectionAttribute(attributes);\n }\n });\n}\n/**\n * Removes 2-SCM attributes from the selection.\n */\nfunction clearSelectionAttributes(model, attributes) {\n model.change(writer => {\n writer.removeSelectionAttribute(attributes);\n });\n}\n/**\n * Prevents the caret movement in the view by calling `preventDefault` on the event data.\n *\n * @alias data.preventDefault\n */\nfunction preventCaretMovement(data) {\n data.preventDefault();\n}\n/**\n * Checks whether the step before `isBetweenDifferentAttributes()`.\n */\nfunction isStepAfterAnyAttributeBoundary(position, attributes) {\n const positionBefore = position.getShiftedBy(-1);\n return isBetweenDifferentAttributes(positionBefore, attributes);\n}\n/**\n * Checks whether the given position is between different values of given attributes.\n */\nfunction isBetweenDifferentAttributes(position, attributes, isStrict = false) {\n const { nodeBefore, nodeAfter } = position;\n for (const observedAttribute of attributes) {\n const attrBefore = nodeBefore ? nodeBefore.getAttribute(observedAttribute) : undefined;\n const attrAfter = nodeAfter ? nodeAfter.getAttribute(observedAttribute) : undefined;\n if (isStrict && (attrBefore === undefined || attrAfter === undefined)) {\n continue;\n }\n if (attrAfter !== attrBefore) {\n return true;\n }\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/texttransformation\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport TextWatcher from './textwatcher.js';\nimport { escapeRegExp } from 'lodash-es';\n// All named transformations.\nconst TRANSFORMATIONS = {\n // Common symbols:\n copyright: { from: '(c)', to: '©' },\n registeredTrademark: { from: '(r)', to: '®' },\n trademark: { from: '(tm)', to: 'â„¢' },\n // Mathematical:\n oneHalf: { from: /(^|[^/a-z0-9])(1\\/2)([^/a-z0-9])$/i, to: [null, '½', null] },\n oneThird: { from: /(^|[^/a-z0-9])(1\\/3)([^/a-z0-9])$/i, to: [null, 'â…“', null] },\n twoThirds: { from: /(^|[^/a-z0-9])(2\\/3)([^/a-z0-9])$/i, to: [null, 'â…”', null] },\n oneForth: { from: /(^|[^/a-z0-9])(1\\/4)([^/a-z0-9])$/i, to: [null, '¼', null] },\n threeQuarters: { from: /(^|[^/a-z0-9])(3\\/4)([^/a-z0-9])$/i, to: [null, '¾', null] },\n lessThanOrEqual: { from: '<=', to: '≤' },\n greaterThanOrEqual: { from: '>=', to: '≥' },\n notEqual: { from: '!=', to: '≠' },\n arrowLeft: { from: '<-', to: 'â†' },\n arrowRight: { from: '->', to: '→' },\n // Typography:\n horizontalEllipsis: { from: '...', to: '…' },\n enDash: { from: /(^| )(--)( )$/, to: [null, '–', null] },\n emDash: { from: /(^| )(---)( )$/, to: [null, '—', null] },\n // Quotations:\n // English, US\n quotesPrimary: { from: buildQuotesRegExp('\"'), to: [null, '“', null, 'â€'] },\n quotesSecondary: { from: buildQuotesRegExp('\\''), to: [null, '‘', null, '’'] },\n // English, UK\n quotesPrimaryEnGb: { from: buildQuotesRegExp('\\''), to: [null, '‘', null, '’'] },\n quotesSecondaryEnGb: { from: buildQuotesRegExp('\"'), to: [null, '“', null, 'â€'] },\n // Polish\n quotesPrimaryPl: { from: buildQuotesRegExp('\"'), to: [null, '„', null, 'â€'] },\n quotesSecondaryPl: { from: buildQuotesRegExp('\\''), to: [null, '‚', null, '’'] }\n};\n// Transformation groups.\nconst TRANSFORMATION_GROUPS = {\n symbols: ['copyright', 'registeredTrademark', 'trademark'],\n mathematical: [\n 'oneHalf', 'oneThird', 'twoThirds', 'oneForth', 'threeQuarters',\n 'lessThanOrEqual', 'greaterThanOrEqual', 'notEqual',\n 'arrowLeft', 'arrowRight'\n ],\n typography: ['horizontalEllipsis', 'enDash', 'emDash'],\n quotes: ['quotesPrimary', 'quotesSecondary']\n};\n// A set of default transformations provided by the feature.\nconst DEFAULT_TRANSFORMATIONS = [\n 'symbols',\n 'mathematical',\n 'typography',\n 'quotes'\n];\n/**\n * The text transformation plugin.\n */\nexport default class TextTransformation extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return ['Delete', 'Input'];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TextTransformation';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('typing', {\n transformations: {\n include: DEFAULT_TRANSFORMATIONS\n }\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const model = this.editor.model;\n const modelSelection = model.document.selection;\n modelSelection.on('change:range', () => {\n // Disable plugin when selection is inside a code block.\n this.isEnabled = !modelSelection.anchor.parent.is('element', 'codeBlock');\n });\n this._enableTransformationWatchers();\n }\n /**\n * Create new TextWatcher listening to the editor for typing and selection events.\n */\n _enableTransformationWatchers() {\n const editor = this.editor;\n const model = editor.model;\n const deletePlugin = editor.plugins.get('Delete');\n const normalizedTransformations = normalizeTransformations(editor.config.get('typing.transformations'));\n const testCallback = (text) => {\n for (const normalizedTransformation of normalizedTransformations) {\n const from = normalizedTransformation.from;\n const match = from.test(text);\n if (match) {\n return { normalizedTransformation };\n }\n }\n };\n const watcher = new TextWatcher(editor.model, testCallback);\n watcher.on('matched:data', (evt, data) => {\n if (!data.batch.isTyping) {\n return;\n }\n const { from, to } = data.normalizedTransformation;\n const matches = from.exec(data.text);\n const replaces = to(matches.slice(1));\n const matchedRange = data.range;\n let changeIndex = matches.index;\n model.enqueueChange(writer => {\n for (let i = 1; i < matches.length; i++) {\n const match = matches[i];\n const replaceWith = replaces[i - 1];\n if (replaceWith == null) {\n changeIndex += match.length;\n continue;\n }\n const replacePosition = matchedRange.start.getShiftedBy(changeIndex);\n const replaceRange = model.createRange(replacePosition, replacePosition.getShiftedBy(match.length));\n const attributes = getTextAttributesAfterPosition(replacePosition);\n model.insertContent(writer.createText(replaceWith, attributes), replaceRange);\n changeIndex += replaceWith.length;\n }\n model.enqueueChange(() => {\n deletePlugin.requestUndoOnBackspace();\n });\n });\n });\n watcher.bind('isEnabled').to(this);\n }\n}\n/**\n * Normalizes the configuration `from` parameter value.\n * The normalized value for the `from` parameter is a RegExp instance. If the passed `from` is already a RegExp instance,\n * it is returned unchanged.\n */\nfunction normalizeFrom(from) {\n if (typeof from == 'string') {\n return new RegExp(`(${escapeRegExp(from)})$`);\n }\n // `from` is already a regular expression.\n return from;\n}\n/**\n * Normalizes the configuration `to` parameter value.\n * The normalized value for the `to` parameter is a function that takes an array and returns an array. See more in the\n * configuration description. If the passed `to` is already a function, it is returned unchanged.\n */\nfunction normalizeTo(to) {\n if (typeof to == 'string') {\n return () => [to];\n }\n else if (to instanceof Array) {\n return () => to;\n }\n // `to` is already a function.\n return to;\n}\n/**\n * For given `position` returns attributes for the text that is after that position.\n * The text can be in the same text node as the position (`foo[]bar`) or in the next text node (`foo[]<$text bold=\"true\">bar</$text>`).\n */\nfunction getTextAttributesAfterPosition(position) {\n const textNode = position.textNode ? position.textNode : position.nodeAfter;\n return textNode.getAttributes();\n}\n/**\n * Returns a RegExp pattern string that detects a sentence inside a quote.\n *\n * @param quoteCharacter The character to create a pattern for.\n */\nfunction buildQuotesRegExp(quoteCharacter) {\n return new RegExp(`(^|\\\\s)(${quoteCharacter})([^${quoteCharacter}]*)(${quoteCharacter})$`);\n}\n/**\n * Reads text transformation config and returns normalized array of transformations objects.\n */\nfunction normalizeTransformations(config) {\n const extra = config.extra || [];\n const remove = config.remove || [];\n const isNotRemoved = (transformation) => !remove.includes(transformation);\n const configured = config.include.concat(extra).filter(isNotRemoved);\n return expandGroupsAndRemoveDuplicates(configured)\n .filter(isNotRemoved) // Filter out 'remove' transformations as they might be set in group.\n .map(transformation => (typeof transformation == 'string' && TRANSFORMATIONS[transformation] ? TRANSFORMATIONS[transformation] : transformation))\n // Filter out transformations set as string that has not been found.\n .filter((transformation) => typeof transformation === 'object')\n .map(transformation => ({\n from: normalizeFrom(transformation.from),\n to: normalizeTo(transformation.to)\n }));\n}\n/**\n * Reads definitions and expands named groups if needed to transformation names.\n * This method also removes duplicated named transformations if any.\n */\nfunction expandGroupsAndRemoveDuplicates(definitions) {\n // Set is using to make sure that transformation names are not duplicated.\n const definedTransformations = new Set();\n for (const transformationOrGroup of definitions) {\n if (typeof transformationOrGroup == 'string' && TRANSFORMATION_GROUPS[transformationOrGroup]) {\n for (const transformation of TRANSFORMATION_GROUPS[transformationOrGroup]) {\n definedTransformations.add(transformation);\n }\n }\n else {\n definedTransformations.add(transformationOrGroup);\n }\n }\n return Array.from(definedTransformations);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns a model range that covers all consecutive nodes with the same `attributeName` and its `value`\n * that intersect the given `position`.\n *\n * It can be used e.g. to get the entire range on which the `linkHref` attribute needs to be changed when having a\n * selection inside a link.\n *\n * @param position The start position.\n * @param attributeName The attribute name.\n * @param value The attribute value.\n * @param model The model instance.\n * @returns The link range.\n */\nexport default function findAttributeRange(position, attributeName, value, model) {\n return model.createRange(findAttributeRangeBound(position, attributeName, value, true, model), findAttributeRangeBound(position, attributeName, value, false, model));\n}\n/**\n * Walks forward or backward (depends on the `lookBack` flag), node by node, as long as they have the same attribute value\n * and returns a position just before or after (depends on the `lookBack` flag) the last matched node.\n *\n * @param position The start position.\n * @param attributeName The attribute name.\n * @param value The attribute value.\n * @param lookBack Whether the walk direction is forward (`false`) or backward (`true`).\n * @returns The position just before the last matched node.\n */\nexport function findAttributeRangeBound(position, attributeName, value, lookBack, model) {\n // Get node before or after position (depends on `lookBack` flag).\n // When position is inside text node then start searching from text node.\n let node = position.textNode || (lookBack ? position.nodeBefore : position.nodeAfter);\n let lastNode = null;\n while (node && node.getAttribute(attributeName) == value) {\n lastNode = node;\n node = lookBack ? node.previousSibling : node.nextSibling;\n }\n return lastNode ? model.createPositionAt(lastNode, lookBack ? 'before' : 'after') : position;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/utils/inlinehighlight\n */\nimport findAttributeRange from './findattributerange.js';\n/**\n * Adds a visual highlight style to an attribute element in which the selection is anchored.\n * Together with two-step caret movement, they indicate that the user is typing inside the element.\n *\n * Highlight is turned on by adding the given class to the attribute element in the view:\n *\n * * The class is removed before the conversion has started, as callbacks added with the `'highest'` priority\n * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.\n * * The class is added in the view post fixer, after other changes in the model tree were converted to the view.\n *\n * This way, adding and removing the highlight does not interfere with conversion.\n *\n * Usage:\n *\n * ```ts\n * import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';\n *\n * // Make `ck-link_selected` class be applied on an `a` element\n * // whenever the corresponding `linkHref` attribute element is selected.\n * inlineHighlight( editor, 'linkHref', 'a', 'ck-link_selected' );\n * ```\n *\n * @param editor The editor instance.\n * @param attributeName The attribute name to check.\n * @param tagName The tagName of a view item.\n * @param className The class name to apply in the view.\n */\nexport default function inlineHighlight(editor, attributeName, tagName, className) {\n const view = editor.editing.view;\n const highlightedElements = new Set();\n // Adding the class.\n view.document.registerPostFixer(writer => {\n const selection = editor.model.document.selection;\n let changed = false;\n if (selection.hasAttribute(attributeName)) {\n const modelRange = findAttributeRange(selection.getFirstPosition(), attributeName, selection.getAttribute(attributeName), editor.model);\n const viewRange = editor.editing.mapper.toViewRange(modelRange);\n // There might be multiple view elements in the `viewRange`, for example, when the `a` element is\n // broken by a UIElement.\n for (const item of viewRange.getItems()) {\n if (item.is('element', tagName) && !item.hasClass(className)) {\n writer.addClass(className, item);\n highlightedElements.add(item);\n changed = true;\n }\n }\n }\n return changed;\n });\n // Removing the class.\n editor.conversion.for('editingDowncast').add(dispatcher => {\n // Make sure the highlight is removed on every possible event, before conversion is started.\n dispatcher.on('insert', removeHighlight, { priority: 'highest' });\n dispatcher.on('remove', removeHighlight, { priority: 'highest' });\n dispatcher.on('attribute', removeHighlight, { priority: 'highest' });\n dispatcher.on('selection', removeHighlight, { priority: 'highest' });\n function removeHighlight() {\n view.change(writer => {\n for (const item of highlightedElements.values()) {\n writer.removeClass(className, item);\n highlightedElements.delete(item);\n }\n });\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns attributes that should be preserved on the enter keystroke.\n *\n * Filtering is realized based on `copyOnEnter` attribute property. Read more about attribute properties\n * {@link module:engine/model/schema~Schema#setAttributeProperties here}.\n *\n * @param schema Model's schema.\n * @param allAttributes Attributes to filter.\n */\nexport function* getCopyOnEnterAttributes(schema, allAttributes) {\n for (const attribute of allAttributes) {\n if (attribute && schema.getAttributeProperties(attribute[0]).copyOnEnter) {\n yield attribute;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/entercommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { getCopyOnEnterAttributes } from './utils.js';\n/**\n * Enter command used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> keystroke.\n */\nexport default class EnterCommand extends Command {\n /**\n * @inheritDoc\n */\n execute() {\n this.editor.model.change(writer => {\n this.enterBlock(writer);\n this.fire('afterExecute', { writer });\n });\n }\n /**\n * Splits a block where the document selection is placed, in the way how the <kbd>Enter</kbd> key is expected to work:\n *\n * ```\n * <p>Foo[]bar</p> -> <p>Foo</p><p>[]bar</p>\n * <p>Foobar[]</p> -> <p>Foobar</p><p>[]</p>\n * <p>Fo[ob]ar</p> -> <p>Fo</p><p>[]ar</p>\n * ```\n *\n * In some cases, the split will not happen:\n *\n * ```\n * // The selection parent is a limit element:\n * <figcaption>A[bc]d</figcaption> -> <figcaption>A[]d</figcaption>\n *\n * // The selection spans over multiple elements:\n * <h>x[x</h><p>y]y<p> -> <h>x</h><p>[]y</p>\n * ```\n *\n * @param writer Writer to use when performing the enter action.\n * @returns Boolean indicating if the block was split.\n */\n enterBlock(writer) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const schema = model.schema;\n const isSelectionEmpty = selection.isCollapsed;\n const range = selection.getFirstRange();\n const startElement = range.start.parent;\n const endElement = range.end.parent;\n // Don't touch the roots and other limit elements.\n if (schema.isLimit(startElement) || schema.isLimit(endElement)) {\n // Delete the selected content but only if inside a single limit element.\n // Abort, when crossing limit elements boundary (e.g. <limit1>x[x</limit1>donttouchme<limit2>y]y</limit2>).\n // This is an edge case and it's hard to tell what should actually happen because such a selection\n // is not entirely valid.\n if (!isSelectionEmpty && startElement == endElement) {\n model.deleteContent(selection);\n }\n return false;\n }\n if (isSelectionEmpty) {\n const attributesToCopy = getCopyOnEnterAttributes(writer.model.schema, selection.getAttributes());\n splitBlock(writer, range.start);\n writer.setSelectionAttribute(attributesToCopy);\n return true;\n }\n else {\n const leaveUnmerged = !(range.start.isAtStart && range.end.isAtEnd);\n const isContainedWithinOneElement = (startElement == endElement);\n model.deleteContent(selection, { leaveUnmerged });\n if (leaveUnmerged) {\n // Partially selected elements.\n //\n // <h>x[xx]x</h>\t\t-> <h>x^x</h>\t\t\t-> <h>x</h><h>^x</h>\n if (isContainedWithinOneElement) {\n splitBlock(writer, selection.focus);\n return true;\n }\n // Selection over multiple elements.\n //\n // <h>x[x</h><p>y]y<p>\t-> <h>x^</h><p>y</p>\t-> <h>x</h><p>^y</p>\n else {\n writer.setSelection(endElement, 0);\n }\n }\n }\n return false;\n }\n}\nfunction splitBlock(writer, splitPos) {\n writer.split(splitPos);\n writer.setSelection(splitPos.parent.nextSibling, 0);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/enterobserver\n */\nimport { Observer, DomEventData, BubblingEventInfo } from '@ckeditor/ckeditor5-engine';\nimport { env } from '@ckeditor/ckeditor5-utils';\nconst ENTER_EVENT_TYPES = {\n insertParagraph: { isSoft: false },\n insertLineBreak: { isSoft: true }\n};\n/**\n * Enter observer introduces the {@link module:engine/view/document~Document#event:enter `Document#enter`} event.\n */\nexport default class EnterObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n const doc = this.document;\n let shiftPressed = false;\n doc.on('keydown', (evt, data) => {\n shiftPressed = data.shiftKey;\n });\n doc.on('beforeinput', (evt, data) => {\n if (!this.isEnabled) {\n return;\n }\n let inputType = data.inputType;\n // See https://github.com/ckeditor/ckeditor5/issues/13321.\n if (env.isSafari && shiftPressed && inputType == 'insertParagraph') {\n inputType = 'insertLineBreak';\n }\n const domEvent = data.domEvent;\n const enterEventSpec = ENTER_EVENT_TYPES[inputType];\n if (!enterEventSpec) {\n return;\n }\n const event = new BubblingEventInfo(doc, 'enter', data.targetRanges[0]);\n doc.fire(event, new DomEventData(view, domEvent, {\n isSoft: enterEventSpec.isSoft\n }));\n // Stop `beforeinput` event if `enter` event was stopped.\n // https://github.com/ckeditor/ckeditor5/issues/753\n if (event.stop.called) {\n evt.stop();\n }\n });\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/enter\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport EnterCommand from './entercommand.js';\nimport EnterObserver from './enterobserver.js';\n/**\n * This plugin handles the <kbd>Enter</kbd> keystroke (hard line break) in the editor.\n *\n * See also the {@link module:enter/shiftenter~ShiftEnter} plugin.\n *\n * For more information about this feature see the {@glink api/enter package page}.\n */\nexport default class Enter extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Enter';\n }\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const t = this.editor.t;\n view.addObserver(EnterObserver);\n editor.commands.add('enter', new EnterCommand(editor));\n this.listenTo(viewDocument, 'enter', (evt, data) => {\n // When not in composition, we handle the action, so prevent the default one.\n // When in composition, it's the browser who modify the DOM (renderer is disabled).\n if (!viewDocument.isComposing) {\n data.preventDefault();\n }\n // The soft enter key is handled by the ShiftEnter plugin.\n if (data.isSoft) {\n return;\n }\n editor.execute('enter');\n view.scrollToTheSelection();\n }, { priority: 'low' });\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Insert a hard break (a new paragraph)'),\n keystroke: 'Enter'\n }\n ]\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/shiftentercommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { getCopyOnEnterAttributes } from './utils.js';\n/**\n * ShiftEnter command. It is used by the {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature} to handle\n * the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke.\n */\nexport default class ShiftEnterCommand extends Command {\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const doc = model.document;\n model.change(writer => {\n softBreakAction(model, writer, doc.selection);\n this.fire('afterExecute', { writer });\n });\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.isEnabled = isEnabled(model.schema, doc.selection);\n }\n}\n/**\n * Checks whether the ShiftEnter command should be enabled in the specified selection.\n */\nfunction isEnabled(schema, selection) {\n // At this moment it is okay to support single range selections only.\n // But in the future we may need to change that.\n if (selection.rangeCount > 1) {\n return false;\n }\n const anchorPos = selection.anchor;\n // Check whether the break element can be inserted in the current selection anchor.\n if (!anchorPos || !schema.checkChild(anchorPos, 'softBreak')) {\n return false;\n }\n const range = selection.getFirstRange();\n const startElement = range.start.parent;\n const endElement = range.end.parent;\n // Do not modify the content if selection is cross-limit elements.\n if ((isInsideLimitElement(startElement, schema) || isInsideLimitElement(endElement, schema)) && startElement !== endElement) {\n return false;\n }\n return true;\n}\n/**\n * Creates a break in the way that the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke is expected to work.\n */\nfunction softBreakAction(model, writer, selection) {\n const isSelectionEmpty = selection.isCollapsed;\n const range = selection.getFirstRange();\n const startElement = range.start.parent;\n const endElement = range.end.parent;\n const isContainedWithinOneElement = (startElement == endElement);\n if (isSelectionEmpty) {\n const attributesToCopy = getCopyOnEnterAttributes(model.schema, selection.getAttributes());\n insertBreak(model, writer, range.end);\n writer.removeSelectionAttribute(selection.getAttributeKeys());\n writer.setSelectionAttribute(attributesToCopy);\n }\n else {\n const leaveUnmerged = !(range.start.isAtStart && range.end.isAtEnd);\n model.deleteContent(selection, { leaveUnmerged });\n // Selection within one element:\n //\n // <h>x[xx]x</h>\t\t-> <h>x^x</h>\t\t\t-> <h>x<br>^x</h>\n if (isContainedWithinOneElement) {\n insertBreak(model, writer, selection.focus);\n }\n // Selection over multiple elements.\n //\n // <h>x[x</h><p>y]y<p>\t-> <h>x^</h><p>y</p>\t-> <h>x</h><p>^y</p>\n //\n // We chose not to insert a line break in this case because:\n //\n // * it's not a very common scenario,\n // * it actually surprised me when I saw the \"expected behavior\" in real life.\n //\n // It's ok if the user will need to be more specific where they want the <br> to be inserted.\n else {\n // Move the selection to the 2nd element (last step of the example above).\n if (leaveUnmerged) {\n writer.setSelection(endElement, 0);\n }\n }\n }\n}\nfunction insertBreak(model, writer, position) {\n const breakLineElement = writer.createElement('softBreak');\n model.insertContent(breakLineElement, position);\n writer.setSelection(breakLineElement, 'after');\n}\n/**\n * Checks whether the specified `element` is a child of the limit element.\n *\n * Checking whether the `<p>` element is inside a limit element:\n * - `<$root><p>Text.</p></$root> => false`\n * - `<$root><limitElement><p>Text</p></limitElement></$root> => true`\n */\nfunction isInsideLimitElement(element, schema) {\n // `$root` is a limit element but in this case is an invalid element.\n if (element.is('rootElement')) {\n return false;\n }\n return schema.isLimit(element) || isInsideLimitElement(element.parent, schema);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/shiftenter\n */\nimport ShiftEnterCommand from './shiftentercommand.js';\nimport EnterObserver from './enterobserver.js';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n/**\n * This plugin handles the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke (soft line break) in the editor.\n *\n * See also the {@link module:enter/enter~Enter} plugin.\n *\n * For more information about this feature see the {@glink api/enter package page}.\n */\nexport default class ShiftEnter extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ShiftEnter';\n }\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const t = this.editor.t;\n // Configure the schema.\n schema.register('softBreak', {\n allowWhere: '$text',\n isInline: true\n });\n // Configure converters.\n conversion.for('upcast')\n .elementToElement({\n model: 'softBreak',\n view: 'br'\n });\n conversion.for('downcast')\n .elementToElement({\n model: 'softBreak',\n view: (modelElement, { writer }) => writer.createEmptyElement('br')\n });\n view.addObserver(EnterObserver);\n editor.commands.add('shiftEnter', new ShiftEnterCommand(editor));\n this.listenTo(viewDocument, 'enter', (evt, data) => {\n // When not in composition, we handle the action, so prevent the default one.\n // When in composition, it's the browser who modify the DOM (renderer is disabled).\n if (!viewDocument.isComposing) {\n data.preventDefault();\n }\n // The hard enter key is handled by the Enter plugin.\n if (!data.isSoft) {\n return;\n }\n editor.execute('shiftEnter');\n view.scrollToTheSelection();\n }, { priority: 'low' });\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Insert a soft break (a <code><br></code> element)'),\n keystroke: 'Shift+Enter'\n }\n ]\n });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widgettypearound.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widgettypearound.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* global DOMParser */\n/**\n * @module widget/widgettypearound/widgettypearound\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { Template } from '@ckeditor/ckeditor5-ui';\nimport { Enter } from '@ckeditor/ckeditor5-enter';\nimport { Delete } from '@ckeditor/ckeditor5-typing';\nimport { env, isForwardArrowKeyCode } from '@ckeditor/ckeditor5-utils';\nimport { isTypeAroundWidget, getClosestTypeAroundDomButton, getTypeAroundButtonPosition, getClosestWidgetViewElement, getTypeAroundFakeCaretPosition, TYPE_AROUND_SELECTION_ATTRIBUTE } from './utils.js';\nimport { isWidget } from '../utils.js';\nimport returnIcon from '../../theme/icons/return-arrow.svg';\nimport '../../theme/widgettypearound.css';\nconst POSSIBLE_INSERTION_POSITIONS = ['before', 'after'];\n// Do the SVG parsing once and then clone the result <svg> DOM element for each new button.\nconst RETURN_ARROW_ICON_ELEMENT = new DOMParser().parseFromString(returnIcon, 'image/svg+xml').firstChild;\nconst PLUGIN_DISABLED_EDITING_ROOT_CLASS = 'ck-widget__type-around_disabled';\n/**\n * A plugin that allows users to type around widgets where normally it is impossible to place the caret due\n * to limitations of web browsers. These \"tight spots\" occur, for instance, before (or after) a widget being\n * the first (or last) child of its parent or between two block widgets.\n *\n * This plugin extends the {@link module:widget/widget~Widget `Widget`} plugin and injects the user interface\n * with two buttons into each widget instance in the editor. Each of the buttons can be clicked by the\n * user if the widget is next to the \"tight spot\". Once clicked, a paragraph is created with the selection anchored\n * in it so that users can type (or insert content, paste, etc.) straight away.\n */\nexport default class WidgetTypeAround extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A reference to the model widget element that has the fake caret active\n * on either side of it. It is later used to remove CSS classes associated with the fake caret\n * when the widget no longer needs it.\n */\n this._currentFakeCaretModelElement = null;\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'WidgetTypeAround';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Enter, Delete];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n // Set a CSS class on the view editing root when the plugin is disabled so all the buttons\n // and lines visually disappear. All the interactions are disabled in individual plugin methods.\n this.on('change:isEnabled', (evt, data, isEnabled) => {\n editingView.change(writer => {\n for (const root of editingView.document.roots) {\n if (isEnabled) {\n writer.removeClass(PLUGIN_DISABLED_EDITING_ROOT_CLASS, root);\n }\n else {\n writer.addClass(PLUGIN_DISABLED_EDITING_ROOT_CLASS, root);\n }\n }\n });\n if (!isEnabled) {\n editor.model.change(writer => {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n });\n }\n });\n this._enableTypeAroundUIInjection();\n this._enableInsertingParagraphsOnButtonClick();\n this._enableInsertingParagraphsOnEnterKeypress();\n this._enableInsertingParagraphsOnTypingKeystroke();\n this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();\n this._enableDeleteIntegration();\n this._enableInsertContentIntegration();\n this._enableInsertObjectIntegration();\n this._enableDeleteContentIntegration();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._currentFakeCaretModelElement = null;\n }\n /**\n * Inserts a new paragraph next to a widget element with the selection anchored in it.\n *\n * **Note**: This method is heavily user-oriented and will both focus the editing view and scroll\n * the viewport to the selection in the inserted paragraph.\n *\n * @param widgetModelElement The model widget element next to which a paragraph is inserted.\n * @param position The position where the paragraph is inserted. Either `'before'` or `'after'` the widget.\n */\n _insertParagraph(widgetModelElement, position) {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const attributesToCopy = editor.model.schema.getAttributesWithProperty(widgetModelElement, 'copyOnReplace', true);\n editor.execute('insertParagraph', {\n position: editor.model.createPositionAt(widgetModelElement, position),\n attributes: attributesToCopy\n });\n editingView.focus();\n editingView.scrollToTheSelection();\n }\n /**\n * A wrapper for the {@link module:utils/emittermixin~Emitter#listenTo} method that executes the callbacks only\n * when the plugin {@link #isEnabled is enabled}.\n *\n * @param emitter The object that fires the event.\n * @param event The name of the event.\n * @param callback The function to be called on event.\n * @param options Additional options.\n * @param options.priority The priority of this event callback. The higher the priority value the sooner\n * the callback will be fired. Events having the same priority are called in the order they were added.\n */\n _listenToIfEnabled(emitter, event, callback, options) {\n this.listenTo(emitter, event, (...args) => {\n // Do not respond if the plugin is disabled.\n if (this.isEnabled) {\n callback(...args);\n }\n }, options);\n }\n /**\n * Similar to {@link #_insertParagraph}, this method inserts a paragraph except that it\n * does not expect a position. Instead, it performs the insertion next to a selected widget\n * according to the `widget-type-around` model selection attribute value (fake caret position).\n *\n * Because this method requires the `widget-type-around` attribute to be set,\n * the insertion can only happen when the widget's fake caret is active (e.g. activated\n * using the keyboard).\n *\n * @returns Returns `true` when the paragraph was inserted (the attribute was present) and `false` otherwise.\n */\n _insertParagraphAccordingToFakeCaretPosition() {\n const editor = this.editor;\n const model = editor.model;\n const modelSelection = model.document.selection;\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(modelSelection);\n if (!typeAroundFakeCaretPosition) {\n return false;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[WidgetTypeAround]%c Fake caret -> insert paragraph',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n const selectedModelElement = modelSelection.getSelectedElement();\n this._insertParagraph(selectedModelElement, typeAroundFakeCaretPosition);\n return true;\n }\n /**\n * Creates a listener in the editing conversion pipeline that injects the widget type around\n * UI into every single widget instance created in the editor.\n *\n * The UI is delivered as a {@link module:engine/view/uielement~UIElement}\n * wrapper which renders DOM buttons that users can use to insert paragraphs.\n */\n _enableTypeAroundUIInjection() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const t = editor.locale.t;\n const buttonTitles = {\n before: t('Insert paragraph before block'),\n after: t('Insert paragraph after block')\n };\n editor.editing.downcastDispatcher.on('insert', (evt, data, conversionApi) => {\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n if (!viewElement) {\n return;\n }\n // Filter out non-widgets and inline widgets.\n if (isTypeAroundWidget(viewElement, data.item, schema)) {\n injectUIIntoWidget(conversionApi.writer, buttonTitles, viewElement);\n const widgetLabel = viewElement.getCustomProperty('widgetLabel');\n widgetLabel.push(() => {\n return this.isEnabled ? t('Press Enter to type after or press Shift + Enter to type before the widget') : '';\n });\n }\n }, { priority: 'low' });\n }\n /**\n * Brings support for the fake caret that appears when either:\n *\n * * the selection moves to a widget from a position next to it using arrow keys,\n * * the arrow key is pressed when the widget is already selected.\n *\n * The fake caret lets the user know that they can start typing or just press\n * <kbd>Enter</kbd> to insert a paragraph at the position next to a widget as suggested by the fake caret.\n *\n * The fake caret disappears when the user changes the selection or the editor\n * gets blurred.\n *\n * The whole idea is as follows:\n *\n * 1. A user does one of the 2 scenarios described at the beginning.\n * 2. The \"keydown\" listener is executed and the decision is made whether to show or hide the fake caret.\n * 3. If it should show up, the `widget-type-around` model selection attribute is set indicating\n * on which side of the widget it should appear.\n * 4. The selection dispatcher reacts to the selection attribute and sets CSS classes responsible for the\n * fake caret on the view widget.\n * 5. If the fake caret should disappear, the selection attribute is removed and the dispatcher\n * does the CSS class clean-up in the view.\n * 6. Additionally, `change:range` and `FocusTracker#isFocused` listeners also remove the selection\n * attribute (the former also removes widget CSS classes).\n */\n _enableTypeAroundFakeCaretActivationUsingKeyboardArrows() {\n const editor = this.editor;\n const model = editor.model;\n const modelSelection = model.document.selection;\n const schema = model.schema;\n const editingView = editor.editing.view;\n // This is the main listener responsible for the fake caret.\n // Note: The priority must precede the default Widget class keydown handler (\"high\").\n this._listenToIfEnabled(editingView.document, 'arrowKey', (evt, domEventData) => {\n this._handleArrowKeyPress(evt, domEventData);\n }, { context: [isWidget, '$text'], priority: 'high' });\n // This listener makes sure the widget type around selection attribute will be gone from the model\n // selection as soon as the model range changes. This attribute only makes sense when a widget is selected\n // (and the \"fake horizontal caret\" is visible) so whenever the range changes (e.g. selection moved somewhere else),\n // let's get rid of the attribute so that the selection downcast dispatcher isn't even bothered.\n this._listenToIfEnabled(modelSelection, 'change:range', (evt, data) => {\n // Do not reset the selection attribute when the change was indirect.\n if (!data.directChange) {\n return;\n }\n // Get rid of the widget type around attribute of the selection on every change:range.\n // If the range changes, it means for sure, the user is no longer in the active (\"fake horizontal caret\") mode.\n editor.model.change(writer => {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n });\n });\n // Get rid of the widget type around attribute of the selection on every document change\n // that makes widget not selected any more (i.e. widget was removed).\n this._listenToIfEnabled(model.document, 'change:data', () => {\n const selectedModelElement = modelSelection.getSelectedElement();\n if (selectedModelElement) {\n const selectedViewElement = editor.editing.mapper.toViewElement(selectedModelElement);\n if (isTypeAroundWidget(selectedViewElement, selectedModelElement, schema)) {\n return;\n }\n }\n editor.model.change(writer => {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n });\n });\n // React to changes of the model selection attribute made by the arrow keys listener.\n // If the block widget is selected and the attribute changes, downcast the attribute to special\n // CSS classes associated with the active (\"fake horizontal caret\") mode of the widget.\n this._listenToIfEnabled(editor.editing.downcastDispatcher, 'selection', (evt, data, conversionApi) => {\n const writer = conversionApi.writer;\n if (this._currentFakeCaretModelElement) {\n const selectedViewElement = conversionApi.mapper.toViewElement(this._currentFakeCaretModelElement);\n if (selectedViewElement) {\n // Get rid of CSS classes associated with the active (\"fake horizontal caret\") mode from the view widget.\n writer.removeClass(POSSIBLE_INSERTION_POSITIONS.map(positionToWidgetCssClass), selectedViewElement);\n this._currentFakeCaretModelElement = null;\n }\n }\n const selectedModelElement = data.selection.getSelectedElement();\n if (!selectedModelElement) {\n return;\n }\n const selectedViewElement = conversionApi.mapper.toViewElement(selectedModelElement);\n if (!isTypeAroundWidget(selectedViewElement, selectedModelElement, schema)) {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(data.selection);\n if (!typeAroundFakeCaretPosition) {\n return;\n }\n writer.addClass(positionToWidgetCssClass(typeAroundFakeCaretPosition), selectedViewElement);\n // Remember the view widget that got the \"fake-caret\" CSS class. This class should be removed ASAP when the\n // selection changes\n this._currentFakeCaretModelElement = selectedModelElement;\n });\n this._listenToIfEnabled(editor.ui.focusTracker, 'change:isFocused', (evt, name, isFocused) => {\n if (!isFocused) {\n editor.model.change(writer => {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n });\n }\n });\n function positionToWidgetCssClass(position) {\n return `ck-widget_type-around_show-fake-caret_${position}`;\n }\n }\n /**\n * A listener executed on each \"keydown\" in the view document, a part of\n * {@link #_enableTypeAroundFakeCaretActivationUsingKeyboardArrows}.\n *\n * It decides whether the arrow keypress should activate the fake caret or not (also whether it should\n * be deactivated).\n *\n * The fake caret activation is done by setting the `widget-type-around` model selection attribute\n * in this listener, and stopping and preventing the event that would normally be handled by the widget\n * plugin that is responsible for the regular keyboard navigation near/across all widgets (that\n * includes inline widgets, which are ignored by the widget type around plugin).\n */\n _handleArrowKeyPress(evt, domEventData) {\n const editor = this.editor;\n const model = editor.model;\n const modelSelection = model.document.selection;\n const schema = model.schema;\n const editingView = editor.editing.view;\n const keyCode = domEventData.keyCode;\n const isForward = isForwardArrowKeyCode(keyCode, editor.locale.contentLanguageDirection);\n const selectedViewElement = editingView.document.selection.getSelectedElement();\n const selectedModelElement = editor.editing.mapper.toModelElement(selectedViewElement);\n let shouldStopAndPreventDefault;\n // Handle keyboard navigation when a type-around-compatible widget is currently selected.\n if (isTypeAroundWidget(selectedViewElement, selectedModelElement, schema)) {\n shouldStopAndPreventDefault = this._handleArrowKeyPressOnSelectedWidget(isForward);\n }\n // Handle keyboard arrow navigation when the selection is next to a type-around-compatible widget\n // and the widget is about to be selected.\n else if (modelSelection.isCollapsed) {\n shouldStopAndPreventDefault = this._handleArrowKeyPressWhenSelectionNextToAWidget(isForward);\n }\n // Handle collapsing a non-collapsed selection that is wider than on a single widget.\n else if (!domEventData.shiftKey) {\n shouldStopAndPreventDefault = this._handleArrowKeyPressWhenNonCollapsedSelection(isForward);\n }\n if (shouldStopAndPreventDefault) {\n domEventData.preventDefault();\n evt.stop();\n }\n }\n /**\n * Handles the keyboard navigation on \"keydown\" when a widget is currently selected and activates or deactivates\n * the fake caret for that widget, depending on the current value of the `widget-type-around` model\n * selection attribute and the direction of the pressed arrow key.\n *\n * @param isForward `true` when the pressed arrow key was responsible for the forward model selection movement\n * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.\n * @returns Returns `true` when the keypress was handled and no other keydown listener of the editor should\n * process the event any further. Returns `false` otherwise.\n */\n _handleArrowKeyPressOnSelectedWidget(isForward) {\n const editor = this.editor;\n const model = editor.model;\n const modelSelection = model.document.selection;\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(modelSelection);\n return model.change(writer => {\n // If the fake caret is displayed...\n if (typeAroundFakeCaretPosition) {\n const isLeavingWidget = typeAroundFakeCaretPosition === (isForward ? 'after' : 'before');\n // If the keyboard arrow works against the value of the selection attribute...\n // then remove the selection attribute but prevent default DOM actions\n // and do not let the Widget plugin listener move the selection. This brings\n // the widget back to the state, for instance, like if was selected using the mouse.\n //\n // **Note**: If leaving the widget when the fake caret is active, then the default\n // Widget handler will change the selection and, in turn, this will automatically discard\n // the selection attribute.\n if (!isLeavingWidget) {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n return true;\n }\n }\n // If the fake caret wasn't displayed, let's set it now according to the direction of the arrow\n // key press. This also means we cannot let the Widget plugin listener move the selection.\n else {\n writer.setSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE, isForward ? 'after' : 'before');\n return true;\n }\n return false;\n });\n }\n /**\n * Handles the keyboard navigation on \"keydown\" when **no** widget is selected but the selection is **directly** next\n * to one and upon the fake caret should become active for this widget upon arrow keypress\n * (AKA entering/selecting the widget).\n *\n * **Note**: This code mirrors the implementation from the widget plugin but also adds the selection attribute.\n * Unfortunately, there is no safe way to let the widget plugin do the selection part first and then just set the\n * selection attribute here in the widget type around plugin. This is why this code must duplicate some from the widget plugin.\n *\n * @param isForward `true` when the pressed arrow key was responsible for the forward model selection movement\n * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.\n * @returns Returns `true` when the keypress was handled and no other keydown listener of the editor should\n * process the event any further. Returns `false` otherwise.\n */\n _handleArrowKeyPressWhenSelectionNextToAWidget(isForward) {\n const editor = this.editor;\n const model = editor.model;\n const schema = model.schema;\n const widgetPlugin = editor.plugins.get('Widget');\n // This is the widget the selection is about to be set on.\n const modelElementNextToSelection = widgetPlugin._getObjectElementNextToSelection(isForward);\n const viewElementNextToSelection = editor.editing.mapper.toViewElement(modelElementNextToSelection);\n if (isTypeAroundWidget(viewElementNextToSelection, modelElementNextToSelection, schema)) {\n model.change(writer => {\n widgetPlugin._setSelectionOverElement(modelElementNextToSelection);\n writer.setSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE, isForward ? 'before' : 'after');\n });\n // The change() block above does the same job as the Widget plugin. The event can\n // be safely canceled.\n return true;\n }\n return false;\n }\n /**\n * Handles the keyboard navigation on \"keydown\" when a widget is currently selected (together with some other content)\n * and the widget is the first or last element in the selection. It activates or deactivates the fake caret for that widget.\n *\n * @param isForward `true` when the pressed arrow key was responsible for the forward model selection movement\n * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.\n * @returns Returns `true` when the keypress was handled and no other keydown listener of the editor should\n * process the event any further. Returns `false` otherwise.\n */\n _handleArrowKeyPressWhenNonCollapsedSelection(isForward) {\n const editor = this.editor;\n const model = editor.model;\n const schema = model.schema;\n const mapper = editor.editing.mapper;\n const modelSelection = model.document.selection;\n const selectedModelNode = isForward ?\n modelSelection.getLastPosition().nodeBefore :\n modelSelection.getFirstPosition().nodeAfter;\n const selectedViewNode = mapper.toViewElement(selectedModelNode);\n // There is a widget at the collapse position so collapse the selection to the fake caret on it.\n if (isTypeAroundWidget(selectedViewNode, selectedModelNode, schema)) {\n model.change(writer => {\n writer.setSelection(selectedModelNode, 'on');\n writer.setSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE, isForward ? 'after' : 'before');\n });\n return true;\n }\n return false;\n }\n /**\n * Registers a `mousedown` listener for the view document which intercepts events\n * coming from the widget type around UI, which happens when a user clicks one of the buttons\n * that insert a paragraph next to a widget.\n */\n _enableInsertingParagraphsOnButtonClick() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n this._listenToIfEnabled(editingView.document, 'mousedown', (evt, domEventData) => {\n const button = getClosestTypeAroundDomButton(domEventData.domTarget);\n if (!button) {\n return;\n }\n const buttonPosition = getTypeAroundButtonPosition(button);\n const widgetViewElement = getClosestWidgetViewElement(button, editingView.domConverter);\n const widgetModelElement = editor.editing.mapper.toModelElement(widgetViewElement);\n this._insertParagraph(widgetModelElement, buttonPosition);\n domEventData.preventDefault();\n evt.stop();\n });\n }\n /**\n * Creates the <kbd>Enter</kbd> key listener on the view document that allows the user to insert a paragraph\n * near the widget when either:\n *\n * * The fake caret was first activated using the arrow keys,\n * * The entire widget is selected in the model.\n *\n * In the first case, the new paragraph is inserted according to the `widget-type-around` selection\n * attribute (see {@link #_handleArrowKeyPress}).\n *\n * In the second case, the new paragraph is inserted based on whether a soft (<kbd>Shift</kbd>+<kbd>Enter</kbd>) keystroke\n * was pressed or not.\n */\n _enableInsertingParagraphsOnEnterKeypress() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const editingView = editor.editing.view;\n this._listenToIfEnabled(editingView.document, 'enter', (evt, domEventData) => {\n // This event could be triggered from inside the widget but we are interested\n // only when the widget is selected itself.\n if (evt.eventPhase != 'atTarget') {\n return;\n }\n const selectedModelElement = selection.getSelectedElement();\n const selectedViewElement = editor.editing.mapper.toViewElement(selectedModelElement);\n const schema = editor.model.schema;\n let wasHandled;\n // First check if the widget is selected and there's a type around selection attribute associated\n // with the fake caret that would tell where to insert a new paragraph.\n if (this._insertParagraphAccordingToFakeCaretPosition()) {\n wasHandled = true;\n }\n // Then, if there is no selection attribute associated with the fake caret, check if the widget\n // simply is selected and create a new paragraph according to the keystroke (Shift+)Enter.\n else if (isTypeAroundWidget(selectedViewElement, selectedModelElement, schema)) {\n this._insertParagraph(selectedModelElement, domEventData.isSoft ? 'before' : 'after');\n wasHandled = true;\n }\n if (wasHandled) {\n domEventData.preventDefault();\n evt.stop();\n }\n }, { context: isWidget });\n }\n /**\n * Similar to the {@link #_enableInsertingParagraphsOnEnterKeypress}, it allows the user\n * to insert a paragraph next to a widget when the fake caret was activated using arrow\n * keys but it responds to typing instead of <kbd>Enter</kbd>.\n *\n * Listener enabled by this method will insert a new paragraph according to the `widget-type-around`\n * model selection attribute as the user simply starts typing, which creates the impression that the fake caret\n * behaves like a real one rendered by the browser (AKA your text appears where the caret was).\n *\n * **Note**: At the moment this listener creates 2 undo steps: one for the `insertParagraph` command\n * and another one for actual typing. It is not a disaster but this may need to be fixed\n * sooner or later.\n */\n _enableInsertingParagraphsOnTypingKeystroke() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n // Note: The priority must precede the default Input plugin insertText handler.\n this._listenToIfEnabled(viewDocument, 'insertText', (evt, data) => {\n if (this._insertParagraphAccordingToFakeCaretPosition()) {\n // The view selection in the event data contains the widget. If the new paragraph\n // was inserted, modify the view selection passed along with the insertText event\n // so the default event handler in the Input plugin starts typing inside the paragraph.\n // Otherwise, the typing would be over the widget.\n data.selection = viewDocument.selection;\n }\n }, { priority: 'high' });\n if (env.isAndroid) {\n // On Android with English keyboard, the composition starts just by putting caret\n // at the word end or by selecting a table column. This is not a real composition started.\n // Trigger delete content on first composition key pressed.\n this._listenToIfEnabled(viewDocument, 'keydown', (evt, data) => {\n if (data.keyCode == 229) {\n this._insertParagraphAccordingToFakeCaretPosition();\n }\n });\n }\n else {\n // Note: The priority must precede the default Input plugin compositionstart handler (to call it before delete content).\n this._listenToIfEnabled(viewDocument, 'compositionstart', () => {\n this._insertParagraphAccordingToFakeCaretPosition();\n }, { priority: 'high' });\n }\n }\n /**\n * It creates a \"delete\" event listener on the view document to handle cases when the <kbd>Delete</kbd> or <kbd>Backspace</kbd>\n * is pressed and the fake caret is currently active.\n *\n * The fake caret should create an illusion of a real browser caret so that when it appears before or after\n * a widget, pressing <kbd>Delete</kbd> or <kbd>Backspace</kbd> should remove a widget or delete the content\n * before or after a widget (depending on the content surrounding the widget).\n */\n _enableDeleteIntegration() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const model = editor.model;\n const schema = model.schema;\n this._listenToIfEnabled(editingView.document, 'delete', (evt, domEventData) => {\n // This event could be triggered from inside the widget but we are interested\n // only when the widget is selected itself.\n if (evt.eventPhase != 'atTarget') {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(model.document.selection);\n // This listener handles only these cases when the fake caret is active.\n if (!typeAroundFakeCaretPosition) {\n return;\n }\n const direction = domEventData.direction;\n const selectedModelWidget = model.document.selection.getSelectedElement();\n const isFakeCaretBefore = typeAroundFakeCaretPosition === 'before';\n const isDeleteForward = direction == 'forward';\n const shouldDeleteEntireWidget = isFakeCaretBefore === isDeleteForward;\n if (shouldDeleteEntireWidget) {\n editor.execute('delete', {\n selection: model.createSelection(selectedModelWidget, 'on')\n });\n }\n else {\n const range = schema.getNearestSelectionRange(model.createPositionAt(selectedModelWidget, typeAroundFakeCaretPosition), direction);\n // If there is somewhere to move selection to, then there will be something to delete.\n if (range) {\n // If the range is NOT collapsed, then we know that the range contains an object (see getNearestSelectionRange() docs).\n if (!range.isCollapsed) {\n model.change(writer => {\n writer.setSelection(range);\n editor.execute(isDeleteForward ? 'deleteForward' : 'delete');\n });\n }\n else {\n const probe = model.createSelection(range.start);\n model.modifySelection(probe, { direction });\n // If the range is collapsed, let's see if a non-collapsed range exists that can could be deleted.\n // If such range exists, use the editor command because it it safe for collaboration (it merges where it can).\n if (!probe.focus.isEqual(range.start)) {\n model.change(writer => {\n writer.setSelection(range);\n editor.execute(isDeleteForward ? 'deleteForward' : 'delete');\n });\n }\n // If there is no non-collapsed range to be deleted then we are sure that there is an empty element\n // next to a widget that should be removed. \"delete\" and \"deleteForward\" commands cannot get rid of it\n // so calling Model#deleteContent here manually.\n else {\n const deepestEmptyRangeAncestor = getDeepestEmptyElementAncestor(schema, range.start.parent);\n model.deleteContent(model.createSelection(deepestEmptyRangeAncestor, 'on'), {\n doNotAutoparagraph: true\n });\n }\n }\n }\n }\n // If some content was deleted, don't let the handler from the Widget plugin kick in.\n // If nothing was deleted, then the default handler will have nothing to do anyway.\n domEventData.preventDefault();\n evt.stop();\n }, { context: isWidget });\n }\n /**\n * Attaches the {@link module:engine/model/model~Model#event:insertContent} event listener that, for instance, allows the user to paste\n * content near a widget when the fake caret is first activated using the arrow keys.\n *\n * The content is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).\n */\n _enableInsertContentIntegration() {\n const editor = this.editor;\n const model = this.editor.model;\n const documentSelection = model.document.selection;\n this._listenToIfEnabled(editor.model, 'insertContent', (evt, [content, selectable]) => {\n if (selectable && !selectable.is('documentSelection')) {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(documentSelection);\n if (!typeAroundFakeCaretPosition) {\n return;\n }\n evt.stop();\n return model.change(writer => {\n const selectedElement = documentSelection.getSelectedElement();\n const position = model.createPositionAt(selectedElement, typeAroundFakeCaretPosition);\n const selection = writer.createSelection(position);\n const result = model.insertContent(content, selection);\n writer.setSelection(selection);\n return result;\n });\n }, { priority: 'high' });\n }\n /**\n * Attaches the {@link module:engine/model/model~Model#event:insertObject} event listener that modifies the\n * `options.findOptimalPosition`parameter to position of fake caret in relation to selected element\n * to reflect user's intent of desired insertion position.\n *\n * The object is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).\n */\n _enableInsertObjectIntegration() {\n const editor = this.editor;\n const model = this.editor.model;\n const documentSelection = model.document.selection;\n this._listenToIfEnabled(editor.model, 'insertObject', (evt, args) => {\n const [, selectable, options = {}] = args;\n if (selectable && !selectable.is('documentSelection')) {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(documentSelection);\n if (!typeAroundFakeCaretPosition) {\n return;\n }\n options.findOptimalPosition = typeAroundFakeCaretPosition;\n args[3] = options;\n }, { priority: 'high' });\n }\n /**\n * Attaches the {@link module:engine/model/model~Model#event:deleteContent} event listener to block the event when the fake\n * caret is active.\n *\n * This is required for cases that trigger {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}\n * before calling {@link module:engine/model/model~Model#insertContent `model.insertContent()`} like, for instance,\n * plain text pasting.\n */\n _enableDeleteContentIntegration() {\n const editor = this.editor;\n const model = this.editor.model;\n const documentSelection = model.document.selection;\n this._listenToIfEnabled(editor.model, 'deleteContent', (evt, [selection]) => {\n if (selection && !selection.is('documentSelection')) {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(documentSelection);\n // Disable removing the selection content while pasting plain text.\n if (typeAroundFakeCaretPosition) {\n evt.stop();\n }\n }, { priority: 'high' });\n }\n}\n/**\n * Injects the type around UI into a view widget instance.\n */\nfunction injectUIIntoWidget(viewWriter, buttonTitles, widgetViewElement) {\n const typeAroundWrapper = viewWriter.createUIElement('div', {\n class: 'ck ck-reset_all ck-widget__type-around'\n }, function (domDocument) {\n const wrapperDomElement = this.toDomElement(domDocument);\n injectButtons(wrapperDomElement, buttonTitles);\n injectFakeCaret(wrapperDomElement);\n return wrapperDomElement;\n });\n // Inject the type around wrapper into the widget's wrapper.\n viewWriter.insert(viewWriter.createPositionAt(widgetViewElement, 'end'), typeAroundWrapper);\n}\n/**\n * FYI: Not using the IconView class because each instance would need to be destroyed to avoid memory leaks\n * and it's pretty hard to figure out when a view (widget) is gone for good so it's cheaper to use raw\n * <svg> here.\n */\nfunction injectButtons(wrapperDomElement, buttonTitles) {\n for (const position of POSSIBLE_INSERTION_POSITIONS) {\n const buttonTemplate = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-widget__type-around__button',\n `ck-widget__type-around__button_${position}`\n ],\n title: buttonTitles[position],\n 'aria-hidden': 'true'\n },\n children: [\n wrapperDomElement.ownerDocument.importNode(RETURN_ARROW_ICON_ELEMENT, true)\n ]\n });\n wrapperDomElement.appendChild(buttonTemplate.render());\n }\n}\nfunction injectFakeCaret(wrapperDomElement) {\n const caretTemplate = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-widget__type-around__fake-caret'\n ]\n }\n });\n wrapperDomElement.appendChild(caretTemplate.render());\n}\n/**\n * Returns the ancestor of an element closest to the root which is empty. For instance,\n * for `<baz>`:\n *\n * ```\n * <foo>abc<bar><baz></baz></bar></foo>\n * ```\n *\n * it returns `<bar>`.\n */\nfunction getDeepestEmptyElementAncestor(schema, element) {\n let deepestEmptyAncestor = element;\n for (const ancestor of element.getAncestors({ parentFirst: true })) {\n if (ancestor.childCount > 1 || schema.isLimit(ancestor)) {\n break;\n }\n deepestEmptyAncestor = ancestor;\n }\n return deepestEmptyAncestor;\n}\n","export default \"<svg viewBox=\\\"0 0 10 8\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/verticalnavigation\n */\nimport { keyCodes, Rect } from '@ckeditor/ckeditor5-utils';\n/**\n * Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.\n *\n * @param editing The editing controller.\n */\nexport default function verticalNavigationHandler(editing) {\n const model = editing.model;\n return (evt, data) => {\n const arrowUpPressed = data.keyCode == keyCodes.arrowup;\n const arrowDownPressed = data.keyCode == keyCodes.arrowdown;\n const expandSelection = data.shiftKey;\n const selection = model.document.selection;\n if (!arrowUpPressed && !arrowDownPressed) {\n return;\n }\n const isForward = arrowDownPressed;\n // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.\n // Selection for sure will not approach any object.\n if (expandSelection && selectionWillShrink(selection, isForward)) {\n return;\n }\n // Find a range between selection and closest limit element.\n const range = findTextRangeFromSelection(editing, selection, isForward);\n // There is no selection position inside the limit element.\n if (!range) {\n return;\n }\n // If already at the edge of a limit element.\n if (range.isCollapsed) {\n // A collapsed selection at limit edge - nothing more to do.\n if (selection.isCollapsed) {\n return;\n }\n // A non collapsed selection is at the limit edge while expanding the selection - let others do their stuff.\n else if (expandSelection) {\n return;\n }\n }\n // If the range is a single line (there is no word wrapping) then move the selection to the position closest to the limit element.\n //\n // We can't move the selection directly to the isObject element (eg. table cell) because of dual position at the end/beginning\n // of wrapped line (it's at the same time at the end of one line and at the start of the next line).\n if (range.isCollapsed || isSingleLineRange(editing, range, isForward)) {\n model.change(writer => {\n const newPosition = isForward ? range.end : range.start;\n if (expandSelection) {\n const newSelection = model.createSelection(selection.anchor);\n newSelection.setFocus(newPosition);\n writer.setSelection(newSelection);\n }\n else {\n writer.setSelection(newPosition);\n }\n });\n evt.stop();\n data.preventDefault();\n data.stopPropagation();\n }\n };\n}\n/**\n * Finds the range between selection and closest limit element (in the direction of navigation).\n * The position next to limit element is adjusted to the closest allowed `$text` position.\n *\n * Returns `null` if, according to the schema, the resulting range cannot contain a `$text` element.\n *\n * @param editing The editing controller.\n * @param selection The current selection.\n * @param isForward The expected navigation direction.\n */\nfunction findTextRangeFromSelection(editing, selection, isForward) {\n const model = editing.model;\n if (isForward) {\n const startPosition = selection.isCollapsed ? selection.focus : selection.getLastPosition();\n const endPosition = getNearestNonInlineLimit(model, startPosition, 'forward');\n // There is no limit element, browser should handle this.\n if (!endPosition) {\n return null;\n }\n const range = model.createRange(startPosition, endPosition);\n const lastRangePosition = getNearestTextPosition(model.schema, range, 'backward');\n if (lastRangePosition) {\n return model.createRange(startPosition, lastRangePosition);\n }\n return null;\n }\n else {\n const endPosition = selection.isCollapsed ? selection.focus : selection.getFirstPosition();\n const startPosition = getNearestNonInlineLimit(model, endPosition, 'backward');\n // There is no limit element, browser should handle this.\n if (!startPosition) {\n return null;\n }\n const range = model.createRange(startPosition, endPosition);\n const firstRangePosition = getNearestTextPosition(model.schema, range, 'forward');\n if (firstRangePosition) {\n return model.createRange(firstRangePosition, endPosition);\n }\n return null;\n }\n}\n/**\n * Finds the limit element position that is closest to startPosition.\n *\n * @param direction Search direction.\n */\nfunction getNearestNonInlineLimit(model, startPosition, direction) {\n const schema = model.schema;\n const range = model.createRangeIn(startPosition.root);\n const walkerValueType = direction == 'forward' ? 'elementStart' : 'elementEnd';\n for (const { previousPosition, item, type } of range.getWalker({ startPosition, direction })) {\n if (schema.isLimit(item) && !schema.isInline(item)) {\n return previousPosition;\n }\n // Stop looking for isLimit element if the next element is a block element (it is for sure not single line).\n if (type == walkerValueType && schema.isBlock(item)) {\n return null;\n }\n }\n return null;\n}\n/**\n * Basing on the provided range, finds the first or last (depending on `direction`) position inside the range\n * that can contain `$text` (according to schema).\n *\n * @param schema The schema.\n * @param range The range to find the position in.\n * @param direction Search direction.\n * @returns The nearest selection position.\n *\n */\nfunction getNearestTextPosition(schema, range, direction) {\n const position = direction == 'backward' ? range.end : range.start;\n if (schema.checkChild(position, '$text')) {\n return position;\n }\n for (const { nextPosition } of range.getWalker({ direction })) {\n if (schema.checkChild(nextPosition, '$text')) {\n return nextPosition;\n }\n }\n return null;\n}\n/**\n * Checks if the DOM range corresponding to the provided model range renders as a single line by analyzing DOMRects\n * (verifying if they visually wrap content to the next line).\n *\n * @param editing The editing controller.\n * @param modelRange The current table cell content range.\n * @param isForward The expected navigation direction.\n */\nfunction isSingleLineRange(editing, modelRange, isForward) {\n const model = editing.model;\n const domConverter = editing.view.domConverter;\n // Wrapped lines contain exactly the same position at the end of current line\n // and at the beginning of next line. That position's client rect is at the end\n // of current line. In case of caret at first position of the last line that 'dual'\n // position would be detected as it's not the last line.\n if (isForward) {\n const probe = model.createSelection(modelRange.start);\n model.modifySelection(probe);\n // If the new position is at the end of the container then we can't use this position\n // because it would provide incorrect result for eg caption of image and selection\n // just before end of it. Also in this case there is no \"dual\" position.\n if (!probe.focus.isAtEnd && !modelRange.start.isEqual(probe.focus)) {\n modelRange = model.createRange(probe.focus, modelRange.end);\n }\n }\n const viewRange = editing.mapper.toViewRange(modelRange);\n const domRange = domConverter.viewRangeToDom(viewRange);\n const rects = Rect.getDomRangeRects(domRange);\n let boundaryVerticalPosition;\n for (const rect of rects) {\n if (boundaryVerticalPosition === undefined) {\n boundaryVerticalPosition = Math.round(rect.bottom);\n continue;\n }\n // Let's check if this rect is in new line.\n if (Math.round(rect.top) >= boundaryVerticalPosition) {\n return false;\n }\n boundaryVerticalPosition = Math.max(boundaryVerticalPosition, Math.round(rect.bottom));\n }\n return true;\n}\nfunction selectionWillShrink(selection, isForward) {\n return !selection.isCollapsed && selection.isBackward == isForward;\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widget.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widget.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widget\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { MouseObserver, TreeWalker } from '@ckeditor/ckeditor5-engine';\nimport { Delete } from '@ckeditor/ckeditor5-typing';\nimport { env, keyCodes, getLocalizedArrowKeyCodeDirection } from '@ckeditor/ckeditor5-utils';\nimport WidgetTypeAround from './widgettypearound/widgettypearound.js';\nimport verticalNavigationHandler from './verticalnavigation.js';\nimport { getLabel, isWidget, WIDGET_SELECTED_CLASS_NAME } from './utils.js';\nimport '../theme/widget.css';\n/**\n * The widget plugin. It enables base support for widgets.\n *\n * See {@glink api/widget package page} for more details and documentation.\n *\n * This plugin enables multiple behaviors required by widgets:\n *\n * * The model to view selection converter for the editing pipeline (it handles widget custom selection rendering).\n * If a converted selection wraps around a widget element, that selection is marked as\n * {@link module:engine/view/selection~Selection#isFake fake}. Additionally, the `ck-widget_selected` CSS class\n * is added to indicate that widget has been selected.\n * * The mouse and keyboard events handling on and around widget elements.\n */\nexport default class Widget extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * Holds previously selected widgets.\n */\n this._previouslySelected = new Set();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Widget';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetTypeAround, Delete];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const t = editor.t;\n // Model to view selection converter.\n // Converts selection placed over widget element to fake selection.\n //\n // By default, the selection is downcasted by the engine to surround the attribute element, even though its only\n // child is an inline widget. A similar thing also happens when a collapsed marker is rendered as a UI element\n // next to an inline widget: the view selection contains both the widget and the marker.\n //\n // This prevents creating a correct fake selection when this inline widget is selected. Normalize the selection\n // in these cases based on the model:\n //\n //\t\t[<attributeElement><inlineWidget /></attributeElement>] -> <attributeElement>[<inlineWidget />]</attributeElement>\n //\t\t[<uiElement></uiElement><inlineWidget />] -> <uiElement></uiElement>[<inlineWidget />]\n //\n // Thanks to this:\n //\n // * fake selection can be set correctly,\n // * any logic depending on (View)Selection#getSelectedElement() also works OK.\n //\n // See https://github.com/ckeditor/ckeditor5/issues/9524.\n this.editor.editing.downcastDispatcher.on('selection', (evt, data, conversionApi) => {\n const viewWriter = conversionApi.writer;\n const modelSelection = data.selection;\n // The collapsed selection can't contain any widget.\n if (modelSelection.isCollapsed) {\n return;\n }\n const selectedModelElement = modelSelection.getSelectedElement();\n if (!selectedModelElement) {\n return;\n }\n const selectedViewElement = editor.editing.mapper.toViewElement(selectedModelElement);\n if (!isWidget(selectedViewElement)) {\n return;\n }\n if (!conversionApi.consumable.consume(modelSelection, 'selection')) {\n return;\n }\n viewWriter.setSelection(viewWriter.createRangeOn(selectedViewElement), {\n fake: true,\n label: getLabel(selectedViewElement)\n });\n });\n // Mark all widgets inside the selection with the css class.\n // This handler is registered at the 'low' priority so it's triggered after the real selection conversion.\n this.editor.editing.downcastDispatcher.on('selection', (evt, data, conversionApi) => {\n // Remove selected class from previously selected widgets.\n this._clearPreviouslySelectedWidgets(conversionApi.writer);\n const viewWriter = conversionApi.writer;\n const viewSelection = viewWriter.document.selection;\n let lastMarked = null;\n for (const range of viewSelection.getRanges()) {\n // Note: There could be multiple selected widgets in a range but no fake selection.\n // All of them must be marked as selected, for instance [<widget></widget><widget></widget>]\n for (const value of range) {\n const node = value.item;\n // Do not mark nested widgets in selected one. See: #4594\n if (isWidget(node) && !isChild(node, lastMarked)) {\n viewWriter.addClass(WIDGET_SELECTED_CLASS_NAME, node);\n this._previouslySelected.add(node);\n lastMarked = node;\n }\n }\n }\n }, { priority: 'low' });\n // If mouse down is pressed on widget - create selection over whole widget.\n view.addObserver(MouseObserver);\n this.listenTo(viewDocument, 'mousedown', (...args) => this._onMousedown(...args));\n // There are two keydown listeners working on different priorities. This allows other\n // features such as WidgetTypeAround or TableKeyboard to attach their listeners in between\n // and customize the behavior even further in different content/selection scenarios.\n //\n // * The first listener handles changing the selection on arrow key press\n // if the widget is selected or if the selection is next to a widget and the widget\n // should become selected upon the arrow key press.\n //\n // * The second (late) listener makes sure the default browser action on arrow key press is\n // prevented when a widget is selected. This prevents the selection from being moved\n // from a fake selection container.\n this.listenTo(viewDocument, 'arrowKey', (...args) => {\n this._handleSelectionChangeOnArrowKeyPress(...args);\n }, { context: [isWidget, '$text'] });\n this.listenTo(viewDocument, 'arrowKey', (...args) => {\n this._preventDefaultOnArrowKeyPress(...args);\n }, { context: '$root' });\n this.listenTo(viewDocument, 'arrowKey', verticalNavigationHandler(this.editor.editing), { context: '$text' });\n // Handle custom delete behaviour.\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n if (this._handleDelete(data.direction == 'forward')) {\n data.preventDefault();\n evt.stop();\n }\n }, { context: '$root' });\n // Handle Tab key while a widget is selected.\n this.listenTo(viewDocument, 'tab', (evt, data) => {\n // This event could be triggered from inside the widget, but we are interested\n // only when the widget is selected itself.\n if (evt.eventPhase != 'atTarget') {\n return;\n }\n if (data.shiftKey) {\n return;\n }\n if (this._selectFirstNestedEditable()) {\n data.preventDefault();\n evt.stop();\n }\n }, { context: isWidget, priority: 'low' });\n // Handle Shift+Tab key while caret inside a widget editable.\n this.listenTo(viewDocument, 'tab', (evt, data) => {\n if (!data.shiftKey) {\n return;\n }\n if (this._selectAncestorWidget()) {\n data.preventDefault();\n evt.stop();\n }\n }, { priority: 'low' });\n // Handle Esc key while inside a nested editable.\n this.listenTo(viewDocument, 'keydown', (evt, data) => {\n if (data.keystroke != keyCodes.esc) {\n return;\n }\n if (this._selectAncestorWidget()) {\n data.preventDefault();\n evt.stop();\n }\n }, { priority: 'low' });\n // Add the information about the keystrokes to the accessibility database.\n editor.accessibility.addKeystrokeInfoGroup({\n id: 'widget',\n label: t('Keystrokes that can be used when a widget is selected (for example: image, table, etc.)'),\n keystrokes: [\n {\n label: t('Move focus from an editable area back to the parent widget'),\n keystroke: 'Esc'\n },\n {\n label: t('Insert a new paragraph directly after a widget'),\n keystroke: 'Enter'\n },\n {\n label: t('Insert a new paragraph directly before a widget'),\n keystroke: 'Shift+Enter'\n },\n {\n label: t('Move the caret to allow typing directly before a widget'),\n keystroke: [['arrowup'], ['arrowleft']]\n },\n {\n label: t('Move the caret to allow typing directly after a widget'),\n keystroke: [['arrowdown'], ['arrowright']]\n }\n ]\n });\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:mousedown mousedown} events on widget elements.\n */\n _onMousedown(eventInfo, domEventData) {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n let element = domEventData.target;\n // If triple click should select entire paragraph.\n if (domEventData.domEvent.detail >= 3) {\n if (this._selectBlockContent(element)) {\n domEventData.preventDefault();\n }\n return;\n }\n // Do nothing for single or double click inside nested editable.\n if (isInsideNestedEditable(element)) {\n return;\n }\n // If target is not a widget element - check if one of the ancestors is.\n if (!isWidget(element)) {\n element = element.findAncestor(isWidget);\n if (!element) {\n return;\n }\n }\n // On Android selection would jump to the first table cell, on other devices\n // we can't block it (and don't need to) because of drag and drop support.\n if (env.isAndroid) {\n domEventData.preventDefault();\n }\n // Focus editor if is not focused already.\n if (!viewDocument.isFocused) {\n view.focus();\n }\n // Create model selection over widget.\n const modelElement = editor.editing.mapper.toModelElement(element);\n this._setSelectionOverElement(modelElement);\n }\n /**\n * Selects entire block content, e.g. on triple click it selects entire paragraph.\n */\n _selectBlockContent(element) {\n const editor = this.editor;\n const model = editor.model;\n const mapper = editor.editing.mapper;\n const schema = model.schema;\n const viewElement = mapper.findMappedViewAncestor(this.editor.editing.view.createPositionAt(element, 0));\n const modelElement = findTextBlockAncestor(mapper.toModelElement(viewElement), model.schema);\n if (!modelElement) {\n return false;\n }\n model.change(writer => {\n const nextTextBlock = !schema.isLimit(modelElement) ?\n findNextTextBlock(writer.createPositionAfter(modelElement), schema) :\n null;\n const start = writer.createPositionAt(modelElement, 0);\n const end = nextTextBlock ?\n writer.createPositionAt(nextTextBlock, 0) :\n writer.createPositionAt(modelElement, 'end');\n writer.setSelection(writer.createRange(start, end));\n });\n return true;\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and changes\n * the model selection when:\n *\n * * arrow key is pressed when the widget is selected,\n * * the selection is next to a widget and the widget should become selected upon the arrow key press.\n *\n * See {@link #_preventDefaultOnArrowKeyPress}.\n */\n _handleSelectionChangeOnArrowKeyPress(eventInfo, domEventData) {\n const keyCode = domEventData.keyCode;\n const model = this.editor.model;\n const schema = model.schema;\n const modelSelection = model.document.selection;\n const objectElement = modelSelection.getSelectedElement();\n const direction = getLocalizedArrowKeyCodeDirection(keyCode, this.editor.locale.contentLanguageDirection);\n const isForward = direction == 'down' || direction == 'right';\n const isVerticalNavigation = direction == 'up' || direction == 'down';\n // If object element is selected.\n if (objectElement && schema.isObject(objectElement)) {\n const position = isForward ? modelSelection.getLastPosition() : modelSelection.getFirstPosition();\n const newRange = schema.getNearestSelectionRange(position, isForward ? 'forward' : 'backward');\n if (newRange) {\n model.change(writer => {\n writer.setSelection(newRange);\n });\n domEventData.preventDefault();\n eventInfo.stop();\n }\n return;\n }\n // Handle collapsing of the selection when there is any widget on the edge of selection.\n // This is needed because browsers have problems with collapsing such selection.\n if (!modelSelection.isCollapsed && !domEventData.shiftKey) {\n const firstPosition = modelSelection.getFirstPosition();\n const lastPosition = modelSelection.getLastPosition();\n const firstSelectedNode = firstPosition.nodeAfter;\n const lastSelectedNode = lastPosition.nodeBefore;\n if (firstSelectedNode && schema.isObject(firstSelectedNode) || lastSelectedNode && schema.isObject(lastSelectedNode)) {\n model.change(writer => {\n writer.setSelection(isForward ? lastPosition : firstPosition);\n });\n domEventData.preventDefault();\n eventInfo.stop();\n }\n return;\n }\n // Return if not collapsed.\n if (!modelSelection.isCollapsed) {\n return;\n }\n // If selection is next to object element.\n const objectElementNextToSelection = this._getObjectElementNextToSelection(isForward);\n if (objectElementNextToSelection && schema.isObject(objectElementNextToSelection)) {\n // Do not select an inline widget while handling up/down arrow.\n if (schema.isInline(objectElementNextToSelection) && isVerticalNavigation) {\n return;\n }\n this._setSelectionOverElement(objectElementNextToSelection);\n domEventData.preventDefault();\n eventInfo.stop();\n }\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and prevents\n * the default browser behavior to make sure the fake selection is not being moved from a fake selection\n * container.\n *\n * See {@link #_handleSelectionChangeOnArrowKeyPress}.\n */\n _preventDefaultOnArrowKeyPress(eventInfo, domEventData) {\n const model = this.editor.model;\n const schema = model.schema;\n const objectElement = model.document.selection.getSelectedElement();\n // If object element is selected.\n if (objectElement && schema.isObject(objectElement)) {\n domEventData.preventDefault();\n eventInfo.stop();\n }\n }\n /**\n * Handles delete keys: backspace and delete.\n *\n * @param isForward Set to true if delete was performed in forward direction.\n * @returns Returns `true` if keys were handled correctly.\n */\n _handleDelete(isForward) {\n const modelDocument = this.editor.model.document;\n const modelSelection = modelDocument.selection;\n // Do nothing when the read only mode is enabled.\n if (!this.editor.model.canEditAt(modelSelection)) {\n return;\n }\n // Do nothing on non-collapsed selection.\n if (!modelSelection.isCollapsed) {\n return;\n }\n const objectElement = this._getObjectElementNextToSelection(isForward);\n if (objectElement) {\n this.editor.model.change(writer => {\n let previousNode = modelSelection.anchor.parent;\n // Remove previous element if empty.\n while (previousNode.isEmpty) {\n const nodeToRemove = previousNode;\n previousNode = nodeToRemove.parent;\n writer.remove(nodeToRemove);\n }\n this._setSelectionOverElement(objectElement);\n });\n return true;\n }\n }\n /**\n * Sets {@link module:engine/model/selection~Selection document's selection} over given element.\n *\n * @internal\n */\n _setSelectionOverElement(element) {\n this.editor.model.change(writer => {\n writer.setSelection(writer.createRangeOn(element));\n });\n }\n /**\n * Checks if {@link module:engine/model/element~Element element} placed next to the current\n * {@link module:engine/model/selection~Selection model selection} exists and is marked in\n * {@link module:engine/model/schema~Schema schema} as `object`.\n *\n * @internal\n * @param forward Direction of checking.\n */\n _getObjectElementNextToSelection(forward) {\n const model = this.editor.model;\n const schema = model.schema;\n const modelSelection = model.document.selection;\n // Clone current selection to use it as a probe. We must leave default selection as it is so it can return\n // to its current state after undo.\n const probe = model.createSelection(modelSelection);\n model.modifySelection(probe, { direction: forward ? 'forward' : 'backward' });\n // The selection didn't change so there is nothing there.\n if (probe.isEqual(modelSelection)) {\n return null;\n }\n const objectElement = forward ? probe.focus.nodeBefore : probe.focus.nodeAfter;\n if (!!objectElement && schema.isObject(objectElement)) {\n return objectElement;\n }\n return null;\n }\n /**\n * Removes CSS class from previously selected widgets.\n */\n _clearPreviouslySelectedWidgets(writer) {\n for (const widget of this._previouslySelected) {\n writer.removeClass(WIDGET_SELECTED_CLASS_NAME, widget);\n }\n this._previouslySelected.clear();\n }\n /**\n * Moves the document selection into the first nested editable.\n */\n _selectFirstNestedEditable() {\n const editor = this.editor;\n const view = this.editor.editing.view;\n const viewDocument = view.document;\n for (const item of viewDocument.selection.getFirstRange().getItems()) {\n if (item.is('editableElement')) {\n const modelElement = editor.editing.mapper.toModelElement(item);\n /* istanbul ignore next -- @preserve */\n if (!modelElement) {\n continue;\n }\n const position = editor.model.createPositionAt(modelElement, 0);\n const newRange = editor.model.schema.getNearestSelectionRange(position, 'forward');\n editor.model.change(writer => {\n writer.setSelection(newRange);\n });\n return true;\n }\n }\n return false;\n }\n /**\n * Updates the document selection so that it selects first ancestor widget.\n */\n _selectAncestorWidget() {\n const editor = this.editor;\n const mapper = editor.editing.mapper;\n const selection = editor.editing.view.document.selection;\n const positionParent = selection.getFirstPosition().parent;\n const positionParentElement = positionParent.is('$text') ?\n positionParent.parent :\n positionParent;\n const viewElement = positionParentElement.findAncestor(isWidget);\n if (!viewElement) {\n return false;\n }\n const modelElement = mapper.toModelElement(viewElement);\n /* istanbul ignore next -- @preserve */\n if (!modelElement) {\n return false;\n }\n editor.model.change(writer => {\n writer.setSelection(modelElement, 'on');\n });\n return true;\n }\n}\n/**\n * Returns `true` when element is a nested editable or is placed inside one.\n */\nfunction isInsideNestedEditable(element) {\n let currentElement = element;\n while (currentElement) {\n if (currentElement.is('editableElement') && !currentElement.is('rootElement')) {\n return true;\n }\n // Click on nested widget should select it.\n if (isWidget(currentElement)) {\n return false;\n }\n currentElement = currentElement.parent;\n }\n return false;\n}\n/**\n * Checks whether the specified `element` is a child of the `parent` element.\n *\n * @param element An element to check.\n * @param parent A parent for the element.\n */\nfunction isChild(element, parent) {\n if (!parent) {\n return false;\n }\n return Array.from(element.getAncestors()).includes(parent);\n}\n/**\n * Returns nearest text block ancestor.\n */\nfunction findTextBlockAncestor(modelElement, schema) {\n for (const element of modelElement.getAncestors({ includeSelf: true, parentFirst: true })) {\n if (schema.checkChild(element, '$text')) {\n return element;\n }\n // Do not go beyond nested editable.\n if (schema.isLimit(element) && !schema.isObject(element)) {\n break;\n }\n }\n return null;\n}\n/**\n * Returns next text block where could put selection.\n */\nfunction findNextTextBlock(position, schema) {\n const treeWalker = new TreeWalker({ startPosition: position });\n for (const { item } of treeWalker) {\n if (schema.isLimit(item) || !item.is('element')) {\n return null;\n }\n if (schema.checkChild(item, '$text')) {\n return item;\n }\n }\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgettoolbarrepository\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { BalloonPanelView, ContextualBalloon, ToolbarView } from '@ckeditor/ckeditor5-ui';\nimport { CKEditorError, logWarning } from '@ckeditor/ckeditor5-utils';\nimport { isWidget } from './utils.js';\n/**\n * Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole\n * toolbar rendering process and exposes a concise API.\n *\n * To add a toolbar for your widget use the {@link ~WidgetToolbarRepository#register `WidgetToolbarRepository#register()`} method.\n *\n * The following example comes from the {@link module:image/imagetoolbar~ImageToolbar} plugin:\n *\n * ```ts\n * class ImageToolbar extends Plugin {\n * \tstatic get requires() {\n * \t\treturn [ WidgetToolbarRepository ];\n * \t}\n *\n * \tafterInit() {\n * \t\tconst editor = this.editor;\n * \t\tconst widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );\n *\n * \t\twidgetToolbarRepository.register( 'image', {\n * \t\t\titems: editor.config.get( 'image.toolbar' ),\n * \t\t\tgetRelatedElement: getClosestSelectedImageWidget\n * \t\t} );\n * \t}\n * }\n * ```\n */\nexport default class WidgetToolbarRepository extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A map of toolbar definitions.\n */\n this._toolbarDefinitions = new Map();\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'WidgetToolbarRepository';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Disables the default balloon toolbar for all widgets.\n if (editor.plugins.has('BalloonToolbar')) {\n const balloonToolbar = editor.plugins.get('BalloonToolbar');\n this.listenTo(balloonToolbar, 'show', evt => {\n if (isWidgetSelected(editor.editing.view.document.selection)) {\n evt.stop();\n }\n }, { priority: 'high' });\n }\n this._balloon = this.editor.plugins.get('ContextualBalloon');\n this.on('change:isEnabled', () => {\n this._updateToolbarsVisibility();\n });\n this.listenTo(editor.ui, 'update', () => {\n this._updateToolbarsVisibility();\n });\n // UI#update is not fired after focus is back in editor, we need to check if balloon panel should be visible.\n this.listenTo(editor.ui.focusTracker, 'change:isFocused', () => {\n this._updateToolbarsVisibility();\n }, { priority: 'low' });\n }\n destroy() {\n super.destroy();\n for (const toolbarConfig of this._toolbarDefinitions.values()) {\n toolbarConfig.view.destroy();\n }\n }\n /**\n * Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked\n * `getRelatedElement` function. Toolbar items are gathered from `items` array.\n * The balloon's CSS class is by default `ck-toolbar-container` and may be override with the `balloonClassName` option.\n *\n * Note: This method should be called in the {@link module:core/plugin~PluginInterface#afterInit `Plugin#afterInit()`}\n * callback (or later) to make sure that the given toolbar items were already registered by other plugins.\n *\n * @param toolbarId An id for the toolbar. Used to\n * @param options.ariaLabel Label used by assistive technologies to describe this toolbar element.\n * @param options.items Array of toolbar items.\n * @param options.getRelatedElement Callback which returns an element the toolbar should be attached to.\n * @param options.balloonClassName CSS class for the widget balloon.\n */\n register(toolbarId, { ariaLabel, items, getRelatedElement, balloonClassName = 'ck-toolbar-container' }) {\n // Trying to register a toolbar without any item.\n if (!items.length) {\n /**\n * When {@link module:widget/widgettoolbarrepository~WidgetToolbarRepository#register registering} a new widget toolbar, you\n * need to provide a non-empty array with the items that will be inserted into the toolbar.\n *\n * If you see this error when integrating the editor, you likely forgot to configure one of the widget toolbars.\n *\n * See for instance:\n *\n * * {@link module:table/tableconfig~TableConfig#contentToolbar `config.table.contentToolbar`}\n * * {@link module:image/imageconfig~ImageConfig#toolbar `config.image.toolbar`}\n *\n * @error widget-toolbar-no-items\n * @param toolbarId The id of the toolbar that has not been configured correctly.\n */\n logWarning('widget-toolbar-no-items', { toolbarId });\n return;\n }\n const editor = this.editor;\n const t = editor.t;\n const toolbarView = new ToolbarView(editor.locale);\n toolbarView.ariaLabel = ariaLabel || t('Widget toolbar');\n if (this._toolbarDefinitions.has(toolbarId)) {\n /**\n * Toolbar with the given id was already added.\n *\n * @error widget-toolbar-duplicated\n * @param toolbarId Toolbar id.\n */\n throw new CKEditorError('widget-toolbar-duplicated', this, { toolbarId });\n }\n const toolbarDefinition = {\n view: toolbarView,\n getRelatedElement,\n balloonClassName,\n itemsConfig: items,\n initialized: false\n };\n // Register the toolbar so it becomes available for Alt+F10 and Esc navigation.\n editor.ui.addToolbar(toolbarView, {\n isContextual: true,\n beforeFocus: () => {\n const relatedElement = getRelatedElement(editor.editing.view.document.selection);\n if (relatedElement) {\n this._showToolbar(toolbarDefinition, relatedElement);\n }\n },\n afterBlur: () => {\n this._hideToolbar(toolbarDefinition);\n }\n });\n this._toolbarDefinitions.set(toolbarId, toolbarDefinition);\n }\n /**\n * Iterates over stored toolbars and makes them visible or hidden.\n */\n _updateToolbarsVisibility() {\n let maxRelatedElementDepth = 0;\n let deepestRelatedElement = null;\n let deepestToolbarDefinition = null;\n for (const definition of this._toolbarDefinitions.values()) {\n const relatedElement = definition.getRelatedElement(this.editor.editing.view.document.selection);\n if (!this.isEnabled || !relatedElement) {\n if (this._isToolbarInBalloon(definition)) {\n this._hideToolbar(definition);\n }\n }\n else if (!this.editor.ui.focusTracker.isFocused) {\n if (this._isToolbarVisible(definition)) {\n this._hideToolbar(definition);\n }\n }\n else {\n const relatedElementDepth = relatedElement.getAncestors().length;\n // Many toolbars can express willingness to be displayed but they do not know about\n // each other. Figure out which toolbar is deepest in the view tree to decide which\n // should be displayed. For instance, if a selected image is inside a table cell, display\n // the ImageToolbar rather than the TableToolbar (#60).\n if (relatedElementDepth > maxRelatedElementDepth) {\n maxRelatedElementDepth = relatedElementDepth;\n deepestRelatedElement = relatedElement;\n deepestToolbarDefinition = definition;\n }\n }\n }\n if (deepestToolbarDefinition) {\n this._showToolbar(deepestToolbarDefinition, deepestRelatedElement);\n }\n }\n /**\n * Hides the given toolbar.\n */\n _hideToolbar(toolbarDefinition) {\n this._balloon.remove(toolbarDefinition.view);\n this.stopListening(this._balloon, 'change:visibleView');\n }\n /**\n * Shows up the toolbar if the toolbar is not visible.\n * Otherwise, repositions the toolbar's balloon when toolbar's view is the most top view in balloon stack.\n *\n * It might happen here that the toolbar's view is under another view. Then do nothing as the other toolbar view\n * should be still visible after the {@link module:ui/editorui/editorui~EditorUI#event:update}.\n */\n _showToolbar(toolbarDefinition, relatedElement) {\n if (this._isToolbarVisible(toolbarDefinition)) {\n repositionContextualBalloon(this.editor, relatedElement);\n }\n else if (!this._isToolbarInBalloon(toolbarDefinition)) {\n if (!toolbarDefinition.initialized) {\n toolbarDefinition.initialized = true;\n toolbarDefinition.view.fillFromConfig(toolbarDefinition.itemsConfig, this.editor.ui.componentFactory);\n }\n this._balloon.add({\n view: toolbarDefinition.view,\n position: getBalloonPositionData(this.editor, relatedElement),\n balloonClassName: toolbarDefinition.balloonClassName\n });\n // Update toolbar position each time stack with toolbar view is switched to visible.\n // This is in a case target element has changed when toolbar was in invisible stack\n // e.g. target image was wrapped by a block quote.\n // See https://github.com/ckeditor/ckeditor5-widget/issues/92.\n this.listenTo(this._balloon, 'change:visibleView', () => {\n for (const definition of this._toolbarDefinitions.values()) {\n if (this._isToolbarVisible(definition)) {\n const relatedElement = definition.getRelatedElement(this.editor.editing.view.document.selection);\n repositionContextualBalloon(this.editor, relatedElement);\n }\n }\n });\n }\n }\n _isToolbarVisible(toolbar) {\n return this._balloon.visibleView === toolbar.view;\n }\n _isToolbarInBalloon(toolbar) {\n return this._balloon.hasView(toolbar.view);\n }\n}\nfunction repositionContextualBalloon(editor, relatedElement) {\n const balloon = editor.plugins.get('ContextualBalloon');\n const position = getBalloonPositionData(editor, relatedElement);\n balloon.updatePosition(position);\n}\nfunction getBalloonPositionData(editor, relatedElement) {\n const editingView = editor.editing.view;\n const defaultPositions = BalloonPanelView.defaultPositions;\n return {\n target: editingView.domConverter.mapViewToDom(relatedElement),\n positions: [\n defaultPositions.northArrowSouth,\n defaultPositions.northArrowSouthWest,\n defaultPositions.northArrowSouthEast,\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthWest,\n defaultPositions.southArrowNorthEast,\n defaultPositions.viewportStickyNorth\n ]\n };\n}\nfunction isWidgetSelected(selection) {\n const viewElement = selection.getSelectedElement();\n return !!(viewElement && isWidget(viewElement));\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgetresize/resizerstate\n */\nimport { ObservableMixin, Rect } from '@ckeditor/ckeditor5-utils';\nimport { calculateResizeHostPercentageWidth } from '../utils.js';\n/**\n * Stores the internal state of a single resizable object.\n */\nexport default class ResizeState extends /* #__PURE__ */ ObservableMixin() {\n /**\n * @param options Resizer options.\n */\n constructor(options) {\n super();\n this.set('activeHandlePosition', null);\n this.set('proposedWidthPercents', null);\n this.set('proposedWidth', null);\n this.set('proposedHeight', null);\n this.set('proposedHandleHostWidth', null);\n this.set('proposedHandleHostHeight', null);\n this._options = options;\n this._referenceCoordinates = null;\n }\n /**\n * The original width (pixels) of the resized object when the resize process was started.\n */\n get originalWidth() {\n return this._originalWidth;\n }\n /**\n * The original height (pixels) of the resized object when the resize process was started.\n */\n get originalHeight() {\n return this._originalHeight;\n }\n /**\n * The original width (percents) of the resized object when the resize process was started.\n */\n get originalWidthPercents() {\n return this._originalWidthPercents;\n }\n /**\n * A width to height ratio of the resized image.\n */\n get aspectRatio() {\n return this._aspectRatio;\n }\n /**\n *\n * @param domResizeHandle The handle used to calculate the reference point.\n */\n begin(domResizeHandle, domHandleHost, domResizeHost) {\n const clientRect = new Rect(domHandleHost);\n this.activeHandlePosition = getHandlePosition(domResizeHandle);\n this._referenceCoordinates = getAbsoluteBoundaryPoint(domHandleHost, getOppositePosition(this.activeHandlePosition));\n this._originalWidth = clientRect.width;\n this._originalHeight = clientRect.height;\n this._aspectRatio = clientRect.width / clientRect.height;\n const widthStyle = domResizeHost.style.width;\n if (widthStyle && widthStyle.match(/^\\d+(\\.\\d*)?%$/)) {\n this._originalWidthPercents = parseFloat(widthStyle);\n }\n else {\n this._originalWidthPercents = calculateResizeHostPercentageWidth(domResizeHost, clientRect);\n }\n }\n update(newSize) {\n this.proposedWidth = newSize.width;\n this.proposedHeight = newSize.height;\n this.proposedWidthPercents = newSize.widthPercents;\n this.proposedHandleHostWidth = newSize.handleHostWidth;\n this.proposedHandleHostHeight = newSize.handleHostHeight;\n }\n}\n/**\n * Returns coordinates of the top-left corner of an element, relative to the document's top-left corner.\n *\n * @param resizerPosition The position of the resize handle, e.g. `\"top-left\"`, `\"bottom-right\"`.\n */\nfunction getAbsoluteBoundaryPoint(element, resizerPosition) {\n const elementRect = new Rect(element);\n const positionParts = resizerPosition.split('-');\n const ret = {\n x: positionParts[1] == 'right' ? elementRect.right : elementRect.left,\n y: positionParts[0] == 'bottom' ? elementRect.bottom : elementRect.top\n };\n ret.x += element.ownerDocument.defaultView.scrollX;\n ret.y += element.ownerDocument.defaultView.scrollY;\n return ret;\n}\n/**\n * @param resizerPosition The expected resizer position, like `\"top-left\"`, `\"bottom-right\"`.\n * @returns A prefixed HTML class name for the resizer element.\n */\nfunction getResizerHandleClass(resizerPosition) {\n return `ck-widget__resizer__handle-${resizerPosition}`;\n}\n/**\n * Determines the position of a given resize handle.\n *\n * @param domHandle Handle used to calculate the reference point.\n * @returns Returns a string like `\"top-left\"` or `undefined` if not matched.\n */\nfunction getHandlePosition(domHandle) {\n const resizerPositions = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];\n for (const position of resizerPositions) {\n if (domHandle.classList.contains(getResizerHandleClass(position))) {\n return position;\n }\n }\n}\n/**\n * @param position Like `\"top-left\"`.\n * @returns Inverted `position`, e.g. it returns `\"bottom-right\"` if `\"top-left\"` was given as `position`.\n */\nfunction getOppositePosition(position) {\n const parts = position.split('-');\n const replacements = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left'\n };\n return `${replacements[parts[0]]}-${replacements[parts[1]]}`;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgetresize/sizeview\n */\nimport { View } from '@ckeditor/ckeditor5-ui';\n/**\n * A view displaying the proposed new element size during the resizing.\n */\nexport default class SizeView extends View {\n constructor() {\n super();\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-size-view',\n bind.to('_viewPosition', value => value ? `ck-orientation-${value}` : '')\n ],\n style: {\n display: bind.if('_isVisible', 'none', visible => !visible)\n }\n },\n children: [{\n text: bind.to('_label')\n }]\n });\n }\n /**\n * A method used for binding the `SizeView` instance properties to the `ResizeState` instance observable properties.\n *\n * @internal\n * @param options An object defining the resizer options, used for setting the proper size label.\n * @param resizeState The `ResizeState` class instance, used for keeping the `SizeView` state up to date.\n */\n _bindToState(options, resizeState) {\n this.bind('_isVisible').to(resizeState, 'proposedWidth', resizeState, 'proposedHeight', (width, height) => width !== null && height !== null);\n this.bind('_label').to(resizeState, 'proposedHandleHostWidth', resizeState, 'proposedHandleHostHeight', resizeState, 'proposedWidthPercents', (width, height, widthPercents) => {\n if (options.unit === 'px') {\n return `${width}×${height}`;\n }\n else {\n return `${widthPercents}%`;\n }\n });\n this.bind('_viewPosition').to(resizeState, 'activeHandlePosition', resizeState, 'proposedHandleHostWidth', resizeState, 'proposedHandleHostHeight', \n // If the widget is too small to contain the size label, display the label above.\n (position, width, height) => width < 50 || height < 50 ? 'above-center' : position);\n }\n /**\n * A method used for cleaning up. It removes the bindings and hides the view.\n *\n * @internal\n */\n _dismiss() {\n this.unbind();\n this._isVisible = false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgetresize/resizer\n */\nimport { Template } from '@ckeditor/ckeditor5-ui';\nimport { Rect, ObservableMixin, compareArrays } from '@ckeditor/ckeditor5-utils';\nimport ResizeState from './resizerstate.js';\nimport SizeView from './sizeview.js';\n/**\n * Represents a resizer for a single resizable object.\n */\nexport default class Resizer extends /* #__PURE__ */ ObservableMixin() {\n /**\n * @param options Resizer options.\n */\n constructor(options) {\n super();\n /**\n * A wrapper that is controlled by the resizer. This is usually a widget element.\n */\n this._viewResizerWrapper = null;\n this._options = options;\n this.set('isEnabled', true);\n this.set('isSelected', false);\n this.bind('isVisible').to(this, 'isEnabled', this, 'isSelected', (isEnabled, isSelected) => isEnabled && isSelected);\n this.decorate('begin');\n this.decorate('cancel');\n this.decorate('commit');\n this.decorate('updateSize');\n this.on('commit', event => {\n // State might not be initialized yet. In this case, prevent further handling and make sure that the resizer is\n // cleaned up (#5195).\n if (!this.state.proposedWidth && !this.state.proposedWidthPercents) {\n this._cleanup();\n event.stop();\n }\n }, { priority: 'high' });\n }\n /**\n * Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.\n *\n * Note that a new state is created for each resize transaction.\n */\n get state() {\n return this._state;\n }\n /**\n * Makes resizer visible in the UI.\n */\n show() {\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n writer.removeClass('ck-hidden', this._viewResizerWrapper);\n });\n }\n /**\n * Hides resizer in the UI.\n */\n hide() {\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n writer.addClass('ck-hidden', this._viewResizerWrapper);\n });\n }\n /**\n * Attaches the resizer to the DOM.\n */\n attach() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n const widgetElement = this._options.viewElement;\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n const viewResizerWrapper = writer.createUIElement('div', {\n class: 'ck ck-reset_all ck-widget__resizer'\n }, function (domDocument) {\n const domElement = this.toDomElement(domDocument);\n that._appendHandles(domElement);\n that._appendSizeUI(domElement);\n return domElement;\n });\n // Append the resizer wrapper to the widget's wrapper.\n writer.insert(writer.createPositionAt(widgetElement, 'end'), viewResizerWrapper);\n writer.addClass('ck-widget_with-resizer', widgetElement);\n this._viewResizerWrapper = viewResizerWrapper;\n if (!this.isVisible) {\n this.hide();\n }\n });\n this.on('change:isVisible', () => {\n if (this.isVisible) {\n this.show();\n this.redraw();\n }\n else {\n this.hide();\n }\n });\n }\n /**\n * Starts the resizing process.\n *\n * Creates a new {@link #state} for the current process.\n *\n * @fires begin\n * @param domResizeHandle Clicked handle.\n */\n begin(domResizeHandle) {\n this._state = new ResizeState(this._options);\n this._sizeView._bindToState(this._options, this.state);\n this._initialViewWidth = this._options.viewElement.getStyle('width');\n this.state.begin(domResizeHandle, this._getHandleHost(), this._getResizeHost());\n }\n /**\n * Updates the proposed size based on `domEventData`.\n *\n * @fires updateSize\n */\n updateSize(domEventData) {\n const newSize = this._proposeNewSize(domEventData);\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n const unit = this._options.unit || '%';\n const newWidth = (unit === '%' ? newSize.widthPercents : newSize.width) + unit;\n writer.setStyle('width', newWidth, this._options.viewElement);\n });\n // Get an actual image width, and:\n // * reflect this size to the resize wrapper\n // * apply this **real** size to the state\n const domHandleHost = this._getHandleHost();\n const domHandleHostRect = new Rect(domHandleHost);\n const handleHostWidth = Math.round(domHandleHostRect.width);\n const handleHostHeight = Math.round(domHandleHostRect.height);\n // Handle max-width limitation.\n const domResizeHostRect = new Rect(domHandleHost);\n newSize.width = Math.round(domResizeHostRect.width);\n newSize.height = Math.round(domResizeHostRect.height);\n this.redraw(domHandleHostRect);\n this.state.update({\n ...newSize,\n handleHostWidth,\n handleHostHeight\n });\n }\n /**\n * Applies the geometry proposed with the resizer.\n *\n * @fires commit\n */\n commit() {\n const unit = this._options.unit || '%';\n const newValue = (unit === '%' ? this.state.proposedWidthPercents : this.state.proposedWidth) + unit;\n // Both cleanup and onCommit callback are very likely to make view changes. Ensure that it is made in a single step.\n this._options.editor.editing.view.change(() => {\n this._cleanup();\n this._options.onCommit(newValue);\n });\n }\n /**\n * Cancels and rejects the proposed resize dimensions, hiding the UI.\n *\n * @fires cancel\n */\n cancel() {\n this._cleanup();\n }\n /**\n * Destroys the resizer.\n */\n destroy() {\n this.cancel();\n }\n /**\n * Redraws the resizer.\n *\n * @param handleHostRect Handle host rectangle might be given to improve performance.\n */\n redraw(handleHostRect) {\n const domWrapper = this._domResizerWrapper;\n // Refresh only if resizer exists in the DOM.\n if (!existsInDom(domWrapper)) {\n return;\n }\n const widgetWrapper = domWrapper.parentElement;\n const handleHost = this._getHandleHost();\n const resizerWrapper = this._viewResizerWrapper;\n const currentDimensions = [\n resizerWrapper.getStyle('width'),\n resizerWrapper.getStyle('height'),\n resizerWrapper.getStyle('left'),\n resizerWrapper.getStyle('top')\n ];\n let newDimensions;\n if (widgetWrapper.isSameNode(handleHost)) {\n const clientRect = handleHostRect || new Rect(handleHost);\n newDimensions = [\n clientRect.width + 'px',\n clientRect.height + 'px',\n undefined,\n undefined\n ];\n }\n // In case a resizing host is not a widget wrapper, we need to compensate\n // for any additional offsets the resize host might have. E.g. wrapper padding\n // or simply another editable. By doing that the border and resizers are shown\n // only around the resize host.\n else {\n newDimensions = [\n handleHost.offsetWidth + 'px',\n handleHost.offsetHeight + 'px',\n handleHost.offsetLeft + 'px',\n handleHost.offsetTop + 'px'\n ];\n }\n // Make changes to the view only if the resizer should actually get new dimensions.\n // Otherwise, if View#change() was always called, this would cause EditorUI#update\n // loops because the WidgetResize plugin listens to EditorUI#update and updates\n // the resizer.\n // https://github.com/ckeditor/ckeditor5/issues/7633\n if (compareArrays(currentDimensions, newDimensions) !== 'same') {\n this._options.editor.editing.view.change(writer => {\n writer.setStyle({\n width: newDimensions[0],\n height: newDimensions[1],\n left: newDimensions[2],\n top: newDimensions[3]\n }, resizerWrapper);\n });\n }\n }\n containsHandle(domElement) {\n return this._domResizerWrapper.contains(domElement);\n }\n static isResizeHandle(domElement) {\n return domElement.classList.contains('ck-widget__resizer__handle');\n }\n /**\n * Cleans up the context state.\n */\n _cleanup() {\n this._sizeView._dismiss();\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n writer.setStyle('width', this._initialViewWidth, this._options.viewElement);\n });\n }\n /**\n * Calculates the proposed size as the resize handles are dragged.\n *\n * @param domEventData Event data that caused the size update request. It should be used to calculate the proposed size.\n */\n _proposeNewSize(domEventData) {\n const state = this.state;\n const currentCoordinates = extractCoordinates(domEventData);\n const isCentered = this._options.isCentered ? this._options.isCentered(this) : true;\n // Enlargement defines how much the resize host has changed in a given axis. Naturally it could be a negative number\n // meaning that it has been shrunk.\n //\n // +----------------+--+\n // | | |\n // | img | |\n // | /handle host | |\n // +----------------+ | ^\n // | | | - enlarge y\n // +-------------------+ v\n // \t\t\t\t\t<-->\n // \t\t\t\t\t enlarge x\n const enlargement = {\n x: state._referenceCoordinates.x - (currentCoordinates.x + state.originalWidth),\n y: (currentCoordinates.y - state.originalHeight) - state._referenceCoordinates.y\n };\n if (isCentered && state.activeHandlePosition.endsWith('-right')) {\n enlargement.x = currentCoordinates.x - (state._referenceCoordinates.x + state.originalWidth);\n }\n // Objects needs to be resized twice as much in horizontal axis if centered, since enlargement is counted from\n // one resized corner to your cursor. It needs to be duplicated to compensate for the other side too.\n if (isCentered) {\n enlargement.x *= 2;\n }\n // const resizeHost = this._getResizeHost();\n // The size proposed by the user. It does not consider the aspect ratio.\n let width = Math.abs(state.originalWidth + enlargement.x);\n let height = Math.abs(state.originalHeight + enlargement.y);\n // Dominant determination must take the ratio into account.\n const dominant = width / state.aspectRatio > height ? 'width' : 'height';\n if (dominant == 'width') {\n height = width / state.aspectRatio;\n }\n else {\n width = height * state.aspectRatio;\n }\n return {\n width: Math.round(width),\n height: Math.round(height),\n widthPercents: Math.min(Math.round(state.originalWidthPercents / state.originalWidth * width * 100) / 100, 100)\n };\n }\n /**\n * Obtains the resize host.\n *\n * Resize host is an object that receives dimensions which are the result of resizing.\n */\n _getResizeHost() {\n const widgetWrapper = this._domResizerWrapper.parentElement;\n return this._options.getResizeHost(widgetWrapper);\n }\n /**\n * Obtains the handle host.\n *\n * Handle host is an object that the handles are aligned to.\n *\n * Handle host will not always be an entire widget itself. Take an image as an example. The image widget\n * contains an image and a caption. Only the image should be surrounded with handles.\n */\n _getHandleHost() {\n const widgetWrapper = this._domResizerWrapper.parentElement;\n return this._options.getHandleHost(widgetWrapper);\n }\n /**\n * DOM container of the entire resize UI.\n *\n * Note that this property will have a value only after the element bound with the resizer is rendered\n * (otherwise `null`).\n */\n get _domResizerWrapper() {\n return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper);\n }\n /**\n * Renders the resize handles in the DOM.\n *\n * @param domElement The resizer wrapper.\n */\n _appendHandles(domElement) {\n const resizerPositions = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];\n for (const currentPosition of resizerPositions) {\n domElement.appendChild((new Template({\n tag: 'div',\n attributes: {\n class: `ck-widget__resizer__handle ${getResizerClass(currentPosition)}`\n }\n }).render()));\n }\n }\n /**\n * Sets up the {@link #_sizeView} property and adds it to the passed `domElement`.\n */\n _appendSizeUI(domElement) {\n this._sizeView = new SizeView();\n // Make sure icon#element is rendered before passing to appendChild().\n this._sizeView.render();\n domElement.appendChild(this._sizeView.element);\n }\n}\n/**\n * @param resizerPosition Expected resizer position like `\"top-left\"`, `\"bottom-right\"`.\n * @returns A prefixed HTML class name for the resizer element\n */\nfunction getResizerClass(resizerPosition) {\n return `ck-widget__resizer__handle-${resizerPosition}`;\n}\nfunction extractCoordinates(event) {\n return {\n x: event.pageX,\n y: event.pageY\n };\n}\nfunction existsInDom(element) {\n return element && element.ownerDocument && element.ownerDocument.contains(element);\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widgetresize.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widgetresize.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgetresize\n */\nimport Resizer from './widgetresize/resizer.js';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { MouseObserver } from '@ckeditor/ckeditor5-engine';\nimport { DomEmitterMixin, global } from '@ckeditor/ckeditor5-utils';\nimport { throttle } from 'lodash-es';\nimport '../theme/widgetresize.css';\n/**\n * The widget resize feature plugin.\n *\n * Use the {@link module:widget/widgetresize~WidgetResize#attachTo} method to create a resizer for the specified widget.\n */\nexport default class WidgetResize extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A map of resizers created using this plugin instance.\n */\n this._resizers = new Map();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'WidgetResize';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editing = this.editor.editing;\n const domDocument = global.window.document;\n this.set('selectedResizer', null);\n this.set('_activeResizer', null);\n editing.view.addObserver(MouseObserver);\n this._observer = new (DomEmitterMixin())();\n this.listenTo(editing.view.document, 'mousedown', this._mouseDownListener.bind(this), { priority: 'high' });\n this._observer.listenTo(domDocument, 'mousemove', this._mouseMoveListener.bind(this));\n this._observer.listenTo(domDocument, 'mouseup', this._mouseUpListener.bind(this));\n this._redrawSelectedResizerThrottled = throttle(() => this.redrawSelectedResizer(), 200);\n // Redrawing on any change of the UI of the editor (including content changes).\n this.editor.ui.on('update', this._redrawSelectedResizerThrottled);\n // Remove view widget-resizer mappings for widgets that have been removed from the document.\n // https://github.com/ckeditor/ckeditor5/issues/10156\n // https://github.com/ckeditor/ckeditor5/issues/10266\n this.editor.model.document.on('change', () => {\n for (const [viewElement, resizer] of this._resizers) {\n if (!viewElement.isAttached()) {\n this._resizers.delete(viewElement);\n resizer.destroy();\n }\n }\n }, { priority: 'lowest' });\n // Resizers need to be redrawn upon window resize, because new window might shrink resize host.\n this._observer.listenTo(global.window, 'resize', this._redrawSelectedResizerThrottled);\n const viewSelection = this.editor.editing.view.document.selection;\n viewSelection.on('change', () => {\n const selectedElement = viewSelection.getSelectedElement();\n const resizer = this.getResizerByViewElement(selectedElement) || null;\n if (resizer) {\n this.select(resizer);\n }\n else {\n this.deselect();\n }\n });\n }\n /**\n * Redraws the selected resizer if there is any selected resizer and if it is visible.\n */\n redrawSelectedResizer() {\n if (this.selectedResizer && this.selectedResizer.isVisible) {\n this.selectedResizer.redraw();\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._observer.stopListening();\n for (const resizer of this._resizers.values()) {\n resizer.destroy();\n }\n this._redrawSelectedResizerThrottled.cancel();\n }\n /**\n * Marks resizer as selected.\n */\n select(resizer) {\n this.deselect();\n this.selectedResizer = resizer;\n this.selectedResizer.isSelected = true;\n }\n /**\n * Deselects currently set resizer.\n */\n deselect() {\n if (this.selectedResizer) {\n this.selectedResizer.isSelected = false;\n }\n this.selectedResizer = null;\n }\n /**\n * @param options Resizer options.\n */\n attachTo(options) {\n const resizer = new Resizer(options);\n const plugins = this.editor.plugins;\n resizer.attach();\n if (plugins.has('WidgetToolbarRepository')) {\n // Hiding widget toolbar to improve the performance\n // (https://github.com/ckeditor/ckeditor5-widget/pull/112#issuecomment-564528765).\n const widgetToolbarRepository = plugins.get('WidgetToolbarRepository');\n resizer.on('begin', () => {\n widgetToolbarRepository.forceDisabled('resize');\n }, { priority: 'lowest' });\n resizer.on('cancel', () => {\n widgetToolbarRepository.clearForceDisabled('resize');\n }, { priority: 'highest' });\n resizer.on('commit', () => {\n widgetToolbarRepository.clearForceDisabled('resize');\n }, { priority: 'highest' });\n }\n this._resizers.set(options.viewElement, resizer);\n const viewSelection = this.editor.editing.view.document.selection;\n const selectedElement = viewSelection.getSelectedElement();\n // If the element the resizer is created for is currently focused, it should become visible.\n if (this.getResizerByViewElement(selectedElement) == resizer) {\n this.select(resizer);\n }\n return resizer;\n }\n /**\n * Returns a resizer created for a given view element (widget element).\n *\n * @param viewElement View element associated with the resizer.\n */\n getResizerByViewElement(viewElement) {\n return this._resizers.get(viewElement);\n }\n /**\n * Returns a resizer that contains a given resize handle.\n */\n _getResizerByHandle(domResizeHandle) {\n for (const resizer of this._resizers.values()) {\n if (resizer.containsHandle(domResizeHandle)) {\n return resizer;\n }\n }\n }\n /**\n * @param domEventData Native DOM event.\n */\n _mouseDownListener(event, domEventData) {\n const resizeHandle = domEventData.domTarget;\n if (!Resizer.isResizeHandle(resizeHandle)) {\n return;\n }\n this._activeResizer = this._getResizerByHandle(resizeHandle) || null;\n if (this._activeResizer) {\n this._activeResizer.begin(resizeHandle);\n // Do not call other events when resizing. See: #6755.\n event.stop();\n domEventData.preventDefault();\n }\n }\n /**\n * @param domEventData Native DOM event.\n */\n _mouseMoveListener(event, domEventData) {\n if (this._activeResizer) {\n this._activeResizer.updateSize(domEventData);\n }\n }\n _mouseUpListener() {\n if (this._activeResizer) {\n this._activeResizer.commit();\n this._activeResizer = null;\n }\n }\n}\n","import imageIcon from '../icons/edit.svg';\nimport { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nexport function createToolbarEditButton(editor, name, callback) {\n\t// Add editing button\n\teditor.ui.componentFactory.add( name, locale => {\n\t\tconst view = new ButtonView( locale );\n\n\t\tview.set( {\n\t\t\tlabel: I18n.t('js.button_edit'),\n\t\t\ticon: imageIcon,\n\t\t\ttooltip: true\n\t\t} );\n\n\t\t// Callback executed once the widget is clicked.\n\t\tview.on( 'execute', () => {\n\n\t\t\tconst widget = editor.model.document.selection.getSelectedElement();\n\n\t\t\tif (!widget) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcallback(widget);\n\t\t} );\n\n\t\treturn view;\n\t} );\n}\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\" width=\\\"20\\\" height=\\\"20\\\"><path d=\\\"M1.586 18.227l.398-2.753.398-2.753 2.355 2.388 2.355 2.355-2.753.365zM14.954 8.01l-7.099 7.065-.763-.796 7.065-7.066-1.592-1.559L5.5 12.721l-.763-.796 7.065-7.066-.796-.796-7.861 7.862 4.71 4.71 7.861-7.828zm3.25-1.56c.398-.397.398-1.094-.033-1.525L15.02 1.775c-.431-.432-1.128-.465-1.526-.034l-.1.1-1.525 1.493 4.71 4.71 1.526-1.493-.033-.033c.033-.033.099-.033.132-.066z\\\"/></svg>\\n\";","import { ToolbarView } from '@ckeditor/ckeditor5-ui';\nimport { BalloonPanelView } from '@ckeditor/ckeditor5-ui';\n\nconst balloonClassName = 'ck-toolbar-container';\n\nexport function createEditToolbar(\n\t// Plugin instance\n\tplugin,\n\t// Editor instance\n\teditor,\n\t// Configuration namespace in op-ckeditor.js\n\tconfig_namespace,\n\t// Callback to check if widget is selected\n\tisWidgetSelected\n) {\n\n\tconst toolbarConfig = editor.config.get( config_namespace + '.toolbar' );\n\n\t// Don't add the toolbar if there is no configuration.\n\tif ( !toolbarConfig || !toolbarConfig.length ) {\n\t\treturn;\n\t}\n\n\tconst _balloon = editor.plugins.get( 'ContextualBalloon' );\n\tconst _toolbar = new ToolbarView( editor.locale );\n\n\tfunction _checkIsVisible() {\n\t\tif ( !editor.ui.focusTracker.isFocused ) {\n\t\t\t_hideToolbar();\n\t\t} else {\n\t\t\tif ( isWidgetSelected(editor.editing.view.document.selection ) ) {\n\t\t\t\t_showToolbar();\n\t\t\t} else {\n\t\t\t\t_hideToolbar();\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction _showToolbar() {\n\t\tif ( _isVisible() ) {\n\t\t\trepositionContextualBalloon( editor, isWidgetSelected );\n\t\t} else if ( !_balloon.hasView( _toolbar ) ) {\n\t\t\t_balloon.add( {\n\t\t\t\tview: _toolbar,\n\t\t\t\tposition: getBalloonPositionData( editor ),\n\t\t\t\tballoonClassName\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction _hideToolbar() {\n\t\tif ( !_isVisible() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t_balloon.remove( _toolbar );\n\t}\n\n\tfunction _isVisible() {\n\t\treturn _balloon.visibleView == _toolbar;\n\t}\n\n\t// Add buttons to the toolbar.\n\t_toolbar.fillFromConfig( toolbarConfig, editor.ui.componentFactory );\n\n\t// Show balloon panel each time the widget is selected.\n\t// TODO: This has changed in master with https://github.com/ckeditor/ckeditor5-image/pull/215\n\tplugin.listenTo( editor.editing.view, 'render', _checkIsVisible);\n\n\t// UI#update is not fired after focus is back in editor, we need to check if balloon panel should be visible.\n\tplugin.listenTo( editor.ui.focusTracker, 'change:isFocused', _checkIsVisible, { priority: 'low' } );\n}\n\n\n/**\n * A helper utility that positions the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance\n * with respect to the element in the editor content, if one is selected.\n *\n * @param {module:core/editor/editor~Editor} editor The editor instance.\n */\nfunction repositionContextualBalloon( editor, selectionCallback ) {\n\tconst balloon = editor.plugins.get( 'ContextualBalloon' );\n\n\tif ( selectionCallback( editor.editing.view.document.selection ) ) {\n\t\tconst position = getBalloonPositionData( editor );\n\n\t\tballoon.updatePosition( position );\n\t}\n}\n\n\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected element in the editor content.\n *\n * @param {module:core/editor/editor~Editor} editor The editor instance.\n * @returns {module:utils/dom/position~Options}\n */\nfunction getBalloonPositionData( editor ) {\n\tconst editingView = editor.editing.view;\n\tconst defaultPositions = BalloonPanelView.defaultPositions;\n\n\treturn {\n\t\ttarget: editingView.domConverter.viewToDom( editingView.document.selection.getSelectedElement() ),\n\t\tpositions: [\n\t\t\tdefaultPositions.northArrowSouth,\n\t\t\tdefaultPositions.northArrowSouthWest,\n\t\t\tdefaultPositions.northArrowSouthEast,\n\t\t\tdefaultPositions.southArrowNorth,\n\t\t\tdefaultPositions.southArrowNorthWest,\n\t\t\tdefaultPositions.southArrowNorthEast\n\t\t]\n\t};\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\nimport { ContextualBalloon } from '@ckeditor/ckeditor5-ui';\n\nimport {isEmbeddedTableWidgetSelected} from './utils';\nimport {createToolbarEditButton} from '../../helpers/create-toolbar-edit-button';\nimport {createEditToolbar} from '../../helpers/create-toolbar';\nimport {getPluginContext} from '../op-context/op-context';\n\n\nconst balloonClassName = 'ck-toolbar-container';\n\nexport default class EmbeddedTableToolbar extends Plugin {\n\tstatic get requires() {\n\t\treturn [ ContextualBalloon ];\n\t}\n\n\tstatic get pluginName() {\n\t\treturn 'EmbeddedTableToolbar';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = this.editor.model;\n\t\tconst pluginContext = getPluginContext(editor);\n\n\t\t// Add editing button\n\t\tcreateToolbarEditButton( editor, 'opEditEmbeddedTableQuery', widget => {\n\t\t\tconst externalQueryConfiguration = pluginContext.services.externalQueryConfiguration;\n\t\t\tconst currentQuery = widget.getAttribute('opEmbeddedTableQuery') || {};\n\n\t\t\tpluginContext.runInZone(() => {\n\t\t\t\texternalQueryConfiguration.show({\n\t\t\t\t\tcurrentQuery: currentQuery,\n\t\t\t\t\tcallback: (newQuery) => model.change(writer => {\n\t\t\t\t\t\twriter.setAttribute('opEmbeddedTableQuery', newQuery, widget);\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t});\n\t\t} );\n\t}\n\n\tafterInit() {\n\t\t// Add actual toolbar\n\t\tcreateEditToolbar(\n\t\t\tthis,\n\t\t\tthis.editor,\n\t\t\t'OPMacroEmbeddedTable',\n\t\t\tisEmbeddedTableWidgetSelected\n\t\t);\n\t}\n}\n","const wpButtonMacroSymbol = Symbol( 'isWpButtonMacroSymbol' );\nimport {toWidget, isWidget} from '@ckeditor/ckeditor5-widget/src/utils';\n\nexport function toWpButtonMacroWidget( viewElement, writer, label ) {\n\twriter.setCustomProperty( wpButtonMacroSymbol, true, viewElement );\n\treturn toWidget( viewElement, writer, { label: label });\n}\n\n\nexport function isWpButtonMacroWidget( viewElement ) {\n\treturn !!viewElement.getCustomProperty( wpButtonMacroSymbol ) && isWidget( viewElement );\n}\n\n\nexport function isWpButtonMacroWidgetSelected( selection ) {\n\tconst viewElement = selection.getSelectedElement();\n\n\treturn !!( viewElement && isWpButtonMacroWidget( viewElement ) );\n}\n","import { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n\nimport {toWpButtonMacroWidget} from './utils';\nimport {getPluginContext} from '../op-context/op-context';\n\nexport default class OPMacroWpButtonEditing extends Plugin {\n\n\tstatic get pluginName() {\n\t\treturn 'OPMacroWpButtonEditing';\n\t}\n\n\tstatic get buttonName() {\n\t\treturn 'insertWorkPackageButton';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\t\tconst conversion = editor.conversion;\n\t\tconst pluginContext = getPluginContext(editor);\n\n\t\t// Schema.\n\t\tmodel.schema.register( 'op-macro-wp-button', {\n\t\t\tallowWhere: ['$block'],\n\t\t\tallowAttributes: ['type', 'classes'],\n\t\t\tisBlock: true,\n\t\t isLimit: true\n\t\t});\n\n\t\tconversion.for( 'upcast' )\n\t\t\t.elementToElement( {\n\t\t\t\tview: {\n\t\t\t\t\tname: 'macro',\n\t\t\t\t\tclasses: 'create_work_package_link'\n\t\t\t\t},\n\t\t\t\tmodel: ( viewElement, {writer:modelWriter} ) => {\n\t\t\t\t\tconst type = viewElement.getAttribute( 'data-type' ) || '';\n\t\t\t\t\tconst classes = viewElement.getAttribute( 'data-classes' ) || '';\n\n\t\t\t\t\treturn modelWriter.createElement(\n\t\t\t\t\t\t'op-macro-wp-button',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: type,\n\t\t\t\t\t\t\tclasses: classes\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\n\t\tconversion.for( 'editingDowncast' ).elementToElement( {\n\t\t\tmodel: 'op-macro-wp-button',\n\t\t\tview: (modelElement, {writer}) => {\n\t\t\t\treturn this.createMacroViewElement(modelElement, writer);\n\t\t\t}\n\t } );\n\n\t\tconversion.for('dataDowncast').elementToElement({\n\t\t\tmodel: 'op-macro-wp-button',\n\t\t\tview: (modelElement, {writer}) => {\n\t\t\t\tconst element = writer.createContainerElement(\n\t\t\t\t\t'macro',\n\t\t\t\t\t{\n\t\t\t\t\t\t'class': 'create_work_package_link',\n\t\t\t\t\t\t'data-type': modelElement.getAttribute('type') || '',\n\t\t\t\t\t\t'data-classes': modelElement.getAttribute('classes') || '',\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn element;\n\t\t\t}\n\t\t});\n\n\t\teditor.ui.componentFactory.add( OPMacroWpButtonEditing.buttonName, locale => {\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: window.I18n.t('js.editor.macro.work_package_button.button'),\n\t\t\t\twithText: true\n\t\t\t} );\n\n\t\t\t// Callback executed once the image is clicked.\n\t\t\tview.on( 'execute', () => {\n\t\t\t\tconst macroService = pluginContext.services.macros;\n\n\t\t\t\tmacroService\n\t\t\t\t\t.configureWorkPackageButton()\n\t\t\t\t\t.then((result) => editor.model.change(writer => {\n\t\t\t\t\t\tconst element = writer.createElement( 'op-macro-wp-button', {});\n\t\t\t\t\t\twriter.setAttribute( 'type', result.type, element );\n\t\t\t\t\t\twriter.setAttribute( 'classes', result.classes, element );\n\n\t\t\t\t\t\teditor.model.insertContent( element, editor.model.document.selection );\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\t}\n\n\tmacroLabel(type) {\n\t\tif (type) {\n\t\t\treturn window.I18n.t('js.editor.macro.work_package_button.with_type', { typename: type });\n\t\t} else {\n\t\t\treturn window.I18n.t('js.editor.macro.work_package_button.without_type');\n\t\t}\n\t}\n\n\tcreateMacroViewElement(modelElement, writer) {\n\t\tconst type = modelElement.getAttribute('type');\n\t\tconst classes = modelElement.getAttribute('classes') || '';\n\t\tconst label = this.macroLabel(); // TODO: Pass type, it is not updated on coming back from the modal..\n\t\tconst placeholder = writer.createText( label );\n\t\tconst container = writer.createContainerElement( 'span', { class: classes } );\n\n\t\twriter.insert( writer.createPositionAt( container, 0 ), placeholder );\n\t\treturn toWpButtonMacroWidget(container, writer, { label: label } )\n\t}\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\nimport { ContextualBalloon } from '@ckeditor/ckeditor5-ui';\n\nimport {isWpButtonMacroWidgetSelected} from './utils';\nimport {createToolbarEditButton} from '../../helpers/create-toolbar-edit-button';\nimport {createEditToolbar} from '../../helpers/create-toolbar';\nimport {getPluginContext} from '../op-context/op-context';\n\n\nconst balloonClassName = 'ck-toolbar-container';\n\nexport default class OPMacroWpButtonToolbar extends Plugin {\n\tstatic get requires() {\n\t\treturn [ ContextualBalloon ];\n\t}\n\n\tstatic get pluginName() {\n\t\treturn 'OPMacroWpButtonToolbar';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = this.editor.model;\n\t\tconst pluginContext = getPluginContext(editor);\n\n\t\t// Add editing button\n\t\tcreateToolbarEditButton( editor, 'opEditWpMacroButton', widget => {\n\t\t\tconst macroService = pluginContext.services.macros;\n\t\t\tconst type = widget.getAttribute('type');\n\t\t\tconst classes = widget.getAttribute('classes');\n\n\t\t\tmacroService\n\t\t\t\t.configureWorkPackageButton(type, classes)\n\t\t\t\t.then((result) => editor.model.change(writer => {\n\t\t\t\t\twriter.setAttribute( 'classes', result.classes, widget );\n\t\t\t\t\twriter.setAttribute( 'type', result.type, widget );\n\t\t\t\t})\n\t\t\t);\n\t\t} );\n\t}\n\n\tafterInit() {\n\t\t// Add actual toolbar\n\t\tcreateEditToolbar(\n\t\t\tthis,\n\t\t\tthis.editor,\n\t\t\t'OPMacroWpButton',\n\t\t\tisWpButtonMacroWidgetSelected\n\t\t);\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module upload/filereader\n */\n/* globals window */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Wrapper over the native `FileReader`.\n */\nexport default class FileReader extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates an instance of the FileReader.\n */\n constructor() {\n super();\n const reader = new window.FileReader();\n this._reader = reader;\n this._data = undefined;\n this.set('loaded', 0);\n reader.onprogress = evt => {\n this.loaded = evt.loaded;\n };\n }\n /**\n * Returns error that occurred during file reading.\n */\n get error() {\n return this._reader.error;\n }\n /**\n * Holds the data of an already loaded file. The file must be first loaded\n * by using {@link module:upload/filereader~FileReader#read `read()`}.\n */\n get data() {\n return this._data;\n }\n /**\n * Reads the provided file.\n *\n * @param file Native File object.\n * @returns Returns a promise that will be resolved with file's content.\n * The promise will be rejected in case of an error or when the reading process is aborted.\n */\n read(file) {\n const reader = this._reader;\n this.total = file.size;\n return new Promise((resolve, reject) => {\n reader.onload = () => {\n const result = reader.result;\n this._data = result;\n resolve(result);\n };\n reader.onerror = () => {\n reject('error');\n };\n reader.onabort = () => {\n reject('aborted');\n };\n this._reader.readAsDataURL(file);\n });\n }\n /**\n * Aborts file reader.\n */\n abort() {\n this._reader.abort();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module upload/filerepository\n */\nimport { Plugin, PendingActions } from '@ckeditor/ckeditor5-core';\nimport { CKEditorError, Collection, ObservableMixin, logWarning, uid } from '@ckeditor/ckeditor5-utils';\nimport FileReader from './filereader.js';\n/**\n * File repository plugin. A central point for managing file upload.\n *\n * To use it, first you need an upload adapter. Upload adapter's job is to handle communication with the server\n * (sending the file and handling server's response). You can use one of the existing plugins introducing upload adapters\n * (e.g. {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter} or\n * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}) or write your own one – see\n * the {@glink framework/deep-dive/upload-adapter Custom image upload adapter deep-dive} guide.\n *\n * Then, you can use {@link module:upload/filerepository~FileRepository#createLoader `createLoader()`} and the returned\n * {@link module:upload/filerepository~FileLoader} instance to load and upload files.\n */\nexport default class FileRepository extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * Collection of loaders associated with this repository.\n */\n this.loaders = new Collection();\n /**\n * Loaders mappings used to retrieve loaders references.\n */\n this._loadersMap = new Map();\n /**\n * Reference to a pending action registered in a {@link module:core/pendingactions~PendingActions} plugin\n * while upload is in progress. When there is no upload then value is `null`.\n */\n this._pendingAction = null;\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FileRepository';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [PendingActions];\n }\n /**\n * @inheritDoc\n */\n init() {\n // Keeps upload in a sync with pending actions.\n this.loaders.on('change', () => this._updatePendingAction());\n this.set('uploaded', 0);\n this.set('uploadTotal', null);\n this.bind('uploadedPercent').to(this, 'uploaded', this, 'uploadTotal', (uploaded, total) => {\n return total ? (uploaded / total * 100) : 0;\n });\n }\n /**\n * Returns the loader associated with specified file or promise.\n *\n * To get loader by id use `fileRepository.loaders.get( id )`.\n *\n * @param fileOrPromise Native file or promise handle.\n */\n getLoader(fileOrPromise) {\n return this._loadersMap.get(fileOrPromise) || null;\n }\n /**\n * Creates a loader instance for the given file.\n *\n * Requires {@link #createUploadAdapter} factory to be defined.\n *\n * @param fileOrPromise Native File object or native Promise object which resolves to a File.\n */\n createLoader(fileOrPromise) {\n if (!this.createUploadAdapter) {\n /**\n * You need to enable an upload adapter in order to be able to upload files.\n *\n * This warning shows up when {@link module:upload/filerepository~FileRepository} is being used\n * without {@link module:upload/filerepository~FileRepository#createUploadAdapter defining an upload adapter}.\n *\n * **If you see this warning when using one of the {@glink getting-started/legacy/installation-methods/predefined-builds\n * CKEditor 5 Builds}**\n * it means that you did not configure any of the upload adapters available by default in those builds.\n *\n * Predefined builds are a deprecated solution and we strongly advise\n * {@glink updating/nim-migration/migration-to-new-installation-methods migrating to new installation methods}.\n *\n * See the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} to learn which upload\n * adapters are available in the builds and how to configure them.\n *\n * Otherwise, if you see this warning, there is a chance that you enabled\n * a feature like {@link module:image/imageupload~ImageUpload},\n * or {@link module:image/imageupload/imageuploadui~ImageUploadUI} but you did not enable any upload adapter.\n * You can choose one of the existing upload adapters listed in the\n * {@glink features/images/image-upload/image-upload \"Image upload overview\"}.\n *\n * You can also implement your {@glink framework/deep-dive/upload-adapter own image upload adapter}.\n *\n * @error filerepository-no-upload-adapter\n */\n logWarning('filerepository-no-upload-adapter');\n return null;\n }\n const loader = new FileLoader(Promise.resolve(fileOrPromise), this.createUploadAdapter);\n this.loaders.add(loader);\n this._loadersMap.set(fileOrPromise, loader);\n // Store also file => loader mapping so loader can be retrieved by file instance returned upon Promise resolution.\n if (fileOrPromise instanceof Promise) {\n loader.file\n .then(file => {\n this._loadersMap.set(file, loader);\n })\n // Every then() must have a catch().\n // File loader state (and rejections) are handled in read() and upload().\n // Also, see the \"does not swallow the file promise rejection\" test.\n .catch(() => { });\n }\n loader.on('change:uploaded', () => {\n let aggregatedUploaded = 0;\n for (const loader of this.loaders) {\n aggregatedUploaded += loader.uploaded;\n }\n this.uploaded = aggregatedUploaded;\n });\n loader.on('change:uploadTotal', () => {\n let aggregatedTotal = 0;\n for (const loader of this.loaders) {\n if (loader.uploadTotal) {\n aggregatedTotal += loader.uploadTotal;\n }\n }\n this.uploadTotal = aggregatedTotal;\n });\n return loader;\n }\n /**\n * Destroys the given loader.\n *\n * @param fileOrPromiseOrLoader File or Promise associated with that loader or loader itself.\n */\n destroyLoader(fileOrPromiseOrLoader) {\n const loader = fileOrPromiseOrLoader instanceof FileLoader ? fileOrPromiseOrLoader : this.getLoader(fileOrPromiseOrLoader);\n loader._destroy();\n this.loaders.remove(loader);\n this._loadersMap.forEach((value, key) => {\n if (value === loader) {\n this._loadersMap.delete(key);\n }\n });\n }\n /**\n * Registers or deregisters pending action bound with upload progress.\n */\n _updatePendingAction() {\n const pendingActions = this.editor.plugins.get(PendingActions);\n if (this.loaders.length) {\n if (!this._pendingAction) {\n const t = this.editor.t;\n const getMessage = (value) => `${t('Upload in progress')} ${parseInt(value)}%.`;\n this._pendingAction = pendingActions.add(getMessage(this.uploadedPercent));\n this._pendingAction.bind('message').to(this, 'uploadedPercent', getMessage);\n }\n }\n else {\n pendingActions.remove(this._pendingAction);\n this._pendingAction = null;\n }\n }\n}\n/**\n * File loader class.\n *\n * It is used to control the process of reading the file and uploading it using the specified upload adapter.\n */\nclass FileLoader extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a new instance of `FileLoader`.\n *\n * @param filePromise A promise which resolves to a file instance.\n * @param uploadAdapterCreator The function which returns {@link module:upload/filerepository~UploadAdapter} instance.\n */\n constructor(filePromise, uploadAdapterCreator) {\n super();\n this.id = uid();\n this._filePromiseWrapper = this._createFilePromiseWrapper(filePromise);\n this._adapter = uploadAdapterCreator(this);\n this._reader = new FileReader();\n this.set('status', 'idle');\n this.set('uploaded', 0);\n this.set('uploadTotal', null);\n this.bind('uploadedPercent').to(this, 'uploaded', this, 'uploadTotal', (uploaded, total) => {\n return total ? (uploaded / total * 100) : 0;\n });\n this.set('uploadResponse', null);\n }\n /**\n * A `Promise` which resolves to a `File` instance associated with this file loader.\n */\n get file() {\n if (!this._filePromiseWrapper) {\n // Loader was destroyed, return promise which resolves to null.\n return Promise.resolve(null);\n }\n else {\n // The `this._filePromiseWrapper.promise` is chained and not simply returned to handle a case when:\n //\n //\t\t* The `loader.file.then( ... )` is called by external code (returned promise is pending).\n //\t\t* Then `loader._destroy()` is called (call is synchronous) which destroys the `loader`.\n //\t\t* Promise returned by the first `loader.file.then( ... )` call is resolved.\n //\n // Returning `this._filePromiseWrapper.promise` will still resolve to a `File` instance so there\n // is an additional check needed in the chain to see if `loader` was destroyed in the meantime.\n return this._filePromiseWrapper.promise.then(file => this._filePromiseWrapper ? file : null);\n }\n }\n /**\n * Returns the file data. To read its data, you need for first load the file\n * by using the {@link module:upload/filerepository~FileLoader#read `read()`} method.\n */\n get data() {\n return this._reader.data;\n }\n /**\n * Reads file using {@link module:upload/filereader~FileReader}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-read-wrong-status` when status\n * is different than `idle`.\n *\n * Example usage:\n *\n * ```ts\n * fileLoader.read()\n * \t.then( data => { ... } )\n * \t.catch( err => {\n * \t\tif ( err === 'aborted' ) {\n * \t\t\tconsole.log( 'Reading aborted.' );\n * \t\t} else {\n * \t\t\tconsole.log( 'Reading error.', err );\n * \t\t}\n * \t} );\n * ```\n *\n * @returns Returns promise that will be resolved with read data. Promise will be rejected if error\n * occurs or if read process is aborted.\n */\n read() {\n if (this.status != 'idle') {\n /**\n * You cannot call read if the status is different than idle.\n *\n * @error filerepository-read-wrong-status\n */\n throw new CKEditorError('filerepository-read-wrong-status', this);\n }\n this.status = 'reading';\n return this.file\n .then(file => this._reader.read(file))\n .then(data => {\n // Edge case: reader was aborted after file was read - double check for proper status.\n // It can happen when image was deleted during its upload.\n if (this.status !== 'reading') {\n throw this.status;\n }\n this.status = 'idle';\n return data;\n })\n .catch(err => {\n if (err === 'aborted') {\n this.status = 'aborted';\n throw 'aborted';\n }\n this.status = 'error';\n throw this._reader.error ? this._reader.error : err;\n });\n }\n /**\n * Reads file using the provided {@link module:upload/filerepository~UploadAdapter}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-upload-wrong-status` when status\n * is different than `idle`.\n * Example usage:\n *\n * ```ts\n * fileLoader.upload()\n * \t.then( data => { ... } )\n * \t.catch( e => {\n * \t\tif ( e === 'aborted' ) {\n * \t\t\tconsole.log( 'Uploading aborted.' );\n * \t\t} else {\n * \t\t\tconsole.log( 'Uploading error.', e );\n * \t\t}\n * \t} );\n * ```\n *\n * @returns Returns promise that will be resolved with response data. Promise will be rejected if error\n * occurs or if read process is aborted.\n */\n upload() {\n if (this.status != 'idle') {\n /**\n * You cannot call upload if the status is different than idle.\n *\n * @error filerepository-upload-wrong-status\n */\n throw new CKEditorError('filerepository-upload-wrong-status', this);\n }\n this.status = 'uploading';\n return this.file\n .then(() => this._adapter.upload())\n .then(data => {\n this.uploadResponse = data;\n this.status = 'idle';\n return data;\n })\n .catch(err => {\n if (this.status === 'aborted') {\n throw 'aborted';\n }\n this.status = 'error';\n throw err;\n });\n }\n /**\n * Aborts loading process.\n */\n abort() {\n const status = this.status;\n this.status = 'aborted';\n if (!this._filePromiseWrapper.isFulfilled) {\n // Edge case: file loader is aborted before read() is called\n // so it might happen that no one handled the rejection of this promise.\n // See https://github.com/ckeditor/ckeditor5-upload/pull/100\n this._filePromiseWrapper.promise.catch(() => { });\n this._filePromiseWrapper.rejecter('aborted');\n }\n else if (status == 'reading') {\n this._reader.abort();\n }\n else if (status == 'uploading' && this._adapter.abort) {\n this._adapter.abort();\n }\n this._destroy();\n }\n /**\n * Performs cleanup.\n *\n * @internal\n */\n _destroy() {\n this._filePromiseWrapper = undefined;\n this._reader = undefined;\n this._adapter = undefined;\n this.uploadResponse = undefined;\n }\n /**\n * Wraps a given file promise into another promise giving additional\n * control (resolving, rejecting, checking if fulfilled) over it.\n *\n * @param filePromise The initial file promise to be wrapped.\n */\n _createFilePromiseWrapper(filePromise) {\n const wrapper = {};\n wrapper.promise = new Promise((resolve, reject) => {\n wrapper.rejecter = reject;\n wrapper.isFulfilled = false;\n filePromise\n .then(file => {\n wrapper.isFulfilled = true;\n resolve(file);\n })\n .catch(err => {\n wrapper.isFulfilled = true;\n reject(err);\n });\n });\n return wrapper;\n }\n}\n","import {getOPService} from './op-context/op-context';\n\nexport default class OpUploadResourceAdapter {\n constructor(loader, resource, editor) {\n this.loader = loader;\n this.resource = resource;\n this.editor = editor;\n }\n\n upload() {\n\t\tconst resource = this.resource;\n\t\tconst resourceService = getOPService(this.editor, 'attachmentsResourceService');\n\n if (!resource) {\n console.warn(`resource not available in this CKEditor instance`);\n return Promise.reject(\"Not possible to upload attachments without resource\");\n\t\t}\n\n\t\treturn this.loader.file\n\t\t\t.then(file => {\n\t\t\treturn resourceService\n\t\t\t\t.attachFiles(resource, [file])\n\t\t\t\t.toPromise()\n\t\t\t\t.then((result) => {\n\t\t\t\t\tthis.editor.model.fire('op:attachment-added', result);\n\n\t\t\t\t\treturn this.buildResponse(result[0])\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tconsole.error(\"Failed upload %O\", error);\n\t\t\t\t});\n\t\t})\n\n\t}\n\n\tbuildResponse(result) {\n\t\treturn { default: result._links.staticDownloadLocation.href };\n\t}\n\n abort() {\n\t\treturn false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboardobserver\n */\nimport { EventInfo } from '@ckeditor/ckeditor5-utils';\nimport { DataTransfer, DomEventObserver } from '@ckeditor/ckeditor5-engine';\n/**\n * Clipboard events observer.\n *\n * Fires the following events:\n *\n * * {@link module:engine/view/document~Document#event:clipboardInput},\n * * {@link module:engine/view/document~Document#event:paste},\n * * {@link module:engine/view/document~Document#event:copy},\n * * {@link module:engine/view/document~Document#event:cut},\n * * {@link module:engine/view/document~Document#event:drop},\n * * {@link module:engine/view/document~Document#event:dragover},\n * * {@link module:engine/view/document~Document#event:dragging},\n * * {@link module:engine/view/document~Document#event:dragstart},\n * * {@link module:engine/view/document~Document#event:dragend},\n * * {@link module:engine/view/document~Document#event:dragenter},\n * * {@link module:engine/view/document~Document#event:dragleave}.\n *\n * **Note**: This observer is not available by default (ckeditor5-engine does not add it on its own).\n * To make it available, it needs to be added to {@link module:engine/view/document~Document} by using\n * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. Alternatively, you can load the\n * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).\n */\nexport default class ClipboardObserver extends DomEventObserver {\n constructor(view) {\n super(view);\n this.domEventType = [\n 'paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter', 'dragleave'\n ];\n const viewDocument = this.document;\n this.listenTo(viewDocument, 'paste', handleInput('clipboardInput'), { priority: 'low' });\n this.listenTo(viewDocument, 'drop', handleInput('clipboardInput'), { priority: 'low' });\n this.listenTo(viewDocument, 'dragover', handleInput('dragging'), { priority: 'low' });\n function handleInput(type) {\n return (evt, data) => {\n data.preventDefault();\n const targetRanges = data.dropRange ? [data.dropRange] : null;\n const eventInfo = new EventInfo(viewDocument, type);\n viewDocument.fire(eventInfo, {\n dataTransfer: data.dataTransfer,\n method: evt.name,\n targetRanges,\n target: data.target,\n domEvent: data.domEvent\n });\n // If CKEditor handled the input, do not bubble the original event any further.\n // This helps external integrations recognize that fact and act accordingly.\n // https://github.com/ckeditor/ckeditor5-upload/issues/92\n if (eventInfo.stop.called) {\n data.stopPropagation();\n }\n };\n }\n }\n onDomEvent(domEvent) {\n const nativeDataTransfer = 'clipboardData' in domEvent ? domEvent.clipboardData : domEvent.dataTransfer;\n const cacheFiles = domEvent.type == 'drop' || domEvent.type == 'paste';\n const evtData = {\n dataTransfer: new DataTransfer(nativeDataTransfer, { cacheFiles })\n };\n if (domEvent.type == 'drop' || domEvent.type == 'dragover') {\n evtData.dropRange = getDropViewRange(this.view, domEvent);\n }\n this.fire(domEvent.type, domEvent, evtData);\n }\n}\nfunction getDropViewRange(view, domEvent) {\n const domDoc = domEvent.target.ownerDocument;\n const x = domEvent.clientX;\n const y = domEvent.clientY;\n let domRange;\n // Webkit & Blink.\n if (domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint(x, y)) {\n domRange = domDoc.caretRangeFromPoint(x, y);\n }\n // FF.\n else if (domEvent.rangeParent) {\n domRange = domDoc.createRange();\n domRange.setStart(domEvent.rangeParent, domEvent.rangeOffset);\n domRange.collapse(true);\n }\n if (domRange) {\n return view.domConverter.domRangeToView(domRange);\n }\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n// Elements which should not have empty-line padding.\n// Most `view.ContainerElement` want to be separate by new-line, but some are creating one structure\n// together (like `<li>`) so it is better to separate them by only one \"\\n\".\nconst smallPaddingElements = ['figcaption', 'li'];\nconst listElements = ['ol', 'ul'];\n/**\n * Converts {@link module:engine/view/item~Item view item} and all of its children to plain text.\n *\n * @param viewItem View item to convert.\n * @returns Plain text representation of `viewItem`.\n */\nexport default function viewToPlainText(viewItem) {\n if (viewItem.is('$text') || viewItem.is('$textProxy')) {\n return viewItem.data;\n }\n if (viewItem.is('element', 'img') && viewItem.hasAttribute('alt')) {\n return viewItem.getAttribute('alt');\n }\n if (viewItem.is('element', 'br')) {\n return '\\n'; // Convert soft breaks to single line break (#8045).\n }\n /**\n * Item is a document fragment, attribute element or container element. It doesn't\n * have it's own text value, so we need to convert its children elements.\n */\n let text = '';\n let prev = null;\n for (const child of viewItem.getChildren()) {\n text += newLinePadding(child, prev) + viewToPlainText(child);\n prev = child;\n }\n return text;\n}\n/**\n * Returns new line padding to prefix the given elements with.\n */\nfunction newLinePadding(element, previous) {\n if (!previous) {\n // Don't add padding to first elements in a level.\n return '';\n }\n if (element.is('element', 'li') && !element.isEmpty && element.getChild(0).is('containerElement')) {\n // Separate document list items with empty lines.\n return '\\n\\n';\n }\n if (listElements.includes(element.name) && listElements.includes(previous.name)) {\n /**\n * Because `<ul>` and `<ol>` are AttributeElements, two consecutive lists will not have any padding between\n * them (see the `if` statement below). To fix this, we need to make an exception for this case.\n */\n return '\\n\\n';\n }\n if (!element.is('containerElement') && !previous.is('containerElement')) {\n // Don't add padding between non-container elements.\n return '';\n }\n if (smallPaddingElements.includes(element.name) || smallPaddingElements.includes(previous.name)) {\n // Add small padding between selected container elements.\n return '\\n';\n }\n // Do not add padding around the elements that won't be rendered.\n if (element.is('element') && element.getCustomProperty('dataPipeline:transparentRendering') ||\n previous.is('element') && previous.getCustomProperty('dataPipeline:transparentRendering')) {\n return '';\n }\n // Add empty lines between container elements.\n return '\\n\\n';\n}\n","import baseFor from './_baseFor.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nexport default baseForOwn;\n","import isObject from './isObject.js';\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nexport default isStrictComparable;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nexport default matchesStrictComparable;\n","import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nexport default baseMatches;\n","import isStrictComparable from './_isStrictComparable.js';\nimport keys from './keys.js';\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nexport default getMatchData;\n","import Stack from './_Stack.js';\nimport baseIsEqual from './_baseIsEqual.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nexport default baseIsMatch;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nexport default baseHasIn;\n","import baseHasIn from './_baseHasIn.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nexport default hasIn;\n","import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n","import baseProperty from './_baseProperty.js';\nimport basePropertyDeep from './_basePropertyDeep.js';\nimport isKey from './_isKey.js';\nimport toKey from './_toKey.js';\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nexport default property;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default baseProperty;\n","import baseGet from './_baseGet.js';\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nexport default basePropertyDeep;\n","import baseMatches from './_baseMatches.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\nimport property from './property.js';\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nexport default baseIteratee;\n","import baseIsEqual from './_baseIsEqual.js';\nimport get from './get.js';\nimport hasIn from './hasIn.js';\nimport isKey from './_isKey.js';\nimport isStrictComparable from './_isStrictComparable.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\nimport toKey from './_toKey.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nexport default baseMatchesProperty;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboardmarkersutils\n */\nimport { mapValues } from 'lodash-es';\nimport { uid } from '@ckeditor/ckeditor5-utils';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { Range } from '@ckeditor/ckeditor5-engine';\n/**\n * Part of the clipboard logic. Responsible for collecting markers from selected fragments\n * and restoring them with proper positions in pasted elements.\n *\n * @internal\n */\nexport default class ClipboardMarkersUtils extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * Map of marker names that can be copied.\n *\n * @internal\n */\n this._markersToCopy = new Map();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ClipboardMarkersUtils';\n }\n /**\n * Registers marker name as copyable in clipboard pipeline.\n *\n * @param markerName Name of marker that can be copied.\n * @param config Configuration that describes what can be performed on specified marker.\n * @internal\n */\n _registerMarkerToCopy(markerName, config) {\n this._markersToCopy.set(markerName, config);\n }\n /**\n * Performs copy markers on provided selection and paste it to fragment returned from `getCopiedFragment`.\n *\n * \t1. Picks all markers in provided selection.\n * \t2. Inserts fake markers to document.\n * \t3. Gets copied selection fragment from document.\n * \t4. Removes fake elements from fragment and document.\n * \t5. Inserts markers in the place of removed fake markers.\n *\n * Due to selection modification, when inserting items, `getCopiedFragment` must *always* operate on `writer.model.document.selection'.\n * Do not use any other custom selection object within callback, as this will lead to out-of-bounds exceptions in rare scenarios.\n *\n * @param action Type of clipboard action.\n * @param writer An instance of the model writer.\n * @param selection Selection to be checked.\n * @param getCopiedFragment\tCallback that performs copy of selection and returns it as fragment.\n * @internal\n */\n _copySelectedFragmentWithMarkers(action, selection, getCopiedFragment = writer => writer.model.getSelectedContent(writer.model.document.selection)) {\n return this.editor.model.change(writer => {\n const oldSelection = writer.model.document.selection;\n // In some scenarios, such like in drag & drop, passed `selection` parameter is not actually\n // the same `selection` as the `writer.model.document.selection` which means that `_insertFakeMarkersToSelection`\n // is not affecting passed `selection` `start` and `end` positions but rather modifies `writer.model.document.selection`.\n //\n // It is critical due to fact that when we have selection that starts [ 0, 0 ] and ends at [ 1, 0 ]\n // and after inserting fake marker it will point to such marker instead of new widget position at start: [ 1, 0 ] end: [2, 0 ].\n // `writer.insert` modifies only original `writer.model.document.selection`.\n writer.setSelection(selection);\n const sourceSelectionInsertedMarkers = this._insertFakeMarkersIntoSelection(writer, writer.model.document.selection, action);\n const fragment = getCopiedFragment(writer);\n const fakeMarkersRangesInsideRange = this._removeFakeMarkersInsideElement(writer, fragment);\n // <fake-marker> [Foo] Bar</fake-marker>\n // ^ ^\n // In `_insertFakeMarkersIntoSelection` call we inserted fake marker just before first element.\n // The problem is that the first element can be start position of selection so insertion fake-marker\n // before such element shifts selection (so selection that was at [0, 0] now is at [0, 1]).\n // It means that inserted fake-marker is no longer present inside such selection and is orphaned.\n // This function checks special case of such problem. Markers that are orphaned at the start position\n // and end position in the same time. Basically it means that they overlaps whole element.\n for (const [markerName, elements] of Object.entries(sourceSelectionInsertedMarkers)) {\n fakeMarkersRangesInsideRange[markerName] || (fakeMarkersRangesInsideRange[markerName] = writer.createRangeIn(fragment));\n for (const element of elements) {\n writer.remove(element);\n }\n }\n fragment.markers.clear();\n for (const [markerName, range] of Object.entries(fakeMarkersRangesInsideRange)) {\n fragment.markers.set(markerName, range);\n }\n // Revert back selection to previous one.\n writer.setSelection(oldSelection);\n return fragment;\n });\n }\n /**\n * Performs paste of markers on already pasted element.\n *\n * \t1. Inserts fake markers that are present in fragment element (such fragment will be processed in `getPastedDocumentElement`).\n * \t2. Calls `getPastedDocumentElement` and gets element that is inserted into root model.\n * \t3. Removes all fake markers present in transformed element.\n * \t4. Inserts new markers with removed fake markers ranges into pasted fragment.\n *\n * There are multiple edge cases that have to be considered before calling this function:\n *\n * \t* `markers` are inserted into the same element that must be later transformed inside `getPastedDocumentElement`.\n * \t* Fake marker elements inside `getPastedDocumentElement` can be cloned, but their ranges cannot overlap.\n * \t* If `duplicateOnPaste` is `true` in marker config then associated marker ID is regenerated before pasting.\n *\n * @param action Type of clipboard action.\n * @param markers Object that maps marker name to corresponding range.\n * @param getPastedDocumentElement Getter used to get target markers element.\n * @internal\n */\n _pasteMarkersIntoTransformedElement(markers, getPastedDocumentElement) {\n const pasteMarkers = this._getPasteMarkersFromRangeMap(markers);\n return this.editor.model.change(writer => {\n // Inserts fake markers into source fragment / element that is later transformed inside `getPastedDocumentElement`.\n const sourceFragmentFakeMarkers = this._insertFakeMarkersElements(writer, pasteMarkers);\n // Modifies document fragment (for example, cloning table cells) and then inserts it into the document.\n const transformedElement = getPastedDocumentElement(writer);\n // Removes markers in pasted and transformed fragment in root document.\n const removedFakeMarkers = this._removeFakeMarkersInsideElement(writer, transformedElement);\n // Cleans up fake markers inserted into source fragment (that one before transformation which is not pasted).\n for (const element of Object.values(sourceFragmentFakeMarkers).flat()) {\n writer.remove(element);\n }\n // Inserts to root document fake markers.\n for (const [markerName, range] of Object.entries(removedFakeMarkers)) {\n if (!writer.model.markers.has(markerName)) {\n writer.addMarker(markerName, {\n usingOperation: true,\n affectsData: true,\n range\n });\n }\n }\n return transformedElement;\n });\n }\n /**\n * Pastes document fragment with markers to document.\n * If `duplicateOnPaste` is `true` in marker config then associated markers IDs\n * are regenerated before pasting to avoid markers duplications in content.\n *\n * @param fragment Document fragment that should contain already processed by pipeline markers.\n * @internal\n */\n _pasteFragmentWithMarkers(fragment) {\n const pasteMarkers = this._getPasteMarkersFromRangeMap(fragment.markers);\n fragment.markers.clear();\n for (const copyableMarker of pasteMarkers) {\n fragment.markers.set(copyableMarker.name, copyableMarker.range);\n }\n return this.editor.model.insertContent(fragment);\n }\n /**\n * In some situations we have to perform copy on selected fragment with certain markers. This function allows to temporarily bypass\n * restrictions on markers that we want to copy.\n *\n * This function executes `executor()` callback. For the duration of the callback, if the clipboard pipeline is used to copy\n * content, markers with the specified name will be copied to the clipboard as well.\n *\n * @param markerName Which markers should be copied.\n * @param executor Callback executed.\n * @param config Optional configuration flags used to copy (such like partial copy flag).\n * @internal\n */\n _forceMarkersCopy(markerName, executor, config = {\n allowedActions: 'all',\n copyPartiallySelected: true,\n duplicateOnPaste: true\n }) {\n const before = this._markersToCopy.get(markerName);\n this._markersToCopy.set(markerName, config);\n executor();\n if (before) {\n this._markersToCopy.set(markerName, before);\n }\n else {\n this._markersToCopy.delete(markerName);\n }\n }\n /**\n * Checks if marker can be copied.\n *\n * @param markerName Name of checked marker.\n * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.\n * @internal\n */\n _isMarkerCopyable(markerName, action) {\n const config = this._getMarkerClipboardConfig(markerName);\n if (!config) {\n return false;\n }\n // If there is no action provided then only presence of marker is checked.\n if (!action) {\n return true;\n }\n const { allowedActions } = config;\n return allowedActions === 'all' || allowedActions.includes(action);\n }\n /**\n * Checks if marker has any clipboard copy behavior configuration.\n *\n * @param markerName Name of checked marker.\n */\n _hasMarkerConfiguration(markerName) {\n return !!this._getMarkerClipboardConfig(markerName);\n }\n /**\n * Returns marker's configuration flags passed during registration.\n *\n * @param markerName Name of marker that should be returned.\n * @internal\n */\n _getMarkerClipboardConfig(markerName) {\n const [markerNamePrefix] = markerName.split(':');\n return this._markersToCopy.get(markerNamePrefix) || null;\n }\n /**\n * First step of copying markers. It looks for markers intersecting with given selection and inserts `$marker` elements\n * at positions where document markers start or end. This way `$marker` elements can be easily copied together with\n * the rest of the content of the selection.\n *\n * @param writer An instance of the model writer.\n * @param selection Selection to be checked.\n * @param action Type of clipboard action.\n */\n _insertFakeMarkersIntoSelection(writer, selection, action) {\n const copyableMarkers = this._getCopyableMarkersFromSelection(writer, selection, action);\n return this._insertFakeMarkersElements(writer, copyableMarkers);\n }\n /**\n * Returns array of markers that can be copied in specified selection.\n *\n * If marker cannot be copied partially (according to `copyPartiallySelected` configuration flag) and\n * is not present entirely in any selection range then it will be skipped.\n *\n * @param writer An instance of the model writer.\n * @param selection Selection which will be checked.\n * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.\n */\n _getCopyableMarkersFromSelection(writer, selection, action) {\n const selectionRanges = Array.from(selection.getRanges());\n // Picks all markers in provided ranges. Ensures that there are no duplications if\n // there are multiple ranges that intersects with the same marker.\n const markersInRanges = new Set(selectionRanges.flatMap(selectionRange => Array.from(writer.model.markers.getMarkersIntersectingRange(selectionRange))));\n const isSelectionMarkerCopyable = (marker) => {\n // Check if marker exists in configuration and provided action can be performed on it.\n const isCopyable = this._isMarkerCopyable(marker.name, action);\n if (!isCopyable) {\n return false;\n }\n // Checks if configuration disallows to copy marker only if part of its content is selected.\n //\n // Example:\n // \t<marker-a> Hello [ World ] </marker-a>\n //\t\t\t\t\t\t^ selection\n //\n // In this scenario `marker-a` won't be copied because selection doesn't overlap its content entirely.\n const { copyPartiallySelected } = this._getMarkerClipboardConfig(marker.name);\n if (!copyPartiallySelected) {\n const markerRange = marker.getRange();\n return selectionRanges.some(selectionRange => selectionRange.containsRange(markerRange, true));\n }\n return true;\n };\n return Array\n .from(markersInRanges)\n .filter(isSelectionMarkerCopyable)\n .map((copyableMarker) => {\n // During `dragstart` event original marker is still present in tree.\n // It is removed after the clipboard drop event, so none of the copied markers are inserted at the end.\n // It happens because there already markers with specified `marker.name` when clipboard is trying to insert data\n // and it aborts inserting.\n const name = action === 'dragstart' ? this._getUniqueMarkerName(copyableMarker.name) : copyableMarker.name;\n return {\n name,\n range: copyableMarker.getRange()\n };\n });\n }\n /**\n * Picks all markers from markers map that can be pasted.\n * If `duplicateOnPaste` is `true`, it regenerates their IDs to ensure uniqueness.\n * If marker is not registered, it will be kept in the array anyway.\n *\n * @param markers Object that maps marker name to corresponding range.\n * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.\n */\n _getPasteMarkersFromRangeMap(markers, action = null) {\n const { model } = this.editor;\n const entries = markers instanceof Map ? Array.from(markers.entries()) : Object.entries(markers);\n return entries.flatMap(([markerName, range]) => {\n if (!this._hasMarkerConfiguration(markerName)) {\n return [\n {\n name: markerName,\n range\n }\n ];\n }\n if (this._isMarkerCopyable(markerName, action)) {\n const copyMarkerConfig = this._getMarkerClipboardConfig(markerName);\n const isInGraveyard = model.markers.has(markerName) &&\n model.markers.get(markerName).getRange().root.rootName === '$graveyard';\n if (copyMarkerConfig.duplicateOnPaste || isInGraveyard) {\n markerName = this._getUniqueMarkerName(markerName);\n }\n return [\n {\n name: markerName,\n range\n }\n ];\n }\n return [];\n });\n }\n /**\n * Inserts specified array of fake markers elements to document and assigns them `type` and `name` attributes.\n * Fake markers elements are used to calculate position of markers on pasted fragment that were transformed during\n * steps between copy and paste.\n *\n * @param writer An instance of the model writer.\n * @param markers Array of markers that will be inserted.\n */\n _insertFakeMarkersElements(writer, markers) {\n const mappedMarkers = {};\n const sortedMarkers = markers\n .flatMap(marker => {\n const { start, end } = marker.range;\n return [\n { position: start, marker, type: 'start' },\n { position: end, marker, type: 'end' }\n ];\n })\n // Markers position is sorted backwards to ensure that the insertion of fake markers will not change\n // the position of the next markers.\n .sort(({ position: posA }, { position: posB }) => posA.isBefore(posB) ? 1 : -1);\n for (const { position, marker, type } of sortedMarkers) {\n const fakeMarker = writer.createElement('$marker', {\n 'data-name': marker.name,\n 'data-type': type\n });\n if (!mappedMarkers[marker.name]) {\n mappedMarkers[marker.name] = [];\n }\n mappedMarkers[marker.name].push(fakeMarker);\n writer.insert(fakeMarker, position);\n }\n return mappedMarkers;\n }\n /**\n * Removes all `$marker` elements from the given document fragment.\n *\n * Returns an object where keys are marker names, and values are ranges corresponding to positions\n * where `$marker` elements were inserted.\n *\n * If the document fragment had only one `$marker` element for given marker (start or end) the other boundary is set automatically\n * (to the end or start of the document fragment, respectively).\n *\n * @param writer An instance of the model writer.\n * @param rootElement The element to be checked.\n */\n _removeFakeMarkersInsideElement(writer, rootElement) {\n const fakeMarkersElements = this._getAllFakeMarkersFromElement(writer, rootElement);\n const fakeMarkersRanges = fakeMarkersElements.reduce((acc, fakeMarker) => {\n const position = fakeMarker.markerElement && writer.createPositionBefore(fakeMarker.markerElement);\n let prevFakeMarker = acc[fakeMarker.name];\n // Handle scenario when tables clone cells with the same fake node. Example:\n //\n // <cell><fake-marker-a></cell> <cell><fake-marker-a></cell> <cell><fake-marker-a></cell>\n // ^ cloned ^ cloned\n //\n // The easiest way to bypass this issue is to rename already existing in map nodes and\n // set them new unique name.\n let skipAssign = false;\n if (prevFakeMarker && prevFakeMarker.start && prevFakeMarker.end) {\n const config = this._getMarkerClipboardConfig(fakeMarker.name);\n if (config.duplicateOnPaste) {\n acc[this._getUniqueMarkerName(fakeMarker.name)] = acc[fakeMarker.name];\n }\n else {\n skipAssign = true;\n }\n prevFakeMarker = null;\n }\n if (!skipAssign) {\n acc[fakeMarker.name] = {\n ...prevFakeMarker,\n [fakeMarker.type]: position\n };\n }\n if (fakeMarker.markerElement) {\n writer.remove(fakeMarker.markerElement);\n }\n return acc;\n }, {});\n // We cannot construct ranges directly in previous reduce because element ranges can overlap.\n // In other words lets assume we have such scenario:\n // <fake-marker-start /> <paragraph /> <fake-marker-2-start /> <fake-marker-end /> <fake-marker-2-end />\n //\n // We have to remove `fake-marker-start` firstly and then remove `fake-marker-2-start`.\n // Removal of `fake-marker-2-start` affects `fake-marker-end` position so we cannot create\n // connection between `fake-marker-start` and `fake-marker-end` without iterating whole set firstly.\n return mapValues(fakeMarkersRanges, range => new Range(range.start || writer.createPositionFromPath(rootElement, [0]), range.end || writer.createPositionAt(rootElement, 'end')));\n }\n /**\n * Returns array that contains list of fake markers with corresponding `$marker` elements.\n *\n * For each marker, there can be two `$marker` elements or only one (if the document fragment contained\n * only the beginning or only the end of a marker).\n *\n * @param writer An instance of the model writer.\n * @param rootElement The element to be checked.\n */\n _getAllFakeMarkersFromElement(writer, rootElement) {\n const foundFakeMarkers = Array\n .from(writer.createRangeIn(rootElement))\n .flatMap(({ item }) => {\n if (!item.is('element', '$marker')) {\n return [];\n }\n const name = item.getAttribute('data-name');\n const type = item.getAttribute('data-type');\n return [\n {\n markerElement: item,\n name,\n type\n }\n ];\n });\n const prependFakeMarkers = [];\n const appendFakeMarkers = [];\n for (const fakeMarker of foundFakeMarkers) {\n if (fakeMarker.type === 'end') {\n // <fake-marker> [ phrase</fake-marker> phrase ]\n // ^\n // Handle case when marker is just before start of selection.\n // Only end marker is inside selection.\n const hasMatchingStartMarker = foundFakeMarkers.some(otherFakeMarker => otherFakeMarker.name === fakeMarker.name && otherFakeMarker.type === 'start');\n if (!hasMatchingStartMarker) {\n prependFakeMarkers.push({\n markerElement: null,\n name: fakeMarker.name,\n type: 'start'\n });\n }\n }\n if (fakeMarker.type === 'start') {\n // [<fake-marker>phrase]</fake-marker>\n // ^\n // Handle case when fake marker is after selection.\n // Only start marker is inside selection.\n const hasMatchingEndMarker = foundFakeMarkers.some(otherFakeMarker => otherFakeMarker.name === fakeMarker.name && otherFakeMarker.type === 'end');\n if (!hasMatchingEndMarker) {\n appendFakeMarkers.unshift({\n markerElement: null,\n name: fakeMarker.name,\n type: 'end'\n });\n }\n }\n }\n return [\n ...prependFakeMarkers,\n ...foundFakeMarkers,\n ...appendFakeMarkers\n ];\n }\n /**\n * When copy of markers occurs we have to make sure that pasted markers have different names\n * than source markers. This functions helps with assigning unique part to marker name to\n * prevent duplicated markers error.\n *\n * @param name Name of marker\n */\n _getUniqueMarkerName(name) {\n const parts = name.split(':');\n const newId = uid().substring(1, 6);\n // It looks like the marker already is UID marker so in this scenario just swap\n // last part of marker name and assign new UID.\n //\n // example: comment:{ threadId }:{ id } => comment:{ threadId }:{ newId }\n if (parts.length === 3) {\n return `${parts.slice(0, 2).join(':')}:${newId}`;\n }\n // Assign new segment to marker name with id.\n //\n // example: comment => comment:{ newId }\n return `${parts.join(':')}:${newId}`;\n }\n}\n","import baseAssignValue from './_baseAssignValue.js';\nimport baseForOwn from './_baseForOwn.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\nfunction mapValues(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n}\n\nexport default mapValues;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboardpipeline\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { EventInfo } from '@ckeditor/ckeditor5-utils';\nimport ClipboardObserver from './clipboardobserver.js';\nimport plainTextToHtml from './utils/plaintexttohtml.js';\nimport normalizeClipboardHtml from './utils/normalizeclipboarddata.js';\nimport viewToPlainText from './utils/viewtoplaintext.js';\nimport ClipboardMarkersUtils from './clipboardmarkersutils.js';\n// Input pipeline events overview:\n//\n// ┌──────────────────────┠┌──────────────────────â”\n// │ view.Document │ │ view.Document │\n// │ paste │ │ drop │\n// └───────────┬──────────┘ └───────────┬──────────┘\n// │ │\n// └────────────────┌────────────────┘\n// │\n// ┌─────────V────────â”\n// │ view.Document │ Retrieves text/html or text/plain from data.dataTransfer\n// │ clipboardInput │ and processes it to view.DocumentFragment.\n// └─────────┬────────┘\n// │\n// ┌───────────V───────────â”\n// │ ClipboardPipeline │ Converts view.DocumentFragment to model.DocumentFragment.\n// │ inputTransformation │\n// └───────────┬───────────┘\n// │\n// ┌──────────V──────────â”\n// │ ClipboardPipeline │ Calls model.insertContent().\n// │ contentInsertion │\n// └─────────────────────┘\n//\n//\n// Output pipeline events overview:\n//\n// ┌──────────────────────┠┌──────────────────────â”\n// │ view.Document │ │ view.Document │ Retrieves the selected model.DocumentFragment\n// │ copy │ │ cut │ and fires the `outputTransformation` event.\n// └───────────┬──────────┘ └───────────┬──────────┘\n// │ │\n// └────────────────┌────────────────┘\n// │\n// ┌───────────V───────────â”\n// │ ClipboardPipeline │ Processes model.DocumentFragment and converts it to\n// │ outputTransformation │ view.DocumentFragment.\n// └───────────┬───────────┘\n// │\n// ┌─────────V────────â”\n// │ view.Document │ Processes view.DocumentFragment to text/html and text/plain\n// │ clipboardOutput │ and stores the results in data.dataTransfer.\n// └──────────────────┘\n//\n/**\n * The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and\n * passing the pasted content through a series of events in order to insert it into the editor's content.\n * It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data.\n *\n * # Input pipeline\n *\n * The behavior of the default handlers (all at a `low` priority):\n *\n * ## Event: `paste` or `drop`\n *\n * 1. Translates the event data.\n * 2. Fires the {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event.\n *\n * ## Event: `view.Document#clipboardInput`\n *\n * 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event\n * from the last point.\n * 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`.\n * 3. Normalizes the raw data by applying simple filters on string data.\n * 4. Processes the raw data to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} with the\n * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.\n * 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation\n * `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field.\n *\n * ## Event: `ClipboardPipeline#inputTransformation`\n *\n * 1. Converts {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} from the `data.content` field to\n * {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`}.\n * 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`}\n * event with the model document fragment in the `data.content` event field.\n * **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers\n * to run in the same block without post-fixers called in between (i.e., the selection post-fixer).\n *\n * ## Event: `ClipboardPipeline#contentInsertion`\n *\n * 1. Calls {@link module:engine/model/model~Model#insertContent `model.insertContent()`} to insert `data.content`\n * at the current selection position.\n *\n * # Output pipeline\n *\n * The behavior of the default handlers (all at a `low` priority):\n *\n * ## Event: `copy`, `cut` or `dragstart`\n *\n * 1. Retrieves the selected {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`} by calling\n * {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}.\n * 2. Converts the model document fragment to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`}.\n * 3. Fires the {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} event\n * with the view document fragment in the `data.content` event field.\n *\n * ## Event: `view.Document#clipboardOutput`\n *\n * 1. Processes `data.content` to HTML and plain text with the\n * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.\n * 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data.\n * 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}\n * on the current selection.\n *\n * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.\n */\nexport default class ClipboardPipeline extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ClipboardPipeline';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardMarkersUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n view.addObserver(ClipboardObserver);\n this._setupPasteDrop();\n this._setupCopyCut();\n }\n /**\n * Fires Clipboard `'outputTransformation'` event for given parameters.\n *\n * @internal\n */\n _fireOutputTransformationEvent(dataTransfer, selection, method) {\n const clipboardMarkersUtils = this.editor.plugins.get('ClipboardMarkersUtils');\n this.editor.model.enqueueChange({ isUndoable: method === 'cut' }, () => {\n const documentFragment = clipboardMarkersUtils._copySelectedFragmentWithMarkers(method, selection);\n this.fire('outputTransformation', {\n dataTransfer,\n content: documentFragment,\n method\n });\n });\n }\n /**\n * The clipboard paste pipeline.\n */\n _setupPasteDrop() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const clipboardMarkersUtils = this.editor.plugins.get('ClipboardMarkersUtils');\n // Pasting is disabled when selection is in non-editable place.\n // Dropping is disabled in drag and drop handler.\n this.listenTo(viewDocument, 'clipboardInput', (evt, data) => {\n if (data.method == 'paste' && !editor.model.canEditAt(editor.model.document.selection)) {\n evt.stop();\n }\n }, { priority: 'highest' });\n this.listenTo(viewDocument, 'clipboardInput', (evt, data) => {\n const dataTransfer = data.dataTransfer;\n let content;\n // Some feature could already inject content in the higher priority event handler (i.e., codeBlock).\n if (data.content) {\n content = data.content;\n }\n else {\n let contentData = '';\n if (dataTransfer.getData('text/html')) {\n contentData = normalizeClipboardHtml(dataTransfer.getData('text/html'));\n }\n else if (dataTransfer.getData('text/plain')) {\n contentData = plainTextToHtml(dataTransfer.getData('text/plain'));\n }\n content = this.editor.data.htmlProcessor.toView(contentData);\n }\n const eventInfo = new EventInfo(this, 'inputTransformation');\n this.fire(eventInfo, {\n content,\n dataTransfer,\n targetRanges: data.targetRanges,\n method: data.method\n });\n // If CKEditor handled the input, do not bubble the original event any further.\n // This helps external integrations recognize this fact and act accordingly.\n // https://github.com/ckeditor/ckeditor5-upload/issues/92\n if (eventInfo.stop.called) {\n evt.stop();\n }\n view.scrollToTheSelection();\n }, { priority: 'low' });\n this.listenTo(this, 'inputTransformation', (evt, data) => {\n if (data.content.isEmpty) {\n return;\n }\n const dataController = this.editor.data;\n // Convert the pasted content into a model document fragment.\n // The conversion is contextual, but in this case an \"all allowed\" context is needed\n // and for that we use the $clipboardHolder item.\n const modelFragment = dataController.toModel(data.content, '$clipboardHolder');\n if (modelFragment.childCount == 0) {\n return;\n }\n evt.stop();\n // Fire content insertion event in a single change block to allow other handlers to run in the same block\n // without post-fixers called in between (i.e., the selection post-fixer).\n model.change(() => {\n this.fire('contentInsertion', {\n content: modelFragment,\n method: data.method,\n dataTransfer: data.dataTransfer,\n targetRanges: data.targetRanges\n });\n });\n }, { priority: 'low' });\n this.listenTo(this, 'contentInsertion', (evt, data) => {\n data.resultRange = clipboardMarkersUtils._pasteFragmentWithMarkers(data.content);\n }, { priority: 'low' });\n }\n /**\n * The clipboard copy/cut pipeline.\n */\n _setupCopyCut() {\n const editor = this.editor;\n const modelDocument = editor.model.document;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const onCopyCut = (evt, data) => {\n const dataTransfer = data.dataTransfer;\n data.preventDefault();\n this._fireOutputTransformationEvent(dataTransfer, modelDocument.selection, evt.name);\n };\n this.listenTo(viewDocument, 'copy', onCopyCut, { priority: 'low' });\n this.listenTo(viewDocument, 'cut', (evt, data) => {\n // Cutting is disabled when selection is in non-editable place.\n // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.\n if (!editor.model.canEditAt(editor.model.document.selection)) {\n data.preventDefault();\n }\n else {\n onCopyCut(evt, data);\n }\n }, { priority: 'low' });\n this.listenTo(this, 'outputTransformation', (evt, data) => {\n const content = editor.data.toView(data.content);\n viewDocument.fire('clipboardOutput', {\n dataTransfer: data.dataTransfer,\n content,\n method: data.method\n });\n }, { priority: 'low' });\n this.listenTo(viewDocument, 'clipboardOutput', (evt, data) => {\n if (!data.content.isEmpty) {\n data.dataTransfer.setData('text/html', this.editor.data.htmlProcessor.toData(data.content));\n data.dataTransfer.setData('text/plain', viewToPlainText(data.content));\n }\n if (data.method == 'cut') {\n editor.model.deleteContent(modelDocument.selection);\n }\n }, { priority: 'low' });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/utils/normalizeclipboarddata\n */\n/**\n * Removes some popular browser quirks out of the clipboard data (HTML).\n * Removes all HTML comments. These are considered an internal thing and it makes little sense if they leak into the editor data.\n *\n * @param data The HTML data to normalize.\n * @returns Normalized HTML.\n */\nexport default function normalizeClipboardData(data) {\n return data\n .replace(/<span(?: class=\"Apple-converted-space\"|)>(\\s+)<\\/span>/g, (fullMatch, spaces) => {\n // Handle the most popular and problematic case when even a single space becomes an nbsp;.\n // Decode those to normal spaces. Read more in https://github.com/ckeditor/ckeditor5-clipboard/issues/2.\n if (spaces.length == 1) {\n return ' ';\n }\n return spaces;\n })\n // Remove all HTML comments.\n .replace(/<!--[\\s\\S]*?-->/g, '');\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/utils/plaintexttohtml\n */\n/**\n * Converts plain text to its HTML-ized version.\n *\n * @param text The plain text to convert.\n * @returns HTML generated from the plain text.\n */\nexport default function plainTextToHtml(text) {\n text = text\n // Encode &.\n .replace(/&/g, '&')\n // Encode <>.\n .replace(/</g, '<')\n .replace(/>/g, '>')\n // Creates a paragraph for each double line break.\n .replace(/\\r?\\n\\r?\\n/g, '</p><p>')\n // Creates a line break for each single line break.\n .replace(/\\r?\\n/g, '<br>')\n // Replace tabs with four spaces.\n .replace(/\\t/g, ' ')\n // Preserve trailing spaces (only the first and last one – the rest is handled below).\n .replace(/^\\s/, ' ')\n .replace(/\\s$/, ' ')\n // Preserve other subsequent spaces now.\n .replace(/\\s\\s/g, ' ');\n if (text.includes('</p><p>') || text.includes('<br>')) {\n // If we created paragraphs above, add the trailing ones.\n text = `<p>${text}</p>`;\n }\n // TODO:\n // * What about '\\nfoo' vs ' foo'?\n return text;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/lineview\n */\n/* istanbul ignore file -- @preserve */\nimport { View } from '@ckeditor/ckeditor5-ui';\nimport { toUnit } from '@ckeditor/ckeditor5-utils';\nconst toPx = /* #__PURE__ */ toUnit('px');\n/**\n * The horizontal drop target line view.\n */\nexport default class LineView extends View {\n /**\n * @inheritDoc\n */\n constructor() {\n super();\n const bind = this.bindTemplate;\n this.set({\n isVisible: false,\n left: null,\n top: null,\n width: null\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-clipboard-drop-target-line',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ],\n style: {\n left: bind.to('left', left => toPx(left)),\n top: bind.to('top', top => toPx(top)),\n width: bind.to('width', width => toPx(width))\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/dragdroptarget\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { global, Rect, DomEmitterMixin, delay, ResizeObserver } from '@ckeditor/ckeditor5-utils';\nimport LineView from './lineview.js';\nimport { throttle } from 'lodash-es';\n/**\n * Part of the Drag and Drop handling. Responsible for finding and displaying the drop target.\n *\n * @internal\n */\nexport default class DragDropTarget extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A delayed callback removing the drop marker.\n *\n * @internal\n */\n this.removeDropMarkerDelayed = delay(() => this.removeDropMarker(), 40);\n /**\n * A throttled callback updating the drop marker.\n */\n this._updateDropMarkerThrottled = throttle(targetRange => this._updateDropMarker(targetRange), 40);\n /**\n * A throttled callback reconverting the drop parker.\n */\n this._reconvertMarkerThrottled = throttle(() => {\n if (this.editor.model.markers.has('drop-target')) {\n this.editor.editing.reconvertMarker('drop-target');\n }\n }, 0);\n /**\n * The horizontal drop target line view.\n */\n this._dropTargetLineView = new LineView();\n /**\n * DOM Emitter.\n */\n this._domEmitter = new (DomEmitterMixin())();\n /**\n * Map of document scrollable elements.\n */\n this._scrollables = new Map();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DragDropTarget';\n }\n /**\n * @inheritDoc\n */\n init() {\n this._setupDropMarker();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this._domEmitter.stopListening();\n for (const { resizeObserver } of this._scrollables.values()) {\n resizeObserver.destroy();\n }\n this._updateDropMarkerThrottled.cancel();\n this.removeDropMarkerDelayed.cancel();\n this._reconvertMarkerThrottled.cancel();\n return super.destroy();\n }\n /**\n * Finds the drop target range and updates the drop marker.\n *\n * @internal\n */\n updateDropMarker(targetViewElement, targetViewRanges, clientX, clientY, blockMode, draggedRange) {\n this.removeDropMarkerDelayed.cancel();\n const targetRange = findDropTargetRange(this.editor, targetViewElement, targetViewRanges, clientX, clientY, blockMode, draggedRange);\n /* istanbul ignore next -- @preserve */\n if (!targetRange) {\n return;\n }\n if (draggedRange && draggedRange.containsRange(targetRange)) {\n // Target range is inside the dragged range.\n return this.removeDropMarker();\n }\n this._updateDropMarkerThrottled(targetRange);\n }\n /**\n * Finds the final drop target range.\n *\n * @internal\n */\n getFinalDropRange(targetViewElement, targetViewRanges, clientX, clientY, blockMode, draggedRange) {\n const targetRange = findDropTargetRange(this.editor, targetViewElement, targetViewRanges, clientX, clientY, blockMode, draggedRange);\n // The dragging markers must be removed after searching for the target range because sometimes\n // the target lands on the marker itself.\n this.removeDropMarker();\n return targetRange;\n }\n /**\n * Removes the drop target marker.\n *\n * @internal\n */\n removeDropMarker() {\n const model = this.editor.model;\n this.removeDropMarkerDelayed.cancel();\n this._updateDropMarkerThrottled.cancel();\n this._dropTargetLineView.isVisible = false;\n if (model.markers.has('drop-target')) {\n model.change(writer => {\n writer.removeMarker('drop-target');\n });\n }\n }\n /**\n * Creates downcast conversion for the drop target marker.\n */\n _setupDropMarker() {\n const editor = this.editor;\n editor.ui.view.body.add(this._dropTargetLineView);\n // Drop marker conversion for hovering over widgets.\n editor.conversion.for('editingDowncast').markerToHighlight({\n model: 'drop-target',\n view: {\n classes: ['ck-clipboard-drop-target-range']\n }\n });\n // Drop marker conversion for in text and block drop target.\n editor.conversion.for('editingDowncast').markerToElement({\n model: 'drop-target',\n view: (data, { writer }) => {\n // Inline drop.\n if (editor.model.schema.checkChild(data.markerRange.start, '$text')) {\n this._dropTargetLineView.isVisible = false;\n return this._createDropTargetPosition(writer);\n }\n // Block drop.\n else {\n if (data.markerRange.isCollapsed) {\n this._updateDropTargetLine(data.markerRange);\n }\n else {\n this._dropTargetLineView.isVisible = false;\n }\n }\n }\n });\n }\n /**\n * Updates the drop target marker to the provided range.\n *\n * @param targetRange The range to set the marker to.\n */\n _updateDropMarker(targetRange) {\n const editor = this.editor;\n const markers = editor.model.markers;\n editor.model.change(writer => {\n if (markers.has('drop-target')) {\n if (!markers.get('drop-target').getRange().isEqual(targetRange)) {\n writer.updateMarker('drop-target', { range: targetRange });\n }\n }\n else {\n writer.addMarker('drop-target', {\n range: targetRange,\n usingOperation: false,\n affectsData: false\n });\n }\n });\n }\n /**\n * Creates the UI element for vertical (in-line) drop target.\n */\n _createDropTargetPosition(writer) {\n return writer.createUIElement('span', { class: 'ck ck-clipboard-drop-target-position' }, function (domDocument) {\n const domElement = this.toDomElement(domDocument);\n // Using word joiner to make this marker as high as text and also making text not break on marker.\n domElement.append('\\u2060', domDocument.createElement('span'), '\\u2060');\n return domElement;\n });\n }\n /**\n * Updates the horizontal drop target line.\n */\n _updateDropTargetLine(range) {\n const editing = this.editor.editing;\n const nodeBefore = range.start.nodeBefore;\n const nodeAfter = range.start.nodeAfter;\n const nodeParent = range.start.parent;\n const viewElementBefore = nodeBefore ? editing.mapper.toViewElement(nodeBefore) : null;\n const domElementBefore = viewElementBefore ? editing.view.domConverter.mapViewToDom(viewElementBefore) : null;\n const viewElementAfter = nodeAfter ? editing.mapper.toViewElement(nodeAfter) : null;\n const domElementAfter = viewElementAfter ? editing.view.domConverter.mapViewToDom(viewElementAfter) : null;\n const viewElementParent = editing.mapper.toViewElement(nodeParent);\n if (!viewElementParent) {\n return;\n }\n const domElementParent = editing.view.domConverter.mapViewToDom(viewElementParent);\n const domScrollableRect = this._getScrollableRect(viewElementParent);\n const { scrollX, scrollY } = global.window;\n const rectBefore = domElementBefore ? new Rect(domElementBefore) : null;\n const rectAfter = domElementAfter ? new Rect(domElementAfter) : null;\n const rectParent = new Rect(domElementParent).excludeScrollbarsAndBorders();\n const above = rectBefore ? rectBefore.bottom : rectParent.top;\n const below = rectAfter ? rectAfter.top : rectParent.bottom;\n const parentStyle = global.window.getComputedStyle(domElementParent);\n const top = (above <= below ? (above + below) / 2 : below);\n if (domScrollableRect.top < top && top < domScrollableRect.bottom) {\n const left = rectParent.left + parseFloat(parentStyle.paddingLeft);\n const right = rectParent.right - parseFloat(parentStyle.paddingRight);\n const leftClamped = Math.max(left + scrollX, domScrollableRect.left);\n const rightClamped = Math.min(right + scrollX, domScrollableRect.right);\n this._dropTargetLineView.set({\n isVisible: true,\n left: leftClamped,\n top: top + scrollY,\n width: rightClamped - leftClamped\n });\n }\n else {\n this._dropTargetLineView.isVisible = false;\n }\n }\n /**\n * Finds the closest scrollable element rect for the given view element.\n */\n _getScrollableRect(viewElement) {\n const rootName = viewElement.root.rootName;\n let domScrollable;\n if (this._scrollables.has(rootName)) {\n domScrollable = this._scrollables.get(rootName).domElement;\n }\n else {\n const domElement = this.editor.editing.view.domConverter.mapViewToDom(viewElement);\n domScrollable = findScrollableElement(domElement);\n this._domEmitter.listenTo(domScrollable, 'scroll', this._reconvertMarkerThrottled, { usePassive: true });\n const resizeObserver = new ResizeObserver(domScrollable, this._reconvertMarkerThrottled);\n this._scrollables.set(rootName, {\n domElement: domScrollable,\n resizeObserver\n });\n }\n return new Rect(domScrollable).excludeScrollbarsAndBorders();\n }\n}\n/**\n * Returns fixed selection range for given position and target element.\n */\nfunction findDropTargetRange(editor, targetViewElement, targetViewRanges, clientX, clientY, blockMode, draggedRange) {\n const model = editor.model;\n const mapper = editor.editing.mapper;\n const targetModelElement = getClosestMappedModelElement(editor, targetViewElement);\n let modelElement = targetModelElement;\n while (modelElement) {\n if (!blockMode) {\n if (model.schema.checkChild(modelElement, '$text')) {\n if (targetViewRanges) {\n const targetViewPosition = targetViewRanges[0].start;\n const targetModelPosition = mapper.toModelPosition(targetViewPosition);\n const canDropOnPosition = !draggedRange || Array\n .from(draggedRange.getItems())\n .every(item => model.schema.checkChild(targetModelPosition, item));\n if (canDropOnPosition) {\n if (model.schema.checkChild(targetModelPosition, '$text')) {\n return model.createRange(targetModelPosition);\n }\n else if (targetViewPosition) {\n // This is the case of dropping inside a span wrapper of an inline image.\n return findDropTargetRangeForElement(editor, getClosestMappedModelElement(editor, targetViewPosition.parent), clientX, clientY);\n }\n }\n }\n }\n else if (model.schema.isInline(modelElement)) {\n return findDropTargetRangeForElement(editor, modelElement, clientX, clientY);\n }\n }\n if (model.schema.isBlock(modelElement)) {\n return findDropTargetRangeForElement(editor, modelElement, clientX, clientY);\n }\n else if (model.schema.checkChild(modelElement, '$block')) {\n const childNodes = Array.from(modelElement.getChildren())\n .filter((node) => node.is('element') && !shouldIgnoreElement(editor, node));\n let startIndex = 0;\n let endIndex = childNodes.length;\n if (endIndex == 0) {\n return model.createRange(model.createPositionAt(modelElement, 'end'));\n }\n while (startIndex < endIndex - 1) {\n const middleIndex = Math.floor((startIndex + endIndex) / 2);\n const side = findElementSide(editor, childNodes[middleIndex], clientX, clientY);\n if (side == 'before') {\n endIndex = middleIndex;\n }\n else {\n startIndex = middleIndex;\n }\n }\n return findDropTargetRangeForElement(editor, childNodes[startIndex], clientX, clientY);\n }\n modelElement = modelElement.parent;\n }\n return null;\n}\n/**\n * Returns true for elements which should be ignored.\n */\nfunction shouldIgnoreElement(editor, modelElement) {\n const mapper = editor.editing.mapper;\n const domConverter = editor.editing.view.domConverter;\n const viewElement = mapper.toViewElement(modelElement);\n if (!viewElement) {\n return true;\n }\n const domElement = domConverter.mapViewToDom(viewElement);\n return global.window.getComputedStyle(domElement).float != 'none';\n}\n/**\n * Returns target range relative to the given element.\n */\nfunction findDropTargetRangeForElement(editor, modelElement, clientX, clientY) {\n const model = editor.model;\n return model.createRange(model.createPositionAt(modelElement, findElementSide(editor, modelElement, clientX, clientY)));\n}\n/**\n * Resolves whether drop marker should be before or after the given element.\n */\nfunction findElementSide(editor, modelElement, clientX, clientY) {\n const mapper = editor.editing.mapper;\n const domConverter = editor.editing.view.domConverter;\n const viewElement = mapper.toViewElement(modelElement);\n const domElement = domConverter.mapViewToDom(viewElement);\n const rect = new Rect(domElement);\n if (editor.model.schema.isInline(modelElement)) {\n return clientX < (rect.left + rect.right) / 2 ? 'before' : 'after';\n }\n else {\n return clientY < (rect.top + rect.bottom) / 2 ? 'before' : 'after';\n }\n}\n/**\n * Returns the closest model element for the specified view element.\n */\nfunction getClosestMappedModelElement(editor, element) {\n const mapper = editor.editing.mapper;\n const view = editor.editing.view;\n const targetModelElement = mapper.toModelElement(element);\n if (targetModelElement) {\n return targetModelElement;\n }\n // Find mapped ancestor if the target is inside not mapped element (for example inline code element).\n const viewPosition = view.createPositionBefore(element);\n const viewElement = mapper.findMappedViewAncestor(viewPosition);\n return mapper.toModelElement(viewElement);\n}\n/**\n * Returns the closest scrollable ancestor DOM element.\n *\n * It is assumed that `domNode` is attached to the document.\n */\nfunction findScrollableElement(domNode) {\n let domElement = domNode;\n do {\n domElement = domElement.parentElement;\n const overflow = global.window.getComputedStyle(domElement).overflowY;\n if (overflow == 'auto' || overflow == 'scroll') {\n break;\n }\n } while (domElement.tagName != 'BODY');\n return domElement;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/dragdropblocktoolbar\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { env, global, DomEmitterMixin } from '@ckeditor/ckeditor5-utils';\nimport ClipboardObserver from './clipboardobserver.js';\n/**\n * Integration of a block Drag and Drop support with the block toolbar.\n *\n * @internal\n */\nexport default class DragDropBlockToolbar extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * Whether current dragging is started by block toolbar button dragging.\n */\n this._isBlockDragging = false;\n /**\n * DOM Emitter.\n */\n this._domEmitter = new (DomEmitterMixin())();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DragDropBlockToolbar';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n this.listenTo(editor, 'change:isReadOnly', (evt, name, isReadOnly) => {\n if (isReadOnly) {\n this.forceDisabled('readOnlyMode');\n this._isBlockDragging = false;\n }\n else {\n this.clearForceDisabled('readOnlyMode');\n }\n });\n if (env.isAndroid) {\n this.forceDisabled('noAndroidSupport');\n }\n if (editor.plugins.has('BlockToolbar')) {\n const blockToolbar = editor.plugins.get('BlockToolbar');\n const element = blockToolbar.buttonView.element;\n this._domEmitter.listenTo(element, 'dragstart', (evt, data) => this._handleBlockDragStart(data));\n this._domEmitter.listenTo(global.document, 'dragover', (evt, data) => this._handleBlockDragging(data));\n this._domEmitter.listenTo(global.document, 'drop', (evt, data) => this._handleBlockDragging(data));\n this._domEmitter.listenTo(global.document, 'dragend', () => this._handleBlockDragEnd(), { useCapture: true });\n if (this.isEnabled) {\n element.setAttribute('draggable', 'true');\n }\n this.on('change:isEnabled', (evt, name, isEnabled) => {\n element.setAttribute('draggable', isEnabled ? 'true' : 'false');\n });\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this._domEmitter.stopListening();\n return super.destroy();\n }\n /**\n * The `dragstart` event handler.\n */\n _handleBlockDragStart(domEvent) {\n if (!this.isEnabled) {\n return;\n }\n const model = this.editor.model;\n const selection = model.document.selection;\n const view = this.editor.editing.view;\n const blocks = Array.from(selection.getSelectedBlocks());\n const draggedRange = model.createRange(model.createPositionBefore(blocks[0]), model.createPositionAfter(blocks[blocks.length - 1]));\n model.change(writer => writer.setSelection(draggedRange));\n this._isBlockDragging = true;\n view.focus();\n view.getObserver(ClipboardObserver).onDomEvent(domEvent);\n }\n /**\n * The `dragover` and `drop` event handler.\n */\n _handleBlockDragging(domEvent) {\n if (!this.isEnabled || !this._isBlockDragging) {\n return;\n }\n const clientX = domEvent.clientX + (this.editor.locale.contentLanguageDirection == 'ltr' ? 100 : -100);\n const clientY = domEvent.clientY;\n const target = document.elementFromPoint(clientX, clientY);\n const view = this.editor.editing.view;\n if (!target || !target.closest('.ck-editor__editable')) {\n return;\n }\n view.getObserver(ClipboardObserver).onDomEvent({\n ...domEvent,\n type: domEvent.type,\n dataTransfer: domEvent.dataTransfer,\n target,\n clientX,\n clientY,\n preventDefault: () => domEvent.preventDefault(),\n stopPropagation: () => domEvent.stopPropagation()\n });\n }\n /**\n * The `dragend` event handler.\n */\n _handleBlockDragEnd() {\n this._isBlockDragging = false;\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./clipboard.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./clipboard.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/dragdrop\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { LiveRange, MouseObserver } from '@ckeditor/ckeditor5-engine';\nimport { Widget, isWidget } from '@ckeditor/ckeditor5-widget';\nimport { env, uid, global, createElement, DomEmitterMixin, delay, Rect } from '@ckeditor/ckeditor5-utils';\nimport ClipboardPipeline from './clipboardpipeline.js';\nimport ClipboardObserver from './clipboardobserver.js';\nimport DragDropTarget from './dragdroptarget.js';\nimport DragDropBlockToolbar from './dragdropblocktoolbar.js';\nimport '../theme/clipboard.css';\n// Drag and drop events overview:\n//\n// ┌──────────────────â”\n// │ mousedown │ Sets the draggable attribute.\n// └─────────┬────────┘\n// │\n// └─────────────────────â”\n// │ │\n// │ ┌─────────V────────â”\n// │ │ mouseup │ Dragging did not start, removes the draggable attribute.\n// │ └──────────────────┘\n// │\n// ┌─────────V────────┠Retrieves the selected model.DocumentFragment\n// │ dragstart │ and converts it to view.DocumentFragment.\n// └─────────┬────────┘\n// │\n// ┌─────────V────────┠Processes view.DocumentFragment to text/html and text/plain\n// │ clipboardOutput │ and stores the results in data.dataTransfer.\n// └─────────┬────────┘\n// │\n// │ DOM dragover\n// ┌────────────â”\n// │ │\n// ┌─────────V────────┠│\n// │ dragging │ │ Updates the drop target marker.\n// └─────────┬────────┘ │\n// │ │\n// ┌─────────────└────────────┘\n// │ │ │\n// │ ┌─────────V────────┠│\n// │ │ dragleave │ │ Removes the drop target marker.\n// │ └─────────┬────────┘ │\n// │ │ │\n// ┌───│─────────────┘ │\n// │ │ │ │\n// │ │ ┌─────────V────────┠│\n// │ │ │ dragenter │ │ Focuses the editor view.\n// │ │ └─────────┬────────┘ │\n// │ │ │ │\n// │ │ └────────────┘\n// │ │\n// │ └─────────────â”\n// │ │ │\n// │ │ ┌─────────V────────â”\n// └───┠│ drop │ (The default handler of the clipboard pipeline).\n// │ └─────────┬────────┘\n// │ │\n// │ ┌─────────V────────┠Resolves the final data.targetRanges.\n// │ │ clipboardInput │ Aborts if dropping on dragged content.\n// │ └─────────┬────────┘\n// │ │\n// │ ┌─────────V────────â”\n// │ │ clipboardInput │ (The default handler of the clipboard pipeline).\n// │ └─────────┬────────┘\n// │ │\n// │ ┌───────────V───────────â”\n// │ │ inputTransformation │ (The default handler of the clipboard pipeline).\n// │ └───────────┬───────────┘\n// │ │\n// │ ┌──────────V──────────â”\n// │ │ contentInsertion │ Updates the document selection to drop range.\n// │ └──────────┬──────────┘\n// │ │\n// │ ┌──────────V──────────â”\n// │ │ contentInsertion │ (The default handler of the clipboard pipeline).\n// │ └──────────┬──────────┘\n// │ │\n// │ ┌──────────V──────────â”\n// │ │ contentInsertion │ Removes the content from the original range if the insertion was successful.\n// │ └──────────┬──────────┘\n// │ │\n// └─────────────â”\n// │\n// ┌─────────V────────â”\n// │ dragend │ Removes the drop marker and cleans the state.\n// └──────────────────┘\n//\n/**\n * The drag and drop feature. It works on top of the {@link module:clipboard/clipboardpipeline~ClipboardPipeline}.\n *\n * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.\n *\n * @internal\n */\nexport default class DragDrop extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A delayed callback removing draggable attributes.\n */\n this._clearDraggableAttributesDelayed = delay(() => this._clearDraggableAttributes(), 40);\n /**\n * Whether the dragged content can be dropped only in block context.\n */\n // TODO handle drag from other editor instance\n // TODO configure to use block, inline or both\n this._blockMode = false;\n /**\n * DOM Emitter.\n */\n this._domEmitter = new (DomEmitterMixin())();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DragDrop';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardPipeline, Widget, DragDropTarget, DragDropBlockToolbar];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n this._draggedRange = null;\n this._draggingUid = '';\n this._draggableElement = null;\n view.addObserver(ClipboardObserver);\n view.addObserver(MouseObserver);\n this._setupDragging();\n this._setupContentInsertionIntegration();\n this._setupClipboardInputIntegration();\n this._setupDraggableAttributeHandling();\n this.listenTo(editor, 'change:isReadOnly', (evt, name, isReadOnly) => {\n if (isReadOnly) {\n this.forceDisabled('readOnlyMode');\n }\n else {\n this.clearForceDisabled('readOnlyMode');\n }\n });\n this.on('change:isEnabled', (evt, name, isEnabled) => {\n if (!isEnabled) {\n this._finalizeDragging(false);\n }\n });\n if (env.isAndroid) {\n this.forceDisabled('noAndroidSupport');\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._draggedRange) {\n this._draggedRange.detach();\n this._draggedRange = null;\n }\n if (this._previewContainer) {\n this._previewContainer.remove();\n }\n this._domEmitter.stopListening();\n this._clearDraggableAttributesDelayed.cancel();\n return super.destroy();\n }\n /**\n * Drag and drop events handling.\n */\n _setupDragging() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const dragDropTarget = editor.plugins.get(DragDropTarget);\n // The handler for the drag start; it is responsible for setting data transfer object.\n this.listenTo(viewDocument, 'dragstart', (evt, data) => {\n // Don't drag the editable element itself.\n if (data.target && data.target.is('editableElement')) {\n data.preventDefault();\n return;\n }\n this._prepareDraggedRange(data.target);\n if (!this._draggedRange) {\n data.preventDefault();\n return;\n }\n this._draggingUid = uid();\n data.dataTransfer.effectAllowed = this.isEnabled ? 'copyMove' : 'copy';\n data.dataTransfer.setData('application/ckeditor5-dragging-uid', this._draggingUid);\n const draggedSelection = model.createSelection(this._draggedRange.toRange());\n const clipboardPipeline = this.editor.plugins.get('ClipboardPipeline');\n clipboardPipeline._fireOutputTransformationEvent(data.dataTransfer, draggedSelection, 'dragstart');\n const { dataTransfer, domTarget, domEvent } = data;\n const { clientX } = domEvent;\n this._updatePreview({ dataTransfer, domTarget, clientX });\n data.stopPropagation();\n if (!this.isEnabled) {\n this._draggedRange.detach();\n this._draggedRange = null;\n this._draggingUid = '';\n }\n }, { priority: 'low' });\n // The handler for finalizing drag and drop. It should always be triggered after dragging completes\n // even if it was completed in a different application.\n // Note: This is not fired if source text node got removed while downcasting a marker.\n this.listenTo(viewDocument, 'dragend', (evt, data) => {\n this._finalizeDragging(!data.dataTransfer.isCanceled && data.dataTransfer.dropEffect == 'move');\n }, { priority: 'low' });\n // Reset block dragging mode even if dropped outside the editable.\n this._domEmitter.listenTo(global.document, 'dragend', () => {\n this._blockMode = false;\n }, { useCapture: true });\n // Dragging over the editable.\n this.listenTo(viewDocument, 'dragenter', () => {\n if (!this.isEnabled) {\n return;\n }\n view.focus();\n });\n // Dragging out of the editable.\n this.listenTo(viewDocument, 'dragleave', () => {\n // We do not know if the mouse left the editor or just some element in it, so let us wait a few milliseconds\n // to check if 'dragover' is not fired.\n dragDropTarget.removeDropMarkerDelayed();\n });\n // Handler for moving dragged content over the target area.\n this.listenTo(viewDocument, 'dragging', (evt, data) => {\n if (!this.isEnabled) {\n data.dataTransfer.dropEffect = 'none';\n return;\n }\n const { clientX, clientY } = data.domEvent;\n dragDropTarget.updateDropMarker(data.target, data.targetRanges, clientX, clientY, this._blockMode, this._draggedRange);\n // If this is content being dragged from another editor, moving out of current editor instance\n // is not possible until 'dragend' event case will be fixed.\n if (!this._draggedRange) {\n data.dataTransfer.dropEffect = 'copy';\n }\n // In Firefox it is already set and effect allowed remains the same as originally set.\n if (!env.isGecko) {\n if (data.dataTransfer.effectAllowed == 'copy') {\n data.dataTransfer.dropEffect = 'copy';\n }\n else if (['all', 'copyMove'].includes(data.dataTransfer.effectAllowed)) {\n data.dataTransfer.dropEffect = 'move';\n }\n }\n evt.stop();\n }, { priority: 'low' });\n }\n /**\n * Integration with the `clipboardInput` event.\n */\n _setupClipboardInputIntegration() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const dragDropTarget = editor.plugins.get(DragDropTarget);\n // Update the event target ranges and abort dropping if dropping over itself.\n this.listenTo(viewDocument, 'clipboardInput', (evt, data) => {\n if (data.method != 'drop') {\n return;\n }\n const { clientX, clientY } = data.domEvent;\n const targetRange = dragDropTarget.getFinalDropRange(data.target, data.targetRanges, clientX, clientY, this._blockMode, this._draggedRange);\n if (!targetRange) {\n this._finalizeDragging(false);\n evt.stop();\n return;\n }\n // Since we cannot rely on the drag end event, we must check if the local drag range is from the current drag and drop\n // or it is from some previous not cleared one.\n if (this._draggedRange && this._draggingUid != data.dataTransfer.getData('application/ckeditor5-dragging-uid')) {\n this._draggedRange.detach();\n this._draggedRange = null;\n this._draggingUid = '';\n }\n // Do not do anything if some content was dragged within the same document to the same position.\n const isMove = getFinalDropEffect(data.dataTransfer) == 'move';\n if (isMove && this._draggedRange && this._draggedRange.containsRange(targetRange, true)) {\n this._finalizeDragging(false);\n evt.stop();\n return;\n }\n // Override the target ranges with the one adjusted to the best one for a drop.\n data.targetRanges = [editor.editing.mapper.toViewRange(targetRange)];\n }, { priority: 'high' });\n }\n /**\n * Integration with the `contentInsertion` event of the clipboard pipeline.\n */\n _setupContentInsertionIntegration() {\n const clipboardPipeline = this.editor.plugins.get(ClipboardPipeline);\n clipboardPipeline.on('contentInsertion', (evt, data) => {\n if (!this.isEnabled || data.method !== 'drop') {\n return;\n }\n // Update the selection to the target range in the same change block to avoid selection post-fixing\n // and to be able to clone text attributes for plain text dropping.\n const ranges = data.targetRanges.map(viewRange => this.editor.editing.mapper.toModelRange(viewRange));\n this.editor.model.change(writer => writer.setSelection(ranges));\n }, { priority: 'high' });\n clipboardPipeline.on('contentInsertion', (evt, data) => {\n if (!this.isEnabled || data.method !== 'drop') {\n return;\n }\n // Remove dragged range content, remove markers, clean after dragging.\n const isMove = getFinalDropEffect(data.dataTransfer) == 'move';\n // Whether any content was inserted (insertion might fail if the schema is disallowing some elements\n // (for example an image caption allows only the content of a block but not blocks themselves.\n // Some integrations might not return valid range (i.e., table pasting).\n const isSuccess = !data.resultRange || !data.resultRange.isCollapsed;\n this._finalizeDragging(isSuccess && isMove);\n }, { priority: 'lowest' });\n }\n /**\n * Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start.\n */\n _setupDraggableAttributeHandling() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Add the 'draggable' attribute to the widget while pressing the selection handle.\n // This is required for widgets to be draggable. In Chrome it will enable dragging text nodes.\n this.listenTo(viewDocument, 'mousedown', (evt, data) => {\n // The lack of data can be caused by editor tests firing fake mouse events. This should not occur\n // in real-life scenarios but this greatly simplifies editor tests that would otherwise fail a lot.\n if (env.isAndroid || !data) {\n return;\n }\n this._clearDraggableAttributesDelayed.cancel();\n // Check if this is a mousedown over the widget (but not a nested editable).\n let draggableElement = findDraggableWidget(data.target);\n // Note: There is a limitation that if more than a widget is selected (a widget and some text)\n // and dragging starts on the widget, then only the widget is dragged.\n // If this was not a widget then we should check if we need to drag some text content.\n // In Chrome set a 'draggable' attribute on closest editable to allow immediate dragging of the selected text range.\n // In Firefox this is not needed. In Safari it makes the whole editable draggable (not just textual content).\n // Disabled in read-only mode because draggable=\"true\" + contenteditable=\"false\" results\n // in not firing selectionchange event ever, which makes the selection stuck in read-only mode.\n if (env.isBlink && !editor.isReadOnly && !draggableElement && !viewDocument.selection.isCollapsed) {\n const selectedElement = viewDocument.selection.getSelectedElement();\n if (!selectedElement || !isWidget(selectedElement)) {\n draggableElement = viewDocument.selection.editableElement;\n }\n }\n if (draggableElement) {\n view.change(writer => {\n writer.setAttribute('draggable', 'true', draggableElement);\n });\n // Keep the reference to the model element in case the view element gets removed while dragging.\n this._draggableElement = editor.editing.mapper.toModelElement(draggableElement);\n }\n });\n // Remove the draggable attribute in case no dragging started (only mousedown + mouseup).\n this.listenTo(viewDocument, 'mouseup', () => {\n if (!env.isAndroid) {\n this._clearDraggableAttributesDelayed();\n }\n });\n }\n /**\n * Removes the `draggable` attribute from the element that was used for dragging.\n */\n _clearDraggableAttributes() {\n const editing = this.editor.editing;\n editing.view.change(writer => {\n // Remove 'draggable' attribute.\n if (this._draggableElement && this._draggableElement.root.rootName != '$graveyard') {\n writer.removeAttribute('draggable', editing.mapper.toViewElement(this._draggableElement));\n }\n this._draggableElement = null;\n });\n }\n /**\n * Deletes the dragged content from its original range and clears the dragging state.\n *\n * @param moved Whether the move succeeded.\n */\n _finalizeDragging(moved) {\n const editor = this.editor;\n const model = editor.model;\n const dragDropTarget = editor.plugins.get(DragDropTarget);\n dragDropTarget.removeDropMarker();\n this._clearDraggableAttributes();\n if (editor.plugins.has('WidgetToolbarRepository')) {\n const widgetToolbarRepository = editor.plugins.get('WidgetToolbarRepository');\n widgetToolbarRepository.clearForceDisabled('dragDrop');\n }\n this._draggingUid = '';\n if (this._previewContainer) {\n this._previewContainer.remove();\n this._previewContainer = undefined;\n }\n if (!this._draggedRange) {\n return;\n }\n // Delete moved content.\n if (moved && this.isEnabled) {\n model.change(writer => {\n const selection = model.createSelection(this._draggedRange);\n model.deleteContent(selection, { doNotAutoparagraph: true });\n // Check result selection if it does not require auto-paragraphing of empty container.\n const selectionParent = selection.getFirstPosition().parent;\n if (selectionParent.isEmpty &&\n !model.schema.checkChild(selectionParent, '$text') &&\n model.schema.checkChild(selectionParent, 'paragraph')) {\n writer.insertElement('paragraph', selectionParent, 0);\n }\n });\n }\n this._draggedRange.detach();\n this._draggedRange = null;\n }\n /**\n * Sets the dragged source range based on event target and document selection.\n */\n _prepareDraggedRange(target) {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n // Check if this is dragstart over the widget (but not a nested editable).\n const draggableWidget = target ? findDraggableWidget(target) : null;\n if (draggableWidget) {\n const modelElement = editor.editing.mapper.toModelElement(draggableWidget);\n this._draggedRange = LiveRange.fromRange(model.createRangeOn(modelElement));\n this._blockMode = model.schema.isBlock(modelElement);\n // Disable toolbars so they won't obscure the drop area.\n if (editor.plugins.has('WidgetToolbarRepository')) {\n const widgetToolbarRepository = editor.plugins.get('WidgetToolbarRepository');\n widgetToolbarRepository.forceDisabled('dragDrop');\n }\n return;\n }\n // If this was not a widget we should check if we need to drag some text content.\n if (selection.isCollapsed && !selection.getFirstPosition().parent.isEmpty) {\n return;\n }\n const blocks = Array.from(selection.getSelectedBlocks());\n const draggedRange = selection.getFirstRange();\n if (blocks.length == 0) {\n this._draggedRange = LiveRange.fromRange(draggedRange);\n return;\n }\n const blockRange = getRangeIncludingFullySelectedParents(model, blocks);\n if (blocks.length > 1) {\n this._draggedRange = LiveRange.fromRange(blockRange);\n this._blockMode = true;\n // TODO block mode for dragging from outside editor? or inline? or both?\n }\n else if (blocks.length == 1) {\n const touchesBlockEdges = draggedRange.start.isTouching(blockRange.start) &&\n draggedRange.end.isTouching(blockRange.end);\n this._draggedRange = LiveRange.fromRange(touchesBlockEdges ? blockRange : draggedRange);\n this._blockMode = touchesBlockEdges;\n }\n model.change(writer => writer.setSelection(this._draggedRange.toRange()));\n }\n /**\n * Updates the dragged preview image.\n */\n _updatePreview({ dataTransfer, domTarget, clientX }) {\n const view = this.editor.editing.view;\n const editable = view.document.selection.editableElement;\n const domEditable = view.domConverter.mapViewToDom(editable);\n const computedStyle = global.window.getComputedStyle(domEditable);\n if (!this._previewContainer) {\n this._previewContainer = createElement(global.document, 'div', {\n style: 'position: fixed; left: -999999px;'\n });\n global.document.body.appendChild(this._previewContainer);\n }\n else if (this._previewContainer.firstElementChild) {\n this._previewContainer.removeChild(this._previewContainer.firstElementChild);\n }\n const domRect = new Rect(domEditable);\n // If domTarget is inside the editable root, browsers will display the preview correctly by themselves.\n if (domEditable.contains(domTarget)) {\n return;\n }\n const domEditablePaddingLeft = parseFloat(computedStyle.paddingLeft);\n const preview = createElement(global.document, 'div');\n preview.className = 'ck ck-content';\n preview.style.width = computedStyle.width;\n preview.style.paddingLeft = `${domRect.left - clientX + domEditablePaddingLeft}px`;\n /**\n * Set white background in drag and drop preview if iOS.\n * Check: https://github.com/ckeditor/ckeditor5/issues/15085\n */\n if (env.isiOS) {\n preview.style.backgroundColor = 'white';\n }\n preview.innerHTML = dataTransfer.getData('text/html');\n dataTransfer.setDragImage(preview, 0, 0);\n this._previewContainer.appendChild(preview);\n }\n}\n/**\n * Returns the drop effect that should be a result of dragging the content.\n * This function is handling a quirk when checking the effect in the 'drop' DOM event.\n */\nfunction getFinalDropEffect(dataTransfer) {\n if (env.isGecko) {\n return dataTransfer.dropEffect;\n }\n return ['all', 'copyMove'].includes(dataTransfer.effectAllowed) ? 'move' : 'copy';\n}\n/**\n * Returns a widget element that should be dragged.\n */\nfunction findDraggableWidget(target) {\n // This is directly an editable so not a widget for sure.\n if (target.is('editableElement')) {\n return null;\n }\n // TODO: Let's have a isWidgetSelectionHandleDomElement() helper in ckeditor5-widget utils.\n if (target.hasClass('ck-widget__selection-handle')) {\n return target.findAncestor(isWidget);\n }\n // Direct hit on a widget.\n if (isWidget(target)) {\n return target;\n }\n // Find closest ancestor that is either a widget or an editable element...\n const ancestor = target.findAncestor(node => isWidget(node) || node.is('editableElement'));\n // ...and if closer was the widget then enable dragging it.\n if (isWidget(ancestor)) {\n return ancestor;\n }\n return null;\n}\n/**\n * Recursively checks if common parent of provided elements doesn't have any other children. If that's the case,\n * it returns range including this parent. Otherwise, it returns only the range from first to last element.\n *\n * Example:\n *\n * <blockQuote>\n * <paragraph>[Test 1</paragraph>\n * <paragraph>Test 2</paragraph>\n * <paragraph>Test 3]</paragraph>\n * <blockQuote>\n *\n * Because all elements inside the `blockQuote` are selected, the range is extended to include the `blockQuote` too.\n * If only first and second paragraphs would be selected, the range would not include it.\n */\nfunction getRangeIncludingFullySelectedParents(model, elements) {\n const firstElement = elements[0];\n const lastElement = elements[elements.length - 1];\n const parent = firstElement.getCommonAncestor(lastElement);\n const startPosition = model.createPositionBefore(firstElement);\n const endPosition = model.createPositionAfter(lastElement);\n if (parent &&\n parent.is('element') &&\n !model.schema.isLimit(parent)) {\n const parentRange = model.createRangeOn(parent);\n const touchesStart = startPosition.isTouching(parentRange.start);\n const touchesEnd = endPosition.isTouching(parentRange.end);\n if (touchesStart && touchesEnd) {\n // Selection includes all elements in the parent.\n return getRangeIncludingFullySelectedParents(model, [parent]);\n }\n }\n return model.createRange(startPosition, endPosition);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/pasteplaintext\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport ClipboardObserver from './clipboardobserver.js';\nimport ClipboardPipeline from './clipboardpipeline.js';\n/**\n * The plugin detects the user's intention to paste plain text.\n *\n * For example, it detects the <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke.\n */\nexport default class PastePlainText extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PastePlainText';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const selection = model.document.selection;\n view.addObserver(ClipboardObserver);\n editor.plugins.get(ClipboardPipeline).on('contentInsertion', (evt, data) => {\n if (!isUnformattedInlineContent(data.content, model)) {\n return;\n }\n model.change(writer => {\n // Formatting attributes should be preserved.\n const textAttributes = Array.from(selection.getAttributes())\n .filter(([key]) => model.schema.getAttributeProperties(key).isFormatting);\n if (!selection.isCollapsed) {\n model.deleteContent(selection, { doNotAutoparagraph: true });\n }\n // Also preserve other attributes if they survived the content deletion (because they were not fully selected).\n // For example linkHref is not a formatting attribute but it should be preserved if pasted text was in the middle\n // of a link.\n textAttributes.push(...selection.getAttributes());\n const range = writer.createRangeIn(data.content);\n for (const item of range.getItems()) {\n for (const attribute of textAttributes) {\n if (model.schema.checkAttribute(item, attribute[0])) {\n writer.setAttribute(attribute[0], attribute[1], item);\n }\n }\n }\n });\n });\n }\n}\n/**\n * Returns true if specified `documentFragment` represents the unformatted inline content.\n */\nfunction isUnformattedInlineContent(documentFragment, model) {\n let range = model.createRangeIn(documentFragment);\n // We consider three scenarios here. The document fragment may include:\n //\n // 1. Only text and inline objects. Then it could be unformatted inline content.\n // 2. Exactly one block element on top-level, eg. <p>Foobar</p> or <h2>Title</h2>.\n // In this case, check this element content, it could be treated as unformatted inline content.\n // 3. More block elements or block objects, then it is not unformatted inline content.\n //\n // We will check for scenario 2. specifically, and if it happens, we will unwrap it and follow with the regular algorithm.\n //\n if (documentFragment.childCount == 1) {\n const child = documentFragment.getChild(0);\n if (child.is('element') && model.schema.isBlock(child) && !model.schema.isObject(child) && !model.schema.isLimit(child)) {\n // Scenario 2. as described above.\n range = model.createRangeIn(child);\n }\n }\n for (const child of range.getItems()) {\n if (!model.schema.isInline(child)) {\n return false;\n }\n const attributeKeys = Array.from(child.getAttributeKeys());\n if (attributeKeys.find(key => model.schema.getAttributeProperties(key).isFormatting)) {\n return false;\n }\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboard\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport ClipboardPipeline from './clipboardpipeline.js';\nimport DragDrop from './dragdrop.js';\nimport PastePlainText from './pasteplaintext.js';\nimport ClipboardMarkersUtils from './clipboardmarkersutils.js';\n/**\n * The clipboard feature.\n *\n * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n * * {@link module:clipboard/clipboardpipeline~ClipboardPipeline}\n * * {@link module:clipboard/dragdrop~DragDrop}\n * * {@link module:clipboard/pasteplaintext~PastePlainText}\n */\nexport default class Clipboard extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Clipboard';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardMarkersUtils, ClipboardPipeline, DragDrop, PastePlainText];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = this.editor.t;\n // Add the information about the keystrokes to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Copy selected content'),\n keystroke: 'CTRL+C'\n },\n {\n label: t('Paste content'),\n keystroke: 'CTRL+V'\n },\n {\n label: t('Paste content as plain text'),\n keystroke: 'CTRL+SHIFT+V'\n }\n ]\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/basecommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { transformSets, NoOperation } from '@ckeditor/ckeditor5-engine';\n/**\n * Base class for the undo feature commands: {@link module:undo/undocommand~UndoCommand} and {@link module:undo/redocommand~RedoCommand}.\n */\nexport default class BaseCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * Stack of items stored by the command. These are pairs of:\n *\n * * {@link module:engine/model/batch~Batch batch} saved by the command,\n * * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.\n */\n this._stack = [];\n /**\n * Stores all batches that were created by this command.\n *\n * @internal\n */\n this._createdBatches = new WeakSet();\n // Refresh state, so the command is inactive right after initialization.\n this.refresh();\n // This command should not depend on selection change.\n this._isEnabledBasedOnSelection = false;\n // Set the transparent batch for the `editor.data.set()` call if the\n // batch type is not set already.\n this.listenTo(editor.data, 'set', (evt, data) => {\n // Create a shallow copy of the options to not change the original args.\n // And make sure that an object is assigned to data[ 1 ].\n data[1] = { ...data[1] };\n const options = data[1];\n // If batch type is not set, default to non-undoable batch.\n if (!options.batchType) {\n options.batchType = { isUndoable: false };\n }\n }, { priority: 'high' });\n // Clear the stack for the `transparent` batches.\n this.listenTo(editor.data, 'set', (evt, data) => {\n // We can assume that the object exists and it has a `batchType` property.\n // It was ensured with a higher priority listener before.\n const options = data[1];\n if (!options.batchType.isUndoable) {\n this.clearStack();\n }\n });\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._stack.length > 0;\n }\n /**\n * Returns all batches created by this command.\n */\n get createdBatches() {\n return this._createdBatches;\n }\n /**\n * Stores a batch in the command, together with the selection state of the {@link module:engine/model/document~Document document}\n * created by the editor which this command is registered to.\n *\n * @param batch The batch to add.\n */\n addBatch(batch) {\n const docSelection = this.editor.model.document.selection;\n const selection = {\n ranges: docSelection.hasOwnRange ? Array.from(docSelection.getRanges()) : [],\n isBackward: docSelection.isBackward\n };\n this._stack.push({ batch, selection });\n this.refresh();\n }\n /**\n * Removes all items from the stack.\n */\n clearStack() {\n this._stack = [];\n this.refresh();\n }\n /**\n * Restores the {@link module:engine/model/document~Document#selection document selection} state after a batch was undone.\n *\n * @param ranges Ranges to be restored.\n * @param isBackward A flag describing whether the restored range was selected forward or backward.\n * @param operations Operations which has been applied since selection has been stored.\n */\n _restoreSelection(ranges, isBackward, operations) {\n const model = this.editor.model;\n const document = model.document;\n // This will keep the transformed selection ranges.\n const selectionRanges = [];\n // Transform all ranges from the restored selection.\n const transformedRangeGroups = ranges.map(range => range.getTransformedByOperations(operations));\n const allRanges = transformedRangeGroups.flat();\n for (const rangeGroup of transformedRangeGroups) {\n // While transforming there could appear ranges that are contained by other ranges, we shall ignore them.\n const transformed = rangeGroup\n .filter(range => range.root != document.graveyard)\n .filter(range => !isRangeContainedByAnyOtherRange(range, allRanges));\n // All the transformed ranges ended up in graveyard.\n if (!transformed.length) {\n continue;\n }\n // After the range got transformed, we have an array of ranges. Some of those\n // ranges may be \"touching\" -- they can be next to each other and could be merged.\n normalizeRanges(transformed);\n // For each `range` from `ranges`, we take only one transformed range.\n // This is because we want to prevent situation where single-range selection\n // got transformed to multi-range selection.\n selectionRanges.push(transformed[0]);\n }\n // @if CK_DEBUG_ENGINE // console.log( `Restored selection by undo: ${ selectionRanges.join( ', ' ) }` );\n // `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.\n if (selectionRanges.length) {\n model.change(writer => {\n writer.setSelection(selectionRanges, { backward: isBackward });\n });\n }\n }\n /**\n * Undoes a batch by reversing that batch, transforming reversed batch and finally applying it.\n * This is a helper method for {@link #execute}.\n *\n * @param batchToUndo The batch to be undone.\n * @param undoingBatch The batch that will contain undoing changes.\n */\n _undo(batchToUndo, undoingBatch) {\n const model = this.editor.model;\n const document = model.document;\n // All changes done by the command execution will be saved as one batch.\n this._createdBatches.add(undoingBatch);\n const operationsToUndo = batchToUndo.operations.slice().filter(operation => operation.isDocumentOperation);\n operationsToUndo.reverse();\n // We will process each operation from `batchToUndo`, in reverse order. If there were operations A, B and C in undone batch,\n // we need to revert them in reverse order, so first C' (reversed C), then B', then A'.\n for (const operationToUndo of operationsToUndo) {\n const nextBaseVersion = operationToUndo.baseVersion + 1;\n const historyOperations = Array.from(document.history.getOperations(nextBaseVersion));\n const transformedSets = transformSets([operationToUndo.getReversed()], historyOperations, {\n useRelations: true,\n document: this.editor.model.document,\n padWithNoOps: false,\n forceWeakRemove: true\n });\n const reversedOperations = transformedSets.operationsA;\n // After reversed operation has been transformed by all history operations, apply it.\n for (let operation of reversedOperations) {\n // Do not apply any operation on non-editable space.\n const affectedSelectable = operation.affectedSelectable;\n if (affectedSelectable && !model.canEditAt(affectedSelectable)) {\n operation = new NoOperation(operation.baseVersion);\n }\n // Before applying, add the operation to the `undoingBatch`.\n undoingBatch.addOperation(operation);\n model.applyOperation(operation);\n document.history.setOperationAsUndone(operationToUndo, operation);\n }\n }\n }\n}\n/**\n * Normalizes list of ranges by joining intersecting or \"touching\" ranges.\n *\n * @param ranges Ranges to be normalized.\n */\nfunction normalizeRanges(ranges) {\n ranges.sort((a, b) => a.start.isBefore(b.start) ? -1 : 1);\n for (let i = 1; i < ranges.length; i++) {\n const previousRange = ranges[i - 1];\n const joinedRange = previousRange.getJoined(ranges[i], true);\n if (joinedRange) {\n // Replace the ranges on the list with the new joined range.\n i--;\n ranges.splice(i, 2, joinedRange);\n }\n }\n}\nfunction isRangeContainedByAnyOtherRange(range, ranges) {\n return ranges.some(otherRange => otherRange !== range && otherRange.containsRange(range, true));\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/undocommand\n */\nimport BaseCommand from './basecommand.js';\n/**\n * The undo command stores {@link module:engine/model/batch~Batch batches} applied to the\n * {@link module:engine/model/document~Document document} and is able to undo a batch by reversing it and transforming by\n * batches from {@link module:engine/model/document~Document#history history} that happened after the reversed batch.\n *\n * The undo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.\n */\nexport default class UndoCommand extends BaseCommand {\n /**\n * Executes the command. This method reverts a {@link module:engine/model/batch~Batch batch} added to the command's stack, transforms\n * and applies the reverted version on the {@link module:engine/model/document~Document document} and removes the batch from the stack.\n * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.\n *\n * @fires execute\n * @fires revert\n * @param batch A batch that should be undone. If not set, the last added batch will be undone.\n */\n execute(batch = null) {\n // If batch is not given, set `batchIndex` to the last index in command stack.\n const batchIndex = batch ? this._stack.findIndex(a => a.batch == batch) : this._stack.length - 1;\n const item = this._stack.splice(batchIndex, 1)[0];\n const undoingBatch = this.editor.model.createBatch({ isUndo: true });\n // All changes have to be done in one `enqueueChange` callback so other listeners will not\n // step between consecutive operations, or won't do changes to the document before selection is properly restored.\n this.editor.model.enqueueChange(undoingBatch, () => {\n this._undo(item.batch, undoingBatch);\n const operations = this.editor.model.document.history.getOperations(item.batch.baseVersion);\n this._restoreSelection(item.selection.ranges, item.selection.isBackward, operations);\n });\n // Firing `revert` event after the change block to make sure that it includes all changes from post-fixers\n // and make sure that the selection is \"stabilized\" (the selection range is saved after undo is executed and then\n // restored on redo, so it is important that the selection range is saved after post-fixers are done).\n this.fire('revert', item.batch, undoingBatch);\n this.refresh();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/redocommand\n */\nimport BaseCommand from './basecommand.js';\n/**\n * The redo command stores {@link module:engine/model/batch~Batch batches} that were used to undo a batch by\n * {@link module:undo/undocommand~UndoCommand}. It is able to redo a previously undone batch by reversing the undoing\n * batches created by `UndoCommand`. The reversed batch is transformed by all the batches from\n * {@link module:engine/model/document~Document#history history} that happened after the reversed undo batch.\n *\n * The redo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.\n */\nexport default class RedoCommand extends BaseCommand {\n /**\n * Executes the command. This method reverts the last {@link module:engine/model/batch~Batch batch} added to\n * the command's stack, applies the reverted and transformed version on the\n * {@link module:engine/model/document~Document document} and removes the batch from the stack.\n * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.\n *\n * @fires execute\n */\n execute() {\n const item = this._stack.pop();\n const redoingBatch = this.editor.model.createBatch({ isUndo: true });\n // All changes have to be done in one `enqueueChange` callback so other listeners will not step between consecutive\n // operations, or won't do changes to the document before selection is properly restored.\n this.editor.model.enqueueChange(redoingBatch, () => {\n const lastOperation = item.batch.operations[item.batch.operations.length - 1];\n const nextBaseVersion = lastOperation.baseVersion + 1;\n const operations = this.editor.model.document.history.getOperations(nextBaseVersion);\n this._restoreSelection(item.selection.ranges, item.selection.isBackward, operations);\n this._undo(item.batch, redoingBatch);\n });\n this.refresh();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/undoediting\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport UndoCommand from './undocommand.js';\nimport RedoCommand from './redocommand.js';\n/**\n * The undo engine feature.\n *\n * It introduces the `'undo'` and `'redo'` commands to the editor.\n */\nexport default class UndoEditing extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * Keeps track of which batches were registered in undo.\n */\n this._batchRegistry = new WeakSet();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'UndoEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Create commands.\n this._undoCommand = new UndoCommand(editor);\n this._redoCommand = new RedoCommand(editor);\n // Register command to the editor.\n editor.commands.add('undo', this._undoCommand);\n editor.commands.add('redo', this._redoCommand);\n this.listenTo(editor.model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n // Do not register batch if the operation is not a document operation.\n // This prevents from creating empty undo steps, where all operations where non-document operations.\n // Non-document operations creates and alters content in detached tree fragments (for example, document fragments).\n // Most of time this is preparing data before it is inserted into actual tree (for example during copy & paste).\n // Such operations should not be reversed.\n if (!operation.isDocumentOperation) {\n return;\n }\n const batch = operation.batch;\n const isRedoBatch = this._redoCommand.createdBatches.has(batch);\n const isUndoBatch = this._undoCommand.createdBatches.has(batch);\n const wasProcessed = this._batchRegistry.has(batch);\n // Skip the batch if it was already processed.\n if (wasProcessed) {\n return;\n }\n // Add the batch to the registry so it will not be processed again.\n this._batchRegistry.add(batch);\n if (!batch.isUndoable) {\n return;\n }\n if (isRedoBatch) {\n // If this batch comes from `redoCommand`, add it to the `undoCommand` stack.\n this._undoCommand.addBatch(batch);\n }\n else if (!isUndoBatch) {\n // If the batch comes neither from `redoCommand` nor from `undoCommand` then it is a new, regular batch.\n // Add the batch to the `undoCommand` stack and clear the `redoCommand` stack.\n this._undoCommand.addBatch(batch);\n this._redoCommand.clearStack();\n }\n }, { priority: 'highest' });\n this.listenTo(this._undoCommand, 'revert', (evt, undoneBatch, undoingBatch) => {\n this._redoCommand.addBatch(undoingBatch);\n });\n editor.keystrokes.set('CTRL+Z', 'undo');\n editor.keystrokes.set('CTRL+Y', 'redo');\n editor.keystrokes.set('CTRL+SHIFT+Z', 'redo');\n // Add the information about the keystrokes to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Undo'),\n keystroke: 'CTRL+Z'\n },\n {\n label: t('Redo'),\n keystroke: [['CTRL+Y'], ['CTRL+SHIFT+Z']]\n }\n ]\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/undoui\n */\nimport { icons, Plugin } from '@ckeditor/ckeditor5-core';\nimport { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui';\n/**\n * The undo UI feature. It introduces the `'undo'` and `'redo'` buttons to the editor.\n */\nexport default class UndoUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'UndoUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const locale = editor.locale;\n const t = editor.t;\n const localizedUndoIcon = locale.uiLanguageDirection == 'ltr' ? icons.undo : icons.redo;\n const localizedRedoIcon = locale.uiLanguageDirection == 'ltr' ? icons.redo : icons.undo;\n this._addButtonsToFactory('undo', t('Undo'), 'CTRL+Z', localizedUndoIcon);\n this._addButtonsToFactory('redo', t('Redo'), 'CTRL+Y', localizedRedoIcon);\n }\n /**\n * Creates a button for the specified command.\n *\n * @param name Command name.\n * @param label Button label.\n * @param keystroke Command keystroke.\n * @param Icon Source of the icon.\n */\n _addButtonsToFactory(name, label, keystroke, Icon) {\n const editor = this.editor;\n editor.ui.componentFactory.add(name, () => {\n const buttonView = this._createButton(ButtonView, name, label, keystroke, Icon);\n buttonView.set({\n tooltip: true\n });\n return buttonView;\n });\n editor.ui.componentFactory.add('menuBar:' + name, () => {\n return this._createButton(MenuBarMenuListItemButtonView, name, label, keystroke, Icon);\n });\n }\n /**\n * TODO\n */\n _createButton(ButtonClass, name, label, keystroke, Icon) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get(name);\n const view = new ButtonClass(locale);\n view.set({\n label,\n icon: Icon,\n keystroke\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n this.listenTo(view, 'execute', () => {\n editor.execute(name);\n editor.editing.view.focus();\n });\n return view;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/undo\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport UndoEditing from './undoediting.js';\nimport UndoUI from './undoui.js';\n/**\n * The undo feature.\n *\n * This is a \"glue\" plugin which loads the {@link module:undo/undoediting~UndoEditing undo editing feature}\n * and the {@link module:undo/undoui~UndoUI undo UI feature}.\n *\n * Below is an explanation of the undo mechanism working together with {@link module:engine/model/history~History History}:\n *\n * Whenever an {@link module:engine/model/operation/operation~Operation operation} is applied to the\n * {@link module:engine/model/document~Document document}, it is saved to `History` as is.\n * The {@link module:engine/model/batch~Batch batch} that owns that operation is also saved, in\n * {@link module:undo/undocommand~UndoCommand}, together with the selection that was present in the document before the\n * operation was applied. A batch is saved instead of the operation because changes are undone batch-by-batch, not operation-by-operation\n * and a batch is seen as one undo step.\n *\n * After changes happen to the document, the `History` and `UndoCommand` stack can be represented as follows:\n *\n * ```\n * History Undo stack\n * ============== ==================================\n * [operation A1] [ batch A ]\n * [operation B1] [ batch B ]\n * [operation B2] [ batch C ]\n * [operation C1]\n * [operation C2]\n * [operation B3]\n * [operation C3]\n * ```\n *\n * Where operations starting with the same letter are from same batch.\n *\n * Undoing a batch means that a set of operations which will reverse the effects of that batch needs to be generated.\n * For example, if a batch added several letters, undoing the batch should remove them. It is important to apply undoing\n * operations in the reversed order, so if a batch has operation `X`, `Y`, `Z`, reversed operations `Zr`, `Yr` and `Xr`\n * need to be applied. Otherwise reversed operation `Xr` would operate on a wrong document state, because operation `X`\n * does not know that operations `Y` and `Z` happened.\n *\n * After operations from an undone batch got {@link module:engine/model/operation/operation~Operation#getReversed reversed},\n * one needs to make sure if they are ready to be applied. In the scenario above, operation `C3` is the last operation and `C3r`\n * bases on up-to-date document state, so it can be applied to the document.\n *\n * ```\n * History Undo stack\n * ================= ==================================\n * [ operation A1 ] [ batch A ]\n * [ operation B1 ] [ batch B ]\n * [ operation B2 ] [ processing undoing batch C ]\n * [ operation C1 ]\n * [ operation C2 ]\n * [ operation B3 ]\n * [ operation C3 ]\n * [ operation C3r ]\n * ```\n *\n * Next is operation `C2`, reversed to `C2r`. `C2r` bases on `C2`, so it bases on the wrong document state. It needs to be\n * transformed by operations from history that happened after it, so it \"knows\" about them. Let us assume that `C2' = C2r * B3 * C3 * C3r`,\n * where `*` means \"transformed by\". Rest of operations from that batch are processed in the same fashion.\n *\n * ```\n * History Undo stack Redo stack\n * ================= ================================== ==================================\n * [ operation A1 ] [ batch A ] [ batch Cr ]\n * [ operation B1 ] [ batch B ]\n * [ operation B2 ]\n * [ operation C1 ]\n * [ operation C2 ]\n * [ operation B3 ]\n * [ operation C3 ]\n * [ operation C3r ]\n * [ operation C2' ]\n * [ operation C1' ]\n * ```\n *\n * Selective undo works on the same basis, however, instead of undoing the last batch in the undo stack, any batch can be undone.\n * The same algorithm applies: operations from a batch (i.e. `A1`) are reversed and then transformed by operations stored in history.\n *\n * Redo also is very similar to undo. It has its own stack that is filled with undoing (reversed batches). Operations from\n * the batch that is re-done are reversed-back, transformed in proper order and applied to the document.\n *\n * ```\n * History Undo stack Redo stack\n * ================= ================================== ==================================\n * [ operation A1 ] [ batch A ]\n * [ operation B1 ] [ batch B ]\n * [ operation B2 ] [ batch Crr ]\n * [ operation C1 ]\n * [ operation C2 ]\n * [ operation B3 ]\n * [ operation C3 ]\n * [ operation C3r ]\n * [ operation C2' ]\n * [ operation C1' ]\n * [ operation C1'r]\n * [ operation C2'r]\n * [ operation C3rr]\n * ```\n */\nexport default class Undo extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [UndoEditing, UndoUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Undo';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { first } from 'ckeditor5/src/utils.js';\n/**\n * Creates a view element representing the inline image.\n *\n * ```html\n * <span class=\"image-inline\"><img></img></span>\n * ```\n *\n * Note that `alt` and `src` attributes are converted separately, so they are not included.\n *\n * @internal\n */\nexport function createInlineImageViewElement(writer) {\n return writer.createContainerElement('span', { class: 'image-inline' }, writer.createEmptyElement('img'));\n}\n/**\n * Creates a view element representing the block image.\n *\n * ```html\n * <figure class=\"image\"><img></img></figure>\n * ```\n *\n * Note that `alt` and `src` attributes are converted separately, so they are not included.\n *\n * @internal\n */\nexport function createBlockImageViewElement(writer) {\n return writer.createContainerElement('figure', { class: 'image' }, [\n writer.createEmptyElement('img'),\n writer.createSlot('children')\n ]);\n}\n/**\n * A function returning a `MatcherPattern` for a particular type of View images.\n *\n * @internal\n * @param matchImageType The type of created image.\n */\nexport function getImgViewElementMatcher(editor, matchImageType) {\n const imageUtils = editor.plugins.get('ImageUtils');\n const areBothImagePluginsLoaded = editor.plugins.has('ImageInlineEditing') && editor.plugins.has('ImageBlockEditing');\n return element => {\n // Check if the matched view element is an <img>.\n if (!imageUtils.isInlineImageView(element)) {\n return null;\n }\n // If just one of the plugins is loaded (block or inline), it will match all kinds of images.\n if (!areBothImagePluginsLoaded) {\n return getPositiveMatchPattern(element);\n }\n // The <img> can be standalone, wrapped in <figure>...</figure> (ImageBlock plugin) or\n // wrapped in <figure><a>...</a></figure> (LinkImage plugin).\n const imageType = element.getStyle('display') == 'block' || element.findAncestor(imageUtils.isBlockImageView) ?\n 'imageBlock' :\n 'imageInline';\n if (imageType !== matchImageType) {\n return null;\n }\n return getPositiveMatchPattern(element);\n };\n function getPositiveMatchPattern(element) {\n const pattern = {\n name: true\n };\n // This will trigger src consumption (See https://github.com/ckeditor/ckeditor5/issues/11530).\n if (element.hasAttribute('src')) {\n pattern.attributes = ['src'];\n }\n return pattern;\n }\n}\n/**\n * Considering the current model selection, it returns the name of the model image element\n * (`'imageBlock'` or `'imageInline'`) that will make most sense from the UX perspective if a new\n * image was inserted (also: uploaded, dropped, pasted) at that selection.\n *\n * The assumption is that inserting images into empty blocks or on other block widgets should\n * produce block images. Inline images should be inserted in other cases, e.g. in paragraphs\n * that already contain some text.\n *\n * @internal\n */\nexport function determineImageTypeForInsertionAtSelection(schema, selection) {\n const firstBlock = first(selection.getSelectedBlocks());\n // Insert a block image if the selection is not in/on block elements or it's on a block widget.\n if (!firstBlock || schema.isObject(firstBlock)) {\n return 'imageBlock';\n }\n // A block image should also be inserted into an empty block element\n // (that is not an empty list item so the list won't get split).\n if (firstBlock.isEmpty && firstBlock.name != 'listItem') {\n return 'imageBlock';\n }\n // Otherwise insert an inline image.\n return 'imageInline';\n}\n/**\n * Returns parsed value of the size, but only if it contains unit: px.\n */\nexport function getSizeValueIfInPx(size) {\n if (size && size.endsWith('px')) {\n return parseInt(size);\n }\n return null;\n}\n/**\n * Returns true if both styles (width and height) are set.\n *\n * If both image styles: width & height are set, they will override the image width & height attributes in the\n * browser. In this case, the image looks the same as if these styles were applied to attributes instead of styles.\n * That's why we can upcast these styles to width & height attributes instead of resizedWidth and resizedHeight.\n */\nexport function widthAndHeightStylesAreBothSet(viewElement) {\n const widthStyle = getSizeValueIfInPx(viewElement.getStyle('width'));\n const heightStyle = getSizeValueIfInPx(viewElement.getStyle('height'));\n return !!(widthStyle && heightStyle);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { findOptimalInsertionRange, isWidget, toWidget } from 'ckeditor5/src/widget.js';\nimport { determineImageTypeForInsertionAtSelection } from './image/utils.js';\nimport { DomEmitterMixin, global } from 'ckeditor5/src/utils.js';\nconst IMAGE_WIDGETS_CLASSES_MATCH_REGEXP = /^(image|image-inline)$/;\n/**\n * A set of helpers related to images.\n */\nexport default class ImageUtils extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * DOM Emitter.\n */\n this._domEmitter = new (DomEmitterMixin())();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageUtils';\n }\n /**\n * Checks if the provided model element is an `image` or `imageInline`.\n */\n isImage(modelElement) {\n return this.isInlineImage(modelElement) || this.isBlockImage(modelElement);\n }\n /**\n * Checks if the provided view element represents an inline image.\n *\n * Also, see {@link module:image/imageutils~ImageUtils#isImageWidget}.\n */\n isInlineImageView(element) {\n return !!element && element.is('element', 'img');\n }\n /**\n * Checks if the provided view element represents a block image.\n *\n * Also, see {@link module:image/imageutils~ImageUtils#isImageWidget}.\n */\n isBlockImageView(element) {\n return !!element && element.is('element', 'figure') && element.hasClass('image');\n }\n /**\n * Handles inserting single file. This method unifies image insertion using {@link module:widget/utils~findOptimalInsertionRange}\n * method.\n *\n * ```ts\n * const imageUtils = editor.plugins.get( 'ImageUtils' );\n *\n * imageUtils.insertImage( { src: 'path/to/image.jpg' } );\n * ```\n *\n * @param attributes Attributes of the inserted image.\n * This method filters out the attributes which are disallowed by the {@link module:engine/model/schema~Schema}.\n * @param selectable Place to insert the image. If not specified,\n * the {@link module:widget/utils~findOptimalInsertionRange} logic will be applied for the block images\n * and `model.document.selection` for the inline images.\n *\n * **Note**: If `selectable` is passed, this helper will not be able to set selection attributes (such as `linkHref`)\n * and apply them to the new image. In this case, make sure all selection attributes are passed in `attributes`.\n *\n * @param imageType Image type of inserted image. If not specified,\n * it will be determined automatically depending of editor config or place of the insertion.\n * @param options.setImageSizes Specifies whether the image `width` and `height` attributes should be set automatically.\n * The default is `true`.\n * @return The inserted model image element.\n */\n insertImage(attributes = {}, selectable = null, imageType = null, options = {}) {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n const determinedImageType = determineImageTypeForInsertion(editor, selectable || selection, imageType);\n // Mix declarative attributes with selection attributes because the new image should \"inherit\"\n // the latter for best UX. For instance, inline images inserted into existing links\n // should not split them. To do that, they need to have \"linkHref\" inherited from the selection.\n attributes = {\n ...Object.fromEntries(selection.getAttributes()),\n ...attributes\n };\n for (const attributeName in attributes) {\n if (!model.schema.checkAttribute(determinedImageType, attributeName)) {\n delete attributes[attributeName];\n }\n }\n return model.change(writer => {\n const { setImageSizes = true } = options;\n const imageElement = writer.createElement(determinedImageType, attributes);\n model.insertObject(imageElement, selectable, null, {\n setSelection: 'on',\n // If we want to insert a block image (for whatever reason) then we don't want to split text blocks.\n // This applies only when we don't have the selectable specified (i.e., we insert multiple block images at once).\n findOptimalPosition: !selectable && determinedImageType != 'imageInline' ? 'auto' : undefined\n });\n // Inserting an image might've failed due to schema regulations.\n if (imageElement.parent) {\n if (setImageSizes) {\n this.setImageNaturalSizeAttributes(imageElement);\n }\n return imageElement;\n }\n return null;\n });\n }\n /**\n * Reads original image sizes and sets them as `width` and `height`.\n *\n * The `src` attribute may not be available if the user is using an upload adapter. In such a case,\n * this method is called again after the upload process is complete and the `src` attribute is available.\n */\n setImageNaturalSizeAttributes(imageElement) {\n const src = imageElement.getAttribute('src');\n if (!src) {\n return;\n }\n if (imageElement.getAttribute('width') || imageElement.getAttribute('height')) {\n return;\n }\n this.editor.model.change(writer => {\n const img = new global.window.Image();\n this._domEmitter.listenTo(img, 'load', () => {\n if (!imageElement.getAttribute('width') && !imageElement.getAttribute('height')) {\n // We use writer.batch to be able to undo (in a single step) width and height setting\n // along with any change that triggered this action (e.g. image resize or image style change).\n this.editor.model.enqueueChange(writer.batch, writer => {\n writer.setAttribute('width', img.naturalWidth, imageElement);\n writer.setAttribute('height', img.naturalHeight, imageElement);\n });\n }\n this._domEmitter.stopListening(img, 'load');\n });\n img.src = src;\n });\n }\n /**\n * Returns an image widget editing view element if one is selected or is among the selection's ancestors.\n */\n getClosestSelectedImageWidget(selection) {\n const selectionPosition = selection.getFirstPosition();\n if (!selectionPosition) {\n return null;\n }\n const viewElement = selection.getSelectedElement();\n if (viewElement && this.isImageWidget(viewElement)) {\n return viewElement;\n }\n let parent = selectionPosition.parent;\n while (parent) {\n if (parent.is('element') && this.isImageWidget(parent)) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n /**\n * Returns a image model element if one is selected or is among the selection's ancestors.\n */\n getClosestSelectedImageElement(selection) {\n const selectedElement = selection.getSelectedElement();\n return this.isImage(selectedElement) ? selectedElement : selection.getFirstPosition().findAncestor('imageBlock');\n }\n /**\n * Returns an image widget editing view based on the passed image view.\n */\n getImageWidgetFromImageView(imageView) {\n return imageView.findAncestor({ classes: IMAGE_WIDGETS_CLASSES_MATCH_REGEXP });\n }\n /**\n * Checks if image can be inserted at current model selection.\n *\n * @internal\n */\n isImageAllowed() {\n const model = this.editor.model;\n const selection = model.document.selection;\n return isImageAllowedInParent(this.editor, selection) && isNotInsideImage(selection);\n }\n /**\n * Converts a given {@link module:engine/view/element~Element} to an image widget:\n * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the image widget\n * element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n * @param label The element's label. It will be concatenated with the image `alt` attribute if one is present.\n */\n toImageWidget(viewElement, writer, label) {\n writer.setCustomProperty('image', true, viewElement);\n const labelCreator = () => {\n const imgElement = this.findViewImgElement(viewElement);\n const altText = imgElement.getAttribute('alt');\n return altText ? `${altText} ${label}` : label;\n };\n return toWidget(viewElement, writer, { label: labelCreator });\n }\n /**\n * Checks if a given view element is an image widget.\n */\n isImageWidget(viewElement) {\n return !!viewElement.getCustomProperty('image') && isWidget(viewElement);\n }\n /**\n * Checks if the provided model element is an `image`.\n */\n isBlockImage(modelElement) {\n return !!modelElement && modelElement.is('element', 'imageBlock');\n }\n /**\n * Checks if the provided model element is an `imageInline`.\n */\n isInlineImage(modelElement) {\n return !!modelElement && modelElement.is('element', 'imageInline');\n }\n /**\n * Get the view `<img>` from another view element, e.g. a widget (`<figure class=\"image\">`), a link (`<a>`).\n *\n * The `<img>` can be located deep in other elements, so this helper performs a deep tree search.\n */\n findViewImgElement(figureView) {\n if (this.isInlineImageView(figureView)) {\n return figureView;\n }\n const editingView = this.editor.editing.view;\n for (const { item } of editingView.createRangeIn(figureView)) {\n if (this.isInlineImageView(item)) {\n return item;\n }\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this._domEmitter.stopListening();\n return super.destroy();\n }\n}\n/**\n * Checks if image is allowed by schema in optimal insertion parent.\n */\nfunction isImageAllowedInParent(editor, selection) {\n const imageType = determineImageTypeForInsertion(editor, selection, null);\n if (imageType == 'imageBlock') {\n const parent = getInsertImageParent(selection, editor.model);\n if (editor.model.schema.checkChild(parent, 'imageBlock')) {\n return true;\n }\n }\n else if (editor.model.schema.checkChild(selection.focus, 'imageInline')) {\n return true;\n }\n return false;\n}\n/**\n * Checks if selection is not placed inside an image (e.g. its caption).\n */\nfunction isNotInsideImage(selection) {\n return [...selection.focus.getAncestors()].every(ancestor => !ancestor.is('element', 'imageBlock'));\n}\n/**\n * Returns a node that will be used to insert image with `model.insertContent`.\n */\nfunction getInsertImageParent(selection, model) {\n const insertionRange = findOptimalInsertionRange(selection, model);\n const parent = insertionRange.start.parent;\n if (parent.isEmpty && !parent.is('element', '$root')) {\n return parent.parent;\n }\n return parent;\n}\n/**\n * Determine image element type name depending on editor config or place of insertion.\n *\n * @param imageType Image element type name. Used to force return of provided element name,\n * but only if there is proper plugin enabled.\n */\nfunction determineImageTypeForInsertion(editor, selectable, imageType) {\n const schema = editor.model.schema;\n const configImageInsertType = editor.config.get('image.insert.type');\n if (!editor.plugins.has('ImageBlockEditing')) {\n return 'imageInline';\n }\n if (!editor.plugins.has('ImageInlineEditing')) {\n return 'imageBlock';\n }\n if (imageType) {\n return imageType;\n }\n if (configImageInsertType === 'inline') {\n return 'imageInline';\n }\n if (configImageInsertType !== 'auto') {\n return 'imageBlock';\n }\n // Try to replace the selected widget (e.g. another image).\n if (selectable.is('selection')) {\n return determineImageTypeForInsertionAtSelection(schema, selectable);\n }\n return schema.checkChild(selectable, 'imageInline') ? 'imageInline' : 'imageBlock';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/autoimage\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Clipboard } from 'ckeditor5/src/clipboard.js';\nimport { LivePosition, LiveRange } from 'ckeditor5/src/engine.js';\nimport { Undo } from 'ckeditor5/src/undo.js';\nimport { Delete } from 'ckeditor5/src/typing.js';\nimport { global } from 'ckeditor5/src/utils.js';\nimport ImageUtils from './imageutils.js';\n// Implements the pattern: http(s)://(www.)example.com/path/to/resource.ext?query=params&maybe=too.\nconst IMAGE_URL_REGEXP = new RegExp(String(/^(http(s)?:\\/\\/)?[\\w-]+\\.[\\w.~:/[\\]@!$&'()*+,;=%-]+/.source +\n /\\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source +\n /(\\?[\\w.~:/[\\]@!$&'()*+,;=%-]*)?/.source +\n /(#[\\w.~:/[\\]@!$&'()*+,;=%-]*)?$/.source));\n/**\n * The auto-image plugin. It recognizes image links in the pasted content and embeds\n * them shortly after they are injected into the document.\n */\nexport default class AutoImage extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Clipboard, ImageUtils, Undo, Delete];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'AutoImage';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._timeoutId = null;\n this._positionToInsert = null;\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const modelDocument = editor.model.document;\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n // We need to listen on `Clipboard#inputTransformation` because we need to save positions of selection.\n // After pasting, the content between those positions will be checked for a URL that could be transformed\n // into an image.\n this.listenTo(clipboardPipeline, 'inputTransformation', () => {\n const firstRange = modelDocument.selection.getFirstRange();\n const leftLivePosition = LivePosition.fromPosition(firstRange.start);\n leftLivePosition.stickiness = 'toPrevious';\n const rightLivePosition = LivePosition.fromPosition(firstRange.end);\n rightLivePosition.stickiness = 'toNext';\n modelDocument.once('change:data', () => {\n this._embedImageBetweenPositions(leftLivePosition, rightLivePosition);\n leftLivePosition.detach();\n rightLivePosition.detach();\n }, { priority: 'high' });\n });\n editor.commands.get('undo').on('execute', () => {\n if (this._timeoutId) {\n global.window.clearTimeout(this._timeoutId);\n this._positionToInsert.detach();\n this._timeoutId = null;\n this._positionToInsert = null;\n }\n }, { priority: 'high' });\n }\n /**\n * Analyzes the part of the document between provided positions in search for a URL representing an image.\n * When the URL is found, it is automatically converted into an image.\n *\n * @param leftPosition Left position of the selection.\n * @param rightPosition Right position of the selection.\n */\n _embedImageBetweenPositions(leftPosition, rightPosition) {\n const editor = this.editor;\n // TODO: Use a marker instead of LiveRange & LivePositions.\n const urlRange = new LiveRange(leftPosition, rightPosition);\n const walker = urlRange.getWalker({ ignoreElementEnd: true });\n const selectionAttributes = Object.fromEntries(editor.model.document.selection.getAttributes());\n const imageUtils = this.editor.plugins.get('ImageUtils');\n let src = '';\n for (const node of walker) {\n if (node.item.is('$textProxy')) {\n src += node.item.data;\n }\n }\n src = src.trim();\n // If the URL does not match the image URL regexp, let's skip that.\n if (!src.match(IMAGE_URL_REGEXP)) {\n urlRange.detach();\n return;\n }\n // Position will not be available in the `setTimeout` function so let's clone it.\n this._positionToInsert = LivePosition.fromPosition(leftPosition);\n // This action mustn't be executed if undo was called between pasting and auto-embedding.\n this._timeoutId = setTimeout(() => {\n // Do nothing if image element cannot be inserted at the current position.\n // See https://github.com/ckeditor/ckeditor5/issues/2763.\n // Condition must be checked after timeout - pasting may take place on an element, replacing it. The final position matters.\n const imageCommand = editor.commands.get('insertImage');\n if (!imageCommand.isEnabled) {\n urlRange.detach();\n return;\n }\n editor.model.change(writer => {\n this._timeoutId = null;\n writer.remove(urlRange);\n urlRange.detach();\n let insertionPosition;\n // Check if the position where the element should be inserted is still valid.\n // Otherwise leave it as undefined to use the logic of insertImage().\n if (this._positionToInsert.root.rootName !== '$graveyard') {\n insertionPosition = this._positionToInsert.toPosition();\n }\n imageUtils.insertImage({ ...selectionAttributes, src }, insertionPosition);\n this._positionToInsert.detach();\n this._positionToInsert = null;\n });\n const deletePlugin = editor.plugins.get('Delete');\n deletePlugin.requestUndoOnBackspace();\n }, 100);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative/imagetextalternativecommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The image text alternative command. It is used to change the `alt` attribute of `<imageBlock>` and `<imageInline>` model elements.\n */\nexport default class ImageTextAlternativeCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = imageUtils.getClosestSelectedImageElement(this.editor.model.document.selection);\n this.isEnabled = !!element;\n if (this.isEnabled && element.hasAttribute('alt')) {\n this.value = element.getAttribute('alt');\n }\n else {\n this.value = false;\n }\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options\n * @param options.newValue The new value of the `alt` attribute to set.\n */\n execute(options) {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const model = editor.model;\n const imageElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n model.change(writer => {\n writer.setAttribute('alt', options.newValue, imageElement);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative/imagetextalternativeediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageTextAlternativeCommand from './imagetextalternativecommand.js';\nimport ImageUtils from '../imageutils.js';\n/**\n * The image text alternative editing plugin.\n *\n * Registers the `'imageTextAlternative'` command.\n */\nexport default class ImageTextAlternativeEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageTextAlternativeEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n this.editor.commands.add('imageTextAlternative', new ImageTextAlternativeCommand(this.editor));\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./textalternativeform.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./textalternativeform.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./responsiveform.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./responsiveform.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative/ui/textalternativeformview\n */\nimport { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, createLabeledInputText, submitHandler } from 'ckeditor5/src/ui.js';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';\nimport { icons } from 'ckeditor5/src/core.js';\nimport '../../../theme/textalternativeform.css';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\n/**\n * The TextAlternativeFormView class.\n */\nexport default class TextAlternativeFormView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const t = this.locale.t;\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.labeledInput = this._createLabeledInputView();\n this.saveButtonView = this._createButton(t('Save'), icons.check, 'ck-button-save');\n this.saveButtonView.type = 'submit';\n this.cancelButtonView = this._createButton(t('Cancel'), icons.cancel, 'ck-button-cancel', 'cancel');\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-text-alternative-form',\n 'ck-responsive-form'\n ],\n // https://github.com/ckeditor/ckeditor5-image/issues/40\n tabindex: '-1'\n },\n children: [\n this.labeledInput,\n this.saveButtonView,\n this.cancelButtonView\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.keystrokes.listenTo(this.element);\n submitHandler({ view: this });\n [this.labeledInput, this.saveButtonView, this.cancelButtonView]\n .forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Creates the button view.\n *\n * @param label The button label\n * @param icon The button's icon.\n * @param className The additional button CSS class name.\n * @param eventName The event name that the ButtonView#execute event will be delegated to.\n * @returns The button view instance.\n */\n _createButton(label, icon, className, eventName) {\n const button = new ButtonView(this.locale);\n button.set({\n label,\n icon,\n tooltip: true\n });\n button.extendTemplate({\n attributes: {\n class: className\n }\n });\n if (eventName) {\n button.delegate('execute').to(this, eventName);\n }\n return button;\n }\n /**\n * Creates an input with a label.\n *\n * @returns Labeled field view instance.\n */\n _createLabeledInputView() {\n const t = this.locale.t;\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n labeledInput.label = t('Text alternative');\n return labeledInput;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { BalloonPanelView } from 'ckeditor5/src/ui.js';\n/**\n * A helper utility that positions the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance\n * with respect to the image in the editor content, if one is selected.\n *\n * @param editor The editor instance.\n */\nexport function repositionContextualBalloon(editor) {\n const balloon = editor.plugins.get('ContextualBalloon');\n const imageUtils = editor.plugins.get('ImageUtils');\n if (imageUtils.getClosestSelectedImageWidget(editor.editing.view.document.selection)) {\n const position = getBalloonPositionData(editor);\n balloon.updatePosition(position);\n }\n}\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected element in the editor content.\n *\n * @param editor The editor instance.\n */\nexport function getBalloonPositionData(editor) {\n const editingView = editor.editing.view;\n const defaultPositions = BalloonPanelView.defaultPositions;\n const imageUtils = editor.plugins.get('ImageUtils');\n return {\n target: editingView.domConverter.mapViewToDom(imageUtils.getClosestSelectedImageWidget(editingView.document.selection)),\n positions: [\n defaultPositions.northArrowSouth,\n defaultPositions.northArrowSouthWest,\n defaultPositions.northArrowSouthEast,\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthWest,\n defaultPositions.southArrowNorthEast,\n defaultPositions.viewportStickyNorth\n ]\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative/imagetextalternativeui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core.js';\nimport { ButtonView, ContextualBalloon, clickOutsideHandler, CssTransitionDisablerMixin } from 'ckeditor5/src/ui.js';\nimport TextAlternativeFormView from './ui/textalternativeformview.js';\nimport { repositionContextualBalloon, getBalloonPositionData } from '../image/ui/utils.js';\n/**\n * The image text alternative UI plugin.\n *\n * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.\n */\nexport default class ImageTextAlternativeUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageTextAlternativeUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n this._createButton();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).\n if (this._form) {\n this._form.destroy();\n }\n }\n /**\n * Creates a button showing the balloon panel for changing the image text alternative and\n * registers it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.\n */\n _createButton() {\n const editor = this.editor;\n const t = editor.t;\n editor.ui.componentFactory.add('imageTextAlternative', locale => {\n const command = editor.commands.get('imageTextAlternative');\n const view = new ButtonView(locale);\n view.set({\n label: t('Change image text alternative'),\n icon: icons.textAlternative,\n tooltip: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n view.bind('isOn').to(command, 'value', value => !!value);\n this.listenTo(view, 'execute', () => {\n this._showForm();\n });\n return view;\n });\n }\n /**\n * Creates the {@link module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}\n * form.\n */\n _createForm() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const imageUtils = editor.plugins.get('ImageUtils');\n this._balloon = this.editor.plugins.get('ContextualBalloon');\n this._form = new (CssTransitionDisablerMixin(TextAlternativeFormView))(editor.locale);\n // Render the form so its #element is available for clickOutsideHandler.\n this._form.render();\n this.listenTo(this._form, 'submit', () => {\n editor.execute('imageTextAlternative', {\n newValue: this._form.labeledInput.fieldView.element.value\n });\n this._hideForm(true);\n });\n this.listenTo(this._form, 'cancel', () => {\n this._hideForm(true);\n });\n // Close the form on Esc key press.\n this._form.keystrokes.set('Esc', (data, cancel) => {\n this._hideForm(true);\n cancel();\n });\n // Reposition the balloon or hide the form if an image widget is no longer selected.\n this.listenTo(editor.ui, 'update', () => {\n if (!imageUtils.getClosestSelectedImageWidget(viewDocument.selection)) {\n this._hideForm(true);\n }\n else if (this._isVisible) {\n repositionContextualBalloon(editor);\n }\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: this._form,\n activator: () => this._isVisible,\n contextElements: () => [this._balloon.view.element],\n callback: () => this._hideForm()\n });\n }\n /**\n * Shows the {@link #_form} in the {@link #_balloon}.\n */\n _showForm() {\n if (this._isVisible) {\n return;\n }\n if (!this._form) {\n this._createForm();\n }\n const editor = this.editor;\n const command = editor.commands.get('imageTextAlternative');\n const labeledInput = this._form.labeledInput;\n this._form.disableCssTransitions();\n if (!this._isInBalloon) {\n this._balloon.add({\n view: this._form,\n position: getBalloonPositionData(editor)\n });\n }\n // Make sure that each time the panel shows up, the field remains in sync with the value of\n // the command. If the user typed in the input, then canceled the balloon (`labeledInput#value`\n // stays unaltered) and re-opened it without changing the value of the command, they would see the\n // old value instead of the actual value of the command.\n // https://github.com/ckeditor/ckeditor5-image/issues/114\n labeledInput.fieldView.value = labeledInput.fieldView.element.value = command.value || '';\n this._form.labeledInput.fieldView.select();\n this._form.enableCssTransitions();\n }\n /**\n * Removes the {@link #_form} from the {@link #_balloon}.\n *\n * @param focusEditable Controls whether the editing view is focused afterwards.\n */\n _hideForm(focusEditable = false) {\n if (!this._isInBalloon) {\n return;\n }\n // Blur the input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n if (this._form.focusTracker.isFocused) {\n this._form.saveButtonView.focus();\n }\n this._balloon.remove(this._form);\n if (focusEditable) {\n this.editor.editing.view.focus();\n }\n }\n /**\n * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.\n */\n get _isVisible() {\n return !!this._balloon && this._balloon.visibleView === this._form;\n }\n /**\n * Returns `true` when the {@link #_form} is in the {@link #_balloon}.\n */\n get _isInBalloon() {\n return !!this._balloon && this._balloon.hasView(this._form);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageTextAlternativeEditing from './imagetextalternative/imagetextalternativeediting.js';\nimport ImageTextAlternativeUI from './imagetextalternative/imagetextalternativeui.js';\n/**\n * The image text alternative plugin.\n *\n * For a detailed overview, check the {@glink features/images/images-styles image styles} documentation.\n *\n * This is a \"glue\" plugin which loads the\n * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}\n * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.\n */\nexport default class ImageTextAlternative extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageTextAlternativeEditing, ImageTextAlternativeUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageTextAlternative';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { first } from 'ckeditor5/src/utils.js';\n/**\n * Returns a function that converts the image view representation:\n *\n * ```html\n * <figure class=\"image\"><img src=\"...\" alt=\"...\"></img></figure>\n * ```\n *\n * to the model representation:\n *\n * ```html\n * <imageBlock src=\"...\" alt=\"...\"></imageBlock>\n * ```\n *\n * The entire content of the `<figure>` element except the first `<img>` is being converted as children\n * of the `<imageBlock>` model element.\n *\n * @internal\n */\nexport function upcastImageFigure(imageUtils) {\n const converter = (evt, data, conversionApi) => {\n // Do not convert if this is not an \"image figure\".\n if (!conversionApi.consumable.test(data.viewItem, { name: true, classes: 'image' })) {\n return;\n }\n // Find an image element inside the figure element.\n const viewImage = imageUtils.findViewImgElement(data.viewItem);\n // Do not convert if image element is absent or was already converted.\n if (!viewImage || !conversionApi.consumable.test(viewImage, { name: true })) {\n return;\n }\n // Consume the figure to prevent other converters from processing it again.\n conversionApi.consumable.consume(data.viewItem, { name: true, classes: 'image' });\n // Convert view image to model image.\n const conversionResult = conversionApi.convertItem(viewImage, data.modelCursor);\n // Get image element from conversion result.\n const modelImage = first(conversionResult.modelRange.getItems());\n // When image wasn't successfully converted then finish conversion.\n if (!modelImage) {\n // Revert consumed figure so other features can convert it.\n conversionApi.consumable.revert(data.viewItem, { name: true, classes: 'image' });\n return;\n }\n // Convert rest of the figure element's children as an image children.\n conversionApi.convertChildren(data.viewItem, modelImage);\n conversionApi.updateConversionResult(modelImage, data);\n };\n return dispatcher => {\n dispatcher.on('element:figure', converter);\n };\n}\n/**\n * Returns a function that converts the image view representation:\n *\n * ```html\n * <picture><source ... /><source ... />...<img ... /></picture>\n * ```\n *\n * to the model representation as the `sources` attribute:\n *\n * ```html\n * <image[Block|Inline] ... sources=\"...\"></image[Block|Inline]>\n * ```\n *\n * @internal\n */\nexport function upcastPicture(imageUtils) {\n const sourceAttributeNames = ['srcset', 'media', 'type', 'sizes'];\n const converter = (evt, data, conversionApi) => {\n const pictureViewElement = data.viewItem;\n // Do not convert <picture> if already consumed.\n if (!conversionApi.consumable.test(pictureViewElement, { name: true })) {\n return;\n }\n const sources = new Map();\n // Collect all <source /> elements attribute values.\n for (const childSourceElement of pictureViewElement.getChildren()) {\n if (childSourceElement.is('element', 'source')) {\n const attributes = {};\n for (const name of sourceAttributeNames) {\n if (childSourceElement.hasAttribute(name)) {\n // Don't collect <source /> attribute if already consumed somewhere else.\n if (conversionApi.consumable.test(childSourceElement, { attributes: name })) {\n attributes[name] = childSourceElement.getAttribute(name);\n }\n }\n }\n if (Object.keys(attributes).length) {\n sources.set(childSourceElement, attributes);\n }\n }\n }\n const imgViewElement = imageUtils.findViewImgElement(pictureViewElement);\n // Don't convert when a picture has no <img/> inside (it is broken).\n if (!imgViewElement) {\n return;\n }\n let modelImage = data.modelCursor.parent;\n // - In case of an inline image (cursor parent in a <paragraph>), the <img/> must be converted right away\n // because no converter handled it yet and otherwise there would be no model element to set the sources attribute on.\n // - In case of a block image, the <figure class=\"image\"> converter (in ImageBlockEditing) converts the\n // <img/> right away on its own and the modelCursor is already inside an imageBlock and there's nothing special\n // to do here.\n if (!modelImage.is('element', 'imageBlock')) {\n const conversionResult = conversionApi.convertItem(imgViewElement, data.modelCursor);\n // Set image range as conversion result.\n data.modelRange = conversionResult.modelRange;\n // Continue conversion where image conversion ends.\n data.modelCursor = conversionResult.modelCursor;\n modelImage = first(conversionResult.modelRange.getItems());\n }\n conversionApi.consumable.consume(pictureViewElement, { name: true });\n // Consume only these <source/> attributes that were actually collected and will be passed on\n // to the image model element.\n for (const [sourceElement, attributes] of sources) {\n conversionApi.consumable.consume(sourceElement, { attributes: Object.keys(attributes) });\n }\n if (sources.size) {\n conversionApi.writer.setAttribute('sources', Array.from(sources.values()), modelImage);\n }\n // Convert rest of the <picture> children as an image children. Other converters may want to consume them.\n conversionApi.convertChildren(pictureViewElement, modelImage);\n };\n return dispatcher => {\n dispatcher.on('element:picture', converter);\n };\n}\n/**\n * Converter used to convert the `srcset` model image attribute to the `srcset` and `sizes` attributes in the view.\n *\n * @internal\n * @param imageType The type of the image.\n */\nexport function downcastSrcsetAttribute(imageUtils, imageType) {\n const converter = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const writer = conversionApi.writer;\n const element = conversionApi.mapper.toViewElement(data.item);\n const img = imageUtils.findViewImgElement(element);\n if (data.attributeNewValue === null) {\n writer.removeAttribute('srcset', img);\n writer.removeAttribute('sizes', img);\n }\n else {\n if (data.attributeNewValue) {\n writer.setAttribute('srcset', data.attributeNewValue, img);\n // Always outputting `100vw`. See https://github.com/ckeditor/ckeditor5-image/issues/2.\n writer.setAttribute('sizes', '100vw', img);\n }\n }\n };\n return dispatcher => {\n dispatcher.on(`attribute:srcset:${imageType}`, converter);\n };\n}\n/**\n * Converts the `source` model attribute to the `<picture><source /><source />...<img /></picture>`\n * view structure.\n *\n * @internal\n */\nexport function downcastSourcesAttribute(imageUtils) {\n const converter = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const element = conversionApi.mapper.toViewElement(data.item);\n const imgElement = imageUtils.findViewImgElement(element);\n const attributeNewValue = data.attributeNewValue;\n if (attributeNewValue && attributeNewValue.length) {\n // Make sure <picture> does not break attribute elements, for instance <a> in linked images.\n const pictureElement = viewWriter.createContainerElement('picture', null, attributeNewValue.map(sourceAttributes => {\n return viewWriter.createEmptyElement('source', sourceAttributes);\n }));\n // Collect all wrapping attribute elements.\n const attributeElements = [];\n let viewElement = imgElement.parent;\n while (viewElement && viewElement.is('attributeElement')) {\n const parentElement = viewElement.parent;\n viewWriter.unwrap(viewWriter.createRangeOn(imgElement), viewElement);\n attributeElements.unshift(viewElement);\n viewElement = parentElement;\n }\n // Insert the picture and move img into it.\n viewWriter.insert(viewWriter.createPositionBefore(imgElement), pictureElement);\n viewWriter.move(viewWriter.createRangeOn(imgElement), viewWriter.createPositionAt(pictureElement, 'end'));\n // Apply collected attribute elements over the new picture element.\n for (const attributeElement of attributeElements) {\n viewWriter.wrap(viewWriter.createRangeOn(pictureElement), attributeElement);\n }\n }\n // Both setting \"sources\" to an empty array and removing the attribute should unwrap the <img />.\n // Unwrap once if the latter followed the former, though.\n else if (imgElement.parent.is('element', 'picture')) {\n const pictureElement = imgElement.parent;\n viewWriter.move(viewWriter.createRangeOn(imgElement), viewWriter.createPositionBefore(pictureElement));\n viewWriter.remove(pictureElement);\n }\n };\n return dispatcher => {\n dispatcher.on('attribute:sources:imageBlock', converter);\n dispatcher.on('attribute:sources:imageInline', converter);\n };\n}\n/**\n * Converter used to convert a given image attribute from the model to the view.\n *\n * @internal\n * @param imageType The type of the image.\n * @param attributeKey The name of the attribute to convert.\n */\nexport function downcastImageAttribute(imageUtils, imageType, attributeKey) {\n const converter = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const element = conversionApi.mapper.toViewElement(data.item);\n const img = imageUtils.findViewImgElement(element);\n viewWriter.setAttribute(data.attributeKey, data.attributeNewValue || '', img);\n };\n return dispatcher => {\n dispatcher.on(`attribute:${attributeKey}:${imageType}`, converter);\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageloadobserver\n */\nimport { Observer } from 'ckeditor5/src/engine.js';\n/**\n * Observes all new images added to the {@link module:engine/view/document~Document},\n * fires {@link module:engine/view/document~Document#event:imageLoaded} and\n * {@link module:engine/view/document~Document#event:layoutChanged} event every time when the new image\n * has been loaded.\n *\n * **Note:** This event is not fired for images that has been added to the document and rendered as `complete` (already loaded).\n */\nexport default class ImageLoadObserver extends Observer {\n /**\n * @inheritDoc\n */\n observe(domRoot) {\n this.listenTo(domRoot, 'load', (event, domEvent) => {\n const domElement = domEvent.target;\n if (this.checkShouldIgnoreEventFromTarget(domElement)) {\n return;\n }\n if (domElement.tagName == 'IMG') {\n this._fireEvents(domEvent);\n }\n // Use capture phase for better performance (#4504).\n }, { useCapture: true });\n }\n /**\n * @inheritDoc\n */\n stopObserving(domRoot) {\n this.stopListening(domRoot);\n }\n /**\n * Fires {@link module:engine/view/document~Document#event:layoutChanged} and\n * {@link module:engine/view/document~Document#event:imageLoaded}\n * if observer {@link #isEnabled is enabled}.\n *\n * @param domEvent The DOM event.\n */\n _fireEvents(domEvent) {\n if (this.isEnabled) {\n this.document.fire('layoutChanged');\n this.document.fire('imageLoaded', domEvent);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/insertimagecommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { logWarning, toArray } from 'ckeditor5/src/utils.js';\n/**\n * Insert image command.\n *\n * The command is registered by the {@link module:image/image/imageediting~ImageEditing} plugin as `insertImage`\n * and it is also available via aliased `imageInsert` name.\n *\n * In order to insert an image at the current selection position\n * (according to the {@link module:widget/utils~findOptimalInsertionRange} algorithm),\n * execute the command and specify the image source:\n *\n * ```ts\n * editor.execute( 'insertImage', { source: 'http://url.to.the/image' } );\n * ```\n *\n * It is also possible to insert multiple images at once:\n *\n * ```ts\n * editor.execute( 'insertImage', {\n * \tsource: [\n * \t\t'path/to/image.jpg',\n * \t\t'path/to/other-image.jpg'\n * \t]\n * } );\n * ```\n *\n * If you want to take the full control over the process, you can specify individual model attributes:\n *\n * ```ts\n * editor.execute( 'insertImage', {\n * \tsource: [\n * \t\t{ src: 'path/to/image.jpg', alt: 'First alt text' },\n * \t\t{ src: 'path/to/other-image.jpg', alt: 'Second alt text', customAttribute: 'My attribute value' }\n * \t]\n * } );\n * ```\n */\nexport default class InsertImageCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n const configImageInsertType = editor.config.get('image.insert.type');\n if (!editor.plugins.has('ImageBlockEditing')) {\n if (configImageInsertType === 'block') {\n /**\n * The {@link module:image/imageblock~ImageBlock} plugin must be enabled to allow inserting block images. See\n * {@link module:image/imageconfig~ImageInsertConfig#type} to learn more.\n *\n * @error image-block-plugin-required\n */\n logWarning('image-block-plugin-required');\n }\n }\n if (!editor.plugins.has('ImageInlineEditing')) {\n if (configImageInsertType === 'inline') {\n /**\n * The {@link module:image/imageinline~ImageInline} plugin must be enabled to allow inserting inline images. See\n * {@link module:image/imageconfig~ImageInsertConfig#type} to learn more.\n *\n * @error image-inline-plugin-required\n */\n logWarning('image-inline-plugin-required');\n }\n }\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const imageUtils = this.editor.plugins.get('ImageUtils');\n this.isEnabled = imageUtils.isImageAllowed();\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options Options for the executed command.\n * @param options.source The image source or an array of image sources to insert.\n * See the documentation of the command to learn more about accepted formats.\n */\n execute(options) {\n const sourceDefinitions = toArray(options.source);\n const selection = this.editor.model.document.selection;\n const imageUtils = this.editor.plugins.get('ImageUtils');\n // In case of multiple images, each image (starting from the 2nd) will be inserted at a position that\n // follows the previous one. That will move the selection and, to stay on the safe side and make sure\n // all images inherit the same selection attributes, they are collected beforehand.\n //\n // Applying these attributes ensures, for instance, that inserting an (inline) image into a link does\n // not split that link but preserves its continuity.\n //\n // Note: Selection attributes that do not make sense for images will be filtered out by insertImage() anyway.\n const selectionAttributes = Object.fromEntries(selection.getAttributes());\n sourceDefinitions.forEach((sourceDefinition, index) => {\n const selectedElement = selection.getSelectedElement();\n if (typeof sourceDefinition === 'string') {\n sourceDefinition = { src: sourceDefinition };\n }\n // Inserting of an inline image replace the selected element and make a selection on the inserted image.\n // Therefore inserting multiple inline images requires creating position after each element.\n if (index && selectedElement && imageUtils.isImage(selectedElement)) {\n const position = this.editor.model.createPositionAfter(selectedElement);\n imageUtils.insertImage({ ...sourceDefinition, ...selectionAttributes }, position);\n }\n else {\n imageUtils.insertImage({ ...sourceDefinition, ...selectionAttributes });\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * @module image/image/replaceimagesourcecommand\n */\n/**\n * Replace image source command.\n *\n * Changes image source to the one provided. Can be executed as follows:\n *\n * ```ts\n * editor.execute( 'replaceImageSource', { source: 'http://url.to.the/image' } );\n * ```\n */\nexport default class ReplaceImageSourceCommand extends Command {\n constructor(editor) {\n super(editor);\n this.decorate('cleanupImage');\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = this.editor.model.document.selection.getSelectedElement();\n this.isEnabled = imageUtils.isImage(element);\n this.value = this.isEnabled ? element.getAttribute('src') : null;\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options Options for the executed command.\n * @param options.source The image source to replace.\n */\n execute(options) {\n const image = this.editor.model.document.selection.getSelectedElement();\n const imageUtils = this.editor.plugins.get('ImageUtils');\n this.editor.model.change(writer => {\n writer.setAttribute('src', options.source, image);\n this.cleanupImage(writer, image);\n imageUtils.setImageNaturalSizeAttributes(image);\n });\n }\n /**\n * Cleanup image attributes that are not relevant to the new source.\n *\n * Removed attributes are: 'srcset', 'sizes', 'sources', 'width', 'height', 'alt'.\n *\n * This method is decorated, to allow custom cleanup logic.\n * For example, to remove 'myImageId' attribute after 'src' has changed:\n *\n * ```ts\n * replaceImageSourceCommand.on( 'cleanupImage', ( eventInfo, [ writer, image ] ) => {\n * \twriter.removeAttribute( 'myImageId', image );\n * } );\n * ```\n */\n cleanupImage(writer, image) {\n writer.removeAttribute('srcset', image);\n writer.removeAttribute('sizes', image);\n /**\n * In case responsive images some attributes should be cleaned up.\n * Check: https://github.com/ckeditor/ckeditor5/issues/15093\n */\n writer.removeAttribute('sources', image);\n writer.removeAttribute('width', image);\n writer.removeAttribute('height', image);\n writer.removeAttribute('alt', image);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageLoadObserver from './imageloadobserver.js';\nimport InsertImageCommand from './insertimagecommand.js';\nimport ReplaceImageSourceCommand from './replaceimagesourcecommand.js';\nimport ImageUtils from '../imageutils.js';\n/**\n * The image engine plugin. This module loads common code shared between\n * {@link module:image/image/imageinlineediting~ImageInlineEditing} and\n * {@link module:image/image/imageblockediting~ImageBlockEditing} plugins.\n *\n * This plugin registers the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command.\n */\nexport default class ImageEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const conversion = editor.conversion;\n // See https://github.com/ckeditor/ckeditor5-image/issues/142.\n editor.editing.view.addObserver(ImageLoadObserver);\n conversion.for('upcast')\n .attributeToAttribute({\n view: {\n name: 'img',\n key: 'alt'\n },\n model: 'alt'\n })\n .attributeToAttribute({\n view: {\n name: 'img',\n key: 'srcset'\n },\n model: 'srcset'\n });\n const insertImageCommand = new InsertImageCommand(editor);\n const replaceImageSourceCommand = new ReplaceImageSourceCommand(editor);\n editor.commands.add('insertImage', insertImageCommand);\n editor.commands.add('replaceImageSource', replaceImageSourceCommand);\n // `imageInsert` is an alias for backward compatibility.\n editor.commands.add('imageInsert', insertImageCommand);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagesizeattributes\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageUtils from './imageutils.js';\nimport { widthAndHeightStylesAreBothSet, getSizeValueIfInPx } from './image/utils.js';\n/**\n * This plugin enables `width` and `height` attributes in inline and block image elements.\n */\nexport default class ImageSizeAttributes extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageSizeAttributes';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n this._registerSchema();\n this._registerConverters('imageBlock');\n this._registerConverters('imageInline');\n }\n /**\n * Registers the `width` and `height` attributes for inline and block images.\n */\n _registerSchema() {\n if (this.editor.plugins.has('ImageBlockEditing')) {\n this.editor.model.schema.extend('imageBlock', { allowAttributes: ['width', 'height'] });\n }\n if (this.editor.plugins.has('ImageInlineEditing')) {\n this.editor.model.schema.extend('imageInline', { allowAttributes: ['width', 'height'] });\n }\n }\n /**\n * Registers converters for `width` and `height` attributes.\n */\n _registerConverters(imageType) {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const viewElementName = imageType === 'imageBlock' ? 'figure' : 'img';\n editor.conversion.for('upcast')\n .attributeToAttribute({\n view: {\n name: viewElementName,\n styles: {\n width: /.+/\n }\n },\n model: {\n key: 'width',\n value: (viewElement) => {\n if (widthAndHeightStylesAreBothSet(viewElement)) {\n return getSizeValueIfInPx(viewElement.getStyle('width'));\n }\n return null;\n }\n }\n })\n .attributeToAttribute({\n view: {\n name: viewElementName,\n key: 'width'\n },\n model: 'width'\n })\n .attributeToAttribute({\n view: {\n name: viewElementName,\n styles: {\n height: /.+/\n }\n },\n model: {\n key: 'height',\n value: (viewElement) => {\n if (widthAndHeightStylesAreBothSet(viewElement)) {\n return getSizeValueIfInPx(viewElement.getStyle('height'));\n }\n return null;\n }\n }\n })\n .attributeToAttribute({\n view: {\n name: viewElementName,\n key: 'height'\n },\n model: 'height'\n });\n // Dedicated converters to propagate attributes to the <img> element.\n editor.conversion.for('editingDowncast').add(dispatcher => {\n attachDowncastConverter(dispatcher, 'width', 'width', true);\n attachDowncastConverter(dispatcher, 'height', 'height', true);\n });\n editor.conversion.for('dataDowncast').add(dispatcher => {\n attachDowncastConverter(dispatcher, 'width', 'width', false);\n attachDowncastConverter(dispatcher, 'height', 'height', false);\n });\n function attachDowncastConverter(dispatcher, modelAttributeName, viewAttributeName, setRatioForInlineImage) {\n dispatcher.on(`attribute:${modelAttributeName}:${imageType}`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n const img = imageUtils.findViewImgElement(viewElement);\n if (data.attributeNewValue !== null) {\n viewWriter.setAttribute(viewAttributeName, data.attributeNewValue, img);\n }\n else {\n viewWriter.removeAttribute(viewAttributeName, img);\n }\n // Do not set aspect-ratio for pictures. See https://github.com/ckeditor/ckeditor5/issues/14579.\n if (data.item.hasAttribute('sources')) {\n return;\n }\n const isResized = data.item.hasAttribute('resizedWidth');\n // Do not set aspect ratio for inline images which are not resized (data pipeline).\n if (imageType === 'imageInline' && !isResized && !setRatioForInlineImage) {\n return;\n }\n const width = data.item.getAttribute('width');\n const height = data.item.getAttribute('height');\n if (width && height) {\n viewWriter.setStyle('aspect-ratio', `${width}/${height}`, img);\n }\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The image type command. It changes the type of a selected image, depending on the configuration.\n */\nexport default class ImageTypeCommand extends Command {\n /**\n * @inheritDoc\n *\n * @param modelElementName Model element name the command converts to.\n */\n constructor(editor, modelElementName) {\n super(editor);\n this._modelElementName = modelElementName;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = imageUtils.getClosestSelectedImageElement(this.editor.model.document.selection);\n if (this._modelElementName === 'imageBlock') {\n this.isEnabled = imageUtils.isInlineImage(element);\n }\n else {\n this.isEnabled = imageUtils.isBlockImage(element);\n }\n }\n /**\n * Executes the command and changes the type of a selected image.\n *\n * @fires execute\n * @param options.setImageSizes Specifies whether the image `width` and `height` attributes should be set automatically.\n * The default is `true`.\n * @returns An object containing references to old and new model image elements\n * (for before and after the change) so external integrations can hook into the decorated\n * `execute` event and handle this change. `null` if the type change failed.\n */\n execute(options = {}) {\n const editor = this.editor;\n const model = this.editor.model;\n const imageUtils = editor.plugins.get('ImageUtils');\n const oldElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n const attributes = Object.fromEntries(oldElement.getAttributes());\n // Don't change image type if \"src\" is missing (a broken image), unless there's \"uploadId\" set.\n // This state may happen during image upload (before it finishes) and it should be possible to change type\n // of the image in the meantime.\n if (!attributes.src && !attributes.uploadId) {\n return null;\n }\n return model.change(writer => {\n const { setImageSizes = true } = options;\n // Get all markers that contain the old image element.\n const markers = Array.from(model.markers)\n .filter(marker => marker.getRange().containsItem(oldElement));\n const newElement = imageUtils.insertImage(attributes, model.createSelection(oldElement, 'on'), this._modelElementName, { setImageSizes });\n if (!newElement) {\n return null;\n }\n const newElementRange = writer.createRangeOn(newElement);\n // Expand the previously intersecting markers' ranges to include the new image element.\n for (const marker of markers) {\n const markerRange = marker.getRange();\n // Join the survived part of the old marker range with the new element range\n // (loosely because there could be some new paragraph or the existing one might got split).\n const range = markerRange.root.rootName != '$graveyard' ?\n markerRange.getJoined(newElementRange, true) : newElementRange;\n writer.updateMarker(marker, { range });\n }\n return {\n oldElement,\n newElement\n };\n });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageplaceholder.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageplaceholder.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageplaceholder\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageUtils from '../imageutils.js';\nimport ImageLoadObserver from './imageloadobserver.js';\nimport '../../theme/imageplaceholder.css';\n/**\n * Adds support for image placeholder that is automatically removed when the image is loaded.\n */\nexport default class ImagePlaceholder extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImagePlaceholder';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n this._setupSchema();\n this._setupConversion();\n this._setupLoadListener();\n }\n /**\n * Extends model schema.\n */\n _setupSchema() {\n const schema = this.editor.model.schema;\n // Wait for ImageBlockEditing or ImageInlineEditing to register their elements first,\n // that's why doing this in afterInit() instead of init().\n if (schema.isRegistered('imageBlock')) {\n schema.extend('imageBlock', {\n allowAttributes: ['placeholder']\n });\n }\n if (schema.isRegistered('imageInline')) {\n schema.extend('imageInline', {\n allowAttributes: ['placeholder']\n });\n }\n }\n /**\n * Registers converters.\n */\n _setupConversion() {\n const editor = this.editor;\n const conversion = editor.conversion;\n const imageUtils = editor.plugins.get('ImageUtils');\n conversion.for('editingDowncast').add(dispatcher => {\n dispatcher.on('attribute:placeholder', (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n if (!data.item.is('element', 'imageBlock') && !data.item.is('element', 'imageInline')) {\n return;\n }\n conversionApi.consumable.consume(data.item, evt.name);\n const viewWriter = conversionApi.writer;\n const element = conversionApi.mapper.toViewElement(data.item);\n const img = imageUtils.findViewImgElement(element);\n if (data.attributeNewValue) {\n viewWriter.addClass('image_placeholder', img);\n viewWriter.setStyle('background-image', `url(${data.attributeNewValue})`, img);\n viewWriter.setCustomProperty('editingPipeline:doNotReuseOnce', true, img);\n }\n else {\n viewWriter.removeClass('image_placeholder', img);\n viewWriter.removeStyle('background-image', img);\n }\n });\n });\n }\n /**\n * Prepares listener for image load.\n */\n _setupLoadListener() {\n const editor = this.editor;\n const model = editor.model;\n const editing = editor.editing;\n const editingView = editing.view;\n const imageUtils = editor.plugins.get('ImageUtils');\n editingView.addObserver(ImageLoadObserver);\n this.listenTo(editingView.document, 'imageLoaded', (evt, domEvent) => {\n const imgViewElement = editingView.domConverter.mapDomToView(domEvent.target);\n if (!imgViewElement) {\n return;\n }\n const viewElement = imageUtils.getImageWidgetFromImageView(imgViewElement);\n if (!viewElement) {\n return;\n }\n const modelElement = editing.mapper.toModelElement(viewElement);\n if (!modelElement || !modelElement.hasAttribute('placeholder')) {\n return;\n }\n model.enqueueChange({ isUndoable: false }, writer => {\n writer.removeAttribute('placeholder', modelElement);\n });\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageblockediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';\nimport { UpcastWriter } from 'ckeditor5/src/engine.js';\nimport { downcastImageAttribute, downcastSrcsetAttribute, upcastImageFigure } from './converters.js';\nimport ImageEditing from './imageediting.js';\nimport ImageSizeAttributes from '../imagesizeattributes.js';\nimport ImageTypeCommand from './imagetypecommand.js';\nimport ImageUtils from '../imageutils.js';\nimport { getImgViewElementMatcher, createBlockImageViewElement, determineImageTypeForInsertionAtSelection } from './utils.js';\nimport ImagePlaceholder from './imageplaceholder.js';\n/**\n * The image block plugin.\n *\n * It registers:\n *\n * * `<imageBlock>` as a block element in the document schema, and allows `alt`, `src` and `srcset` attributes.\n * * converters for editing and data pipelines.,\n * * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeBlock'`} command that converts inline images into\n * block images.\n */\nexport default class ImageBlockEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageEditing, ImageSizeAttributes, ImageUtils, ImagePlaceholder, ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageBlockEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n // Converters 'alt' and 'srcset' are added in 'ImageEditing' plugin.\n schema.register('imageBlock', {\n inheritAllFrom: '$blockObject',\n allowAttributes: ['alt', 'src', 'srcset']\n });\n this._setupConversion();\n if (editor.plugins.has('ImageInlineEditing')) {\n editor.commands.add('imageTypeBlock', new ImageTypeCommand(this.editor, 'imageBlock'));\n this._setupClipboardIntegration();\n }\n }\n /**\n * Configures conversion pipelines to support upcasting and downcasting\n * block images (block image widgets) and their attributes.\n */\n _setupConversion() {\n const editor = this.editor;\n const t = editor.t;\n const conversion = editor.conversion;\n const imageUtils = editor.plugins.get('ImageUtils');\n conversion.for('dataDowncast')\n .elementToStructure({\n model: 'imageBlock',\n view: (modelElement, { writer }) => createBlockImageViewElement(writer)\n });\n conversion.for('editingDowncast')\n .elementToStructure({\n model: 'imageBlock',\n view: (modelElement, { writer }) => imageUtils.toImageWidget(createBlockImageViewElement(writer), writer, t('image widget'))\n });\n conversion.for('downcast')\n .add(downcastImageAttribute(imageUtils, 'imageBlock', 'src'))\n .add(downcastImageAttribute(imageUtils, 'imageBlock', 'alt'))\n .add(downcastSrcsetAttribute(imageUtils, 'imageBlock'));\n // More image related upcasts are in 'ImageEditing' plugin.\n conversion.for('upcast')\n .elementToElement({\n view: getImgViewElementMatcher(editor, 'imageBlock'),\n model: (viewImage, { writer }) => writer.createElement('imageBlock', viewImage.hasAttribute('src') ? { src: viewImage.getAttribute('src') } : undefined)\n })\n .add(upcastImageFigure(imageUtils));\n }\n /**\n * Integrates the plugin with the clipboard pipeline.\n *\n * Idea is that the feature should recognize the user's intent when an **inline** image is\n * pasted or dropped. If such an image is pasted/dropped:\n *\n * * into an empty block (e.g. an empty paragraph),\n * * on another object (e.g. some block widget).\n *\n * it gets converted into a block image on the fly. We assume this is the user's intent\n * if they decided to put their image there.\n *\n * See the `ImageInlineEditing` for the similar integration that works in the opposite direction.\n *\n * The feature also sets image `width` and `height` attributes on paste.\n */\n _setupClipboardIntegration() {\n const editor = this.editor;\n const model = editor.model;\n const editingView = editor.editing.view;\n const imageUtils = editor.plugins.get('ImageUtils');\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n this.listenTo(clipboardPipeline, 'inputTransformation', (evt, data) => {\n const docFragmentChildren = Array.from(data.content.getChildren());\n let modelRange;\n // Make sure only <img> elements are dropped or pasted. Otherwise, if there some other HTML\n // mixed up, this should be handled as a regular paste.\n if (!docFragmentChildren.every(imageUtils.isInlineImageView)) {\n return;\n }\n // When drag and dropping, data.targetRanges specifies where to drop because\n // this is usually a different place than the current model selection (the user\n // uses a drop marker to specify the drop location).\n if (data.targetRanges) {\n modelRange = editor.editing.mapper.toModelRange(data.targetRanges[0]);\n }\n // Pasting, however, always occurs at the current model selection.\n else {\n modelRange = model.document.selection.getFirstRange();\n }\n const selection = model.createSelection(modelRange);\n // Convert inline images into block images only when the currently selected block is empty\n // (e.g. an empty paragraph) or some object is selected (to replace it).\n if (determineImageTypeForInsertionAtSelection(model.schema, selection) === 'imageBlock') {\n const writer = new UpcastWriter(editingView.document);\n // Wrap <img ... /> -> <figure class=\"image\"><img .../></figure>\n const blockViewImages = docFragmentChildren.map(inlineViewImage => writer.createElement('figure', { class: 'image' }, inlineViewImage));\n data.content = writer.createDocumentFragment(blockViewImages);\n }\n });\n this.listenTo(clipboardPipeline, 'contentInsertion', (evt, data) => {\n if (data.method !== 'paste') {\n return;\n }\n model.change(writer => {\n const range = writer.createRangeIn(data.content);\n for (const item of range.getItems()) {\n if (item.is('element', 'imageBlock')) {\n imageUtils.setImageNaturalSizeAttributes(item);\n }\n }\n });\n });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageinsert.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageinsert.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageinsert/ui/imageinsertformview\n */\nimport { View, ViewCollection, submitHandler, FocusCycler, CollapsibleView } from 'ckeditor5/src/ui.js';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';\nimport '../../../theme/imageinsert.css';\n/**\n * The view displayed in the insert image dropdown.\n *\n * See {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.\n */\nexport default class ImageInsertFormView extends View {\n /**\n * Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.\n *\n * @param locale The localization services instance.\n * @param integrations An integrations object that contains components (or tokens for components) to be shown in the panel view.\n */\n constructor(locale, integrations = []) {\n super(locale);\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this._focusables = new ViewCollection();\n this.children = this.createCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n for (const view of integrations) {\n this.children.add(view);\n this._focusables.add(view);\n if (view instanceof CollapsibleView) {\n this._focusables.addMany(view.children);\n }\n }\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-image-insert-form'\n ],\n tabindex: -1\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n submitHandler({\n view: this\n });\n for (const view of this._focusables) {\n this.focusTracker.add(view.element);\n }\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n const stopPropagation = (data) => data.stopPropagation();\n // Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's\n // keystroke handler would take over the key management in the URL input. We need to prevent\n // this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible.\n this.keystrokes.set('arrowright', stopPropagation);\n this.keystrokes.set('arrowleft', stopPropagation);\n this.keystrokes.set('arrowup', stopPropagation);\n this.keystrokes.set('arrowdown', stopPropagation);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the first {@link #_focusables focusable} in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageinsert/imageinsertui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core.js';\nimport { logWarning } from 'ckeditor5/src/utils.js';\nimport { createDropdown, MenuBarMenuListItemView, MenuBarMenuListView, MenuBarMenuView, SplitButtonView } from 'ckeditor5/src/ui.js';\nimport ImageInsertFormView from './ui/imageinsertformview.js';\nimport ImageUtils from '../imageutils.js';\n/**\n * The image insert dropdown plugin.\n *\n * For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature}\n * and {@glink features/images/images-inserting Insert images via source URL} documentation.\n *\n * Adds the `'insertImage'` dropdown to the {@link module:ui/componentfactory~ComponentFactory UI component factory}\n * and also the `imageInsert` dropdown as an alias for backward compatibility.\n *\n * Adds the `'menuBar:insertImage'` sub-menu to the {@link module:ui/componentfactory~ComponentFactory UI component factory}, which is\n * by default added to the `'Insert'` menu.\n */\nexport default class ImageInsertUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageInsertUI';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * Registered integrations map.\n */\n this._integrations = new Map();\n editor.config.define('image.insert.integrations', [\n 'upload',\n 'assetManager',\n 'url'\n ]);\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const imageUtils = editor.plugins.get('ImageUtils');\n this.set('isImageSelected', false);\n this.listenTo(editor.model.document, 'change', () => {\n this.isImageSelected = imageUtils.isImage(selection.getSelectedElement());\n });\n const componentCreator = (locale) => this._createToolbarComponent(locale);\n const menuBarComponentCreator = (locale) => this._createMenuBarComponent(locale);\n // Register `insertImage` dropdown and add `imageInsert` dropdown as an alias for backward compatibility.\n editor.ui.componentFactory.add('insertImage', componentCreator);\n editor.ui.componentFactory.add('imageInsert', componentCreator);\n editor.ui.componentFactory.add('menuBar:insertImage', menuBarComponentCreator);\n }\n /**\n * Registers the insert image dropdown integration.\n */\n registerIntegration({ name, observable, buttonViewCreator, formViewCreator, menuBarButtonViewCreator, requiresForm = false }) {\n if (this._integrations.has(name)) {\n /**\n * There are two insert-image integrations registered with the same name.\n *\n * Make sure that you do not load multiple asset manager plugins.\n *\n * @error image-insert-integration-exists\n */\n logWarning('image-insert-integration-exists', { name });\n }\n this._integrations.set(name, {\n observable,\n buttonViewCreator,\n menuBarButtonViewCreator,\n formViewCreator,\n requiresForm\n });\n }\n /**\n * Creates the toolbar component.\n */\n _createToolbarComponent(locale) {\n const editor = this.editor;\n const t = locale.t;\n const integrations = this._prepareIntegrations();\n if (!integrations.length) {\n return null;\n }\n let dropdownButton;\n const firstIntegration = integrations[0];\n if (integrations.length == 1) {\n // Do not use dropdown for a single integration button (integration that does not require form view).\n if (!firstIntegration.requiresForm) {\n return firstIntegration.buttonViewCreator(true);\n }\n dropdownButton = firstIntegration.buttonViewCreator(true);\n }\n else {\n const actionButton = firstIntegration.buttonViewCreator(false);\n dropdownButton = new SplitButtonView(locale, actionButton);\n dropdownButton.tooltip = true;\n dropdownButton.bind('label').to(this, 'isImageSelected', isImageSelected => isImageSelected ?\n t('Replace image') :\n t('Insert image'));\n }\n const dropdownView = this.dropdownView = createDropdown(locale, dropdownButton);\n const observables = integrations.map(({ observable }) => typeof observable == 'function' ? observable() : observable);\n dropdownView.bind('isEnabled').toMany(observables, 'isEnabled', (...isEnabled) => (isEnabled.some(isEnabled => isEnabled)));\n dropdownView.once('change:isOpen', () => {\n const integrationViews = integrations.map(({ formViewCreator }) => formViewCreator(integrations.length == 1));\n const imageInsertFormView = new ImageInsertFormView(editor.locale, integrationViews);\n dropdownView.panelView.children.add(imageInsertFormView);\n });\n return dropdownView;\n }\n /**\n * Creates the menu bar component.\n */\n _createMenuBarComponent(locale) {\n const t = locale.t;\n const integrations = this._prepareIntegrations();\n if (!integrations.length) {\n return null;\n }\n let resultView;\n const firstIntegration = integrations[0];\n if (integrations.length == 1) {\n resultView = firstIntegration.menuBarButtonViewCreator(true);\n }\n else {\n resultView = new MenuBarMenuView(locale);\n const listView = new MenuBarMenuListView(locale);\n resultView.panelView.children.add(listView);\n resultView.buttonView.set({\n icon: icons.image,\n label: t('Image')\n });\n for (const integration of integrations) {\n const listItemView = new MenuBarMenuListItemView(locale, resultView);\n const buttonView = integration.menuBarButtonViewCreator(false);\n listItemView.children.add(buttonView);\n listView.items.add(listItemView);\n }\n }\n return resultView;\n }\n /**\n * Validates the integrations list.\n */\n _prepareIntegrations() {\n const editor = this.editor;\n const items = editor.config.get('image.insert.integrations');\n const result = [];\n if (!items.length) {\n /**\n * The insert image feature requires a list of integrations to be provided in the editor configuration.\n *\n * The default list of integrations is `upload`, `assetManager`, `url`. Those integrations are included\n * in the insert image dropdown if the given feature plugin is loaded. You should omit the `integrations`\n * configuration key to use the default set or provide a selected list of integrations that should be used.\n *\n * @error image-insert-integrations-not-specified\n */\n logWarning('image-insert-integrations-not-specified');\n return result;\n }\n for (const item of items) {\n if (!this._integrations.has(item)) {\n if (!['upload', 'assetManager', 'url'].includes(item)) {\n /**\n * The specified insert image integration name is unknown or the providing plugin is not loaded in the editor.\n *\n * @error image-insert-unknown-integration\n */\n logWarning('image-insert-unknown-integration', { item });\n }\n continue;\n }\n result.push(this._integrations.get(item));\n }\n if (!result.length) {\n /**\n * The image insert feature requires integrations to be registered by separate features.\n *\n * The `insertImage` toolbar button requires integrations to be registered by other features.\n * For example {@link module:image/imageupload~ImageUpload ImageUpload},\n * {@link module:image/imageinsert~ImageInsert ImageInsert},\n * {@link module:image/imageinsertviaurl~ImageInsertViaUrl ImageInsertViaUrl},\n * {@link module:ckbox/ckbox~CKBox CKBox}\n *\n * @error image-insert-integrations-not-registered\n */\n logWarning('image-insert-integrations-not-registered');\n }\n return result;\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./image.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./image.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageinlineediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';\nimport { UpcastWriter } from 'ckeditor5/src/engine.js';\nimport { downcastImageAttribute, downcastSrcsetAttribute } from './converters.js';\nimport ImageEditing from './imageediting.js';\nimport ImageSizeAttributes from '../imagesizeattributes.js';\nimport ImageTypeCommand from './imagetypecommand.js';\nimport ImageUtils from '../imageutils.js';\nimport { getImgViewElementMatcher, createInlineImageViewElement, determineImageTypeForInsertionAtSelection } from './utils.js';\nimport ImagePlaceholder from './imageplaceholder.js';\n/**\n * The image inline plugin.\n *\n * It registers:\n *\n * * `<imageInline>` as an inline element in the document schema, and allows `alt`, `src` and `srcset` attributes.\n * * converters for editing and data pipelines.\n * * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeInline'`} command that converts block images into\n * inline images.\n */\nexport default class ImageInlineEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageEditing, ImageSizeAttributes, ImageUtils, ImagePlaceholder, ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageInlineEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n // Converters 'alt' and 'srcset' are added in 'ImageEditing' plugin.\n schema.register('imageInline', {\n inheritAllFrom: '$inlineObject',\n allowAttributes: ['alt', 'src', 'srcset'],\n // Disallow inline images in captions (at least for now).\n // This is the best spot to do that because independent packages can introduce captions (ImageCaption, TableCaption, etc.).\n disallowIn: ['caption']\n });\n this._setupConversion();\n if (editor.plugins.has('ImageBlockEditing')) {\n editor.commands.add('imageTypeInline', new ImageTypeCommand(this.editor, 'imageInline'));\n this._setupClipboardIntegration();\n }\n }\n /**\n * Configures conversion pipelines to support upcasting and downcasting\n * inline images (inline image widgets) and their attributes.\n */\n _setupConversion() {\n const editor = this.editor;\n const t = editor.t;\n const conversion = editor.conversion;\n const imageUtils = editor.plugins.get('ImageUtils');\n conversion.for('dataDowncast')\n .elementToElement({\n model: 'imageInline',\n view: (modelElement, { writer }) => writer.createEmptyElement('img')\n });\n conversion.for('editingDowncast')\n .elementToStructure({\n model: 'imageInline',\n view: (modelElement, { writer }) => imageUtils.toImageWidget(createInlineImageViewElement(writer), writer, t('image widget'))\n });\n conversion.for('downcast')\n .add(downcastImageAttribute(imageUtils, 'imageInline', 'src'))\n .add(downcastImageAttribute(imageUtils, 'imageInline', 'alt'))\n .add(downcastSrcsetAttribute(imageUtils, 'imageInline'));\n // More image related upcasts are in 'ImageEditing' plugin.\n conversion.for('upcast')\n .elementToElement({\n view: getImgViewElementMatcher(editor, 'imageInline'),\n model: (viewImage, { writer }) => writer.createElement('imageInline', viewImage.hasAttribute('src') ? { src: viewImage.getAttribute('src') } : undefined)\n });\n }\n /**\n * Integrates the plugin with the clipboard pipeline.\n *\n * Idea is that the feature should recognize the user's intent when an **block** image is\n * pasted or dropped. If such an image is pasted/dropped into a non-empty block\n * (e.g. a paragraph with some text) it gets converted into an inline image on the fly.\n *\n * We assume this is the user's intent if they decided to put their image there.\n *\n * **Note**: If a block image has a caption, it will not be converted to an inline image\n * to avoid the confusion. Captions are added on purpose and they should never be lost\n * in the clipboard pipeline.\n *\n * See the `ImageBlockEditing` for the similar integration that works in the opposite direction.\n *\n * The feature also sets image `width` and `height` attributes when pasting.\n */\n _setupClipboardIntegration() {\n const editor = this.editor;\n const model = editor.model;\n const editingView = editor.editing.view;\n const imageUtils = editor.plugins.get('ImageUtils');\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n this.listenTo(clipboardPipeline, 'inputTransformation', (evt, data) => {\n const docFragmentChildren = Array.from(data.content.getChildren());\n let modelRange;\n // Make sure only <figure class=\"image\"></figure> elements are dropped or pasted. Otherwise, if there some other HTML\n // mixed up, this should be handled as a regular paste.\n if (!docFragmentChildren.every(imageUtils.isBlockImageView)) {\n return;\n }\n // When drag and dropping, data.targetRanges specifies where to drop because\n // this is usually a different place than the current model selection (the user\n // uses a drop marker to specify the drop location).\n if (data.targetRanges) {\n modelRange = editor.editing.mapper.toModelRange(data.targetRanges[0]);\n }\n // Pasting, however, always occurs at the current model selection.\n else {\n modelRange = model.document.selection.getFirstRange();\n }\n const selection = model.createSelection(modelRange);\n // Convert block images into inline images only when pasting or dropping into non-empty blocks\n // and when the block is not an object (e.g. pasting to replace another widget).\n if (determineImageTypeForInsertionAtSelection(model.schema, selection) === 'imageInline') {\n const writer = new UpcastWriter(editingView.document);\n // Unwrap <figure class=\"image\"><img .../></figure> -> <img ... />\n // but <figure class=\"image\"><img .../><figcaption>...</figcaption></figure> -> stays the same\n const inlineViewImages = docFragmentChildren.map(blockViewImage => {\n // If there's just one child, it can be either <img /> or <a><img></a>.\n // If there are other children than <img>, this means that the block image\n // has a caption or some other features and this kind of image should be\n // pasted/dropped without modifications.\n if (blockViewImage.childCount === 1) {\n // Pass the attributes which are present only in the <figure> to the <img>\n // (e.g. the style=\"width:10%\" attribute applied by the ImageResize plugin).\n Array.from(blockViewImage.getAttributes())\n .forEach(attribute => writer.setAttribute(...attribute, imageUtils.findViewImgElement(blockViewImage)));\n return blockViewImage.getChild(0);\n }\n else {\n return blockViewImage;\n }\n });\n data.content = writer.createDocumentFragment(inlineViewImages);\n }\n });\n this.listenTo(clipboardPipeline, 'contentInsertion', (evt, data) => {\n if (data.method !== 'paste') {\n return;\n }\n model.change(writer => {\n const range = writer.createRangeIn(data.content);\n for (const item of range.getItems()) {\n if (item.is('element', 'imageInline')) {\n imageUtils.setImageNaturalSizeAttributes(item);\n }\n }\n });\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageUtils from '../imageutils.js';\n/**\n * The image caption utilities plugin.\n */\nexport default class ImageCaptionUtils extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCaptionUtils';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * Returns the caption model element from a given image element. Returns `null` if no caption is found.\n */\n getCaptionFromImageModelElement(imageModelElement) {\n for (const node of imageModelElement.getChildren()) {\n if (!!node && node.is('element', 'caption')) {\n return node;\n }\n }\n return null;\n }\n /**\n * Returns the caption model element for a model selection. Returns `null` if the selection has no caption element ancestor.\n */\n getCaptionFromModelSelection(selection) {\n const imageUtils = this.editor.plugins.get('ImageUtils');\n const captionElement = selection.getFirstPosition().findAncestor('caption');\n if (!captionElement) {\n return null;\n }\n if (imageUtils.isBlockImage(captionElement.parent)) {\n return captionElement;\n }\n return null;\n }\n /**\n * {@link module:engine/view/matcher~Matcher} pattern. Checks if a given element is a `<figcaption>` element that is placed\n * inside the image `<figure>` element.\n * @returns Returns the object accepted by {@link module:engine/view/matcher~Matcher} or `null` if the element\n * cannot be matched.\n */\n matchImageCaptionViewElement(element) {\n const imageUtils = this.editor.plugins.get('ImageUtils');\n // Convert only captions for images.\n if (element.name == 'figcaption' && imageUtils.isBlockImageView(element.parent)) {\n return { name: true };\n }\n return null;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport ImageBlockEditing from '../image/imageblockediting.js';\n/**\n * The toggle image caption command.\n *\n * This command is registered by {@link module:image/imagecaption/imagecaptionediting~ImageCaptionEditing} as the\n * `'toggleImageCaption'` editor command.\n *\n * Executing this command:\n *\n * * either adds or removes the image caption of a selected image (depending on whether the caption is present or not),\n * * removes the image caption if the selection is anchored in one.\n *\n * ```ts\n * // Toggle the presence of the caption.\n * editor.execute( 'toggleImageCaption' );\n * ```\n *\n * **Note**: Upon executing this command, the selection will be set on the image if previously anchored in the caption element.\n *\n * **Note**: You can move the selection to the caption right away as it shows up upon executing this command by using\n * the `focusCaptionOnShow` option:\n *\n * ```ts\n * editor.execute( 'toggleImageCaption', { focusCaptionOnShow: true } );\n * ```\n */\nexport default class ToggleImageCaptionCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n const imageUtils = editor.plugins.get('ImageUtils');\n // Only block images can get captions.\n if (!editor.plugins.has(ImageBlockEditing)) {\n this.isEnabled = false;\n this.value = false;\n return;\n }\n const selection = editor.model.document.selection;\n const selectedElement = selection.getSelectedElement();\n if (!selectedElement) {\n const ancestorCaptionElement = imageCaptionUtils.getCaptionFromModelSelection(selection);\n this.isEnabled = !!ancestorCaptionElement;\n this.value = !!ancestorCaptionElement;\n return;\n }\n // Block images support captions by default but the command should also be enabled for inline\n // images because toggling the caption when one is selected should convert it into a block image.\n this.isEnabled = imageUtils.isImage(selectedElement);\n if (!this.isEnabled) {\n this.value = false;\n }\n else {\n this.value = !!imageCaptionUtils.getCaptionFromImageModelElement(selectedElement);\n }\n }\n /**\n * Executes the command.\n *\n * ```ts\n * editor.execute( 'toggleImageCaption' );\n * ```\n *\n * @param options Options for the executed command.\n * @param options.focusCaptionOnShow When true and the caption shows up, the selection will be moved into it straight away.\n * @fires execute\n */\n execute(options = {}) {\n const { focusCaptionOnShow } = options;\n this.editor.model.change(writer => {\n if (this.value) {\n this._hideImageCaption(writer);\n }\n else {\n this._showImageCaption(writer, focusCaptionOnShow);\n }\n });\n }\n /**\n * Shows the caption of the `<imageBlock>` or `<imageInline>`. Also:\n *\n * * it converts `<imageInline>` to `<imageBlock>` to show the caption,\n * * it attempts to restore the caption content from the `ImageCaptionEditing` caption registry,\n * * it moves the selection to the caption right away, it the `focusCaptionOnShow` option was set.\n */\n _showImageCaption(writer, focusCaptionOnShow) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const imageCaptionEditing = this.editor.plugins.get('ImageCaptionEditing');\n const imageUtils = this.editor.plugins.get('ImageUtils');\n let selectedImage = selection.getSelectedElement();\n const savedCaption = imageCaptionEditing._getSavedCaption(selectedImage);\n // Convert imageInline -> image first.\n if (imageUtils.isInlineImage(selectedImage)) {\n this.editor.execute('imageTypeBlock');\n // Executing the command created a new model element. Let's pick it again.\n selectedImage = selection.getSelectedElement();\n }\n // Try restoring the caption from the ImageCaptionEditing plugin storage.\n const newCaptionElement = savedCaption || writer.createElement('caption');\n writer.append(newCaptionElement, selectedImage);\n if (focusCaptionOnShow) {\n writer.setSelection(newCaptionElement, 'in');\n }\n }\n /**\n * Hides the caption of a selected image (or an image caption the selection is anchored to).\n *\n * The content of the caption is stored in the `ImageCaptionEditing` caption registry to make this\n * a reversible action.\n */\n _hideImageCaption(writer) {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const imageCaptionEditing = editor.plugins.get('ImageCaptionEditing');\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n let selectedImage = selection.getSelectedElement();\n let captionElement;\n if (selectedImage) {\n captionElement = imageCaptionUtils.getCaptionFromImageModelElement(selectedImage);\n }\n else {\n captionElement = imageCaptionUtils.getCaptionFromModelSelection(selection);\n selectedImage = captionElement.parent;\n }\n // Store the caption content so it can be restored quickly if the user changes their mind even if they toggle image<->imageInline.\n imageCaptionEditing._saveCaption(selectedImage, captionElement);\n writer.setSelection(selectedImage, 'on');\n writer.remove(captionElement);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagecaption/imagecaptionediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Element, enablePlaceholder } from 'ckeditor5/src/engine.js';\nimport { toWidgetEditable } from 'ckeditor5/src/widget.js';\nimport ToggleImageCaptionCommand from './toggleimagecaptioncommand.js';\nimport ImageUtils from '../imageutils.js';\nimport ImageCaptionUtils from './imagecaptionutils.js';\n/**\n * The image caption engine plugin. It is responsible for:\n *\n * * registering converters for the caption element,\n * * registering converters for the caption model attribute,\n * * registering the {@link module:image/imagecaption/toggleimagecaptioncommand~ToggleImageCaptionCommand `toggleImageCaption`} command.\n */\nexport default class ImageCaptionEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils, ImageCaptionUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCaptionEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._savedCaptionsMap = new WeakMap();\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n // Schema configuration.\n if (!schema.isRegistered('caption')) {\n schema.register('caption', {\n allowIn: 'imageBlock',\n allowContentOf: '$block',\n isLimit: true\n });\n }\n else {\n schema.extend('caption', {\n allowIn: 'imageBlock'\n });\n }\n editor.commands.add('toggleImageCaption', new ToggleImageCaptionCommand(this.editor));\n this._setupConversion();\n this._setupImageTypeCommandsIntegration();\n this._registerCaptionReconversion();\n }\n /**\n * Configures conversion pipelines to support upcasting and downcasting\n * image captions.\n */\n _setupConversion() {\n const editor = this.editor;\n const view = editor.editing.view;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n const t = editor.t;\n // View -> model converter for the data pipeline.\n editor.conversion.for('upcast').elementToElement({\n view: element => imageCaptionUtils.matchImageCaptionViewElement(element),\n model: 'caption'\n });\n // Model -> view converter for the data pipeline.\n editor.conversion.for('dataDowncast').elementToElement({\n model: 'caption',\n view: (modelElement, { writer }) => {\n if (!imageUtils.isBlockImage(modelElement.parent)) {\n return null;\n }\n return writer.createContainerElement('figcaption');\n }\n });\n // Model -> view converter for the editing pipeline.\n editor.conversion.for('editingDowncast').elementToElement({\n model: 'caption',\n view: (modelElement, { writer }) => {\n if (!imageUtils.isBlockImage(modelElement.parent)) {\n return null;\n }\n const figcaptionElement = writer.createEditableElement('figcaption');\n writer.setCustomProperty('imageCaption', true, figcaptionElement);\n figcaptionElement.placeholder = t('Enter image caption');\n enablePlaceholder({\n view,\n element: figcaptionElement,\n keepOnFocus: true\n });\n const imageAlt = modelElement.parent.getAttribute('alt');\n const label = imageAlt ? t('Caption for image: %0', [imageAlt]) : t('Caption for the image');\n return toWidgetEditable(figcaptionElement, writer, { label });\n }\n });\n }\n /**\n * Integrates with {@link module:image/image/imagetypecommand~ImageTypeCommand image type commands}\n * to make sure the caption is preserved when the type of an image changes so it can be restored\n * in the future if the user decides they want their caption back.\n */\n _setupImageTypeCommandsIntegration() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n const imageTypeInlineCommand = editor.commands.get('imageTypeInline');\n const imageTypeBlockCommand = editor.commands.get('imageTypeBlock');\n const handleImageTypeChange = evt => {\n // The image type command execution can be unsuccessful.\n if (!evt.return) {\n return;\n }\n const { oldElement, newElement } = evt.return;\n /* istanbul ignore if: paranoid check -- @preserve */\n if (!oldElement) {\n return;\n }\n if (imageUtils.isBlockImage(oldElement)) {\n const oldCaptionElement = imageCaptionUtils.getCaptionFromImageModelElement(oldElement);\n // If the old element was a captioned block image (the caption was visible),\n // simply save it so it can be restored.\n if (oldCaptionElement) {\n this._saveCaption(newElement, oldCaptionElement);\n return;\n }\n }\n const savedOldElementCaption = this._getSavedCaption(oldElement);\n // If either:\n //\n // * the block image didn't have a visible caption,\n // * the block image caption was hidden (and already saved),\n // * the inline image was passed\n //\n // just try to \"pass\" the saved caption from the old image to the new image\n // so it can be retrieved in the future if the user wants it back.\n if (savedOldElementCaption) {\n // Note: Since we're writing to a WeakMap, we don't bother with removing the\n // [ oldElement, savedOldElementCaption ] pair from it.\n this._saveCaption(newElement, savedOldElementCaption);\n }\n };\n // Presence of the commands depends on the Image(Inline|Block)Editing plugins loaded in the editor.\n if (imageTypeInlineCommand) {\n this.listenTo(imageTypeInlineCommand, 'execute', handleImageTypeChange, { priority: 'low' });\n }\n if (imageTypeBlockCommand) {\n this.listenTo(imageTypeBlockCommand, 'execute', handleImageTypeChange, { priority: 'low' });\n }\n }\n /**\n * Returns the saved {@link module:engine/model/element~Element#toJSON JSONified} caption\n * of an image model element.\n *\n * See {@link #_saveCaption}.\n *\n * @internal\n * @param imageModelElement The model element the caption should be returned for.\n * @returns The model caption element or `null` if there is none.\n */\n _getSavedCaption(imageModelElement) {\n const jsonObject = this._savedCaptionsMap.get(imageModelElement);\n return jsonObject ? Element.fromJSON(jsonObject) : null;\n }\n /**\n * Saves a {@link module:engine/model/element~Element#toJSON JSONified} caption for\n * an image element to allow restoring it in the future.\n *\n * A caption is saved every time it gets hidden and/or the type of an image changes. The\n * user should be able to restore it on demand.\n *\n * **Note**: The caption cannot be stored in the image model element attribute because,\n * for instance, when the model state propagates to collaborators, the attribute would get\n * lost (mainly because it does not convert to anything when the caption is hidden) and\n * the states of collaborators' models would de-synchronize causing numerous issues.\n *\n * See {@link #_getSavedCaption}.\n *\n * @internal\n * @param imageModelElement The model element the caption is saved for.\n * @param caption The caption model element to be saved.\n */\n _saveCaption(imageModelElement, caption) {\n this._savedCaptionsMap.set(imageModelElement, caption.toJSON());\n }\n /**\n * Reconverts image caption when image alt attribute changes.\n * The change of alt attribute is reflected in caption's aria-label attribute.\n */\n _registerCaptionReconversion() {\n const editor = this.editor;\n const model = editor.model;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n model.document.on('change:data', () => {\n const changes = model.document.differ.getChanges();\n for (const change of changes) {\n if (change.attributeKey !== 'alt') {\n continue;\n }\n const image = change.range.start.nodeAfter;\n if (imageUtils.isBlockImage(image)) {\n const caption = imageCaptionUtils.getCaptionFromImageModelElement(image);\n if (!caption) {\n return;\n }\n editor.editing.reconvertItem(caption);\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagecaption/imagecaptionui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core.js';\nimport { ButtonView } from 'ckeditor5/src/ui.js';\nimport ImageCaptionUtils from './imagecaptionutils.js';\n/**\n * The image caption UI plugin. It introduces the `'toggleImageCaption'` UI button.\n */\nexport default class ImageCaptionUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageCaptionUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCaptionUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n const t = editor.t;\n editor.ui.componentFactory.add('toggleImageCaption', locale => {\n const command = editor.commands.get('toggleImageCaption');\n const view = new ButtonView(locale);\n view.set({\n icon: icons.caption,\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n view.bind('label').to(command, 'value', value => value ? t('Toggle caption off') : t('Toggle caption on'));\n this.listenTo(view, 'execute', () => {\n editor.execute('toggleImageCaption', { focusCaptionOnShow: true });\n // Scroll to the selection and highlight the caption if the caption showed up.\n const modelCaptionElement = imageCaptionUtils.getCaptionFromModelSelection(editor.model.document.selection);\n if (modelCaptionElement) {\n const figcaptionElement = editor.editing.mapper.toViewElement(modelCaptionElement);\n editingView.scrollToTheSelection();\n editingView.change(writer => {\n writer.addClass('image__caption_highlighted', figcaptionElement);\n });\n }\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imagecaption.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imagecaption.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { global } from 'ckeditor5/src/utils.js';\n/**\n * Creates a regular expression used to test for image files.\n *\n * ```ts\n * const imageType = createImageTypeRegExp( [ 'png', 'jpeg', 'svg+xml', 'vnd.microsoft.icon' ] );\n *\n * console.log( 'is supported image', imageType.test( file.type ) );\n * ```\n */\nexport function createImageTypeRegExp(types) {\n // Sanitize the MIME type name which may include: \"+\", \"-\" or \".\".\n const regExpSafeNames = types.map(type => type.replace('+', '\\\\+'));\n return new RegExp(`^image\\\\/(${regExpSafeNames.join('|')})$`);\n}\n/**\n * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.\n *\n * @param image Image whose source to fetch.\n * @returns A promise which resolves when an image source is fetched and converted to a `File` instance.\n * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.\n */\nexport function fetchLocalImage(image) {\n return new Promise((resolve, reject) => {\n const imageSrc = image.getAttribute('src');\n // Fetch works asynchronously and so does not block browser UI when processing data.\n fetch(imageSrc)\n .then(resource => resource.blob())\n .then(blob => {\n const mimeType = getImageMimeType(blob, imageSrc);\n const ext = mimeType.replace('image/', '');\n const filename = `image.${ext}`;\n const file = new File([blob], filename, { type: mimeType });\n resolve(file);\n })\n .catch(err => {\n // Fetch fails only, if it can't make a request due to a network failure or if anything prevented the request\n // from completing, i.e. the Content Security Policy rules. It is not possible to detect the exact cause of failure,\n // so we are just trying the fallback solution, if general TypeError is thrown.\n return err && err.name === 'TypeError' ?\n convertLocalImageOnCanvas(imageSrc).then(resolve).catch(reject) :\n reject(err);\n });\n });\n}\n/**\n * Checks whether a given node is an image element with a local source (Base64 or blob).\n *\n * @param node The node to check.\n */\nexport function isLocalImage(imageUtils, node) {\n if (!imageUtils.isInlineImageView(node) || !node.getAttribute('src')) {\n return false;\n }\n return !!node.getAttribute('src').match(/^data:image\\/\\w+;base64,/g) ||\n !!node.getAttribute('src').match(/^blob:/g);\n}\n/**\n * Extracts an image type based on its blob representation or its source.\n * @param blob Image blob representation.\n * @param src Image `src` attribute value.\n */\nfunction getImageMimeType(blob, src) {\n if (blob.type) {\n return blob.type;\n }\n else if (src.match(/data:(image\\/\\w+);base64/)) {\n return src.match(/data:(image\\/\\w+);base64/)[1].toLowerCase();\n }\n else {\n // Fallback to 'jpeg' as common extension.\n return 'image/jpeg';\n }\n}\n/**\n * Creates a promise that converts the image local source (Base64 or blob) to a blob using canvas and resolves\n * with a `File` object.\n * @param imageSrc Image `src` attribute value.\n * @returns A promise which resolves when an image source is converted to a `File` instance.\n * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.\n */\nfunction convertLocalImageOnCanvas(imageSrc) {\n return getBlobFromCanvas(imageSrc).then(blob => {\n const mimeType = getImageMimeType(blob, imageSrc);\n const ext = mimeType.replace('image/', '');\n const filename = `image.${ext}`;\n return new File([blob], filename, { type: mimeType });\n });\n}\n/**\n * Creates a promise that resolves with a `Blob` object converted from the image source (Base64 or blob).\n * @param imageSrc Image `src` attribute value.\n */\nfunction getBlobFromCanvas(imageSrc) {\n return new Promise((resolve, reject) => {\n const image = global.document.createElement('img');\n image.addEventListener('load', () => {\n const canvas = global.document.createElement('canvas');\n canvas.width = image.width;\n canvas.height = image.height;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(image, 0, 0);\n canvas.toBlob(blob => blob ? resolve(blob) : reject());\n });\n image.addEventListener('error', () => reject());\n image.src = imageSrc;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageupload/imageuploadui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core.js';\nimport { FileDialogButtonView, MenuBarMenuListItemFileDialogButtonView } from 'ckeditor5/src/ui.js';\nimport { createImageTypeRegExp } from './utils.js';\n/**\n * The image upload button plugin.\n *\n * For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature} documentation.\n *\n * Adds the `'uploadImage'` button to the {@link module:ui/componentfactory~ComponentFactory UI component factory}\n * and also the `imageUpload` button as an alias for backward compatibility.\n *\n * Adds the `'menuBar:uploadImage'` menu button to the {@link module:ui/componentfactory~ComponentFactory UI component factory}.\n *\n * It also integrates with the `insertImage` toolbar component and `menuBar:insertImage` menu component, which are the default components\n * through which image upload is available.\n */\nexport default class ImageUploadUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageUploadUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Setup `uploadImage` button and add `imageUpload` button as an alias for backward compatibility.\n editor.ui.componentFactory.add('uploadImage', () => this._createToolbarButton());\n editor.ui.componentFactory.add('imageUpload', () => this._createToolbarButton());\n editor.ui.componentFactory.add('menuBar:uploadImage', () => this._createMenuBarButton('standalone'));\n if (editor.plugins.has('ImageInsertUI')) {\n editor.plugins.get('ImageInsertUI').registerIntegration({\n name: 'upload',\n observable: () => editor.commands.get('uploadImage'),\n buttonViewCreator: () => this._createToolbarButton(),\n formViewCreator: () => this._createDropdownButton(),\n menuBarButtonViewCreator: isOnly => this._createMenuBarButton(isOnly ? 'insertOnly' : 'insertNested')\n });\n }\n }\n /**\n * Creates the base for various kinds of the button component provided by this feature.\n */\n _createButton(ButtonClass) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get('uploadImage');\n const imageTypes = editor.config.get('image.upload.types');\n const imageTypesRegExp = createImageTypeRegExp(imageTypes);\n const view = new ButtonClass(editor.locale);\n const t = locale.t;\n view.set({\n acceptedType: imageTypes.map(type => `image/${type}`).join(','),\n allowMultipleFiles: true,\n label: t('Upload from computer'),\n icon: icons.imageUpload\n });\n view.bind('isEnabled').to(command);\n view.on('done', (evt, files) => {\n const imagesToUpload = Array.from(files).filter(file => imageTypesRegExp.test(file.type));\n if (imagesToUpload.length) {\n editor.execute('uploadImage', { file: imagesToUpload });\n editor.editing.view.focus();\n }\n });\n return view;\n }\n /**\n * Creates a simple toolbar button, with an icon and a tooltip.\n */\n _createToolbarButton() {\n const t = this.editor.locale.t;\n const imageInsertUI = this.editor.plugins.get('ImageInsertUI');\n const uploadImageCommand = this.editor.commands.get('uploadImage');\n const button = this._createButton(FileDialogButtonView);\n button.tooltip = true;\n button.bind('label').to(imageInsertUI, 'isImageSelected', uploadImageCommand, 'isAccessAllowed', (isImageSelected, isAccessAllowed) => {\n if (!isAccessAllowed) {\n return t('You have no image upload permissions.');\n }\n return isImageSelected ? t('Replace image from computer') : t('Upload image from computer');\n });\n return button;\n }\n /**\n * Creates a button for the dropdown view, with an icon, text and no tooltip.\n */\n _createDropdownButton() {\n const t = this.editor.locale.t;\n const imageInsertUI = this.editor.plugins.get('ImageInsertUI');\n const button = this._createButton(FileDialogButtonView);\n button.withText = true;\n button.bind('label').to(imageInsertUI, 'isImageSelected', isImageSelected => isImageSelected ? t('Replace from computer') : t('Upload from computer'));\n button.on('execute', () => {\n imageInsertUI.dropdownView.isOpen = false;\n });\n return button;\n }\n /**\n * Creates a button for the menu bar.\n */\n _createMenuBarButton(type) {\n const t = this.editor.locale.t;\n const button = this._createButton(MenuBarMenuListItemFileDialogButtonView);\n button.withText = true;\n switch (type) {\n case 'standalone':\n button.label = t('Image from computer');\n break;\n case 'insertOnly':\n button.label = t('Image');\n break;\n case 'insertNested':\n button.label = t('From computer');\n break;\n }\n return button;\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadprogress.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadprogress.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadicon.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadicon.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadloader.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadloader.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageupload/imageuploadprogress\n */\n/* globals setTimeout */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { FileRepository } from 'ckeditor5/src/upload.js';\nimport '../../theme/imageuploadprogress.css';\nimport '../../theme/imageuploadicon.css';\nimport '../../theme/imageuploadloader.css';\n/**\n * The image upload progress plugin.\n * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.\n */\nexport default class ImageUploadProgress extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageUploadProgress';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * This method is called each time the image `uploadStatus` attribute is changed.\n *\n * @param evt An object containing information about the fired event.\n * @param data Additional information about the change.\n */\n this.uploadStatusChange = (evt, data, conversionApi) => {\n const editor = this.editor;\n const modelImage = data.item;\n const uploadId = modelImage.getAttribute('uploadId');\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const imageUtils = editor.plugins.get('ImageUtils');\n const fileRepository = editor.plugins.get(FileRepository);\n const status = uploadId ? data.attributeNewValue : null;\n const placeholder = this.placeholder;\n const viewFigure = editor.editing.mapper.toViewElement(modelImage);\n const viewWriter = conversionApi.writer;\n if (status == 'reading') {\n // Start \"appearing\" effect and show placeholder with infinite progress bar on the top\n // while image is read from disk.\n _startAppearEffect(viewFigure, viewWriter);\n _showPlaceholder(imageUtils, placeholder, viewFigure, viewWriter);\n return;\n }\n // Show progress bar on the top of the image when image is uploading.\n if (status == 'uploading') {\n const loader = fileRepository.loaders.get(uploadId);\n // Start appear effect if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.\n _startAppearEffect(viewFigure, viewWriter);\n if (!loader) {\n // There is no loader associated with uploadId - this means that image came from external changes.\n // In such cases we still want to show the placeholder until image is fully uploaded.\n // Show placeholder if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.\n _showPlaceholder(imageUtils, placeholder, viewFigure, viewWriter);\n }\n else {\n // Hide placeholder and initialize progress bar showing upload progress.\n _hidePlaceholder(viewFigure, viewWriter);\n _showProgressBar(viewFigure, viewWriter, loader, editor.editing.view);\n _displayLocalImage(imageUtils, viewFigure, viewWriter, loader);\n }\n return;\n }\n if (status == 'complete' && fileRepository.loaders.get(uploadId)) {\n _showCompleteIcon(viewFigure, viewWriter, editor.editing.view);\n }\n // Clean up.\n _hideProgressBar(viewFigure, viewWriter);\n _hidePlaceholder(viewFigure, viewWriter);\n _stopAppearEffect(viewFigure, viewWriter);\n };\n this.placeholder = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Upload status change - update image's view according to that status.\n if (editor.plugins.has('ImageBlockEditing')) {\n editor.editing.downcastDispatcher.on('attribute:uploadStatus:imageBlock', this.uploadStatusChange);\n }\n if (editor.plugins.has('ImageInlineEditing')) {\n editor.editing.downcastDispatcher.on('attribute:uploadStatus:imageInline', this.uploadStatusChange);\n }\n }\n}\n/**\n * Adds ck-appear class to the image figure if one is not already applied.\n */\nfunction _startAppearEffect(viewFigure, writer) {\n if (!viewFigure.hasClass('ck-appear')) {\n writer.addClass('ck-appear', viewFigure);\n }\n}\n/**\n * Removes ck-appear class to the image figure if one is not already removed.\n */\nfunction _stopAppearEffect(viewFigure, writer) {\n writer.removeClass('ck-appear', viewFigure);\n}\n/**\n * Shows placeholder together with infinite progress bar on given image figure.\n */\nfunction _showPlaceholder(imageUtils, placeholder, viewFigure, writer) {\n if (!viewFigure.hasClass('ck-image-upload-placeholder')) {\n writer.addClass('ck-image-upload-placeholder', viewFigure);\n }\n const viewImg = imageUtils.findViewImgElement(viewFigure);\n if (viewImg.getAttribute('src') !== placeholder) {\n writer.setAttribute('src', placeholder, viewImg);\n }\n if (!_getUIElement(viewFigure, 'placeholder')) {\n writer.insert(writer.createPositionAfter(viewImg), _createPlaceholder(writer));\n }\n}\n/**\n * Removes placeholder together with infinite progress bar on given image figure.\n */\nfunction _hidePlaceholder(viewFigure, writer) {\n if (viewFigure.hasClass('ck-image-upload-placeholder')) {\n writer.removeClass('ck-image-upload-placeholder', viewFigure);\n }\n _removeUIElement(viewFigure, writer, 'placeholder');\n}\n/**\n * Shows progress bar displaying upload progress.\n * Attaches it to the file loader to update when upload percentace is changed.\n */\nfunction _showProgressBar(viewFigure, writer, loader, view) {\n const progressBar = _createProgressBar(writer);\n writer.insert(writer.createPositionAt(viewFigure, 'end'), progressBar);\n // Update progress bar width when uploadedPercent is changed.\n loader.on('change:uploadedPercent', (evt, name, value) => {\n view.change(writer => {\n writer.setStyle('width', value + '%', progressBar);\n });\n });\n}\n/**\n * Hides upload progress bar.\n */\nfunction _hideProgressBar(viewFigure, writer) {\n _removeUIElement(viewFigure, writer, 'progressBar');\n}\n/**\n * Shows complete icon and hides after a certain amount of time.\n */\nfunction _showCompleteIcon(viewFigure, writer, view) {\n const completeIcon = writer.createUIElement('div', { class: 'ck-image-upload-complete-icon' });\n writer.insert(writer.createPositionAt(viewFigure, 'end'), completeIcon);\n setTimeout(() => {\n view.change(writer => writer.remove(writer.createRangeOn(completeIcon)));\n }, 3000);\n}\n/**\n * Create progress bar element using {@link module:engine/view/uielement~UIElement}.\n */\nfunction _createProgressBar(writer) {\n const progressBar = writer.createUIElement('div', { class: 'ck-progress-bar' });\n writer.setCustomProperty('progressBar', true, progressBar);\n return progressBar;\n}\n/**\n * Create placeholder element using {@link module:engine/view/uielement~UIElement}.\n */\nfunction _createPlaceholder(writer) {\n const placeholder = writer.createUIElement('div', { class: 'ck-upload-placeholder-loader' });\n writer.setCustomProperty('placeholder', true, placeholder);\n return placeholder;\n}\n/**\n * Returns {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.\n * Returns `undefined` if element is not found.\n */\nfunction _getUIElement(imageFigure, uniqueProperty) {\n for (const child of imageFigure.getChildren()) {\n if (child.getCustomProperty(uniqueProperty)) {\n return child;\n }\n }\n}\n/**\n * Removes {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.\n */\nfunction _removeUIElement(viewFigure, writer, uniqueProperty) {\n const element = _getUIElement(viewFigure, uniqueProperty);\n if (element) {\n writer.remove(writer.createRangeOn(element));\n }\n}\n/**\n * Displays local data from file loader.\n */\nfunction _displayLocalImage(imageUtils, viewFigure, writer, loader) {\n if (loader.data) {\n const viewImg = imageUtils.findViewImgElement(viewFigure);\n writer.setAttribute('src', loader.data, viewImg);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { FileRepository } from 'ckeditor5/src/upload.js';\nimport { Command } from 'ckeditor5/src/core.js';\nimport { toArray } from 'ckeditor5/src/utils.js';\n/**\n * @module image/imageupload/uploadimagecommand\n */\n/**\n * The upload image command.\n *\n * The command is registered by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin as `uploadImage`\n * and it is also available via aliased `imageUpload` name.\n *\n * In order to upload an image at the current selection position\n * (according to the {@link module:widget/utils~findOptimalInsertionRange} algorithm),\n * execute the command and pass the native image file instance:\n *\n * ```ts\n * this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {\n * \t// Assuming that only images were pasted:\n * \tconst images = Array.from( data.dataTransfer.files );\n *\n * \t// Upload the first image:\n * \teditor.execute( 'uploadImage', { file: images[ 0 ] } );\n * } );\n * ```\n *\n * It is also possible to insert multiple images at once:\n *\n * ```ts\n * editor.execute( 'uploadImage', {\n * \tfile: [\n * \t\tfile1,\n * \t\tfile2\n * \t]\n * } );\n * ```\n */\nexport default class UploadImageCommand extends Command {\n /**\n * Creates an instance of the `imageUlpoad` command. When executed, the command upload one of\n * the currently selected image from computer.\n *\n * @param editor The editor instance.\n */\n constructor(editor) {\n super(editor);\n this.set('isAccessAllowed', true);\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const selectedElement = editor.model.document.selection.getSelectedElement();\n // TODO: This needs refactoring.\n this.isEnabled = imageUtils.isImageAllowed() || imageUtils.isImage(selectedElement);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options Options for the executed command.\n * @param options.file The image file or an array of image files to upload.\n */\n execute(options) {\n const files = toArray(options.file);\n const selection = this.editor.model.document.selection;\n const imageUtils = this.editor.plugins.get('ImageUtils');\n // In case of multiple files, each file (starting from the 2nd) will be inserted at a position that\n // follows the previous one. That will move the selection and, to stay on the safe side and make sure\n // all images inherit the same selection attributes, they are collected beforehand.\n //\n // Applying these attributes ensures, for instance, that inserting an (inline) image into a link does\n // not split that link but preserves its continuity.\n //\n // Note: Selection attributes that do not make sense for images will be filtered out by insertImage() anyway.\n const selectionAttributes = Object.fromEntries(selection.getAttributes());\n files.forEach((file, index) => {\n const selectedElement = selection.getSelectedElement();\n // Inserting of an inline image replace the selected element and make a selection on the inserted image.\n // Therefore inserting multiple inline images requires creating position after each element.\n if (index && selectedElement && imageUtils.isImage(selectedElement)) {\n const position = this.editor.model.createPositionAfter(selectedElement);\n this._uploadImage(file, selectionAttributes, position);\n }\n else {\n this._uploadImage(file, selectionAttributes);\n }\n });\n }\n /**\n * Handles uploading single file.\n */\n _uploadImage(file, attributes, position) {\n const editor = this.editor;\n const fileRepository = editor.plugins.get(FileRepository);\n const loader = fileRepository.createLoader(file);\n const imageUtils = editor.plugins.get('ImageUtils');\n // Do not throw when upload adapter is not set. FileRepository will log an error anyway.\n if (!loader) {\n return;\n }\n imageUtils.insertImage({ ...attributes, uploadId: loader.id }, position);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageupload/imageuploadediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { UpcastWriter } from 'ckeditor5/src/engine.js';\nimport { Notification } from 'ckeditor5/src/ui.js';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';\nimport { FileRepository } from 'ckeditor5/src/upload.js';\nimport { env } from 'ckeditor5/src/utils.js';\nimport ImageUtils from '../imageutils.js';\nimport UploadImageCommand from './uploadimagecommand.js';\nimport { fetchLocalImage, isLocalImage } from '../../src/imageupload/utils.js';\nimport { createImageTypeRegExp } from './utils.js';\n/**\n * The editing part of the image upload feature. It registers the `'uploadImage'` command\n * and the `imageUpload` command as an aliased name.\n *\n * When an image is uploaded, it fires the {@link ~ImageUploadEditing#event:uploadComplete `uploadComplete`} event\n * that allows adding custom attributes to the {@link module:engine/model/element~Element image element}.\n */\nexport default class ImageUploadEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FileRepository, Notification, ClipboardPipeline, ImageUtils];\n }\n static get pluginName() {\n return 'ImageUploadEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('image', {\n upload: {\n types: ['jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff']\n }\n });\n this._uploadImageElements = new Map();\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const doc = editor.model.document;\n const conversion = editor.conversion;\n const fileRepository = editor.plugins.get(FileRepository);\n const imageUtils = editor.plugins.get('ImageUtils');\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n const imageTypes = createImageTypeRegExp(editor.config.get('image.upload.types'));\n const uploadImageCommand = new UploadImageCommand(editor);\n // Register `uploadImage` command and add `imageUpload` command as an alias for backward compatibility.\n editor.commands.add('uploadImage', uploadImageCommand);\n editor.commands.add('imageUpload', uploadImageCommand);\n // Register upcast converter for uploadId.\n conversion.for('upcast')\n .attributeToAttribute({\n view: {\n name: 'img',\n key: 'uploadId'\n },\n model: 'uploadId'\n });\n // Handle pasted images.\n // For every image file, a new file loader is created and a placeholder image is\n // inserted into the content. Then, those images are uploaded once they appear in the model\n // (see Document#change listener below).\n this.listenTo(editor.editing.view.document, 'clipboardInput', (evt, data) => {\n // Skip if non empty HTML data is included.\n // https://github.com/ckeditor/ckeditor5-upload/issues/68\n if (isHtmlIncluded(data.dataTransfer)) {\n return;\n }\n const images = Array.from(data.dataTransfer.files).filter(file => {\n // See https://github.com/ckeditor/ckeditor5-image/pull/254.\n if (!file) {\n return false;\n }\n return imageTypes.test(file.type);\n });\n if (!images.length) {\n return;\n }\n evt.stop();\n editor.model.change(writer => {\n // Set selection to paste target.\n if (data.targetRanges) {\n writer.setSelection(data.targetRanges.map(viewRange => editor.editing.mapper.toModelRange(viewRange)));\n }\n editor.execute('uploadImage', { file: images });\n });\n const uploadImageCommand = editor.commands.get('uploadImage');\n if (!uploadImageCommand.isAccessAllowed) {\n const notification = editor.plugins.get('Notification');\n const t = editor.locale.t;\n // eslint-disable-next-line max-len\n notification.showWarning(t('You have no image upload permissions.'), {\n namespace: 'image'\n });\n }\n });\n // Handle HTML pasted with images with base64 or blob sources.\n // For every image file, a new file loader is created and a placeholder image is\n // inserted into the content. Then, those images are uploaded once they appear in the model\n // (see Document#change listener below).\n this.listenTo(clipboardPipeline, 'inputTransformation', (evt, data) => {\n const fetchableImages = Array.from(editor.editing.view.createRangeIn(data.content))\n .map(value => value.item)\n .filter(viewElement => isLocalImage(imageUtils, viewElement) &&\n !viewElement.getAttribute('uploadProcessed'))\n .map(viewElement => { return { promise: fetchLocalImage(viewElement), imageElement: viewElement }; });\n if (!fetchableImages.length) {\n return;\n }\n const writer = new UpcastWriter(editor.editing.view.document);\n for (const fetchableImage of fetchableImages) {\n // Set attribute marking that the image was processed already.\n writer.setAttribute('uploadProcessed', true, fetchableImage.imageElement);\n const loader = fileRepository.createLoader(fetchableImage.promise);\n if (loader) {\n writer.setAttribute('src', '', fetchableImage.imageElement);\n writer.setAttribute('uploadId', loader.id, fetchableImage.imageElement);\n }\n }\n });\n // Prevents from the browser redirecting to the dropped image.\n editor.editing.view.document.on('dragover', (evt, data) => {\n data.preventDefault();\n });\n // Upload placeholder images that appeared in the model.\n doc.on('change', () => {\n // Note: Reversing changes to start with insertions and only then handle removals. If it was the other way around,\n // loaders for **all** images that land in the $graveyard would abort while in fact only those that were **not** replaced\n // by other images should be aborted.\n const changes = doc.differ.getChanges({ includeChangesInGraveyard: true }).reverse();\n const insertedImagesIds = new Set();\n for (const entry of changes) {\n if (entry.type == 'insert' && entry.name != '$text') {\n const item = entry.position.nodeAfter;\n const isInsertedInGraveyard = entry.position.root.rootName == '$graveyard';\n for (const imageElement of getImagesFromChangeItem(editor, item)) {\n // Check if the image element still has upload id.\n const uploadId = imageElement.getAttribute('uploadId');\n if (!uploadId) {\n continue;\n }\n // Check if the image is loaded on this client.\n const loader = fileRepository.loaders.get(uploadId);\n if (!loader) {\n continue;\n }\n if (isInsertedInGraveyard) {\n // If the image was inserted to the graveyard for good (**not** replaced by another image),\n // only then abort the loading process.\n if (!insertedImagesIds.has(uploadId)) {\n loader.abort();\n }\n }\n else {\n // Remember the upload id of the inserted image. If it acted as a replacement for another\n // image (which landed in the $graveyard), the related loader will not be aborted because\n // this is still the same image upload.\n insertedImagesIds.add(uploadId);\n // Keep the mapping between the upload ID and the image model element so the upload\n // can later resolve in the context of the correct model element. The model element could\n // change for the same upload if one image was replaced by another (e.g. image type was changed),\n // so this may also replace an existing mapping.\n this._uploadImageElements.set(uploadId, imageElement);\n if (loader.status == 'idle') {\n // If the image was inserted into content and has not been loaded yet, start loading it.\n this._readAndUpload(loader);\n }\n }\n }\n }\n }\n });\n // Set the default handler for feeding the image element with `src` and `srcset` attributes.\n // Also set the natural `width` and `height` attributes (if not already set).\n this.on('uploadComplete', (evt, { imageElement, data }) => {\n const urls = data.urls ? data.urls : data;\n this.editor.model.change(writer => {\n writer.setAttribute('src', urls.default, imageElement);\n this._parseAndSetSrcsetAttributeOnImage(urls, imageElement, writer);\n imageUtils.setImageNaturalSizeAttributes(imageElement);\n });\n }, { priority: 'low' });\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const schema = this.editor.model.schema;\n // Setup schema to allow uploadId and uploadStatus for images.\n // Wait for ImageBlockEditing or ImageInlineEditing to register their elements first,\n // that's why doing this in afterInit() instead of init().\n if (this.editor.plugins.has('ImageBlockEditing')) {\n schema.extend('imageBlock', {\n allowAttributes: ['uploadId', 'uploadStatus']\n });\n }\n if (this.editor.plugins.has('ImageInlineEditing')) {\n schema.extend('imageInline', {\n allowAttributes: ['uploadId', 'uploadStatus']\n });\n }\n }\n /**\n * Reads and uploads an image.\n *\n * The image is read from the disk and as a Base64-encoded string it is set temporarily to\n * `image[src]`. When the image is successfully uploaded, the temporary data is replaced with the target\n * image's URL (the URL to the uploaded image on the server).\n */\n _readAndUpload(loader) {\n const editor = this.editor;\n const model = editor.model;\n const t = editor.locale.t;\n const fileRepository = editor.plugins.get(FileRepository);\n const notification = editor.plugins.get(Notification);\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageUploadElements = this._uploadImageElements;\n model.enqueueChange({ isUndoable: false }, writer => {\n writer.setAttribute('uploadStatus', 'reading', imageUploadElements.get(loader.id));\n });\n return loader.read()\n .then(() => {\n const promise = loader.upload();\n const imageElement = imageUploadElements.get(loader.id);\n // Force re–paint in Safari. Without it, the image will display with a wrong size.\n // https://github.com/ckeditor/ckeditor5/issues/1975\n /* istanbul ignore next -- @preserve */\n if (env.isSafari) {\n const viewFigure = editor.editing.mapper.toViewElement(imageElement);\n const viewImg = imageUtils.findViewImgElement(viewFigure);\n editor.editing.view.once('render', () => {\n // Early returns just to be safe. There might be some code ran\n // in between the outer scope and this callback.\n if (!viewImg.parent) {\n return;\n }\n const domFigure = editor.editing.view.domConverter.mapViewToDom(viewImg.parent);\n if (!domFigure) {\n return;\n }\n const originalDisplay = domFigure.style.display;\n domFigure.style.display = 'none';\n // Make sure this line will never be removed during minification for having \"no effect\".\n domFigure._ckHack = domFigure.offsetHeight;\n domFigure.style.display = originalDisplay;\n });\n }\n if (editor.ui) {\n editor.ui.ariaLiveAnnouncer.announce(t('Uploading image'));\n }\n model.enqueueChange({ isUndoable: false }, writer => {\n writer.setAttribute('uploadStatus', 'uploading', imageElement);\n });\n return promise;\n })\n .then(data => {\n model.enqueueChange({ isUndoable: false }, writer => {\n const imageElement = imageUploadElements.get(loader.id);\n writer.setAttribute('uploadStatus', 'complete', imageElement);\n if (editor.ui) {\n editor.ui.ariaLiveAnnouncer.announce(t('Image upload complete'));\n }\n this.fire('uploadComplete', { data, imageElement });\n });\n clean();\n })\n .catch(error => {\n if (editor.ui) {\n editor.ui.ariaLiveAnnouncer.announce(t('Error during image upload'));\n }\n // If status is not 'error' nor 'aborted' - throw error because it means that something else went wrong,\n // it might be generic error and it would be real pain to find what is going on.\n if (loader.status !== 'error' && loader.status !== 'aborted') {\n throw error;\n }\n // Might be 'aborted'.\n if (loader.status == 'error' && error) {\n notification.showWarning(error, {\n title: t('Upload failed'),\n namespace: 'upload'\n });\n }\n // Permanently remove image from insertion batch.\n model.enqueueChange({ isUndoable: false }, writer => {\n writer.remove(imageUploadElements.get(loader.id));\n });\n clean();\n });\n function clean() {\n model.enqueueChange({ isUndoable: false }, writer => {\n const imageElement = imageUploadElements.get(loader.id);\n writer.removeAttribute('uploadId', imageElement);\n writer.removeAttribute('uploadStatus', imageElement);\n imageUploadElements.delete(loader.id);\n });\n fileRepository.destroyLoader(loader);\n }\n }\n /**\n * Creates the `srcset` attribute based on a given file upload response and sets it as an attribute to a specific image element.\n *\n * @param data Data object from which `srcset` will be created.\n * @param image The image element on which the `srcset` attribute will be set.\n */\n _parseAndSetSrcsetAttributeOnImage(data, image, writer) {\n // Srcset attribute for responsive images support.\n let maxWidth = 0;\n const srcsetAttribute = Object.keys(data)\n // Filter out keys that are not integers.\n .filter(key => {\n const width = parseInt(key, 10);\n if (!isNaN(width)) {\n maxWidth = Math.max(maxWidth, width);\n return true;\n }\n })\n // Convert each key to srcset entry.\n .map(key => `${data[key]} ${key}w`)\n // Join all entries.\n .join(', ');\n if (srcsetAttribute != '') {\n const attributes = {\n srcset: srcsetAttribute\n };\n if (!image.hasAttribute('width') && !image.hasAttribute('height')) {\n attributes.width = maxWidth;\n }\n writer.setAttributes(attributes, image);\n }\n }\n}\n/**\n * Returns `true` if non-empty `text/html` is included in the data transfer.\n */\nexport function isHtmlIncluded(dataTransfer) {\n return Array.from(dataTransfer.types).includes('text/html') && dataTransfer.getData('text/html') !== '';\n}\nfunction getImagesFromChangeItem(editor, item) {\n const imageUtils = editor.plugins.get('ImageUtils');\n return Array.from(editor.model.createRangeOn(item))\n .filter(value => imageUtils.isImage(value.item))\n .map(value => value.item);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageupload\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageUploadUI from './imageupload/imageuploadui.js';\nimport ImageUploadProgress from './imageupload/imageuploadprogress.js';\nimport ImageUploadEditing from './imageupload/imageuploadediting.js';\n/**\n * The image upload plugin.\n *\n * For a detailed overview, check the {@glink features/images/image-upload/image-upload image upload feature} documentation.\n *\n * This plugin does not do anything directly, but it loads a set of specific plugins to enable image uploading:\n *\n * * {@link module:image/imageupload/imageuploadediting~ImageUploadEditing},\n * * {@link module:image/imageupload/imageuploadui~ImageUploadUI},\n * * {@link module:image/imageupload/imageuploadprogress~ImageUploadProgress}.\n */\nexport default class ImageUpload extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageUpload';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUploadEditing, ImageUploadUI, ImageUploadProgress];\n }\n}\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n","import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n","import baseEach from './_baseEach.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nexport default baseMap;\n","import arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseMap from './_baseMap.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n}\n\nexport default map;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize/resizeimagecommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The resize image command. Currently, it only supports the width attribute.\n */\nexport default class ResizeImageCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = imageUtils.getClosestSelectedImageElement(editor.model.document.selection);\n this.isEnabled = !!element;\n if (!element || !element.hasAttribute('resizedWidth')) {\n this.value = null;\n }\n else {\n this.value = {\n width: element.getAttribute('resizedWidth'),\n height: null\n };\n }\n }\n /**\n * Executes the command.\n *\n * ```ts\n * // Sets the width to 50%:\n * editor.execute( 'resizeImage', { width: '50%' } );\n *\n * // Removes the width attribute:\n * editor.execute( 'resizeImage', { width: null } );\n * ```\n *\n * @param options\n * @param options.width The new width of the image.\n * @fires execute\n */\n execute(options) {\n const editor = this.editor;\n const model = editor.model;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n this.value = {\n width: options.width,\n height: null\n };\n if (imageElement) {\n model.change(writer => {\n writer.setAttribute('resizedWidth', options.width, imageElement);\n writer.removeAttribute('resizedHeight', imageElement);\n imageUtils.setImageNaturalSizeAttributes(imageElement);\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageUtils from '../imageutils.js';\nimport ResizeImageCommand from './resizeimagecommand.js';\nimport { widthAndHeightStylesAreBothSet } from '../image/utils.js';\n/**\n * The image resize editing feature.\n *\n * It adds the ability to resize each image using handles or manually by\n * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.\n */\nexport default class ImageResizeEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageResizeEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('image', {\n resizeUnit: '%',\n resizeOptions: [\n {\n name: 'resizeImage:original',\n value: null,\n icon: 'original'\n },\n {\n name: 'resizeImage:custom',\n value: 'custom',\n icon: 'custom'\n },\n {\n name: 'resizeImage:25',\n value: '25',\n icon: 'small'\n },\n {\n name: 'resizeImage:50',\n value: '50',\n icon: 'medium'\n },\n {\n name: 'resizeImage:75',\n value: '75',\n icon: 'large'\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const resizeImageCommand = new ResizeImageCommand(editor);\n this._registerConverters('imageBlock');\n this._registerConverters('imageInline');\n // Register `resizeImage` command and add `imageResize` command as an alias for backward compatibility.\n editor.commands.add('resizeImage', resizeImageCommand);\n editor.commands.add('imageResize', resizeImageCommand);\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n this._registerSchema();\n }\n _registerSchema() {\n if (this.editor.plugins.has('ImageBlockEditing')) {\n this.editor.model.schema.extend('imageBlock', { allowAttributes: ['resizedWidth', 'resizedHeight'] });\n }\n if (this.editor.plugins.has('ImageInlineEditing')) {\n this.editor.model.schema.extend('imageInline', { allowAttributes: ['resizedWidth', 'resizedHeight'] });\n }\n }\n /**\n * Registers image resize converters.\n *\n * @param imageType The type of the image.\n */\n _registerConverters(imageType) {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n // Dedicated converter to propagate image's attribute to the img tag.\n editor.conversion.for('downcast').add(dispatcher => dispatcher.on(`attribute:resizedWidth:${imageType}`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewImg = conversionApi.mapper.toViewElement(data.item);\n if (data.attributeNewValue !== null) {\n viewWriter.setStyle('width', data.attributeNewValue, viewImg);\n viewWriter.addClass('image_resized', viewImg);\n }\n else {\n viewWriter.removeStyle('width', viewImg);\n viewWriter.removeClass('image_resized', viewImg);\n }\n }));\n editor.conversion.for('dataDowncast').attributeToAttribute({\n model: {\n name: imageType,\n key: 'resizedHeight'\n },\n view: modelAttributeValue => ({\n key: 'style',\n value: {\n 'height': modelAttributeValue\n }\n })\n });\n editor.conversion.for('editingDowncast').add(dispatcher => dispatcher.on(`attribute:resizedHeight:${imageType}`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewImg = conversionApi.mapper.toViewElement(data.item);\n const target = imageType === 'imageInline' ? imageUtils.findViewImgElement(viewImg) : viewImg;\n if (data.attributeNewValue !== null) {\n viewWriter.setStyle('height', data.attributeNewValue, target);\n }\n else {\n viewWriter.removeStyle('height', target);\n }\n }));\n editor.conversion.for('upcast')\n .attributeToAttribute({\n view: {\n name: imageType === 'imageBlock' ? 'figure' : 'img',\n styles: {\n width: /.+/\n }\n },\n model: {\n key: 'resizedWidth',\n value: (viewElement) => {\n if (widthAndHeightStylesAreBothSet(viewElement)) {\n return null;\n }\n return viewElement.getStyle('width');\n }\n }\n });\n editor.conversion.for('upcast')\n .attributeToAttribute({\n view: {\n name: imageType === 'imageBlock' ? 'figure' : 'img',\n styles: {\n height: /.+/\n }\n },\n model: {\n key: 'resizedHeight',\n value: (viewElement) => {\n if (widthAndHeightStylesAreBothSet(viewElement)) {\n return null;\n }\n return viewElement.getStyle('height');\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize/imageresizebuttons\n */\nimport { map } from 'lodash-es';\nimport { Plugin, icons } from 'ckeditor5/src/core.js';\nimport { ButtonView, DropdownButtonView, ViewModel, createDropdown, addListToDropdown } from 'ckeditor5/src/ui.js';\nimport { CKEditorError, Collection } from 'ckeditor5/src/utils.js';\nimport ImageResizeEditing from './imageresizeediting.js';\nconst RESIZE_ICONS = /* #__PURE__ */ (() => ({\n small: icons.objectSizeSmall,\n medium: icons.objectSizeMedium,\n large: icons.objectSizeLarge,\n custom: icons.objectSizeCustom,\n original: icons.objectSizeFull\n}))();\n/**\n * The image resize buttons plugin.\n *\n * It adds a possibility to resize images using the toolbar dropdown or individual buttons, depending on the plugin configuration.\n */\nexport default class ImageResizeButtons extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageResizeEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageResizeButtons';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._resizeUnit = editor.config.get('image.resizeUnit');\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const options = editor.config.get('image.resizeOptions');\n const command = editor.commands.get('resizeImage');\n this.bind('isEnabled').to(command);\n for (const option of options) {\n this._registerImageResizeButton(option);\n }\n this._registerImageResizeDropdown(options);\n }\n /**\n * A helper function that creates a standalone button component for the plugin.\n *\n * @param resizeOption A model of the resize option.\n */\n _registerImageResizeButton(option) {\n const editor = this.editor;\n const { name, value, icon } = option;\n editor.ui.componentFactory.add(name, locale => {\n const button = new ButtonView(locale);\n const command = editor.commands.get('resizeImage');\n const labelText = this._getOptionLabelValue(option, true);\n if (!RESIZE_ICONS[icon]) {\n /**\n * When configuring {@link module:image/imageconfig~ImageConfig#resizeOptions `config.image.resizeOptions`} for standalone\n * buttons, a valid `icon` token must be set for each option.\n *\n * See all valid options described in the\n * {@link module:image/imageconfig~ImageResizeOption plugin configuration}.\n *\n * @error imageresizebuttons-missing-icon\n * @param option Invalid image resize option.\n */\n throw new CKEditorError('imageresizebuttons-missing-icon', editor, option);\n }\n button.set({\n // Use the `label` property for a verbose description (because of ARIA).\n label: labelText,\n icon: RESIZE_ICONS[icon],\n tooltip: labelText,\n isToggleable: true\n });\n // Bind button to the command.\n button.bind('isEnabled').to(this);\n if (editor.plugins.has('ImageCustomResizeUI') && isCustomImageResizeOption(option)) {\n const customResizeUI = editor.plugins.get('ImageCustomResizeUI');\n this.listenTo(button, 'execute', () => {\n customResizeUI._showForm(this._resizeUnit);\n });\n }\n else {\n const optionValueWithUnit = value ? value + this._resizeUnit : null;\n button.bind('isOn').to(command, 'value', getIsOnButtonCallback(optionValueWithUnit));\n this.listenTo(button, 'execute', () => {\n editor.execute('resizeImage', { width: optionValueWithUnit });\n });\n }\n return button;\n });\n }\n /**\n * A helper function that creates a dropdown component for the plugin containing all the resize options defined in\n * the editor configuration.\n *\n * @param options An array of configured options.\n */\n _registerImageResizeDropdown(options) {\n const editor = this.editor;\n const t = editor.t;\n const originalSizeOption = options.find(option => !option.value);\n const componentCreator = (locale) => {\n const command = editor.commands.get('resizeImage');\n const dropdownView = createDropdown(locale, DropdownButtonView);\n const dropdownButton = dropdownView.buttonView;\n const accessibleLabel = t('Resize image');\n dropdownButton.set({\n tooltip: accessibleLabel,\n commandValue: originalSizeOption.value,\n icon: RESIZE_ICONS.medium,\n isToggleable: true,\n label: this._getOptionLabelValue(originalSizeOption),\n withText: true,\n class: 'ck-resize-image-button',\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined\n });\n dropdownButton.bind('label').to(command, 'value', commandValue => {\n if (commandValue && commandValue.width) {\n return commandValue.width;\n }\n else {\n return this._getOptionLabelValue(originalSizeOption);\n }\n });\n dropdownView.bind('isEnabled').to(this);\n addListToDropdown(dropdownView, () => this._getResizeDropdownListItemDefinitions(options, command), {\n ariaLabel: t('Image resize list'),\n role: 'menu'\n });\n // Execute command when an item from the dropdown is selected.\n this.listenTo(dropdownView, 'execute', evt => {\n if ('onClick' in evt.source) {\n evt.source.onClick();\n }\n else {\n editor.execute(evt.source.commandName, { width: evt.source.commandValue });\n editor.editing.view.focus();\n }\n });\n return dropdownView;\n };\n // Register `resizeImage` dropdown and add `imageResize` dropdown as an alias for backward compatibility.\n editor.ui.componentFactory.add('resizeImage', componentCreator);\n editor.ui.componentFactory.add('imageResize', componentCreator);\n }\n /**\n * A helper function for creating an option label value string.\n *\n * @param option A resize option object.\n * @param forTooltip An optional flag for creating a tooltip label.\n * @returns A user-defined label combined from the numeric value and the resize unit or the default label\n * for reset options (`Original`).\n */\n _getOptionLabelValue(option, forTooltip = false) {\n const t = this.editor.t;\n if (option.label) {\n return option.label;\n }\n else if (forTooltip) {\n if (isCustomImageResizeOption(option)) {\n return t('Custom image size');\n }\n else if (option.value) {\n return t('Resize image to %0', option.value + this._resizeUnit);\n }\n else {\n return t('Resize image to the original size');\n }\n }\n else {\n if (isCustomImageResizeOption(option)) {\n return t('Custom');\n }\n else if (option.value) {\n return option.value + this._resizeUnit;\n }\n else {\n return t('Original');\n }\n }\n }\n /**\n * A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.\n *\n * @param options The resize options.\n * @param command The resize image command.\n * @returns Dropdown item definitions.\n */\n _getResizeDropdownListItemDefinitions(options, command) {\n const { editor } = this;\n const itemDefinitions = new Collection();\n const optionsWithSerializedValues = options.map(option => {\n if (isCustomImageResizeOption(option)) {\n return {\n ...option,\n valueWithUnits: 'custom'\n };\n }\n if (!option.value) {\n return {\n ...option,\n valueWithUnits: null\n };\n }\n return {\n ...option,\n valueWithUnits: `${option.value}${this._resizeUnit}`\n };\n });\n for (const option of optionsWithSerializedValues) {\n let definition = null;\n if (editor.plugins.has('ImageCustomResizeUI') && isCustomImageResizeOption(option)) {\n const customResizeUI = editor.plugins.get('ImageCustomResizeUI');\n definition = {\n type: 'button',\n model: new ViewModel({\n label: this._getOptionLabelValue(option),\n role: 'menuitemradio',\n withText: true,\n icon: null,\n onClick: () => {\n customResizeUI._showForm(this._resizeUnit);\n }\n })\n };\n const allDropdownValues = map(optionsWithSerializedValues, 'valueWithUnits');\n definition.model.bind('isOn').to(command, 'value', getIsOnCustomButtonCallback(allDropdownValues));\n }\n else {\n definition = {\n type: 'button',\n model: new ViewModel({\n commandName: 'resizeImage',\n commandValue: option.valueWithUnits,\n label: this._getOptionLabelValue(option),\n role: 'menuitemradio',\n withText: true,\n icon: null\n })\n };\n definition.model.bind('isOn').to(command, 'value', getIsOnButtonCallback(option.valueWithUnits));\n }\n definition.model.bind('isEnabled').to(command, 'isEnabled');\n itemDefinitions.add(definition);\n }\n return itemDefinitions;\n }\n}\n/**\n * A helper that checks if provided option triggers custom resize balloon.\n */\nfunction isCustomImageResizeOption(option) {\n return option.value === 'custom';\n}\n/**\n * A helper function for setting the `isOn` state of buttons in value bindings.\n */\nfunction getIsOnButtonCallback(value) {\n return (commandValue) => {\n const objectCommandValue = commandValue;\n if (value === null && objectCommandValue === value) {\n return true;\n }\n return objectCommandValue !== null && objectCommandValue.width === value;\n };\n}\n/**\n * A helper function for setting the `isOn` state of custom size button in value bindings.\n */\nfunction getIsOnCustomButtonCallback(allDropdownValues) {\n return (commandValue) => !allDropdownValues.some(dropdownValue => getIsOnButtonCallback(dropdownValue)(commandValue));\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { WidgetResize } from 'ckeditor5/src/widget.js';\nimport ImageUtils from '../imageutils.js';\nimport ImageLoadObserver from '../image/imageloadobserver.js';\nconst RESIZABLE_IMAGES_CSS_SELECTOR = 'figure.image.ck-widget > img,' +\n 'figure.image.ck-widget > picture > img,' +\n 'figure.image.ck-widget > a > img,' +\n 'figure.image.ck-widget > a > picture > img,' +\n 'span.image-inline.ck-widget > img,' +\n 'span.image-inline.ck-widget > picture > img';\nconst RESIZED_IMAGE_CLASS = 'image_resized';\n/**\n * The image resize by handles feature.\n *\n * It adds the ability to resize each image using handles or manually by\n * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.\n */\nexport default class ImageResizeHandles extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetResize, ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageResizeHandles';\n }\n /**\n * @inheritDoc\n */\n init() {\n const command = this.editor.commands.get('resizeImage');\n this.bind('isEnabled').to(command);\n this._setupResizerCreator();\n }\n /**\n * Attaches the listeners responsible for creating a resizer for each image, except for images inside the HTML embed preview.\n */\n _setupResizerCreator() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const imageUtils = editor.plugins.get('ImageUtils');\n editingView.addObserver(ImageLoadObserver);\n this.listenTo(editingView.document, 'imageLoaded', (evt, domEvent) => {\n // The resizer must be attached only to images loaded by the `ImageInsert`, `ImageUpload` or `LinkImage` plugins.\n if (!domEvent.target.matches(RESIZABLE_IMAGES_CSS_SELECTOR)) {\n return;\n }\n const domConverter = editor.editing.view.domConverter;\n const imageView = domConverter.domToView(domEvent.target);\n const widgetView = imageUtils.getImageWidgetFromImageView(imageView);\n let resizer = this.editor.plugins.get(WidgetResize).getResizerByViewElement(widgetView);\n if (resizer) {\n // There are rare cases when the image will be triggered multiple times for the same widget, e.g. when\n // the image's source was changed after upload (https://github.com/ckeditor/ckeditor5/pull/8108#issuecomment-708302992).\n resizer.redraw();\n return;\n }\n const mapper = editor.editing.mapper;\n const imageModel = mapper.toModelElement(widgetView);\n resizer = editor.plugins\n .get(WidgetResize)\n .attachTo({\n unit: editor.config.get('image.resizeUnit'),\n modelElement: imageModel,\n viewElement: widgetView,\n editor,\n getHandleHost(domWidgetElement) {\n return domWidgetElement.querySelector('img');\n },\n getResizeHost() {\n return domConverter.mapViewToDom(mapper.toViewElement(imageModel));\n },\n isCentered() {\n const imageStyle = imageModel.getAttribute('imageStyle');\n return imageStyle == 'alignCenter';\n },\n onCommit(newValue) {\n // Get rid of the CSS class in case the command execution that follows is unsuccessful\n // (e.g. Track Changes can override it and the new dimensions will not apply). Otherwise,\n // the presence of the class and the absence of the width style will cause it to take 100%\n // of the horizontal space.\n editingView.change(writer => {\n writer.removeClass(RESIZED_IMAGE_CLASS, widgetView);\n });\n editor.execute('resizeImage', { width: newValue });\n }\n });\n resizer.on('updateSize', () => {\n if (!widgetView.hasClass(RESIZED_IMAGE_CLASS)) {\n editingView.change(writer => {\n writer.addClass(RESIZED_IMAGE_CLASS, widgetView);\n });\n }\n const target = imageModel.name === 'imageInline' ? imageView : widgetView;\n if (target.getStyle('height')) {\n editingView.change(writer => {\n writer.removeStyle('height', target);\n });\n }\n });\n resizer.bind('isEnabled').to(this);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize/utils/tryparsedimensionwithunit\n */\n/**\n * Parses provided string with dimension value and returns extracted numeric value and unit.\n *\n * \t* If non-string dimension is passed then `null` value is returned.\n * \t* If unit is missing then `null` is returned.\n * \t* If numeric value part of string is not a number then `null` is returned.\n *\n * Example:\n * \t`\"222px\"` => `{ value: 222, unit: \"px\" }`\n *\t`\"99%\"` => `{ value: 99, unit: \"%\" }`\n\n * @param dimension Unsafe string with dimension.\n * @returns Parsed dimension with extracted numeric value and units.\n */\nexport function tryParseDimensionWithUnit(dimension) {\n if (!dimension) {\n return null;\n }\n const [, rawValue, unit] = dimension.trim().match(/([.,\\d]+)(%|px)$/) || [];\n const parsedValue = Number.parseFloat(rawValue);\n if (Number.isNaN(parsedValue)) {\n return null;\n }\n return {\n value: parsedValue,\n unit\n };\n}\n/**\n * Converts dimension between `px` -> `%` and `%` -> `px`.\n *\n * @param parentDimensionPx\tDimension of parent element that contains measured element.\n * @param dimension Measured element dimension.\n * @returns Casted dimension.\n */\nexport function tryCastDimensionsToUnit(parentDimensionPx, dimension, targetUnit) {\n // \"%\" -> \"px\" conversion\n if (targetUnit === 'px') {\n return {\n value: dimension.value,\n unit: 'px'\n };\n }\n // \"px\" -> \"%\" conversion\n return {\n value: dimension.value / parentDimensionPx * 100,\n unit: '%'\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Finds model, view and DOM element for selected image element. Returns `null` if there is no image selected.\n *\n * @param editor Editor instance.\n */\nexport function getSelectedImageEditorNodes(editor) {\n const { editing } = editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageModelElement = imageUtils.getClosestSelectedImageElement(editor.model.document.selection);\n if (!imageModelElement) {\n return null;\n }\n const imageViewElement = editing.mapper.toViewElement(imageModelElement);\n const imageDOMElement = editing.view.domConverter.mapViewToDom(imageViewElement);\n return {\n model: imageModelElement,\n view: imageViewElement,\n dom: imageDOMElement\n };\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imagecustomresizeform.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imagecustomresizeform.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize/ui/imagecustomresizeformview\n */\nimport { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, createLabeledInputNumber, submitHandler } from 'ckeditor5/src/ui.js';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';\nimport { icons } from 'ckeditor5/src/core.js';\nimport '../../../theme/imagecustomresizeform.css';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\n/**\n * The ImageCustomResizeFormView class.\n */\nexport default class ImageCustomResizeFormView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale, unit, validators) {\n super(locale);\n const t = this.locale.t;\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.unit = unit;\n this.labeledInput = this._createLabeledInputView();\n this.saveButtonView = this._createButton(t('Save'), icons.check, 'ck-button-save');\n this.saveButtonView.type = 'submit';\n this.cancelButtonView = this._createButton(t('Cancel'), icons.cancel, 'ck-button-cancel', 'cancel');\n this._focusables = new ViewCollection();\n this._validators = validators;\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-image-custom-resize-form',\n 'ck-responsive-form'\n ],\n // https://github.com/ckeditor/ckeditor5-image/issues/40\n tabindex: '-1'\n },\n children: [\n this.labeledInput,\n this.saveButtonView,\n this.cancelButtonView\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.keystrokes.listenTo(this.element);\n submitHandler({ view: this });\n [this.labeledInput, this.saveButtonView, this.cancelButtonView]\n .forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Creates the button view.\n *\n * @param label The button label\n * @param icon The button's icon.\n * @param className The additional button CSS class name.\n * @param eventName The event name that the ButtonView#execute event will be delegated to.\n * @returns The button view instance.\n */\n _createButton(label, icon, className, eventName) {\n const button = new ButtonView(this.locale);\n button.set({\n label,\n icon,\n tooltip: true\n });\n button.extendTemplate({\n attributes: {\n class: className\n }\n });\n if (eventName) {\n button.delegate('execute').to(this, eventName);\n }\n return button;\n }\n /**\n * Creates an input with a label.\n *\n * @returns Labeled field view instance.\n */\n _createLabeledInputView() {\n const t = this.locale.t;\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputNumber);\n labeledInput.label = t('Resize image (in %0)', this.unit);\n labeledInput.fieldView.set({\n step: 0.1\n });\n return labeledInput;\n }\n /**\n * Validates the form and returns `false` when some fields are invalid.\n */\n isValid() {\n this.resetFormStatus();\n for (const validator of this._validators) {\n const errorText = validator(this);\n // One error per field is enough.\n if (errorText) {\n // Apply updated error.\n this.labeledInput.errorText = errorText;\n return false;\n }\n }\n return true;\n }\n /**\n * Cleans up the supplementary error and information text of the {@link #labeledInput}\n * bringing them back to the state when the form has been displayed for the first time.\n *\n * See {@link #isValid}.\n */\n resetFormStatus() {\n this.labeledInput.errorText = null;\n }\n /**\n * The native DOM `value` of the input element of {@link #labeledInput}.\n */\n get rawSize() {\n const { element } = this.labeledInput.fieldView;\n if (!element) {\n return null;\n }\n return element.value;\n }\n /**\n * Get numeric value of size. Returns `null` if value of size input element in {@link #labeledInput}.is not a number.\n */\n get parsedSize() {\n const { rawSize } = this;\n if (rawSize === null) {\n return null;\n }\n const parsed = Number.parseFloat(rawSize);\n if (Number.isNaN(parsed)) {\n return null;\n }\n return parsed;\n }\n /**\n * Returns serialized image input size with unit.\n * Returns `null` if value of size input element in {@link #labeledInput}.is not a number.\n */\n get sizeWithUnits() {\n const { parsedSize, unit } = this;\n if (parsedSize === null) {\n return null;\n }\n return `${parsedSize}${unit}`;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize/imagecustomresizeui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ContextualBalloon, clickOutsideHandler, CssTransitionDisablerMixin } from 'ckeditor5/src/ui.js';\nimport { getBalloonPositionData } from '../image/ui/utils.js';\nimport { getSelectedImageWidthInUnits } from './utils/getselectedimagewidthinunits.js';\nimport ImageCustomResizeFormView from './ui/imagecustomresizeformview.js';\nimport { getSelectedImagePossibleResizeRange } from './utils/getselectedimagepossibleresizerange.js';\n/**\n * The custom resize image UI plugin.\n *\n * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.\n */\nexport default class ImageCustomResizeUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCustomResizeUI';\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).\n if (this._form) {\n this._form.destroy();\n }\n }\n /**\n * Creates the {@link module:image/imageresize/ui/imagecustomresizeformview~ImageCustomResizeFormView}\n * form.\n */\n _createForm(unit) {\n const editor = this.editor;\n this._balloon = this.editor.plugins.get('ContextualBalloon');\n this._form = new (CssTransitionDisablerMixin(ImageCustomResizeFormView))(editor.locale, unit, getFormValidators(editor));\n // Render the form so its #element is available for clickOutsideHandler.\n this._form.render();\n this.listenTo(this._form, 'submit', () => {\n if (this._form.isValid()) {\n editor.execute('resizeImage', {\n width: this._form.sizeWithUnits\n });\n this._hideForm(true);\n }\n });\n // Update balloon position when form error label is added .\n this.listenTo(this._form.labeledInput, 'change:errorText', () => {\n editor.ui.update();\n });\n this.listenTo(this._form, 'cancel', () => {\n this._hideForm(true);\n });\n // Close the form on Esc key press.\n this._form.keystrokes.set('Esc', (data, cancel) => {\n this._hideForm(true);\n cancel();\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: this._form,\n activator: () => this._isVisible,\n contextElements: () => [this._balloon.view.element],\n callback: () => this._hideForm()\n });\n }\n /**\n * Shows the {@link #_form} in the {@link #_balloon}.\n *\n * @internal\n */\n _showForm(unit) {\n if (this._isVisible) {\n return;\n }\n if (!this._form) {\n this._createForm(unit);\n }\n const editor = this.editor;\n const labeledInput = this._form.labeledInput;\n this._form.disableCssTransitions();\n this._form.resetFormStatus();\n if (!this._isInBalloon) {\n this._balloon.add({\n view: this._form,\n position: getBalloonPositionData(editor)\n });\n }\n // Make sure that each time the panel shows up, the field remains in sync with the value of\n // the command. If the user typed in the input, then canceled the balloon (`labeledInput#value`\n // stays unaltered) and re-opened it without changing the value of the command, they would see the\n // old value instead of the actual value of the command.\n const currentParsedWidth = getSelectedImageWidthInUnits(editor, unit);\n const initialInputValue = currentParsedWidth ? currentParsedWidth.value.toFixed(1) : '';\n const possibleRange = getSelectedImagePossibleResizeRange(editor, unit);\n labeledInput.fieldView.value = labeledInput.fieldView.element.value = initialInputValue;\n if (possibleRange) {\n Object.assign(labeledInput.fieldView, {\n min: possibleRange.lower.toFixed(1),\n max: Math.ceil(possibleRange.upper).toFixed(1)\n });\n }\n this._form.labeledInput.fieldView.select();\n this._form.enableCssTransitions();\n }\n /**\n * Removes the {@link #_form} from the {@link #_balloon}.\n *\n * @param focusEditable Controls whether the editing view is focused afterwards.\n */\n _hideForm(focusEditable = false) {\n if (!this._isInBalloon) {\n return;\n }\n // Blur the input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n if (this._form.focusTracker.isFocused) {\n this._form.saveButtonView.focus();\n }\n this._balloon.remove(this._form);\n if (focusEditable) {\n this.editor.editing.view.focus();\n }\n }\n /**\n * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.\n */\n get _isVisible() {\n return !!this._balloon && this._balloon.visibleView === this._form;\n }\n /**\n * Returns `true` when the {@link #_form} is in the {@link #_balloon}.\n */\n get _isInBalloon() {\n return !!this._balloon && this._balloon.hasView(this._form);\n }\n}\n/**\n * Returns image resize form validation callbacks.\n *\n * @param editor Editor instance.\n */\nfunction getFormValidators(editor) {\n const t = editor.t;\n return [\n form => {\n if (form.rawSize.trim() === '') {\n return t('The value must not be empty.');\n }\n if (form.parsedSize === null) {\n return t('The value should be a plain number.');\n }\n }\n ];\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize/utils/getselectedimagewidthinunits\n */\nimport { Rect } from 'ckeditor5/src/utils.js';\nimport { calculateResizeHostAncestorWidth } from 'ckeditor5/src/widget.js';\nimport { tryCastDimensionsToUnit, tryParseDimensionWithUnit } from './tryparsedimensionwithunit.js';\nimport { getSelectedImageEditorNodes } from './getselectedimageeditornodes.js';\n/**\n * Returns image width in specified units. It is width of image after resize.\n *\n * \t* If image is not selected or command is disabled then `null` will be returned.\n * \t* If image is not fully loaded (and it is impossible to determine its natural size) then `null` will be returned.\n *\t* If `targetUnit` percentage is passed then it will return width percentage of image related to its accessors.\n *\n * @param editor Editor instance.\n * @param targetUnit Unit in which dimension will be returned.\n * @returns Parsed image width after resize (with unit).\n */\nexport function getSelectedImageWidthInUnits(editor, targetUnit) {\n const imageNodes = getSelectedImageEditorNodes(editor);\n if (!imageNodes) {\n return null;\n }\n const parsedResizedWidth = tryParseDimensionWithUnit(imageNodes.model.getAttribute('resizedWidth') || null);\n if (!parsedResizedWidth) {\n return null;\n }\n if (parsedResizedWidth.unit === targetUnit) {\n return parsedResizedWidth;\n }\n const imageParentWidthPx = calculateResizeHostAncestorWidth(imageNodes.dom);\n const imageHolderDimension = {\n unit: 'px',\n value: new Rect(imageNodes.dom).width\n };\n return tryCastDimensionsToUnit(imageParentWidthPx, imageHolderDimension, targetUnit);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { calculateResizeHostAncestorWidth } from 'ckeditor5/src/widget.js';\nimport { getSelectedImageEditorNodes } from './getselectedimageeditornodes.js';\nimport { tryCastDimensionsToUnit, tryParseDimensionWithUnit } from './tryparsedimensionwithunit.js';\n/**\n * Returns min and max value of resize image in specified unit.\n *\n * @param editor Editor instance.\n * @param targetUnit Unit in which dimension will be returned.\n * @returns Possible resize range in numeric form.\n */\nexport function getSelectedImagePossibleResizeRange(editor, targetUnit) {\n const imageNodes = getSelectedImageEditorNodes(editor);\n if (!imageNodes) {\n return null;\n }\n const imageParentWidthPx = calculateResizeHostAncestorWidth(imageNodes.dom);\n const minimumImageWidth = tryParseDimensionWithUnit(window.getComputedStyle(imageNodes.dom).minWidth) || {\n value: 1,\n unit: 'px'\n };\n const lower = Math.max(0.1, tryCastDimensionsToUnit(imageParentWidthPx, minimumImageWidth, targetUnit).value);\n const upper = targetUnit === 'px' ? imageParentWidthPx : 100;\n return {\n unit: targetUnit,\n lower,\n upper\n };\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageresize.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageresize.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The image style command. It is used to apply {@link module:image/imageconfig~ImageStyleConfig#options image style option}\n * to a selected image.\n *\n * **Note**: Executing this command may change the image model element if the desired style requires an image of a different\n * type. See {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute} to learn more.\n */\nexport default class ImageStyleCommand extends Command {\n /**\n * Creates an instance of the image style command. When executed, the command applies one of\n * {@link module:image/imageconfig~ImageStyleConfig#options style options} to the currently selected image.\n *\n * @param editor The editor instance.\n * @param styles The style options that this command supports.\n */\n constructor(editor, styles) {\n super(editor);\n this._defaultStyles = {\n imageBlock: false,\n imageInline: false\n };\n this._styles = new Map(styles.map(style => {\n if (style.isDefault) {\n for (const modelElementName of style.modelElements) {\n this._defaultStyles[modelElementName] = style.name;\n }\n }\n return [style.name, style];\n }));\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = imageUtils.getClosestSelectedImageElement(this.editor.model.document.selection);\n this.isEnabled = !!element;\n if (!this.isEnabled) {\n this.value = false;\n }\n else if (element.hasAttribute('imageStyle')) {\n this.value = element.getAttribute('imageStyle');\n }\n else {\n this.value = this._defaultStyles[element.name];\n }\n }\n /**\n * Executes the command and applies the style to the currently selected image:\n *\n * ```ts\n * editor.execute( 'imageStyle', { value: 'side' } );\n * ```\n *\n * **Note**: Executing this command may change the image model element if the desired style requires an image\n * of a different type. Learn more about {@link module:image/imageconfig~ImageStyleOptionDefinition#modelElements model element}\n * configuration for the style option.\n *\n * @param options.value The name of the style (as configured in {@link module:image/imageconfig~ImageStyleConfig#options}).\n * @param options.setImageSizes Specifies whether the image `width` and `height` attributes should be set automatically.\n * The default is `true`.\n * @fires execute\n */\n execute(options = {}) {\n const editor = this.editor;\n const model = editor.model;\n const imageUtils = editor.plugins.get('ImageUtils');\n model.change(writer => {\n const requestedStyle = options.value;\n const { setImageSizes = true } = options;\n let imageElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n // Change the image type if a style requires it.\n if (requestedStyle && this.shouldConvertImageType(requestedStyle, imageElement)) {\n this.editor.execute(imageUtils.isBlockImage(imageElement) ? 'imageTypeInline' : 'imageTypeBlock', { setImageSizes });\n // Update the imageElement to the newly created image.\n imageElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n }\n // Default style means that there is no `imageStyle` attribute in the model.\n // https://github.com/ckeditor/ckeditor5-image/issues/147\n if (!requestedStyle || this._styles.get(requestedStyle).isDefault) {\n writer.removeAttribute('imageStyle', imageElement);\n }\n else {\n writer.setAttribute('imageStyle', requestedStyle, imageElement);\n }\n if (setImageSizes) {\n imageUtils.setImageNaturalSizeAttributes(imageElement);\n }\n });\n }\n /**\n * Returns `true` if requested style change would trigger the image type change.\n *\n * @param requestedStyle The name of the style (as configured in {@link module:image/imageconfig~ImageStyleConfig#options}).\n * @param imageElement The image model element.\n */\n shouldConvertImageType(requestedStyle, imageElement) {\n const supportedTypes = this._styles.get(requestedStyle).modelElements;\n return !supportedTypes.includes(imageElement.name);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagestyle/utils\n */\nimport { icons } from 'ckeditor5/src/core.js';\nimport { logWarning } from 'ckeditor5/src/utils.js';\n/**\n * Default image style options provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles}\n * configuration.\n *\n * There are available 5 styles focused on formatting:\n *\n * * **`'alignLeft'`** aligns the inline or block image to the left and wraps it with the text using the `image-style-align-left` class,\n * * **`'alignRight'`** aligns the inline or block image to the right and wraps it with the text using the `image-style-align-right` class,\n * * **`'alignCenter'`** centers the block image using the `image-style-align-center` class,\n * * **`'alignBlockLeft'`** aligns the block image to the left using the `image-style-block-align-left` class,\n * * **`'alignBlockRight'`** aligns the block image to the right using the `image-style-block-align-right` class,\n *\n * and 3 semantic styles:\n *\n * * **`'inline'`** is an inline image without any CSS class,\n * * **`'block'`** is a block image without any CSS class,\n * * **`'side'`** is a block image styled with the `image-style-side` CSS class.\n */\nexport const DEFAULT_OPTIONS = {\n // This style represents an image placed in the line of text.\n get inline() {\n return {\n name: 'inline',\n title: 'In line',\n icon: icons.objectInline,\n modelElements: ['imageInline'],\n isDefault: true\n };\n },\n // This style represents an image aligned to the left and wrapped with text.\n get alignLeft() {\n return {\n name: 'alignLeft',\n title: 'Left aligned image',\n icon: icons.objectLeft,\n modelElements: ['imageBlock', 'imageInline'],\n className: 'image-style-align-left'\n };\n },\n // This style represents an image aligned to the left.\n get alignBlockLeft() {\n return {\n name: 'alignBlockLeft',\n title: 'Left aligned image',\n icon: icons.objectBlockLeft,\n modelElements: ['imageBlock'],\n className: 'image-style-block-align-left'\n };\n },\n // This style represents a centered image.\n get alignCenter() {\n return {\n name: 'alignCenter',\n title: 'Centered image',\n icon: icons.objectCenter,\n modelElements: ['imageBlock'],\n className: 'image-style-align-center'\n };\n },\n // This style represents an image aligned to the right and wrapped with text.\n get alignRight() {\n return {\n name: 'alignRight',\n title: 'Right aligned image',\n icon: icons.objectRight,\n modelElements: ['imageBlock', 'imageInline'],\n className: 'image-style-align-right'\n };\n },\n // This style represents an image aligned to the right.\n get alignBlockRight() {\n return {\n name: 'alignBlockRight',\n title: 'Right aligned image',\n icon: icons.objectBlockRight,\n modelElements: ['imageBlock'],\n className: 'image-style-block-align-right'\n };\n },\n // This option is equal to the situation when no style is applied.\n get block() {\n return {\n name: 'block',\n title: 'Centered image',\n icon: icons.objectCenter,\n modelElements: ['imageBlock'],\n isDefault: true\n };\n },\n // This represents a side image.\n get side() {\n return {\n name: 'side',\n title: 'Side image',\n icon: icons.objectRight,\n modelElements: ['imageBlock'],\n className: 'image-style-side'\n };\n }\n};\n/**\n * Default image style icons provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles}\n * configuration.\n *\n * See {@link module:image/imageconfig~ImageStyleOptionDefinition#icon} to learn more.\n *\n * There are 7 default icons available: `'full'`, `'left'`, `'inlineLeft'`, `'center'`, `'right'`, `'inlineRight'`, and `'inline'`.\n */\nexport const DEFAULT_ICONS = /* #__PURE__ */ (() => ({\n full: icons.objectFullWidth,\n left: icons.objectBlockLeft,\n right: icons.objectBlockRight,\n center: icons.objectCenter,\n inlineLeft: icons.objectLeft,\n inlineRight: icons.objectRight,\n inline: icons.objectInline\n}))();\n/**\n * Default drop-downs provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#toolbar}\n * configuration. The drop-downs are containers for the {@link module:image/imageconfig~ImageStyleConfig#options image style options}.\n *\n * If both of the `ImageEditing` plugins are loaded, there are 2 predefined drop-downs available:\n *\n * * **`'imageStyle:wrapText'`**, which contains the `alignLeft` and `alignRight` options, that is,\n * those that wraps the text around the image,\n * * **`'imageStyle:breakText'`**, which contains the `alignBlockLeft`, `alignCenter` and `alignBlockRight` options, that is,\n * those that breaks the text around the image.\n */\nexport const DEFAULT_DROPDOWN_DEFINITIONS = [{\n name: 'imageStyle:wrapText',\n title: 'Wrap text',\n defaultItem: 'imageStyle:alignLeft',\n items: ['imageStyle:alignLeft', 'imageStyle:alignRight']\n }, {\n name: 'imageStyle:breakText',\n title: 'Break text',\n defaultItem: 'imageStyle:block',\n items: ['imageStyle:alignBlockLeft', 'imageStyle:block', 'imageStyle:alignBlockRight']\n }];\n/**\n * Returns a list of the normalized and validated image style options.\n *\n * @param config\n * @param config.isInlinePluginLoaded\n * Determines whether the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin has been loaded.\n * @param config.isBlockPluginLoaded\n * Determines whether the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin has been loaded.\n * @param config.configuredStyles\n * The image styles configuration provided in the image styles {@link module:image/imageconfig~ImageConfig#styles configuration}\n * as a default or custom value.\n * @returns\n * * Each of options contains a complete icon markup.\n * * The image style options not supported by any of the loaded plugins are filtered out.\n */\nfunction normalizeStyles(config) {\n const configuredStyles = config.configuredStyles.options || [];\n const styles = configuredStyles\n .map(arrangement => normalizeDefinition(arrangement))\n .filter(arrangement => isValidOption(arrangement, config));\n return styles;\n}\n/**\n * Returns the default image styles configuration depending on the loaded image editing plugins.\n *\n * @param isInlinePluginLoaded\n * Determines whether the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin has been loaded.\n *\n * @param isBlockPluginLoaded\n * Determines whether the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin has been loaded.\n *\n * @returns\n * It returns an object with the lists of the image style options and groups defined as strings related to the\n * {@link module:image/imagestyle/utils#DEFAULT_OPTIONS default options}\n */\nfunction getDefaultStylesConfiguration(isBlockPluginLoaded, isInlinePluginLoaded) {\n if (isBlockPluginLoaded && isInlinePluginLoaded) {\n return {\n options: [\n 'inline', 'alignLeft', 'alignRight',\n 'alignCenter', 'alignBlockLeft', 'alignBlockRight',\n 'block', 'side'\n ]\n };\n }\n else if (isBlockPluginLoaded) {\n return {\n options: ['block', 'side']\n };\n }\n else if (isInlinePluginLoaded) {\n return {\n options: ['inline', 'alignLeft', 'alignRight']\n };\n }\n return {};\n}\n/**\n * Returns a list of the available predefined drop-downs' definitions depending on the loaded image editing plugins.\n */\nfunction getDefaultDropdownDefinitions(pluginCollection) {\n if (pluginCollection.has('ImageBlockEditing') && pluginCollection.has('ImageInlineEditing')) {\n return [...DEFAULT_DROPDOWN_DEFINITIONS];\n }\n else {\n return [];\n }\n}\n/**\n * Normalizes an image style option or group provided in the {@link module:image/imageconfig~ImageConfig#styles}\n * and returns it in a {@link module:image/imageconfig~ImageStyleOptionDefinition}/\n */\nfunction normalizeDefinition(definition) {\n if (typeof definition === 'string') {\n // Just the name of the style has been passed, but none of the defaults.\n if (!DEFAULT_OPTIONS[definition]) {\n // Normalize the style anyway to prevent errors.\n definition = { name: definition };\n }\n // Just the name of the style has been passed and it's one of the defaults, just use it.\n // Clone the style to avoid overriding defaults.\n else {\n definition = { ...DEFAULT_OPTIONS[definition] };\n }\n }\n else {\n // If an object style has been passed and if the name matches one of the defaults,\n // extend it with defaults – the user wants to customize a default style.\n // Note: Don't override the user–defined style object, clone it instead.\n definition = extendStyle(DEFAULT_OPTIONS[definition.name], definition);\n }\n // If an icon is defined as a string and correspond with a name\n // in default icons, use the default icon provided by the plugin.\n if (typeof definition.icon === 'string') {\n definition.icon = DEFAULT_ICONS[definition.icon] || definition.icon;\n }\n return definition;\n}\n/**\n * Checks if the image style option is valid:\n * * if it has the modelElements fields defined and filled,\n * * if the defined modelElements are supported by any of the loaded image editing plugins.\n * It also displays a console warning these conditions are not met.\n *\n * @param option image style option\n */\nfunction isValidOption(option, { isBlockPluginLoaded, isInlinePluginLoaded }) {\n const { modelElements, name } = option;\n if (!modelElements || !modelElements.length || !name) {\n warnInvalidStyle({ style: option });\n return false;\n }\n else {\n const supportedElements = [isBlockPluginLoaded ? 'imageBlock' : null, isInlinePluginLoaded ? 'imageInline' : null];\n // Check if the option is supported by any of the loaded plugins.\n if (!modelElements.some(elementName => supportedElements.includes(elementName))) {\n /**\n * In order to work correctly, each image style {@link module:image/imageconfig~ImageStyleOptionDefinition option}\n * requires specific model elements (also: types of images) to be supported by the editor.\n *\n * Model element names to which the image style option can be applied are defined in the\n * {@link module:image/imageconfig~ImageStyleOptionDefinition#modelElements} property of the style option\n * definition.\n *\n * Explore the warning in the console to find out precisely which option is not supported and which editor plugins\n * are missing. Make sure these plugins are loaded in your editor to get this image style option working.\n *\n * @error image-style-missing-dependency\n * @param {String} [option] The name of the unsupported option.\n * @param {String} [missingPlugins] The names of the plugins one of which has to be loaded for the particular option.\n */\n logWarning('image-style-missing-dependency', {\n style: option,\n missingPlugins: modelElements.map(name => name === 'imageBlock' ? 'ImageBlockEditing' : 'ImageInlineEditing')\n });\n return false;\n }\n }\n return true;\n}\n/**\n * Extends the default style with a style provided by the developer.\n * Note: Don't override the custom–defined style object, clone it instead.\n */\nfunction extendStyle(source, style) {\n const extendedStyle = { ...style };\n for (const prop in source) {\n if (!Object.prototype.hasOwnProperty.call(style, prop)) {\n extendedStyle[prop] = source[prop];\n }\n }\n return extendedStyle;\n}\n/**\n * Displays a console warning with the 'image-style-configuration-definition-invalid' error.\n */\nfunction warnInvalidStyle(info) {\n /**\n * The image style definition provided in the configuration is invalid.\n *\n * Please make sure the definition implements properly one of the following:\n *\n * * {@link module:image/imageconfig~ImageStyleOptionDefinition image style option definition},\n * * {@link module:image/imageconfig~ImageStyleDropdownDefinition image style dropdown definition}\n *\n * @error image-style-configuration-definition-invalid\n * @param {String} [dropdown] The name of the invalid drop-down\n * @param {String} [style] The name of the invalid image style option\n */\n logWarning('image-style-configuration-definition-invalid', info);\n}\nexport default {\n normalizeStyles,\n getDefaultStylesConfiguration,\n getDefaultDropdownDefinitions,\n warnInvalidStyle,\n DEFAULT_OPTIONS,\n DEFAULT_ICONS,\n DEFAULT_DROPDOWN_DEFINITIONS\n};\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { first } from 'ckeditor5/src/utils.js';\n/**\n * @module image/imagestyle/converters\n */\n/**\n * Returns a converter for the `imageStyle` attribute. It can be used for adding, changing and removing the attribute.\n *\n * @param styles An array containing available image style options.\n * @returns A model-to-view attribute converter.\n */\nexport function modelToViewStyleAttribute(styles) {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n // Check if there is class name associated with given value.\n const newStyle = getStyleDefinitionByName(data.attributeNewValue, styles);\n const oldStyle = getStyleDefinitionByName(data.attributeOldValue, styles);\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n const viewWriter = conversionApi.writer;\n if (oldStyle) {\n viewWriter.removeClass(oldStyle.className, viewElement);\n }\n if (newStyle) {\n viewWriter.addClass(newStyle.className, viewElement);\n }\n };\n}\n/**\n * Returns a view-to-model converter converting image CSS classes to a proper value in the model.\n *\n * @param styles Image style options for which the converter is created.\n * @returns A view-to-model converter.\n */\nexport function viewToModelStyleAttribute(styles) {\n // Convert only non–default styles.\n const nonDefaultStyles = {\n imageInline: styles.filter(style => !style.isDefault && style.modelElements.includes('imageInline')),\n imageBlock: styles.filter(style => !style.isDefault && style.modelElements.includes('imageBlock'))\n };\n return (evt, data, conversionApi) => {\n if (!data.modelRange) {\n return;\n }\n const viewElement = data.viewItem;\n const modelImageElement = first(data.modelRange.getItems());\n // Run this converter only if an image has been found in the model.\n // In some cases it may not be found (for example if we run this on a figure with different type than image).\n if (!modelImageElement) {\n return;\n }\n // ...and the `imageStyle` attribute is allowed for that element, otherwise stop conversion early.\n if (!conversionApi.schema.checkAttribute(modelImageElement, 'imageStyle')) {\n return;\n }\n // Convert styles one by one.\n for (const style of nonDefaultStyles[modelImageElement.name]) {\n // Try to consume class corresponding with the style.\n if (conversionApi.consumable.consume(viewElement, { classes: style.className })) {\n // And convert this style to model attribute.\n conversionApi.writer.setAttribute('imageStyle', style.name, modelImageElement);\n }\n }\n };\n}\n/**\n * Returns the style with a given `name` from an array of styles.\n */\nfunction getStyleDefinitionByName(name, styles) {\n for (const style of styles) {\n if (style.name === name) {\n return style;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagestyle/imagestyleediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageStyleCommand from './imagestylecommand.js';\nimport ImageUtils from '../imageutils.js';\nimport utils from './utils.js';\nimport { viewToModelStyleAttribute, modelToViewStyleAttribute } from './converters.js';\n/**\n * The image style engine plugin. It sets the default configuration, creates converters and registers\n * {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand ImageStyleCommand}.\n */\nexport default class ImageStyleEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageStyleEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const { normalizeStyles, getDefaultStylesConfiguration } = utils;\n const editor = this.editor;\n const isBlockPluginLoaded = editor.plugins.has('ImageBlockEditing');\n const isInlinePluginLoaded = editor.plugins.has('ImageInlineEditing');\n editor.config.define('image.styles', getDefaultStylesConfiguration(isBlockPluginLoaded, isInlinePluginLoaded));\n this.normalizedStyles = normalizeStyles({\n configuredStyles: editor.config.get('image.styles'),\n isBlockPluginLoaded,\n isInlinePluginLoaded\n });\n this._setupConversion(isBlockPluginLoaded, isInlinePluginLoaded);\n this._setupPostFixer();\n // Register imageStyle command.\n editor.commands.add('imageStyle', new ImageStyleCommand(editor, this.normalizedStyles));\n }\n /**\n * Sets the editor conversion taking the presence of\n * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`}\n * and {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugins into consideration.\n */\n _setupConversion(isBlockPluginLoaded, isInlinePluginLoaded) {\n const editor = this.editor;\n const schema = editor.model.schema;\n const modelToViewConverter = modelToViewStyleAttribute(this.normalizedStyles);\n const viewToModelConverter = viewToModelStyleAttribute(this.normalizedStyles);\n editor.editing.downcastDispatcher.on('attribute:imageStyle', modelToViewConverter);\n editor.data.downcastDispatcher.on('attribute:imageStyle', modelToViewConverter);\n // Allow imageStyle attribute in image and imageInline.\n // We could call it 'style' but https://github.com/ckeditor/ckeditor5-engine/issues/559.\n if (isBlockPluginLoaded) {\n schema.extend('imageBlock', { allowAttributes: 'imageStyle' });\n // Converter for figure element from view to model.\n editor.data.upcastDispatcher.on('element:figure', viewToModelConverter, { priority: 'low' });\n }\n if (isInlinePluginLoaded) {\n schema.extend('imageInline', { allowAttributes: 'imageStyle' });\n // Converter for the img element from view to model.\n editor.data.upcastDispatcher.on('element:img', viewToModelConverter, { priority: 'low' });\n }\n }\n /**\n * Registers a post-fixer that will make sure that the style attribute value is correct for a specific image type (block vs inline).\n */\n _setupPostFixer() {\n const editor = this.editor;\n const document = editor.model.document;\n const imageUtils = editor.plugins.get(ImageUtils);\n const stylesMap = new Map(this.normalizedStyles.map(style => [style.name, style]));\n // Make sure that style attribute is valid for the image type.\n document.registerPostFixer(writer => {\n let changed = false;\n for (const change of document.differ.getChanges()) {\n if (change.type == 'insert' || change.type == 'attribute' && change.attributeKey == 'imageStyle') {\n let element = change.type == 'insert' ? change.position.nodeAfter : change.range.start.nodeAfter;\n if (element && element.is('element', 'paragraph') && element.childCount > 0) {\n element = element.getChild(0);\n }\n if (!imageUtils.isImage(element)) {\n continue;\n }\n const imageStyle = element.getAttribute('imageStyle');\n if (!imageStyle) {\n continue;\n }\n const imageStyleDefinition = stylesMap.get(imageStyle);\n if (!imageStyleDefinition || !imageStyleDefinition.modelElements.includes(element.name)) {\n writer.removeAttribute('imageStyle', element);\n changed = true;\n }\n }\n }\n return changed;\n });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imagestyle.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imagestyle.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagestyle/imagestyleui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, createDropdown, addToolbarToDropdown, SplitButtonView } from 'ckeditor5/src/ui.js';\nimport { isObject, identity } from 'lodash-es';\nimport ImageStyleEditing from './imagestyleediting.js';\nimport utils from './utils.js';\nimport '../../theme/imagestyle.css';\n/**\n * The image style UI plugin.\n *\n * It registers buttons corresponding to the {@link module:image/imageconfig~ImageConfig#styles} configuration.\n * It also registers the {@link module:image/imagestyle/utils#DEFAULT_DROPDOWN_DEFINITIONS default drop-downs} and the\n * custom drop-downs defined by the developer in the {@link module:image/imageconfig~ImageConfig#toolbar} configuration.\n */\nexport default class ImageStyleUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageStyleEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageStyleUI';\n }\n /**\n * Returns the default localized style titles provided by the plugin.\n *\n * The following localized titles corresponding with\n * {@link module:image/imagestyle/utils#DEFAULT_OPTIONS} are available:\n *\n * * `'Wrap text'`,\n * * `'Break text'`,\n * * `'In line'`,\n * * `'Full size image'`,\n * * `'Side image'`,\n * * `'Left aligned image'`,\n * * `'Centered image'`,\n * * `'Right aligned image'`\n */\n get localizedDefaultStylesTitles() {\n const t = this.editor.t;\n return {\n 'Wrap text': t('Wrap text'),\n 'Break text': t('Break text'),\n 'In line': t('In line'),\n 'Full size image': t('Full size image'),\n 'Side image': t('Side image'),\n 'Left aligned image': t('Left aligned image'),\n 'Centered image': t('Centered image'),\n 'Right aligned image': t('Right aligned image')\n };\n }\n /**\n * @inheritDoc\n */\n init() {\n const plugins = this.editor.plugins;\n const toolbarConfig = this.editor.config.get('image.toolbar') || [];\n const imageStyleEditing = plugins.get('ImageStyleEditing');\n const definedStyles = translateStyles(imageStyleEditing.normalizedStyles, this.localizedDefaultStylesTitles);\n for (const styleConfig of definedStyles) {\n this._createButton(styleConfig);\n }\n const definedDropdowns = translateStyles([\n ...toolbarConfig.filter(isObject),\n ...utils.getDefaultDropdownDefinitions(plugins)\n ], this.localizedDefaultStylesTitles);\n for (const dropdownConfig of definedDropdowns) {\n this._createDropdown(dropdownConfig, definedStyles);\n }\n }\n /**\n * Creates a dropdown and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.\n */\n _createDropdown(dropdownConfig, definedStyles) {\n const factory = this.editor.ui.componentFactory;\n factory.add(dropdownConfig.name, locale => {\n let defaultButton;\n const { defaultItem, items, title } = dropdownConfig;\n const buttonViews = items\n .filter(itemName => definedStyles.find(({ name }) => getUIComponentName(name) === itemName))\n .map(buttonName => {\n const button = factory.create(buttonName);\n if (buttonName === defaultItem) {\n defaultButton = button;\n }\n return button;\n });\n if (items.length !== buttonViews.length) {\n utils.warnInvalidStyle({ dropdown: dropdownConfig });\n }\n const dropdownView = createDropdown(locale, SplitButtonView);\n const splitButtonView = dropdownView.buttonView;\n const splitButtonViewArrow = splitButtonView.arrowView;\n addToolbarToDropdown(dropdownView, buttonViews, { enableActiveItemFocusOnDropdownOpen: true });\n splitButtonView.set({\n label: getDropdownButtonTitle(title, defaultButton.label),\n class: null,\n tooltip: true\n });\n splitButtonViewArrow.unbind('label');\n splitButtonViewArrow.set({\n label: title\n });\n splitButtonView.bind('icon').toMany(buttonViews, 'isOn', (...areOn) => {\n const index = areOn.findIndex(identity);\n return (index < 0) ? defaultButton.icon : buttonViews[index].icon;\n });\n splitButtonView.bind('label').toMany(buttonViews, 'isOn', (...areOn) => {\n const index = areOn.findIndex(identity);\n return getDropdownButtonTitle(title, (index < 0) ? defaultButton.label : buttonViews[index].label);\n });\n splitButtonView.bind('isOn').toMany(buttonViews, 'isOn', (...areOn) => areOn.some(identity));\n splitButtonView.bind('class')\n .toMany(buttonViews, 'isOn', (...areOn) => areOn.some(identity) ? 'ck-splitbutton_flatten' : undefined);\n splitButtonView.on('execute', () => {\n if (!buttonViews.some(({ isOn }) => isOn)) {\n defaultButton.fire('execute');\n }\n else {\n dropdownView.isOpen = !dropdownView.isOpen;\n }\n });\n dropdownView.bind('isEnabled')\n .toMany(buttonViews, 'isEnabled', (...areEnabled) => areEnabled.some(identity));\n // Focus the editable after executing the command.\n // Overrides a default behaviour where the focus is moved to the dropdown button (#12125).\n this.listenTo(dropdownView, 'execute', () => {\n this.editor.editing.view.focus();\n });\n return dropdownView;\n });\n }\n /**\n * Creates a button and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.\n */\n _createButton(buttonConfig) {\n const buttonName = buttonConfig.name;\n this.editor.ui.componentFactory.add(getUIComponentName(buttonName), locale => {\n const command = this.editor.commands.get('imageStyle');\n const view = new ButtonView(locale);\n view.set({\n label: buttonConfig.title,\n icon: buttonConfig.icon,\n tooltip: true,\n isToggleable: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n view.bind('isOn').to(command, 'value', value => value === buttonName);\n view.on('execute', this._executeCommand.bind(this, buttonName));\n return view;\n });\n }\n _executeCommand(name) {\n this.editor.execute('imageStyle', { value: name });\n this.editor.editing.view.focus();\n }\n}\n/**\n * Returns the translated `title` from the passed styles array.\n */\nfunction translateStyles(styles, titles) {\n for (const style of styles) {\n // Localize the titles of the styles, if a title corresponds with\n // a localized default provided by the plugin.\n if (titles[style.title]) {\n style.title = titles[style.title];\n }\n }\n return styles;\n}\n/**\n * Returns the image style component name with the \"imageStyle:\" prefix.\n */\nfunction getUIComponentName(name) {\n return `imageStyle:${name}`;\n}\n/**\n * Returns title for the splitbutton containing the dropdown title and default action item title.\n */\nfunction getDropdownButtonTitle(dropdownTitle, buttonTitle) {\n return (dropdownTitle ? dropdownTitle + ': ' : '') + buttonTitle;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetoolbar\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { WidgetToolbarRepository } from 'ckeditor5/src/widget.js';\nimport ImageUtils from './imageutils.js';\nimport { isObject } from 'lodash-es';\n/**\n * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).\n *\n * For an overview, check the {@glink features/images/images-overview#image-contextual-toolbar image contextual toolbar} documentation.\n *\n * Instances of toolbar components (e.g. buttons) are created using the editor's\n * {@link module:ui/componentfactory~ComponentFactory component factory}\n * based on the {@link module:image/imageconfig~ImageConfig#toolbar `image.toolbar` configuration option}.\n *\n * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.\n */\nexport default class ImageToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetToolbarRepository, ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageToolbar';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const t = editor.t;\n const widgetToolbarRepository = editor.plugins.get(WidgetToolbarRepository);\n const imageUtils = editor.plugins.get('ImageUtils');\n widgetToolbarRepository.register('image', {\n ariaLabel: t('Image toolbar'),\n items: normalizeDeclarativeConfig(editor.config.get('image.toolbar') || []),\n getRelatedElement: selection => imageUtils.getClosestSelectedImageWidget(selection)\n });\n }\n}\n/**\n * Convert the dropdown definitions to their keys registered in the ComponentFactory.\n * The registration precess should be handled by the plugin which handles the UI of a particular feature.\n */\nfunction normalizeDeclarativeConfig(config) {\n return config.map(item => isObject(item) ? item.name : item);\n}\n","const childPagesMacroSymbol = Symbol( 'isWpButtonMacroSymbol' );\nimport {toWidget, isWidget} from '@ckeditor/ckeditor5-widget/src/utils';\n\nexport function toChildPagesMacroWidget( viewElement, writer, label ) {\n\twriter.setCustomProperty( childPagesMacroSymbol, true, viewElement );\n\treturn toWidget( viewElement, writer, { label: label });\n}\n\n\nexport function isChildPagesMacroWidget( viewElement ) {\n\treturn !!viewElement.getCustomProperty( childPagesMacroSymbol ) && isWidget( viewElement );\n}\n\n\nexport function isChildPagesMacroWidgetSelected( selection ) {\n\tconst viewElement = selection.getSelectedElement();\n\n\treturn !!( viewElement && isChildPagesMacroWidget( viewElement ) );\n}\n","import { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n\nimport { ViewPosition } from '@ckeditor/ckeditor5-engine';\nimport { ViewRange } from '@ckeditor/ckeditor5-engine';\n\nimport {toChildPagesMacroWidget} from './utils';\n\nexport default class OPChildPagesEditing extends Plugin {\n\n\tstatic get pluginName() {\n\t\treturn 'OPChildPagesEditing';\n\t}\n\n\tstatic get buttonName(){\n\t\treturn \"insertChildPages\";\n\t}\n\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\t\tconst conversion = editor.conversion;\n\n\t\t// Schema.\n\t\tmodel.schema.register( 'op-macro-child-pages', {\n\t\t\tallowWhere: ['$block'],\n\t\t\tallowAttributes: ['page'],\n\t\t\tisBlock: true,\n\t\t\tisLimit: true\n\t\t});\n\n\t\tconversion.for( 'upcast' )\n\t\t\t.elementToElement( {\n\t\t\t\tview: {\n\t\t\t\t\tname: 'macro',\n\t\t\t\t\tclasses: 'child_pages'\n\t\t\t\t},\n\t\t\t\tmodel: ( viewElement, {writer:modelWriter} ) => {\n\t\t\t\t\tconst page = viewElement.getAttribute( 'data-page' ) || '';\n\t\t\t\t\tconst includeParent = viewElement.getAttribute( 'data-include-parent' ) == 'true';\n\n\t\t\t\t\treturn modelWriter.createElement(\n\t\t\t\t\t\t'op-macro-child-pages',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpage: page,\n\t\t\t\t\t\t\tincludeParent: includeParent\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\n\t\tconversion.for( 'editingDowncast' )\n\t\t\t.elementToElement({\n\t\t\t\tmodel: 'op-macro-child-pages',\n\t\t\t\tview: (modelElement, {writer}) => {\n\t\t\t\t\treturn this.createMacroViewElement(modelElement, writer);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.add(dispatcher => dispatcher.on( 'attribute:page', this.modelAttributeToView.bind(this)))\n\t\t\t.add(dispatcher => dispatcher.on( 'attribute:includeParent', this.modelAttributeToView.bind(this)));\n\n\t\tconversion.for('dataDowncast').elementToElement({\n\t\t\tmodel: 'op-macro-child-pages',\n\t\t\tview: (modelElement, {writer}) => {\n\t\t\t\tconst element = writer.createContainerElement(\n\t\t\t\t\t'macro',\n\t\t\t\t\t{\n\t\t\t\t\t\t'class': 'child_pages',\n\t\t\t\t\t\t'data-page': modelElement.getAttribute('page') || '',\n\t\t\t\t\t\t'data-include-parent': modelElement.getAttribute('includeParent') || ''\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn element;\n\t\t\t}\n\t\t});\n\n\t\teditor.ui.componentFactory.add( OPChildPagesEditing.buttonName, locale => {\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: window.I18n.t('js.editor.macro.child_pages.button'),\n\t\t\t\twithText: true\n\t\t\t} );\n\n\t\t\t// Callback executed once the image is clicked.\n\t\t\tview.on( 'execute', () => {\n\t\t\t\teditor.model.change(writer => {\n\t\t\t\t\tconst element = writer.createElement( 'op-macro-child-pages', {});\n\n\t\t\t\t\teditor.model.insertContent( element, editor.model.document.selection );\n\t\t\t\t});\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\t}\n\n\tmodelAttributeToView( evt, data, conversionApi ) {\n\t\tconst modelElement = data.item;\n\t\tif (!modelElement.is('element', 'op-macro-child-pages')) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Mark element as consumed by conversion.\n\t\tconversionApi.consumable.consume(data.item, evt.name);\n\n\t\t// Get mapped view element to update.\n\t\tconst viewElement = conversionApi.mapper.toViewElement(modelElement);\n\n\t\t// Remove current <div> element contents.\n\t\tconversionApi.writer.remove(conversionApi.writer.createRangeIn(viewElement));\n\n\t\t// Set current content\n\t\tthis.setPlaceholderContent(conversionApi.writer, modelElement, viewElement);\n\t}\n\n\tmacroLabel() {\n\t\treturn window.I18n.t('js.editor.macro.child_pages.text');\n\t}\n\n\tpageLabel(page) {\n\t\tif (page && page.length > 0) {\n\t\t\treturn page\n\t\t} else {\n\t\t\treturn window.I18n.t('js.editor.macro.child_pages.this_page');\n\t\t}\n\t}\n\n\tincludeParentText(includeParent) {\n\t\tif (includeParent) {\n\t\t\treturn ` (${window.I18n.t('js.editor.macro.child_pages.include_parent')})`;\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}\n\n\tcreateMacroViewElement(modelElement, writer) {\n\t\tconst placeholderContainer = writer.createContainerElement( 'div' );\n\n\t\tthis.setPlaceholderContent( writer, modelElement, placeholderContainer );\n\n\t\treturn toChildPagesMacroWidget(placeholderContainer, writer, { label: this.macroLabel() } )\n\t}\n\n\tsetPlaceholderContent(writer, modelElement, placeholderContainer ) {\n\t\tconst page = modelElement.getAttribute('page');\n\t\tconst includeParent = modelElement.getAttribute('includeParent');\n\t\tconst macroLabel = this.macroLabel();\n\t\tconst pageLabel = this.pageLabel(page);\n\t\tconst pageLabelContainer = writer.createContainerElement( 'span', { class: 'macro-value' } );\n\t\tlet placeholderContent = [ writer.createText( `${macroLabel} ` ) ];\n\t\twriter.insert( writer.createPositionAt( pageLabelContainer, 0 ), writer.createText( `${pageLabel}` ) )\n\t\tplaceholderContent.push( pageLabelContainer );\n\t\tplaceholderContent.push( writer.createText( this.includeParentText(includeParent) ));\n\n\t\twriter.insert( writer.createPositionAt( placeholderContainer, 0 ), placeholderContent );\n\t}\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\nimport { ContextualBalloon } from '@ckeditor/ckeditor5-ui';\n\nimport {isChildPagesMacroWidgetSelected} from './utils';\nimport {createToolbarEditButton} from '../../helpers/create-toolbar-edit-button';\nimport {createEditToolbar} from '../../helpers/create-toolbar';\nimport {getPluginContext} from '../op-context/op-context';\n\n\nconst balloonClassName = 'ck-toolbar-container';\n\nexport default class OPChildPagesToolbar extends Plugin {\n\tstatic get requires() {\n\t\treturn [ ContextualBalloon ];\n\t}\n\n\tstatic get pluginName() {\n\t\treturn 'OPChildPagesToolbar';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = this.editor.model;\n\t\tconst pluginContext = getPluginContext(editor);\n\n\t\t// Add editing button\n\t\tcreateToolbarEditButton( editor, 'opEditChildPagesMacroButton', widget => {\n\t\t\tconst macroService = pluginContext.services.macros;\n\t\t\tconst pageAttribute = widget.getAttribute('page');\n\t\t\tconst includeParent = widget.getAttribute('includeParent');\n\t\t\tconst page = (pageAttribute && pageAttribute.length > 0) ? pageAttribute : '';\n\t\t\tmacroService\n\t\t\t\t.configureChildPages(page, includeParent)\n\t\t\t\t.then((macroConf) => model.change(writer => {\n\t\t\t\t\t\twriter.setAttribute( 'page', macroConf.page, widget );\n\t\t\t\t\t\twriter.setAttribute( 'includeParent', macroConf.includeParent, widget );\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t} );\n\t}\n\n\tafterInit() {\n\t\t// Add actual toolbar\n\t\tcreateEditToolbar(\n\t\t\tthis,\n\t\t\tthis.editor,\n\t\t\t'OPChildPages',\n\t\t\tisChildPagesMacroWidgetSelected\n\t\t);\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module select-all/selectallcommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\n/**\n * The select all command.\n *\n * It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle\n * the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke.\n *\n * Executing this command changes the {@glink framework/architecture/editing-engine#model model}\n * selection so it contains the entire content of the editable root of the editor the selection is\n * {@link module:engine/model/selection~Selection#anchor anchored} in.\n *\n * If the selection was anchored in a {@glink framework/tutorials/widgets/implementing-a-block-widget nested editable}\n * (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command\n * will expand the selection to encompass more and more content up to the entire editable root of the editor.\n */\nexport default class SelectAllCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // It does not affect data so should be enabled in read-only mode.\n this.affectsData = false;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const selection = model.document.selection;\n let scopeElement = model.schema.getLimitElement(selection);\n // If an entire scope is selected, or the selection's ancestor is not a scope yet,\n // browse through ancestors to find the enclosing parent scope.\n if (selection.containsEntireContent(scopeElement) || !isSelectAllScope(model.schema, scopeElement)) {\n do {\n scopeElement = scopeElement.parent;\n // Do nothing, if the entire `root` is already selected.\n if (!scopeElement) {\n return;\n }\n } while (!isSelectAllScope(model.schema, scopeElement));\n }\n model.change(writer => {\n writer.setSelection(scopeElement, 'in');\n });\n }\n}\n/**\n * Checks whether the element is a valid select-all scope. Returns true, if the element is a\n * {@link module:engine/model/schema~Schema#isLimit limit}, and can contain any text or paragraph.\n *\n * @param schema Schema to check against.\n * @param element Model element.\n */\nfunction isSelectAllScope(schema, element) {\n return schema.isLimit(element) && (schema.checkChild(element, '$text') || schema.checkChild(element, 'paragraph'));\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module select-all/selectallediting\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { getCode, parseKeystroke } from '@ckeditor/ckeditor5-utils';\nimport SelectAllCommand from './selectallcommand.js';\nconst SELECT_ALL_KEYSTROKE = /* #__PURE__ */ parseKeystroke('Ctrl+A');\n/**\n * The select all editing feature.\n *\n * It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}\n * and the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke listener which executes it.\n */\nexport default class SelectAllEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SelectAllEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const view = editor.editing.view;\n const viewDocument = view.document;\n editor.commands.add('selectAll', new SelectAllCommand(editor));\n this.listenTo(viewDocument, 'keydown', (eventInfo, domEventData) => {\n if (getCode(domEventData) === SELECT_ALL_KEYSTROKE) {\n editor.execute('selectAll');\n domEventData.preventDefault();\n }\n });\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Select all'),\n keystroke: 'CTRL+A'\n }\n ]\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module select-all/selectallui\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui';\nimport selectAllIcon from '../theme/icons/select-all.svg';\n/**\n * The select all UI feature.\n *\n * It registers the `'selectAll'` UI button in the editor's\n * {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button\n * executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.\n */\nexport default class SelectAllUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SelectAllUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.ui.componentFactory.add('selectAll', () => {\n const buttonView = this._createButton(ButtonView);\n buttonView.set({\n tooltip: true\n });\n return buttonView;\n });\n editor.ui.componentFactory.add('menuBar:selectAll', () => {\n return this._createButton(MenuBarMenuListItemButtonView);\n });\n }\n /**\n * Creates a button for select all command to use either in toolbar or in menu bar.\n */\n _createButton(ButtonClass) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get('selectAll');\n const view = new ButtonClass(editor.locale);\n const t = locale.t;\n view.set({\n label: t('Select all'),\n icon: selectAllIcon,\n keystroke: 'Ctrl+A'\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', () => {\n editor.execute('selectAll');\n editor.editing.view.focus();\n });\n return view;\n }\n}\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module select-all/selectall\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport SelectAllEditing from './selectallediting.js';\nimport SelectAllUI from './selectallui.js';\n/**\n * The select all feature.\n *\n * This is a \"glue\" plugin which loads the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature}\n * and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.\n *\n * Please refer to the documentation of individual features to learn more.\n */\nexport default class SelectAll extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [SelectAllEditing, SelectAllUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SelectAll';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals window, document */\n/**\n * @module adapter-ckfinder/utils\n */\nconst TOKEN_COOKIE_NAME = 'ckCsrfToken';\nconst TOKEN_LENGTH = 40;\nconst tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';\n/**\n * Returns the CSRF token value. The value is a hash stored in `document.cookie`\n * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication\n * between the web browser and the CKFinder server.\n */\nexport function getCsrfToken() {\n let token = getCookie(TOKEN_COOKIE_NAME);\n if (!token || token.length != TOKEN_LENGTH) {\n token = generateToken(TOKEN_LENGTH);\n setCookie(TOKEN_COOKIE_NAME, token);\n }\n return token;\n}\n/**\n * Returns the value of the cookie with a given name or `null` if the cookie is not found.\n */\nexport function getCookie(name) {\n name = name.toLowerCase();\n const parts = document.cookie.split(';');\n for (const part of parts) {\n const pair = part.split('=');\n const key = decodeURIComponent(pair[0].trim().toLowerCase());\n if (key === name) {\n return decodeURIComponent(pair[1]);\n }\n }\n return null;\n}\n/**\n * Sets the value of the cookie with a given name.\n */\nexport function setCookie(name, value) {\n document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=/';\n}\n/**\n * Generates the CSRF token with the given length.\n */\nfunction generateToken(length) {\n let result = '';\n const randValues = new Uint8Array(length);\n window.crypto.getRandomValues(randValues);\n for (let j = 0; j < randValues.length; j++) {\n const character = tokenCharset.charAt(randValues[j] % tokenCharset.length);\n result += Math.random() > 0.5 ? character.toUpperCase() : character;\n }\n return result;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals XMLHttpRequest, FormData */\n/**\n * @module adapter-ckfinder/uploadadapter\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { FileRepository } from 'ckeditor5/src/upload.js';\nimport { getCsrfToken } from './utils.js';\n/**\n * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.\n *\n * See the {@glink features/file-management/ckfinder \"CKFinder file manager integration\"} guide to learn how to configure\n * and use this feature as well as find out more about the full integration with the file manager\n * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} guide to learn\n * about other ways to upload images into CKEditor 5.\n */\nexport default class CKFinderUploadAdapter extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FileRepository];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CKFinderUploadAdapter';\n }\n /**\n * @inheritDoc\n */\n init() {\n const url = this.editor.config.get('ckfinder.uploadUrl');\n if (!url) {\n return;\n }\n // Register CKFinderAdapter\n this.editor.plugins.get(FileRepository).createUploadAdapter = loader => new UploadAdapter(loader, url, this.editor.t);\n }\n}\n/**\n * Upload adapter for CKFinder.\n */\nclass UploadAdapter {\n /**\n * Creates a new adapter instance.\n */\n constructor(loader, url, t) {\n this.loader = loader;\n this.url = url;\n this.t = t;\n }\n /**\n * Starts the upload process.\n *\n * @see module:upload/filerepository~UploadAdapter#upload\n */\n upload() {\n return this.loader.file.then(file => {\n return new Promise((resolve, reject) => {\n this._initRequest();\n this._initListeners(resolve, reject, file);\n this._sendRequest(file);\n });\n });\n }\n /**\n * Aborts the upload process.\n *\n * @see module:upload/filerepository~UploadAdapter#abort\n */\n abort() {\n if (this.xhr) {\n this.xhr.abort();\n }\n }\n /**\n * Initializes the XMLHttpRequest object.\n */\n _initRequest() {\n const xhr = this.xhr = new XMLHttpRequest();\n xhr.open('POST', this.url, true);\n xhr.responseType = 'json';\n }\n /**\n * Initializes XMLHttpRequest listeners.\n *\n * @param resolve Callback function to be called when the request is successful.\n * @param reject Callback function to be called when the request cannot be completed.\n * @param file File instance to be uploaded.\n */\n _initListeners(resolve, reject, file) {\n const xhr = this.xhr;\n const loader = this.loader;\n const t = this.t;\n const genericError = t('Cannot upload file:') + ` ${file.name}.`;\n xhr.addEventListener('error', () => reject(genericError));\n xhr.addEventListener('abort', () => reject());\n xhr.addEventListener('load', () => {\n const response = xhr.response;\n if (!response || !response.uploaded) {\n return reject(response && response.error && response.error.message ? response.error.message : genericError);\n }\n resolve({\n default: response.url\n });\n });\n // Upload progress when it's supported.\n /* istanbul ignore else -- @preserve */\n if (xhr.upload) {\n xhr.upload.addEventListener('progress', evt => {\n if (evt.lengthComputable) {\n loader.uploadTotal = evt.total;\n loader.uploaded = evt.loaded;\n }\n });\n }\n }\n /**\n * Prepares the data and sends the request.\n *\n * @param file File instance to be uploaded.\n */\n _sendRequest(file) {\n // Prepare form data.\n const data = new FormData();\n data.append('upload', file);\n data.append('ckCsrfToken', getCsrfToken());\n // Send request.\n this.xhr.send(data);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { LiveRange } from 'ckeditor5/src/engine.js';\nimport { first } from 'ckeditor5/src/utils.js';\n/**\n * The block autoformatting engine. It allows to format various block patterns. For example,\n * it can be configured to turn a paragraph starting with `*` and followed by a space into a list item.\n *\n * The autoformatting operation is integrated with the undo manager,\n * so the autoformatting step can be undone if the user's intention was not to format the text.\n *\n * See the {@link module:autoformat/blockautoformatediting~blockAutoformatEditing `blockAutoformatEditing`} documentation\n * to learn how to create custom block autoformatters. You can also use\n * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters\n * (lists, headings, bold and italic).\n *\n * @module autoformat/blockautoformatediting\n */\n/**\n * Creates a listener triggered on {@link module:engine/model/document~Document#event:change:data `change:data`} event in the document.\n * Calls the callback when inserted text matches the regular expression or the command name\n * if provided instead of the callback.\n *\n * Examples of usage:\n *\n * To convert a paragraph into heading 1 when `- ` is typed, using just the command name:\n *\n * ```ts\n * blockAutoformatEditing( editor, plugin, /^\\- $/, 'heading1' );\n * ```\n *\n * To convert a paragraph into heading 1 when `- ` is typed, using just the callback:\n *\n * ```ts\n * blockAutoformatEditing( editor, plugin, /^\\- $/, ( context ) => {\n * \tconst { match } = context;\n * \tconst headingLevel = match[ 1 ].length;\n *\n * \teditor.execute( 'heading', {\n * \t\tformatId: `heading${ headingLevel }`\n * \t} );\n * } );\n * ```\n *\n * @param editor The editor instance.\n * @param plugin The autoformat plugin instance.\n * @param pattern The regular expression to execute on just inserted text. The regular expression is tested against the text\n * from the beginning until the caret position.\n * @param callbackOrCommand The callback to execute or the command to run when the text is matched.\n * In case of providing the callback, it receives the following parameter:\n * * match RegExp.exec() result of matching the pattern to inserted text.\n */\nexport default function blockAutoformatEditing(editor, plugin, pattern, callbackOrCommand) {\n let callback;\n let command = null;\n if (typeof callbackOrCommand == 'function') {\n callback = callbackOrCommand;\n }\n else {\n // We assume that the actual command name was provided.\n command = editor.commands.get(callbackOrCommand);\n callback = () => {\n editor.execute(callbackOrCommand);\n };\n }\n editor.model.document.on('change:data', (evt, batch) => {\n if (command && !command.isEnabled || !plugin.isEnabled) {\n return;\n }\n const range = first(editor.model.document.selection.getRanges());\n if (!range.isCollapsed) {\n return;\n }\n if (batch.isUndo || !batch.isLocal) {\n return;\n }\n const changes = Array.from(editor.model.document.differ.getChanges());\n const entry = changes[0];\n // Typing is represented by only a single change.\n if (changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1) {\n return;\n }\n const blockToFormat = entry.position.parent;\n // Block formatting should be disabled in codeBlocks (#5800).\n if (blockToFormat.is('element', 'codeBlock')) {\n return;\n }\n // Only list commands and custom callbacks can be applied inside a list.\n if (blockToFormat.is('element', 'listItem') &&\n typeof callbackOrCommand !== 'function' &&\n !['numberedList', 'bulletedList', 'todoList'].includes(callbackOrCommand)) {\n return;\n }\n // In case a command is bound, do not re-execute it over an existing block style which would result in a style removal.\n // Instead, just drop processing so that autoformat trigger text is not lost. E.g. writing \"# \" in a level 1 heading.\n if (command && command.value === true) {\n return;\n }\n const firstNode = blockToFormat.getChild(0);\n const firstNodeRange = editor.model.createRangeOn(firstNode);\n // Range is only expected to be within or at the very end of the first text node.\n if (!firstNodeRange.containsRange(range) && !range.end.isEqual(firstNodeRange.end)) {\n return;\n }\n const match = pattern.exec(firstNode.data.substr(0, range.end.offset));\n // ...and this text node's data match the pattern.\n if (!match) {\n return;\n }\n // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.\n editor.model.enqueueChange(writer => {\n // Matched range.\n const start = writer.createPositionAt(blockToFormat, 0);\n const end = writer.createPositionAt(blockToFormat, match[0].length);\n const range = new LiveRange(start, end);\n const wasChanged = callback({ match });\n // Remove matched text.\n if (wasChanged !== false) {\n writer.remove(range);\n const selectionRange = editor.model.document.selection.getFirstRange();\n const blockRange = writer.createRangeIn(blockToFormat);\n // If the block is empty and the document selection has been moved when\n // applying formatting (e.g. is now in newly created block).\n if (blockToFormat.isEmpty && !blockRange.isEqual(selectionRange) && !blockRange.containsRange(selectionRange, true)) {\n writer.remove(blockToFormat);\n }\n }\n range.detach();\n editor.model.enqueueChange(() => {\n const deletePlugin = editor.plugins.get('Delete');\n deletePlugin.requestUndoOnBackspace();\n });\n });\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.\n *\n * It formats the matched text by applying the given model attribute or by running the provided formatting callback.\n * On every {@link module:engine/model/document~Document#event:change:data data change} in the model document\n * the autoformatting engine checks the text on the left of the selection\n * and executes the provided action if the text matches given criteria (regular expression or callback).\n *\n * @param editor The editor instance.\n * @param plugin The autoformat plugin instance.\n * @param testRegexpOrCallback The regular expression or callback to execute on text.\n * Provided regular expression *must* have three capture groups. The first and the third capture group\n * should match opening and closing delimiters. The second capture group should match the text to format.\n *\n * ```ts\n * // Matches the `**bold text**` pattern.\n * // There are three capturing groups:\n * // - The first to match the starting `**` delimiter.\n * // - The second to match the text to format.\n * // - The third to match the ending `**` delimiter.\n * inlineAutoformatEditing( editor, plugin, /(\\*\\*)([^\\*]+?)(\\*\\*)$/g, formatCallback );\n * ```\n *\n * When a function is provided instead of the regular expression, it will be executed with the text to match as a parameter.\n * The function should return proper \"ranges\" to delete and format.\n *\n * ```ts\n * {\n * \tremove: [\n * \t\t[ 0, 1 ],\t// Remove the first letter from the given text.\n * \t\t[ 5, 6 ]\t// Remove the 6th letter from the given text.\n * \t],\n * \tformat: [\n * \t\t[ 1, 5 ]\t// Format all letters from 2nd to 5th.\n * \t]\n * }\n * ```\n *\n * @param formatCallback A callback to apply actual formatting.\n * It should return `false` if changes should not be applied (e.g. if a command is disabled).\n *\n * ```ts\n * inlineAutoformatEditing( editor, plugin, /(\\*\\*)([^\\*]+?)(\\*\\*)$/g, ( writer, rangesToFormat ) => {\n * \tconst command = editor.commands.get( 'bold' );\n *\n * \tif ( !command.isEnabled ) {\n * \t\treturn false;\n * \t}\n *\n * \tconst validRanges = editor.model.schema.getValidRanges( rangesToFormat, 'bold' );\n *\n * \tfor ( let range of validRanges ) {\n * \t\twriter.setAttribute( 'bold', true, range );\n * \t}\n * } );\n * ```\n */\nexport default function inlineAutoformatEditing(editor, plugin, testRegexpOrCallback, formatCallback) {\n let regExp;\n let testCallback;\n if (testRegexpOrCallback instanceof RegExp) {\n regExp = testRegexpOrCallback;\n }\n else {\n testCallback = testRegexpOrCallback;\n }\n // A test callback run on changed text.\n testCallback = testCallback || (text => {\n let result;\n const remove = [];\n const format = [];\n while ((result = regExp.exec(text)) !== null) {\n // There should be full match and 3 capture groups.\n if (result && result.length < 4) {\n break;\n }\n let { index, '1': leftDel, '2': content, '3': rightDel } = result;\n // Real matched string - there might be some non-capturing groups so we need to recalculate starting index.\n const found = leftDel + content + rightDel;\n index += result[0].length - found.length;\n // Start and End offsets of delimiters to remove.\n const delStart = [\n index,\n index + leftDel.length\n ];\n const delEnd = [\n index + leftDel.length + content.length,\n index + leftDel.length + content.length + rightDel.length\n ];\n remove.push(delStart);\n remove.push(delEnd);\n format.push([index + leftDel.length, index + leftDel.length + content.length]);\n }\n return {\n remove,\n format\n };\n });\n editor.model.document.on('change:data', (evt, batch) => {\n if (batch.isUndo || !batch.isLocal || !plugin.isEnabled) {\n return;\n }\n const model = editor.model;\n const selection = model.document.selection;\n // Do nothing if selection is not collapsed.\n if (!selection.isCollapsed) {\n return;\n }\n const changes = Array.from(model.document.differ.getChanges());\n const entry = changes[0];\n // Typing is represented by only a single change.\n if (changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1) {\n return;\n }\n const focus = selection.focus;\n const block = focus.parent;\n const { text, range } = getTextAfterCode(model.createRange(model.createPositionAt(block, 0), focus), model);\n const testOutput = testCallback(text);\n const rangesToFormat = testOutputToRanges(range.start, testOutput.format, model);\n const rangesToRemove = testOutputToRanges(range.start, testOutput.remove, model);\n if (!(rangesToFormat.length && rangesToRemove.length)) {\n return;\n }\n // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.\n model.enqueueChange(writer => {\n // Apply format.\n const hasChanged = formatCallback(writer, rangesToFormat);\n // Strict check on `false` to have backward compatibility (when callbacks were returning `undefined`).\n if (hasChanged === false) {\n return;\n }\n // Remove delimiters - use reversed order to not mix the offsets while removing.\n for (const range of rangesToRemove.reverse()) {\n writer.remove(range);\n }\n model.enqueueChange(() => {\n const deletePlugin = editor.plugins.get('Delete');\n deletePlugin.requestUndoOnBackspace();\n });\n });\n });\n}\n/**\n * Converts output of the test function provided to the inlineAutoformatEditing and converts it to the model ranges\n * inside provided block.\n */\nfunction testOutputToRanges(start, arrays, model) {\n return arrays\n .filter(array => (array[0] !== undefined && array[1] !== undefined))\n .map(array => {\n return model.createRange(start.getShiftedBy(array[0]), start.getShiftedBy(array[1]));\n });\n}\n/**\n * Returns the last text line after the last code element from the given range.\n * It is similar to {@link module:typing/utils/getlasttextline.getLastTextLine `getLastTextLine()`},\n * but it ignores any text before the last `code`.\n */\nfunction getTextAfterCode(range, model) {\n let start = range.start;\n const text = Array.from(range.getItems()).reduce((rangeText, node) => {\n // Trim text to a last occurrence of an inline element and update range start.\n if (!(node.is('$text') || node.is('$textProxy')) || node.getAttribute('code')) {\n start = model.createPositionAfter(node);\n return '';\n }\n return rangeText + node.data;\n }, '');\n return { text, range: model.createRange(start, range.end) };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Delete } from 'ckeditor5/src/typing.js';\nimport blockAutoformatEditing from './blockautoformatediting.js';\nimport inlineAutoformatEditing from './inlineautoformatediting.js';\n/**\n * Enables a set of predefined autoformatting actions.\n *\n * For a detailed overview, check the {@glink features/autoformat Autoformatting} feature guide\n * and the {@glink api/autoformat package page}.\n */\nexport default class Autoformat extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Delete];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Autoformat';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const t = this.editor.t;\n this._addListAutoformats();\n this._addBasicStylesAutoformats();\n this._addHeadingAutoformats();\n this._addBlockQuoteAutoformats();\n this._addCodeBlockAutoformats();\n this._addHorizontalLineAutoformats();\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Revert autoformatting action'),\n keystroke: 'Backspace'\n }\n ]\n });\n }\n /**\n * Adds autoformatting related to the {@link module:list/list~List}.\n *\n * When typed:\n * - `* ` or `- ` – A paragraph will be changed into a bulleted list.\n * - `1. ` or `1) ` – A paragraph will be changed into a numbered list (\"1\" can be any digit or a list of digits).\n * - `[] ` or `[ ] ` – A paragraph will be changed into a to-do list.\n * - `[x] ` or `[ x ] ` – A paragraph will be changed into a checked to-do list.\n */\n _addListAutoformats() {\n const commands = this.editor.commands;\n if (commands.get('bulletedList')) {\n blockAutoformatEditing(this.editor, this, /^[*-]\\s$/, 'bulletedList');\n }\n if (commands.get('numberedList')) {\n blockAutoformatEditing(this.editor, this, /^1[.|)]\\s$/, 'numberedList');\n }\n if (commands.get('todoList')) {\n blockAutoformatEditing(this.editor, this, /^\\[\\s?\\]\\s$/, 'todoList');\n }\n if (commands.get('checkTodoList')) {\n blockAutoformatEditing(this.editor, this, /^\\[\\s?x\\s?\\]\\s$/, () => {\n this.editor.execute('todoList');\n this.editor.execute('checkTodoList');\n });\n }\n }\n /**\n * Adds autoformatting related to the {@link module:basic-styles/bold~Bold},\n * {@link module:basic-styles/italic~Italic}, {@link module:basic-styles/code~Code}\n * and {@link module:basic-styles/strikethrough~Strikethrough}\n *\n * When typed:\n * - `**foobar**` – `**` characters are removed and `foobar` is set to bold,\n * - `__foobar__` – `__` characters are removed and `foobar` is set to bold,\n * - `*foobar*` – `*` characters are removed and `foobar` is set to italic,\n * - `_foobar_` – `_` characters are removed and `foobar` is set to italic,\n * - ``` `foobar` – ``` ` ``` characters are removed and `foobar` is set to code,\n * - `~~foobar~~` – `~~` characters are removed and `foobar` is set to strikethrough.\n */\n _addBasicStylesAutoformats() {\n const commands = this.editor.commands;\n if (commands.get('bold')) {\n const boldCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'bold');\n inlineAutoformatEditing(this.editor, this, /(?:^|\\s)(\\*\\*)([^*]+)(\\*\\*)$/g, boldCallback);\n inlineAutoformatEditing(this.editor, this, /(?:^|\\s)(__)([^_]+)(__)$/g, boldCallback);\n }\n if (commands.get('italic')) {\n const italicCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'italic');\n // The italic autoformatter cannot be triggered by the bold markers, so we need to check the\n // text before the pattern (e.g. `(?:^|[^\\*])`).\n inlineAutoformatEditing(this.editor, this, /(?:^|\\s)(\\*)([^*_]+)(\\*)$/g, italicCallback);\n inlineAutoformatEditing(this.editor, this, /(?:^|\\s)(_)([^_]+)(_)$/g, italicCallback);\n }\n if (commands.get('code')) {\n const codeCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'code');\n inlineAutoformatEditing(this.editor, this, /(`)([^`]+)(`)$/g, codeCallback);\n }\n if (commands.get('strikethrough')) {\n const strikethroughCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'strikethrough');\n inlineAutoformatEditing(this.editor, this, /(~~)([^~]+)(~~)$/g, strikethroughCallback);\n }\n }\n /**\n * Adds autoformatting related to {@link module:heading/heading~Heading}.\n *\n * It is using a number at the end of the command name to associate it with the proper trigger:\n *\n * * `heading` with a `heading1` value will be executed when typing `#`,\n * * `heading` with a `heading2` value will be executed when typing `##`,\n * * ... up to `heading6` for `######`.\n */\n _addHeadingAutoformats() {\n const command = this.editor.commands.get('heading');\n if (command) {\n command.modelElements\n .filter(name => name.match(/^heading[1-6]$/))\n .forEach(modelName => {\n const level = modelName[7];\n const pattern = new RegExp(`^(#{${level}})\\\\s$`);\n blockAutoformatEditing(this.editor, this, pattern, () => {\n // Should only be active if command is enabled and heading style associated with pattern is inactive.\n if (!command.isEnabled || command.value === modelName) {\n return false;\n }\n this.editor.execute('heading', { value: modelName });\n });\n });\n }\n }\n /**\n * Adds autoformatting related to {@link module:block-quote/blockquote~BlockQuote}.\n *\n * When typed:\n * * `> ` – A paragraph will be changed to a block quote.\n */\n _addBlockQuoteAutoformats() {\n if (this.editor.commands.get('blockQuote')) {\n blockAutoformatEditing(this.editor, this, /^>\\s$/, 'blockQuote');\n }\n }\n /**\n * Adds autoformatting related to {@link module:code-block/codeblock~CodeBlock}.\n *\n * When typed:\n * - `` ``` `` – A paragraph will be changed to a code block.\n */\n _addCodeBlockAutoformats() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n if (editor.commands.get('codeBlock')) {\n blockAutoformatEditing(editor, this, /^```$/, () => {\n if (selection.getFirstPosition().parent.is('element', 'listItem')) {\n return false;\n }\n this.editor.execute('codeBlock', {\n usePreviousLanguageChoice: true\n });\n });\n }\n }\n /**\n * Adds autoformatting related to {@link module:horizontal-line/horizontalline~HorizontalLine}.\n *\n * When typed:\n * - `` --- `` – Will be replaced with a horizontal line.\n */\n _addHorizontalLineAutoformats() {\n if (this.editor.commands.get('horizontalLine')) {\n blockAutoformatEditing(this.editor, this, /^---$/, 'horizontalLine');\n }\n }\n}\n/**\n * Helper function for getting `inlineAutoformatEditing` callbacks that checks if command is enabled.\n */\nfunction getCallbackFunctionForInlineAutoformat(editor, attributeKey) {\n return (writer, rangesToFormat) => {\n const command = editor.commands.get(attributeKey);\n if (!command.isEnabled) {\n return false;\n }\n const validRanges = editor.model.schema.getValidRanges(rangesToFormat, attributeKey);\n for (const range of validRanges) {\n writer.setAttribute(attributeKey, true, range);\n }\n // After applying attribute to the text, remove given attribute from the selection.\n // This way user is able to type a text without attribute used by auto formatter.\n writer.removeSelectionAttribute(attributeKey);\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/attributecommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command\n * that toggles a single attribute on a text or an element.\n *\n * `AttributeCommand` uses {@link module:engine/model/document~Document#selection}\n * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.\n *\n * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled\n * for the current selection and to which nodes the attribute can be applied.\n */\nexport default class AttributeCommand extends Command {\n /**\n * @param attributeKey Attribute that will be set by the command.\n */\n constructor(editor, attributeKey) {\n super(editor);\n this.attributeKey = attributeKey;\n }\n /**\n * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.value = this._getValueFromFirstAllowedNode();\n this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);\n }\n /**\n * Executes the command – applies the attribute to the selection or removes it from the selection.\n *\n * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.\n *\n * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:\n *\n * * If the selection is on a range, the command applies the attribute to all nodes in that range\n * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).\n * * If the selection is collapsed in a non-empty node, the command applies the attribute to the\n * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).\n * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note\n * that the selection inherits all attributes from a node if it is in an empty node).\n *\n * @fires execute\n * @param options Command options.\n * @param options.forceValue If set, it will force the command behavior. If `true`,\n * the command will apply the attribute, otherwise the command will remove the attribute.\n * If not set, the command will look for its current value to decide what it should do.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const value = (options.forceValue === undefined) ? !this.value : options.forceValue;\n model.change(writer => {\n if (selection.isCollapsed) {\n if (value) {\n writer.setSelectionAttribute(this.attributeKey, true);\n }\n else {\n writer.removeSelectionAttribute(this.attributeKey);\n }\n }\n else {\n const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);\n for (const range of ranges) {\n if (value) {\n writer.setAttribute(this.attributeKey, value, range);\n }\n else {\n writer.removeAttribute(this.attributeKey, range);\n }\n }\n }\n });\n }\n /**\n * Checks the attribute value of the first node in the selection that allows the attribute.\n * For the collapsed selection returns the selection attribute.\n *\n * @returns The attribute value.\n */\n _getValueFromFirstAllowedNode() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n if (selection.isCollapsed) {\n return selection.hasAttribute(this.attributeKey);\n }\n for (const range of selection.getRanges()) {\n for (const item of range.getItems()) {\n if (schema.checkAttribute(item, this.attributeKey)) {\n return item.hasAttribute(this.attributeKey);\n }\n }\n }\n return false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold/boldediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport AttributeCommand from '../attributecommand.js';\nconst BOLD = 'bold';\n/**\n * The bold editing feature.\n *\n * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view\n * as a `<strong>` element.\n */\nexport default class BoldEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BoldEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = this.editor.t;\n // Allow bold attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: BOLD });\n editor.model.schema.setAttributeProperties(BOLD, {\n isFormatting: true,\n copyOnEnter: true\n });\n // Build converter from model to view for data and editing pipelines.\n editor.conversion.attributeToElement({\n model: BOLD,\n view: 'strong',\n upcastAlso: [\n 'b',\n viewElement => {\n const fontWeight = viewElement.getStyle('font-weight');\n if (!fontWeight) {\n return null;\n }\n // Value of the `font-weight` attribute can be defined as a string or a number.\n if (fontWeight == 'bold' || Number(fontWeight) >= 600) {\n return {\n name: true,\n styles: ['font-weight']\n };\n }\n return null;\n }\n ]\n });\n // Create bold command.\n editor.commands.add(BOLD, new AttributeCommand(editor, BOLD));\n // Set the Ctrl+B keystroke.\n editor.keystrokes.set('CTRL+B', BOLD);\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Bold text'),\n keystroke: 'CTRL+B'\n }\n ]\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\n/**\n * Returns a function that creates a (toolbar or menu bar) button for a basic style feature.\n */\nexport function getButtonCreator({ editor, commandName, plugin, icon, label, keystroke }) {\n return (ButtonClass) => {\n const command = editor.commands.get(commandName);\n const view = new ButtonClass(editor.locale);\n view.set({\n label,\n icon,\n keystroke,\n isToggleable: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n view.bind('isOn').to(command, 'value');\n if (view instanceof MenuBarMenuListItemButtonView) {\n view.set({\n role: 'menuitemcheckbox'\n });\n }\n else {\n view.set({\n tooltip: true\n });\n }\n // Execute the command.\n plugin.listenTo(view, 'execute', () => {\n editor.execute(commandName);\n editor.editing.view.focus();\n });\n return view;\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold/boldui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\nimport { getButtonCreator } from '../utils.js';\nconst BOLD = 'bold';\n/**\n * The bold UI feature. It introduces the Bold button.\n */\nexport default class BoldUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BoldUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.locale.t;\n const createButton = getButtonCreator({\n editor,\n commandName: BOLD,\n plugin: this,\n icon: icons.bold,\n label: t('Bold'),\n keystroke: 'CTRL+B'\n });\n // Add bold button to feature components.\n editor.ui.componentFactory.add(BOLD, () => createButton(ButtonView));\n editor.ui.componentFactory.add('menuBar:' + BOLD, () => createButton(MenuBarMenuListItemButtonView));\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code/codeediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { TwoStepCaretMovement, inlineHighlight } from 'ckeditor5/src/typing.js';\nimport AttributeCommand from '../attributecommand.js';\nconst CODE = 'code';\nconst HIGHLIGHT_CLASS = 'ck-code_selected';\n/**\n * The code editing feature.\n *\n * It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view\n * as a `<code>` element.\n */\nexport default class CodeEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TwoStepCaretMovement];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = this.editor.t;\n // Allow code attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: CODE });\n editor.model.schema.setAttributeProperties(CODE, {\n isFormatting: true,\n copyOnEnter: false\n });\n editor.conversion.attributeToElement({\n model: CODE,\n view: 'code',\n upcastAlso: {\n styles: {\n 'word-wrap': 'break-word'\n }\n }\n });\n // Create code command.\n editor.commands.add(CODE, new AttributeCommand(editor, CODE));\n // Enable two-step caret movement for `code` attribute.\n editor.plugins.get(TwoStepCaretMovement).registerAttribute(CODE);\n // Setup highlight over selected element.\n inlineHighlight(editor, CODE, 'code', HIGHLIGHT_CLASS);\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Move out of an inline code style'),\n keystroke: [\n ['arrowleft', 'arrowleft'],\n ['arrowright', 'arrowright']\n ]\n }\n ]\n });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./code.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./code.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code/codeui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\nimport { getButtonCreator } from '../utils.js';\nimport codeIcon from '../../theme/icons/code.svg';\nimport '../../theme/code.css';\nconst CODE = 'code';\n/**\n * The code UI feature. It introduces the Code button.\n */\nexport default class CodeUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.locale.t;\n const createButton = getButtonCreator({\n editor,\n commandName: CODE,\n plugin: this,\n icon: codeIcon,\n label: t('Code')\n });\n // Add code button to feature components.\n editor.ui.componentFactory.add(CODE, () => createButton(ButtonView));\n editor.ui.componentFactory.add('menuBar:' + CODE, () => createButton(MenuBarMenuListItemButtonView));\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m12.5 5.7 5.2 3.9v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4 4.7-3.5L11.5 7l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zm-5.2 0L2 9.6v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5L8.2 7l.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic/italicediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport AttributeCommand from '../attributecommand.js';\nconst ITALIC = 'italic';\n/**\n * The italic editing feature.\n *\n * It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model\n * which renders to the view as an `<i>` element.\n */\nexport default class ItalicEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ItalicEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = this.editor.t;\n // Allow italic attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: ITALIC });\n editor.model.schema.setAttributeProperties(ITALIC, {\n isFormatting: true,\n copyOnEnter: true\n });\n editor.conversion.attributeToElement({\n model: ITALIC,\n view: 'i',\n upcastAlso: [\n 'em',\n {\n styles: {\n 'font-style': 'italic'\n }\n }\n ]\n });\n // Create italic command.\n editor.commands.add(ITALIC, new AttributeCommand(editor, ITALIC));\n // Set the Ctrl+I keystroke.\n editor.keystrokes.set('CTRL+I', ITALIC);\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Italic text'),\n keystroke: 'CTRL+I'\n }\n ]\n });\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic/italicui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { MenuBarMenuListItemButtonView, ButtonView } from 'ckeditor5/src/ui.js';\nimport { getButtonCreator } from '../utils.js';\nimport italicIcon from '../../theme/icons/italic.svg';\nconst ITALIC = 'italic';\n/**\n * The italic UI feature. It introduces the Italic button.\n */\nexport default class ItalicUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ItalicUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.locale.t;\n const createButton = getButtonCreator({\n editor,\n commandName: ITALIC,\n plugin: this,\n icon: italicIcon,\n keystroke: 'CTRL+I',\n label: t('Italic')\n });\n // Add bold button to feature components.\n editor.ui.componentFactory.add(ITALIC, () => createButton(ButtonView));\n editor.ui.componentFactory.add('menuBar:' + ITALIC, () => createButton(MenuBarMenuListItemButtonView));\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough/strikethroughediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport AttributeCommand from '../attributecommand.js';\nconst STRIKETHROUGH = 'strikethrough';\n/**\n * The strikethrough editing feature.\n *\n * It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the\n * `strikethroughsthrough` attribute in the model which renders to the view\n * as a `<s>` element.\n */\nexport default class StrikethroughEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'StrikethroughEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = this.editor.t;\n // Allow strikethrough attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: STRIKETHROUGH });\n editor.model.schema.setAttributeProperties(STRIKETHROUGH, {\n isFormatting: true,\n copyOnEnter: true\n });\n editor.conversion.attributeToElement({\n model: STRIKETHROUGH,\n view: 's',\n upcastAlso: [\n 'del',\n 'strike',\n {\n styles: {\n 'text-decoration': 'line-through'\n }\n }\n ]\n });\n // Create strikethrough command.\n editor.commands.add(STRIKETHROUGH, new AttributeCommand(editor, STRIKETHROUGH));\n // Set the Ctrl+Shift+X keystroke.\n editor.keystrokes.set('CTRL+SHIFT+X', 'strikethrough');\n // Add the information about the keystroke to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Strikethrough text'),\n keystroke: 'CTRL+SHIFT+X'\n }\n ]\n });\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z\\\"/><path d=\\\"M3 10.5V9h14v1.5z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough/strikethroughui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\nimport { getButtonCreator } from '../utils.js';\nimport strikethroughIcon from '../../theme/icons/strikethrough.svg';\nconst STRIKETHROUGH = 'strikethrough';\n/**\n * The strikethrough UI feature. It introduces the Strikethrough button.\n */\nexport default class StrikethroughUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'StrikethroughUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.locale.t;\n const createButton = getButtonCreator({\n editor,\n commandName: STRIKETHROUGH,\n plugin: this,\n icon: strikethroughIcon,\n keystroke: 'CTRL+SHIFT+X',\n label: t('Strikethrough')\n });\n // Add strikethrough button to feature components.\n editor.ui.componentFactory.add(STRIKETHROUGH, () => createButton(ButtonView));\n editor.ui.componentFactory.add('menuBar:' + STRIKETHROUGH, () => createButton(MenuBarMenuListItemButtonView));\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquotecommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { first } from 'ckeditor5/src/utils.js';\n/**\n * The block quote command plugin.\n *\n * @extends module:core/command~Command\n */\nexport default class BlockQuoteCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n this.value = this._getValue();\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the command. When the command {@link #value is on}, all top-most block quotes within\n * the selection will be removed. If it is off, all selected blocks will be wrapped with\n * a block quote.\n *\n * @fires execute\n * @param options Command options.\n * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply a block quote,\n * otherwise the command will remove the block quote. If not set, the command will act basing on its current value.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n const blocks = Array.from(selection.getSelectedBlocks());\n const value = (options.forceValue === undefined) ? !this.value : options.forceValue;\n model.change(writer => {\n if (!value) {\n this._removeQuote(writer, blocks.filter(findQuote));\n }\n else {\n const blocksToQuote = blocks.filter(block => {\n // Already quoted blocks needs to be considered while quoting too\n // in order to reuse their <bQ> elements.\n return findQuote(block) || checkCanBeQuoted(schema, block);\n });\n this._applyQuote(writer, blocksToQuote);\n }\n });\n }\n /**\n * Checks the command's {@link #value}.\n */\n _getValue() {\n const selection = this.editor.model.document.selection;\n const firstBlock = first(selection.getSelectedBlocks());\n // In the current implementation, the block quote must be an immediate parent of a block element.\n return !!(firstBlock && findQuote(firstBlock));\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n if (this.value) {\n return true;\n }\n const selection = this.editor.model.document.selection;\n const schema = this.editor.model.schema;\n const firstBlock = first(selection.getSelectedBlocks());\n if (!firstBlock) {\n return false;\n }\n return checkCanBeQuoted(schema, firstBlock);\n }\n /**\n * Removes the quote from given blocks.\n *\n * If blocks which are supposed to be \"unquoted\" are in the middle of a quote,\n * start it or end it, then the quote will be split (if needed) and the blocks\n * will be moved out of it, so other quoted blocks remained quoted.\n */\n _removeQuote(writer, blocks) {\n // Unquote all groups of block. Iterate in the reverse order to not break following ranges.\n getRangesOfBlockGroups(writer, blocks).reverse().forEach(groupRange => {\n if (groupRange.start.isAtStart && groupRange.end.isAtEnd) {\n writer.unwrap(groupRange.start.parent);\n return;\n }\n // The group of blocks are at the beginning of an <bQ> so let's move them left (out of the <bQ>).\n if (groupRange.start.isAtStart) {\n const positionBefore = writer.createPositionBefore(groupRange.start.parent);\n writer.move(groupRange, positionBefore);\n return;\n }\n // The blocks are in the middle of an <bQ> so we need to split the <bQ> after the last block\n // so we move the items there.\n if (!groupRange.end.isAtEnd) {\n writer.split(groupRange.end);\n }\n // Now we are sure that groupRange.end.isAtEnd is true, so let's move the blocks right.\n const positionAfter = writer.createPositionAfter(groupRange.end.parent);\n writer.move(groupRange, positionAfter);\n });\n }\n /**\n * Applies the quote to given blocks.\n */\n _applyQuote(writer, blocks) {\n const quotesToMerge = [];\n // Quote all groups of block. Iterate in the reverse order to not break following ranges.\n getRangesOfBlockGroups(writer, blocks).reverse().forEach(groupRange => {\n let quote = findQuote(groupRange.start);\n if (!quote) {\n quote = writer.createElement('blockQuote');\n writer.wrap(groupRange, quote);\n }\n quotesToMerge.push(quote);\n });\n // Merge subsequent <bQ> elements. Reverse the order again because this time we want to go through\n // the <bQ> elements in the source order (due to how merge works – it moves the right element's content\n // to the first element and removes the right one. Since we may need to merge a couple of subsequent `<bQ>` elements\n // we want to keep the reference to the first (furthest left) one.\n quotesToMerge.reverse().reduce((currentQuote, nextQuote) => {\n if (currentQuote.nextSibling == nextQuote) {\n writer.merge(writer.createPositionAfter(currentQuote));\n return currentQuote;\n }\n return nextQuote;\n });\n }\n}\nfunction findQuote(elementOrPosition) {\n return elementOrPosition.parent.name == 'blockQuote' ? elementOrPosition.parent : null;\n}\n/**\n * Returns a minimal array of ranges containing groups of subsequent blocks.\n *\n * content: abcdefgh\n * blocks: [ a, b, d, f, g, h ]\n * output ranges: [ab]c[d]e[fgh]\n */\nfunction getRangesOfBlockGroups(writer, blocks) {\n let startPosition;\n let i = 0;\n const ranges = [];\n while (i < blocks.length) {\n const block = blocks[i];\n const nextBlock = blocks[i + 1];\n if (!startPosition) {\n startPosition = writer.createPositionBefore(block);\n }\n if (!nextBlock || block.nextSibling != nextBlock) {\n ranges.push(writer.createRange(startPosition, writer.createPositionAfter(block)));\n startPosition = null;\n }\n i++;\n }\n return ranges;\n}\n/**\n * Checks whether <bQ> can wrap the block.\n */\nfunction checkCanBeQuoted(schema, block) {\n // TMP will be replaced with schema.checkWrap().\n const isBQAllowed = schema.checkChild(block.parent, 'blockQuote');\n const isBlockAllowedInBQ = schema.checkChild(['$root', 'blockQuote'], block);\n return isBQAllowed && isBlockAllowedInBQ;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquoteediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Enter } from 'ckeditor5/src/enter.js';\nimport { Delete } from 'ckeditor5/src/typing.js';\nimport BlockQuoteCommand from './blockquotecommand.js';\n/**\n * The block quote editing.\n *\n * Introduces the `'blockQuote'` command and the `'blockQuote'` model element.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuoteEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuoteEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Enter, Delete];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n editor.commands.add('blockQuote', new BlockQuoteCommand(editor));\n schema.register('blockQuote', {\n inheritAllFrom: '$container'\n });\n editor.conversion.elementToElement({ model: 'blockQuote', view: 'blockquote' });\n // Postfixer which cleans incorrect model states connected with block quotes.\n editor.model.document.registerPostFixer(writer => {\n const changes = editor.model.document.differ.getChanges();\n for (const entry of changes) {\n if (entry.type == 'insert') {\n const element = entry.position.nodeAfter;\n if (!element) {\n // We are inside a text node.\n continue;\n }\n if (element.is('element', 'blockQuote') && element.isEmpty) {\n // Added an empty blockQuote - remove it.\n writer.remove(element);\n return true;\n }\n else if (element.is('element', 'blockQuote') && !schema.checkChild(entry.position, element)) {\n // Added a blockQuote in incorrect place. Unwrap it so the content inside is not lost.\n writer.unwrap(element);\n return true;\n }\n else if (element.is('element')) {\n // Just added an element. Check that all children meet the scheme rules.\n const range = writer.createRangeIn(element);\n for (const child of range.getItems()) {\n if (child.is('element', 'blockQuote') &&\n !schema.checkChild(writer.createPositionBefore(child), child)) {\n writer.unwrap(child);\n return true;\n }\n }\n }\n }\n else if (entry.type == 'remove') {\n const parent = entry.position.parent;\n if (parent.is('element', 'blockQuote') && parent.isEmpty) {\n // Something got removed and now blockQuote is empty. Remove the blockQuote as well.\n writer.remove(parent);\n return true;\n }\n }\n }\n return false;\n });\n const viewDocument = this.editor.editing.view.document;\n const selection = editor.model.document.selection;\n const blockQuoteCommand = editor.commands.get('blockQuote');\n // Overwrite default Enter key behavior.\n // If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.\n this.listenTo(viewDocument, 'enter', (evt, data) => {\n if (!selection.isCollapsed || !blockQuoteCommand.value) {\n return;\n }\n const positionParent = selection.getLastPosition().parent;\n if (positionParent.isEmpty) {\n editor.execute('blockQuote');\n editor.editing.view.scrollToTheSelection();\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'blockquote' });\n // Overwrite default Backspace key behavior.\n // If Backspace key is pressed with selection collapsed in first empty block inside a quote, break the quote.\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n if (data.direction != 'backward' || !selection.isCollapsed || !blockQuoteCommand.value) {\n return;\n }\n const positionParent = selection.getLastPosition().parent;\n if (positionParent.isEmpty && !positionParent.previousSibling) {\n editor.execute('blockQuote');\n editor.editing.view.scrollToTheSelection();\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'blockquote' });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./blockquote.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./blockquote.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquoteui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\nimport '../theme/blockquote.css';\n/**\n * The block quote UI plugin.\n *\n * It introduces the `'blockQuote'` button.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuoteUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuoteUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.ui.componentFactory.add('blockQuote', () => {\n const buttonView = this._createButton(ButtonView);\n buttonView.set({\n tooltip: true\n });\n return buttonView;\n });\n editor.ui.componentFactory.add('menuBar:blockQuote', () => {\n const buttonView = this._createButton(MenuBarMenuListItemButtonView);\n buttonView.set({\n role: 'menuitemcheckbox'\n });\n return buttonView;\n });\n }\n /**\n * Creates a button for block quote command to use either in toolbar or in menu bar.\n */\n _createButton(ButtonClass) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get('blockQuote');\n const view = new ButtonClass(editor.locale);\n const t = locale.t;\n view.set({\n label: t('Block quote'),\n icon: icons.quote,\n isToggleable: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n view.bind('isOn').to(command, 'value');\n // Execute the command.\n this.listenTo(view, 'execute', () => {\n editor.execute('blockQuote');\n editor.editing.view.focus();\n });\n return view;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paragraph/paragraphcommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { first } from '@ckeditor/ckeditor5-utils';\n/**\n * The paragraph command.\n */\nexport default class ParagraphCommand extends Command {\n constructor(editor) {\n super(editor);\n // Since this command may pass selection in execution block, it should be checked directly.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const document = model.document;\n const block = first(document.selection.getSelectedBlocks());\n this.value = !!block && block.is('element', 'paragraph');\n this.isEnabled = !!block && checkCanBecomeParagraph(block, model.schema);\n }\n /**\n * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection\n * will be turned to paragraphs.\n *\n * @fires execute\n * @param options Options for the executed command.\n * @param options.selection The selection that the command should be applied to. By default,\n * if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const document = model.document;\n const selection = options.selection || document.selection;\n // Don't execute command if selection is in non-editable place.\n if (!model.canEditAt(selection)) {\n return;\n }\n model.change(writer => {\n const blocks = selection.getSelectedBlocks();\n for (const block of blocks) {\n if (!block.is('element', 'paragraph') && checkCanBecomeParagraph(block, model.schema)) {\n writer.rename(block, 'paragraph');\n }\n }\n });\n }\n}\n/**\n * Checks whether the given block can be replaced by a paragraph.\n *\n * @param block A block to be tested.\n * @param schema The schema of the document.\n */\nfunction checkCanBecomeParagraph(block, schema) {\n return schema.checkChild(block.parent, 'paragraph') && !schema.isObject(block);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paragraph/insertparagraphcommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\n/**\n * The insert paragraph command. It inserts a new paragraph at a specific\n * {@link module:engine/model/position~Position document position}.\n *\n * ```ts\n * // Insert a new paragraph before an element in the document.\n * editor.execute( 'insertParagraph', {\n * position: editor.model.createPositionBefore( element )\n * } );\n * ```\n *\n * If a paragraph is disallowed in the context of the specific position, the command\n * will attempt to split position ancestors to find a place where it is possible\n * to insert a paragraph.\n *\n * **Note**: This command moves the selection to the inserted paragraph.\n */\nexport default class InsertParagraphCommand extends Command {\n constructor(editor) {\n super(editor);\n // Since this command passes position in execution block instead of selection, it should be checked directly.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * Executes the command.\n *\n * @param options Options for the executed command.\n * @param options.position The model position at which the new paragraph will be inserted.\n * @param options.attributes Attributes keys and values to set on a inserted paragraph.\n * @fires execute\n */\n execute(options) {\n const model = this.editor.model;\n const attributes = options.attributes;\n let position = options.position;\n // Don't execute command if position is in non-editable place.\n if (!model.canEditAt(position)) {\n return;\n }\n model.change(writer => {\n position = this._findPositionToInsertParagraph(position, writer);\n if (!position) {\n return;\n }\n const paragraph = writer.createElement('paragraph');\n if (attributes) {\n model.schema.setAllowedAttributes(paragraph, attributes, writer);\n }\n model.insertContent(paragraph, position);\n writer.setSelection(paragraph, 'in');\n });\n }\n /**\n * Returns the best position to insert a new paragraph.\n */\n _findPositionToInsertParagraph(position, writer) {\n const model = this.editor.model;\n if (model.schema.checkChild(position, 'paragraph')) {\n return position;\n }\n const allowedParent = model.schema.findAllowedParent(position, 'paragraph');\n // It could be there's no ancestor limit that would allow paragraph.\n // In theory, \"paragraph\" could be disallowed even in the \"$root\".\n if (!allowedParent) {\n return null;\n }\n const positionParent = position.parent;\n const isTextAllowed = model.schema.checkChild(positionParent, '$text');\n // At empty $block or at the end of $block.\n // <paragraph>[]</paragraph> ---> <paragraph></paragraph><paragraph>[]</paragraph>\n // <paragraph>foo[]</paragraph> ---> <paragraph>foo</paragraph><paragraph>[]</paragraph>\n if (positionParent.isEmpty || isTextAllowed && position.isAtEnd) {\n return model.createPositionAfter(positionParent);\n }\n // At the start of $block with text.\n // <paragraph>[]foo</paragraph> ---> <paragraph>[]</paragraph><paragraph>foo</paragraph>\n if (!positionParent.isEmpty && isTextAllowed && position.isAtStart) {\n return model.createPositionBefore(positionParent);\n }\n return writer.split(position, allowedParent).position;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paragraph/paragraph\n */\nimport ParagraphCommand from './paragraphcommand.js';\nimport InsertParagraphCommand from './insertparagraphcommand.js';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n/**\n * The paragraph feature for the editor.\n *\n * It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.\n *\n * It also brings two editors commands:\n *\n * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all\n * blocks in the model selection into paragraphs.\n * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command\n * that inserts a new paragraph at a specified location in the model.\n */\nclass Paragraph extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Paragraph';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n editor.commands.add('paragraph', new ParagraphCommand(editor));\n editor.commands.add('insertParagraph', new InsertParagraphCommand(editor));\n // Schema.\n model.schema.register('paragraph', { inheritAllFrom: '$block' });\n editor.conversion.elementToElement({ model: 'paragraph', view: 'p' });\n // Conversion for paragraph-like elements which has not been converted by any plugin.\n editor.conversion.for('upcast').elementToElement({\n model: (viewElement, { writer }) => {\n if (!Paragraph.paragraphLikeElements.has(viewElement.name)) {\n return null;\n }\n // Do not auto-paragraph empty elements.\n if (viewElement.isEmpty) {\n return null;\n }\n return writer.createElement('paragraph');\n },\n view: /.+/,\n converterPriority: 'low'\n });\n }\n}\n/**\n * A list of element names which should be treated by the autoparagraphing algorithms as\n * paragraph-like. This means that e.g. the following content:\n *\n * ```html\n * <h1>Foo</h1>\n * <table>\n * <tr>\n * <td>X</td>\n * <td>\n * <ul>\n * <li>Y</li>\n * <li>Z</li>\n * </ul>\n * </td>\n * </tr>\n * </table>\n * ```\n *\n * contains five paragraph-like elements: `<h1>`, two `<td>`s and two `<li>`s.\n * Hence, if none of the features is going to convert those elements the above content will be automatically handled\n * by the paragraph feature and converted to:\n *\n * ```html\n * <p>Foo</p>\n * <p>X</p>\n * <p>Y</p>\n * <p>Z</p>\n * ```\n *\n * Note: The `<td>` containing two `<li>` elements was ignored as the innermost paragraph-like elements\n * have a priority upon conversion.\n */\nParagraph.paragraphLikeElements = new Set([\n 'blockquote',\n 'dd',\n 'div',\n 'dt',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'li',\n 'p',\n 'td',\n 'th'\n]);\nexport default Paragraph;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/headingcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { first } from 'ckeditor5/src/utils.js';\n/**\n * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.\n */\nexport default class HeadingCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor Editor instance.\n * @param modelElements Names of the element which this command can apply in the model.\n */\n constructor(editor, modelElements) {\n super(editor);\n this.modelElements = modelElements;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const block = first(this.editor.model.document.selection.getSelectedBlocks());\n this.value = !!block && this.modelElements.includes(block.name) && block.name;\n this.isEnabled = !!block && this.modelElements.some(heading => checkCanBecomeHeading(block, heading, this.editor.model.schema));\n }\n /**\n * Executes the command. Applies the heading to the selected blocks or, if the first selected\n * block is a heading already, turns selected headings (of this level only) to paragraphs.\n *\n * @param options.value Name of the element which this command will apply in the model.\n * @fires execute\n */\n execute(options) {\n const model = this.editor.model;\n const document = model.document;\n const modelElement = options.value;\n model.change(writer => {\n const blocks = Array.from(document.selection.getSelectedBlocks())\n .filter(block => {\n return checkCanBecomeHeading(block, modelElement, model.schema);\n });\n for (const block of blocks) {\n if (!block.is('element', modelElement)) {\n writer.rename(block, modelElement);\n }\n }\n });\n }\n}\n/**\n * Checks whether the given block can be replaced by a specific heading.\n *\n * @param block A block to be tested.\n * @param heading Command element name in the model.\n * @param schema The schema of the document.\n */\nfunction checkCanBecomeHeading(block, heading, schema) {\n return schema.checkChild(block.parent, heading) && !schema.isObject(block);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/headingediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Paragraph } from 'ckeditor5/src/paragraph.js';\nimport { priorities } from 'ckeditor5/src/utils.js';\nimport HeadingCommand from './headingcommand.js';\nconst defaultModelElement = 'paragraph';\n/**\n * The headings engine feature. It handles switching between block formats – headings and paragraph.\n * This class represents the engine part of the heading feature. See also {@link module:heading/heading~Heading}.\n * It introduces `heading1`-`headingN` commands which allow to convert paragraphs into headings.\n */\nexport default class HeadingEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HeadingEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('heading', {\n options: [\n { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },\n { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },\n { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },\n { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Paragraph];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const options = editor.config.get('heading.options');\n const modelElements = [];\n for (const option of options) {\n // Skip paragraph - it is defined in required Paragraph feature.\n if (option.model === 'paragraph') {\n continue;\n }\n // Schema.\n editor.model.schema.register(option.model, {\n inheritAllFrom: '$block'\n });\n editor.conversion.elementToElement(option);\n modelElements.push(option.model);\n }\n this._addDefaultH1Conversion(editor);\n // Register the heading command for this option.\n editor.commands.add('heading', new HeadingCommand(editor, modelElements));\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n // If the enter command is added to the editor, alter its behavior.\n // Enter at the end of a heading element should create a paragraph.\n const editor = this.editor;\n const enterCommand = editor.commands.get('enter');\n const options = editor.config.get('heading.options');\n if (enterCommand) {\n this.listenTo(enterCommand, 'afterExecute', (evt, data) => {\n const positionParent = editor.model.document.selection.getFirstPosition().parent;\n const isHeading = options.some(option => positionParent.is('element', option.model));\n if (isHeading && !positionParent.is('element', defaultModelElement) && positionParent.childCount === 0) {\n data.writer.rename(positionParent, defaultModelElement);\n }\n });\n }\n }\n /**\n * Adds default conversion for `h1` -> `heading1` with a low priority.\n *\n * @param editor Editor instance on which to add the `h1` conversion.\n */\n _addDefaultH1Conversion(editor) {\n editor.conversion.for('upcast').elementToElement({\n model: 'heading1',\n view: 'h1',\n // With a `low` priority, `paragraph` plugin autoparagraphing mechanism is executed. Make sure\n // this listener is called before it. If not, `h1` will be transformed into a paragraph.\n converterPriority: priorities.low + 1\n });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./heading.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./heading.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/headingui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ViewModel, createDropdown, addListToDropdown, MenuBarMenuListItemView, MenuBarMenuListView, MenuBarMenuView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\nimport { Collection } from 'ckeditor5/src/utils.js';\nimport { getLocalizedOptions } from './utils.js';\nimport '../theme/heading.css';\n/**\n * The headings UI feature. It introduces the `headings` dropdown.\n */\nexport default class HeadingUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HeadingUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const options = getLocalizedOptions(editor);\n const defaultTitle = t('Choose heading');\n const accessibleLabel = t('Heading');\n // Register UI component.\n editor.ui.componentFactory.add('heading', locale => {\n const titles = {};\n const itemDefinitions = new Collection();\n const headingCommand = editor.commands.get('heading');\n const paragraphCommand = editor.commands.get('paragraph');\n const commands = [headingCommand];\n for (const option of options) {\n const def = {\n type: 'button',\n model: new ViewModel({\n label: option.title,\n class: option.class,\n role: 'menuitemradio',\n withText: true\n })\n };\n if (option.model === 'paragraph') {\n def.model.bind('isOn').to(paragraphCommand, 'value');\n def.model.set('commandName', 'paragraph');\n commands.push(paragraphCommand);\n }\n else {\n def.model.bind('isOn').to(headingCommand, 'value', value => value === option.model);\n def.model.set({\n commandName: 'heading',\n commandValue: option.model\n });\n }\n // Add the option to the collection.\n itemDefinitions.add(def);\n titles[option.model] = option.title;\n }\n const dropdownView = createDropdown(locale);\n addListToDropdown(dropdownView, itemDefinitions, {\n ariaLabel: accessibleLabel,\n role: 'menu'\n });\n dropdownView.buttonView.set({\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined,\n isOn: false,\n withText: true,\n tooltip: accessibleLabel\n });\n dropdownView.extendTemplate({\n attributes: {\n class: [\n 'ck-heading-dropdown'\n ]\n }\n });\n dropdownView.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => {\n return areEnabled.some(isEnabled => isEnabled);\n });\n dropdownView.buttonView.bind('label').to(headingCommand, 'value', paragraphCommand, 'value', (heading, paragraph) => {\n const whichModel = paragraph ? 'paragraph' : heading;\n if (typeof whichModel === 'boolean') {\n return defaultTitle;\n }\n // If none of the commands is active, display default title.\n if (!titles[whichModel]) {\n return defaultTitle;\n }\n return titles[whichModel];\n });\n dropdownView.buttonView.bind('ariaLabel').to(headingCommand, 'value', paragraphCommand, 'value', (heading, paragraph) => {\n const whichModel = paragraph ? 'paragraph' : heading;\n if (typeof whichModel === 'boolean') {\n return accessibleLabel;\n }\n // If none of the commands is active, display default title.\n if (!titles[whichModel]) {\n return accessibleLabel;\n }\n return `${titles[whichModel]}, ${accessibleLabel}`;\n });\n // Execute command when an item from the dropdown is selected.\n this.listenTo(dropdownView, 'execute', evt => {\n const { commandName, commandValue } = evt.source;\n editor.execute(commandName, commandValue ? { value: commandValue } : undefined);\n editor.editing.view.focus();\n });\n return dropdownView;\n });\n editor.ui.componentFactory.add('menuBar:heading', locale => {\n const menuView = new MenuBarMenuView(locale);\n const headingCommand = editor.commands.get('heading');\n const paragraphCommand = editor.commands.get('paragraph');\n const commands = [headingCommand];\n const listView = new MenuBarMenuListView(locale);\n menuView.set({\n class: 'ck-heading-dropdown'\n });\n listView.set({\n ariaLabel: t('Heading'),\n role: 'menu'\n });\n menuView.buttonView.set({\n label: t('Heading')\n });\n menuView.panelView.children.add(listView);\n for (const option of options) {\n const listItemView = new MenuBarMenuListItemView(locale, menuView);\n const buttonView = new MenuBarMenuListItemButtonView(locale);\n listItemView.children.add(buttonView);\n listView.items.add(listItemView);\n buttonView.set({\n isToggleable: true,\n label: option.title,\n role: 'menuitemradio',\n class: option.class\n });\n buttonView.delegate('execute').to(menuView);\n buttonView.on('execute', () => {\n const commandName = option.model === 'paragraph' ? 'paragraph' : 'heading';\n editor.execute(commandName, { value: option.model });\n editor.editing.view.focus();\n });\n if (option.model === 'paragraph') {\n buttonView.bind('isOn').to(paragraphCommand, 'value');\n commands.push(paragraphCommand);\n }\n else {\n buttonView.bind('isOn').to(headingCommand, 'value', value => value === option.model);\n }\n }\n menuView.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => {\n return areEnabled.some(isEnabled => isEnabled);\n });\n return menuView;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns heading options as defined in `config.heading.options` but processed to consider\n * the editor localization, i.e. to display {@link module:heading/headingconfig~HeadingOption}\n * in the correct language.\n *\n * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}\n * when the user configuration is defined because the editor does not exist yet.\n */\nexport function getLocalizedOptions(editor) {\n const t = editor.t;\n const localizedTitles = {\n 'Paragraph': t('Paragraph'),\n 'Heading 1': t('Heading 1'),\n 'Heading 2': t('Heading 2'),\n 'Heading 3': t('Heading 3'),\n 'Heading 4': t('Heading 4'),\n 'Heading 5': t('Heading 5'),\n 'Heading 6': t('Heading 6')\n };\n return editor.config.get('heading.options').map(option => {\n const title = localizedTitles[option.title];\n if (title && title != option.title) {\n option.title = title;\n }\n return option;\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/title\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { first } from 'ckeditor5/src/utils.js';\nimport { DowncastWriter, enablePlaceholder, hidePlaceholder, needsPlaceholder, showPlaceholder } from 'ckeditor5/src/engine.js';\n// A list of element names that should be treated by the Title plugin as title-like.\n// This means that an element of a type from this list will be changed to a title element\n// when it is the first element in the root.\nconst titleLikeElements = new Set(['paragraph', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6']);\n/**\n * The Title plugin.\n *\n * It splits the document into `Title` and `Body` sections.\n */\nexport default class Title extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A reference to an empty paragraph in the body\n * created when there is no element in the body for the placeholder purposes.\n */\n this._bodyPlaceholder = new Map();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Title';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return ['Paragraph'];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n // To use the schema for disabling some features when the selection is inside the title element\n // it is needed to create the following structure:\n //\n // <title>\n // <title-content>The title text</title-content>\n // </title>\n //\n // See: https://github.com/ckeditor/ckeditor5/issues/2005.\n model.schema.register('title', { isBlock: true, allowIn: '$root' });\n model.schema.register('title-content', { isBlock: true, allowIn: 'title', allowAttributes: ['alignment'] });\n model.schema.extend('$text', { allowIn: 'title-content' });\n // Disallow all attributes in `title-content`.\n model.schema.addAttributeCheck(context => {\n if (context.endsWith('title-content $text')) {\n return false;\n }\n });\n // Because `title` is represented by two elements in the model\n // but only one in the view, it is needed to adjust Mapper.\n editor.editing.mapper.on('modelToViewPosition', mapModelPositionToView(editor.editing.view));\n editor.data.mapper.on('modelToViewPosition', mapModelPositionToView(editor.editing.view));\n // Conversion.\n editor.conversion.for('downcast').elementToElement({ model: 'title-content', view: 'h1' });\n editor.conversion.for('downcast').add(dispatcher => dispatcher.on('insert:title', (evt, data, conversionApi) => {\n conversionApi.consumable.consume(data.item, evt.name);\n }));\n // Custom converter is used for data v -> m conversion to avoid calling post-fixer when setting data.\n // See https://github.com/ckeditor/ckeditor5/issues/2036.\n editor.data.upcastDispatcher.on('element:h1', dataViewModelH1Insertion, { priority: 'high' });\n editor.data.upcastDispatcher.on('element:h2', dataViewModelH1Insertion, { priority: 'high' });\n editor.data.upcastDispatcher.on('element:h3', dataViewModelH1Insertion, { priority: 'high' });\n // Take care about correct `title` element structure.\n model.document.registerPostFixer(writer => this._fixTitleContent(writer));\n // Create and take care of correct position of a `title` element.\n model.document.registerPostFixer(writer => this._fixTitleElement(writer));\n // Create element for `Body` placeholder if it is missing.\n model.document.registerPostFixer(writer => this._fixBodyElement(writer));\n // Prevent from adding extra at the end of the document.\n model.document.registerPostFixer(writer => this._fixExtraParagraph(writer));\n // Attach `Title` and `Body` placeholders to the empty title and/or content.\n this._attachPlaceholders();\n // Attach Tab handling.\n this._attachTabPressHandling();\n }\n /**\n * Returns the title of the document. Note that because this plugin does not allow any formatting inside\n * the title element, the output of this method will be a plain text, with no HTML tags.\n *\n * It is not recommended to use this method together with features that insert markers to the\n * data output, like comments or track changes features. If such markers start in the title and end in the\n * body, the result of this method might be incorrect.\n *\n * @param options Additional configuration passed to the conversion process.\n * See {@link module:engine/controller/datacontroller~DataController#get `DataController#get`}.\n * @returns The title of the document.\n */\n getTitle(options = {}) {\n const rootName = options.rootName ? options.rootName : undefined;\n const titleElement = this._getTitleElement(rootName);\n const titleContentElement = titleElement.getChild(0);\n return this.editor.data.stringify(titleContentElement, options);\n }\n /**\n * Returns the body of the document.\n *\n * Note that it is not recommended to use this method together with features that insert markers to the\n * data output, like comments or track changes features. If such markers start in the title and end in the\n * body, the result of this method might be incorrect.\n *\n * @param options Additional configuration passed to the conversion process.\n * See {@link module:engine/controller/datacontroller~DataController#get `DataController#get`}.\n * @returns The body of the document.\n */\n getBody(options = {}) {\n const editor = this.editor;\n const data = editor.data;\n const model = editor.model;\n const rootName = options.rootName ? options.rootName : undefined;\n const root = editor.model.document.getRoot(rootName);\n const view = editor.editing.view;\n const viewWriter = new DowncastWriter(view.document);\n const rootRange = model.createRangeIn(root);\n const viewDocumentFragment = viewWriter.createDocumentFragment();\n // Find all markers that intersects with body.\n const bodyStartPosition = model.createPositionAfter(root.getChild(0));\n const bodyRange = model.createRange(bodyStartPosition, model.createPositionAt(root, 'end'));\n const markers = new Map();\n for (const marker of model.markers) {\n const intersection = bodyRange.getIntersection(marker.getRange());\n if (intersection) {\n markers.set(marker.name, intersection);\n }\n }\n // Convert the entire root to view.\n data.mapper.clearBindings();\n data.mapper.bindElements(root, viewDocumentFragment);\n data.downcastDispatcher.convert(rootRange, markers, viewWriter, options);\n // Remove title element from view.\n viewWriter.remove(viewWriter.createRangeOn(viewDocumentFragment.getChild(0)));\n // view -> data\n return editor.data.processor.toData(viewDocumentFragment);\n }\n /**\n * Returns the `title` element when it is in the document. Returns `undefined` otherwise.\n */\n _getTitleElement(rootName) {\n const root = this.editor.model.document.getRoot(rootName);\n for (const child of root.getChildren()) {\n if (isTitle(child)) {\n return child;\n }\n }\n }\n /**\n * Model post-fixer callback that ensures that `title` has only one `title-content` child.\n * All additional children should be moved after the `title` element and renamed to a paragraph.\n */\n _fixTitleContent(writer) {\n let changed = false;\n for (const rootName of this.editor.model.document.getRootNames()) {\n const title = this._getTitleElement(rootName);\n // If there is no title in the content it will be created by `_fixTitleElement` post-fixer.\n // If the title has just one element, then it is correct. No fixing.\n if (!title || title.maxOffset === 1) {\n continue;\n }\n const titleChildren = Array.from(title.getChildren());\n // Skip first child because it is an allowed element.\n titleChildren.shift();\n for (const titleChild of titleChildren) {\n writer.move(writer.createRangeOn(titleChild), title, 'after');\n writer.rename(titleChild, 'paragraph');\n }\n changed = true;\n }\n return changed;\n }\n /**\n * Model post-fixer callback that creates a title element when it is missing,\n * takes care of the correct position of it and removes additional title elements.\n */\n _fixTitleElement(writer) {\n let changed = false;\n const model = this.editor.model;\n for (const modelRoot of this.editor.model.document.getRoots()) {\n const titleElements = Array.from(modelRoot.getChildren()).filter(isTitle);\n const firstTitleElement = titleElements[0];\n const firstRootChild = modelRoot.getChild(0);\n // When title element is at the beginning of the document then try to fix additional title elements (if there are any).\n if (firstRootChild.is('element', 'title')) {\n if (titleElements.length > 1) {\n fixAdditionalTitleElements(titleElements, writer, model);\n changed = true;\n }\n continue;\n }\n // When there is no title in the document and first element in the document cannot be changed\n // to the title then create an empty title element at the beginning of the document.\n if (!firstTitleElement && !titleLikeElements.has(firstRootChild.name)) {\n const title = writer.createElement('title');\n writer.insert(title, modelRoot);\n writer.insertElement('title-content', title);\n changed = true;\n continue;\n }\n if (titleLikeElements.has(firstRootChild.name)) {\n // Change the first element in the document to the title if it can be changed (is title-like).\n changeElementToTitle(firstRootChild, writer, model);\n }\n else {\n // Otherwise, move the first occurrence of the title element to the beginning of the document.\n writer.move(writer.createRangeOn(firstTitleElement), modelRoot, 0);\n }\n fixAdditionalTitleElements(titleElements, writer, model);\n changed = true;\n }\n return changed;\n }\n /**\n * Model post-fixer callback that adds an empty paragraph at the end of the document\n * when it is needed for the placeholder purposes.\n */\n _fixBodyElement(writer) {\n let changed = false;\n for (const rootName of this.editor.model.document.getRootNames()) {\n const modelRoot = this.editor.model.document.getRoot(rootName);\n if (modelRoot.childCount < 2) {\n const placeholder = writer.createElement('paragraph');\n writer.insert(placeholder, modelRoot, 1);\n this._bodyPlaceholder.set(rootName, placeholder);\n changed = true;\n }\n }\n return changed;\n }\n /**\n * Model post-fixer callback that removes a paragraph from the end of the document\n * if it was created for the placeholder purposes and is not needed anymore.\n */\n _fixExtraParagraph(writer) {\n let changed = false;\n for (const rootName of this.editor.model.document.getRootNames()) {\n const root = this.editor.model.document.getRoot(rootName);\n const placeholder = this._bodyPlaceholder.get(rootName);\n if (shouldRemoveLastParagraph(placeholder, root)) {\n this._bodyPlaceholder.delete(rootName);\n writer.remove(placeholder);\n changed = true;\n }\n }\n return changed;\n }\n /**\n * Attaches the `Title` and `Body` placeholders to the title and/or content.\n */\n _attachPlaceholders() {\n const editor = this.editor;\n const t = editor.t;\n const view = editor.editing.view;\n const sourceElement = editor.sourceElement;\n const titlePlaceholder = editor.config.get('title.placeholder') || t('Type your title');\n const bodyPlaceholder = editor.config.get('placeholder') ||\n sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.getAttribute('placeholder') ||\n t('Type or paste your content here.');\n // Attach placeholder to the view title element.\n editor.editing.downcastDispatcher.on('insert:title-content', (evt, data, conversionApi) => {\n const element = conversionApi.mapper.toViewElement(data.item);\n element.placeholder = titlePlaceholder;\n enablePlaceholder({\n view,\n element,\n keepOnFocus: true\n });\n });\n // Attach placeholder to first element after a title element and remove it if it's not needed anymore.\n // First element after title can change, so we need to observe all changes keep placeholder in sync.\n const bodyViewElements = new Map();\n // This post-fixer runs after the model post-fixer, so we can assume that the second child in view root will always exist.\n view.document.registerPostFixer(writer => {\n let hasChanged = false;\n for (const viewRoot of view.document.roots) {\n // `viewRoot` can be empty despite the model post-fixers if the model root was detached.\n if (viewRoot.isEmpty) {\n continue;\n }\n // If `viewRoot` is not empty, then we can expect at least two elements in it.\n const body = viewRoot.getChild(1);\n const oldBody = bodyViewElements.get(viewRoot.rootName);\n // If body element has changed we need to disable placeholder on the previous element and enable on the new one.\n if (body !== oldBody) {\n if (oldBody) {\n hidePlaceholder(writer, oldBody);\n writer.removeAttribute('data-placeholder', oldBody);\n }\n writer.setAttribute('data-placeholder', bodyPlaceholder, body);\n bodyViewElements.set(viewRoot.rootName, body);\n hasChanged = true;\n }\n // Then we need to display placeholder if it is needed.\n // See: https://github.com/ckeditor/ckeditor5/issues/8689.\n if (needsPlaceholder(body, true) && viewRoot.childCount === 2 && body.name === 'p') {\n hasChanged = showPlaceholder(writer, body) ? true : hasChanged;\n }\n else {\n // Or hide if it is not needed.\n hasChanged = hidePlaceholder(writer, body) ? true : hasChanged;\n }\n }\n return hasChanged;\n });\n }\n /**\n * Creates navigation between the title and body sections using <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keys.\n */\n _attachTabPressHandling() {\n const editor = this.editor;\n const model = editor.model;\n // Pressing <kbd>Tab</kbd> inside the title should move the caret to the body.\n editor.keystrokes.set('TAB', (data, cancel) => {\n model.change(writer => {\n const selection = model.document.selection;\n const selectedElements = Array.from(selection.getSelectedBlocks());\n if (selectedElements.length === 1 && selectedElements[0].is('element', 'title-content')) {\n const root = selection.getFirstPosition().root;\n const firstBodyElement = root.getChild(1);\n writer.setSelection(firstBodyElement, 0);\n cancel();\n }\n });\n });\n // Pressing <kbd>Shift</kbd>+<kbd>Tab</kbd> at the beginning of the body should move the caret to the title.\n editor.keystrokes.set('SHIFT + TAB', (data, cancel) => {\n model.change(writer => {\n const selection = model.document.selection;\n if (!selection.isCollapsed) {\n return;\n }\n const selectedElement = first(selection.getSelectedBlocks());\n const selectionPosition = selection.getFirstPosition();\n const root = editor.model.document.getRoot(selectionPosition.root.rootName);\n const title = root.getChild(0);\n const body = root.getChild(1);\n if (selectedElement === body && selectionPosition.isAtStart) {\n writer.setSelection(title.getChild(0), 0);\n cancel();\n }\n });\n });\n }\n}\n/**\n * A view-to-model converter for the h1 that appears at the beginning of the document (a title element).\n *\n * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element\n * @param evt An object containing information about the fired event.\n * @param data An object containing conversion input, a placeholder for conversion output and possibly other values.\n * @param conversionApi Conversion interface to be used by the callback.\n */\nfunction dataViewModelH1Insertion(evt, data, conversionApi) {\n const modelCursor = data.modelCursor;\n const viewItem = data.viewItem;\n if (!modelCursor.isAtStart || !modelCursor.parent.is('element', '$root')) {\n return;\n }\n if (!conversionApi.consumable.consume(viewItem, { name: true })) {\n return;\n }\n const modelWriter = conversionApi.writer;\n const title = modelWriter.createElement('title');\n const titleContent = modelWriter.createElement('title-content');\n modelWriter.append(titleContent, title);\n modelWriter.insert(title, modelCursor);\n conversionApi.convertChildren(viewItem, titleContent);\n conversionApi.updateConversionResult(title, data);\n}\n/**\n * Maps position from the beginning of the model `title` element to the beginning of the view `h1` element.\n *\n * ```html\n * <title>^<title-content>Foo</title-content></title> -> <h1>^Foo</h1>\n * ```\n */\nfunction mapModelPositionToView(editingView) {\n return (evt, data) => {\n const positionParent = data.modelPosition.parent;\n if (!positionParent.is('element', 'title')) {\n return;\n }\n const modelTitleElement = positionParent.parent;\n const viewElement = data.mapper.toViewElement(modelTitleElement);\n data.viewPosition = editingView.createPositionAt(viewElement, 0);\n evt.stop();\n };\n}\n/**\n * @returns Returns true when given element is a title. Returns false otherwise.\n */\nfunction isTitle(element) {\n return element.is('element', 'title');\n}\n/**\n * Changes the given element to the title element.\n */\nfunction changeElementToTitle(element, writer, model) {\n const title = writer.createElement('title');\n writer.insert(title, element, 'before');\n writer.insert(element, title, 0);\n writer.rename(element, 'title-content');\n model.schema.removeDisallowedAttributes([element], writer);\n}\n/**\n * Loops over the list of title elements and fixes additional ones.\n *\n * @returns Returns true when there was any change. Returns false otherwise.\n */\nfunction fixAdditionalTitleElements(titleElements, writer, model) {\n let hasChanged = false;\n for (const title of titleElements) {\n if (title.index !== 0) {\n fixTitleElement(title, writer, model);\n hasChanged = true;\n }\n }\n return hasChanged;\n}\n/**\n * Changes given title element to a paragraph or removes it when it is empty.\n */\nfunction fixTitleElement(title, writer, model) {\n const child = title.getChild(0);\n // Empty title should be removed.\n // It is created as a result of pasting to the title element.\n if (child.isEmpty) {\n writer.remove(title);\n return;\n }\n writer.move(writer.createRangeOn(child), title, 'before');\n writer.rename(child, 'paragraph');\n writer.remove(title);\n model.schema.removeDisallowedAttributes([child], writer);\n}\n/**\n * Returns true when the last paragraph in the document was created only for the placeholder\n * purpose and it's not needed anymore. Returns false otherwise.\n */\nfunction shouldRemoveLastParagraph(placeholder, root) {\n if (!placeholder || !placeholder.is('element', 'paragraph') || placeholder.childCount) {\n return false;\n }\n if (root.childCount <= 2 || root.getChild(root.childCount - 1) !== placeholder) {\n return false;\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/utils/automaticdecorators\n */\nimport { toMap } from 'ckeditor5/src/utils.js';\n/**\n * Helper class that ties together all {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition} and provides\n * the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement downcast dispatchers} for them.\n */\nexport default class AutomaticDecorators {\n constructor() {\n /**\n * Stores the definition of {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators}.\n * This data is used as a source for a downcast dispatcher to create a proper conversion to output data.\n */\n this._definitions = new Set();\n }\n /**\n * Gives information about the number of decorators stored in the {@link module:link/utils/automaticdecorators~AutomaticDecorators}\n * instance.\n */\n get length() {\n return this._definitions.size;\n }\n /**\n * Adds automatic decorator objects or an array with them to be used during downcasting.\n *\n * @param item A configuration object of automatic rules for decorating links. It might also be an array of such objects.\n */\n add(item) {\n if (Array.isArray(item)) {\n item.forEach(item => this._definitions.add(item));\n }\n else {\n this._definitions.add(item);\n }\n }\n /**\n * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method.\n *\n * @returns A dispatcher function used as conversion helper in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.\n */\n getDispatcher() {\n return dispatcher => {\n dispatcher.on('attribute:linkHref', (evt, data, conversionApi) => {\n // There is only test as this behavior decorates links and\n // it is run before dispatcher which actually consumes this node.\n // This allows on writing own dispatcher with highest priority,\n // which blocks both native converter and this additional decoration.\n if (!conversionApi.consumable.test(data.item, 'attribute:linkHref')) {\n return;\n }\n // Automatic decorators for block links are handled e.g. in LinkImageEditing.\n if (!(data.item.is('selection') || conversionApi.schema.isInline(data.item))) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewSelection = viewWriter.document.selection;\n for (const item of this._definitions) {\n const viewElement = viewWriter.createAttributeElement('a', item.attributes, {\n priority: 5\n });\n if (item.classes) {\n viewWriter.addClass(item.classes, viewElement);\n }\n for (const key in item.styles) {\n viewWriter.setStyle(key, item.styles[key], viewElement);\n }\n viewWriter.setCustomProperty('link', true, viewElement);\n if (item.callback(data.attributeNewValue)) {\n if (data.item.is('selection')) {\n viewWriter.wrap(viewSelection.getFirstRange(), viewElement);\n }\n else {\n viewWriter.wrap(conversionApi.mapper.toViewRange(data.range), viewElement);\n }\n }\n else {\n viewWriter.unwrap(conversionApi.mapper.toViewRange(data.range), viewElement);\n }\n }\n }, { priority: 'high' });\n };\n }\n /**\n * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method\n * when linking images.\n *\n * @returns A dispatcher function used as conversion helper in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.\n */\n getDispatcherForLinkedImage() {\n return dispatcher => {\n dispatcher.on('attribute:linkHref:imageBlock', (evt, data, { writer, mapper }) => {\n const viewFigure = mapper.toViewElement(data.item);\n const linkInImage = Array.from(viewFigure.getChildren())\n .find((child) => child.is('element', 'a'));\n for (const item of this._definitions) {\n const attributes = toMap(item.attributes);\n if (item.callback(data.attributeNewValue)) {\n for (const [key, val] of attributes) {\n // Left for backward compatibility. Since v30 decorator should\n // accept `classes` and `styles` separately from `attributes`.\n if (key === 'class') {\n writer.addClass(val, linkInImage);\n }\n else {\n writer.setAttribute(key, val, linkInImage);\n }\n }\n if (item.classes) {\n writer.addClass(item.classes, linkInImage);\n }\n for (const key in item.styles) {\n writer.setStyle(key, item.styles[key], linkInImage);\n }\n }\n else {\n for (const [key, val] of attributes) {\n if (key === 'class') {\n writer.removeClass(val, linkInImage);\n }\n else {\n writer.removeAttribute(key, linkInImage);\n }\n }\n if (item.classes) {\n writer.removeClass(item.classes, linkInImage);\n }\n for (const key in item.styles) {\n writer.removeStyle(key, linkInImage);\n }\n }\n }\n });\n };\n }\n}\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nexport default hasUnicode;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nexport default unicodeToArray;\n","import asciiToArray from './_asciiToArray.js';\nimport hasUnicode from './_hasUnicode.js';\nimport unicodeToArray from './_unicodeToArray.js';\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nexport default stringToArray;\n","/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nexport default asciiToArray;\n","import createCaseFirst from './_createCaseFirst.js';\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nexport default upperFirst;\n","import castSlice from './_castSlice.js';\nimport hasUnicode from './_hasUnicode.js';\nimport stringToArray from './_stringToArray.js';\nimport toString from './toString.js';\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\nexport default createCaseFirst;\n","import baseSlice from './_baseSlice.js';\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nexport default castSlice;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { upperFirst } from 'lodash-es';\nconst ATTRIBUTE_WHITESPACES = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\nconst SAFE_URL_TEMPLATE = '^(?:(?:<protocols>):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))';\n// Simplified email test - should be run over previously found URL.\nconst EMAIL_REG_EXP = /^[\\S]+@((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})$/i;\n// The regex checks for the protocol syntax ('xxxx://' or 'xxxx:')\n// or non-word characters at the beginning of the link ('/', '#' etc.).\nconst PROTOCOL_REG_EXP = /^((\\w+:(\\/{2,})?)|(\\W))/i;\nconst DEFAULT_LINK_PROTOCOLS = [\n 'https?',\n 'ftps?',\n 'mailto'\n];\n/**\n * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.\n */\nexport const LINK_KEYSTROKE = 'Ctrl+K';\n/**\n * Returns `true` if a given view node is the link element.\n */\nexport function isLinkElement(node) {\n return node.is('attributeElement') && !!node.getCustomProperty('link');\n}\n/**\n * Creates a link {@link module:engine/view/attributeelement~AttributeElement} with the provided `href` attribute.\n */\nexport function createLinkElement(href, { writer }) {\n // Priority 5 - https://github.com/ckeditor/ckeditor5-link/issues/121.\n const linkElement = writer.createAttributeElement('a', { href }, { priority: 5 });\n writer.setCustomProperty('link', true, linkElement);\n return linkElement;\n}\n/**\n * Returns a safe URL based on a given value.\n *\n * A URL is considered safe if it is safe for the user (does not contain any malicious code).\n *\n * If a URL is considered unsafe, a simple `\"#\"` is returned.\n *\n * @internal\n */\nexport function ensureSafeUrl(url, allowedProtocols = DEFAULT_LINK_PROTOCOLS) {\n const urlString = String(url);\n const protocolsList = allowedProtocols.join('|');\n const customSafeRegex = new RegExp(`${SAFE_URL_TEMPLATE.replace('<protocols>', protocolsList)}`, 'i');\n return isSafeUrl(urlString, customSafeRegex) ? urlString : '#';\n}\n/**\n * Checks whether the given URL is safe for the user (does not contain any malicious code).\n */\nfunction isSafeUrl(url, customRegexp) {\n const normalizedUrl = url.replace(ATTRIBUTE_WHITESPACES, '');\n return !!normalizedUrl.match(customRegexp);\n}\n/**\n * Returns the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} configuration processed\n * to respect the locale of the editor, i.e. to display the {@link module:link/linkconfig~LinkDecoratorManualDefinition label}\n * in the correct language.\n *\n * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually\n * translated in the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} configuration.\n *\n * @param t Shorthand for {@link module:utils/locale~Locale#t Locale#t}.\n * @param decorators The decorator reference where the label values should be localized.\n */\nexport function getLocalizedDecorators(t, decorators) {\n const localizedDecoratorsLabels = {\n 'Open in a new tab': t('Open in a new tab'),\n 'Downloadable': t('Downloadable')\n };\n decorators.forEach(decorator => {\n if ('label' in decorator && localizedDecoratorsLabels[decorator.label]) {\n decorator.label = localizedDecoratorsLabels[decorator.label];\n }\n return decorator;\n });\n return decorators;\n}\n/**\n * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and\n * is used as the attribute's name in the model.\n */\nexport function normalizeDecorators(decorators) {\n const retArray = [];\n if (decorators) {\n for (const [key, value] of Object.entries(decorators)) {\n const decorator = Object.assign({}, value, { id: `link${upperFirst(key)}` });\n retArray.push(decorator);\n }\n }\n return retArray;\n}\n/**\n * Returns `true` if the specified `element` can be linked (the element allows the `linkHref` attribute).\n */\nexport function isLinkableElement(element, schema) {\n if (!element) {\n return false;\n }\n return schema.checkAttribute(element.name, 'linkHref');\n}\n/**\n * Returns `true` if the specified `value` is an email.\n */\nexport function isEmail(value) {\n return EMAIL_REG_EXP.test(value);\n}\n/**\n * Adds the protocol prefix to the specified `link` when:\n *\n * * it does not contain it already, and there is a {@link module:link/linkconfig~LinkConfig#defaultProtocol `defaultProtocol` }\n * configuration value provided,\n * * or the link is an email address.\n */\nexport function addLinkProtocolIfApplicable(link, defaultProtocol) {\n const protocol = isEmail(link) ? 'mailto:' : defaultProtocol;\n const isProtocolNeeded = !!protocol && !linkHasProtocol(link);\n return link && isProtocolNeeded ? protocol + link : link;\n}\n/**\n * Checks if protocol is already included in the link.\n */\nexport function linkHasProtocol(link) {\n return PROTOCOL_REG_EXP.test(link);\n}\n/**\n * Opens the link in a new browser tab.\n */\nexport function openLink(link) {\n window.open(link, '_blank', 'noopener');\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { findAttributeRange } from 'ckeditor5/src/typing.js';\nimport { Collection, first, toMap } from 'ckeditor5/src/utils.js';\nimport AutomaticDecorators from './utils/automaticdecorators.js';\nimport { isLinkableElement } from './utils.js';\n/**\n * The link command. It is used by the {@link module:link/link~Link link feature}.\n */\nexport default class LinkCommand extends Command {\n constructor() {\n super(...arguments);\n /**\n * A collection of {@link module:link/utils/manualdecorator~ManualDecorator manual decorators}\n * corresponding to the {@link module:link/linkconfig~LinkConfig#decorators decorator configuration}.\n *\n * You can consider it a model with states of manual decorators added to the currently selected link.\n */\n this.manualDecorators = new Collection();\n /**\n * An instance of the helper that ties together all {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition}\n * that are used by the {@glink features/link link} and the {@glink features/images/images-linking linking images} features.\n */\n this.automaticDecorators = new AutomaticDecorators();\n }\n /**\n * Synchronizes the state of {@link #manualDecorators} with the currently present elements in the model.\n */\n restoreManualDecoratorStates() {\n for (const manualDecorator of this.manualDecorators) {\n manualDecorator.value = this._getDecoratorStateFromModel(manualDecorator.id);\n }\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedElement = selection.getSelectedElement() || first(selection.getSelectedBlocks());\n // A check for any integration that allows linking elements (e.g. `LinkImage`).\n // Currently the selection reads attributes from text nodes only. See #7429 and #7465.\n if (isLinkableElement(selectedElement, model.schema)) {\n this.value = selectedElement.getAttribute('linkHref');\n this.isEnabled = model.schema.checkAttribute(selectedElement, 'linkHref');\n }\n else {\n this.value = selection.getAttribute('linkHref');\n this.isEnabled = model.schema.checkAttributeInSelection(selection, 'linkHref');\n }\n for (const manualDecorator of this.manualDecorators) {\n manualDecorator.value = this._getDecoratorStateFromModel(manualDecorator.id);\n }\n }\n /**\n * Executes the command.\n *\n * When the selection is non-collapsed, the `linkHref` attribute will be applied to nodes inside the selection, but only to\n * those nodes where the `linkHref` attribute is allowed (disallowed nodes will be omitted).\n *\n * When the selection is collapsed and is not inside the text with the `linkHref` attribute, a\n * new {@link module:engine/model/text~Text text node} with the `linkHref` attribute will be inserted in place of the caret, but\n * only if such element is allowed in this place. The `_data` of the inserted text will equal the `href` parameter.\n * The selection will be updated to wrap the just inserted text node.\n *\n * When the selection is collapsed and inside the text with the `linkHref` attribute, the attribute value will be updated.\n *\n * # Decorators and model attribute management\n *\n * There is an optional argument to this command that applies or removes model\n * {@glink framework/architecture/editing-engine#text-attributes text attributes} brought by\n * {@link module:link/utils/manualdecorator~ManualDecorator manual link decorators}.\n *\n * Text attribute names in the model correspond to the entries in the {@link module:link/linkconfig~LinkConfig#decorators\n * configuration}.\n * For every decorator configured, a model text attribute exists with the \"link\" prefix. For example, a `'linkMyDecorator'` attribute\n * corresponds to `'myDecorator'` in the configuration.\n *\n * To learn more about link decorators, check out the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`}\n * documentation.\n *\n * Here is how to manage decorator attributes with the link command:\n *\n * ```ts\n * const linkCommand = editor.commands.get( 'link' );\n *\n * // Adding a new decorator attribute.\n * linkCommand.execute( 'http://example.com', {\n * \tlinkIsExternal: true\n * } );\n *\n * // Removing a decorator attribute from the selection.\n * linkCommand.execute( 'http://example.com', {\n * \tlinkIsExternal: false\n * } );\n *\n * // Adding multiple decorator attributes at the same time.\n * linkCommand.execute( 'http://example.com', {\n * \tlinkIsExternal: true,\n * \tlinkIsDownloadable: true,\n * } );\n *\n * // Removing and adding decorator attributes at the same time.\n * linkCommand.execute( 'http://example.com', {\n * \tlinkIsExternal: false,\n * \tlinkFoo: true,\n * \tlinkIsDownloadable: false,\n * } );\n * ```\n *\n * **Note**: If the decorator attribute name is not specified, its state remains untouched.\n *\n * **Note**: {@link module:link/unlinkcommand~UnlinkCommand#execute `UnlinkCommand#execute()`} removes all\n * decorator attributes.\n *\n * @fires execute\n * @param href Link destination.\n * @param manualDecoratorIds The information about manual decorator attributes to be applied or removed upon execution.\n */\n execute(href, manualDecoratorIds = {}) {\n const model = this.editor.model;\n const selection = model.document.selection;\n // Stores information about manual decorators to turn them on/off when command is applied.\n const truthyManualDecorators = [];\n const falsyManualDecorators = [];\n for (const name in manualDecoratorIds) {\n if (manualDecoratorIds[name]) {\n truthyManualDecorators.push(name);\n }\n else {\n falsyManualDecorators.push(name);\n }\n }\n model.change(writer => {\n // If selection is collapsed then update selected link or insert new one at the place of caret.\n if (selection.isCollapsed) {\n const position = selection.getFirstPosition();\n // When selection is inside text with `linkHref` attribute.\n if (selection.hasAttribute('linkHref')) {\n const linkText = extractTextFromSelection(selection);\n // Then update `linkHref` value.\n let linkRange = findAttributeRange(position, 'linkHref', selection.getAttribute('linkHref'), model);\n if (selection.getAttribute('linkHref') === linkText) {\n linkRange = this._updateLinkContent(model, writer, linkRange, href);\n }\n writer.setAttribute('linkHref', href, linkRange);\n truthyManualDecorators.forEach(item => {\n writer.setAttribute(item, true, linkRange);\n });\n falsyManualDecorators.forEach(item => {\n writer.removeAttribute(item, linkRange);\n });\n // Put the selection at the end of the updated link.\n writer.setSelection(writer.createPositionAfter(linkRange.end.nodeBefore));\n }\n // If not then insert text node with `linkHref` attribute in place of caret.\n // However, since selection is collapsed, attribute value will be used as data for text node.\n // So, if `href` is empty, do not create text node.\n else if (href !== '') {\n const attributes = toMap(selection.getAttributes());\n attributes.set('linkHref', href);\n truthyManualDecorators.forEach(item => {\n attributes.set(item, true);\n });\n const { end: positionAfter } = model.insertContent(writer.createText(href, attributes), position);\n // Put the selection at the end of the inserted link.\n // Using end of range returned from insertContent in case nodes with the same attributes got merged.\n writer.setSelection(positionAfter);\n }\n // Remove the `linkHref` attribute and all link decorators from the selection.\n // It stops adding a new content into the link element.\n ['linkHref', ...truthyManualDecorators, ...falsyManualDecorators].forEach(item => {\n writer.removeSelectionAttribute(item);\n });\n }\n else {\n // If selection has non-collapsed ranges, we change attribute on nodes inside those ranges\n // omitting nodes where the `linkHref` attribute is disallowed.\n const ranges = model.schema.getValidRanges(selection.getRanges(), 'linkHref');\n // But for the first, check whether the `linkHref` attribute is allowed on selected blocks (e.g. the \"image\" element).\n const allowedRanges = [];\n for (const element of selection.getSelectedBlocks()) {\n if (model.schema.checkAttribute(element, 'linkHref')) {\n allowedRanges.push(writer.createRangeOn(element));\n }\n }\n // Ranges that accept the `linkHref` attribute. Since we will iterate over `allowedRanges`, let's clone it.\n const rangesToUpdate = allowedRanges.slice();\n // For all selection ranges we want to check whether given range is inside an element that accepts the `linkHref` attribute.\n // If so, we don't want to propagate applying the attribute to its children.\n for (const range of ranges) {\n if (this._isRangeToUpdate(range, allowedRanges)) {\n rangesToUpdate.push(range);\n }\n }\n for (const range of rangesToUpdate) {\n let linkRange = range;\n if (rangesToUpdate.length === 1) {\n // Current text of the link in the document.\n const linkText = extractTextFromSelection(selection);\n if (selection.getAttribute('linkHref') === linkText) {\n linkRange = this._updateLinkContent(model, writer, range, href);\n writer.setSelection(writer.createSelection(linkRange));\n }\n }\n writer.setAttribute('linkHref', href, linkRange);\n truthyManualDecorators.forEach(item => {\n writer.setAttribute(item, true, linkRange);\n });\n falsyManualDecorators.forEach(item => {\n writer.removeAttribute(item, linkRange);\n });\n }\n }\n });\n }\n /**\n * Provides information whether a decorator with a given name is present in the currently processed selection.\n *\n * @param decoratorName The name of the manual decorator used in the model\n * @returns The information whether a given decorator is currently present in the selection.\n */\n _getDecoratorStateFromModel(decoratorName) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedElement = selection.getSelectedElement();\n // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.\n // Currently the selection reads attributes from text nodes only. See #7429 and #7465.\n if (isLinkableElement(selectedElement, model.schema)) {\n return selectedElement.getAttribute(decoratorName);\n }\n return selection.getAttribute(decoratorName);\n }\n /**\n * Checks whether specified `range` is inside an element that accepts the `linkHref` attribute.\n *\n * @param range A range to check.\n * @param allowedRanges An array of ranges created on elements where the attribute is accepted.\n */\n _isRangeToUpdate(range, allowedRanges) {\n for (const allowedRange of allowedRanges) {\n // A range is inside an element that will have the `linkHref` attribute. Do not modify its nodes.\n if (allowedRange.containsRange(range)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Updates selected link with a new value as its content and as its href attribute.\n *\n * @param model Model is need to insert content.\n * @param writer Writer is need to create text element in model.\n * @param range A range where should be inserted content.\n * @param href A link value which should be in the href attribute and in the content.\n */\n _updateLinkContent(model, writer, range, href) {\n const text = writer.createText(href, { linkHref: href });\n return model.insertContent(text, range);\n }\n}\n// Returns a text of a link under the collapsed selection or a selection that contains the entire link.\nfunction extractTextFromSelection(selection) {\n if (selection.isCollapsed) {\n const firstPosition = selection.getFirstPosition();\n return firstPosition.textNode && firstPosition.textNode.data;\n }\n else {\n const rangeItems = Array.from(selection.getFirstRange().getItems());\n if (rangeItems.length > 1) {\n return null;\n }\n const firstNode = rangeItems[0];\n if (firstNode.is('$text') || firstNode.is('$textProxy')) {\n return firstNode.data;\n }\n return null;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/unlinkcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { findAttributeRange } from 'ckeditor5/src/typing.js';\nimport { isLinkableElement } from './utils.js';\n/**\n * The unlink command. It is used by the {@link module:link/link~Link link plugin}.\n */\nexport default class UnlinkCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedElement = selection.getSelectedElement();\n // A check for any integration that allows linking elements (e.g. `LinkImage`).\n // Currently the selection reads attributes from text nodes only. See #7429 and #7465.\n if (isLinkableElement(selectedElement, model.schema)) {\n this.isEnabled = model.schema.checkAttribute(selectedElement, 'linkHref');\n }\n else {\n this.isEnabled = model.schema.checkAttributeInSelection(selection, 'linkHref');\n }\n }\n /**\n * Executes the command.\n *\n * When the selection is collapsed, it removes the `linkHref` attribute from each node with the same `linkHref` attribute value.\n * When the selection is non-collapsed, it removes the `linkHref` attribute from each node in selected ranges.\n *\n * # Decorators\n *\n * If {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} is specified,\n * all configured decorators are removed together with the `linkHref` attribute.\n *\n * @fires execute\n */\n execute() {\n const editor = this.editor;\n const model = this.editor.model;\n const selection = model.document.selection;\n const linkCommand = editor.commands.get('link');\n model.change(writer => {\n // Get ranges to unlink.\n const rangesToUnlink = selection.isCollapsed ?\n [findAttributeRange(selection.getFirstPosition(), 'linkHref', selection.getAttribute('linkHref'), model)] :\n model.schema.getValidRanges(selection.getRanges(), 'linkHref');\n // Remove `linkHref` attribute from specified ranges.\n for (const range of rangesToUnlink) {\n writer.removeAttribute('linkHref', range);\n // If there are registered custom attributes, then remove them during unlink.\n if (linkCommand) {\n for (const manualDecorator of linkCommand.manualDecorators) {\n writer.removeAttribute(manualDecorator.id, range);\n }\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/utils/manualdecorator\n */\nimport { ObservableMixin } from 'ckeditor5/src/utils.js';\n/**\n * Helper class that stores manual decorators with observable {@link module:link/utils/manualdecorator~ManualDecorator#value}\n * to support integration with the UI state. An instance of this class is a model with the state of individual manual decorators.\n * These decorators are kept as collections in {@link module:link/linkcommand~LinkCommand#manualDecorators}.\n */\nexport default class ManualDecorator extends /* #__PURE__ */ ObservableMixin() {\n /**\n * Creates a new instance of {@link module:link/utils/manualdecorator~ManualDecorator}.\n *\n * @param config.id The name of the attribute used in the model that represents a given manual decorator.\n * For example: `'linkIsExternal'`.\n * @param config.label The label used in the user interface to toggle the manual decorator.\n * @param config.attributes A set of attributes added to output data when the decorator is active for a specific link.\n * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.\n * @param [config.defaultValue] Controls whether the decorator is \"on\" by default.\n */\n constructor({ id, label, attributes, classes, styles, defaultValue }) {\n super();\n this.id = id;\n this.set('value', undefined);\n this.defaultValue = defaultValue;\n this.label = label;\n this.attributes = attributes;\n this.classes = classes;\n this.styles = styles;\n }\n /**\n * Returns {@link module:engine/view/matcher~MatcherPattern} with decorator attributes.\n *\n * @internal\n */\n _createPattern() {\n return {\n attributes: this.attributes,\n classes: this.classes,\n styles: this.styles\n };\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./link.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./link.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Input, TwoStepCaretMovement, inlineHighlight } from 'ckeditor5/src/typing.js';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';\nimport { keyCodes, env } from 'ckeditor5/src/utils.js';\nimport LinkCommand from './linkcommand.js';\nimport UnlinkCommand from './unlinkcommand.js';\nimport ManualDecorator from './utils/manualdecorator.js';\nimport { createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, openLink, addLinkProtocolIfApplicable } from './utils.js';\nimport '../theme/link.css';\nconst HIGHLIGHT_CLASS = 'ck-link_selected';\nconst DECORATOR_AUTOMATIC = 'automatic';\nconst DECORATOR_MANUAL = 'manual';\nconst EXTERNAL_LINKS_REGEXP = /^(https?:)?\\/\\//;\n/**\n * The link engine feature.\n *\n * It introduces the `linkHref=\"url\"` attribute in the model which renders to the view as a `<a href=\"url\">` element\n * as well as `'link'` and `'unlink'` commands.\n */\nexport default class LinkEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'LinkEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n // Clipboard is required for handling cut and paste events while typing over the link.\n return [TwoStepCaretMovement, Input, ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('link', {\n allowCreatingEmptyLinks: false,\n addTargetToExternalLinks: false\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const allowedProtocols = this.editor.config.get('link.allowedProtocols');\n // Allow link attribute on all inline nodes.\n editor.model.schema.extend('$text', { allowAttributes: 'linkHref' });\n editor.conversion.for('dataDowncast')\n .attributeToElement({ model: 'linkHref', view: createLinkElement });\n editor.conversion.for('editingDowncast')\n .attributeToElement({ model: 'linkHref', view: (href, conversionApi) => {\n return createLinkElement(ensureSafeUrl(href, allowedProtocols), conversionApi);\n } });\n editor.conversion.for('upcast')\n .elementToAttribute({\n view: {\n name: 'a',\n attributes: {\n href: true\n }\n },\n model: {\n key: 'linkHref',\n value: (viewElement) => viewElement.getAttribute('href')\n }\n });\n // Create linking commands.\n editor.commands.add('link', new LinkCommand(editor));\n editor.commands.add('unlink', new UnlinkCommand(editor));\n const linkDecorators = getLocalizedDecorators(editor.t, normalizeDecorators(editor.config.get('link.decorators')));\n this._enableAutomaticDecorators(linkDecorators\n .filter((item) => item.mode === DECORATOR_AUTOMATIC));\n this._enableManualDecorators(linkDecorators\n .filter((item) => item.mode === DECORATOR_MANUAL));\n // Enable two-step caret movement for `linkHref` attribute.\n const twoStepCaretMovementPlugin = editor.plugins.get(TwoStepCaretMovement);\n twoStepCaretMovementPlugin.registerAttribute('linkHref');\n // Setup highlight over selected link.\n inlineHighlight(editor, 'linkHref', 'a', HIGHLIGHT_CLASS);\n // Handle link following by CTRL+click or ALT+ENTER\n this._enableLinkOpen();\n // Clears the DocumentSelection decorator attributes if the selection is no longer in a link (for example while using 2-SCM).\n this._enableSelectionAttributesFixer();\n // Handle adding default protocol to pasted links.\n this._enableClipboardIntegration();\n }\n /**\n * Processes an array of configured {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators}\n * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}\n * for each one of them. Downcast dispatchers are obtained using the\n * {@link module:link/utils/automaticdecorators~AutomaticDecorators#getDispatcher} method.\n *\n * **Note**: This method also activates the automatic external link decorator if enabled with\n * {@link module:link/linkconfig~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.\n */\n _enableAutomaticDecorators(automaticDecoratorDefinitions) {\n const editor = this.editor;\n // Store automatic decorators in the command instance as we do the same with manual decorators.\n // Thanks to that, `LinkImageEditing` plugin can re-use the same definitions.\n const command = editor.commands.get('link');\n const automaticDecorators = command.automaticDecorators;\n // Adds a default decorator for external links.\n if (editor.config.get('link.addTargetToExternalLinks')) {\n automaticDecorators.add({\n id: 'linkIsExternal',\n mode: DECORATOR_AUTOMATIC,\n callback: url => !!url && EXTERNAL_LINKS_REGEXP.test(url),\n attributes: {\n target: '_blank',\n rel: 'noopener noreferrer'\n }\n });\n }\n automaticDecorators.add(automaticDecoratorDefinitions);\n if (automaticDecorators.length) {\n editor.conversion.for('downcast').add(automaticDecorators.getDispatcher());\n }\n }\n /**\n * Processes an array of configured {@link module:link/linkconfig~LinkDecoratorManualDefinition manual decorators},\n * transforms them into {@link module:link/utils/manualdecorator~ManualDecorator} instances and stores them in the\n * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).\n *\n * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}\n * converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema}\n * with adequate model attributes.\n */\n _enableManualDecorators(manualDecoratorDefinitions) {\n if (!manualDecoratorDefinitions.length) {\n return;\n }\n const editor = this.editor;\n const command = editor.commands.get('link');\n const manualDecorators = command.manualDecorators;\n manualDecoratorDefinitions.forEach(decoratorDefinition => {\n editor.model.schema.extend('$text', { allowAttributes: decoratorDefinition.id });\n // Keeps reference to manual decorator to decode its name to attributes during downcast.\n const decorator = new ManualDecorator(decoratorDefinition);\n manualDecorators.add(decorator);\n editor.conversion.for('downcast').attributeToElement({\n model: decorator.id,\n view: (manualDecoratorValue, { writer, schema }, { item }) => {\n // Manual decorators for block links are handled e.g. in LinkImageEditing.\n if (!(item.is('selection') || schema.isInline(item))) {\n return;\n }\n if (manualDecoratorValue) {\n const element = writer.createAttributeElement('a', decorator.attributes, { priority: 5 });\n if (decorator.classes) {\n writer.addClass(decorator.classes, element);\n }\n for (const key in decorator.styles) {\n writer.setStyle(key, decorator.styles[key], element);\n }\n writer.setCustomProperty('link', true, element);\n return element;\n }\n }\n });\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'a',\n ...decorator._createPattern()\n },\n model: {\n key: decorator.id\n }\n });\n });\n }\n /**\n * Attaches handlers for {@link module:engine/view/document~Document#event:enter} and\n * {@link module:engine/view/document~Document#event:click} to enable link following.\n */\n _enableLinkOpen() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n this.listenTo(viewDocument, 'click', (evt, data) => {\n const shouldOpen = env.isMac ? data.domEvent.metaKey : data.domEvent.ctrlKey;\n if (!shouldOpen) {\n return;\n }\n let clickedElement = data.domTarget;\n if (clickedElement.tagName.toLowerCase() != 'a') {\n clickedElement = clickedElement.closest('a');\n }\n if (!clickedElement) {\n return;\n }\n const url = clickedElement.getAttribute('href');\n if (!url) {\n return;\n }\n evt.stop();\n data.preventDefault();\n openLink(url);\n }, { context: '$capture' });\n // Open link on Alt+Enter.\n this.listenTo(viewDocument, 'keydown', (evt, data) => {\n const linkCommand = editor.commands.get('link');\n const url = linkCommand.value;\n const shouldOpen = !!url && data.keyCode === keyCodes.enter && data.altKey;\n if (!shouldOpen) {\n return;\n }\n evt.stop();\n openLink(url);\n });\n }\n /**\n * Watches the DocumentSelection attribute changes and removes link decorator attributes when the linkHref attribute is removed.\n *\n * This is to ensure that there is no left-over link decorator attributes on the document selection that is no longer in a link.\n */\n _enableSelectionAttributesFixer() {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n this.listenTo(selection, 'change:attribute', (evt, { attributeKeys }) => {\n if (!attributeKeys.includes('linkHref') || selection.hasAttribute('linkHref')) {\n return;\n }\n model.change(writer => {\n removeLinkAttributesFromSelection(writer, getLinkAttributesAllowedOnText(model.schema));\n });\n });\n }\n /**\n * Enables URL fixing on pasting.\n */\n _enableClipboardIntegration() {\n const editor = this.editor;\n const model = editor.model;\n const defaultProtocol = this.editor.config.get('link.defaultProtocol');\n if (!defaultProtocol) {\n return;\n }\n this.listenTo(editor.plugins.get('ClipboardPipeline'), 'contentInsertion', (evt, data) => {\n model.change(writer => {\n const range = writer.createRangeIn(data.content);\n for (const item of range.getItems()) {\n if (item.hasAttribute('linkHref')) {\n const newLink = addLinkProtocolIfApplicable(item.getAttribute('linkHref'), defaultProtocol);\n writer.setAttribute('linkHref', newLink, item);\n }\n }\n });\n });\n }\n}\n/**\n * Make the selection free of link-related model attributes.\n * All link-related model attributes start with \"link\". That includes not only \"linkHref\"\n * but also all decorator attributes (they have dynamic names), or even custom plugins.\n */\nfunction removeLinkAttributesFromSelection(writer, linkAttributes) {\n writer.removeSelectionAttribute('linkHref');\n for (const attribute of linkAttributes) {\n writer.removeSelectionAttribute(attribute);\n }\n}\n/**\n * Returns an array containing names of the attributes allowed on `$text` that describes the link item.\n */\nfunction getLinkAttributesAllowedOnText(schema) {\n const textAttributes = schema.getDefinition('$text').allowAttributes;\n return textAttributes.filter(attribute => attribute.startsWith('link'));\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkform.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkform.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/ui/linkformview\n */\nimport { ButtonView, FocusCycler, LabeledFieldView, SwitchButtonView, View, ViewCollection, createLabeledInputText, submitHandler } from 'ckeditor5/src/ui.js';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';\nimport { icons } from 'ckeditor5/src/core.js';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\nimport '../../theme/linkform.css';\n/**\n * The link form view controller class.\n *\n * See {@link module:link/ui/linkformview~LinkFormView}.\n */\nexport default class LinkFormView extends View {\n /**\n * Creates an instance of the {@link module:link/ui/linkformview~LinkFormView} class.\n *\n * Also see {@link #render}.\n *\n * @param locale The localization services instance.\n * @param linkCommand Reference to {@link module:link/linkcommand~LinkCommand}.\n * @param validators Form validators used by {@link #isValid}.\n */\n constructor(locale, linkCommand, validators) {\n super(locale);\n /**\n * Tracks information about DOM focus in the form.\n */\n this.focusTracker = new FocusTracker();\n /**\n * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.\n */\n this.keystrokes = new KeystrokeHandler();\n /**\n * A collection of views that can be focused in the form.\n */\n this._focusables = new ViewCollection();\n const t = locale.t;\n this._validators = validators;\n this.urlInputView = this._createUrlInput();\n this.saveButtonView = this._createButton(t('Save'), icons.check, 'ck-button-save');\n this.saveButtonView.type = 'submit';\n this.cancelButtonView = this._createButton(t('Cancel'), icons.cancel, 'ck-button-cancel', 'cancel');\n this._manualDecoratorSwitches = this._createManualDecoratorSwitches(linkCommand);\n this.children = this._createFormChildren(linkCommand.manualDecorators);\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n const classList = ['ck', 'ck-link-form', 'ck-responsive-form'];\n if (linkCommand.manualDecorators.length) {\n classList.push('ck-link-form_layout-vertical', 'ck-vertical-form');\n }\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: classList,\n // https://github.com/ckeditor/ckeditor5-link/issues/90\n tabindex: '-1'\n },\n children: this.children\n });\n }\n /**\n * Obtains the state of the {@link module:ui/button/switchbuttonview~SwitchButtonView switch buttons} representing\n * {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators}\n * in the {@link module:link/ui/linkformview~LinkFormView}.\n *\n * @returns Key-value pairs, where the key is the name of the decorator and the value is its state.\n */\n getDecoratorSwitchesState() {\n return Array\n .from(this._manualDecoratorSwitches)\n .reduce((accumulator, switchButton) => {\n accumulator[switchButton.name] = switchButton.isOn;\n return accumulator;\n }, {});\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n submitHandler({\n view: this\n });\n const childViews = [\n this.urlInputView,\n ...this._manualDecoratorSwitches,\n this.saveButtonView,\n this.cancelButtonView\n ];\n childViews.forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist {@link #_focusables} in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Validates the form and returns `false` when some fields are invalid.\n */\n isValid() {\n this.resetFormStatus();\n for (const validator of this._validators) {\n const errorText = validator(this);\n // One error per field is enough.\n if (errorText) {\n // Apply updated error.\n this.urlInputView.errorText = errorText;\n return false;\n }\n }\n return true;\n }\n /**\n * Cleans up the supplementary error and information text of the {@link #urlInputView}\n * bringing them back to the state when the form has been displayed for the first time.\n *\n * See {@link #isValid}.\n */\n resetFormStatus() {\n this.urlInputView.errorText = null;\n }\n /**\n * Creates a labeled input view.\n *\n * @returns Labeled field view instance.\n */\n _createUrlInput() {\n const t = this.locale.t;\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n labeledInput.fieldView.inputMode = 'url';\n labeledInput.label = t('Link URL');\n return labeledInput;\n }\n /**\n * Creates a button view.\n *\n * @param label The button label.\n * @param icon The button icon.\n * @param className The additional button CSS class name.\n * @param eventName An event name that the `ButtonView#execute` event will be delegated to.\n * @returns The button view instance.\n */\n _createButton(label, icon, className, eventName) {\n const button = new ButtonView(this.locale);\n button.set({\n label,\n icon,\n tooltip: true\n });\n button.extendTemplate({\n attributes: {\n class: className\n }\n });\n if (eventName) {\n button.delegate('execute').to(this, eventName);\n }\n return button;\n }\n /**\n * Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView}\n * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}.\n *\n * @param linkCommand A reference to the link command.\n * @returns ViewCollection of switch buttons.\n */\n _createManualDecoratorSwitches(linkCommand) {\n const switches = this.createCollection();\n for (const manualDecorator of linkCommand.manualDecorators) {\n const switchButton = new SwitchButtonView(this.locale);\n switchButton.set({\n name: manualDecorator.id,\n label: manualDecorator.label,\n withText: true\n });\n switchButton.bind('isOn').toMany([manualDecorator, linkCommand], 'value', (decoratorValue, commandValue) => {\n return commandValue === undefined && decoratorValue === undefined ? !!manualDecorator.defaultValue : !!decoratorValue;\n });\n switchButton.on('execute', () => {\n manualDecorator.set('value', !switchButton.isOn);\n });\n switches.add(switchButton);\n }\n return switches;\n }\n /**\n * Populates the {@link #children} collection of the form.\n *\n * If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an\n * additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding\n * to these decorators.\n *\n * @param manualDecorators A reference to\n * the collection of manual decorators stored in the link command.\n * @returns The children of link form view.\n */\n _createFormChildren(manualDecorators) {\n const children = this.createCollection();\n children.add(this.urlInputView);\n if (manualDecorators.length) {\n const additionalButtonsView = new View();\n additionalButtonsView.setTemplate({\n tag: 'ul',\n children: this._manualDecoratorSwitches.map(switchButton => ({\n tag: 'li',\n children: [switchButton],\n attributes: {\n class: [\n 'ck',\n 'ck-list__item'\n ]\n }\n })),\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-list'\n ]\n }\n });\n children.add(additionalButtonsView);\n }\n children.add(this.saveButtonView);\n children.add(this.cancelButtonView);\n return children;\n }\n /**\n * The native DOM `value` of the {@link #urlInputView} element.\n *\n * **Note**: Do not confuse it with the {@link module:ui/inputtext/inputtextview~InputTextView#value}\n * which works one way only and may not represent the actual state of the component in the DOM.\n */\n get url() {\n const { element } = this.urlInputView.fieldView;\n if (!element) {\n return null;\n }\n return element.value.trim();\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkactions.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkactions.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/ui/linkactionsview\n */\nimport { ButtonView, View, ViewCollection, FocusCycler } from 'ckeditor5/src/ui.js';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';\nimport { icons } from 'ckeditor5/src/core.js';\nimport { ensureSafeUrl } from '../utils.js';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\nimport '../../theme/linkactions.css';\nimport unlinkIcon from '../../theme/icons/unlink.svg';\n/**\n * The link actions view class. This view displays the link preview, allows\n * unlinking or editing the link.\n */\nexport default class LinkActionsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale, linkConfig = {}) {\n super(locale);\n /**\n * Tracks information about DOM focus in the actions.\n */\n this.focusTracker = new FocusTracker();\n /**\n * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.\n */\n this.keystrokes = new KeystrokeHandler();\n /**\n * A collection of views that can be focused in the view.\n */\n this._focusables = new ViewCollection();\n const t = locale.t;\n this.previewButtonView = this._createPreviewButton();\n this.unlinkButtonView = this._createButton(t('Unlink'), unlinkIcon, 'unlink');\n this.editButtonView = this._createButton(t('Edit link'), icons.pencil, 'edit');\n this.set('href', undefined);\n this._linkConfig = linkConfig;\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-link-actions',\n 'ck-responsive-form'\n ],\n // https://github.com/ckeditor/ckeditor5-link/issues/90\n tabindex: '-1'\n },\n children: [\n this.previewButtonView,\n this.editButtonView,\n this.unlinkButtonView\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n const childViews = [\n this.previewButtonView,\n this.editButtonView,\n this.unlinkButtonView\n ];\n childViews.forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist {@link #_focusables} in the actions.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Creates a button view.\n *\n * @param label The button label.\n * @param icon The button icon.\n * @param eventName An event name that the `ButtonView#execute` event will be delegated to.\n * @returns The button view instance.\n */\n _createButton(label, icon, eventName) {\n const button = new ButtonView(this.locale);\n button.set({\n label,\n icon,\n tooltip: true\n });\n button.delegate('execute').to(this, eventName);\n return button;\n }\n /**\n * Creates a link href preview button.\n *\n * @returns The button view instance.\n */\n _createPreviewButton() {\n const button = new ButtonView(this.locale);\n const bind = this.bindTemplate;\n const t = this.t;\n button.set({\n withText: true,\n tooltip: t('Open link in new tab')\n });\n button.extendTemplate({\n attributes: {\n class: [\n 'ck',\n 'ck-link-actions__preview'\n ],\n href: bind.to('href', href => href && ensureSafeUrl(href, this._linkConfig.allowedProtocols)),\n target: '_blank',\n rel: 'noopener noreferrer'\n }\n });\n button.bind('label').to(this, 'href', href => {\n return href || t('This link has no URL');\n });\n button.bind('isEnabled').to(this, 'href', href => !!href);\n button.template.tag = 'a';\n button.template.eventListeners = {};\n return button;\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ClickObserver } from 'ckeditor5/src/engine.js';\nimport { ButtonView, ContextualBalloon, clickOutsideHandler, CssTransitionDisablerMixin, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\nimport { isWidget } from 'ckeditor5/src/widget.js';\nimport LinkFormView from './ui/linkformview.js';\nimport LinkActionsView from './ui/linkactionsview.js';\nimport { addLinkProtocolIfApplicable, isLinkElement, LINK_KEYSTROKE } from './utils.js';\nimport linkIcon from '../theme/icons/link.svg';\nconst VISUAL_SELECTION_MARKER_NAME = 'link-ui';\n/**\n * The link UI plugin. It introduces the `'link'` and `'unlink'` buttons and support for the <kbd>Ctrl+K</kbd> keystroke.\n *\n * It uses the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.\n */\nexport default class LinkUI extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * The actions view displayed inside of the balloon.\n */\n this.actionsView = null;\n /**\n * The form view displayed inside the balloon.\n */\n this.formView = null;\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'LinkUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = this.editor.t;\n editor.editing.view.addObserver(ClickObserver);\n this._balloon = editor.plugins.get(ContextualBalloon);\n // Create toolbar buttons.\n this._createToolbarLinkButton();\n this._enableBalloonActivators();\n // Renders a fake visual selection marker on an expanded selection.\n editor.conversion.for('editingDowncast').markerToHighlight({\n model: VISUAL_SELECTION_MARKER_NAME,\n view: {\n classes: ['ck-fake-link-selection']\n }\n });\n // Renders a fake visual selection marker on a collapsed selection.\n editor.conversion.for('editingDowncast').markerToElement({\n model: VISUAL_SELECTION_MARKER_NAME,\n view: (data, { writer }) => {\n if (!data.markerRange.isCollapsed) {\n return null;\n }\n const markerElement = writer.createUIElement('span');\n writer.addClass(['ck-fake-link-selection', 'ck-fake-link-selection_collapsed'], markerElement);\n return markerElement;\n }\n });\n // Add the information about the keystrokes to the accessibility database.\n editor.accessibility.addKeystrokeInfos({\n keystrokes: [\n {\n label: t('Create link'),\n keystroke: LINK_KEYSTROKE\n },\n {\n label: t('Move out of a link'),\n keystroke: [\n ['arrowleft', 'arrowleft'],\n ['arrowright', 'arrowright']\n ]\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).\n if (this.formView) {\n this.formView.destroy();\n }\n if (this.actionsView) {\n this.actionsView.destroy();\n }\n }\n /**\n * Creates views.\n */\n _createViews() {\n this.actionsView = this._createActionsView();\n this.formView = this._createFormView();\n // Attach lifecycle actions to the the balloon.\n this._enableUserBalloonInteractions();\n }\n /**\n * Creates the {@link module:link/ui/linkactionsview~LinkActionsView} instance.\n */\n _createActionsView() {\n const editor = this.editor;\n const actionsView = new LinkActionsView(editor.locale, editor.config.get('link'));\n const linkCommand = editor.commands.get('link');\n const unlinkCommand = editor.commands.get('unlink');\n actionsView.bind('href').to(linkCommand, 'value');\n actionsView.editButtonView.bind('isEnabled').to(linkCommand);\n actionsView.unlinkButtonView.bind('isEnabled').to(unlinkCommand);\n // Execute unlink command after clicking on the \"Edit\" button.\n this.listenTo(actionsView, 'edit', () => {\n this._addFormView();\n });\n // Execute unlink command after clicking on the \"Unlink\" button.\n this.listenTo(actionsView, 'unlink', () => {\n editor.execute('unlink');\n this._hideUI();\n });\n // Close the panel on esc key press when the **actions have focus**.\n actionsView.keystrokes.set('Esc', (data, cancel) => {\n this._hideUI();\n cancel();\n });\n // Open the form view on Ctrl+K when the **actions have focus**..\n actionsView.keystrokes.set(LINK_KEYSTROKE, (data, cancel) => {\n this._addFormView();\n cancel();\n });\n return actionsView;\n }\n /**\n * Creates the {@link module:link/ui/linkformview~LinkFormView} instance.\n */\n _createFormView() {\n const editor = this.editor;\n const linkCommand = editor.commands.get('link');\n const defaultProtocol = editor.config.get('link.defaultProtocol');\n const formView = new (CssTransitionDisablerMixin(LinkFormView))(editor.locale, linkCommand, getFormValidators(editor));\n formView.urlInputView.fieldView.bind('value').to(linkCommand, 'value');\n // Form elements should be read-only when corresponding commands are disabled.\n formView.urlInputView.bind('isEnabled').to(linkCommand, 'isEnabled');\n // Disable the \"save\" button if the command is disabled.\n formView.saveButtonView.bind('isEnabled').to(linkCommand, 'isEnabled');\n // Execute link command after clicking the \"Save\" button.\n this.listenTo(formView, 'submit', () => {\n if (formView.isValid()) {\n const { value } = formView.urlInputView.fieldView.element;\n const parsedUrl = addLinkProtocolIfApplicable(value, defaultProtocol);\n editor.execute('link', parsedUrl, formView.getDecoratorSwitchesState());\n this._closeFormView();\n }\n });\n // Update balloon position when form error changes.\n this.listenTo(formView.urlInputView, 'change:errorText', () => {\n editor.ui.update();\n });\n // Hide the panel after clicking the \"Cancel\" button.\n this.listenTo(formView, 'cancel', () => {\n this._closeFormView();\n });\n // Close the panel on esc key press when the **form has focus**.\n formView.keystrokes.set('Esc', (data, cancel) => {\n this._closeFormView();\n cancel();\n });\n return formView;\n }\n /**\n * Creates a toolbar Link button. Clicking this button will show\n * a {@link #_balloon} attached to the selection.\n */\n _createToolbarLinkButton() {\n const editor = this.editor;\n editor.ui.componentFactory.add('link', () => {\n const button = this._createButton(ButtonView);\n button.set({\n tooltip: true\n });\n return button;\n });\n editor.ui.componentFactory.add('menuBar:link', () => {\n const button = this._createButton(MenuBarMenuListItemButtonView);\n button.set({\n role: 'menuitemcheckbox'\n });\n return button;\n });\n }\n /**\n * Creates a button for link command to use either in toolbar or in menu bar.\n */\n _createButton(ButtonClass) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get('link');\n const view = new ButtonClass(editor.locale);\n const t = locale.t;\n view.set({\n label: t('Link'),\n icon: linkIcon,\n keystroke: LINK_KEYSTROKE,\n isToggleable: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n view.bind('isOn').to(command, 'value', value => !!value);\n // Show the panel on button click.\n this.listenTo(view, 'execute', () => this._showUI(true));\n return view;\n }\n /**\n * Attaches actions that control whether the balloon panel containing the\n * {@link #formView} should be displayed.\n */\n _enableBalloonActivators() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n // Handle click on view document and show panel when selection is placed inside the link element.\n // Keep panel open until selection will be inside the same link element.\n this.listenTo(viewDocument, 'click', () => {\n const parentLink = this._getSelectedLinkElement();\n if (parentLink) {\n // Then show panel but keep focus inside editor editable.\n this._showUI();\n }\n });\n // Handle the `Ctrl+K` keystroke and show the panel.\n editor.keystrokes.set(LINK_KEYSTROKE, (keyEvtData, cancel) => {\n // Prevent focusing the search bar in FF, Chrome and Edge. See https://github.com/ckeditor/ckeditor5/issues/4811.\n cancel();\n if (editor.commands.get('link').isEnabled) {\n this._showUI(true);\n }\n });\n }\n /**\n * Attaches actions that control whether the balloon panel containing the\n * {@link #formView} is visible or not.\n */\n _enableUserBalloonInteractions() {\n // Focus the form if the balloon is visible and the Tab key has been pressed.\n this.editor.keystrokes.set('Tab', (data, cancel) => {\n if (this._areActionsVisible && !this.actionsView.focusTracker.isFocused) {\n this.actionsView.focus();\n cancel();\n }\n }, {\n // Use the high priority because the link UI navigation is more important\n // than other feature's actions, e.g. list indentation.\n // https://github.com/ckeditor/ckeditor5-link/issues/146\n priority: 'high'\n });\n // Close the panel on the Esc key press when the editable has focus and the balloon is visible.\n this.editor.keystrokes.set('Esc', (data, cancel) => {\n if (this._isUIVisible) {\n this._hideUI();\n cancel();\n }\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: this.formView,\n activator: () => this._isUIInPanel,\n contextElements: () => [this._balloon.view.element],\n callback: () => this._hideUI()\n });\n }\n /**\n * Adds the {@link #actionsView} to the {@link #_balloon}.\n *\n * @internal\n */\n _addActionsView() {\n if (!this.actionsView) {\n this._createViews();\n }\n if (this._areActionsInPanel) {\n return;\n }\n this._balloon.add({\n view: this.actionsView,\n position: this._getBalloonPositionData()\n });\n }\n /**\n * Adds the {@link #formView} to the {@link #_balloon}.\n */\n _addFormView() {\n if (!this.formView) {\n this._createViews();\n }\n if (this._isFormInPanel) {\n return;\n }\n const editor = this.editor;\n const linkCommand = editor.commands.get('link');\n this.formView.disableCssTransitions();\n this.formView.resetFormStatus();\n this._balloon.add({\n view: this.formView,\n position: this._getBalloonPositionData()\n });\n // Make sure that each time the panel shows up, the URL field remains in sync with the value of\n // the command. If the user typed in the input, then canceled the balloon (`urlInputView.fieldView#value` stays\n // unaltered) and re-opened it without changing the value of the link command (e.g. because they\n // clicked the same link), they would see the old value instead of the actual value of the command.\n // https://github.com/ckeditor/ckeditor5-link/issues/78\n // https://github.com/ckeditor/ckeditor5-link/issues/123\n this.formView.urlInputView.fieldView.value = linkCommand.value || '';\n // Select input when form view is currently visible.\n if (this._balloon.visibleView === this.formView) {\n this.formView.urlInputView.fieldView.select();\n }\n this.formView.enableCssTransitions();\n }\n /**\n * Closes the form view. Decides whether the balloon should be hidden completely or if the action view should be shown. This is\n * decided upon the link command value (which has a value if the document selection is in the link).\n *\n * Additionally, if any {@link module:link/linkconfig~LinkConfig#decorators} are defined in the editor configuration, the state of\n * switch buttons responsible for manual decorator handling is restored.\n */\n _closeFormView() {\n const linkCommand = this.editor.commands.get('link');\n // Restore manual decorator states to represent the current model state. This case is important to reset the switch buttons\n // when the user cancels the editing form.\n linkCommand.restoreManualDecoratorStates();\n if (linkCommand.value !== undefined) {\n this._removeFormView();\n }\n else {\n this._hideUI();\n }\n }\n /**\n * Removes the {@link #formView} from the {@link #_balloon}.\n */\n _removeFormView() {\n if (this._isFormInPanel) {\n // Blur the input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n this.formView.saveButtonView.focus();\n // Reset the URL field to update the state of the submit button.\n this.formView.urlInputView.fieldView.reset();\n this._balloon.remove(this.formView);\n // Because the form has an input which has focus, the focus must be brought back\n // to the editor. Otherwise, it would be lost.\n this.editor.editing.view.focus();\n this._hideFakeVisualSelection();\n }\n }\n /**\n * Shows the correct UI type. It is either {@link #formView} or {@link #actionsView}.\n *\n * @internal\n */\n _showUI(forceVisible = false) {\n if (!this.formView) {\n this._createViews();\n }\n // When there's no link under the selection, go straight to the editing UI.\n if (!this._getSelectedLinkElement()) {\n // Show visual selection on a text without a link when the contextual balloon is displayed.\n // See https://github.com/ckeditor/ckeditor5/issues/4721.\n this._showFakeVisualSelection();\n this._addActionsView();\n // Be sure panel with link is visible.\n if (forceVisible) {\n this._balloon.showStack('main');\n }\n this._addFormView();\n }\n // If there's a link under the selection...\n else {\n // Go to the editing UI if actions are already visible.\n if (this._areActionsVisible) {\n this._addFormView();\n }\n // Otherwise display just the actions UI.\n else {\n this._addActionsView();\n }\n // Be sure panel with link is visible.\n if (forceVisible) {\n this._balloon.showStack('main');\n }\n }\n // Begin responding to ui#update once the UI is added.\n this._startUpdatingUI();\n }\n /**\n * Removes the {@link #formView} from the {@link #_balloon}.\n *\n * See {@link #_addFormView}, {@link #_addActionsView}.\n */\n _hideUI() {\n if (!this._isUIInPanel) {\n return;\n }\n const editor = this.editor;\n this.stopListening(editor.ui, 'update');\n this.stopListening(this._balloon, 'change:visibleView');\n // Make sure the focus always gets back to the editable _before_ removing the focused form view.\n // Doing otherwise causes issues in some browsers. See https://github.com/ckeditor/ckeditor5-link/issues/193.\n editor.editing.view.focus();\n // Remove form first because it's on top of the stack.\n this._removeFormView();\n // Then remove the actions view because it's beneath the form.\n this._balloon.remove(this.actionsView);\n this._hideFakeVisualSelection();\n }\n /**\n * Makes the UI react to the {@link module:ui/editorui/editorui~EditorUI#event:update} event to\n * reposition itself when the editor UI should be refreshed.\n *\n * See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event.\n */\n _startUpdatingUI() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n let prevSelectedLink = this._getSelectedLinkElement();\n let prevSelectionParent = getSelectionParent();\n const update = () => {\n const selectedLink = this._getSelectedLinkElement();\n const selectionParent = getSelectionParent();\n // Hide the panel if:\n //\n // * the selection went out of the EXISTING link element. E.g. user moved the caret out\n // of the link,\n // * the selection went to a different parent when creating a NEW link. E.g. someone\n // else modified the document.\n // * the selection has expanded (e.g. displaying link actions then pressing SHIFT+Right arrow).\n //\n // Note: #_getSelectedLinkElement will return a link for a non-collapsed selection only\n // when fully selected.\n if ((prevSelectedLink && !selectedLink) ||\n (!prevSelectedLink && selectionParent !== prevSelectionParent)) {\n this._hideUI();\n }\n // Update the position of the panel when:\n // * link panel is in the visible stack\n // * the selection remains in the original link element,\n // * there was no link element in the first place, i.e. creating a new link\n else if (this._isUIVisible) {\n // If still in a link element, simply update the position of the balloon.\n // If there was no link (e.g. inserting one), the balloon must be moved\n // to the new position in the editing view (a new native DOM range).\n this._balloon.updatePosition(this._getBalloonPositionData());\n }\n prevSelectedLink = selectedLink;\n prevSelectionParent = selectionParent;\n };\n function getSelectionParent() {\n return viewDocument.selection.focus.getAncestors()\n .reverse()\n .find((node) => node.is('element'));\n }\n this.listenTo(editor.ui, 'update', update);\n this.listenTo(this._balloon, 'change:visibleView', update);\n }\n /**\n * Returns `true` when {@link #formView} is in the {@link #_balloon}.\n */\n get _isFormInPanel() {\n return !!this.formView && this._balloon.hasView(this.formView);\n }\n /**\n * Returns `true` when {@link #actionsView} is in the {@link #_balloon}.\n */\n get _areActionsInPanel() {\n return !!this.actionsView && this._balloon.hasView(this.actionsView);\n }\n /**\n * Returns `true` when {@link #actionsView} is in the {@link #_balloon} and it is\n * currently visible.\n */\n get _areActionsVisible() {\n return !!this.actionsView && this._balloon.visibleView === this.actionsView;\n }\n /**\n * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon}.\n */\n get _isUIInPanel() {\n return this._isFormInPanel || this._areActionsInPanel;\n }\n /**\n * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon} and it is\n * currently visible.\n */\n get _isUIVisible() {\n const visibleView = this._balloon.visibleView;\n return !!this.formView && visibleView == this.formView || this._areActionsVisible;\n }\n /**\n * Returns positioning options for the {@link #_balloon}. They control the way the balloon is attached\n * to the target element or selection.\n *\n * If the selection is collapsed and inside a link element, the panel will be attached to the\n * entire link element. Otherwise, it will be attached to the selection.\n */\n _getBalloonPositionData() {\n const view = this.editor.editing.view;\n const model = this.editor.model;\n const viewDocument = view.document;\n let target;\n if (model.markers.has(VISUAL_SELECTION_MARKER_NAME)) {\n // There are cases when we highlight selection using a marker (#7705, #4721).\n const markerViewElements = Array.from(this.editor.editing.mapper.markerNameToElements(VISUAL_SELECTION_MARKER_NAME));\n const newRange = view.createRange(view.createPositionBefore(markerViewElements[0]), view.createPositionAfter(markerViewElements[markerViewElements.length - 1]));\n target = view.domConverter.viewRangeToDom(newRange);\n }\n else {\n // Make sure the target is calculated on demand at the last moment because a cached DOM range\n // (which is very fragile) can desynchronize with the state of the editing view if there was\n // any rendering done in the meantime. This can happen, for instance, when an inline widget\n // gets unlinked.\n target = () => {\n const targetLink = this._getSelectedLinkElement();\n return targetLink ?\n // When selection is inside link element, then attach panel to this element.\n view.domConverter.mapViewToDom(targetLink) :\n // Otherwise attach panel to the selection.\n view.domConverter.viewRangeToDom(viewDocument.selection.getFirstRange());\n };\n }\n return { target };\n }\n /**\n * Returns the link {@link module:engine/view/attributeelement~AttributeElement} under\n * the {@link module:engine/view/document~Document editing view's} selection or `null`\n * if there is none.\n *\n * **Note**: For a non–collapsed selection, the link element is returned when **fully**\n * selected and the **only** element within the selection boundaries, or when\n * a linked widget is selected.\n */\n _getSelectedLinkElement() {\n const view = this.editor.editing.view;\n const selection = view.document.selection;\n const selectedElement = selection.getSelectedElement();\n // The selection is collapsed or some widget is selected (especially inline widget).\n if (selection.isCollapsed || selectedElement && isWidget(selectedElement)) {\n return findLinkElementAncestor(selection.getFirstPosition());\n }\n else {\n // The range for fully selected link is usually anchored in adjacent text nodes.\n // Trim it to get closer to the actual link element.\n const range = selection.getFirstRange().getTrimmed();\n const startLink = findLinkElementAncestor(range.start);\n const endLink = findLinkElementAncestor(range.end);\n if (!startLink || startLink != endLink) {\n return null;\n }\n // Check if the link element is fully selected.\n if (view.createRangeIn(startLink).getTrimmed().isEqual(range)) {\n return startLink;\n }\n else {\n return null;\n }\n }\n }\n /**\n * Displays a fake visual selection when the contextual balloon is displayed.\n *\n * This adds a 'link-ui' marker into the document that is rendered as a highlight on selected text fragment.\n */\n _showFakeVisualSelection() {\n const model = this.editor.model;\n model.change(writer => {\n const range = model.document.selection.getFirstRange();\n if (model.markers.has(VISUAL_SELECTION_MARKER_NAME)) {\n writer.updateMarker(VISUAL_SELECTION_MARKER_NAME, { range });\n }\n else {\n if (range.start.isAtEnd) {\n const startPosition = range.start.getLastMatchingPosition(({ item }) => !model.schema.isContent(item), { boundaries: range });\n writer.addMarker(VISUAL_SELECTION_MARKER_NAME, {\n usingOperation: false,\n affectsData: false,\n range: writer.createRange(startPosition, range.end)\n });\n }\n else {\n writer.addMarker(VISUAL_SELECTION_MARKER_NAME, {\n usingOperation: false,\n affectsData: false,\n range\n });\n }\n }\n });\n }\n /**\n * Hides the fake visual selection created in {@link #_showFakeVisualSelection}.\n */\n _hideFakeVisualSelection() {\n const model = this.editor.model;\n if (model.markers.has(VISUAL_SELECTION_MARKER_NAME)) {\n model.change(writer => {\n writer.removeMarker(VISUAL_SELECTION_MARKER_NAME);\n });\n }\n }\n}\n/**\n * Returns a link element if there's one among the ancestors of the provided `Position`.\n *\n * @param View position to analyze.\n * @returns Link element at the position or null.\n */\nfunction findLinkElementAncestor(position) {\n return position.getAncestors().find((ancestor) => isLinkElement(ancestor)) || null;\n}\n/**\n * Returns link form validation callbacks.\n *\n * @param editor Editor instance.\n */\nfunction getFormValidators(editor) {\n const t = editor.t;\n const allowCreatingEmptyLinks = editor.config.get('link.allowCreatingEmptyLinks');\n return [\n form => {\n if (!allowCreatingEmptyLinks && !form.url.length) {\n return t('Link URL must not be empty.');\n }\n }\n ];\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/autolink\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Delete, TextWatcher, getLastTextLine, findAttributeRange } from 'ckeditor5/src/typing.js';\nimport { addLinkProtocolIfApplicable, linkHasProtocol } from './utils.js';\nimport LinkEditing from './linkediting.js';\nconst MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: \"t.co \" (length 5).\n// This was a tweak from https://gist.github.com/dperini/729294.\nconst URL_REG_EXP = new RegExp(\n// Group 1: Line start or after a space.\n'(^|\\\\s)' +\n // Group 2: Detected URL (or e-mail).\n '(' +\n // Protocol identifier or short syntax \"//\"\n // a. Full form http://user@foo.bar.baz:8080/foo/bar.html#baz?foo=bar\n '(' +\n '(?:(?:(?:https?|ftp):)?\\\\/\\\\/)' +\n // BasicAuth using user:pass (optional)\n '(?:\\\\S+(?::\\\\S*)?@)?' +\n '(?:' +\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broadcast addresses\n // (first & last IP address of each class)\n '(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])' +\n '(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}' +\n '(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))' +\n '|' +\n '(' +\n // Do not allow `www.foo` - see https://github.com/ckeditor/ckeditor5/issues/8050.\n '((?!www\\\\.)|(www\\\\.))' +\n // Host & domain names.\n '(?![-_])(?:[-_a-z0-9\\\\u00a1-\\\\uffff]{1,63}\\\\.)+' +\n // TLD identifier name.\n '(?:[a-z\\\\u00a1-\\\\uffff]{2,63})' +\n ')' +\n ')' +\n // port number (optional)\n '(?::\\\\d{2,5})?' +\n // resource path (optional)\n '(?:[/?#]\\\\S*)?' +\n ')' +\n '|' +\n // b. Short form (either www.example.com or example@example.com)\n '(' +\n '(www.|(\\\\S+@))' +\n // Host & domain names.\n '((?![-_])(?:[-_a-z0-9\\\\u00a1-\\\\uffff]{1,63}\\\\.))+' +\n // TLD identifier name.\n '(?:[a-z\\\\u00a1-\\\\uffff]{2,63})' +\n ')' +\n ')$', 'i');\nconst URL_GROUP_IN_MATCH = 2;\n/**\n * The autolink plugin.\n */\nexport default class AutoLink extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Delete, LinkEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'AutoLink';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n selection.on('change:range', () => {\n // Disable plugin when selection is inside a code block.\n this.isEnabled = !selection.anchor.parent.is('element', 'codeBlock');\n });\n this._enableTypingHandling();\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n this._enableEnterHandling();\n this._enableShiftEnterHandling();\n this._enablePasteLinking();\n }\n /**\n * For given position, returns a range that includes the whole link that contains the position.\n *\n * If position is not inside a link, returns `null`.\n */\n _expandLinkRange(model, position) {\n if (position.textNode && position.textNode.hasAttribute('linkHref')) {\n return findAttributeRange(position, 'linkHref', position.textNode.getAttribute('linkHref'), model);\n }\n else {\n return null;\n }\n }\n /**\n * Extends the document selection to includes all links that intersects with given `selectedRange`.\n */\n _selectEntireLinks(writer, selectedRange) {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n const selStart = selection.getFirstPosition();\n const selEnd = selection.getLastPosition();\n let updatedSelection = selectedRange.getJoined(this._expandLinkRange(model, selStart) || selectedRange);\n if (updatedSelection) {\n updatedSelection = updatedSelection.getJoined(this._expandLinkRange(model, selEnd) || selectedRange);\n }\n if (updatedSelection && (updatedSelection.start.isBefore(selStart) || updatedSelection.end.isAfter(selEnd))) {\n // Only update the selection if it changed.\n writer.setSelection(updatedSelection);\n }\n }\n /**\n * Enables autolinking on pasting a URL when some content is selected.\n */\n _enablePasteLinking() {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n const linkCommand = editor.commands.get('link');\n clipboardPipeline.on('inputTransformation', (evt, data) => {\n if (!this.isEnabled || !linkCommand.isEnabled || selection.isCollapsed || data.method !== 'paste') {\n // Abort if we are disabled or the selection is collapsed.\n return;\n }\n if (selection.rangeCount > 1) {\n // Abort if there are multiple selection ranges.\n return;\n }\n const selectedRange = selection.getFirstRange();\n const newLink = data.dataTransfer.getData('text/plain');\n if (!newLink) {\n // Abort if there is no plain text on the clipboard.\n return;\n }\n const matches = newLink.match(URL_REG_EXP);\n // If the text in the clipboard has a URL, and that URL is the whole clipboard.\n if (matches && matches[2] === newLink) {\n model.change(writer => {\n this._selectEntireLinks(writer, selectedRange);\n linkCommand.execute(newLink);\n });\n evt.stop();\n }\n }, { priority: 'high' });\n }\n /**\n * Enables autolinking on typing.\n */\n _enableTypingHandling() {\n const editor = this.editor;\n const watcher = new TextWatcher(editor.model, text => {\n // 1. Detect <kbd>Space</kbd> after a text with a potential link.\n if (!isSingleSpaceAtTheEnd(text)) {\n return;\n }\n // 2. Check text before last typed <kbd>Space</kbd>.\n const url = getUrlAtTextEnd(text.substr(0, text.length - 1));\n if (url) {\n return { url };\n }\n });\n watcher.on('matched:data', (evt, data) => {\n const { batch, range, url } = data;\n if (!batch.isTyping) {\n return;\n }\n const linkEnd = range.end.getShiftedBy(-1); // Executed after a space character.\n const linkStart = linkEnd.getShiftedBy(-url.length);\n const linkRange = editor.model.createRange(linkStart, linkEnd);\n this._applyAutoLink(url, linkRange);\n });\n watcher.bind('isEnabled').to(this);\n }\n /**\n * Enables autolinking on the <kbd>Enter</kbd> key.\n */\n _enableEnterHandling() {\n const editor = this.editor;\n const model = editor.model;\n const enterCommand = editor.commands.get('enter');\n if (!enterCommand) {\n return;\n }\n enterCommand.on('execute', () => {\n const position = model.document.selection.getFirstPosition();\n if (!position.parent.previousSibling) {\n return;\n }\n const rangeToCheck = model.createRangeIn(position.parent.previousSibling);\n this._checkAndApplyAutoLinkOnRange(rangeToCheck);\n });\n }\n /**\n * Enables autolinking on the <kbd>Shift</kbd>+<kbd>Enter</kbd> keyboard shortcut.\n */\n _enableShiftEnterHandling() {\n const editor = this.editor;\n const model = editor.model;\n const shiftEnterCommand = editor.commands.get('shiftEnter');\n if (!shiftEnterCommand) {\n return;\n }\n shiftEnterCommand.on('execute', () => {\n const position = model.document.selection.getFirstPosition();\n const rangeToCheck = model.createRange(model.createPositionAt(position.parent, 0), position.getShiftedBy(-1));\n this._checkAndApplyAutoLinkOnRange(rangeToCheck);\n });\n }\n /**\n * Checks if the passed range contains a linkable text.\n */\n _checkAndApplyAutoLinkOnRange(rangeToCheck) {\n const model = this.editor.model;\n const { text, range } = getLastTextLine(rangeToCheck, model);\n const url = getUrlAtTextEnd(text);\n if (url) {\n const linkRange = model.createRange(range.end.getShiftedBy(-url.length), range.end);\n this._applyAutoLink(url, linkRange);\n }\n }\n /**\n * Applies a link on a given range if the link should be applied.\n *\n * @param url The URL to link.\n * @param range The text range to apply the link attribute to.\n */\n _applyAutoLink(url, range) {\n const model = this.editor.model;\n const defaultProtocol = this.editor.config.get('link.defaultProtocol');\n const fullUrl = addLinkProtocolIfApplicable(url, defaultProtocol);\n if (!this.isEnabled || !isLinkAllowedOnRange(range, model) || !linkHasProtocol(fullUrl) || linkIsAlreadySet(range)) {\n return;\n }\n this._persistAutoLink(fullUrl, range);\n }\n /**\n * Enqueues autolink changes in the model.\n *\n * @param url The URL to link.\n * @param range The text range to apply the link attribute to.\n */\n _persistAutoLink(url, range) {\n const model = this.editor.model;\n const deletePlugin = this.editor.plugins.get('Delete');\n // Enqueue change to make undo step.\n model.enqueueChange(writer => {\n writer.setAttribute('linkHref', url, range);\n model.enqueueChange(() => {\n deletePlugin.requestUndoOnBackspace();\n });\n });\n }\n}\n// Check if text should be evaluated by the plugin in order to reduce number of RegExp checks on whole text.\nfunction isSingleSpaceAtTheEnd(text) {\n return text.length > MIN_LINK_LENGTH_WITH_SPACE_AT_END && text[text.length - 1] === ' ' && text[text.length - 2] !== ' ';\n}\nfunction getUrlAtTextEnd(text) {\n const match = URL_REG_EXP.exec(text);\n return match ? match[URL_GROUP_IN_MATCH] : null;\n}\nfunction isLinkAllowedOnRange(range, model) {\n return model.schema.checkAttributeInSelection(model.createSelection(range), 'linkHref');\n}\nfunction linkIsAlreadySet(range) {\n const item = range.start.nodeAfter;\n return !!item && item.hasAttribute('linkHref');\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkimage.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkimage.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list/utils/listwalker\n */\nimport { first, toArray } from 'ckeditor5/src/utils.js';\nimport { isListItemBlock } from './model.js';\n/**\n * Document list blocks iterator.\n */\nexport default class ListWalker {\n /**\n * Creates a document list iterator.\n *\n * @param startElement The start list item block element.\n * @param options.direction The iterating direction.\n * @param options.includeSelf Whether start block should be included in the result (if it's matching other criteria).\n * @param options.sameAttributes Additional attributes that must be the same for each block.\n * @param options.sameIndent Whether blocks with the same indent level as the start block should be included\n * in the result.\n * @param options.lowerIndent Whether blocks with a lower indent level than the start block should be included\n * in the result.\n * @param options.higherIndent Whether blocks with a higher indent level than the start block should be included\n * in the result.\n */\n constructor(startElement, options) {\n this._startElement = startElement;\n this._referenceIndent = startElement.getAttribute('listIndent');\n this._isForward = options.direction == 'forward';\n this._includeSelf = !!options.includeSelf;\n this._sameAttributes = toArray(options.sameAttributes || []);\n this._sameIndent = !!options.sameIndent;\n this._lowerIndent = !!options.lowerIndent;\n this._higherIndent = !!options.higherIndent;\n }\n /**\n * Performs only first step of iteration and returns the result.\n *\n * @param startElement The start list item block element.\n * @param options.direction The iterating direction.\n * @param options.includeSelf Whether start block should be included in the result (if it's matching other criteria).\n * @param options.sameAttributes Additional attributes that must be the same for each block.\n * @param options.sameIndent Whether blocks with the same indent level as the start block should be included\n * in the result.\n * @param options.lowerIndent Whether blocks with a lower indent level than the start block should be included\n * in the result.\n * @param options.higherIndent Whether blocks with a higher indent level than the start block should be included\n * in the result.\n */\n static first(startElement, options) {\n const walker = new this(startElement, options);\n const iterator = walker[Symbol.iterator]();\n return first(iterator);\n }\n /**\n * Iterable interface.\n */\n *[Symbol.iterator]() {\n const nestedItems = [];\n for (const { node } of iterateSiblingListBlocks(this._getStartNode(), this._isForward ? 'forward' : 'backward')) {\n const indent = node.getAttribute('listIndent');\n // Leaving a nested list.\n if (indent < this._referenceIndent) {\n // Abort searching blocks.\n if (!this._lowerIndent) {\n break;\n }\n // While searching for lower indents, update the reference indent to find another parent in the next step.\n this._referenceIndent = indent;\n }\n // Entering a nested list.\n else if (indent > this._referenceIndent) {\n // Ignore nested blocks.\n if (!this._higherIndent) {\n continue;\n }\n // Collect nested blocks to verify if they are really nested, or it's a different item.\n if (!this._isForward) {\n nestedItems.push(node);\n continue;\n }\n }\n // Same indent level block.\n else {\n // Ignore same indent block.\n if (!this._sameIndent) {\n // While looking for nested blocks, stop iterating while encountering first same indent block.\n if (this._higherIndent) {\n // No more nested blocks so yield nested items.\n if (nestedItems.length) {\n yield* nestedItems;\n nestedItems.length = 0;\n }\n break;\n }\n continue;\n }\n // Abort if item has any additionally specified attribute different.\n if (this._sameAttributes.some(attr => node.getAttribute(attr) !== this._startElement.getAttribute(attr))) {\n break;\n }\n }\n // There is another block for the same list item so the nested items were in the same list item.\n if (nestedItems.length) {\n yield* nestedItems;\n nestedItems.length = 0;\n }\n yield node;\n }\n }\n /**\n * Returns the model element to start iterating.\n */\n _getStartNode() {\n if (this._includeSelf) {\n return this._startElement;\n }\n return this._isForward ?\n this._startElement.nextSibling :\n this._startElement.previousSibling;\n }\n}\n/**\n * Iterates sibling list blocks starting from the given node.\n *\n * @internal\n * @param node The model node.\n * @param direction Iteration direction.\n * @returns The object with `node` and `previous` {@link module:engine/model/element~Element blocks}.\n */\nexport function* iterateSiblingListBlocks(node, direction = 'forward') {\n const isForward = direction == 'forward';\n const previousNodesByIndent = []; // Last seen nodes of lower indented lists.\n let previous = null;\n while (isListItemBlock(node)) {\n let previousNodeInList = null; // It's like `previous` but has the same indent as current node.\n if (previous) {\n const nodeIndent = node.getAttribute('listIndent');\n const previousNodeIndent = previous.getAttribute('listIndent');\n // Let's find previous node for the same indent.\n // We're going to need that when we get back to previous indent.\n if (nodeIndent > previousNodeIndent) {\n previousNodesByIndent[previousNodeIndent] = previous;\n }\n // Restore the one for given indent.\n else if (nodeIndent < previousNodeIndent) {\n previousNodeInList = previousNodesByIndent[nodeIndent];\n previousNodesByIndent.length = nodeIndent;\n }\n // Same indent.\n else {\n previousNodeInList = previous;\n }\n }\n yield { node, previous, previousNodeInList };\n previous = node;\n node = isForward ? node.nextSibling : node.previousSibling;\n }\n}\n/**\n * The iterable protocol over the list elements.\n *\n * @internal\n */\nexport class ListBlocksIterable {\n /**\n * @param listHead The head element of a list.\n */\n constructor(listHead) {\n this._listHead = listHead;\n }\n /**\n * List blocks iterator.\n *\n * Iterates over all blocks of a list.\n */\n [Symbol.iterator]() {\n return iterateSiblingListBlocks(this._listHead, 'forward');\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { uid, toArray } from 'ckeditor5/src/utils.js';\nimport ListWalker, { iterateSiblingListBlocks } from './listwalker.js';\n/**\n * The list item ID generator.\n *\n * @internal\n */\nexport class ListItemUid {\n /**\n * Returns the next ID.\n *\n * @internal\n */\n /* istanbul ignore next: static function definition -- @preserve */\n static next() {\n return uid();\n }\n}\n/**\n * Returns true if the given model node is a list item block.\n *\n * @internal\n */\nexport function isListItemBlock(node) {\n return !!node && node.is('element') && node.hasAttribute('listItemId');\n}\n/**\n * Returns an array with all elements that represents the same list item.\n *\n * It means that values for `listIndent`, and `listItemId` for all items are equal.\n *\n * @internal\n * @param listItem Starting list item element.\n * @param options.higherIndent Whether blocks with a higher indent level than the start block should be included\n * in the result.\n */\nexport function getAllListItemBlocks(listItem, options = {}) {\n return [\n ...getListItemBlocks(listItem, { ...options, direction: 'backward' }),\n ...getListItemBlocks(listItem, { ...options, direction: 'forward' })\n ];\n}\n/**\n * Returns an array with elements that represents the same list item in the specified direction.\n *\n * It means that values for `listIndent` and `listItemId` for all items are equal.\n *\n * **Note**: For backward search the provided item is not included, but for forward search it is included in the result.\n *\n * @internal\n * @param listItem Starting list item element.\n * @param options.direction Walking direction.\n * @param options.higherIndent Whether blocks with a higher indent level than the start block should be included in the result.\n */\nexport function getListItemBlocks(listItem, options = {}) {\n const isForward = options.direction == 'forward';\n const items = Array.from(new ListWalker(listItem, {\n ...options,\n includeSelf: isForward,\n sameIndent: true,\n sameAttributes: 'listItemId'\n }));\n return isForward ? items : items.reverse();\n}\n/**\n * Returns a list items nested inside the given list item.\n *\n * @internal\n */\nexport function getNestedListBlocks(listItem) {\n return Array.from(new ListWalker(listItem, {\n direction: 'forward',\n higherIndent: true\n }));\n}\n/**\n * Returns array of all blocks/items of the same list as given block (same indent, same type and properties).\n *\n * @internal\n * @param listItem Starting list item element.\n * @param options Additional list walker options to modify the range of returned list items.\n */\nexport function getListItems(listItem, options) {\n const backwardBlocks = new ListWalker(listItem, {\n sameIndent: true,\n sameAttributes: 'listType',\n ...options\n });\n const forwardBlocks = new ListWalker(listItem, {\n sameIndent: true,\n sameAttributes: 'listType',\n includeSelf: true,\n direction: 'forward',\n ...options\n });\n return [\n ...Array.from(backwardBlocks).reverse(),\n ...forwardBlocks\n ];\n}\n/**\n * Check if the given block is the first in the list item.\n *\n * @internal\n * @param listBlock The list block element.\n */\nexport function isFirstBlockOfListItem(listBlock) {\n const previousSibling = ListWalker.first(listBlock, {\n sameIndent: true,\n sameAttributes: 'listItemId'\n });\n if (!previousSibling) {\n return true;\n }\n return false;\n}\n/**\n * Check if the given block is the last in the list item.\n *\n * @internal\n */\nexport function isLastBlockOfListItem(listBlock) {\n const nextSibling = ListWalker.first(listBlock, {\n direction: 'forward',\n sameIndent: true,\n sameAttributes: 'listItemId'\n });\n if (!nextSibling) {\n return true;\n }\n return false;\n}\n/**\n * Expands the given list of selected blocks to include the leading and tailing blocks of partially selected list items.\n *\n * @internal\n * @param blocks The list of selected blocks.\n * @param options.withNested Whether should include nested list items.\n */\nexport function expandListBlocksToCompleteItems(blocks, options = {}) {\n blocks = toArray(blocks);\n const higherIndent = options.withNested !== false;\n const allBlocks = new Set();\n for (const block of blocks) {\n for (const itemBlock of getAllListItemBlocks(block, { higherIndent })) {\n allBlocks.add(itemBlock);\n }\n }\n return sortBlocks(allBlocks);\n}\n/**\n * Expands the given list of selected blocks to include all the items of the lists they're in.\n *\n * @internal\n * @param blocks The list of selected blocks.\n */\nexport function expandListBlocksToCompleteList(blocks) {\n blocks = toArray(blocks);\n const allBlocks = new Set();\n for (const block of blocks) {\n for (const itemBlock of getListItems(block)) {\n allBlocks.add(itemBlock);\n }\n }\n return sortBlocks(allBlocks);\n}\n/**\n * Splits the list item just before the provided list block.\n *\n * @internal\n * @param listBlock The list block element.\n * @param writer The model writer.\n * @returns The array of updated blocks.\n */\nexport function splitListItemBefore(listBlock, writer) {\n const blocks = getListItemBlocks(listBlock, { direction: 'forward' });\n const id = ListItemUid.next();\n for (const block of blocks) {\n writer.setAttribute('listItemId', id, block);\n }\n return blocks;\n}\n/**\n * Merges the list item with the parent list item.\n *\n * @internal\n * @param listBlock The list block element.\n * @param parentBlock The list block element to merge with.\n * @param writer The model writer.\n * @returns The array of updated blocks.\n */\nexport function mergeListItemBefore(listBlock, parentBlock, writer) {\n const attributes = {};\n for (const [key, value] of parentBlock.getAttributes()) {\n if (key.startsWith('list')) {\n attributes[key] = value;\n }\n }\n const blocks = getListItemBlocks(listBlock, { direction: 'forward' });\n for (const block of blocks) {\n writer.setAttributes(attributes, block);\n }\n return blocks;\n}\n/**\n * Increases indentation of given list blocks.\n *\n * @internal\n * @param blocks The block or iterable of blocks.\n * @param writer The model writer.\n * @param options.expand Whether should expand the list of blocks to include complete list items.\n * @param options.indentBy The number of levels the indentation should change (could be negative).\n */\nexport function indentBlocks(blocks, writer, { expand, indentBy = 1 } = {}) {\n blocks = toArray(blocks);\n // Expand the selected blocks to contain the whole list items.\n const allBlocks = expand ? expandListBlocksToCompleteItems(blocks) : blocks;\n for (const block of allBlocks) {\n const blockIndent = block.getAttribute('listIndent') + indentBy;\n if (blockIndent < 0) {\n removeListAttributes(block, writer);\n }\n else {\n writer.setAttribute('listIndent', blockIndent, block);\n }\n }\n return allBlocks;\n}\n/**\n * Decreases indentation of given list of blocks. If the indentation of some blocks matches the indentation\n * of surrounding blocks, they get merged together.\n *\n * @internal\n * @param blocks The block or iterable of blocks.\n * @param writer The model writer.\n */\nexport function outdentBlocksWithMerge(blocks, writer) {\n blocks = toArray(blocks);\n // Expand the selected blocks to contain the whole list items.\n const allBlocks = expandListBlocksToCompleteItems(blocks);\n const visited = new Set();\n const referenceIndent = Math.min(...allBlocks.map(block => block.getAttribute('listIndent')));\n const parentBlocks = new Map();\n // Collect parent blocks before the list structure gets altered.\n for (const block of allBlocks) {\n parentBlocks.set(block, ListWalker.first(block, { lowerIndent: true }));\n }\n for (const block of allBlocks) {\n if (visited.has(block)) {\n continue;\n }\n visited.add(block);\n const blockIndent = block.getAttribute('listIndent') - 1;\n if (blockIndent < 0) {\n removeListAttributes(block, writer);\n continue;\n }\n // Merge with parent list item while outdenting and indent matches reference indent.\n if (block.getAttribute('listIndent') == referenceIndent) {\n const mergedBlocks = mergeListItemIfNotLast(block, parentBlocks.get(block), writer);\n // All list item blocks are updated while merging so add those to visited set.\n for (const mergedBlock of mergedBlocks) {\n visited.add(mergedBlock);\n }\n // The indent level was updated while merging so continue to next block.\n if (mergedBlocks.length) {\n continue;\n }\n }\n writer.setAttribute('listIndent', blockIndent, block);\n }\n return sortBlocks(visited);\n}\n/**\n * Removes all list attributes from the given blocks.\n *\n * @internal\n * @param blocks The block or iterable of blocks.\n * @param writer The model writer.\n * @returns Array of altered blocks.\n */\nexport function removeListAttributes(blocks, writer) {\n blocks = toArray(blocks);\n // Convert simple list items to plain paragraphs.\n for (const block of blocks) {\n if (block.is('element', 'listItem')) {\n writer.rename(block, 'paragraph');\n }\n }\n // Remove list attributes.\n for (const block of blocks) {\n for (const attributeKey of block.getAttributeKeys()) {\n if (attributeKey.startsWith('list')) {\n writer.removeAttribute(attributeKey, block);\n }\n }\n }\n return blocks;\n}\n/**\n * Checks whether the given blocks are related to a single list item.\n *\n * @internal\n * @param blocks The list block elements.\n */\nexport function isSingleListItem(blocks) {\n if (!blocks.length) {\n return false;\n }\n const firstItemId = blocks[0].getAttribute('listItemId');\n if (!firstItemId) {\n return false;\n }\n return !blocks.some(item => item.getAttribute('listItemId') != firstItemId);\n}\n/**\n * Modifies the indents of list blocks following the given list block so the indentation is valid after\n * the given block is no longer a list item.\n *\n * @internal\n * @param lastBlock The last list block that has become a non-list element.\n * @param writer The model writer.\n * @returns Array of altered blocks.\n */\nexport function outdentFollowingItems(lastBlock, writer) {\n const changedBlocks = [];\n // Start from the model item that is just after the last turned-off item.\n let currentIndent = Number.POSITIVE_INFINITY;\n // Correct indent of all items after the last turned off item.\n // Rules that should be followed:\n // 1. All direct sub-items of turned-off item should become indent 0, because the first item after it\n // will be the first item of a new list. Other items are at the same level, so should have same 0 index.\n // 2. All items with indent lower than indent of turned-off item should become indent 0, because they\n // should not end up as a child of any of list items that they were not children of before.\n // 3. All other items should have their indent changed relatively to it's parent.\n //\n // For example:\n // 1 * --------\n // 2 * --------\n // 3 * --------\t\t\t<-- this is turned off.\n // 4 * --------\t\t<-- this has to become indent = 0, because it will be first item on a new list.\n // 5 * --------\t<-- this should be still be a child of item above, so indent = 1.\n // 6 * --------\t\t\t<-- this has to become indent = 0, because it should not be a child of any of items above.\n // 7 * --------\t\t<-- this should be still be a child of item above, so indent = 1.\n // 8 * --------\t\t\t\t<-- this has to become indent = 0.\n // 9 * --------\t\t\t<-- this should still be a child of item above, so indent = 1.\n // 10 * --------\t\t<-- this should still be a child of item above, so indent = 2.\n // 11 * --------\t\t<-- this should still be at the same level as item above, so indent = 2.\n // 12 * --------\t\t\t\t<-- this and all below are left unchanged.\n // 13 * --------\n // 14 * --------\n //\n // After turning off 3 the list becomes:\n //\n // 1 * --------\n // 2 * --------\n //\n // 3 --------\n //\n // 4 * --------\n // 5 * --------\n // 6 * --------\n // 7 * --------\n // 8 * --------\n // 9 * --------\n // 10 * --------\n // 11 * --------\n // 12 * --------\n // 13 * --------\n // 14 * --------\n //\n // Thanks to this algorithm no lists are mismatched and no items get unexpected children/parent, while\n // those parent-child connection which are possible to maintain are still maintained. It's worth noting\n // that this is the same effect that we would be get by multiple use of outdent command. However doing\n // it like this is much more efficient because it's less operation (less memory usage, easier OT) and\n // less conversion (faster).\n for (const { node } of iterateSiblingListBlocks(lastBlock.nextSibling, 'forward')) {\n // Check each next list item, as long as its indent is higher than 0.\n const indent = node.getAttribute('listIndent');\n // If the indent is 0 we are not going to change anything anyway.\n if (indent == 0) {\n break;\n }\n // We check if that's item indent is lower than current relative indent.\n if (indent < currentIndent) {\n // If it is, current relative indent becomes that indent.\n currentIndent = indent;\n }\n // Fix indent relatively to current relative indent.\n // Note, that if we just changed the current relative indent, the newIndent will be equal to 0.\n const newIndent = indent - currentIndent;\n writer.setAttribute('listIndent', newIndent, node);\n changedBlocks.push(node);\n }\n return changedBlocks;\n}\n/**\n * Returns the array of given blocks sorted by model indexes (document order).\n *\n * @internal\n */\nexport function sortBlocks(blocks) {\n return Array.from(blocks)\n .filter(block => block.root.rootName !== '$graveyard')\n .sort((a, b) => a.index - b.index);\n}\n/**\n * Returns a selected block object. If a selected object is inline or when there is no selected\n * object, `null` is returned.\n *\n * @internal\n * @param model The instance of editor model.\n * @returns Selected block object or `null`.\n */\nexport function getSelectedBlockObject(model) {\n const selectedElement = model.document.selection.getSelectedElement();\n if (!selectedElement) {\n return null;\n }\n if (model.schema.isObject(selectedElement) && model.schema.isBlock(selectedElement)) {\n return selectedElement;\n }\n return null;\n}\n/**\n * Checks whether the given block can be replaced by a listItem.\n *\n * Note that this is possible only when multiBlock = false option is set in feature config.\n *\n * @param block A block to be tested.\n * @param schema The schema of the document.\n */\nexport function canBecomeSimpleListItem(block, schema) {\n return schema.checkChild(block.parent, 'listItem') && schema.checkChild(block, '$text') && !schema.isObject(block);\n}\n/**\n * Returns true if listType is of type `numbered` or `customNumbered`.\n */\nexport function isNumberedListType(listType) {\n return listType == 'numbered' || listType == 'customNumbered';\n}\n/**\n * Merges a given block to the given parent block if parent is a list item and there is no more blocks in the same item.\n */\nfunction mergeListItemIfNotLast(block, parentBlock, writer) {\n const parentItemBlocks = getListItemBlocks(parentBlock, { direction: 'forward' });\n // Merge with parent only if outdented item wasn't the last one in its parent.\n // Merge:\n // * a\t\t\t->\t\t* a\n // * [b]\t\t->\t\t b\n // c\t\t\t->\t\t c\n // Don't merge:\n // * a\t\t\t->\t\t* a\n // * [b]\t\t-> \t\t* b\n // * c\t\t\t->\t\t* c\n if (parentItemBlocks.pop().index > block.index) {\n return mergeListItemBefore(block, parentBlock, writer);\n }\n return [];\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list/listindentcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { expandListBlocksToCompleteItems, indentBlocks, isFirstBlockOfListItem, isListItemBlock, isSingleListItem, outdentBlocksWithMerge, sortBlocks, splitListItemBefore } from './utils/model.js';\nimport ListWalker from './utils/listwalker.js';\n/**\n * The document list indent command. It is used by the {@link module:list/list~List list feature}.\n */\nexport default class ListIndentCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor The editor instance.\n * @param indentDirection The direction of indent. If it is equal to `backward`, the command\n * will outdent a list item.\n */\n constructor(editor, indentDirection) {\n super(editor);\n this._direction = indentDirection;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.\n *\n * @fires execute\n * @fires afterExecute\n */\n execute() {\n const model = this.editor.model;\n const blocks = getSelectedListBlocks(model.document.selection);\n model.change(writer => {\n const changedBlocks = [];\n // Handle selection contained in the single list item and starting in the following blocks.\n if (isSingleListItem(blocks) && !isFirstBlockOfListItem(blocks[0])) {\n // Allow increasing indent of following list item blocks.\n if (this._direction == 'forward') {\n changedBlocks.push(...indentBlocks(blocks, writer));\n }\n // For indent make sure that indented blocks have a new ID.\n // For outdent just split blocks from the list item (give them a new IDs).\n changedBlocks.push(...splitListItemBefore(blocks[0], writer));\n }\n // More than a single list item is selected, or the first block of list item is selected.\n else {\n // Now just update the attributes of blocks.\n if (this._direction == 'forward') {\n changedBlocks.push(...indentBlocks(blocks, writer, { expand: true }));\n }\n else {\n changedBlocks.push(...outdentBlocksWithMerge(blocks, writer));\n }\n }\n // Align the list item type to match the previous list item (from the same list).\n for (const block of changedBlocks) {\n // This block become a plain block (for example a paragraph).\n if (!block.hasAttribute('listType')) {\n continue;\n }\n const previousItemBlock = ListWalker.first(block, { sameIndent: true });\n if (previousItemBlock) {\n writer.setAttribute('listType', previousItemBlock.getAttribute('listType'), block);\n }\n }\n this._fireAfterExecute(changedBlocks);\n });\n }\n /**\n * Fires the `afterExecute` event.\n *\n * @param changedBlocks The changed list elements.\n */\n _fireAfterExecute(changedBlocks) {\n this.fire('afterExecute', sortBlocks(new Set(changedBlocks)));\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n // Check whether any of position's ancestor is a list item.\n let blocks = getSelectedListBlocks(this.editor.model.document.selection);\n let firstBlock = blocks[0];\n // If selection is not in a list item, the command is disabled.\n if (!firstBlock) {\n return false;\n }\n // If we are outdenting it is enough to be in list item. Every list item can always be outdented.\n if (this._direction == 'backward') {\n return true;\n }\n // A single block of a list item is selected, so it could be indented as a sublist.\n if (isSingleListItem(blocks) && !isFirstBlockOfListItem(blocks[0])) {\n return true;\n }\n blocks = expandListBlocksToCompleteItems(blocks);\n firstBlock = blocks[0];\n // Check if there is any list item before selected items that could become a parent of selected items.\n const siblingItem = ListWalker.first(firstBlock, { sameIndent: true });\n if (!siblingItem) {\n return false;\n }\n if (siblingItem.getAttribute('listType') == firstBlock.getAttribute('listType')) {\n return true;\n }\n return false;\n }\n}\n/**\n * Returns an array of selected blocks truncated to the first non list block element.\n */\nfunction getSelectedListBlocks(selection) {\n const blocks = Array.from(selection.getSelectedBlocks());\n const firstNonListBlockIndex = blocks.findIndex(block => !isListItemBlock(block));\n if (firstNonListBlockIndex != -1) {\n blocks.length = firstNonListBlockIndex;\n }\n return blocks;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { splitListItemBefore, expandListBlocksToCompleteItems, getListItemBlocks, getListItems, removeListAttributes, outdentFollowingItems, ListItemUid, sortBlocks, getSelectedBlockObject, isListItemBlock, canBecomeSimpleListItem } from './utils/model.js';\n/**\n * The list command. It is used by the {@link module:list/list~List list feature}.\n */\nexport default class ListCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor The editor instance.\n * @param type List type that will be handled by this command.\n */\n constructor(editor, type, options = {}) {\n super(editor);\n this.type = type;\n this._listWalkerOptions = options.multiLevel ? {\n higherIndent: true,\n lowerIndent: true,\n sameAttributes: []\n } : undefined;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.value = this._getValue();\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the list command.\n *\n * @fires execute\n * @fires afterExecute\n * @param options Command options.\n * @param options.forceValue If set, it will force the command behavior. If `true`, the command will try to convert the\n * selected items and potentially the neighbor elements to the proper list items. If set to `false` it will convert selected elements\n * to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.\n * @param options.additionalAttributes Additional attributes that are set for list items when the command is executed.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const document = model.document;\n const selectedBlockObject = getSelectedBlockObject(model);\n const blocks = Array.from(document.selection.getSelectedBlocks())\n .filter(block => model.schema.checkAttribute(block, 'listType') || canBecomeSimpleListItem(block, model.schema));\n // Whether we are turning off some items.\n const turnOff = options.forceValue !== undefined ? !options.forceValue : this.value;\n model.change(writer => {\n if (turnOff) {\n const lastBlock = blocks[blocks.length - 1];\n // Split the first block from the list item.\n const itemBlocks = getListItemBlocks(lastBlock, { direction: 'forward' });\n const changedBlocks = [];\n if (itemBlocks.length > 1) {\n changedBlocks.push(...splitListItemBefore(itemBlocks[1], writer));\n }\n // Strip list attributes.\n changedBlocks.push(...removeListAttributes(blocks, writer));\n // Outdent items following the selected list item.\n changedBlocks.push(...outdentFollowingItems(lastBlock, writer));\n this._fireAfterExecute(changedBlocks);\n }\n // Changing type of list items for a collapsed selection inside a list item.\n else if ((selectedBlockObject || document.selection.isCollapsed) && isListItemBlock(blocks[0])) {\n const changedBlocks = getListItems(selectedBlockObject || blocks[0], this._listWalkerOptions);\n for (const block of changedBlocks) {\n writer.setAttributes({\n ...options.additionalAttributes,\n listType: this.type\n }, block);\n }\n this._fireAfterExecute(changedBlocks);\n }\n // Turning on the list items for a non-collapsed selection.\n else {\n const changedBlocks = [];\n for (const block of blocks) {\n // Promote the given block to the list item.\n if (!block.hasAttribute('listType')) {\n // Rename block to a simple list item if this option is enabled.\n if (!block.is('element', 'listItem') && canBecomeSimpleListItem(block, model.schema)) {\n writer.rename(block, 'listItem');\n }\n writer.setAttributes({\n ...options.additionalAttributes,\n listIndent: 0,\n listItemId: ListItemUid.next(),\n listType: this.type\n }, block);\n changedBlocks.push(block);\n }\n // Change the type of list item.\n else {\n for (const node of expandListBlocksToCompleteItems(block, { withNested: false })) {\n if (node.getAttribute('listType') != this.type) {\n writer.setAttributes({\n ...options.additionalAttributes,\n listType: this.type\n }, node);\n changedBlocks.push(node);\n }\n }\n }\n }\n this._fireAfterExecute(changedBlocks);\n }\n });\n }\n /**\n * Fires the `afterExecute` event.\n *\n * @param changedBlocks The changed list elements.\n */\n _fireAfterExecute(changedBlocks) {\n this.fire('afterExecute', sortBlocks(new Set(changedBlocks)));\n }\n /**\n * Checks the command's {@link #value}.\n *\n * @returns The current value.\n */\n _getValue() {\n const selection = this.editor.model.document.selection;\n const blocks = Array.from(selection.getSelectedBlocks());\n if (!blocks.length) {\n return false;\n }\n for (const block of blocks) {\n if (block.getAttribute('listType') != this.type) {\n return false;\n }\n }\n return true;\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n const blocks = Array.from(selection.getSelectedBlocks());\n if (!blocks.length) {\n return false;\n }\n // If command value is true it means that we are in list item, so the command should be enabled.\n if (this.value) {\n return true;\n }\n for (const block of blocks) {\n if (schema.checkAttribute(block, 'listType') || canBecomeSimpleListItem(block, schema)) {\n return true;\n }\n }\n return false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list/listmergecommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { getNestedListBlocks, indentBlocks, sortBlocks, isFirstBlockOfListItem, mergeListItemBefore, isSingleListItem, getSelectedBlockObject, isListItemBlock } from './utils/model.js';\nimport ListWalker from './utils/listwalker.js';\n/**\n * The document list merge command. It is used by the {@link module:list/list~List list feature}.\n */\nexport default class ListMergeCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor The editor instance.\n * @param direction Whether list item should be merged before or after the selected block.\n */\n constructor(editor, direction) {\n super(editor);\n this._direction = direction;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Merges list blocks together (depending on the {@link #constructor}'s `direction` parameter).\n *\n * @fires execute\n * @fires afterExecute\n * @param options Command options.\n * @param options.shouldMergeOnBlocksContentLevel When set `true`, merging will be performed together\n * with {@link module:engine/model/model~Model#deleteContent} to get rid of the inline content in the selection or take advantage\n * of the heuristics in `deleteContent()` that helps convert lists into paragraphs in certain cases.\n */\n execute({ shouldMergeOnBlocksContentLevel = false } = {}) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const changedBlocks = [];\n model.change(writer => {\n const { firstElement, lastElement } = this._getMergeSubjectElements(selection, shouldMergeOnBlocksContentLevel);\n const firstIndent = firstElement.getAttribute('listIndent') || 0;\n const lastIndent = lastElement.getAttribute('listIndent');\n const lastElementId = lastElement.getAttribute('listItemId');\n if (firstIndent != lastIndent) {\n const nestedLastElementBlocks = getNestedListBlocks(lastElement);\n changedBlocks.push(...indentBlocks([lastElement, ...nestedLastElementBlocks], writer, {\n indentBy: firstIndent - lastIndent,\n // If outdenting, the entire sub-tree that follows must be included.\n expand: firstIndent < lastIndent\n }));\n }\n if (shouldMergeOnBlocksContentLevel) {\n let sel = selection;\n if (selection.isCollapsed) {\n sel = writer.createSelection(writer.createRange(writer.createPositionAt(firstElement, 'end'), writer.createPositionAt(lastElement, 0)));\n }\n // Delete selected content. Replace entire content only for non-collapsed selection.\n model.deleteContent(sel, { doNotResetEntireContent: selection.isCollapsed });\n // Get the last \"touched\" element after deleteContent call (can't use the lastElement because\n // it could get merged into the firstElement while deleting content).\n const lastElementAfterDelete = sel.getLastPosition().parent;\n // Check if the element after it was in the same list item and adjust it if needed.\n const nextSibling = lastElementAfterDelete.nextSibling;\n changedBlocks.push(lastElementAfterDelete);\n if (nextSibling && nextSibling !== lastElement && nextSibling.getAttribute('listItemId') == lastElementId) {\n changedBlocks.push(...mergeListItemBefore(nextSibling, lastElementAfterDelete, writer));\n }\n }\n else {\n changedBlocks.push(...mergeListItemBefore(lastElement, firstElement, writer));\n }\n this._fireAfterExecute(changedBlocks);\n });\n }\n /**\n * Fires the `afterExecute` event.\n *\n * @param changedBlocks The changed list elements.\n */\n _fireAfterExecute(changedBlocks) {\n this.fire('afterExecute', sortBlocks(new Set(changedBlocks)));\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedBlockObject = getSelectedBlockObject(model);\n if (selection.isCollapsed || selectedBlockObject) {\n const positionParent = selectedBlockObject || selection.getFirstPosition().parent;\n if (!isListItemBlock(positionParent)) {\n return false;\n }\n const siblingNode = this._direction == 'backward' ?\n positionParent.previousSibling :\n positionParent.nextSibling;\n if (!siblingNode) {\n return false;\n }\n if (isSingleListItem([positionParent, siblingNode])) {\n return false;\n }\n }\n else {\n const lastPosition = selection.getLastPosition();\n const firstPosition = selection.getFirstPosition();\n // If deleting within a single block of a list item, there's no need to merge anything.\n // The default delete should be executed instead.\n if (lastPosition.parent === firstPosition.parent) {\n return false;\n }\n if (!isListItemBlock(lastPosition.parent)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns the boundary elements the merge should be executed for. These are not necessarily selection's first\n * and last position parents but sometimes sibling or even further blocks depending on the context.\n *\n * @param selection The selection the merge is executed for.\n * @param shouldMergeOnBlocksContentLevel When `true`, merge is performed together with\n * {@link module:engine/model/model~Model#deleteContent} to remove the inline content within the selection.\n */\n _getMergeSubjectElements(selection, shouldMergeOnBlocksContentLevel) {\n const model = this.editor.model;\n const selectedBlockObject = getSelectedBlockObject(model);\n let firstElement, lastElement;\n if (selection.isCollapsed || selectedBlockObject) {\n const positionParent = selectedBlockObject || selection.getFirstPosition().parent;\n const isFirstBlock = isFirstBlockOfListItem(positionParent);\n if (this._direction == 'backward') {\n lastElement = positionParent;\n if (isFirstBlock && !shouldMergeOnBlocksContentLevel) {\n // For the \"c\" as an anchorElement:\n // * a\n // * b\n // * [c] <-- this block should be merged with \"a\"\n // It should find \"a\" element to merge with:\n // * a\n // * b\n // c\n firstElement = ListWalker.first(positionParent, { sameIndent: true, lowerIndent: true });\n }\n else {\n firstElement = positionParent.previousSibling;\n }\n }\n else {\n // In case of the forward merge there is no case as above, just merge with next sibling.\n firstElement = positionParent;\n lastElement = positionParent.nextSibling;\n }\n }\n else {\n firstElement = selection.getFirstPosition().parent;\n lastElement = selection.getLastPosition().parent;\n }\n return {\n firstElement: firstElement,\n lastElement: lastElement\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { isFirstBlockOfListItem, isListItemBlock, sortBlocks, splitListItemBefore } from './utils/model.js';\n/**\n * The document list split command that splits the list item at the selection.\n *\n * It is used by the {@link module:list/list~List list feature}.\n */\nexport default class ListSplitCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor The editor instance.\n * @param direction Whether list item should be split before or after the selected block.\n */\n constructor(editor, direction) {\n super(editor);\n this._direction = direction;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Splits the list item at the selection.\n *\n * @fires execute\n * @fires afterExecute\n */\n execute() {\n const editor = this.editor;\n editor.model.change(writer => {\n const changedBlocks = splitListItemBefore(this._getStartBlock(), writer);\n this._fireAfterExecute(changedBlocks);\n });\n }\n /**\n * Fires the `afterExecute` event.\n *\n * @param changedBlocks The changed list elements.\n */\n _fireAfterExecute(changedBlocks) {\n this.fire('afterExecute', sortBlocks(new Set(changedBlocks)));\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n const selection = this.editor.model.document.selection;\n const block = this._getStartBlock();\n return selection.isCollapsed &&\n isListItemBlock(block) &&\n !isFirstBlockOfListItem(block);\n }\n /**\n * Returns the model element that is the main focus of the command (according to the current selection and command direction).\n */\n _getStartBlock() {\n const doc = this.editor.model.document;\n const positionParent = doc.selection.getFirstPosition().parent;\n return (this._direction == 'before' ? positionParent : positionParent.nextSibling);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { expandListBlocksToCompleteItems, expandListBlocksToCompleteList, isFirstBlockOfListItem, isListItemBlock, isNumberedListType } from './utils/model.js';\n/**\n * A set of helpers related to document lists.\n */\nexport default class ListUtils extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListUtils';\n }\n /**\n * Expands the given list of selected blocks to include all the items of the lists they're in.\n *\n * @param blocks The list of selected blocks.\n */\n expandListBlocksToCompleteList(blocks) {\n return expandListBlocksToCompleteList(blocks);\n }\n /**\n * Check if the given block is the first in the list item.\n *\n * @param listBlock The list block element.\n */\n isFirstBlockOfListItem(listBlock) {\n return isFirstBlockOfListItem(listBlock);\n }\n /**\n * Returns true if the given model node is a list item block.\n *\n * @param node A model node.\n */\n isListItemBlock(node) {\n return isListItemBlock(node);\n }\n /**\n * Expands the given list of selected blocks to include the leading and tailing blocks of partially selected list items.\n *\n * @param blocks The list of selected blocks.\n * @param options.withNested Whether should include nested list items.\n */\n expandListBlocksToCompleteItems(blocks, options = {}) {\n return expandListBlocksToCompleteItems(blocks, options);\n }\n /**\n * Returns true if listType is of type `numbered` or `customNumbered`.\n */\n isNumberedListType(listType) {\n return isNumberedListType(listType);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Checks if view element is a list type (ul or ol).\n *\n * @internal\n */\nexport function isListView(viewElement) {\n return viewElement.is('element', 'ol') || viewElement.is('element', 'ul');\n}\n/**\n * Checks if view element is a list item (li).\n *\n * @internal\n */\nexport function isListItemView(viewElement) {\n return viewElement.is('element', 'li');\n}\n/**\n * Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.\n *\n * Also, fixes non HTML compliant lists indents:\n *\n * ```\n * before: fixed list:\n * OL OL\n * |-> LI (parent LIs: 0) |-> LI (indent: 0)\n * |-> OL |-> OL\n * |-> OL |\n * | |-> OL |\n * | |-> OL |\n * | |-> LI (parent LIs: 1) |-> LI (indent: 1)\n * |-> LI (parent LIs: 1) |-> LI (indent: 1)\n *\n * before: fixed list:\n * OL OL\n * |-> OL |\n * |-> OL |\n * |-> OL |\n * |-> LI (parent LIs: 0) |-> LI (indent: 0)\n *\n * before: fixed list:\n * OL OL\n * |-> LI (parent LIs: 0) |-> LI (indent: 0)\n * |-> OL |-> OL\n * |-> LI (parent LIs: 0) |-> LI (indent: 1)\n * ```\n *\n * @internal\n */\nexport function getIndent(listItem) {\n let indent = 0;\n let parent = listItem.parent;\n while (parent) {\n // Each LI in the tree will result in an increased indent for HTML compliant lists.\n if (isListItemView(parent)) {\n indent++;\n }\n else {\n // If however the list is nested in other list we should check previous sibling of any of the list elements...\n const previousSibling = parent.previousSibling;\n // ...because the we might need increase its indent:\n //\t\tbefore: fixed list:\n //\t\tOL OL\n //\t\t|-> LI (parent LIs: 0) |-> LI (indent: 0)\n //\t\t|-> OL |-> OL\n //\t\t |-> LI (parent LIs: 0) |-> LI (indent: 1)\n if (previousSibling && isListItemView(previousSibling)) {\n indent++;\n }\n }\n parent = parent.parent;\n }\n return indent;\n}\n/**\n * Creates a list attribute element (ol or ul).\n *\n * @internal\n */\nexport function createListElement(writer, indent, type, id = getViewElementIdForListType(type, indent)) {\n // Negative priorities so that restricted editing attribute won't wrap lists.\n return writer.createAttributeElement(getViewElementNameForListType(type), null, {\n priority: 2 * indent / 100 - 100,\n id\n });\n}\n/**\n * Creates a list item attribute element (li).\n *\n * @internal\n */\nexport function createListItemElement(writer, indent, id) {\n // Negative priorities so that restricted editing attribute won't wrap list items.\n return writer.createAttributeElement('li', null, {\n priority: (2 * indent + 1) / 100 - 100,\n id\n });\n}\n/**\n * Returns a view element name for the given list type.\n *\n * @internal\n */\nexport function getViewElementNameForListType(type) {\n return type == 'numbered' || type == 'customNumbered' ? 'ol' : 'ul';\n}\n/**\n * Returns a view element ID for the given list type and indent.\n *\n * @internal\n */\nexport function getViewElementIdForListType(type, indent) {\n return `list-${type}-${indent}`;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { iterateSiblingListBlocks } from './listwalker.js';\nimport { getListItemBlocks, isListItemBlock, ListItemUid } from './model.js';\n/**\n * Based on the provided positions looks for the list head and stores it in the provided map.\n *\n * @internal\n * @param position The search starting position.\n * @param itemToListHead The map from list item element to the list head element.\n */\nexport function findAndAddListHeadToMap(position, itemToListHead) {\n const previousNode = position.nodeBefore;\n if (!isListItemBlock(previousNode)) {\n const item = position.nodeAfter;\n if (isListItemBlock(item)) {\n itemToListHead.set(item, item);\n }\n }\n else {\n let listHead = previousNode;\n // Previously, the loop below was defined like this:\n //\n // \t\tfor ( { node: listHead } of iterateSiblingListBlocks( listHead, 'backward' ) )\n //\n // Unfortunately, such a destructuring is incorrectly transpiled by Babel and the loop never ends.\n // See: https://github.com/ckeditor/ckeditor5-react/issues/345.\n for (const { node } of iterateSiblingListBlocks(listHead, 'backward')) {\n listHead = node;\n if (itemToListHead.has(listHead)) {\n return;\n }\n }\n itemToListHead.set(previousNode, listHead);\n }\n}\n/**\n * Scans the list starting from the given list head element and fixes items' indentation.\n *\n * @internal\n * @param listNodes The iterable of list nodes.\n * @param writer The model writer.\n * @returns Whether the model was modified.\n */\nexport function fixListIndents(listNodes, writer) {\n let maxIndent = 0; // Guards local sublist max indents that need fixing.\n let prevIndent = -1; // Previous item indent.\n let fixBy = null;\n let applied = false;\n for (const { node } of listNodes) {\n const itemIndent = node.getAttribute('listIndent');\n if (itemIndent > maxIndent) {\n let newIndent;\n if (fixBy === null) {\n fixBy = itemIndent - maxIndent;\n newIndent = maxIndent;\n }\n else {\n if (fixBy > itemIndent) {\n fixBy = itemIndent;\n }\n newIndent = itemIndent - fixBy;\n }\n if (newIndent > prevIndent + 1) {\n newIndent = prevIndent + 1;\n }\n writer.setAttribute('listIndent', newIndent, node);\n applied = true;\n prevIndent = newIndent;\n }\n else {\n fixBy = null;\n maxIndent = itemIndent + 1;\n prevIndent = itemIndent;\n }\n }\n return applied;\n}\n/**\n * Scans the list starting from the given list head element and fixes items' types.\n *\n * @internal\n * @param listNodes The iterable of list nodes.\n * @param seenIds The set of already known IDs.\n * @param writer The model writer.\n * @returns Whether the model was modified.\n */\nexport function fixListItemIds(listNodes, seenIds, writer) {\n const visited = new Set();\n let applied = false;\n for (const { node } of listNodes) {\n if (visited.has(node)) {\n continue;\n }\n let listType = node.getAttribute('listType');\n let listItemId = node.getAttribute('listItemId');\n // Use a new ID if this one was spot earlier (even in other list).\n if (seenIds.has(listItemId)) {\n listItemId = ListItemUid.next();\n }\n seenIds.add(listItemId);\n // Make sure that all items in a simple list have unique IDs.\n if (node.is('element', 'listItem')) {\n if (node.getAttribute('listItemId') != listItemId) {\n writer.setAttribute('listItemId', listItemId, node);\n applied = true;\n }\n continue;\n }\n for (const block of getListItemBlocks(node, { direction: 'forward' })) {\n visited.add(block);\n // Use a new ID if a block of a bigger list item has different type.\n if (block.getAttribute('listType') != listType) {\n listItemId = ListItemUid.next();\n listType = block.getAttribute('listType');\n }\n if (block.getAttribute('listItemId') != listItemId) {\n writer.setAttribute('listItemId', listItemId, block);\n applied = true;\n }\n }\n }\n return applied;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getAllListItemBlocks, getListItemBlocks, isListItemBlock, isFirstBlockOfListItem, ListItemUid } from './utils/model.js';\nimport { createListElement, createListItemElement, getIndent, isListView, isListItemView } from './utils/view.js';\nimport ListWalker, { iterateSiblingListBlocks } from './utils/listwalker.js';\nimport { findAndAddListHeadToMap } from './utils/postfixers.js';\n/**\n * Returns the upcast converter for list items. It's supposed to work after the block converters (content inside list items) are converted.\n *\n * @internal\n */\nexport function listItemUpcastConverter() {\n return (evt, data, conversionApi) => {\n const { writer, schema } = conversionApi;\n if (!data.modelRange) {\n return;\n }\n const items = Array.from(data.modelRange.getItems({ shallow: true }))\n .filter((item) => schema.checkAttribute(item, 'listItemId'));\n if (!items.length) {\n return;\n }\n const listItemId = ListItemUid.next();\n const listIndent = getIndent(data.viewItem);\n let listType = data.viewItem.parent && data.viewItem.parent.is('element', 'ol') ? 'numbered' : 'bulleted';\n // Preserve list type if was already set (for example by to-do list feature).\n const firstItemListType = items[0].getAttribute('listType');\n if (firstItemListType) {\n listType = firstItemListType;\n }\n const attributes = {\n listItemId,\n listIndent,\n listType\n };\n for (const item of items) {\n // Set list attributes only on same level items, those nested deeper are already handled by the recursive conversion.\n if (!item.hasAttribute('listItemId')) {\n writer.setAttributes(attributes, item);\n }\n }\n if (items.length > 1) {\n // Make sure that list item that contain only nested list will preserve paragraph for itself:\n //\t<ul>\n //\t\t<li>\n //\t\t\t<p></p> <-- this one must be kept\n //\t\t\t<ul>\n //\t\t\t\t<li></li>\n //\t\t\t</ul>\n //\t\t</li>\n //\t</ul>\n if (items[1].getAttribute('listItemId') != attributes.listItemId) {\n conversionApi.keepEmptyElement(items[0]);\n }\n }\n };\n}\n/**\n * Returns a model document change:data event listener that triggers conversion of related items if needed.\n *\n * @internal\n * @param model The editor model.\n * @param editing The editing controller.\n * @param attributeNames The list of all model list attributes (including registered strategies).\n * @param listEditing The document list editing plugin.\n */\nexport function reconvertItemsOnDataChange(model, editing, attributeNames, listEditing) {\n return () => {\n const changes = model.document.differ.getChanges();\n const itemsToRefresh = [];\n const itemToListHead = new Map();\n const changedItems = new Set();\n for (const entry of changes) {\n if (entry.type == 'insert' && entry.name != '$text') {\n findAndAddListHeadToMap(entry.position, itemToListHead);\n // Insert of a non-list item.\n if (!entry.attributes.has('listItemId')) {\n findAndAddListHeadToMap(entry.position.getShiftedBy(entry.length), itemToListHead);\n }\n else {\n changedItems.add(entry.position.nodeAfter);\n }\n }\n // Removed list item.\n else if (entry.type == 'remove' && entry.attributes.has('listItemId')) {\n findAndAddListHeadToMap(entry.position, itemToListHead);\n }\n // Changed list attribute.\n else if (entry.type == 'attribute') {\n const item = entry.range.start.nodeAfter;\n if (attributeNames.includes(entry.attributeKey)) {\n findAndAddListHeadToMap(entry.range.start, itemToListHead);\n if (entry.attributeNewValue === null) {\n findAndAddListHeadToMap(entry.range.start.getShiftedBy(1), itemToListHead);\n // Check if paragraph should be converted from bogus to plain paragraph.\n if (doesItemBlockRequiresRefresh(item)) {\n itemsToRefresh.push(item);\n }\n }\n else {\n changedItems.add(item);\n }\n }\n else if (isListItemBlock(item)) {\n // Some other attribute was changed on the list item,\n // check if paragraph does not need to be converted to bogus or back.\n if (doesItemBlockRequiresRefresh(item)) {\n itemsToRefresh.push(item);\n }\n }\n }\n }\n for (const listHead of itemToListHead.values()) {\n itemsToRefresh.push(...collectListItemsToRefresh(listHead, changedItems));\n }\n for (const item of new Set(itemsToRefresh)) {\n editing.reconvertItem(item);\n }\n };\n function collectListItemsToRefresh(listHead, changedItems) {\n const itemsToRefresh = [];\n const visited = new Set();\n const stack = [];\n for (const { node, previous } of iterateSiblingListBlocks(listHead, 'forward')) {\n if (visited.has(node)) {\n continue;\n }\n const itemIndent = node.getAttribute('listIndent');\n // Current node is at the lower indent so trim the stack.\n if (previous && itemIndent < previous.getAttribute('listIndent')) {\n stack.length = itemIndent + 1;\n }\n // Update the stack for the current indent level.\n stack[itemIndent] = Object.fromEntries(Array.from(node.getAttributes())\n .filter(([key]) => attributeNames.includes(key)));\n // Find all blocks of the current node.\n const blocks = getListItemBlocks(node, { direction: 'forward' });\n for (const block of blocks) {\n visited.add(block);\n // Check if bogus vs plain paragraph needs refresh.\n if (doesItemBlockRequiresRefresh(block, blocks)) {\n itemsToRefresh.push(block);\n }\n // Check if wrapping with UL, OL, LIs needs refresh.\n else if (doesItemWrappingRequiresRefresh(block, stack, changedItems)) {\n itemsToRefresh.push(block);\n }\n }\n }\n return itemsToRefresh;\n }\n function doesItemBlockRequiresRefresh(item, blocks) {\n const viewElement = editing.mapper.toViewElement(item);\n if (!viewElement) {\n return false;\n }\n const needsRefresh = listEditing.fire('checkElement', {\n modelElement: item,\n viewElement\n });\n if (needsRefresh) {\n return true;\n }\n if (!item.is('element', 'paragraph') && !item.is('element', 'listItem')) {\n return false;\n }\n const useBogus = shouldUseBogusParagraph(item, attributeNames, blocks);\n if (useBogus && viewElement.is('element', 'p')) {\n return true;\n }\n else if (!useBogus && viewElement.is('element', 'span')) {\n return true;\n }\n return false;\n }\n function doesItemWrappingRequiresRefresh(item, stack, changedItems) {\n // Items directly affected by some \"change\" don't need a refresh, they will be converted by their own changes.\n if (changedItems.has(item)) {\n return false;\n }\n const viewElement = editing.mapper.toViewElement(item);\n let indent = stack.length - 1;\n // Traverse down the stack to the root to verify if all ULs, OLs, and LIs are as expected.\n for (let element = viewElement.parent; !element.is('editableElement'); element = element.parent) {\n const isListItemElement = isListItemView(element);\n const isListElement = isListView(element);\n if (!isListElement && !isListItemElement) {\n continue;\n }\n const eventName = `checkAttributes:${isListItemElement ? 'item' : 'list'}`;\n const needsRefresh = listEditing.fire(eventName, {\n viewElement: element,\n modelAttributes: stack[indent]\n });\n if (needsRefresh) {\n break;\n }\n if (isListElement) {\n indent--;\n // Don't need to iterate further if we already know that the item is wrapped appropriately.\n if (indent < 0) {\n return false;\n }\n }\n }\n return true;\n }\n}\n/**\n * Returns the list item downcast converter.\n *\n * @internal\n * @param attributeNames A list of attribute names that should be converted if they are set.\n * @param strategies The strategies.\n * @param model The model.\n */\nexport function listItemDowncastConverter(attributeNames, strategies, model, { dataPipeline } = {}) {\n const consumer = createAttributesConsumer(attributeNames);\n return (evt, data, conversionApi) => {\n const { writer, mapper, consumable } = conversionApi;\n const listItem = data.item;\n if (!attributeNames.includes(data.attributeKey)) {\n return;\n }\n // Test if attributes on the converted items are not consumed.\n if (!consumer(listItem, consumable)) {\n return;\n }\n // Use positions mapping instead of mapper.toViewElement( listItem ) to find outermost view element.\n // This is for cases when mapping is using inner view element like in the code blocks (pre > code).\n const viewElement = findMappedViewElement(listItem, mapper, model);\n // Remove custom item marker.\n removeCustomMarkerElements(viewElement, writer, mapper);\n // Unwrap element from current list wrappers.\n unwrapListItemBlock(viewElement, writer);\n // Insert custom item marker.\n const viewRange = insertCustomMarkerElements(listItem, viewElement, strategies, writer, { dataPipeline });\n // Then wrap them with the new list wrappers (UL, OL, LI).\n wrapListItemBlock(listItem, viewRange, strategies, writer);\n };\n}\n/**\n * The 'remove' downcast converter for custom markers.\n */\nexport function listItemDowncastRemoveConverter(schema) {\n return (evt, data, conversionApi) => {\n const { writer, mapper } = conversionApi;\n const elementName = evt.name.split(':')[1];\n // Do not remove marker if the deleted element is some inline object inside paragraph.\n // See https://github.com/cksource/ckeditor5-internal/issues/3680.\n if (!schema.checkAttribute(elementName, 'listItemId')) {\n return;\n }\n // Find the view range start position by mapping the model position at which the remove happened.\n const viewStart = mapper.toViewPosition(data.position);\n const modelEnd = data.position.getShiftedBy(data.length);\n const viewEnd = mapper.toViewPosition(modelEnd, { isPhantom: true });\n // Trim the range to remove in case some UI elements are on the view range boundaries.\n const viewRange = writer.createRange(viewStart, viewEnd).getTrimmed();\n // Use positions mapping instead of mapper.toViewElement( listItem ) to find outermost view element.\n // This is for cases when mapping is using inner view element like in the code blocks (pre > code).\n const viewElement = viewRange.end.nodeBefore;\n /* istanbul ignore next -- @preserve */\n if (!viewElement) {\n return;\n }\n // Remove custom item marker.\n removeCustomMarkerElements(viewElement, writer, mapper);\n };\n}\n/**\n * Returns the bogus paragraph view element creator. A bogus paragraph is used if a list item contains only a single block or nested list.\n *\n * @internal\n * @param attributeNames The list of all model list attributes (including registered strategies).\n */\nexport function bogusParagraphCreator(attributeNames, { dataPipeline } = {}) {\n return (modelElement, { writer }) => {\n // Convert only if a bogus paragraph should be used.\n if (!shouldUseBogusParagraph(modelElement, attributeNames)) {\n return null;\n }\n if (!dataPipeline) {\n return writer.createContainerElement('span', { class: 'ck-list-bogus-paragraph' });\n }\n // Using `<p>` in case there are some markers on it and transparentRendering will render it anyway.\n const viewElement = writer.createContainerElement('p');\n writer.setCustomProperty('dataPipeline:transparentRendering', true, viewElement);\n return viewElement;\n };\n}\n/**\n * Helper for mapping mode to view elements. It's using positions mapping instead of mapper.toViewElement( element )\n * to find outermost view element. This is for cases when mapping is using inner view element like in the code blocks (pre > code).\n *\n * @internal\n * @param element The model element.\n * @param mapper The mapper instance.\n * @param model The model.\n */\nexport function findMappedViewElement(element, mapper, model) {\n const modelRange = model.createRangeOn(element);\n const viewRange = mapper.toViewRange(modelRange).getTrimmed();\n return viewRange.end.nodeBefore;\n}\n/**\n * The model to view custom position mapping for cases when marker is injected at the beginning of a block.\n */\nexport function createModelToViewPositionMapper(strategies, view) {\n return (evt, data) => {\n if (data.modelPosition.offset > 0) {\n return;\n }\n const positionParent = data.modelPosition.parent;\n if (!isListItemBlock(positionParent)) {\n return;\n }\n if (!strategies.some(strategy => (strategy.scope == 'itemMarker' &&\n strategy.canInjectMarkerIntoElement &&\n strategy.canInjectMarkerIntoElement(positionParent)))) {\n return;\n }\n const viewElement = data.mapper.toViewElement(positionParent);\n const viewRange = view.createRangeIn(viewElement);\n const viewWalker = viewRange.getWalker();\n let positionAfterLastMarker = viewRange.start;\n for (const { item } of viewWalker) {\n // Walk only over the non-mapped elements (UIElements, AttributeElements, $text, or any other element without mapping).\n if (item.is('element') && data.mapper.toModelElement(item) || item.is('$textProxy')) {\n break;\n }\n if (item.is('element') && item.getCustomProperty('listItemMarker')) {\n positionAfterLastMarker = view.createPositionAfter(item);\n // Jump over the content of the marker (this is not needed for UIElement but required for other element types).\n viewWalker.skip(({ previousPosition }) => !previousPosition.isEqual(positionAfterLastMarker));\n }\n }\n data.viewPosition = positionAfterLastMarker;\n };\n}\n/**\n * Removes a custom marker elements and item wrappers related to that marker.\n */\nfunction removeCustomMarkerElements(viewElement, viewWriter, mapper) {\n // Remove item wrapper.\n while (viewElement.parent.is('attributeElement') && viewElement.parent.getCustomProperty('listItemWrapper')) {\n viewWriter.unwrap(viewWriter.createRangeOn(viewElement), viewElement.parent);\n }\n // Remove custom item markers.\n const markersToRemove = [];\n // Markers before a block.\n collectMarkersToRemove(viewWriter.createPositionBefore(viewElement).getWalker({ direction: 'backward' }));\n // Markers inside a block.\n collectMarkersToRemove(viewWriter.createRangeIn(viewElement).getWalker());\n for (const marker of markersToRemove) {\n viewWriter.remove(marker);\n }\n function collectMarkersToRemove(viewWalker) {\n for (const { item } of viewWalker) {\n // Walk only over the non-mapped elements (UIElements, AttributeElements, $text, or any other element without mapping).\n if (item.is('element') && mapper.toModelElement(item)) {\n break;\n }\n if (item.is('element') && item.getCustomProperty('listItemMarker')) {\n markersToRemove.push(item);\n }\n }\n }\n}\n/**\n * Inserts a custom marker elements and wraps first block of a list item if marker requires it.\n */\nfunction insertCustomMarkerElements(listItem, viewElement, strategies, writer, { dataPipeline }) {\n let viewRange = writer.createRangeOn(viewElement);\n // Marker can be inserted only before the first block of a list item.\n if (!isFirstBlockOfListItem(listItem)) {\n return viewRange;\n }\n for (const strategy of strategies) {\n if (strategy.scope != 'itemMarker') {\n continue;\n }\n // Create the custom marker element and inject it before the first block of the list item.\n const markerElement = strategy.createElement(writer, listItem, { dataPipeline });\n if (!markerElement) {\n continue;\n }\n writer.setCustomProperty('listItemMarker', true, markerElement);\n if (strategy.canInjectMarkerIntoElement && strategy.canInjectMarkerIntoElement(listItem)) {\n writer.insert(writer.createPositionAt(viewElement, 0), markerElement);\n }\n else {\n writer.insert(viewRange.start, markerElement);\n viewRange = writer.createRange(writer.createPositionBefore(markerElement), writer.createPositionAfter(viewElement));\n }\n // Wrap the marker and optionally the first block with an attribute element (label for to-do lists).\n if (!strategy.createWrapperElement || !strategy.canWrapElement) {\n continue;\n }\n const wrapper = strategy.createWrapperElement(writer, listItem, { dataPipeline });\n writer.setCustomProperty('listItemWrapper', true, wrapper);\n // The whole block can be wrapped...\n if (strategy.canWrapElement(listItem)) {\n viewRange = writer.wrap(viewRange, wrapper);\n }\n else {\n // ... or only the marker element (if the block is downcasted to heading or block widget).\n viewRange = writer.wrap(writer.createRangeOn(markerElement), wrapper);\n viewRange = writer.createRange(viewRange.start, writer.createPositionAfter(viewElement));\n }\n }\n return viewRange;\n}\n/**\n * Unwraps all ol, ul, and li attribute elements that are wrapping the provided view element.\n */\nfunction unwrapListItemBlock(viewElement, viewWriter) {\n let attributeElement = viewElement.parent;\n while (attributeElement.is('attributeElement') && ['ul', 'ol', 'li'].includes(attributeElement.name)) {\n const parentElement = attributeElement.parent;\n viewWriter.unwrap(viewWriter.createRangeOn(viewElement), attributeElement);\n attributeElement = parentElement;\n }\n}\n/**\n * Wraps the given list item with appropriate attribute elements for ul, ol, and li.\n */\nfunction wrapListItemBlock(listItem, viewRange, strategies, writer) {\n if (!listItem.hasAttribute('listIndent')) {\n return;\n }\n const listItemIndent = listItem.getAttribute('listIndent');\n let currentListItem = listItem;\n for (let indent = listItemIndent; indent >= 0; indent--) {\n const listItemViewElement = createListItemElement(writer, indent, currentListItem.getAttribute('listItemId'));\n const listViewElement = createListElement(writer, indent, currentListItem.getAttribute('listType'));\n for (const strategy of strategies) {\n if ((strategy.scope == 'list' || strategy.scope == 'item') &&\n currentListItem.hasAttribute(strategy.attributeName)) {\n strategy.setAttributeOnDowncast(writer, currentListItem.getAttribute(strategy.attributeName), strategy.scope == 'list' ? listViewElement : listItemViewElement);\n }\n }\n viewRange = writer.wrap(viewRange, listItemViewElement);\n viewRange = writer.wrap(viewRange, listViewElement);\n if (indent == 0) {\n break;\n }\n currentListItem = ListWalker.first(currentListItem, { lowerIndent: true });\n // There is no list item with lower indent, this means this is a document fragment containing\n // only a part of nested list (like copy to clipboard) so we don't need to try to wrap it further.\n if (!currentListItem) {\n break;\n }\n }\n}\n// Returns the function that is responsible for consuming attributes that are set on the model node.\nfunction createAttributesConsumer(attributeNames) {\n return (node, consumable) => {\n const events = [];\n // Collect all set attributes that are triggering conversion.\n for (const attributeName of attributeNames) {\n if (node.hasAttribute(attributeName)) {\n events.push(`attribute:${attributeName}`);\n }\n }\n if (!events.every(event => consumable.test(node, event) !== false)) {\n return false;\n }\n events.forEach(event => consumable.consume(node, event));\n return true;\n };\n}\n// Whether the given item should be rendered as a bogus paragraph.\nfunction shouldUseBogusParagraph(item, attributeNames, blocks = getAllListItemBlocks(item)) {\n if (!isListItemBlock(item)) {\n return false;\n }\n for (const attributeKey of item.getAttributeKeys()) {\n // Ignore selection attributes stored on block elements.\n if (attributeKey.startsWith('selection:')) {\n continue;\n }\n // Don't use bogus paragraph if there are attributes from other features.\n if (!attributeNames.includes(attributeKey)) {\n return false;\n }\n }\n return blocks.length < 2;\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./documentlist.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./documentlist.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./list.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./list.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list/listediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Delete } from 'ckeditor5/src/typing.js';\nimport { Enter } from 'ckeditor5/src/enter.js';\nimport { CKEditorError } from 'ckeditor5/src/utils.js';\nimport ListIndentCommand from './listindentcommand.js';\nimport ListCommand from './listcommand.js';\nimport ListMergeCommand from './listmergecommand.js';\nimport ListSplitCommand from './listsplitcommand.js';\nimport ListUtils from './listutils.js';\nimport { bogusParagraphCreator, createModelToViewPositionMapper, listItemDowncastConverter, listItemDowncastRemoveConverter, listItemUpcastConverter, reconvertItemsOnDataChange } from './converters.js';\nimport { findAndAddListHeadToMap, fixListIndents, fixListItemIds } from './utils/postfixers.js';\nimport { getAllListItemBlocks, isFirstBlockOfListItem, isLastBlockOfListItem, isSingleListItem, getSelectedBlockObject, isListItemBlock, removeListAttributes, ListItemUid } from './utils/model.js';\nimport { getViewElementIdForListType, getViewElementNameForListType } from './utils/view.js';\nimport ListWalker, { ListBlocksIterable } from './utils/listwalker.js';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';\nimport '../../theme/documentlist.css';\nimport '../../theme/list.css';\n/**\n * A list of base list model attributes.\n */\nconst LIST_BASE_ATTRIBUTES = ['listType', 'listIndent', 'listItemId'];\n/**\n * The editing part of the document-list feature. It handles creating, editing and removing lists and list items.\n */\nexport default class ListEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Enter, Delete, ListUtils, ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * The list of registered downcast strategies.\n */\n this._downcastStrategies = [];\n editor.config.define('list.multiBlock', true);\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const multiBlock = editor.config.get('list.multiBlock');\n if (editor.plugins.has('LegacyListEditing')) {\n /**\n * The `List` feature can not be loaded together with the `LegacyList` plugin.\n *\n * @error list-feature-conflict\n * @param conflictPlugin Name of the plugin.\n */\n throw new CKEditorError('list-feature-conflict', this, { conflictPlugin: 'LegacyListEditing' });\n }\n model.schema.register('$listItem', { allowAttributes: LIST_BASE_ATTRIBUTES });\n if (multiBlock) {\n model.schema.extend('$container', { allowAttributesOf: '$listItem' });\n model.schema.extend('$block', { allowAttributesOf: '$listItem' });\n model.schema.extend('$blockObject', { allowAttributesOf: '$listItem' });\n }\n else {\n model.schema.register('listItem', {\n inheritAllFrom: '$block',\n allowAttributesOf: '$listItem'\n });\n }\n for (const attribute of LIST_BASE_ATTRIBUTES) {\n model.schema.setAttributeProperties(attribute, {\n copyOnReplace: true\n });\n }\n // Register commands.\n editor.commands.add('numberedList', new ListCommand(editor, 'numbered'));\n editor.commands.add('bulletedList', new ListCommand(editor, 'bulleted'));\n editor.commands.add('customNumberedList', new ListCommand(editor, 'customNumbered', { multiLevel: true }));\n editor.commands.add('customBulletedList', new ListCommand(editor, 'customBulleted', { multiLevel: true }));\n editor.commands.add('indentList', new ListIndentCommand(editor, 'forward'));\n editor.commands.add('outdentList', new ListIndentCommand(editor, 'backward'));\n editor.commands.add('splitListItemBefore', new ListSplitCommand(editor, 'before'));\n editor.commands.add('splitListItemAfter', new ListSplitCommand(editor, 'after'));\n if (multiBlock) {\n editor.commands.add('mergeListItemBackward', new ListMergeCommand(editor, 'backward'));\n editor.commands.add('mergeListItemForward', new ListMergeCommand(editor, 'forward'));\n }\n this._setupDeleteIntegration();\n this._setupEnterIntegration();\n this._setupTabIntegration();\n this._setupClipboardIntegration();\n this._setupAccessibilityIntegration();\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const commands = editor.commands;\n const indent = commands.get('indent');\n const outdent = commands.get('outdent');\n if (indent) {\n // Priority is high due to integration with `IndentBlock` plugin. We want to indent list first and if it's not possible\n // user can indent content with `IndentBlock` plugin.\n indent.registerChildCommand(commands.get('indentList'), { priority: 'high' });\n }\n if (outdent) {\n // Priority is lowest due to integration with `IndentBlock` and `IndentCode` plugins.\n // First we want to allow user to outdent all indendations from other features then he can oudent list item.\n outdent.registerChildCommand(commands.get('outdentList'), { priority: 'lowest' });\n }\n // Register conversion and model post-fixer after other plugins had a chance to register their attribute strategies.\n this._setupModelPostFixing();\n this._setupConversion();\n }\n /**\n * Registers a downcast strategy.\n *\n * **Note**: Strategies must be registered in the `Plugin#init()` phase so that it can be applied\n * in the `ListEditing#afterInit()`.\n *\n * @param strategy The downcast strategy to register.\n */\n registerDowncastStrategy(strategy) {\n this._downcastStrategies.push(strategy);\n }\n /**\n * Returns list of model attribute names that should affect downcast conversion.\n */\n getListAttributeNames() {\n return [\n ...LIST_BASE_ATTRIBUTES,\n ...this._downcastStrategies.map(strategy => strategy.attributeName)\n ];\n }\n /**\n * Attaches the listener to the {@link module:engine/view/document~Document#event:delete} event and handles backspace/delete\n * keys in and around document lists.\n */\n _setupDeleteIntegration() {\n const editor = this.editor;\n const mergeBackwardCommand = editor.commands.get('mergeListItemBackward');\n const mergeForwardCommand = editor.commands.get('mergeListItemForward');\n this.listenTo(editor.editing.view.document, 'delete', (evt, data) => {\n const selection = editor.model.document.selection;\n // Let the Widget plugin take care of block widgets while deleting (https://github.com/ckeditor/ckeditor5/issues/11346).\n if (getSelectedBlockObject(editor.model)) {\n return;\n }\n editor.model.change(() => {\n const firstPosition = selection.getFirstPosition();\n if (selection.isCollapsed && data.direction == 'backward') {\n if (!firstPosition.isAtStart) {\n return;\n }\n const positionParent = firstPosition.parent;\n if (!isListItemBlock(positionParent)) {\n return;\n }\n const previousBlock = ListWalker.first(positionParent, {\n sameAttributes: 'listType',\n sameIndent: true\n });\n // Outdent the first block of a first list item.\n if (!previousBlock && positionParent.getAttribute('listIndent') === 0) {\n if (!isLastBlockOfListItem(positionParent)) {\n editor.execute('splitListItemAfter');\n }\n editor.execute('outdentList');\n }\n // Merge block with previous one (on the block level or on the content level).\n else {\n if (!mergeBackwardCommand || !mergeBackwardCommand.isEnabled) {\n return;\n }\n mergeBackwardCommand.execute({\n shouldMergeOnBlocksContentLevel: shouldMergeOnBlocksContentLevel(editor.model, 'backward')\n });\n }\n data.preventDefault();\n evt.stop();\n }\n // Non-collapsed selection or forward delete.\n else {\n // Collapsed selection should trigger forward merging only if at the end of a block.\n if (selection.isCollapsed && !selection.getLastPosition().isAtEnd) {\n return;\n }\n if (!mergeForwardCommand || !mergeForwardCommand.isEnabled) {\n return;\n }\n mergeForwardCommand.execute({\n shouldMergeOnBlocksContentLevel: shouldMergeOnBlocksContentLevel(editor.model, 'forward')\n });\n data.preventDefault();\n evt.stop();\n }\n });\n }, { context: 'li' });\n }\n /**\n * Attaches a listener to the {@link module:engine/view/document~Document#event:enter} event and handles enter key press\n * in document lists.\n */\n _setupEnterIntegration() {\n const editor = this.editor;\n const model = editor.model;\n const commands = editor.commands;\n const enterCommand = commands.get('enter');\n // Overwrite the default Enter key behavior: outdent or split the list in certain cases.\n this.listenTo(editor.editing.view.document, 'enter', (evt, data) => {\n const doc = model.document;\n const positionParent = doc.selection.getFirstPosition().parent;\n if (doc.selection.isCollapsed &&\n isListItemBlock(positionParent) &&\n positionParent.isEmpty &&\n !data.isSoft) {\n const isFirstBlock = isFirstBlockOfListItem(positionParent);\n const isLastBlock = isLastBlockOfListItem(positionParent);\n // * a → * a\n // * [] → []\n if (isFirstBlock && isLastBlock) {\n editor.execute('outdentList');\n data.preventDefault();\n evt.stop();\n }\n // * [] → * []\n // a → * a\n else if (isFirstBlock && !isLastBlock) {\n editor.execute('splitListItemAfter');\n data.preventDefault();\n evt.stop();\n }\n // * a → * a\n // [] → * []\n else if (isLastBlock) {\n editor.execute('splitListItemBefore');\n data.preventDefault();\n evt.stop();\n }\n }\n }, { context: 'li' });\n // In some cases, after the default block splitting, we want to modify the new block to become a new list item\n // instead of an additional block in the same list item.\n this.listenTo(enterCommand, 'afterExecute', () => {\n const splitCommand = commands.get('splitListItemBefore');\n // The command has not refreshed because the change block related to EnterCommand#execute() is not over yet.\n // Let's keep it up to date and take advantage of ListSplitCommand#isEnabled.\n splitCommand.refresh();\n if (!splitCommand.isEnabled) {\n return;\n }\n const doc = editor.model.document;\n const positionParent = doc.selection.getLastPosition().parent;\n const listItemBlocks = getAllListItemBlocks(positionParent);\n // Keep in mind this split happens after the default enter handler was executed. For instance:\n //\n // │ Initial state │ After default enter │ Here in #afterExecute │\n // ├───────────────────────────┼───────────────────────────┼───────────────────────────┤\n // │ * a[] │ * a │ * a │\n // │ │ [] │ * [] │\n if (listItemBlocks.length === 2) {\n splitCommand.execute();\n }\n });\n }\n /**\n * Attaches a listener to the {@link module:engine/view/document~Document#event:tab} event and handles tab key and tab+shift keys\n * presses in document lists.\n */\n _setupTabIntegration() {\n const editor = this.editor;\n this.listenTo(editor.editing.view.document, 'tab', (evt, data) => {\n const commandName = data.shiftKey ? 'outdentList' : 'indentList';\n const command = this.editor.commands.get(commandName);\n if (command.isEnabled) {\n editor.execute(commandName);\n data.stopPropagation();\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'li' });\n }\n /**\n * Registers the conversion helpers for the document-list feature.\n */\n _setupConversion() {\n const editor = this.editor;\n const model = editor.model;\n const attributeNames = this.getListAttributeNames();\n const multiBlock = editor.config.get('list.multiBlock');\n const elementName = multiBlock ? 'paragraph' : 'listItem';\n editor.conversion.for('upcast')\n // Convert <li> to a generic paragraph (or listItem element) so the content of <li> is always inside a block.\n // Setting the listType attribute to let other features (to-do list) know that this is part of a list item.\n // This is also important to properly handle simple lists so that paragraphs inside a list item won't break the list item.\n // <li> <-- converted to listItem\n // <p></p> <-- should be also converted to listItem, so it won't split and replace the listItem generated from the above li.\n .elementToElement({\n view: 'li',\n model: (viewElement, { writer }) => writer.createElement(elementName, { listType: '' })\n })\n // Convert paragraph to the list block (without list type defined yet).\n // This is important to properly handle bogus paragraph and to-do lists.\n // Most of the time the bogus paragraph should not appear in the data of to-do list,\n // but if there is any marker or an attribute on the paragraph then the bogus paragraph\n // is preserved in the data, and we need to be able to detect this case.\n .elementToElement({\n view: 'p',\n model: (viewElement, { writer }) => {\n if (viewElement.parent && viewElement.parent.is('element', 'li')) {\n return writer.createElement(elementName, { listType: '' });\n }\n return null;\n },\n converterPriority: 'high'\n })\n .add(dispatcher => {\n dispatcher.on('element:li', listItemUpcastConverter());\n });\n if (!multiBlock) {\n editor.conversion.for('downcast')\n .elementToElement({\n model: 'listItem',\n view: 'p'\n });\n }\n editor.conversion.for('editingDowncast')\n .elementToElement({\n model: elementName,\n view: bogusParagraphCreator(attributeNames),\n converterPriority: 'high'\n })\n .add(dispatcher => {\n dispatcher.on('attribute', listItemDowncastConverter(attributeNames, this._downcastStrategies, model));\n dispatcher.on('remove', listItemDowncastRemoveConverter(model.schema));\n });\n editor.conversion.for('dataDowncast')\n .elementToElement({\n model: elementName,\n view: bogusParagraphCreator(attributeNames, { dataPipeline: true }),\n converterPriority: 'high'\n })\n .add(dispatcher => {\n dispatcher.on('attribute', listItemDowncastConverter(attributeNames, this._downcastStrategies, model, { dataPipeline: true }));\n });\n const modelToViewPositionMapper = createModelToViewPositionMapper(this._downcastStrategies, editor.editing.view);\n editor.editing.mapper.on('modelToViewPosition', modelToViewPositionMapper);\n editor.data.mapper.on('modelToViewPosition', modelToViewPositionMapper);\n this.listenTo(model.document, 'change:data', reconvertItemsOnDataChange(model, editor.editing, attributeNames, this), { priority: 'high' });\n // For LI verify if an ID of the attribute element is correct.\n this.on('checkAttributes:item', (evt, { viewElement, modelAttributes }) => {\n if (viewElement.id != modelAttributes.listItemId) {\n evt.return = true;\n evt.stop();\n }\n });\n // For UL and OL check if the name and ID of element is correct.\n this.on('checkAttributes:list', (evt, { viewElement, modelAttributes }) => {\n if (viewElement.name != getViewElementNameForListType(modelAttributes.listType) ||\n viewElement.id != getViewElementIdForListType(modelAttributes.listType, modelAttributes.listIndent)) {\n evt.return = true;\n evt.stop();\n }\n });\n }\n /**\n * Registers model post-fixers.\n */\n _setupModelPostFixing() {\n const model = this.editor.model;\n const attributeNames = this.getListAttributeNames();\n // Register list fixing.\n // First the low level handler.\n model.document.registerPostFixer(writer => modelChangePostFixer(model, writer, attributeNames, this));\n // Then the callbacks for the specific lists.\n // The indentation fixing must be the first one...\n this.on('postFixer', (evt, { listNodes, writer }) => {\n evt.return = fixListIndents(listNodes, writer) || evt.return;\n }, { priority: 'high' });\n // ...then the item ids... and after that other fixers that rely on the correct indentation and ids.\n this.on('postFixer', (evt, { listNodes, writer, seenIds }) => {\n evt.return = fixListItemIds(listNodes, seenIds, writer) || evt.return;\n }, { priority: 'high' });\n }\n /**\n * Integrates the feature with the clipboard via {@link module:engine/model/model~Model#insertContent} and\n * {@link module:engine/model/model~Model#getSelectedContent}.\n */\n _setupClipboardIntegration() {\n const model = this.editor.model;\n const clipboardPipeline = this.editor.plugins.get('ClipboardPipeline');\n this.listenTo(model, 'insertContent', createModelIndentPasteFixer(model), { priority: 'high' });\n // To enhance the UX, the editor should not copy list attributes to the clipboard if the selection\n // started and ended in the same list item.\n //\n // If the selection was enclosed in a single list item, there is a good chance the user did not want it\n // copied as a list item but plain blocks.\n //\n // This avoids pasting orphaned list items instead of paragraphs, for instance, straight into the root.\n //\n //\t ┌─────────────────────┬───────────────────â”\n //\t │ Selection │ Clipboard content │\n //\t ├─────────────────────┼───────────────────┤\n //\t │ [* <Widget />] │ <Widget /> │\n //\t ├─────────────────────┼───────────────────┤\n //\t │ [* Foo] │ Foo │\n //\t ├─────────────────────┼───────────────────┤\n //\t │ * Foo [bar] baz │ bar │\n //\t ├─────────────────────┼───────────────────┤\n //\t │ * Fo[o │ o │\n //\t │ ba]r │ ba │\n //\t ├─────────────────────┼───────────────────┤\n //\t │ * Fo[o │ * o │\n //\t │ * ba]r │ * ba │\n //\t ├─────────────────────┼───────────────────┤\n //\t │ [* Foo │ * Foo │\n //\t │ * bar] │ * bar │\n //\t └─────────────────────┴───────────────────┘\n //\n // See https://github.com/ckeditor/ckeditor5/issues/11608, https://github.com/ckeditor/ckeditor5/issues/14969\n this.listenTo(clipboardPipeline, 'outputTransformation', (evt, data) => {\n model.change(writer => {\n // Remove last block if it's empty.\n const allContentChildren = Array.from(data.content.getChildren());\n const lastItem = allContentChildren[allContentChildren.length - 1];\n if (allContentChildren.length > 1 && lastItem.is('element') && lastItem.isEmpty) {\n const contentChildrenExceptLastItem = allContentChildren.slice(0, -1);\n if (contentChildrenExceptLastItem.every(isListItemBlock)) {\n writer.remove(lastItem);\n }\n }\n // Copy/cut only content of a list item (for drag-drop move the whole list item).\n if (data.method == 'copy' || data.method == 'cut') {\n const allChildren = Array.from(data.content.getChildren());\n const isSingleListItemSelected = isSingleListItem(allChildren);\n if (isSingleListItemSelected) {\n removeListAttributes(allChildren, writer);\n }\n }\n });\n });\n }\n /**\n * Informs editor accessibility features about keystrokes brought by the plugin.\n */\n _setupAccessibilityIntegration() {\n const editor = this.editor;\n const t = editor.t;\n editor.accessibility.addKeystrokeInfoGroup({\n id: 'list',\n label: t('Keystrokes that can be used in a list'),\n keystrokes: [\n {\n label: t('Increase list item indent'),\n keystroke: 'Tab'\n },\n {\n label: t('Decrease list item indent'),\n keystroke: 'Shift+Tab'\n }\n ]\n });\n }\n}\n/**\n * Post-fixer that reacts to changes on document and fixes incorrect model states (invalid `listItemId` and `listIndent` values).\n *\n * In the example below, there is a correct list structure.\n * Then the middle element is removed so the list structure will become incorrect:\n *\n * ```xml\n * <paragraph listType=\"bulleted\" listItemId=\"a\" listIndent=0>Item 1</paragraph>\n * <paragraph listType=\"bulleted\" listItemId=\"b\" listIndent=1>Item 2</paragraph> <--- this is removed.\n * <paragraph listType=\"bulleted\" listItemId=\"c\" listIndent=2>Item 3</paragraph>\n * ```\n *\n * The list structure after the middle element is removed:\n *\n * ```xml\n * <paragraph listType=\"bulleted\" listItemId=\"a\" listIndent=0>Item 1</paragraph>\n * <paragraph listType=\"bulleted\" listItemId=\"c\" listIndent=2>Item 3</paragraph>\n * ```\n *\n * Should become:\n *\n * ```xml\n * <paragraph listType=\"bulleted\" listItemId=\"a\" listIndent=0>Item 1</paragraph>\n * <paragraph listType=\"bulleted\" listItemId=\"c\" listIndent=1>Item 3</paragraph> <--- note that indent got post-fixed.\n * ```\n *\n * @param model The data model.\n * @param writer The writer to do changes with.\n * @param attributeNames The list of all model list attributes (including registered strategies).\n * @param ListEditing The document list editing plugin.\n * @returns `true` if any change has been applied, `false` otherwise.\n */\nfunction modelChangePostFixer(model, writer, attributeNames, listEditing) {\n const changes = model.document.differ.getChanges();\n const itemToListHead = new Map();\n const multiBlock = listEditing.editor.config.get('list.multiBlock');\n let applied = false;\n for (const entry of changes) {\n if (entry.type == 'insert' && entry.name != '$text') {\n const item = entry.position.nodeAfter;\n // Remove attributes in case of renamed element.\n if (!model.schema.checkAttribute(item, 'listItemId')) {\n for (const attributeName of Array.from(item.getAttributeKeys())) {\n if (attributeNames.includes(attributeName)) {\n writer.removeAttribute(attributeName, item);\n applied = true;\n }\n }\n }\n findAndAddListHeadToMap(entry.position, itemToListHead);\n // Insert of a non-list item - check if there is a list after it.\n if (!entry.attributes.has('listItemId')) {\n findAndAddListHeadToMap(entry.position.getShiftedBy(entry.length), itemToListHead);\n }\n // Check if there is no nested list.\n for (const { item: innerItem, previousPosition } of model.createRangeIn(item)) {\n if (isListItemBlock(innerItem)) {\n findAndAddListHeadToMap(previousPosition, itemToListHead);\n }\n }\n }\n // Removed list item or block adjacent to a list.\n else if (entry.type == 'remove') {\n findAndAddListHeadToMap(entry.position, itemToListHead);\n }\n // Changed list item indent or type.\n else if (entry.type == 'attribute' && attributeNames.includes(entry.attributeKey)) {\n findAndAddListHeadToMap(entry.range.start, itemToListHead);\n if (entry.attributeNewValue === null) {\n findAndAddListHeadToMap(entry.range.start.getShiftedBy(1), itemToListHead);\n }\n }\n // Make sure that there is no left over listItem element without attributes or a block with list attributes that is not a listItem.\n if (!multiBlock && entry.type == 'attribute' && LIST_BASE_ATTRIBUTES.includes(entry.attributeKey)) {\n const element = entry.range.start.nodeAfter;\n if (entry.attributeNewValue === null && element && element.is('element', 'listItem')) {\n writer.rename(element, 'paragraph');\n applied = true;\n }\n else if (entry.attributeOldValue === null && element && element.is('element') && element.name != 'listItem') {\n writer.rename(element, 'listItem');\n applied = true;\n }\n }\n }\n // Make sure that IDs are not shared by split list.\n const seenIds = new Set();\n for (const listHead of itemToListHead.values()) {\n applied = listEditing.fire('postFixer', {\n listNodes: new ListBlocksIterable(listHead),\n listHead,\n writer,\n seenIds\n }) || applied;\n }\n return applied;\n}\n/**\n * A fixer for pasted content that includes list items.\n *\n * It fixes indentation of pasted list items so the pasted items match correctly to the context they are pasted into.\n *\n * Example:\n *\n * ```xml\n * <paragraph listType=\"bulleted\" listItemId=\"a\" listIndent=\"0\">A</paragraph>\n * <paragraph listType=\"bulleted\" listItemId=\"b\" listIndent=\"1\">B^</paragraph>\n * // At ^ paste: <paragraph listType=\"numbered\" listItemId=\"x\" listIndent=\"0\">X</paragraph>\n * // <paragraph listType=\"numbered\" listItemId=\"y\" listIndent=\"1\">Y</paragraph>\n * <paragraph listType=\"bulleted\" listItemId=\"c\" listIndent=\"2\">C</paragraph>\n * ```\n *\n * Should become:\n *\n * ```xml\n * <paragraph listType=\"bulleted\" listItemId=\"a\" listIndent=\"0\">A</paragraph>\n * <paragraph listType=\"bulleted\" listItemId=\"b\" listIndent=\"1\">BX</paragraph>\n * <paragraph listType=\"bulleted\" listItemId=\"y\" listIndent=\"2\">Y/paragraph>\n * <paragraph listType=\"bulleted\" listItemId=\"c\" listIndent=\"2\">C</paragraph>\n * ```\n */\nfunction createModelIndentPasteFixer(model) {\n return (evt, [content, selectable]) => {\n const items = content.is('documentFragment') ?\n Array.from(content.getChildren()) :\n [content];\n if (!items.length) {\n return;\n }\n const selection = selectable ?\n model.createSelection(selectable) :\n model.document.selection;\n const position = selection.getFirstPosition();\n // Get a reference list item. Attributes of the inserted list items will be fixed according to that item.\n let refItem;\n if (isListItemBlock(position.parent)) {\n refItem = position.parent;\n }\n else if (isListItemBlock(position.nodeBefore)) {\n refItem = position.nodeBefore;\n }\n else {\n return; // Content is not copied into a list.\n }\n model.change(writer => {\n const refType = refItem.getAttribute('listType');\n const refIndent = refItem.getAttribute('listIndent');\n const firstElementIndent = items[0].getAttribute('listIndent') || 0;\n const indentDiff = Math.max(refIndent - firstElementIndent, 0);\n for (const item of items) {\n const isListItem = isListItemBlock(item);\n if (refItem.is('element', 'listItem') && item.is('element', 'paragraph')) {\n /**\n * When paragraphs or a plain text list is pasted into a simple list, convert\n * the `<paragraphs>' to `<listItem>' to avoid breaking the target list.\n *\n * See https://github.com/ckeditor/ckeditor5/issues/13826.\n */\n writer.rename(item, 'listItem');\n }\n writer.setAttributes({\n listIndent: (isListItem ? item.getAttribute('listIndent') : 0) + indentDiff,\n listItemId: isListItem ? item.getAttribute('listItemId') : ListItemUid.next(),\n listType: refType\n }, item);\n }\n });\n };\n}\n/**\n * Decides whether the merge should be accompanied by the model's `deleteContent()`, for instance, to get rid of the inline\n * content in the selection or take advantage of the heuristics in `deleteContent()` that helps convert lists into paragraphs\n * in certain cases.\n */\nfunction shouldMergeOnBlocksContentLevel(model, direction) {\n const selection = model.document.selection;\n if (!selection.isCollapsed) {\n return !getSelectedBlockObject(model);\n }\n if (direction === 'forward') {\n return true;\n }\n const firstPosition = selection.getFirstPosition();\n const positionParent = firstPosition.parent;\n const previousSibling = positionParent.previousSibling;\n if (model.schema.isObject(previousSibling)) {\n return false;\n }\n if (previousSibling.isEmpty) {\n return true;\n }\n return isSingleListItem([positionParent, previousSibling]);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\n/**\n * Helper method for creating toolbar and menu buttons and linking them with an appropriate command.\n *\n * @internal\n * @param editor The editor instance to which the UI component will be added.\n * @param commandName The name of the command.\n * @param label The button label.\n * @param icon The source of the icon.\n */\nexport function createUIComponents(editor, commandName, label, icon) {\n editor.ui.componentFactory.add(commandName, () => {\n const buttonView = _createButton(ButtonView, editor, commandName, label, icon);\n buttonView.set({\n tooltip: true,\n isToggleable: true\n });\n return buttonView;\n });\n editor.ui.componentFactory.add(`menuBar:${commandName}`, () => {\n const buttonView = _createButton(MenuBarMenuListItemButtonView, editor, commandName, label, icon);\n buttonView.set({\n role: 'menuitemcheckbox',\n isToggleable: true\n });\n return buttonView;\n });\n}\n/**\n * Creates a button to use either in toolbar or in menu bar.\n */\nfunction _createButton(ButtonClass, editor, commandName, label, icon) {\n const command = editor.commands.get(commandName);\n const view = new ButtonClass(editor.locale);\n view.set({\n label,\n icon\n });\n // Bind button model to command.\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute the command.\n view.on('execute', () => {\n editor.execute(commandName);\n editor.editing.view.focus();\n });\n return view;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list/listui\n */\nimport { createUIComponents } from './utils.js';\nimport { icons, Plugin } from 'ckeditor5/src/core.js';\n/**\n * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that\n * allow to convert paragraphs to and from list items and indent or outdent them.\n */\nexport default class ListUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const t = this.editor.t;\n // Create button numberedList.\n if (!this.editor.ui.componentFactory.has('numberedList')) {\n createUIComponents(this.editor, 'numberedList', t('Numbered List'), icons.numberedList);\n }\n // Create button bulletedList.\n if (!this.editor.ui.componentFactory.has('bulletedList')) {\n createUIComponents(this.editor, 'bulletedList', t('Bulleted List'), icons.bulletedList);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n* @module list/listproperties/utils/style\n*/\nconst LIST_STYLE_TO_LIST_TYPE = {};\nconst LIST_STYLE_TO_TYPE_ATTRIBUTE = {};\nconst TYPE_ATTRIBUTE_TO_LIST_STYLE = {};\nconst LIST_STYLE_TYPES = [\n { listStyle: 'disc', typeAttribute: 'disc', listType: 'bulleted' },\n { listStyle: 'circle', typeAttribute: 'circle', listType: 'bulleted' },\n { listStyle: 'square', typeAttribute: 'square', listType: 'bulleted' },\n { listStyle: 'decimal', typeAttribute: '1', listType: 'numbered' },\n { listStyle: 'decimal-leading-zero', typeAttribute: null, listType: 'numbered' },\n { listStyle: 'lower-roman', typeAttribute: 'i', listType: 'numbered' },\n { listStyle: 'upper-roman', typeAttribute: 'I', listType: 'numbered' },\n { listStyle: 'lower-alpha', typeAttribute: 'a', listType: 'numbered' },\n { listStyle: 'upper-alpha', typeAttribute: 'A', listType: 'numbered' },\n { listStyle: 'lower-latin', typeAttribute: 'a', listType: 'numbered' },\n { listStyle: 'upper-latin', typeAttribute: 'A', listType: 'numbered' }\n];\nfor (const { listStyle, typeAttribute, listType } of LIST_STYLE_TYPES) {\n LIST_STYLE_TO_LIST_TYPE[listStyle] = listType;\n LIST_STYLE_TO_TYPE_ATTRIBUTE[listStyle] = typeAttribute;\n if (typeAttribute) {\n TYPE_ATTRIBUTE_TO_LIST_STYLE[typeAttribute] = listStyle;\n }\n}\n/**\n * Gets all the style types supported by given list type.\n */\nexport function getAllSupportedStyleTypes() {\n return LIST_STYLE_TYPES.map(x => x.listStyle);\n}\n/**\n * Checks whether the given list-style-type is supported by numbered or bulleted list.\n */\nexport function getListTypeFromListStyleType(listStyleType) {\n return LIST_STYLE_TO_LIST_TYPE[listStyleType] || null;\n}\n/**\n * Converts `type` attribute of `<ul>` or `<ol>` elements to `list-style-type` equivalent.\n */\nexport function getListStyleTypeFromTypeAttribute(value) {\n return TYPE_ATTRIBUTE_TO_LIST_STYLE[value] || null;\n}\n/**\n * Converts `list-style-type` style to `type` attribute of `<ul>` or `<ol>` elements.\n */\nexport function getTypeAttributeFromListStyleType(value) {\n return LIST_STYLE_TO_TYPE_ATTRIBUTE[value] || null;\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./listproperties.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./listproperties.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./liststyles.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./liststyles.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/todolist/checktodolistcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { getAllListItemBlocks } from '../list/utils/model.js';\n/**\n * The check to-do command.\n *\n * The command is registered by the {@link module:list/todolist/todolistediting~TodoListEditing} as\n * the `checkTodoList` editor command.\n */\nexport default class CheckTodoListCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // Refresh command before executing to be sure all values are up to date.\n // It is needed when selection has changed before command execution, in the same change block.\n this.on('execute', () => {\n this.refresh();\n }, { priority: 'highest' });\n }\n /**\n * Updates the command's {@link #value} and {@link #isEnabled} properties based on the current selection.\n */\n refresh() {\n const selectedElements = this._getSelectedItems();\n this.value = this._getValue(selectedElements);\n this.isEnabled = !!selectedElements.length;\n }\n /**\n * Executes the command.\n *\n * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply\n * the attribute. Otherwise, the command will remove the attribute. If not set, the command will look for its current\n * value to decide what it should do.\n */\n execute(options = {}) {\n this.editor.model.change(writer => {\n const selectedElements = this._getSelectedItems();\n const value = (options.forceValue === undefined) ? !this._getValue(selectedElements) : options.forceValue;\n for (const element of selectedElements) {\n if (value) {\n writer.setAttribute('todoListChecked', true, element);\n }\n else {\n writer.removeAttribute('todoListChecked', element);\n }\n }\n });\n }\n /**\n * Returns a value for the command.\n */\n _getValue(selectedElements) {\n return selectedElements.every(element => element.getAttribute('todoListChecked'));\n }\n /**\n * Gets all to-do list items selected by the {@link module:engine/model/selection~Selection}.\n */\n _getSelectedItems() {\n const model = this.editor.model;\n const schema = model.schema;\n const selectionRange = model.document.selection.getFirstRange();\n const startElement = selectionRange.start.parent;\n const elements = [];\n if (schema.checkAttribute(startElement, 'todoListChecked')) {\n elements.push(...getAllListItemBlocks(startElement));\n }\n for (const item of selectionRange.getItems({ shallow: true })) {\n if (schema.checkAttribute(item, 'todoListChecked') && !elements.includes(item)) {\n elements.push(...getAllListItemBlocks(item));\n }\n }\n return elements;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/todolist/todocheckboxchangeobserver\n */\nimport { DomEventObserver } from 'ckeditor5/src/engine.js';\n/**\n * Observes all to-do list checkboxes state changes.\n *\n * Note that this observer is not available by default. To make it available it needs to be added to\n * {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.\n */\nexport default class TodoCheckboxChangeObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = ['change'];\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n if (domEvent.target) {\n const viewTarget = this.view.domConverter.mapDomToView(domEvent.target);\n if (viewTarget &&\n viewTarget.is('element', 'input') &&\n viewTarget.getAttribute('type') == 'checkbox' &&\n viewTarget.findAncestor({ classes: 'todo-list__label' })) {\n this.fire('todoCheckboxChange', domEvent);\n }\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/todolist/todolistediting\n */\nimport { Matcher } from 'ckeditor5/src/engine.js';\nimport { getCode, parseKeystroke, getLocalizedArrowKeyCodeDirection } from 'ckeditor5/src/utils.js';\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { isFirstBlockOfListItem, isListItemBlock } from '../list/utils/model.js';\nimport ListEditing from '../list/listediting.js';\nimport ListCommand from '../list/listcommand.js';\nimport CheckTodoListCommand from './checktodolistcommand.js';\nimport TodoCheckboxChangeObserver from './todocheckboxchangeobserver.js';\nconst ITEM_TOGGLE_KEYSTROKE = /* #__PURE__ */ parseKeystroke('Ctrl+Enter');\n/**\n * The engine of the to-do list feature. It handles creating, editing and removing to-do lists and their items.\n *\n * It registers the entire functionality of the {@link module:list/list/listediting~ListEditing list editing plugin}\n * and extends it with the commands:\n *\n * - `'todoList'`,\n * - `'checkTodoList'`,\n */\nexport default class TodoListEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TodoListEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ListEditing];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const editing = editor.editing;\n const listEditing = editor.plugins.get(ListEditing);\n const multiBlock = editor.config.get('list.multiBlock');\n const elementName = multiBlock ? 'paragraph' : 'listItem';\n editor.commands.add('todoList', new ListCommand(editor, 'todo'));\n editor.commands.add('checkTodoList', new CheckTodoListCommand(editor));\n editing.view.addObserver(TodoCheckboxChangeObserver);\n model.schema.extend('$listItem', { allowAttributes: 'todoListChecked' });\n model.schema.addAttributeCheck(context => {\n const item = context.last;\n // Don't allow `todoListChecked` attribute on elements which are not todo list items.\n if (!item.getAttribute('listItemId') || item.getAttribute('listType') != 'todo') {\n return false;\n }\n }, 'todoListChecked');\n editor.conversion.for('upcast').add(dispatcher => {\n // Upcast of to-do list item is based on a checkbox at the beginning of a <li> to keep compatibility with markdown input.\n dispatcher.on('element:input', todoItemInputConverter());\n // Consume other elements that are normally generated in data downcast, so they won't get captured by GHS.\n dispatcher.on('element:label', elementUpcastConsumingConverter({ name: 'label', classes: 'todo-list__label' }));\n dispatcher.on('element:label', elementUpcastConsumingConverter({ name: 'label', classes: ['todo-list__label', 'todo-list__label_without-description'] }));\n dispatcher.on('element:span', elementUpcastConsumingConverter({ name: 'span', classes: 'todo-list__label__description' }));\n dispatcher.on('element:ul', attributeUpcastConsumingConverter({ name: 'ul', classes: 'todo-list' }));\n });\n editor.conversion.for('downcast').elementToElement({\n model: elementName,\n view: (element, { writer }) => {\n if (isDescriptionBlock(element, listEditing.getListAttributeNames())) {\n return writer.createContainerElement('span', { class: 'todo-list__label__description' });\n }\n },\n converterPriority: 'highest'\n });\n listEditing.registerDowncastStrategy({\n scope: 'list',\n attributeName: 'listType',\n setAttributeOnDowncast(writer, value, element) {\n if (value == 'todo') {\n writer.addClass('todo-list', element);\n }\n else {\n writer.removeClass('todo-list', element);\n }\n }\n });\n listEditing.registerDowncastStrategy({\n scope: 'itemMarker',\n attributeName: 'todoListChecked',\n createElement(writer, modelElement, { dataPipeline }) {\n if (modelElement.getAttribute('listType') != 'todo') {\n return null;\n }\n const viewElement = writer.createUIElement('input', {\n type: 'checkbox',\n ...(modelElement.getAttribute('todoListChecked') ?\n { checked: 'checked' } :\n null),\n ...(dataPipeline ?\n { disabled: 'disabled' } :\n { tabindex: '-1' })\n });\n if (dataPipeline) {\n return viewElement;\n }\n const wrapper = writer.createContainerElement('span', { contenteditable: 'false' }, viewElement);\n wrapper.getFillerOffset = () => null;\n return wrapper;\n },\n canWrapElement(modelElement) {\n return isDescriptionBlock(modelElement, listEditing.getListAttributeNames());\n },\n createWrapperElement(writer, modelElement, { dataPipeline }) {\n const classes = ['todo-list__label'];\n if (!isDescriptionBlock(modelElement, listEditing.getListAttributeNames())) {\n classes.push('todo-list__label_without-description');\n }\n return writer.createAttributeElement(dataPipeline ? 'label' : 'span', {\n class: classes.join(' ')\n });\n }\n });\n // Verifies if a to-do list block requires reconversion of a first item downcasted as an item description.\n listEditing.on('checkElement', (evt, { modelElement, viewElement }) => {\n const isFirstTodoModelParagraphBlock = isDescriptionBlock(modelElement, listEditing.getListAttributeNames());\n const hasViewClass = viewElement.hasClass('todo-list__label__description');\n if (hasViewClass != isFirstTodoModelParagraphBlock) {\n evt.return = true;\n evt.stop();\n }\n });\n // Verifies if a to-do list block requires reconversion of a checkbox element\n // (for example there is a new paragraph inserted as a first block of a list item).\n listEditing.on('checkElement', (evt, { modelElement, viewElement }) => {\n const isFirstTodoModelItemBlock = modelElement.getAttribute('listType') == 'todo' && isFirstBlockOfListItem(modelElement);\n let hasViewItemMarker = false;\n const viewWalker = editor.editing.view.createPositionBefore(viewElement).getWalker({ direction: 'backward' });\n for (const { item } of viewWalker) {\n if (item.is('element') && editor.editing.mapper.toModelElement(item)) {\n break;\n }\n if (item.is('element', 'input') && item.getAttribute('type') == 'checkbox') {\n hasViewItemMarker = true;\n }\n }\n if (hasViewItemMarker != isFirstTodoModelItemBlock) {\n evt.return = true;\n evt.stop();\n }\n });\n // Make sure that all blocks of the same list item have the same todoListChecked attribute.\n listEditing.on('postFixer', (evt, { listNodes, writer }) => {\n for (const { node, previousNodeInList } of listNodes) {\n // This is a first item of a nested list.\n if (!previousNodeInList) {\n continue;\n }\n if (previousNodeInList.getAttribute('listItemId') != node.getAttribute('listItemId')) {\n continue;\n }\n const previousHasAttribute = previousNodeInList.hasAttribute('todoListChecked');\n const nodeHasAttribute = node.hasAttribute('todoListChecked');\n if (nodeHasAttribute && !previousHasAttribute) {\n writer.removeAttribute('todoListChecked', node);\n evt.return = true;\n }\n else if (!nodeHasAttribute && previousHasAttribute) {\n writer.setAttribute('todoListChecked', true, node);\n evt.return = true;\n }\n }\n });\n // Make sure that todoListChecked attribute is only present for to-do list items.\n model.document.registerPostFixer(writer => {\n const changes = model.document.differ.getChanges();\n let wasFixed = false;\n for (const change of changes) {\n if (change.type == 'attribute' && change.attributeKey == 'listType') {\n const element = change.range.start.nodeAfter;\n if (change.attributeOldValue == 'todo' && element.hasAttribute('todoListChecked')) {\n writer.removeAttribute('todoListChecked', element);\n wasFixed = true;\n }\n }\n else if (change.type == 'insert' && change.name != '$text') {\n for (const { item } of writer.createRangeOn(change.position.nodeAfter)) {\n if (item.is('element') && item.getAttribute('listType') != 'todo' && item.hasAttribute('todoListChecked')) {\n writer.removeAttribute('todoListChecked', item);\n wasFixed = true;\n }\n }\n }\n }\n return wasFixed;\n });\n // Toggle check state of selected to-do list items on keystroke.\n this.listenTo(editing.view.document, 'keydown', (evt, data) => {\n if (getCode(data) === ITEM_TOGGLE_KEYSTROKE) {\n editor.execute('checkTodoList');\n evt.stop();\n }\n }, { priority: 'high' });\n // Toggle check state of a to-do list item clicked on the checkbox.\n this.listenTo(editing.view.document, 'todoCheckboxChange', (evt, data) => {\n const viewTarget = data.target;\n if (!viewTarget || !viewTarget.is('element', 'input')) {\n return;\n }\n const viewPositionAfter = editing.view.createPositionAfter(viewTarget);\n const modelPositionAfter = editing.mapper.toModelPosition(viewPositionAfter);\n const modelElement = modelPositionAfter.parent;\n if (modelElement && isListItemBlock(modelElement) && modelElement.getAttribute('listType') == 'todo') {\n this._handleCheckmarkChange(modelElement);\n }\n });\n // Jump at the start/end of the next node on right arrow key press, when selection is before the checkbox.\n //\n // <blockquote><p>Foo{}</p></blockquote>\n // <ul><li><checkbox/>Bar</li></ul>\n //\n // press: `->`\n //\n // <blockquote><p>Foo</p></blockquote>\n // <ul><li><checkbox/>{}Bar</li></ul>\n //\n this.listenTo(editing.view.document, 'arrowKey', jumpOverCheckmarkOnSideArrowKeyPress(model, editor.locale), { context: '$text' });\n // Map view positions inside the checkbox and wrappers to the position in the first block of the list item.\n this.listenTo(editing.mapper, 'viewToModelPosition', (evt, data) => {\n const viewParent = data.viewPosition.parent;\n const isStartOfListItem = viewParent.is('attributeElement', 'li') && data.viewPosition.offset == 0;\n const isStartOfListLabel = isLabelElement(viewParent) && data.viewPosition.offset <= 1;\n const isInInputWrapper = viewParent.is('element', 'span') &&\n viewParent.getAttribute('contenteditable') == 'false' &&\n isLabelElement(viewParent.parent);\n if (!isStartOfListItem && !isStartOfListLabel && !isInInputWrapper) {\n return;\n }\n const nodeAfter = data.modelPosition.nodeAfter;\n if (nodeAfter && nodeAfter.getAttribute('listType') == 'todo') {\n data.modelPosition = model.createPositionAt(nodeAfter, 0);\n }\n }, { priority: 'low' });\n this._initAriaAnnouncements();\n }\n /**\n * Handles the checkbox element change, moves the selection to the corresponding model item to make it possible\n * to toggle the `todoListChecked` attribute using the command, and restores the selection position.\n *\n * Some say it's a hack :) Moving the selection only for executing the command on a certain node and restoring it after,\n * is not a clear solution. We need to design an API for using commands beyond the selection range.\n * See https://github.com/ckeditor/ckeditor5/issues/1954.\n */\n _handleCheckmarkChange(listItem) {\n const editor = this.editor;\n const model = editor.model;\n const previousSelectionRanges = Array.from(model.document.selection.getRanges());\n model.change(writer => {\n writer.setSelection(listItem, 'end');\n editor.execute('checkTodoList');\n writer.setSelection(previousSelectionRanges);\n });\n }\n /**\n * Observe when user enters or leaves todo list and set proper aria value in global live announcer.\n * This allows screen readers to indicate when the user has entered and left the specified todo list.\n *\n * @internal\n */\n _initAriaAnnouncements() {\n const { model, ui, t } = this.editor;\n let lastFocusedCodeBlock = null;\n if (!ui) {\n return;\n }\n model.document.selection.on('change:range', () => {\n const focusParent = model.document.selection.focus.parent;\n const lastElementIsTodoList = isTodoListItemElement(lastFocusedCodeBlock);\n const currentElementIsTodoList = isTodoListItemElement(focusParent);\n if (lastElementIsTodoList && !currentElementIsTodoList) {\n ui.ariaLiveAnnouncer.announce(t('Leaving a to-do list'));\n }\n else if (!lastElementIsTodoList && currentElementIsTodoList) {\n ui.ariaLiveAnnouncer.announce(t('Entering a to-do list'));\n }\n lastFocusedCodeBlock = focusParent;\n });\n }\n}\n/**\n * Returns an upcast converter that detects a to-do list checkbox and marks the list item as a to-do list.\n */\nfunction todoItemInputConverter() {\n return (evt, data, conversionApi) => {\n const modelCursor = data.modelCursor;\n const modelItem = modelCursor.parent;\n const viewItem = data.viewItem;\n if (!conversionApi.consumable.test(viewItem, { name: true })) {\n return;\n }\n if (viewItem.getAttribute('type') != 'checkbox' || !modelCursor.isAtStart || !modelItem.hasAttribute('listType')) {\n return;\n }\n conversionApi.consumable.consume(viewItem, { name: true });\n const writer = conversionApi.writer;\n writer.setAttribute('listType', 'todo', modelItem);\n if (data.viewItem.hasAttribute('checked')) {\n writer.setAttribute('todoListChecked', true, modelItem);\n }\n data.modelRange = writer.createRange(modelCursor);\n };\n}\n/**\n * Returns an upcast converter that consumes element matching the given matcher pattern.\n */\nfunction elementUpcastConsumingConverter(matcherPattern) {\n const matcher = new Matcher(matcherPattern);\n return (evt, data, conversionApi) => {\n const matcherResult = matcher.match(data.viewItem);\n if (!matcherResult) {\n return;\n }\n if (!conversionApi.consumable.consume(data.viewItem, matcherResult.match)) {\n return;\n }\n Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));\n };\n}\n/**\n * Returns an upcast converter that consumes attributes matching the given matcher pattern.\n */\nfunction attributeUpcastConsumingConverter(matcherPattern) {\n const matcher = new Matcher(matcherPattern);\n return (evt, data, conversionApi) => {\n const matcherResult = matcher.match(data.viewItem);\n if (!matcherResult) {\n return;\n }\n const match = matcherResult.match;\n match.name = false;\n conversionApi.consumable.consume(data.viewItem, match);\n };\n}\n/**\n * Returns true if the given list item block should be converted as a description block of a to-do list item.\n */\nfunction isDescriptionBlock(modelElement, listAttributeNames) {\n return (modelElement.is('element', 'paragraph') || modelElement.is('element', 'listItem')) &&\n modelElement.getAttribute('listType') == 'todo' &&\n isFirstBlockOfListItem(modelElement) &&\n hasOnlyListAttributes(modelElement, listAttributeNames);\n}\n/**\n * Returns true if only attributes from the given list are present on the model element.\n */\nfunction hasOnlyListAttributes(modelElement, attributeNames) {\n for (const attributeKey of modelElement.getAttributeKeys()) {\n // Ignore selection attributes stored on block elements.\n if (attributeKey.startsWith('selection:')) {\n continue;\n }\n if (!attributeNames.includes(attributeKey)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Jump at the start and end of a to-do list item.\n */\nfunction jumpOverCheckmarkOnSideArrowKeyPress(model, locale) {\n return (eventInfo, domEventData) => {\n const direction = getLocalizedArrowKeyCodeDirection(domEventData.keyCode, locale.contentLanguageDirection);\n const schema = model.schema;\n const selection = model.document.selection;\n if (!selection.isCollapsed) {\n return;\n }\n const position = selection.getFirstPosition();\n const parent = position.parent;\n // Right arrow before a to-do list item.\n if (direction == 'right' && position.isAtEnd) {\n const newRange = schema.getNearestSelectionRange(model.createPositionAfter(parent), 'forward');\n if (!newRange) {\n return;\n }\n const newRangeParent = newRange.start.parent;\n if (newRangeParent && isListItemBlock(newRangeParent) && newRangeParent.getAttribute('listType') == 'todo') {\n model.change(writer => writer.setSelection(newRange));\n domEventData.preventDefault();\n domEventData.stopPropagation();\n eventInfo.stop();\n }\n }\n // Left arrow at the beginning of a to-do list item.\n else if (direction == 'left' && position.isAtStart && isListItemBlock(parent) && parent.getAttribute('listType') == 'todo') {\n const newRange = schema.getNearestSelectionRange(model.createPositionBefore(parent), 'backward');\n if (!newRange) {\n return;\n }\n model.change(writer => writer.setSelection(newRange));\n domEventData.preventDefault();\n domEventData.stopPropagation();\n eventInfo.stop();\n }\n };\n}\n/**\n * Returns true if the given element is a label element of a to-do list item.\n */\nfunction isLabelElement(viewElement) {\n return !!viewElement && viewElement.is('attributeElement') && viewElement.hasClass('todo-list__label');\n}\n/**\n * Returns true if the given element is a list item model element of a to-do list.\n */\nfunction isTodoListItemElement(element) {\n if (!element) {\n return false;\n }\n if (!element.is('element', 'paragraph') && !element.is('element', 'listItem')) {\n return false;\n }\n return element.getAttribute('listType') == 'todo';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/todolist/todolistui\n */\nimport { createUIComponents } from '../list/utils.js';\nimport { icons, Plugin } from 'ckeditor5/src/core.js';\n/**\n * The to-do list UI feature. It introduces the `'todoList'` button that\n * allows to convert elements to and from to-do list items and to indent or outdent them.\n */\nexport default class TodoListUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TodoListUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const t = this.editor.t;\n createUIComponents(this.editor, 'todoList', t('To-do List'), icons.todoList);\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./todolist.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./todolist.css\";\n export default content && content.locals ? content.locals : undefined;\n","export default \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\"?>\\n<svg\\n xmlns:dc=\\\"http://purl.org/dc/elements/1.1/\\\"\\n xmlns:cc=\\\"http://creativecommons.org/ns#\\\"\\n xmlns:rdf=\\\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\\\"\\n xmlns:svg=\\\"http://www.w3.org/2000/svg\\\"\\n xmlns=\\\"http://www.w3.org/2000/svg\\\"\\n xmlns:sodipodi=\\\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\\\"\\n xmlns:inkscape=\\\"http://www.inkscape.org/namespaces/inkscape\\\"\\n class=\\\"ck ck-icon ck-button__icon\\\"\\n viewBox=\\\"0 0 20 20\\\"\\n version=\\\"1.1\\\"\\n id=\\\"svg10\\\"\\n sodipodi:docname=\\\"code-block.svg\\\"\\n inkscape:version=\\\"0.92.3 (2405546, 2018-03-11)\\\">\\n <defs\\n id=\\\"defs14\\\" />\\n <sodipodi:namedview\\n pagecolor=\\\"#ffffff\\\"\\n bordercolor=\\\"#666666\\\"\\n borderopacity=\\\"1\\\"\\n objecttolerance=\\\"10\\\"\\n gridtolerance=\\\"10\\\"\\n guidetolerance=\\\"10\\\"\\n inkscape:pageopacity=\\\"0\\\"\\n inkscape:pageshadow=\\\"2\\\"\\n inkscape:window-width=\\\"640\\\"\\n inkscape:window-height=\\\"480\\\"\\n id=\\\"namedview12\\\"\\n showgrid=\\\"false\\\"\\n inkscape:zoom=\\\"33.37544\\\"\\n inkscape:cx=\\\"10.656564\\\"\\n inkscape:cy=\\\"13.670445\\\"\\n inkscape:current-layer=\\\"svg10\\\" />\\n <g\\n id=\\\"g8\\\"\\n style=\\\"fill:none;fill-rule:evenodd\\\"\\n transform=\\\"matrix(0.8751128,0,0,0.8751128,1.3360704,0.91121972)\\\">\\n <g\\n id=\\\"g6\\\"\\n style=\\\"fill:#353535\\\">\\n <g\\n transform=\\\"translate(2,5.6)\\\"\\n id=\\\"g4\\\">\\n <path\\n d=\\\"M 10.5,0.1 15.7,4 v 1.3 l -5.6,4 C 10,9.5 9.8,9.5 9.6,9.5 9.3,9.4 9,8.8 9,8.5 L 9.3,8.1 14,4.6 9.5,1.4 9.3,1.2 C 9.2,0.9 9.2,0.6 9.3,0.4 9.5,0.2 9.8,0 10.1,0 a 0.8,0.8 0 0 1 0.4,0.1 z M 5.3,0.1 0,4 v 1.3 l 5.6,4 C 5.7,9.5 5.9,9.5 6.1,9.5 6.4,9.4 6.8,8.8 6.7,8.5 6.7,8.4 6.7,8.2 6.5,8.1 L 1.5,4.6 6.2,1.4 6.4,1.2 C 6.5,0.9 6.5,0.6 6.4,0.4 6.2,0.2 5.9,0 5.6,0 A 0.8,0.8 0 0 0 5.3,0.1 Z\\\"\\n id=\\\"path2\\\"\\n inkscape:connector-curvature=\\\"0\\\" />\\n </g>\\n </g>\\n </g>\\n <path\\n style=\\\"color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#353535;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.09228408;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate\\\"\\n d=\\\"M 0.22004104,0.22004104 V 0.76600468 19.779959 H 19.779959 V 0.22004104 Z M 1.3119682,1.3119682 H 18.688032 V 18.688032 H 1.3119682 Z\\\"\\n id=\\\"rect3722\\\"\\n inkscape:connector-curvature=\\\"0\\\" />\\n <metadata\\n id=\\\"metadata4596\\\">\\n <rdf:RDF>\\n <cc:Work\\n rdf:about=\\\"\\\">\\n <dc:title></dc:title>\\n <dc:format>image/svg+xml</dc:format>\\n <dc:type\\n rdf:resource=\\\"http://purl.org/dc/dcmitype/StillImage\\\" />\\n </cc:Work>\\n </rdf:RDF>\\n </metadata>\\n</svg>\\n\";","import { ViewPosition } from '@ckeditor/ckeditor5-engine';\nimport {toWidget, isWidget} from '@ckeditor/ckeditor5-widget/src/utils';\nimport {setContent} from './widget';\n\nconst codeBlockSymbol = Symbol( 'isOPCodeBlock' );\n\nexport function toCodeBlockWidget( viewElement, writer, label ) {\n\twriter.setCustomProperty( codeBlockSymbol, true, viewElement );\n\treturn toWidget( viewElement, writer, { label: label } );\n}\n\n\nexport function isCodeBlockWidget( viewElement ) {\n\treturn !!viewElement.getCustomProperty( codeBlockSymbol ) && isWidget( viewElement );\n}\n\n\nexport function isCodeBlockWidgetSelected( selection ) {\n\tconst viewElement = selection.getSelectedElement();\n\n\treturn !!( viewElement && isCodeBlockWidget( viewElement ) );\n}\n\nexport function createCodeBlockWidget( modelElement, writer, label ) {\n\tconst container = writer.createContainerElement(\n\t\t'pre',\n\t\t{\n\t\t\ttitle: window.I18n.t('js.editor.macro.toolbar_help')\n\t\t}\n\t);\n\trenderCodeBlockContent( writer, modelElement, container );\n\n\treturn toCodeBlockWidget( container, writer, label );\n}\n\nexport function renderCodeBlockContent( writer, modelElement, container ) {\n\t// Append language element\n\tconst languageClass = modelElement.getAttribute( 'opCodeblockLanguage' ) || 'language-text';\n\tconst language = languageClass.replace(/^language-/, '');\n\tconst langElement = writer.createContainerElement( 'div', { class: 'op-uc-code-block--language' } );\n\tsetTextNode( writer, language, langElement, 'text' );\n\twriter.insert( writer.createPositionAt( container, 0 ), langElement );\n\n\t// Append code block content\n\tconst content = modelElement.getAttribute( 'opCodeblockContent' );\n\tsetTextNode( writer, content, container, '(empty)' );\n}\n\nexport function setTextNode( writer, content, container, empty_text ) {\n const placeholder = writer.createText( content || empty_text );\n writer.insert( writer.createPositionAt( container, 0 ), placeholder );\n}\n","import { DomEventObserver } from '@ckeditor/ckeditor5-engine';\n\nexport default class DoubleClickObserver extends DomEventObserver {\n\tconstructor( view ) {\n\t\tsuper( view );\n\n\t\tthis.domEventType = 'dblclick';\n\t}\n\n\tonDomEvent( domEvent ) {\n\t\tthis.fire( domEvent.type, domEvent );\n\t}\n}\n","import icon from '../../icons/code-block.svg';\nimport { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport {modelCodeBlockToView, viewCodeBlockToModel, codeBlockContentToView} from './converters';\nimport {createCodeBlockWidget, isCodeBlockWidget} from './widget';\nimport DoubleClickObserver from './click-observer';\nimport { getPluginContext } from '../op-context/op-context';\nimport {viewToModelPositionOutsideModelElement} from \"@ckeditor/ckeditor5-widget\";\n\nexport default class CodeBlockEditing extends Plugin {\n\n\tstatic get pluginName() {\n\t\treturn 'CodeBlockEditing';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst schema = editor.model.schema;\n\t\tconst conversion = editor.conversion;\n\t\tconst view = editor.editing.view;\n\t\tconst viewDocument = view.document;\n\t\tconst pluginContext = getPluginContext(editor);\n\n\t\t// Configure schema.\n\t\tschema.register('codeblock', {\n\t\t\tisObject: true,\n\t\t\tisBlock: true,\n\t\t\tallowContentOf: '$block',\n\t\t\tallowWhere: ['$root', '$block'],\n\t\t\tallowIn: ['$root'],\n\t\t\tallowAttributes: ['opCodeblockLanguage', 'opCodeblockContent']\n\t\t});\n\n\t\tconversion.for( 'upcast' )\n\t\t\t.add(viewCodeBlockToModel());\n\n\t\tconversion.for( 'editingDowncast' )\n\t\t\t.elementToElement( {\n\t\t\t\tmodel: 'codeblock',\n\t\t\t\tview: (modelElement, {writer:viewWriter}) => {\n\t\t\t\t\treturn createCodeBlockWidget( modelElement, viewWriter, 'Code block' );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.add ( codeBlockContentToView() );\n\n\t\tconversion\n\t\t\t.for('dataDowncast')\n\t\t\t.add(modelCodeBlockToView());\n\n\t\tthis.editor.editing.mapper.on(\n\t\t\t'viewToModelPosition',\n\t\t\tviewToModelPositionOutsideModelElement( this.editor.model, viewElement => {\n\t\t\t\treturn viewElement.hasClass( 'op-uc-code-block' )\n\t\t\t} )\n\t\t);\n\n\t\t// Register click handler to code block to edit it immediately\n\t\tview.addObserver( DoubleClickObserver );\n\t\tthis.listenTo( viewDocument, 'dblclick', ( eventInfo, domEventData ) => {\n\t\t\tlet element = domEventData.target;\n\t\t\tlet evt = domEventData.domEvent;\n\n\t\t\t// Avoid opening the widget with modifiers selected to allow selecting the widget\n\t\t\tif (evt.shiftKey || evt.altKey || evt.metaKey) {\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\t// If target is our widget\n\t\t\tif ( !isCodeBlockWidget( element ) ) {\n\t\t\t\telement = element.findAncestor( isCodeBlockWidget );\n\n\t\t\t\tif ( !element ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdomEventData.preventDefault();\n\t\t\tdomEventData.stopPropagation();\n\n\t\t\t// Create model selection over widget.\n\t\t\tconst modelElement = editor.editing.mapper.toModelElement( element );\n\n\t\t\tconst macroService = pluginContext.services.macros;\n\t\t\tconst language = modelElement.getAttribute( 'opCodeblockLanguage' );\n\t\t\tconst content = modelElement.getAttribute( 'opCodeblockContent' );\n\n\t\t\tmacroService\n\t\t\t\t.editCodeBlock( content, language )\n\t\t\t\t.then((update) => editor.model.change(writer => {\n\t\t\t\t\twriter.setAttribute( 'opCodeblockLanguage', update.languageClass, modelElement );\n\t\t\t\t\twriter.setAttribute( 'opCodeblockContent', update.content, modelElement );\n\t\t\t\t})\n\t\t\t);\n\n\t\t} );\n\n\t\t// Register toolbar button to create code block\n\t\teditor.ui.componentFactory.add( 'insertCodeBlock', locale => {\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: window.I18n.t('js.editor.macro.code_block.button'),\n\t\t\t\ticon: icon,\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\t// Callback executed once the image is clicked.\n\t\t\tview.on( 'execute', () => {\n\t\t\t\tpluginContext.services.macros\n\t\t\t\t\t.editCodeBlock()\n\t\t\t\t\t.then((update) => editor.model.change(writer => {\n\n\t\t\t\t\t\tconst element = writer.createElement( 'codeblock' );\n\t\t\t\t\t\twriter.setAttribute( 'opCodeblockLanguage', update.languageClass, element );\n\t\t\t\t\t\twriter.setAttribute( 'opCodeblockContent', update.content, element );\n\t\t\t\t\t\teditor.model.insertContent( element, editor.model.document.selection );\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\t}\n}\n","import { Range } from '@ckeditor/ckeditor5-engine';\nimport {renderCodeBlockContent} from './widget';\n\n\nexport function modelCodeBlockToView() {\n\treturn dispatcher => {\n\t\tdispatcher.on( 'insert:codeblock', converter, { priority: 'high' } );\n\t};\n\n\tfunction converter( evt, data, conversionApi ) {\n\t\tconst codeBlock = data.item;\n\t\tconst language = codeBlock.getAttribute('opCodeblockLanguage') || 'language-text';\n\t\tconst content = codeBlock.getAttribute('opCodeblockContent');\n\n\t\t// Consume the codeblock and text\n\t\tconversionApi.consumable.consume( codeBlock, 'insert' );\n\n\t\t// Wrap the element in a <pre> <code> block\n\t\tconst viewWriter = conversionApi.writer;\n\t\tconst preElement = viewWriter.createContainerElement( 'pre' );\n\t\tconst langElement = viewWriter.createContainerElement( 'div', { class: 'op-uc-code-block--language' } );\n\t\tconst codeElement = viewWriter.createContainerElement( 'code', { class: language } );\n\t\tconst langContent = viewWriter.createText( language );\n\t\tconst contentElement = viewWriter.createText( content );\n\n\t\tviewWriter.insert( viewWriter.createPositionAt( codeElement, 0 ), contentElement );\n\t\tviewWriter.insert( viewWriter.createPositionAt( langElement, 0 ), langContent );\n\t\tviewWriter.insert( viewWriter.createPositionAt( preElement, 0 ), langElement );\n\t\tviewWriter.insert( viewWriter.createPositionAt( preElement, 0 ), codeElement );\n\n\t\tconversionApi.mapper.bindElements( codeBlock, codeElement );\n\t\tconversionApi.mapper.bindElements( codeBlock, preElement );\n\t\tconversionApi.mapper.bindElements( codeBlock, langElement );\n\n\t\t// Insert at matching position\n\t\tconst insertPosition = conversionApi.mapper.toViewPosition( data.range.start );\n\t\tviewWriter.insert( insertPosition, preElement );\n\n\t\tevt.stop();\n\t}\n}\n\nexport function viewCodeBlockToModel() {\n\treturn dispatcher => {\n\t\tdispatcher.on( 'element:pre', converter, { priority: 'high' } );\n\t};\n\n\tfunction converter( evt, data, conversionApi ) {\n\t\t// Do not convert if this is not an \"image figure\".\n\t\tif ( !conversionApi.consumable.test( data.viewItem, { name: true } ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find an code element inside the pre element.\n\t\tconst codeBlock = Array.from( data.viewItem.getChildren() ).find( viewChild => viewChild.is('element', 'code'));\n\n\t\t// Do not convert if code block is absent\n\t\tif ( !codeBlock || !conversionApi.consumable.consume( codeBlock, { name: true } ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Create the model element\n\t\tconst modelCodeBlock = conversionApi.writer.createElement( 'codeblock' );\n\t\tconversionApi.writer.setAttribute( 'opCodeblockLanguage', codeBlock.getAttribute('class'), modelCodeBlock );\n\n\t\t// Find allowed parent for paragraph that we are going to insert. If current parent does not allow\n\t\t// to insert paragraph but one of the ancestors does then split nodes to allowed parent.\n\t\tconst splitResult = conversionApi.splitToAllowedParent( modelCodeBlock, data.modelCursor );\n\n\t\t// When there is no split result it means that we can't insert paragraph in this position.\n\t\tif ( splitResult ) {\n\t\t\t// Insert codeblock in allowed position.\n\t\t\tconversionApi.writer.insert( modelCodeBlock, splitResult.position );\n\n\t\t\t// Convert text child of codeblock\n\t\t\tconst child = codeBlock.getChild(0);\n\t\t\tconversionApi.consumable.consume( child, { name: true } );\n\t\t\t// Replace last newline since that text is incorrectly mapped\n\t\t\t// Regression OP#28609\n\t\t\tconst content = child.data.replace(/\\n$/, \"\");\n\t\t\tconversionApi.writer.setAttribute( 'opCodeblockContent', content, modelCodeBlock );\n\n\t\t\t// Set as conversion result, attribute converters may use this property.\n\t\t\tdata.modelRange = new Range(\n\t\t\t\tconversionApi.writer.createPositionBefore( modelCodeBlock ),\n\t\t\t\tconversionApi.writer.createPositionAfter( modelCodeBlock )\n\t\t\t);\n\n\t\t\t// Convert after pre element\n\t\t\tdata.modelCursor = data.modelRange.end;\n\t\t}\n\t}\n}\n\n\nexport function codeBlockContentToView() {\n\treturn dispatcher => {\n\t\tdispatcher.on( 'attribute:opCodeblockContent', converter );\n\t\tdispatcher.on( 'attribute:opCodeblockLanguage', converter );\n\t};\n\n\tfunction converter( evt, data, conversionApi ) {\n const modelElement = data.item;\n\n // Mark element as consumed by conversion.\n conversionApi.consumable.consume( data.item, evt.name );\n\n // Get mapped view element to update.\n const viewElement = conversionApi.mapper.toViewElement( modelElement );\n\n // Remove current <div> element contents.\n conversionApi.writer.remove( conversionApi.writer.createRangeOn( viewElement.getChild( 1 ) ) );\n conversionApi.writer.remove( conversionApi.writer.createRangeOn( viewElement.getChild( 0 ) ) );\n\n\t\t// Set current content\n\t\trenderCodeBlockContent( conversionApi.writer, modelElement, viewElement );\n\t}\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\nimport { ContextualBalloon } from '@ckeditor/ckeditor5-ui';\n\nimport {createToolbarEditButton} from '../../helpers/create-toolbar-edit-button';\nimport {createEditToolbar} from '../../helpers/create-toolbar';\nimport {isCodeBlockWidgetSelected} from './widget';\nimport {getPluginContext} from '../op-context/op-context';\n\nexport default class CodeBlockToolbar extends Plugin {\n\tstatic get requires() {\n\t\treturn [ ContextualBalloon ];\n\t}\n\n\tstatic get pluginName() {\n\t\treturn 'CodeBlockToolbar';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = this.editor.model;\n\t\tconst pluginContext = getPluginContext(editor);\n\n\t\t// Add editing button\n\t\tcreateToolbarEditButton( editor, 'opEditCodeBlock', widget => {\n\t\t\tconst macroService = pluginContext.services.macros;\n\t\t\tconst language = widget.getAttribute( 'opCodeblockLanguage' );\n\t\t\tconst content = widget.getAttribute( 'opCodeblockContent' );\n\n\t\t\tmacroService\n\t\t\t\t.editCodeBlock( content, language )\n\t\t\t\t.then((update) => model.change(writer => {\n\t\t\t\t\twriter.setAttribute( 'opCodeblockLanguage', update.languageClass, widget );\n\t\t\t\t\twriter.setAttribute( 'opCodeblockContent', update.content, widget );\n\t\t\t\t})\n\t\t\t);\n\t\t} );\n\t}\n\n\tafterInit() {\n\t\t// Add actual toolbar\n\t\tcreateEditToolbar(\n\t\t\tthis,\n\t\t\tthis.editor,\n\t\t\t'OPCodeBlock',\n\t\t\tisCodeBlockWidgetSelected\n\t\t);\n\t}\n}\n","import { FileDialogButtonView } from '@ckeditor/ckeditor5-ui';\n\nexport function getToolbarItems(editor) {\n\teditor.__currentlyDisabled = editor.__currentlyDisabled || [];\n\n\tif (!editor.ui.view.toolbar) {\n\t\treturn [];\n\t}\n\n\treturn editor.ui.view.toolbar.items._items;\n}\n\nexport function disableItems(editor, except) {\n\tjQuery.each(getToolbarItems(editor), function(index, item) {\n\t\tlet toDisable = item;\n\n\t\tif (item instanceof FileDialogButtonView) {\n\t\t\ttoDisable = item.buttonView;\n\t\t} else if (item === except || !item.hasOwnProperty('isEnabled')) {\n\t\t\ttoDisable = null;\n\t\t}\n\n\t\tif (!toDisable) {\n\t\t\t// do nothing\n\t\t} else if (toDisable.isEnabled) {\n\t\t\ttoDisable.isEnabled = false;\n\t\t} else {\n\t\t\teditor.__currentlyDisabled.push(toDisable);\n\t\t}\n\t});\n}\n\nexport function enableItems(editor) {\n\tjQuery.each(getToolbarItems(editor), function(index, item) {\n\t\tlet toEnable = item;\n\n\t\tif (item instanceof FileDialogButtonView) {\n\t\t\ttoEnable = item.buttonView;\n\t\t}\n\n\t\tif (editor.__currentlyDisabled.indexOf(toEnable) < 0) {\n\t\t\ttoEnable.isEnabled = true\n\t\t}\n\t});\n\n\teditor.__currentlyDisabled = [];\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Conversion helper for upcasting attributes using normalized styles.\n *\n * @param options.modelAttribute The attribute to set.\n * @param options.styleName The style name to convert.\n * @param options.viewElement The view element name that should be converted.\n * @param options.defaultValue The default value for the specified `modelAttribute`.\n * @param options.shouldUpcast The function which returns `true` if style should be upcasted from this element.\n */\nexport function upcastStyleToAttribute(conversion, options) {\n const { modelAttribute, styleName, viewElement, defaultValue, reduceBoxSides = false, shouldUpcast = () => true } = options;\n conversion.for('upcast').attributeToAttribute({\n view: {\n name: viewElement,\n styles: {\n [styleName]: /[\\s\\S]+/\n }\n },\n model: {\n key: modelAttribute,\n value: (viewElement) => {\n if (!shouldUpcast(viewElement)) {\n return;\n }\n const normalized = viewElement.getNormalizedStyle(styleName);\n const value = reduceBoxSides ? reduceBoxSidesValue(normalized) : normalized;\n if (defaultValue !== value) {\n return value;\n }\n }\n }\n });\n}\n/**\n * Conversion helper for upcasting border styles for view elements.\n *\n * @param defaultBorder The default border values.\n * @param defaultBorder.color The default `borderColor` value.\n * @param defaultBorder.style The default `borderStyle` value.\n * @param defaultBorder.width The default `borderWidth` value.\n */\nexport function upcastBorderStyles(conversion, viewElementName, modelAttributes, defaultBorder) {\n conversion.for('upcast').add(dispatcher => dispatcher.on('element:' + viewElementName, (evt, data, conversionApi) => {\n // If the element was not converted by element-to-element converter,\n // we should not try to convert the style. See #8393.\n if (!data.modelRange) {\n return;\n }\n // Check the most detailed properties. These will be always set directly or\n // when using the \"group\" properties like: `border-(top|right|bottom|left)` or `border`.\n const stylesToConsume = [\n 'border-top-width',\n 'border-top-color',\n 'border-top-style',\n 'border-bottom-width',\n 'border-bottom-color',\n 'border-bottom-style',\n 'border-right-width',\n 'border-right-color',\n 'border-right-style',\n 'border-left-width',\n 'border-left-color',\n 'border-left-style'\n ].filter(styleName => data.viewItem.hasStyle(styleName));\n if (!stylesToConsume.length) {\n return;\n }\n const matcherPattern = {\n styles: stylesToConsume\n };\n // Try to consume appropriate values from consumable values list.\n if (!conversionApi.consumable.test(data.viewItem, matcherPattern)) {\n return;\n }\n const modelElement = [...data.modelRange.getItems({ shallow: true })].pop();\n conversionApi.consumable.consume(data.viewItem, matcherPattern);\n const normalizedBorder = {\n style: data.viewItem.getNormalizedStyle('border-style'),\n color: data.viewItem.getNormalizedStyle('border-color'),\n width: data.viewItem.getNormalizedStyle('border-width')\n };\n const reducedBorder = {\n style: reduceBoxSidesValue(normalizedBorder.style),\n color: reduceBoxSidesValue(normalizedBorder.color),\n width: reduceBoxSidesValue(normalizedBorder.width)\n };\n if (reducedBorder.style !== defaultBorder.style) {\n conversionApi.writer.setAttribute(modelAttributes.style, reducedBorder.style, modelElement);\n }\n if (reducedBorder.color !== defaultBorder.color) {\n conversionApi.writer.setAttribute(modelAttributes.color, reducedBorder.color, modelElement);\n }\n if (reducedBorder.width !== defaultBorder.width) {\n conversionApi.writer.setAttribute(modelAttributes.width, reducedBorder.width, modelElement);\n }\n }));\n}\n/**\n * Conversion helper for downcasting an attribute to a style.\n */\nexport function downcastAttributeToStyle(conversion, options) {\n const { modelElement, modelAttribute, styleName } = options;\n conversion.for('downcast').attributeToAttribute({\n model: {\n name: modelElement,\n key: modelAttribute\n },\n view: modelAttributeValue => ({\n key: 'style',\n value: {\n [styleName]: modelAttributeValue\n }\n })\n });\n}\n/**\n * Conversion helper for downcasting attributes from the model table to a view table (not to `<figure>`).\n */\nexport function downcastTableAttribute(conversion, options) {\n const { modelAttribute, styleName } = options;\n conversion.for('downcast').add(dispatcher => dispatcher.on(`attribute:${modelAttribute}:table`, (evt, data, conversionApi) => {\n const { item, attributeNewValue } = data;\n const { mapper, writer } = conversionApi;\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const table = [...mapper.toViewElement(item).getChildren()].find(child => child.is('element', 'table'));\n if (attributeNewValue) {\n writer.setStyle(styleName, attributeNewValue, table);\n }\n else {\n writer.removeStyle(styleName, table);\n }\n }));\n}\n/**\n * Reduces the full top, right, bottom, left object to a single string if all sides are equal.\n * Returns original style otherwise.\n */\nfunction reduceBoxSidesValue(style) {\n if (!style) {\n return;\n }\n const sides = ['top', 'right', 'bottom', 'left'];\n const allSidesDefined = sides.every(side => style[side]);\n if (!allSidesDefined) {\n return style;\n }\n const topSideStyle = style.top;\n const allSidesEqual = sides.every(side => style[side] === topSideStyle);\n if (!allSidesEqual) {\n return style;\n }\n return topSideStyle;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { downcastAttributeToStyle, upcastStyleToAttribute } from './../converters/tableproperties.js';\n/**\n * A common method to update the numeric value. If a value is the default one, it will be unset.\n *\n * @param key An attribute key.\n * @param value The new attribute value.\n * @param item A model item on which the attribute will be set.\n * @param defaultValue The default attribute value. If a value is lower or equal, it will be unset.\n */\nexport function updateNumericAttribute(key, value, item, writer, defaultValue = 1) {\n if (value !== undefined && value !== null && defaultValue !== undefined && defaultValue !== null && value > defaultValue) {\n writer.setAttribute(key, value, item);\n }\n else {\n writer.removeAttribute(key, item);\n }\n}\n/**\n * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.\n *\n * @param writer The model writer.\n * @param insertPosition The position at which the table cell should be inserted.\n * @param attributes The element attributes.\n * @returns Created table cell.\n */\nexport function createEmptyTableCell(writer, insertPosition, attributes = {}) {\n const tableCell = writer.createElement('tableCell', attributes);\n writer.insertElement('paragraph', tableCell);\n writer.insert(tableCell, insertPosition);\n return tableCell;\n}\n/**\n * Checks if a table cell belongs to the heading column section.\n */\nexport function isHeadingColumnCell(tableUtils, tableCell) {\n const table = tableCell.parent.parent;\n const headingColumns = parseInt(table.getAttribute('headingColumns') || '0');\n const { column } = tableUtils.getCellLocation(tableCell);\n return !!headingColumns && column < headingColumns;\n}\n/**\n * Enables conversion for an attribute for simple view-model mappings.\n *\n * @param options.defaultValue The default value for the specified `modelAttribute`.\n */\nexport function enableProperty(schema, conversion, options) {\n const { modelAttribute } = options;\n schema.extend('tableCell', {\n allowAttributes: [modelAttribute]\n });\n upcastStyleToAttribute(conversion, { viewElement: /^(td|th)$/, ...options });\n downcastAttributeToStyle(conversion, { modelElement: 'tableCell', ...options });\n}\n/**\n * Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.\n */\nexport function getSelectionAffectedTable(selection) {\n const selectedElement = selection.getSelectedElement();\n // Is the command triggered from the `tableToolbar`?\n if (selectedElement && selectedElement.is('element', 'table')) {\n return selectedElement;\n }\n return selection.getFirstPosition().findAncestor('table');\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { createEmptyTableCell } from '../utils/common.js';\nimport { first } from 'ckeditor5/src/utils.js';\n/**\n * Returns a function that converts the table view representation:\n *\n * ```xml\n * <figure class=\"table\"><table>...</table></figure>\n * ```\n *\n * to the model representation:\n *\n * ```xml\n * <table></table>\n * ```\n */\nexport function upcastTableFigure() {\n return (dispatcher) => {\n dispatcher.on('element:figure', (evt, data, conversionApi) => {\n // Do not convert if this is not a \"table figure\".\n if (!conversionApi.consumable.test(data.viewItem, { name: true, classes: 'table' })) {\n return;\n }\n // Find a table element inside the figure element.\n const viewTable = getViewTableFromFigure(data.viewItem);\n // Do not convert if table element is absent or was already converted.\n if (!viewTable || !conversionApi.consumable.test(viewTable, { name: true })) {\n return;\n }\n // Consume the figure to prevent other converters from processing it again.\n conversionApi.consumable.consume(data.viewItem, { name: true, classes: 'table' });\n // Convert view table to model table.\n const conversionResult = conversionApi.convertItem(viewTable, data.modelCursor);\n // Get table element from conversion result.\n const modelTable = first(conversionResult.modelRange.getItems());\n // When table wasn't successfully converted then finish conversion.\n if (!modelTable) {\n // Revert consumed figure so other features can convert it.\n conversionApi.consumable.revert(data.viewItem, { name: true, classes: 'table' });\n return;\n }\n conversionApi.convertChildren(data.viewItem, conversionApi.writer.createPositionAt(modelTable, 'end'));\n conversionApi.updateConversionResult(modelTable, data);\n });\n };\n}\n/**\n * View table element to model table element conversion helper.\n *\n * This conversion helper converts the table element as well as table rows.\n *\n * @returns Conversion helper.\n */\nexport default function upcastTable() {\n return (dispatcher) => {\n dispatcher.on('element:table', (evt, data, conversionApi) => {\n const viewTable = data.viewItem;\n // When element was already consumed then skip it.\n if (!conversionApi.consumable.test(viewTable, { name: true })) {\n return;\n }\n const { rows, headingRows, headingColumns } = scanTable(viewTable);\n // Only set attributes if values is greater then 0.\n const attributes = {};\n if (headingColumns) {\n attributes.headingColumns = headingColumns;\n }\n if (headingRows) {\n attributes.headingRows = headingRows;\n }\n const table = conversionApi.writer.createElement('table', attributes);\n if (!conversionApi.safeInsert(table, data.modelCursor)) {\n return;\n }\n conversionApi.consumable.consume(viewTable, { name: true });\n // Upcast table rows in proper order (heading rows first).\n rows.forEach(row => conversionApi.convertItem(row, conversionApi.writer.createPositionAt(table, 'end')));\n // Convert everything else.\n conversionApi.convertChildren(viewTable, conversionApi.writer.createPositionAt(table, 'end'));\n // Create one row and one table cell for empty table.\n if (table.isEmpty) {\n const row = conversionApi.writer.createElement('tableRow');\n conversionApi.writer.insert(row, conversionApi.writer.createPositionAt(table, 'end'));\n createEmptyTableCell(conversionApi.writer, conversionApi.writer.createPositionAt(row, 'end'));\n }\n conversionApi.updateConversionResult(table, data);\n });\n };\n}\n/**\n * A conversion helper that skips empty <tr> elements from upcasting at the beginning of the table.\n *\n * An empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells\n * and empty TR-s are used to maintain the table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only\n * rows that have related `tableRow` elements).\n *\n * *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue\n * of an improper table with all empty rows.\n *\n * @returns Conversion helper.\n */\nexport function skipEmptyTableRow() {\n return (dispatcher) => {\n dispatcher.on('element:tr', (evt, data) => {\n if (data.viewItem.isEmpty && data.modelCursor.index == 0) {\n evt.stop();\n }\n }, { priority: 'high' });\n };\n}\n/**\n * A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.\n *\n * @returns Conversion helper.\n */\nexport function ensureParagraphInTableCell(elementName) {\n return (dispatcher) => {\n dispatcher.on(`element:${elementName}`, (evt, data, { writer }) => {\n // The default converter will create a model range on converted table cell.\n if (!data.modelRange) {\n return;\n }\n const tableCell = data.modelRange.start.nodeAfter;\n const modelCursor = writer.createPositionAt(tableCell, 0);\n // Ensure a paragraph in the model for empty table cells for converted table cells.\n if (data.viewItem.isEmpty) {\n writer.insertElement('paragraph', modelCursor);\n return;\n }\n const childNodes = Array.from(tableCell.getChildren());\n // In case there are only markers inside the table cell then move them to the paragraph.\n if (childNodes.every(node => node.is('element', '$marker'))) {\n const paragraph = writer.createElement('paragraph');\n writer.insert(paragraph, writer.createPositionAt(tableCell, 0));\n for (const node of childNodes) {\n writer.move(writer.createRangeOn(node), writer.createPositionAt(paragraph, 'end'));\n }\n }\n }, { priority: 'low' });\n };\n}\n/**\n * Get view `<table>` element from the view widget (`<figure>`).\n */\nfunction getViewTableFromFigure(figureView) {\n for (const figureChild of figureView.getChildren()) {\n if (figureChild.is('element', 'table')) {\n return figureChild;\n }\n }\n}\n/**\n * Scans table rows and extracts required metadata from the table:\n *\n * headingRows - The number of rows that go as table headers.\n * headingColumns - The maximum number of row headings.\n * rows - Sorted `<tr>` elements as they should go into the model - ie. if `<thead>` is inserted after `<tbody>` in the view.\n */\nfunction scanTable(viewTable) {\n let headingRows = 0;\n let headingColumns = undefined;\n // The `<tbody>` and `<thead>` sections in the DOM do not have to be in order `<thead>` -> `<tbody>` and there might be more than one\n // of them.\n // As the model does not have these sections, rows from different sections must be sorted.\n // For example, below is a valid HTML table:\n //\n // <table>\n // <tbody><tr><td>2</td></tr></tbody>\n // <thead><tr><td>1</td></tr></thead>\n // <tbody><tr><td>3</td></tr></tbody>\n // </table>\n //\n // But browsers will render rows in order as: 1 as the heading and 2 and 3 as the body.\n const headRows = [];\n const bodyRows = [];\n // Currently the editor does not support more then one <thead> section.\n // Only the first <thead> from the view will be used as a heading row and the others will be converted to body rows.\n let firstTheadElement;\n for (const tableChild of Array.from(viewTable.getChildren())) {\n // Only `<thead>`, `<tbody>` & `<tfoot>` from allowed table children can have `<tr>`s.\n // The else is for future purposes (mainly `<caption>`).\n if (tableChild.name !== 'tbody' && tableChild.name !== 'thead' && tableChild.name !== 'tfoot') {\n continue;\n }\n // Save the first `<thead>` in the table as table header - all other ones will be converted to table body rows.\n if (tableChild.name === 'thead' && !firstTheadElement) {\n firstTheadElement = tableChild;\n }\n // There might be some extra empty text nodes between the `<tr>`s.\n // Make sure further code operates on `tr`s only. (#145)\n const trs = Array.from(tableChild.getChildren()).filter((el) => el.is('element', 'tr'));\n for (const tr of trs) {\n // This <tr> is a child of a first <thead> element.\n if ((firstTheadElement && tableChild === firstTheadElement) ||\n (tableChild.name === 'tbody' &&\n Array.from(tr.getChildren()).length &&\n Array.from(tr.getChildren()).every(e => e.is('element', 'th')))) {\n headingRows++;\n headRows.push(tr);\n }\n else {\n bodyRows.push(tr);\n // For other rows check how many column headings this row has.\n const headingCols = scanRowForHeadingColumns(tr);\n if (!headingColumns || headingCols < headingColumns) {\n headingColumns = headingCols;\n }\n }\n }\n }\n return {\n headingRows,\n headingColumns: headingColumns || 0,\n rows: [...headRows, ...bodyRows]\n };\n}\n/**\n * Scans a `<tr>` element and its children for metadata:\n * - For heading row:\n * - Adds this row to either the heading or the body rows.\n * - Updates the number of heading rows.\n * - For body rows:\n * - Calculates the number of column headings.\n */\nfunction scanRowForHeadingColumns(tr) {\n let headingColumns = 0;\n let index = 0;\n // Filter out empty text nodes from tr children.\n const children = Array.from(tr.getChildren())\n .filter(child => child.name === 'th' || child.name === 'td');\n // Count starting adjacent <th> elements of a <tr>.\n while (index < children.length && children[index].name === 'th') {\n const th = children[index];\n // Adjust columns calculation by the number of spanned columns.\n const colspan = parseInt(th.getAttribute('colspan') || '1');\n headingColumns = headingColumns + colspan;\n index++;\n }\n return headingColumns;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields\n * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.\n */\nexport default class TableWalker {\n /**\n * Creates an instance of the table walker.\n *\n * The table walker iterates internally by traversing the table from row index = 0 and column index = 0.\n * It walks row by row and column by column in order to output values defined in the constructor.\n * By default it will output only the locations that are occupied by a cell. To include also spanned rows and columns,\n * pass the `includeAllSlots` option to the constructor.\n *\n * The most important values of the iterator are column and row indexes of a cell.\n *\n * See {@link module:table/tablewalker~TableSlot} what values are returned by the table walker.\n *\n * To iterate over a given row:\n *\n * ```ts\n * const tableWalker = new TableWalker( table, { startRow: 1, endRow: 2 } );\n *\n * for ( const tableSlot of tableWalker ) {\n * console.log( 'A cell at row', tableSlot.row, 'and column', tableSlot.column );\n * }\n * ```\n *\n * For instance the code above for the following table:\n *\n * +----+----+----+----+----+----+\n * | 00 | 02 | 03 | 04 | 05 |\n * | +----+----+----+----+\n * | | 12 | 14 | 15 |\n * | +----+----+----+ +\n * | | 22 | |\n * |----+----+----+----+----+ +\n * | 30 | 31 | 32 | 33 | 34 | |\n * +----+----+----+----+----+----+\n *\n * will log in the console:\n *\n * 'A cell at row 1 and column 2'\n * 'A cell at row 1 and column 4'\n * 'A cell at row 1 and column 5'\n * 'A cell at row 2 and column 2'\n *\n * To also iterate over spanned cells:\n *\n * ```ts\n * const tableWalker = new TableWalker( table, { row: 1, includeAllSlots: true } );\n *\n * for ( const tableSlot of tableWalker ) {\n * console.log( 'Slot at', tableSlot.row, 'x', tableSlot.column, ':', tableSlot.isAnchor ? 'is anchored' : 'is spanned' );\n * }\n * ```\n *\n * will log in the console for the table from the previous example:\n *\n * 'Cell at 1 x 0 : is spanned'\n * 'Cell at 1 x 1 : is spanned'\n * 'Cell at 1 x 2 : is anchored'\n * 'Cell at 1 x 3 : is spanned'\n * 'Cell at 1 x 4 : is anchored'\n * 'Cell at 1 x 5 : is anchored'\n *\n * **Note**: Option `row` is a shortcut that sets both `startRow` and `endRow` to the same row.\n * (Use either `row` or `startRow` and `endRow` but never together). Similarly the `column` option sets both `startColumn`\n * and `endColumn` to the same column (Use either `column` or `startColumn` and `endColumn` but never together).\n *\n * @param table A table over which the walker iterates.\n * @param options An object with configuration.\n * @param options.row A row index for which this iterator will output cells. Can't be used together with `startRow` and `endRow`.\n * @param options.startRow A row index from which this iterator should start. Can't be used together with `row`. Default value is 0.\n * @param options.endRow A row index at which this iterator should end. Can't be used together with `row`.\n * @param options.column A column index for which this iterator will output cells.\n * Can't be used together with `startColumn` and `endColumn`.\n * @param options.startColumn A column index from which this iterator should start.\n * Can't be used together with `column`. Default value is 0.\n * @param options.endColumn A column index at which this iterator should end. Can't be used together with `column`.\n * @param options.includeAllSlots Also return values for spanned cells. Default value is \"false\".\n */\n constructor(table, options = {}) {\n /**\n * Indicates whether the iterator jumped to (or close to) the start row, ignoring rows that don't need to be traversed.\n */\n this._jumpedToStartRow = false;\n this._table = table;\n this._startRow = options.row !== undefined ? options.row : options.startRow || 0;\n this._endRow = options.row !== undefined ? options.row : options.endRow;\n this._startColumn = options.column !== undefined ? options.column : options.startColumn || 0;\n this._endColumn = options.column !== undefined ? options.column : options.endColumn;\n this._includeAllSlots = !!options.includeAllSlots;\n this._skipRows = new Set();\n this._row = 0;\n this._rowIndex = 0;\n this._column = 0;\n this._cellIndex = 0;\n this._spannedCells = new Map();\n this._nextCellAtColumn = -1;\n }\n /**\n * Iterable interface.\n */\n [Symbol.iterator]() {\n return this;\n }\n /**\n * Gets the next table walker's value.\n *\n * @returns The next table walker's value.\n */\n next() {\n if (this._canJumpToStartRow()) {\n this._jumpToNonSpannedRowClosestToStartRow();\n }\n const row = this._table.getChild(this._rowIndex);\n // Iterator is done when there's no row (table ended) or the row is after `endRow` limit.\n if (!row || this._isOverEndRow()) {\n return { done: true, value: undefined };\n }\n // We step over current element when it is not a tableRow instance.\n if (!row.is('element', 'tableRow')) {\n this._rowIndex++;\n return this.next();\n }\n if (this._isOverEndColumn()) {\n return this._advanceToNextRow();\n }\n let outValue = null;\n const spanData = this._getSpanned();\n if (spanData) {\n if (this._includeAllSlots && !this._shouldSkipSlot()) {\n outValue = this._formatOutValue(spanData.cell, spanData.row, spanData.column);\n }\n }\n else {\n const cell = row.getChild(this._cellIndex);\n if (!cell) {\n // If there are no more cells left in row advance to the next row.\n return this._advanceToNextRow();\n }\n const colspan = parseInt(cell.getAttribute('colspan') || '1');\n const rowspan = parseInt(cell.getAttribute('rowspan') || '1');\n // Record this cell spans if it's not 1x1 cell.\n if (colspan > 1 || rowspan > 1) {\n this._recordSpans(cell, rowspan, colspan);\n }\n if (!this._shouldSkipSlot()) {\n outValue = this._formatOutValue(cell);\n }\n this._nextCellAtColumn = this._column + colspan;\n }\n // Advance to the next column before returning value.\n this._column++;\n if (this._column == this._nextCellAtColumn) {\n this._cellIndex++;\n }\n // The current value will be returned only if current row and column are not skipped.\n return outValue || this.next();\n }\n /**\n * Marks a row to skip in the next iteration. It will also skip cells from the current row if there are any cells from the current row\n * to output.\n *\n * @param row The row index to skip.\n */\n skipRow(row) {\n this._skipRows.add(row);\n }\n /**\n * Advances internal cursor to the next row.\n */\n _advanceToNextRow() {\n this._row++;\n this._rowIndex++;\n this._column = 0;\n this._cellIndex = 0;\n this._nextCellAtColumn = -1;\n return this.next();\n }\n /**\n * Checks if the current row is over {@link #_endRow}.\n */\n _isOverEndRow() {\n // If #_endRow is defined skip all rows after it.\n return this._endRow !== undefined && this._row > this._endRow;\n }\n /**\n * Checks if the current cell is over {@link #_endColumn}\n */\n _isOverEndColumn() {\n // If #_endColumn is defined skip all cells after it.\n return this._endColumn !== undefined && this._column > this._endColumn;\n }\n /**\n * A common method for formatting the iterator's output value.\n *\n * @param cell The table cell to output.\n * @param anchorRow The row index of a cell anchor slot.\n * @param anchorColumn The column index of a cell anchor slot.\n */\n _formatOutValue(cell, anchorRow = this._row, anchorColumn = this._column) {\n return {\n done: false,\n value: new TableSlot(this, cell, anchorRow, anchorColumn)\n };\n }\n /**\n * Checks if the current slot should be skipped.\n */\n _shouldSkipSlot() {\n const rowIsMarkedAsSkipped = this._skipRows.has(this._row);\n const rowIsBeforeStartRow = this._row < this._startRow;\n const columnIsBeforeStartColumn = this._column < this._startColumn;\n const columnIsAfterEndColumn = this._endColumn !== undefined && this._column > this._endColumn;\n return rowIsMarkedAsSkipped || rowIsBeforeStartRow || columnIsBeforeStartColumn || columnIsAfterEndColumn;\n }\n /**\n * Returns the cell element that is spanned over the current cell location.\n */\n _getSpanned() {\n const rowMap = this._spannedCells.get(this._row);\n // No spans for given row.\n if (!rowMap) {\n return null;\n }\n // If spans for given rows has entry for column it means that this location if spanned by other cell.\n return rowMap.get(this._column) || null;\n }\n /**\n * Updates spanned cells map relative to the current cell location and its span dimensions.\n *\n * @param cell A cell that is spanned.\n * @param rowspan Cell height.\n * @param colspan Cell width.\n */\n _recordSpans(cell, rowspan, colspan) {\n const data = {\n cell,\n row: this._row,\n column: this._column\n };\n for (let rowToUpdate = this._row; rowToUpdate < this._row + rowspan; rowToUpdate++) {\n for (let columnToUpdate = this._column; columnToUpdate < this._column + colspan; columnToUpdate++) {\n if (rowToUpdate != this._row || columnToUpdate != this._column) {\n this._markSpannedCell(rowToUpdate, columnToUpdate, data);\n }\n }\n }\n }\n /**\n * Marks the cell location as spanned by another cell.\n *\n * @param row The row index of the cell location.\n * @param column The column index of the cell location.\n * @param data A spanned cell details (cell element, anchor row and column).\n */\n _markSpannedCell(row, column, data) {\n if (!this._spannedCells.has(row)) {\n this._spannedCells.set(row, new Map());\n }\n const rowSpans = this._spannedCells.get(row);\n rowSpans.set(column, data);\n }\n /**\n * Checks if part of the table can be skipped.\n */\n _canJumpToStartRow() {\n return !!this._startRow &&\n this._startRow > 0 &&\n !this._jumpedToStartRow;\n }\n /**\n * Sets the current row to `this._startRow` or the first row before it that has the number of cells\n * equal to the number of columns in the table.\n *\n * Example:\n * \t+----+----+----+\n * | 00 | 01 | 02 |\n * |----+----+----+\n * | 10 | 12 |\n * | +----+\n * | | 22 |\n * | +----+\n * | | 32 | <--- Start row\n * +----+----+----+\n * | 40 | 41 | 42 |\n * +----+----+----+\n *\n * If the 4th row is a `this._startRow`, this method will:\n * 1.) Count the number of columns this table has based on the first row (3 columns in this case).\n * 2.) Check if the 4th row contains 3 cells. It doesn't, so go to the row before it.\n * 3.) Check if the 3rd row contains 3 cells. It doesn't, so go to the row before it.\n * 4.) Check if the 2nd row contains 3 cells. It does, so set the current row to that row.\n *\n * Setting the current row this way is necessary to let the `next()` method loop over the cells\n * spanning multiple rows or columns and update the `this._spannedCells` property.\n */\n _jumpToNonSpannedRowClosestToStartRow() {\n const firstRowLength = this._getRowLength(0);\n for (let i = this._startRow; !this._jumpedToStartRow; i--) {\n if (firstRowLength === this._getRowLength(i)) {\n this._row = i;\n this._rowIndex = i;\n this._jumpedToStartRow = true;\n }\n }\n }\n /**\n * Returns a number of columns in a row taking `colspan` into consideration.\n */\n _getRowLength(rowIndex) {\n const row = this._table.getChild(rowIndex);\n return [...row.getChildren()].reduce((cols, row) => {\n return cols + parseInt(row.getAttribute('colspan') || '1');\n }, 0);\n }\n}\n/**\n * An object returned by {@link module:table/tablewalker~TableWalker} when traversing table cells.\n */\nclass TableSlot {\n /**\n * Creates an instance of the table walker value.\n *\n * @param tableWalker The table walker instance.\n * @param cell The current table cell.\n * @param anchorRow The row index of a cell anchor slot.\n * @param anchorColumn The column index of a cell anchor slot.\n */\n constructor(tableWalker, cell, anchorRow, anchorColumn) {\n this.cell = cell;\n this.row = tableWalker._row;\n this.column = tableWalker._column;\n this.cellAnchorRow = anchorRow;\n this.cellAnchorColumn = anchorColumn;\n this._cellIndex = tableWalker._cellIndex;\n this._rowIndex = tableWalker._rowIndex;\n this._table = tableWalker._table;\n }\n // @if CK_DEBUG // public get isSpanned(): unknown { return throwMissingGetterError( 'isSpanned' ); }\n // @if CK_DEBUG // public get colspan(): unknown { return throwMissingGetterError( 'colspan' ); }\n // @if CK_DEBUG // public get rowspan(): unknown { return throwMissingGetterError( 'rowspan' ); }\n // @if CK_DEBUG // public get cellIndex(): unknown { return throwMissingGetterError( 'cellIndex' ); }\n /**\n * Whether the cell is anchored in the current slot.\n */\n get isAnchor() {\n return this.row === this.cellAnchorRow && this.column === this.cellAnchorColumn;\n }\n /**\n * The width of a cell defined by a `colspan` attribute. If the model attribute is not present, it is set to `1`.\n */\n get cellWidth() {\n return parseInt(this.cell.getAttribute('colspan') || '1');\n }\n /**\n * The height of a cell defined by a `rowspan` attribute. If the model attribute is not present, it is set to `1`.\n */\n get cellHeight() {\n return parseInt(this.cell.getAttribute('rowspan') || '1');\n }\n /**\n * The index of the current row element in the table.\n */\n get rowIndex() {\n return this._rowIndex;\n }\n /**\n * Returns the {@link module:engine/model/position~Position} before the table slot.\n */\n getPositionBefore() {\n const model = this._table.root.document.model;\n return model.createPositionAt(this._table.getChild(this.row), this._cellIndex);\n }\n}\n/**\n * This `TableSlot`'s getter (property) was removed in CKEditor 5 v20.0.0.\n *\n * Check out the new `TableWalker`'s API in the documentation.\n *\n * @error tableslot-getter-removed\n * @param getterName\n */\n// @if CK_DEBUG // function throwMissingGetterError( getterName: string ): void {\n// @if CK_DEBUG //\t\tthrow new CKEditorError( 'tableslot-getter-removed', null, {\n// @if CK_DEBUG //\t\t\tgetterName\n// @if CK_DEBUG //\t\t} );\n// @if CK_DEBUG // }\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/converters/downcast\n */\nimport { toWidget, toWidgetEditable } from 'ckeditor5/src/widget.js';\nimport TableWalker from './../tablewalker.js';\n/**\n * Model table element to view table element conversion helper.\n */\nexport function downcastTable(tableUtils, options) {\n return (table, { writer }) => {\n const headingRows = table.getAttribute('headingRows') || 0;\n const tableElement = writer.createContainerElement('table', null, []);\n const figureElement = writer.createContainerElement('figure', { class: 'table' }, tableElement);\n // Table head slot.\n if (headingRows > 0) {\n writer.insert(writer.createPositionAt(tableElement, 'end'), writer.createContainerElement('thead', null, writer.createSlot(element => element.is('element', 'tableRow') && element.index < headingRows)));\n }\n // Table body slot.\n if (headingRows < tableUtils.getRows(table)) {\n writer.insert(writer.createPositionAt(tableElement, 'end'), writer.createContainerElement('tbody', null, writer.createSlot(element => element.is('element', 'tableRow') && element.index >= headingRows)));\n }\n // Dynamic slots.\n for (const { positionOffset, filter } of options.additionalSlots) {\n writer.insert(writer.createPositionAt(tableElement, positionOffset), writer.createSlot(filter));\n }\n // Create a slot with items that don't fit into the table.\n writer.insert(writer.createPositionAt(tableElement, 'after'), writer.createSlot(element => {\n if (element.is('element', 'tableRow')) {\n return false;\n }\n return !options.additionalSlots.some(({ filter }) => filter(element));\n }));\n return options.asWidget ? toTableWidget(figureElement, writer) : figureElement;\n };\n}\n/**\n * Model table row element to view `<tr>` element conversion helper.\n *\n * @returns Element creator.\n */\nexport function downcastRow() {\n return (tableRow, { writer }) => {\n return tableRow.isEmpty ?\n writer.createEmptyElement('tr') :\n writer.createContainerElement('tr');\n };\n}\n/**\n * Model table cell element to view `<td>` or `<th>` element conversion helper.\n *\n * This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)\n * and `<td>` otherwise.\n *\n * @param options.asWidget If set to `true`, the downcast conversion will produce a widget.\n * @returns Element creator.\n */\nexport function downcastCell(options = {}) {\n return (tableCell, { writer }) => {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowIndex = table.getChildIndex(tableRow);\n const tableWalker = new TableWalker(table, { row: rowIndex });\n const headingRows = table.getAttribute('headingRows') || 0;\n const headingColumns = table.getAttribute('headingColumns') || 0;\n let result = null;\n // We need to iterate over a table in order to get proper row & column values from a walker.\n for (const tableSlot of tableWalker) {\n if (tableSlot.cell == tableCell) {\n const isHeading = tableSlot.row < headingRows || tableSlot.column < headingColumns;\n const cellElementName = isHeading ? 'th' : 'td';\n result = options.asWidget ?\n toWidgetEditable(writer.createEditableElement(cellElementName), writer) :\n writer.createContainerElement(cellElementName);\n break;\n }\n }\n return result;\n };\n}\n/**\n * Overrides paragraph inside table cell conversion.\n *\n * This converter:\n * * should be used to override default paragraph conversion.\n * * It will only convert `<paragraph>` placed directly inside `<tableCell>`.\n * * For a single paragraph without attributes it returns `<span>` to simulate data table.\n * * For all other cases it returns `<p>` element.\n *\n * @param options.asWidget If set to `true`, the downcast conversion will produce a widget.\n * @returns Element creator.\n */\nexport function convertParagraphInTableCell(options = {}) {\n return (modelElement, { writer }) => {\n if (!modelElement.parent.is('element', 'tableCell')) {\n return null;\n }\n if (!isSingleParagraphWithoutAttributes(modelElement)) {\n return null;\n }\n if (options.asWidget) {\n return writer.createContainerElement('span', { class: 'ck-table-bogus-paragraph' });\n }\n else {\n // Using `<p>` in case there are some markers on it and transparentRendering will render it anyway.\n const viewElement = writer.createContainerElement('p');\n writer.setCustomProperty('dataPipeline:transparentRendering', true, viewElement);\n return viewElement;\n }\n };\n}\n/**\n * Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.\n *\n * The paragraph should be converted in the editing view to:\n *\n * * If returned `true` - to a `<span class=\"ck-table-bogus-paragraph\">`\n * * If returned `false` - to a `<p>`\n */\nexport function isSingleParagraphWithoutAttributes(modelElement) {\n const tableCell = modelElement.parent;\n const isSingleParagraph = tableCell.childCount == 1;\n return isSingleParagraph && !hasAnyAttribute(modelElement);\n}\n/**\n * Converts a given {@link module:engine/view/element~Element} to a table widget:\n * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the table widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n * @param label The element's label. It will be concatenated with the table `alt` attribute if one is present.\n */\nfunction toTableWidget(viewElement, writer) {\n writer.setCustomProperty('table', true, viewElement);\n return toWidget(viewElement, writer, { hasSelectionHandle: true });\n}\n/**\n * Checks if an element has any attributes set.\n */\nfunction hasAnyAttribute(element) {\n const iteratorItem = element.getAttributeKeys().next();\n return !iteratorItem.done;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/inserttablecommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The insert table command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.\n *\n * To insert a table at the current selection, execute the command and specify the dimensions:\n *\n * ```ts\n * editor.execute( 'insertTable', { rows: 20, columns: 5 } );\n * ```\n */\nexport default class InsertTableCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const selection = model.document.selection;\n const schema = model.schema;\n this.isEnabled = isAllowedInParent(selection, schema);\n }\n /**\n * Executes the command.\n *\n * Inserts a table with the given number of rows and columns into the editor.\n *\n * @param options.rows The number of rows to create in the inserted table. Default value is 2.\n * @param options.columns The number of columns to create in the inserted table. Default value is 2.\n * @param options.headingRows The number of heading rows. If not provided it will default to\n * {@link module:table/tableconfig~TableConfig#defaultHeadings `config.table.defaultHeadings.rows`} table config.\n * @param options.headingColumns The number of heading columns. If not provided it will default to\n * {@link module:table/tableconfig~TableConfig#defaultHeadings `config.table.defaultHeadings.columns`} table config.\n * @fires execute\n */\n execute(options = {}) {\n const editor = this.editor;\n const model = editor.model;\n const tableUtils = editor.plugins.get('TableUtils');\n const defaultRows = editor.config.get('table.defaultHeadings.rows');\n const defaultColumns = editor.config.get('table.defaultHeadings.columns');\n if (options.headingRows === undefined && defaultRows) {\n options.headingRows = defaultRows;\n }\n if (options.headingColumns === undefined && defaultColumns) {\n options.headingColumns = defaultColumns;\n }\n model.change(writer => {\n const table = tableUtils.createTable(writer, options);\n model.insertObject(table, null, null, { findOptimalPosition: 'auto' });\n writer.setSelection(writer.createPositionAt(table.getNodeByPath([0, 0, 0]), 0));\n });\n }\n}\n/**\n * Checks if the table is allowed in the parent.\n */\nfunction isAllowedInParent(selection, schema) {\n const positionParent = selection.getFirstPosition().parent;\n const validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;\n return schema.checkChild(validParent, 'table');\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/insertrowcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The insert row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and\n * `'insertTableRowAbove'` editor commands.\n *\n * To insert a row below the selected cell, execute the following command:\n *\n * ```ts\n * editor.execute( 'insertTableRowBelow' );\n * ```\n *\n * To insert a row above the selected cell, execute the following command:\n *\n * ```ts\n * editor.execute( 'insertTableRowAbove' );\n * ```\n */\nexport default class InsertRowCommand extends Command {\n /**\n * Creates a new `InsertRowCommand` instance.\n *\n * @param editor The editor on which this command will be used.\n * @param options.order The order of insertion relative to the row in which the caret is located.\n * Possible values: `\"above\"` and `\"below\"`. Default value is \"below\"\n */\n constructor(editor, options = {}) {\n super(editor);\n this.order = options.order || 'below';\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const selection = this.editor.model.document.selection;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const isAnyCellSelected = !!tableUtils.getSelectionAffectedTableCells(selection).length;\n this.isEnabled = isAnyCellSelected;\n }\n /**\n * Executes the command.\n *\n * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.\n *\n * @fires execute\n */\n execute() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const tableUtils = editor.plugins.get('TableUtils');\n const insertAbove = this.order === 'above';\n const affectedTableCells = tableUtils.getSelectionAffectedTableCells(selection);\n const rowIndexes = tableUtils.getRowIndexes(affectedTableCells);\n const row = insertAbove ? rowIndexes.first : rowIndexes.last;\n const table = affectedTableCells[0].findAncestor('table');\n tableUtils.insertRows(table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/insertcolumncommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The insert column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and\n * `'insertTableColumnRight'` editor commands.\n *\n * To insert a column to the left of the selected cell, execute the following command:\n *\n * ```ts\n * editor.execute( 'insertTableColumnLeft' );\n * ```\n *\n * To insert a column to the right of the selected cell, execute the following command:\n *\n * ```ts\n * editor.execute( 'insertTableColumnRight' );\n * ```\n */\nexport default class InsertColumnCommand extends Command {\n /**\n * Creates a new `InsertColumnCommand` instance.\n *\n * @param editor An editor on which this command will be used.\n * @param options.order The order of insertion relative to the column in which the caret is located.\n * Possible values: `\"left\"` and `\"right\"`. Default value is \"right\".\n */\n constructor(editor, options = {}) {\n super(editor);\n this.order = options.order || 'right';\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const selection = this.editor.model.document.selection;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const isAnyCellSelected = !!tableUtils.getSelectionAffectedTableCells(selection).length;\n this.isEnabled = isAnyCellSelected;\n }\n /**\n * Executes the command.\n *\n * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column\n * in which the selection is set.\n *\n * @fires execute\n */\n execute() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const tableUtils = editor.plugins.get('TableUtils');\n const insertBefore = this.order === 'left';\n const affectedTableCells = tableUtils.getSelectionAffectedTableCells(selection);\n const columnIndexes = tableUtils.getColumnIndexes(affectedTableCells);\n const column = insertBefore ? columnIndexes.first : columnIndexes.last;\n const table = affectedTableCells[0].findAncestor('table');\n tableUtils.insertColumns(table, { columns: 1, at: insertBefore ? column : column + 1 });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/splitcellcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The split cell command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`\n * and `'splitTableCellHorizontally'` editor commands.\n *\n * You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:\n *\n * ```ts\n * editor.execute( 'splitTableCellVertically' );\n * ```\n */\nexport default class SplitCellCommand extends Command {\n /**\n * Creates a new `SplitCellCommand` instance.\n *\n * @param editor The editor on which this command will be used.\n * @param options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.\n */\n constructor(editor, options = {}) {\n super(editor);\n this.direction = options.direction || 'horizontally';\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n this.isEnabled = selectedCells.length === 1;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const tableCell = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];\n const isHorizontal = this.direction === 'horizontally';\n if (isHorizontal) {\n tableUtils.splitCellHorizontally(tableCell, 2);\n }\n else {\n tableUtils.splitCellVertically(tableCell, 2);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { default as TableWalker } from '../tablewalker.js';\nimport { createEmptyTableCell, updateNumericAttribute } from './common.js';\n/**\n * Returns a cropped table according to given dimensions.\n\n * To return a cropped table that starts at first row and first column and end in third row and column:\n *\n * ```ts\n * const croppedTable = cropTableToDimensions( table, {\n * startRow: 1,\n * endRow: 3,\n * startColumn: 1,\n * endColumn: 3\n * }, writer );\n * ```\n *\n * Calling the code above for the table below:\n *\n * 0 1 2 3 4 0 1 2\n * ┌───┬───┬───┬───┬───â”\n * 0 │ a │ b │ c │ d │ e │\n * ├───┴───┤ ├───┴───┤ ┌───┬───┬───â”\n * 1 │ f │ │ g │ │ │ │ g │ 0\n * ├───┬───┴───┼───┬───┤ will return: ├───┴───┼───┤\n * 2 │ h │ i │ j │ k │ │ i │ j │ 1\n * ├───┤ ├───┤ │ │ ├───┤\n * 3 │ l │ │ m │ │ │ │ m │ 2\n * ├───┼───┬───┤ ├───┤ └───────┴───┘\n * 4 │ n │ o │ p │ │ q │\n * └───┴───┴───┴───┴───┘\n */\nexport function cropTableToDimensions(sourceTable, cropDimensions, writer) {\n const { startRow, startColumn, endRow, endColumn } = cropDimensions;\n // Create empty table with empty rows equal to crop height.\n const croppedTable = writer.createElement('table');\n const cropHeight = endRow - startRow + 1;\n for (let i = 0; i < cropHeight; i++) {\n writer.insertElement('tableRow', croppedTable, 'end');\n }\n const tableMap = [...new TableWalker(sourceTable, { startRow, endRow, startColumn, endColumn, includeAllSlots: true })];\n // Iterate over source table slots (including empty - spanned - ones).\n for (const { row: sourceRow, column: sourceColumn, cell: tableCell, isAnchor, cellAnchorRow, cellAnchorColumn } of tableMap) {\n // Row index in cropped table.\n const rowInCroppedTable = sourceRow - startRow;\n const row = croppedTable.getChild(rowInCroppedTable);\n // For empty slots: fill the gap with empty table cell.\n if (!isAnchor) {\n // But fill the gap only if the spanning cell is anchored outside cropped area.\n // In the table from method jsdoc those cells are: \"c\" & \"f\".\n if (cellAnchorRow < startRow || cellAnchorColumn < startColumn) {\n createEmptyTableCell(writer, writer.createPositionAt(row, 'end'));\n }\n }\n // Otherwise clone the cell with all children and trim if it exceeds cropped area.\n else {\n const tableCellCopy = writer.cloneElement(tableCell);\n writer.append(tableCellCopy, row);\n // Trim table if it exceeds cropped area.\n // In the table from method jsdoc those cells are: \"g\" & \"m\".\n trimTableCellIfNeeded(tableCellCopy, sourceRow, sourceColumn, endRow, endColumn, writer);\n }\n }\n // Adjust heading rows & columns in cropped table if crop selection includes headings parts.\n addHeadingsToCroppedTable(croppedTable, sourceTable, startRow, startColumn, writer);\n return croppedTable;\n}\n/**\n * Returns slot info of cells that starts above and overlaps a given row.\n *\n * In a table below, passing `overlapRow = 3`\n *\n * ┌───┬───┬───┬───┬───â”\n * 0 │ a │ b │ c │ d │ e │\n * │ ├───┼───┼───┼───┤\n * 1 │ │ f │ g │ h │ i │\n * ├───┤ ├───┼───┤ │\n * 2 │ j │ │ k │ l │ │\n * │ │ │ ├───┼───┤\n * 3 │ │ │ │ m │ n │ <- overlap row to check\n * ├───┼───┤ │ ├───│\n * 4 │ o │ p │ │ │ q │\n * └───┴───┴───┴───┴───┘\n *\n * will return slot info for cells: \"j\", \"f\", \"k\".\n *\n * @param table The table to check.\n * @param overlapRow The index of the row to check.\n * @param startRow row to start analysis. Use it when it is known that the cells above that row will not overlap. Default value is 0.\n */\nexport function getVerticallyOverlappingCells(table, overlapRow, startRow = 0) {\n const cells = [];\n const tableWalker = new TableWalker(table, { startRow, endRow: overlapRow - 1 });\n for (const slotInfo of tableWalker) {\n const { row, cellHeight } = slotInfo;\n const cellEndRow = row + cellHeight - 1;\n if (row < overlapRow && overlapRow <= cellEndRow) {\n cells.push(slotInfo);\n }\n }\n return cells;\n}\n/**\n * Splits the table cell horizontally.\n *\n * @returns Created table cell, if any were created.\n */\nexport function splitHorizontally(tableCell, splitRow, writer) {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowIndex = tableRow.index;\n const rowspan = parseInt(tableCell.getAttribute('rowspan'));\n const newRowspan = splitRow - rowIndex;\n const newCellAttributes = {};\n const newCellRowSpan = rowspan - newRowspan;\n if (newCellRowSpan > 1) {\n newCellAttributes.rowspan = newCellRowSpan;\n }\n const colspan = parseInt(tableCell.getAttribute('colspan') || '1');\n if (colspan > 1) {\n newCellAttributes.colspan = colspan;\n }\n const startRow = rowIndex;\n const endRow = startRow + newRowspan;\n const tableMap = [...new TableWalker(table, { startRow, endRow, includeAllSlots: true })];\n let newCell = null;\n let columnIndex;\n for (const tableSlot of tableMap) {\n const { row, column, cell } = tableSlot;\n if (cell === tableCell && columnIndex === undefined) {\n columnIndex = column;\n }\n if (columnIndex !== undefined && columnIndex === column && row === endRow) {\n newCell = createEmptyTableCell(writer, tableSlot.getPositionBefore(), newCellAttributes);\n }\n }\n // Update the rowspan attribute after updating table.\n updateNumericAttribute('rowspan', newRowspan, tableCell, writer);\n return newCell;\n}\n/**\n * Returns slot info of cells that starts before and overlaps a given column.\n *\n * In a table below, passing `overlapColumn = 3`\n *\n * 0 1 2 3 4\n * ┌───────┬───────┬───â”\n * │ a │ b │ c │\n * │───┬───┴───────┼───┤\n * │ d │ e │ f │\n * ├───┼───┬───────┴───┤\n * │ g │ h │ i │\n * ├───┼───┼───┬───────┤\n * │ j │ k │ l │ m │\n * ├───┼───┴───┼───┬───┤\n * │ n │ o │ p │ q │\n * └───┴───────┴───┴───┘\n * ^\n * Overlap column to check\n *\n * will return slot info for cells: \"b\", \"e\", \"i\".\n *\n * @param table The table to check.\n * @param overlapColumn The index of the column to check.\n */\nexport function getHorizontallyOverlappingCells(table, overlapColumn) {\n const cellsToSplit = [];\n const tableWalker = new TableWalker(table);\n for (const slotInfo of tableWalker) {\n const { column, cellWidth } = slotInfo;\n const cellEndColumn = column + cellWidth - 1;\n if (column < overlapColumn && overlapColumn <= cellEndColumn) {\n cellsToSplit.push(slotInfo);\n }\n }\n return cellsToSplit;\n}\n/**\n * Splits the table cell vertically.\n *\n * @param columnIndex The table cell column index.\n * @param splitColumn The index of column to split cell on.\n * @returns Created table cell.\n */\nexport function splitVertically(tableCell, columnIndex, splitColumn, writer) {\n const colspan = parseInt(tableCell.getAttribute('colspan'));\n const newColspan = splitColumn - columnIndex;\n const newCellAttributes = {};\n const newCellColSpan = colspan - newColspan;\n if (newCellColSpan > 1) {\n newCellAttributes.colspan = newCellColSpan;\n }\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n if (rowspan > 1) {\n newCellAttributes.rowspan = rowspan;\n }\n const newCell = createEmptyTableCell(writer, writer.createPositionAfter(tableCell), newCellAttributes);\n // Update the colspan attribute after updating table.\n updateNumericAttribute('colspan', newColspan, tableCell, writer);\n return newCell;\n}\n/**\n * Adjusts table cell dimensions to not exceed limit row and column.\n *\n * If table cell width (or height) covers a column (or row) that is after a limit column (or row)\n * this method will trim \"colspan\" (or \"rowspan\") attribute so the table cell will fit in a defined limits.\n */\nexport function trimTableCellIfNeeded(tableCell, cellRow, cellColumn, limitRow, limitColumn, writer) {\n const colspan = parseInt(tableCell.getAttribute('colspan') || '1');\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const endColumn = cellColumn + colspan - 1;\n if (endColumn > limitColumn) {\n const trimmedSpan = limitColumn - cellColumn + 1;\n updateNumericAttribute('colspan', trimmedSpan, tableCell, writer, 1);\n }\n const endRow = cellRow + rowspan - 1;\n if (endRow > limitRow) {\n const trimmedSpan = limitRow - cellRow + 1;\n updateNumericAttribute('rowspan', trimmedSpan, tableCell, writer, 1);\n }\n}\n/**\n * Sets proper heading attributes to a cropped table.\n */\nfunction addHeadingsToCroppedTable(croppedTable, sourceTable, startRow, startColumn, writer) {\n const headingRows = parseInt(sourceTable.getAttribute('headingRows') || '0');\n if (headingRows > 0) {\n const headingRowsInCrop = headingRows - startRow;\n updateNumericAttribute('headingRows', headingRowsInCrop, croppedTable, writer, 0);\n }\n const headingColumns = parseInt(sourceTable.getAttribute('headingColumns') || '0');\n if (headingColumns > 0) {\n const headingColumnsInCrop = headingColumns - startColumn;\n updateNumericAttribute('headingColumns', headingColumnsInCrop, croppedTable, writer, 0);\n }\n}\n/**\n * Removes columns that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+----+----+----+----+\n * | 00 | 01 | 03 | 04 | 06 |\n * +----+----+----+----+ +----+\n * | 10 | 11 | 13 | | 16 |\n * +----+----+----+----+----+----+----+\n * | 20 | 21 | 23 | 24 | 26 |\n * +----+----+----+----+----+----+----+\n * ^--- empty ---^\n *\n * Will remove columns 2 and 5.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a column from a table use {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`}.\n *\n * @internal\n * @returns True if removed some columns.\n */\nexport function removeEmptyColumns(table, tableUtils) {\n const width = tableUtils.getColumns(table);\n const columnsMap = new Array(width).fill(0);\n for (const { column } of new TableWalker(table)) {\n columnsMap[column]++;\n }\n const emptyColumns = columnsMap.reduce((result, cellsCount, column) => {\n return cellsCount ? result : [...result, column];\n }, []);\n if (emptyColumns.length > 0) {\n // Remove only last empty column because it will recurrently trigger removing empty rows.\n const emptyColumn = emptyColumns[emptyColumns.length - 1];\n // @if CK_DEBUG_TABLE // console.log( `Removing empty column: ${ emptyColumn }.` );\n tableUtils.removeColumns(table, { at: emptyColumn });\n return true;\n }\n return false;\n}\n/**\n * Removes rows that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+\n * | 00 | 01 | 02 |\n * +----+----+----+\n * | 10 | 11 | 12 |\n * + + + +\n * | | | | <-- empty\n * +----+----+----+\n * | 30 | 31 | 32 |\n * +----+----+----+\n * | 40 | 42 |\n * + + +\n * | | | <-- empty\n * +----+----+----+\n * | 60 | 61 | 62 |\n * +----+----+----+\n *\n * Will remove rows 2 and 5.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a row from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`}.\n *\n * @internal\n * @returns True if removed some rows.\n */\nexport function removeEmptyRows(table, tableUtils) {\n const emptyRows = [];\n const tableRowCount = tableUtils.getRows(table);\n for (let rowIndex = 0; rowIndex < tableRowCount; rowIndex++) {\n const tableRow = table.getChild(rowIndex);\n if (tableRow.isEmpty) {\n emptyRows.push(rowIndex);\n }\n }\n if (emptyRows.length > 0) {\n // Remove only last empty row because it will recurrently trigger removing empty columns.\n const emptyRow = emptyRows[emptyRows.length - 1];\n // @if CK_DEBUG_TABLE // console.log( `Removing empty row: ${ emptyRow }.` );\n tableUtils.removeRows(table, { at: emptyRow });\n return true;\n }\n return false;\n}\n/**\n * Removes rows and columns that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+----+\n * | 00 | 02 |\n * +----+----+ +\n * | 10 | |\n * +----+----+----+----+\n * | 20 | 22 | 23 |\n * + + + +\n * | | | | <-- empty row\n * +----+----+----+----+\n * ^--- empty column\n *\n * Will remove row 3 and column 1.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a rows from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`} and\n * {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`} to remove a column.\n *\n * @internal\n */\nexport function removeEmptyRowsColumns(table, tableUtils) {\n const removedColumns = removeEmptyColumns(table, tableUtils);\n // If there was some columns removed then cleaning empty rows was already triggered.\n if (!removedColumns) {\n removeEmptyRows(table, tableUtils);\n }\n}\n/**\n * Returns adjusted last row index if selection covers part of a row with empty slots (spanned by other cells).\n * The `dimensions.lastRow` is equal to last row index but selection might be bigger.\n *\n * This happens *only* on rectangular selection so we analyze a case like this:\n *\n * +---+---+---+---+\n * 0 | a | b | c | d |\n * + + +---+---+\n * 1 | | e | f | g |\n * + +---+ +---+\n * 2 | | h | | i | <- last row, each cell has rowspan = 2,\n * + + + + + so we need to return 3, not 2\n * 3 | | | | |\n * +---+---+---+---+\n *\n * @returns Adjusted last row index.\n */\nexport function adjustLastRowIndex(table, dimensions) {\n const lastRowMap = Array.from(new TableWalker(table, {\n startColumn: dimensions.firstColumn,\n endColumn: dimensions.lastColumn,\n row: dimensions.lastRow\n }));\n const everyCellHasSingleRowspan = lastRowMap.every(({ cellHeight }) => cellHeight === 1);\n // It is a \"flat\" row, so the last row index is OK.\n if (everyCellHasSingleRowspan) {\n return dimensions.lastRow;\n }\n // Otherwise get any cell's rowspan and adjust the last row index.\n const rowspanAdjustment = lastRowMap[0].cellHeight - 1;\n return dimensions.lastRow + rowspanAdjustment;\n}\n/**\n * Returns adjusted last column index if selection covers part of a column with empty slots (spanned by other cells).\n * The `dimensions.lastColumn` is equal to last column index but selection might be bigger.\n *\n * This happens *only* on rectangular selection so we analyze a case like this:\n *\n * 0 1 2 3\n * +---+---+---+---+\n * | a |\n * +---+---+---+---+\n * | b | c | d |\n * +---+---+---+---+\n * | e | f |\n * +---+---+---+---+\n * | g | h |\n * +---+---+---+---+\n * ^\n * last column, each cell has colspan = 2, so we need to return 3, not 2\n *\n * @returns Adjusted last column index.\n */\nexport function adjustLastColumnIndex(table, dimensions) {\n const lastColumnMap = Array.from(new TableWalker(table, {\n startRow: dimensions.firstRow,\n endRow: dimensions.lastRow,\n column: dimensions.lastColumn\n }));\n const everyCellHasSingleColspan = lastColumnMap.every(({ cellWidth }) => cellWidth === 1);\n // It is a \"flat\" column, so the last column index is OK.\n if (everyCellHasSingleColspan) {\n return dimensions.lastColumn;\n }\n // Otherwise get any cell's colspan and adjust the last column index.\n const colspanAdjustment = lastColumnMap[0].cellWidth - 1;\n return dimensions.lastColumn + colspanAdjustment;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport TableWalker from '../tablewalker.js';\nimport { isHeadingColumnCell } from '../utils/common.js';\nimport { removeEmptyRowsColumns } from '../utils/structure.js';\n/**\n * The merge cell command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,\n * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.\n *\n * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.\n *\n * For example, to merge with a cell to the right:\n *\n * ```ts\n * editor.execute( 'mergeTableCellRight' );\n * ```\n *\n * **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)\n * (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)\n * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.\n */\nexport default class MergeCellCommand extends Command {\n /**\n * Creates a new `MergeCellCommand` instance.\n *\n * @param editor The editor on which this command will be used.\n * @param options.direction Indicates which cell to merge with the currently selected one.\n * Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.\n */\n constructor(editor, options) {\n super(editor);\n this.direction = options.direction;\n this.isHorizontal = this.direction == 'right' || this.direction == 'left';\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const cellToMerge = this._getMergeableCell();\n this.value = cellToMerge;\n this.isEnabled = !!cellToMerge;\n }\n /**\n * Executes the command.\n *\n * Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.\n *\n * @fires execute\n */\n execute() {\n const model = this.editor.model;\n const doc = model.document;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const tableCell = tableUtils.getTableCellsContainingSelection(doc.selection)[0];\n const cellToMerge = this.value;\n const direction = this.direction;\n model.change(writer => {\n const isMergeNext = direction == 'right' || direction == 'down';\n // The merge mechanism is always the same so sort cells to be merged.\n const cellToExpand = (isMergeNext ? tableCell : cellToMerge);\n const cellToRemove = (isMergeNext ? cellToMerge : tableCell);\n // Cache the parent of cell to remove for later check.\n const removedTableCellRow = cellToRemove.parent;\n mergeTableCells(cellToRemove, cellToExpand, writer);\n const spanAttribute = this.isHorizontal ? 'colspan' : 'rowspan';\n const cellSpan = parseInt(tableCell.getAttribute(spanAttribute) || '1');\n const cellToMergeSpan = parseInt(cellToMerge.getAttribute(spanAttribute) || '1');\n // Update table cell span attribute and merge set selection on merged contents.\n writer.setAttribute(spanAttribute, cellSpan + cellToMergeSpan, cellToExpand);\n writer.setSelection(writer.createRangeIn(cellToExpand));\n const tableUtils = this.editor.plugins.get('TableUtils');\n const table = removedTableCellRow.findAncestor('table');\n // Remove empty rows and columns after merging.\n removeEmptyRowsColumns(table, tableUtils);\n });\n }\n /**\n * Returns a cell that can be merged with the current cell depending on the command's direction.\n */\n _getMergeableCell() {\n const model = this.editor.model;\n const doc = model.document;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const tableCell = tableUtils.getTableCellsContainingSelection(doc.selection)[0];\n if (!tableCell) {\n return;\n }\n // First get the cell on proper direction.\n const cellToMerge = this.isHorizontal ?\n getHorizontalCell(tableCell, this.direction, tableUtils) :\n getVerticalCell(tableCell, this.direction, tableUtils);\n if (!cellToMerge) {\n return;\n }\n // If found check if the span perpendicular to merge direction is equal on both cells.\n const spanAttribute = this.isHorizontal ? 'rowspan' : 'colspan';\n const span = parseInt(tableCell.getAttribute(spanAttribute) || '1');\n const cellToMergeSpan = parseInt(cellToMerge.getAttribute(spanAttribute) || '1');\n if (cellToMergeSpan === span) {\n return cellToMerge;\n }\n }\n}\n/**\n * Returns the cell that can be merged horizontally.\n */\nfunction getHorizontalCell(tableCell, direction, tableUtils) {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const horizontalCell = direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling;\n const hasHeadingColumns = (table.getAttribute('headingColumns') || 0) > 0;\n if (!horizontalCell) {\n return;\n }\n // Sort cells:\n const cellOnLeft = (direction == 'right' ? tableCell : horizontalCell);\n const cellOnRight = (direction == 'right' ? horizontalCell : tableCell);\n // Get their column indexes:\n const { column: leftCellColumn } = tableUtils.getCellLocation(cellOnLeft);\n const { column: rightCellColumn } = tableUtils.getCellLocation(cellOnRight);\n const leftCellSpan = parseInt(cellOnLeft.getAttribute('colspan') || '1');\n const isCellOnLeftInHeadingColumn = isHeadingColumnCell(tableUtils, cellOnLeft);\n const isCellOnRightInHeadingColumn = isHeadingColumnCell(tableUtils, cellOnRight);\n // We cannot merge heading columns cells with regular cells.\n if (hasHeadingColumns && isCellOnLeftInHeadingColumn != isCellOnRightInHeadingColumn) {\n return;\n }\n // The cell on the right must have index that is distant to the cell on the left by the left cell's width (colspan).\n const cellsAreTouching = leftCellColumn + leftCellSpan === rightCellColumn;\n // If the right cell's column index is different it means that there are rowspanned cells between them.\n return cellsAreTouching ? horizontalCell : undefined;\n}\n/**\n * Returns the cell that can be merged vertically.\n */\nfunction getVerticalCell(tableCell, direction, tableUtils) {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowIndex = table.getChildIndex(tableRow);\n // Don't search for mergeable cell if direction points out of the table.\n if ((direction == 'down' && rowIndex === tableUtils.getRows(table) - 1) || (direction == 'up' && rowIndex === 0)) {\n return null;\n }\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const headingRows = table.getAttribute('headingRows') || 0;\n const isMergeWithBodyCell = direction == 'down' && (rowIndex + rowspan) === headingRows;\n const isMergeWithHeadCell = direction == 'up' && rowIndex === headingRows;\n // Don't search for mergeable cell if direction points out of the current table section.\n if (headingRows && (isMergeWithBodyCell || isMergeWithHeadCell)) {\n return null;\n }\n const currentCellRowSpan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const rowOfCellToMerge = direction == 'down' ? rowIndex + currentCellRowSpan : rowIndex;\n const tableMap = [...new TableWalker(table, { endRow: rowOfCellToMerge })];\n const currentCellData = tableMap.find(value => value.cell === tableCell);\n const mergeColumn = currentCellData.column;\n const cellToMergeData = tableMap.find(({ row, cellHeight, column }) => {\n if (column !== mergeColumn) {\n return false;\n }\n if (direction == 'down') {\n // If merging a cell below the mergeRow is already calculated.\n return row === rowOfCellToMerge;\n }\n else {\n // If merging a cell above calculate if it spans to mergeRow.\n return rowOfCellToMerge === row + cellHeight;\n }\n });\n return cellToMergeData && cellToMergeData.cell ? cellToMergeData.cell : null;\n}\n/**\n * Merges two table cells. It will ensure that after merging cells with an empty paragraph, the resulting table cell will only have one\n * paragraph. If one of the merged table cells is empty, the merged table cell will have the contents of the non-empty table cell.\n * If both are empty, the merged table cell will have only one empty paragraph.\n */\nfunction mergeTableCells(cellToRemove, cellToExpand, writer) {\n if (!isEmpty(cellToRemove)) {\n if (isEmpty(cellToExpand)) {\n writer.remove(writer.createRangeIn(cellToExpand));\n }\n writer.move(writer.createRangeIn(cellToRemove), writer.createPositionAt(cellToExpand, 'end'));\n }\n // Remove merged table cell.\n writer.remove(cellToRemove);\n}\n/**\n * Checks if the passed table cell contains an empty paragraph.\n */\nfunction isEmpty(tableCell) {\n const firstTableChild = tableCell.getChild(0);\n return tableCell.childCount == 1 && firstTableChild.is('element', 'paragraph') && firstTableChild.isEmpty;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/removerowcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The remove row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.\n *\n * To remove the row containing the selected cell, execute the command:\n *\n * ```ts\n * editor.execute( 'removeTableRow' );\n * ```\n */\nexport default class RemoveRowCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n const firstCell = selectedCells[0];\n if (firstCell) {\n const table = firstCell.findAncestor('table');\n const tableRowCount = tableUtils.getRows(table);\n const lastRowIndex = tableRowCount - 1;\n const selectedRowIndexes = tableUtils.getRowIndexes(selectedCells);\n const areAllRowsSelected = selectedRowIndexes.first === 0 && selectedRowIndexes.last === lastRowIndex;\n // Disallow selecting whole table -> delete whole table should be used instead.\n this.isEnabled = !areAllRowsSelected;\n }\n else {\n this.isEnabled = false;\n }\n }\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const referenceCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const removedRowIndexes = tableUtils.getRowIndexes(referenceCells);\n const firstCell = referenceCells[0];\n const table = firstCell.findAncestor('table');\n const columnIndexToFocus = tableUtils.getCellLocation(firstCell).column;\n model.change(writer => {\n const rowsToRemove = removedRowIndexes.last - removedRowIndexes.first + 1;\n tableUtils.removeRows(table, {\n at: removedRowIndexes.first,\n rows: rowsToRemove\n });\n const cellToFocus = getCellToFocus(table, removedRowIndexes.first, columnIndexToFocus, tableUtils.getRows(table));\n writer.setSelection(writer.createPositionAt(cellToFocus, 0));\n });\n }\n}\n/**\n * Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.\n * - If the row was not the last one, the cell to focus will be in the row that followed it (before removal).\n * - If the row was the last one, the cell to focus will be in the row that preceded it (before removal).\n */\nfunction getCellToFocus(table, removedRowIndex, columnToFocus, tableRowCount) {\n // Don't go beyond last row's index.\n const row = table.getChild(Math.min(removedRowIndex, tableRowCount - 1));\n // Default to first table cell.\n let cellToFocus = row.getChild(0);\n let column = 0;\n for (const tableCell of row.getChildren()) {\n if (column > columnToFocus) {\n return cellToFocus;\n }\n cellToFocus = tableCell;\n column += parseInt(tableCell.getAttribute('colspan') || '1');\n }\n return cellToFocus;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/removecolumncommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport TableWalker from '../tablewalker.js';\n/**\n * The remove column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.\n *\n * To remove the column containing the selected cell, execute the command:\n *\n * ```ts\n * editor.execute( 'removeTableColumn' );\n * ```\n */\nexport default class RemoveColumnCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n const firstCell = selectedCells[0];\n if (firstCell) {\n const table = firstCell.findAncestor('table');\n const tableColumnCount = tableUtils.getColumns(table);\n const { first, last } = tableUtils.getColumnIndexes(selectedCells);\n this.isEnabled = last - first < (tableColumnCount - 1);\n }\n else {\n this.isEnabled = false;\n }\n }\n /**\n * @inheritDoc\n */\n execute() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const [firstCell, lastCell] = getBoundaryCells(this.editor.model.document.selection, tableUtils);\n const table = firstCell.parent.parent;\n // Cache the table before removing or updating colspans.\n const tableMap = [...new TableWalker(table)];\n // Store column indexes of removed columns.\n const removedColumnIndexes = {\n first: tableMap.find(value => value.cell === firstCell).column,\n last: tableMap.find(value => value.cell === lastCell).column\n };\n const cellToFocus = getCellToFocus(tableMap, firstCell, lastCell, removedColumnIndexes);\n this.editor.model.change(writer => {\n const columnsToRemove = removedColumnIndexes.last - removedColumnIndexes.first + 1;\n tableUtils.removeColumns(table, {\n at: removedColumnIndexes.first,\n columns: columnsToRemove\n });\n writer.setSelection(writer.createPositionAt(cellToFocus, 0));\n });\n }\n}\n/**\n * Returns a proper table cell to focus after removing a column.\n * - selection is on last table cell it will return previous cell.\n */\nfunction getCellToFocus(tableMap, firstCell, lastCell, removedColumnIndexes) {\n const colspan = parseInt(lastCell.getAttribute('colspan') || '1');\n // If the table cell is spanned over 2+ columns - it will be truncated so the selection should\n // stay in that cell.\n if (colspan > 1) {\n return lastCell;\n }\n // Normally, look for the cell in the same row that precedes the first cell to put selection there (\"column on the left\").\n // If the deleted column is the first column of the table, there will be no predecessor: use the cell\n // from the column that follows then (also in the same row).\n else if (firstCell.previousSibling || lastCell.nextSibling) {\n return lastCell.nextSibling || firstCell.previousSibling;\n }\n // It can happen that table cells have no siblings in a row, for instance, when there are row spans\n // in the table (in the previous row). Then just look for the closest cell that is in a column\n // that will not be removed to put the selection there.\n else {\n // Look for any cell in a column that precedes the first removed column.\n if (removedColumnIndexes.first) {\n return tableMap.reverse().find(({ column }) => {\n return column < removedColumnIndexes.first;\n }).cell;\n }\n // If the first removed column is the first column of the table, then\n // look for any cell that is in a column that follows the last removed column.\n else {\n return tableMap.reverse().find(({ column }) => {\n return column > removedColumnIndexes.last;\n }).cell;\n }\n }\n}\n/**\n * Returns helper object returning the first and the last cell contained in given selection, based on DOM order.\n */\nfunction getBoundaryCells(selection, tableUtils) {\n const referenceCells = tableUtils.getSelectionAffectedTableCells(selection);\n const firstCell = referenceCells[0];\n const lastCell = referenceCells.pop();\n const returnValue = [firstCell, lastCell];\n return firstCell.isBefore(lastCell) ? returnValue : returnValue.reverse();\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/setheaderrowcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { updateNumericAttribute } from '../utils/common.js';\nimport { getVerticallyOverlappingCells, splitHorizontally } from '../utils/structure.js';\n/**\n * The header row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.\n *\n * You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:\n *\n * ```ts\n * editor.execute( 'setTableRowHeader' );\n * ```\n *\n * **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command\n * will make it a regular row back again (including the following rows).\n */\nexport default class SetHeaderRowCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const model = this.editor.model;\n const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const isInTable = selectedCells.length > 0;\n this.isEnabled = isInTable;\n this.value = isInTable && selectedCells.every(cell => this._isInHeading(cell, cell.parent.parent));\n }\n /**\n * Executes the command.\n *\n * When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.\n *\n * When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.\n *\n * @fires execute\n * @param options.forceValue If set, the command will set (`true`) or unset (`false`) the header rows according to\n * the `forceValue` parameter instead of the current model state.\n */\n execute(options = {}) {\n if (options.forceValue === this.value) {\n return;\n }\n const tableUtils = this.editor.plugins.get('TableUtils');\n const model = this.editor.model;\n const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const table = selectedCells[0].findAncestor('table');\n const { first, last } = tableUtils.getRowIndexes(selectedCells);\n const headingRowsToSet = this.value ? first : last + 1;\n const currentHeadingRows = table.getAttribute('headingRows') || 0;\n model.change(writer => {\n if (headingRowsToSet) {\n // Changing heading rows requires to check if any of a heading cell is overlapping vertically the table head.\n // Any table cell that has a rowspan attribute > 1 will not exceed the table head so we need to fix it in rows below.\n const startRow = headingRowsToSet > currentHeadingRows ? currentHeadingRows : 0;\n const overlappingCells = getVerticallyOverlappingCells(table, headingRowsToSet, startRow);\n for (const { cell } of overlappingCells) {\n splitHorizontally(cell, headingRowsToSet, writer);\n }\n }\n updateNumericAttribute('headingRows', headingRowsToSet, table, writer, 0);\n });\n }\n /**\n * Checks if a table cell is in the heading section.\n */\n _isInHeading(tableCell, table) {\n const headingRows = parseInt(table.getAttribute('headingRows') || '0');\n return !!headingRows && tableCell.parent.index < headingRows;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/setheadercolumncommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { isHeadingColumnCell, updateNumericAttribute } from '../utils/common.js';\nimport { getHorizontallyOverlappingCells, splitVertically } from '../utils/structure.js';\n/**\n * The header column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.\n *\n * You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)\n * by executing:\n *\n * ```ts\n * editor.execute( 'setTableColumnHeader' );\n * ```\n *\n * **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command\n * will make it a regular column back again (including the following columns).\n */\nexport default class SetHeaderColumnCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const isInTable = selectedCells.length > 0;\n this.isEnabled = isInTable;\n this.value = isInTable && selectedCells.every(cell => isHeadingColumnCell(tableUtils, cell));\n }\n /**\n * Executes the command.\n *\n * When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.\n *\n * When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.\n *\n * @fires execute\n * @param options.forceValue If set, the command will set (`true`) or unset (`false`) the header columns according to\n * the `forceValue` parameter instead of the current model state.\n */\n execute(options = {}) {\n if (options.forceValue === this.value) {\n return;\n }\n const tableUtils = this.editor.plugins.get('TableUtils');\n const model = this.editor.model;\n const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const table = selectedCells[0].findAncestor('table');\n const { first, last } = tableUtils.getColumnIndexes(selectedCells);\n const headingColumnsToSet = this.value ? first : last + 1;\n model.change(writer => {\n if (headingColumnsToSet) {\n // Changing heading columns requires to check if any of a heading cell is overlapping horizontally the table head.\n // Any table cell that has a colspan attribute > 1 will not exceed the table head so we need to fix it in columns before.\n const overlappingCells = getHorizontallyOverlappingCells(table, headingColumnsToSet);\n for (const { cell, column } of overlappingCells) {\n splitVertically(cell, column, headingColumnsToSet, writer);\n }\n }\n updateNumericAttribute('headingColumns', headingColumnsToSet, table, writer, 0);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { global } from 'ckeditor5/src/utils.js';\nimport { COLUMN_WIDTH_PRECISION, COLUMN_MIN_WIDTH_AS_PERCENTAGE, COLUMN_MIN_WIDTH_IN_PIXELS } from './constants.js';\n/**\n * Returns all the inserted or changed table model elements in a given change set. Only the tables\n * with 'columnsWidth' attribute are taken into account. The returned set may be empty.\n *\n * Most notably if an entire table is removed it will not be included in returned set.\n *\n * @param model The model to collect the affected elements from.\n * @returns A set of table model elements.\n */\nexport function getChangedResizedTables(model) {\n const affectedTables = new Set();\n for (const change of model.document.differ.getChanges()) {\n let referencePosition = null;\n // Checks if the particular change from the differ is:\n // - an insertion or removal of a table, a row or a cell,\n // - an attribute change on a table, a row or a cell.\n switch (change.type) {\n case 'insert':\n referencePosition = ['table', 'tableRow', 'tableCell'].includes(change.name) ?\n change.position :\n null;\n break;\n case 'remove':\n // If the whole table is removed, there's no need to update its column widths (#12201).\n referencePosition = ['tableRow', 'tableCell'].includes(change.name) ?\n change.position :\n null;\n break;\n case 'attribute':\n if (change.range.start.nodeAfter) {\n referencePosition = ['table', 'tableRow', 'tableCell'].includes(change.range.start.nodeAfter.name) ?\n change.range.start :\n null;\n }\n break;\n }\n if (!referencePosition) {\n continue;\n }\n const tableNode = (referencePosition.nodeAfter && referencePosition.nodeAfter.is('element', 'table')) ?\n referencePosition.nodeAfter : referencePosition.findAncestor('table');\n // We iterate over the whole table looking for the nested tables that are also affected.\n for (const node of model.createRangeOn(tableNode).getItems()) {\n if (!node.is('element', 'table')) {\n continue;\n }\n if (!getColumnGroupElement(node)) {\n continue;\n }\n affectedTables.add(node);\n }\n }\n return affectedTables;\n}\n/**\n * Calculates the percentage of the minimum column width given in pixels for a given table.\n *\n * @param modelTable A table model element.\n * @param editor The editor instance.\n * @returns The minimal column width in percentage.\n */\nexport function getColumnMinWidthAsPercentage(modelTable, editor) {\n return COLUMN_MIN_WIDTH_IN_PIXELS * 100 / getTableWidthInPixels(modelTable, editor);\n}\n/**\n * Calculates the table width in pixels.\n *\n * @param modelTable A table model element.\n * @param editor The editor instance.\n * @returns The width of the table in pixels.\n */\nexport function getTableWidthInPixels(modelTable, editor) {\n // It is possible for a table to not have a <tbody> element - see #11878.\n const referenceElement = getChildrenViewElement(modelTable, 'tbody', editor) || getChildrenViewElement(modelTable, 'thead', editor);\n const domReferenceElement = editor.editing.view.domConverter.mapViewToDom(referenceElement);\n return getElementWidthInPixels(domReferenceElement);\n}\n/**\n * Returns the a view element with a given name that is nested directly in a `<table>` element\n * related to a given `modelTable`.\n *\n * @param elementName Name of a view to be looked for, e.g. `'colgroup`', `'thead`'.\n * @returns Matched view or `undefined` otherwise.\n */\nfunction getChildrenViewElement(modelTable, elementName, editor) {\n const viewFigure = editor.editing.mapper.toViewElement(modelTable);\n const viewTable = [...viewFigure.getChildren()]\n .find((node) => node.is('element', 'table'));\n return [...viewTable.getChildren()]\n .find((node) => node.is('element', elementName));\n}\n/**\n * Returns the computed width (in pixels) of the DOM element without padding and borders.\n *\n * @param domElement A DOM element.\n * @returns The width of the DOM element in pixels.\n */\nexport function getElementWidthInPixels(domElement) {\n const styles = global.window.getComputedStyle(domElement);\n // In the 'border-box' box sizing algorithm, the element's width\n // already includes the padding and border width (#12335).\n if (styles.boxSizing === 'border-box') {\n return parseFloat(styles.width) -\n parseFloat(styles.paddingLeft) -\n parseFloat(styles.paddingRight) -\n parseFloat(styles.borderLeftWidth) -\n parseFloat(styles.borderRightWidth);\n }\n else {\n return parseFloat(styles.width);\n }\n}\n/**\n * Returns the column indexes on the left and right edges of a cell. They differ if the cell spans\n * across multiple columns.\n *\n * @param cell A table cell model element.\n * @param tableUtils The Table Utils plugin instance.\n * @returns An object containing the indexes of the left and right edges of the cell.\n */\nexport function getColumnEdgesIndexes(cell, tableUtils) {\n const cellColumnIndex = tableUtils.getCellLocation(cell).column;\n const cellWidth = cell.getAttribute('colspan') || 1;\n return {\n leftEdge: cellColumnIndex,\n rightEdge: cellColumnIndex + cellWidth - 1\n };\n}\n/**\n * Rounds the provided value to a fixed-point number with defined number of digits after the decimal point.\n *\n * @param value A number to be rounded.\n * @returns The rounded number.\n */\nexport function toPrecision(value) {\n const multiplier = Math.pow(10, COLUMN_WIDTH_PRECISION);\n const number = typeof value === 'number' ? value : parseFloat(value);\n return Math.round(number * multiplier) / multiplier;\n}\n/**\n * Clamps the number within the inclusive lower (min) and upper (max) bounds. Returned number is rounded using the\n * {@link ~toPrecision `toPrecision()`} function.\n *\n * @param number A number to be clamped.\n * @param min A lower bound.\n * @param max An upper bound.\n * @returns The clamped number.\n */\nexport function clamp(number, min, max) {\n if (number <= min) {\n return toPrecision(min);\n }\n if (number >= max) {\n return toPrecision(max);\n }\n return toPrecision(number);\n}\n/**\n * Creates an array with defined length and fills all elements with defined value.\n *\n * @param length The length of the array.\n * @param value The value to fill the array with.\n * @returns An array with defined length and filled with defined value.\n */\nexport function createFilledArray(length, value) {\n return Array(length).fill(value);\n}\n/**\n * Sums all array values that can be parsed to a float.\n *\n * @param array An array of numbers.\n * @returns The sum of all array values.\n */\nexport function sumArray(array) {\n return array\n .map(value => typeof value === 'number' ? value : parseFloat(value))\n .filter(value => !Number.isNaN(value))\n .reduce((result, item) => result + item, 0);\n}\n/**\n * Makes sure that the sum of the widths from all columns is 100%. If the sum of all the widths is not equal 100%, all the widths are\n * changed proportionally so that they all sum back to 100%. If there are columns without specified width, the amount remaining\n * after assigning the known widths will be distributed equally between them.\n *\n * @param columnWidths An array of column widths.\n * @returns An array of column widths guaranteed to sum up to 100%.\n */\nexport function normalizeColumnWidths(columnWidths) {\n const widths = columnWidths.map(width => {\n if (width === 'auto') {\n return width;\n }\n return parseFloat(width.replace('%', ''));\n });\n let normalizedWidths = calculateMissingColumnWidths(widths);\n const totalWidth = sumArray(normalizedWidths);\n if (totalWidth !== 100) {\n normalizedWidths = normalizedWidths\n // Adjust all the columns proportionally.\n .map(width => toPrecision(width * 100 / totalWidth))\n // Due to rounding of numbers it may happen that the sum of the widths of all columns will not be exactly 100%.\n // Therefore, the width of the last column is explicitly adjusted (narrowed or expanded), since all the columns\n // have been proportionally changed already.\n .map((columnWidth, columnIndex, width) => {\n const isLastColumn = columnIndex === width.length - 1;\n if (!isLastColumn) {\n return columnWidth;\n }\n const totalWidth = sumArray(width);\n return toPrecision(columnWidth + 100 - totalWidth);\n });\n }\n return normalizedWidths.map(width => width + '%');\n}\n/**\n * Initializes the column widths by parsing the attribute value and calculating the uninitialized column widths. The special value 'auto'\n * indicates that width for the column must be calculated. The width of such uninitialized column is calculated as follows:\n * - If there is enough free space in the table for all uninitialized columns to have at least the minimum allowed width for all of them,\n * then set this width equally for all uninitialized columns.\n * - Otherwise, just set the minimum allowed width for all uninitialized columns. The sum of all column widths will be greater than 100%,\n * but then it will be adjusted proportionally to 100% in {@link #normalizeColumnWidths `normalizeColumnWidths()`}.\n *\n * @param columnWidths An array of column widths.\n * @returns An array with 'auto' values replaced with calculated widths.\n */\nfunction calculateMissingColumnWidths(columnWidths) {\n const numberOfUninitializedColumns = columnWidths.filter(columnWidth => columnWidth === 'auto').length;\n if (numberOfUninitializedColumns === 0) {\n return columnWidths.map(columnWidth => toPrecision(columnWidth));\n }\n const totalWidthOfInitializedColumns = sumArray(columnWidths);\n const widthForUninitializedColumn = Math.max((100 - totalWidthOfInitializedColumns) / numberOfUninitializedColumns, COLUMN_MIN_WIDTH_AS_PERCENTAGE);\n return columnWidths\n .map(columnWidth => columnWidth === 'auto' ? widthForUninitializedColumn : columnWidth)\n .map(columnWidth => toPrecision(columnWidth));\n}\n/**\n * Calculates the total horizontal space taken by the cell. That includes:\n * * width,\n * * left and red padding,\n * * border width.\n *\n * @param domCell A DOM cell element.\n * @returns Width in pixels without `px` at the end.\n */\nexport function getDomCellOuterWidth(domCell) {\n const styles = global.window.getComputedStyle(domCell);\n // In the 'border-box' box sizing algorithm, the element's width\n // already includes the padding and border width (#12335).\n if (styles.boxSizing === 'border-box') {\n return parseInt(styles.width);\n }\n else {\n return parseFloat(styles.width) +\n parseFloat(styles.paddingLeft) +\n parseFloat(styles.paddingRight) +\n parseFloat(styles.borderWidth);\n }\n}\n/**\n * Updates column elements to match columns widths.\n *\n * @param columns\n * @param tableColumnGroup\n * @param normalizedWidths\n * @param writer\n */\nexport function updateColumnElements(columns, tableColumnGroup, normalizedWidths, writer) {\n for (let i = 0; i < Math.max(normalizedWidths.length, columns.length); i++) {\n const column = columns[i];\n const columnWidth = normalizedWidths[i];\n if (!columnWidth) {\n // Number of `<tableColumn>` elements exceeds actual number of columns.\n writer.remove(column);\n }\n else if (!column) {\n // There is fewer `<tableColumn>` elements than actual columns.\n writer.appendElement('tableColumn', { columnWidth }, tableColumnGroup);\n }\n else {\n // Update column width.\n writer.setAttribute('columnWidth', columnWidth, column);\n }\n }\n}\n/**\n * Returns a 'tableColumnGroup' element from the 'table'.\n *\n * @internal\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns A 'tableColumnGroup' element.\n */\nexport function getColumnGroupElement(element) {\n if (element.is('element', 'tableColumnGroup')) {\n return element;\n }\n const children = element.getChildren();\n return Array\n .from(children)\n .find(element => element.is('element', 'tableColumnGroup'));\n}\n/**\n * Returns an array of 'tableColumn' elements. It may be empty if there's no `tableColumnGroup` element.\n *\n * @internal\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns An array of 'tableColumn' elements.\n */\nexport function getTableColumnElements(element) {\n const columnGroupElement = getColumnGroupElement(element);\n if (!columnGroupElement) {\n return [];\n }\n return Array.from(columnGroupElement.getChildren());\n}\n/**\n * Returns an array of table column widths.\n *\n * @internal\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns An array of table column widths.\n */\nexport function getTableColumnsWidths(element) {\n return getTableColumnElements(element).map(column => column.getAttribute('columnWidth'));\n}\n/**\n * Translates the `colSpan` model attribute into additional column widths and returns the resulting array.\n *\n * @internal\n * @param element A 'table' or 'tableColumnGroup' element.\n * @param writer A writer instance.\n * @returns An array of table column widths.\n */\nexport function translateColSpanAttribute(element, writer) {\n const tableColumnElements = getTableColumnElements(element);\n return tableColumnElements.reduce((acc, element) => {\n const columnWidth = element.getAttribute('columnWidth');\n const colSpan = element.getAttribute('colSpan');\n if (!colSpan) {\n acc.push(columnWidth);\n return acc;\n }\n // Translate the `colSpan` model attribute on to the proper number of column widths\n // and remove it from the element.\n // See https://github.com/ckeditor/ckeditor5/issues/14521#issuecomment-1662102889 for more details.\n for (let i = 0; i < colSpan; i++) {\n acc.push(columnWidth);\n }\n writer.removeAttribute('colSpan', element);\n return acc;\n }, []);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableutils\n */\nimport { CKEditorError } from 'ckeditor5/src/utils.js';\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport TableWalker from './tablewalker.js';\nimport { createEmptyTableCell, updateNumericAttribute } from './utils/common.js';\nimport { removeEmptyColumns, removeEmptyRows } from './utils/structure.js';\nimport { getTableColumnElements } from './tablecolumnresize/utils.js';\n/**\n * The table utilities plugin.\n */\nexport default class TableUtils extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableUtils';\n }\n /**\n * @inheritDoc\n */\n init() {\n this.decorate('insertColumns');\n this.decorate('insertRows');\n }\n /**\n * Returns the table cell location as an object with table row and table column indexes.\n *\n * For instance, in the table below:\n *\n * 0 1 2 3\n * +---+---+---+---+\n * 0 | a | b | c |\n * + + +---+\n * 1 | | | d |\n * +---+---+ +---+\n * 2 | e | | f |\n * +---+---+---+---+\n *\n * the method will return:\n *\n * ```ts\n * const cellA = table.getNodeByPath( [ 0, 0 ] );\n * editor.plugins.get( 'TableUtils' ).getCellLocation( cellA );\n * // will return { row: 0, column: 0 }\n *\n * const cellD = table.getNodeByPath( [ 1, 0 ] );\n * editor.plugins.get( 'TableUtils' ).getCellLocation( cellD );\n * // will return { row: 1, column: 3 }\n * ```\n *\n * @returns Returns a `{row, column}` object.\n */\n getCellLocation(tableCell) {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowIndex = table.getChildIndex(tableRow);\n const tableWalker = new TableWalker(table, { row: rowIndex });\n for (const { cell, row, column } of tableWalker) {\n if (cell === tableCell) {\n return { row, column };\n }\n }\n // Should be unreachable code.\n /* istanbul ignore next -- @preserve */\n return undefined;\n }\n /**\n * Creates an empty table with a proper structure. The table needs to be inserted into the model,\n * for example, by using the {@link module:engine/model/model~Model#insertContent} function.\n *\n * ```ts\n * model.change( ( writer ) => {\n * // Create a table of 2 rows and 7 columns:\n * const table = tableUtils.createTable( writer, { rows: 2, columns: 7 } );\n *\n * // Insert a table to the model at the best position taking the current selection:\n * model.insertContent( table );\n * }\n * ```\n *\n * @param writer The model writer.\n * @param options.rows The number of rows to create. Default value is 2.\n * @param options.columns The number of columns to create. Default value is 2.\n * @param options.headingRows The number of heading rows. Default value is 0.\n * @param options.headingColumns The number of heading columns. Default value is 0.\n * @returns The created table element.\n */\n createTable(writer, options) {\n const table = writer.createElement('table');\n const rows = options.rows || 2;\n const columns = options.columns || 2;\n createEmptyRows(writer, table, 0, rows, columns);\n if (options.headingRows) {\n updateNumericAttribute('headingRows', Math.min(options.headingRows, rows), table, writer, 0);\n }\n if (options.headingColumns) {\n updateNumericAttribute('headingColumns', Math.min(options.headingColumns, columns), table, writer, 0);\n }\n return table;\n }\n /**\n * Inserts rows into a table.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).insertRows( table, { at: 1, rows: 2 } );\n * ```\n *\n * Assuming the table on the left, the above code will transform it to the table on the right:\n *\n * row index\n * 0 +---+---+---+ `at` = 1, +---+---+---+ 0\n * | a | b | c | `rows` = 2, | a | b | c |\n * 1 + +---+---+ <-- insert here + +---+---+ 1\n * | | d | e | | | | |\n * 2 + +---+---+ will give: + +---+---+ 2\n * | | f | g | | | | |\n * 3 +---+---+---+ + +---+---+ 3\n * | | d | e |\n * + +---+---+ 4\n * + + f | g |\n * +---+---+---+ 5\n *\n * @param table The table model element where the rows will be inserted.\n * @param options.at The row index at which the rows will be inserted. Default value is 0.\n * @param options.rows The number of rows to insert. Default value is 1.\n * @param options.copyStructureFromAbove The flag for copying row structure. Note that\n * the row structure will not be copied if this option is not provided.\n */\n insertRows(table, options = {}) {\n const model = this.editor.model;\n const insertAt = options.at || 0;\n const rowsToInsert = options.rows || 1;\n const isCopyStructure = options.copyStructureFromAbove !== undefined;\n const copyStructureFrom = options.copyStructureFromAbove ? insertAt - 1 : insertAt;\n const rows = this.getRows(table);\n const columns = this.getColumns(table);\n if (insertAt > rows) {\n /**\n * The `options.at` points at a row position that does not exist.\n *\n * @error tableutils-insertrows-insert-out-of-range\n */\n throw new CKEditorError('tableutils-insertrows-insert-out-of-range', this, { options });\n }\n model.change(writer => {\n const headingRows = table.getAttribute('headingRows') || 0;\n // Inserting rows inside heading section requires to update `headingRows` attribute as the heading section will grow.\n if (headingRows > insertAt) {\n updateNumericAttribute('headingRows', headingRows + rowsToInsert, table, writer, 0);\n }\n // Inserting at the end or at the beginning of a table doesn't require to calculate anything special.\n if (!isCopyStructure && (insertAt === 0 || insertAt === rows)) {\n createEmptyRows(writer, table, insertAt, rowsToInsert, columns);\n return;\n }\n // Iterate over all the rows above the inserted rows in order to check for the row-spanned cells.\n const walkerEndRow = isCopyStructure ? Math.max(insertAt, copyStructureFrom) : insertAt;\n const tableIterator = new TableWalker(table, { endRow: walkerEndRow });\n // Store spans of the reference row to reproduce it's structure. This array is column number indexed.\n const rowColSpansMap = new Array(columns).fill(1);\n for (const { row, column, cellHeight, cellWidth, cell } of tableIterator) {\n const lastCellRow = row + cellHeight - 1;\n const isOverlappingInsertedRow = row < insertAt && insertAt <= lastCellRow;\n const isReferenceRow = row <= copyStructureFrom && copyStructureFrom <= lastCellRow;\n // If the cell is row-spanned and overlaps the inserted row, then reserve space for it in the row map.\n if (isOverlappingInsertedRow) {\n // This cell overlaps the inserted rows so we need to expand it further.\n writer.setAttribute('rowspan', cellHeight + rowsToInsert, cell);\n // Mark this cell with negative number to indicate how many cells should be skipped when adding the new cells.\n rowColSpansMap[column] = -cellWidth;\n }\n // Store the colspan from reference row.\n else if (isCopyStructure && isReferenceRow) {\n rowColSpansMap[column] = cellWidth;\n }\n }\n for (let rowIndex = 0; rowIndex < rowsToInsert; rowIndex++) {\n const tableRow = writer.createElement('tableRow');\n writer.insert(tableRow, table, insertAt);\n for (let cellIndex = 0; cellIndex < rowColSpansMap.length; cellIndex++) {\n const colspan = rowColSpansMap[cellIndex];\n const insertPosition = writer.createPositionAt(tableRow, 'end');\n // Insert the empty cell only if this slot is not row-spanned from any other cell.\n if (colspan > 0) {\n createEmptyTableCell(writer, insertPosition, colspan > 1 ? { colspan } : undefined);\n }\n // Skip the col-spanned slots, there won't be any cells.\n cellIndex += Math.abs(colspan) - 1;\n }\n }\n });\n }\n /**\n * Inserts columns into a table.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).insertColumns( table, { at: 1, columns: 2 } );\n * ```\n *\n * Assuming the table on the left, the above code will transform it to the table on the right:\n *\n * 0 1 2 3 0 1 2 3 4 5\n * +---+---+---+ +---+---+---+---+---+\n * | a | b | | a | b |\n * + +---+ + +---+\n * | | c | | | c |\n * +---+---+---+ will give: +---+---+---+---+---+\n * | d | e | f | | d | | | e | f |\n * +---+ +---+ +---+---+---+ +---+\n * | g | | h | | g | | | | h |\n * +---+---+---+ +---+---+---+---+---+\n * | i | | i |\n * +---+---+---+ +---+---+---+---+---+\n * ^---- insert here, `at` = 1, `columns` = 2\n *\n * @param table The table model element where the columns will be inserted.\n * @param options.at The column index at which the columns will be inserted. Default value is 0.\n * @param options.columns The number of columns to insert. Default value is 1.\n */\n insertColumns(table, options = {}) {\n const model = this.editor.model;\n const insertAt = options.at || 0;\n const columnsToInsert = options.columns || 1;\n model.change(writer => {\n const headingColumns = table.getAttribute('headingColumns');\n // Inserting columns inside heading section requires to update `headingColumns` attribute as the heading section will grow.\n if (insertAt < headingColumns) {\n writer.setAttribute('headingColumns', headingColumns + columnsToInsert, table);\n }\n const tableColumns = this.getColumns(table);\n // Inserting at the end and at the beginning of a table doesn't require to calculate anything special.\n if (insertAt === 0 || tableColumns === insertAt) {\n for (const tableRow of table.getChildren()) {\n // Ignore non-row elements inside the table (e.g. caption).\n if (!tableRow.is('element', 'tableRow')) {\n continue;\n }\n createCells(columnsToInsert, writer, writer.createPositionAt(tableRow, insertAt ? 'end' : 0));\n }\n return;\n }\n const tableWalker = new TableWalker(table, { column: insertAt, includeAllSlots: true });\n for (const tableSlot of tableWalker) {\n const { row, cell, cellAnchorColumn, cellAnchorRow, cellWidth, cellHeight } = tableSlot;\n // When iterating over column the table walker outputs either:\n // - cells at given column index (cell \"e\" from method docs),\n // - spanned columns (spanned cell from row between cells \"g\" and \"h\" - spanned by \"e\", only if `includeAllSlots: true`),\n // - or a cell from the same row which spans over this column (cell \"a\").\n if (cellAnchorColumn < insertAt) {\n // If cell is anchored in previous column, it is a cell that spans over an inserted column (cell \"a\" & \"i\").\n // For such cells expand them by a number of columns inserted.\n writer.setAttribute('colspan', cellWidth + columnsToInsert, cell);\n // This cell will overlap cells in rows below so skip them (because of `includeAllSlots` option) - (cell \"a\")\n const lastCellRow = cellAnchorRow + cellHeight - 1;\n for (let i = row; i <= lastCellRow; i++) {\n tableWalker.skipRow(i);\n }\n }\n else {\n // It's either cell at this column index or spanned cell by a row-spanned cell from row above.\n // In table above it's cell \"e\" and a spanned position from row below (empty cell between cells \"g\" and \"h\")\n createCells(columnsToInsert, writer, tableSlot.getPositionBefore());\n }\n }\n });\n }\n /**\n * Removes rows from the given `table`.\n *\n * This method re-calculates the table geometry including `rowspan` attribute of table cells overlapping removed rows\n * and table headings values.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).removeRows( table, { at: 1, rows: 2 } );\n * ```\n *\n * Executing the above code in the context of the table on the left will transform its structure as presented on the right:\n *\n * row index\n * ┌───┬───┬───┠`at` = 1 ┌───┬───┬───â”\n * 0 │ a │ b │ c │ `rows` = 2 │ a │ b │ c │ 0\n * │ ├───┼───┤ │ ├───┼───┤\n * 1 │ │ d │ e │ <-- remove from here │ │ d │ g │ 1\n * │ │ ├───┤ will give: ├───┼───┼───┤\n * 2 │ │ │ f │ │ h │ i │ j │ 2\n * │ │ ├───┤ └───┴───┴───┘\n * 3 │ │ │ g │\n * ├───┼───┼───┤\n * 4 │ h │ i │ j │\n * └───┴───┴───┘\n *\n * @param options.at The row index at which the removing rows will start.\n * @param options.rows The number of rows to remove. Default value is 1.\n */\n removeRows(table, options) {\n const model = this.editor.model;\n const rowsToRemove = options.rows || 1;\n const rowCount = this.getRows(table);\n const first = options.at;\n const last = first + rowsToRemove - 1;\n if (last > rowCount - 1) {\n /**\n * The `options.at` param must point at existing row and `options.rows` must not exceed the rows in the table.\n *\n * @error tableutils-removerows-row-index-out-of-range\n */\n throw new CKEditorError('tableutils-removerows-row-index-out-of-range', this, { table, options });\n }\n model.change(writer => {\n const indexesObject = { first, last };\n // Removing rows from the table require that most calculations to be done prior to changing table structure.\n // Preparations must be done in the same enqueueChange callback to use the current table structure.\n // 1. Preparation - get row-spanned cells that have to be modified after removing rows.\n const { cellsToMove, cellsToTrim } = getCellsToMoveAndTrimOnRemoveRow(table, indexesObject);\n // 2. Execution\n // 2a. Move cells from removed rows that extends over a removed section - must be done before removing rows.\n // This will fill any gaps in a rows below that previously were empty because of row-spanned cells.\n if (cellsToMove.size) {\n const rowAfterRemovedSection = last + 1;\n moveCellsToRow(table, rowAfterRemovedSection, cellsToMove, writer);\n }\n // 2b. Remove all required rows.\n for (let i = last; i >= first; i--) {\n writer.remove(table.getChild(i));\n }\n // 2c. Update cells from rows above that overlap removed section. Similar to step 2 but does not involve moving cells.\n for (const { rowspan, cell } of cellsToTrim) {\n updateNumericAttribute('rowspan', rowspan, cell, writer);\n }\n // 2d. Adjust heading rows if removed rows were in a heading section.\n updateHeadingRows(table, indexesObject, writer);\n // 2e. Remove empty columns (without anchored cells) if there are any.\n if (!removeEmptyColumns(table, this)) {\n // If there wasn't any empty columns then we still need to check if this wasn't called\n // because of cleaning empty rows and we only removed one of them.\n removeEmptyRows(table, this);\n }\n });\n }\n /**\n * Removes columns from the given `table`.\n *\n * This method re-calculates the table geometry including the `colspan` attribute of table cells overlapping removed columns\n * and table headings values.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).removeColumns( table, { at: 1, columns: 2 } );\n * ```\n *\n * Executing the above code in the context of the table on the left will transform its structure as presented on the right:\n *\n * 0 1 2 3 4 0 1 2\n * ┌───────────────┬───┠┌───────┬───â”\n * │ a │ b │ │ a │ b │\n * │ ├───┤ │ ├───┤\n * │ │ c │ │ │ c │\n * ├───┬───┬───┬───┼───┤ will give: ├───┬───┼───┤\n * │ d │ e │ f │ g │ h │ │ d │ g │ h │\n * ├───┼───┼───┤ ├───┤ ├───┤ ├───┤\n * │ i │ j │ k │ │ l │ │ i │ │ l │\n * ├───┴───┴───┴───┴───┤ ├───┴───┴───┤\n * │ m │ │ m │\n * └───────────────────┘ └───────────┘\n * ^---- remove from here, `at` = 1, `columns` = 2\n *\n * @param options.at The row index at which the removing columns will start.\n * @param options.columns The number of columns to remove.\n */\n removeColumns(table, options) {\n const model = this.editor.model;\n const first = options.at;\n const columnsToRemove = options.columns || 1;\n const last = options.at + columnsToRemove - 1;\n model.change(writer => {\n adjustHeadingColumns(table, { first, last }, writer);\n const tableColumns = getTableColumnElements(table);\n for (let removedColumnIndex = last; removedColumnIndex >= first; removedColumnIndex--) {\n for (const { cell, column, cellWidth } of [...new TableWalker(table)]) {\n // If colspaned cell overlaps removed column decrease its span.\n if (column <= removedColumnIndex && cellWidth > 1 && column + cellWidth > removedColumnIndex) {\n updateNumericAttribute('colspan', cellWidth - 1, cell, writer);\n }\n else if (column === removedColumnIndex) {\n // The cell in removed column has colspan of 1.\n writer.remove(cell);\n }\n }\n // If table has `tableColumn` elements, we need to update it manually.\n // See https://github.com/ckeditor/ckeditor5/issues/14521#issuecomment-1662102889 for details.\n if (tableColumns[removedColumnIndex]) {\n // If the removed column is the first one then we need to add its width to the next column.\n // Otherwise we add it to the previous column.\n const adjacentColumn = removedColumnIndex === 0 ? tableColumns[1] : tableColumns[removedColumnIndex - 1];\n const removedColumnWidth = parseFloat(tableColumns[removedColumnIndex].getAttribute('columnWidth'));\n const adjacentColumnWidth = parseFloat(adjacentColumn.getAttribute('columnWidth'));\n writer.remove(tableColumns[removedColumnIndex]);\n // Add the removed column width (in %) to the adjacent column.\n writer.setAttribute('columnWidth', removedColumnWidth + adjacentColumnWidth + '%', adjacentColumn);\n }\n }\n // Remove empty rows that could appear after removing columns.\n if (!removeEmptyRows(table, this)) {\n // If there wasn't any empty rows then we still need to check if this wasn't called\n // because of cleaning empty columns and we only removed one of them.\n removeEmptyColumns(table, this);\n }\n });\n }\n /**\n * Divides a table cell vertically into several ones.\n *\n * The cell will be visually split into more cells by updating colspans of other cells in a column\n * and inserting cells (columns) after that cell.\n *\n * In the table below, if cell \"a\" is split into 3 cells:\n *\n * +---+---+---+\n * | a | b | c |\n * +---+---+---+\n * | d | e | f |\n * +---+---+---+\n *\n * it will result in the table below:\n *\n * +---+---+---+---+---+\n * | a | | | b | c |\n * +---+---+---+---+---+\n * | d | e | f |\n * +---+---+---+---+---+\n *\n * So cell \"d\" will get its `colspan` updated to `3` and 2 cells will be added (2 columns will be created).\n *\n * Splitting a cell that already has a `colspan` attribute set will distribute the cell `colspan` evenly and the remainder\n * will be left to the original cell:\n *\n * +---+---+---+\n * | a |\n * +---+---+---+\n * | b | c | d |\n * +---+---+---+\n *\n * Splitting cell \"a\" with `colspan=3` into 2 cells will create 1 cell with a `colspan=a` and cell \"a\" that will have `colspan=2`:\n *\n * +---+---+---+\n * | a | |\n * +---+---+---+\n * | b | c | d |\n * +---+---+---+\n */\n splitCellVertically(tableCell, numberOfCells = 2) {\n const model = this.editor.model;\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const colspan = parseInt(tableCell.getAttribute('colspan') || '1');\n model.change(writer => {\n // First check - the cell spans over multiple rows so before doing anything else just split this cell.\n if (colspan > 1) {\n // Get spans of new (inserted) cells and span to update of split cell.\n const { newCellsSpan, updatedSpan } = breakSpanEvenly(colspan, numberOfCells);\n updateNumericAttribute('colspan', updatedSpan, tableCell, writer);\n // Each inserted cell will have the same attributes:\n const newCellsAttributes = {};\n // Do not store default value in the model.\n if (newCellsSpan > 1) {\n newCellsAttributes.colspan = newCellsSpan;\n }\n // Copy rowspan of split cell.\n if (rowspan > 1) {\n newCellsAttributes.rowspan = rowspan;\n }\n const cellsToInsert = colspan > numberOfCells ? numberOfCells - 1 : colspan - 1;\n createCells(cellsToInsert, writer, writer.createPositionAfter(tableCell), newCellsAttributes);\n }\n // Second check - the cell has colspan of 1 or we need to create more cells then the currently one spans over.\n if (colspan < numberOfCells) {\n const cellsToInsert = numberOfCells - colspan;\n // First step: expand cells on the same column as split cell.\n const tableMap = [...new TableWalker(table)];\n // Get the column index of split cell.\n const { column: splitCellColumn } = tableMap.find(({ cell }) => cell === tableCell);\n // Find cells which needs to be expanded vertically - those on the same column or those that spans over split cell's column.\n const cellsToUpdate = tableMap.filter(({ cell, cellWidth, column }) => {\n const isOnSameColumn = cell !== tableCell && column === splitCellColumn;\n const spansOverColumn = (column < splitCellColumn && column + cellWidth > splitCellColumn);\n return isOnSameColumn || spansOverColumn;\n });\n // Expand cells vertically.\n for (const { cell, cellWidth } of cellsToUpdate) {\n writer.setAttribute('colspan', cellWidth + cellsToInsert, cell);\n }\n // Second step: create columns after split cell.\n // Each inserted cell will have the same attributes:\n const newCellsAttributes = {};\n // Do not store default value in the model.\n // Copy rowspan of split cell.\n if (rowspan > 1) {\n newCellsAttributes.rowspan = rowspan;\n }\n createCells(cellsToInsert, writer, writer.createPositionAfter(tableCell), newCellsAttributes);\n const headingColumns = table.getAttribute('headingColumns') || 0;\n // Update heading section if split cell is in heading section.\n if (headingColumns > splitCellColumn) {\n updateNumericAttribute('headingColumns', headingColumns + cellsToInsert, table, writer);\n }\n }\n });\n }\n /**\n * Divides a table cell horizontally into several ones.\n *\n * The cell will be visually split into more cells by updating rowspans of other cells in the row and inserting rows with a single cell\n * below.\n *\n * If in the table below cell \"b\" is split into 3 cells:\n *\n * +---+---+---+\n * | a | b | c |\n * +---+---+---+\n * | d | e | f |\n * +---+---+---+\n *\n * It will result in the table below:\n *\n * +---+---+---+\n * | a | b | c |\n * + +---+ +\n * | | | |\n * + +---+ +\n * | | | |\n * +---+---+---+\n * | d | e | f |\n * +---+---+---+\n *\n * So cells \"a\" and \"b\" will get their `rowspan` updated to `3` and 2 rows with a single cell will be added.\n *\n * Splitting a cell that already has a `rowspan` attribute set will distribute the cell `rowspan` evenly and the remainder\n * will be left to the original cell:\n *\n * +---+---+---+\n * | a | b | c |\n * + +---+---+\n * | | d | e |\n * + +---+---+\n * | | f | g |\n * + +---+---+\n * | | h | i |\n * +---+---+---+\n *\n * Splitting cell \"a\" with `rowspan=4` into 3 cells will create 2 cells with a `rowspan=1` and cell \"a\" will have `rowspan=2`:\n *\n * +---+---+---+\n * | a | b | c |\n * + +---+---+\n * | | d | e |\n * +---+---+---+\n * | | f | g |\n * +---+---+---+\n * | | h | i |\n * +---+---+---+\n */\n splitCellHorizontally(tableCell, numberOfCells = 2) {\n const model = this.editor.model;\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const splitCellRow = table.getChildIndex(tableRow);\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const colspan = parseInt(tableCell.getAttribute('colspan') || '1');\n model.change(writer => {\n // First check - the cell spans over multiple rows so before doing anything else just split this cell.\n if (rowspan > 1) {\n // Cache table map before updating table.\n const tableMap = [...new TableWalker(table, {\n startRow: splitCellRow,\n endRow: splitCellRow + rowspan - 1,\n includeAllSlots: true\n })];\n // Get spans of new (inserted) cells and span to update of split cell.\n const { newCellsSpan, updatedSpan } = breakSpanEvenly(rowspan, numberOfCells);\n updateNumericAttribute('rowspan', updatedSpan, tableCell, writer);\n const { column: cellColumn } = tableMap.find(({ cell }) => cell === tableCell);\n // Each inserted cell will have the same attributes:\n const newCellsAttributes = {};\n // Do not store default value in the model.\n if (newCellsSpan > 1) {\n newCellsAttributes.rowspan = newCellsSpan;\n }\n // Copy colspan of split cell.\n if (colspan > 1) {\n newCellsAttributes.colspan = colspan;\n }\n // Accumulator that stores distance from the last inserted cell span.\n // It helps with evenly splitting larger cell spans (for example 10 cells collapsing into 3 cells).\n // We split these cells into 3, 3, 4 cells and we have to call `createCells` only when distance between\n // these cells is equal or greater than the new cells span size.\n let distanceFromLastCellSpan = 0;\n for (const tableSlot of tableMap) {\n const { column, row } = tableSlot;\n // As both newly created cells and the split cell might have rowspan,\n // the insertion of new cells must go to appropriate rows:\n //\n // 1. It's a row after split cell + it's height.\n const isAfterSplitCell = row >= splitCellRow + updatedSpan;\n // 2. Is on the same column.\n const isOnSameColumn = column === cellColumn;\n // Reset distance from the last cell span if we are on the same column and we exceeded the new cells span size.\n if (distanceFromLastCellSpan >= newCellsSpan && isOnSameColumn) {\n distanceFromLastCellSpan = 0;\n }\n if (isAfterSplitCell && isOnSameColumn) {\n // Create new cells only if the distance from the last cell span is equal or greater than the new cells span.\n if (!distanceFromLastCellSpan) {\n createCells(1, writer, tableSlot.getPositionBefore(), newCellsAttributes);\n }\n // Increase the distance from the last cell span.\n distanceFromLastCellSpan++;\n }\n }\n }\n // Second check - the cell has rowspan of 1 or we need to create more cells than the current cell spans over.\n if (rowspan < numberOfCells) {\n // We already split the cell in check one so here we split to the remaining number of cells only.\n const cellsToInsert = numberOfCells - rowspan;\n // This check is needed since we need to check if there are any cells from previous rows than spans over this cell's row.\n const tableMap = [...new TableWalker(table, { startRow: 0, endRow: splitCellRow })];\n // First step: expand cells.\n for (const { cell, cellHeight, row } of tableMap) {\n // Expand rowspan of cells that are either:\n // - on the same row as current cell,\n // - or are below split cell row and overlaps that row.\n if (cell !== tableCell && row + cellHeight > splitCellRow) {\n const rowspanToSet = cellHeight + cellsToInsert;\n writer.setAttribute('rowspan', rowspanToSet, cell);\n }\n }\n // Second step: create rows with single cell below split cell.\n const newCellsAttributes = {};\n // Copy colspan of split cell.\n if (colspan > 1) {\n newCellsAttributes.colspan = colspan;\n }\n createEmptyRows(writer, table, splitCellRow + 1, cellsToInsert, 1, newCellsAttributes);\n // Update heading section if split cell is in heading section.\n const headingRows = table.getAttribute('headingRows') || 0;\n if (headingRows > splitCellRow) {\n updateNumericAttribute('headingRows', headingRows + cellsToInsert, table, writer);\n }\n }\n });\n }\n /**\n * Returns the number of columns for a given table.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).getColumns( table );\n * ```\n *\n * @param table The table to analyze.\n */\n getColumns(table) {\n // Analyze first row only as all the rows should have the same width.\n // Using the first row without checking if it's a tableRow because we expect\n // that table will have only tableRow model elements at the beginning.\n const row = table.getChild(0);\n return [...row.getChildren()]\n // $marker elements can also be children of a row too (when TrackChanges is on). Don't include them in the count.\n .filter(node => node.is('element', 'tableCell'))\n .reduce((columns, row) => {\n const columnWidth = parseInt(row.getAttribute('colspan') || '1');\n return columns + columnWidth;\n }, 0);\n }\n /**\n * Returns the number of rows for a given table. Any other element present in the table model is omitted.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).getRows( table );\n * ```\n *\n * @param table The table to analyze.\n */\n getRows(table) {\n // Rowspan not included due to #6427.\n return Array.from(table.getChildren())\n .reduce((rowCount, child) => child.is('element', 'tableRow') ? rowCount + 1 : rowCount, 0);\n }\n /**\n * Creates an instance of the table walker.\n *\n * The table walker iterates internally by traversing the table from row index = 0 and column index = 0.\n * It walks row by row and column by column in order to output values defined in the options.\n * By default it will output only the locations that are occupied by a cell. To include also spanned rows and columns,\n * pass the `includeAllSlots` option.\n *\n * @internal\n * @param table A table over which the walker iterates.\n * @param options An object with configuration.\n */\n createTableWalker(table, options = {}) {\n return new TableWalker(table, options);\n }\n /**\n * Returns all model table cells that are fully selected (from the outside)\n * within the provided model selection's ranges.\n *\n * To obtain the cells selected from the inside, use\n * {@link #getTableCellsContainingSelection}.\n */\n getSelectedTableCells(selection) {\n const cells = [];\n for (const range of this.sortRanges(selection.getRanges())) {\n const element = range.getContainedElement();\n if (element && element.is('element', 'tableCell')) {\n cells.push(element);\n }\n }\n return cells;\n }\n /**\n * Returns all model table cells that the provided model selection's ranges\n * {@link module:engine/model/range~Range#start} inside.\n *\n * To obtain the cells selected from the outside, use\n * {@link #getSelectedTableCells}.\n */\n getTableCellsContainingSelection(selection) {\n const cells = [];\n for (const range of selection.getRanges()) {\n const cellWithSelection = range.start.findAncestor('tableCell');\n if (cellWithSelection) {\n cells.push(cellWithSelection);\n }\n }\n return cells;\n }\n /**\n * Returns all model table cells that are either completely selected\n * by selection ranges or host selection range\n * {@link module:engine/model/range~Range#start start positions} inside them.\n *\n * Combines {@link #getTableCellsContainingSelection} and\n * {@link #getSelectedTableCells}.\n */\n getSelectionAffectedTableCells(selection) {\n const selectedCells = this.getSelectedTableCells(selection);\n if (selectedCells.length) {\n return selectedCells;\n }\n return this.getTableCellsContainingSelection(selection);\n }\n /**\n * Returns an object with the `first` and `last` row index contained in the given `tableCells`.\n *\n * ```ts\n * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );\n *\n * const { first, last } = getRowIndexes( selectedTableCells );\n *\n * console.log( `Selected rows: ${ first } to ${ last }` );\n * ```\n *\n * @returns Returns an object with the `first` and `last` table row indexes.\n */\n getRowIndexes(tableCells) {\n const indexes = tableCells.map(cell => cell.parent.index);\n return this._getFirstLastIndexesObject(indexes);\n }\n /**\n * Returns an object with the `first` and `last` column index contained in the given `tableCells`.\n *\n * ```ts\n * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );\n *\n * const { first, last } = getColumnIndexes( selectedTableCells );\n *\n * console.log( `Selected columns: ${ first } to ${ last }` );\n * ```\n *\n * @returns Returns an object with the `first` and `last` table column indexes.\n */\n getColumnIndexes(tableCells) {\n const table = tableCells[0].findAncestor('table');\n const tableMap = [...new TableWalker(table)];\n const indexes = tableMap\n .filter(entry => tableCells.includes(entry.cell))\n .map(entry => entry.column);\n return this._getFirstLastIndexesObject(indexes);\n }\n /**\n * Checks if the selection contains cells that do not exceed rectangular selection.\n *\n * In a table below:\n *\n * ┌───┬───┬───┬───â”\n * │ a │ b │ c │ d │\n * ├───┴───┼───┤ │\n * │ e │ f │ │\n * │ ├───┼───┤\n * │ │ g │ h │\n * └───────┴───┴───┘\n *\n * Valid selections are these which create a solid rectangle (without gaps), such as:\n * - a, b (two horizontal cells)\n * - c, f (two vertical cells)\n * - a, b, e (cell \"e\" spans over four cells)\n * - c, d, f (cell d spans over a cell in the row below)\n *\n * While an invalid selection would be:\n * - a, c (the unselected cell \"b\" creates a gap)\n * - f, g, h (cell \"d\" spans over a cell from the row of \"f\" cell - thus creates a gap)\n */\n isSelectionRectangular(selectedTableCells) {\n if (selectedTableCells.length < 2 || !this._areCellInTheSameTableSection(selectedTableCells)) {\n return false;\n }\n // A valid selection is a fully occupied rectangle composed of table cells.\n // Below we will calculate the area of a selected table cells and the area of valid selection.\n // The area of a valid selection is defined by top-left and bottom-right cells.\n const rows = new Set();\n const columns = new Set();\n let areaOfSelectedCells = 0;\n for (const tableCell of selectedTableCells) {\n const { row, column } = this.getCellLocation(tableCell);\n const rowspan = parseInt(tableCell.getAttribute('rowspan')) || 1;\n const colspan = parseInt(tableCell.getAttribute('colspan')) || 1;\n // Record row & column indexes of current cell.\n rows.add(row);\n columns.add(column);\n // For cells that spans over multiple rows add also the last row that this cell spans over.\n if (rowspan > 1) {\n rows.add(row + rowspan - 1);\n }\n // For cells that spans over multiple columns add also the last column that this cell spans over.\n if (colspan > 1) {\n columns.add(column + colspan - 1);\n }\n areaOfSelectedCells += (rowspan * colspan);\n }\n // We can only merge table cells that are in adjacent rows...\n const areaOfValidSelection = getBiggestRectangleArea(rows, columns);\n return areaOfValidSelection == areaOfSelectedCells;\n }\n /**\n * Returns array of sorted ranges.\n */\n sortRanges(ranges) {\n return Array.from(ranges).sort(compareRangeOrder);\n }\n /**\n * Helper method to get an object with `first` and `last` indexes from an unsorted array of indexes.\n */\n _getFirstLastIndexesObject(indexes) {\n const allIndexesSorted = indexes.sort((indexA, indexB) => indexA - indexB);\n const first = allIndexesSorted[0];\n const last = allIndexesSorted[allIndexesSorted.length - 1];\n return { first, last };\n }\n /**\n * Checks if the selection does not mix a header (column or row) with other cells.\n *\n * For instance, in the table below valid selections consist of cells with the same letter only.\n * So, a-a (same heading row and column) or d-d (body cells) are valid while c-d or a-b are not.\n *\n * header columns\n * ↓ ↓\n * ┌───┬───┬───┬───â”\n * │ a │ a │ b │ b │ ↠header row\n * ├───┼───┼───┼───┤\n * │ c │ c │ d │ d │\n * ├───┼───┼───┼───┤\n * │ c │ c │ d │ d │\n * └───┴───┴───┴───┘\n */\n _areCellInTheSameTableSection(tableCells) {\n const table = tableCells[0].findAncestor('table');\n const rowIndexes = this.getRowIndexes(tableCells);\n const headingRows = parseInt(table.getAttribute('headingRows')) || 0;\n // Calculating row indexes is a bit cheaper so if this check fails we can't merge.\n if (!this._areIndexesInSameSection(rowIndexes, headingRows)) {\n return false;\n }\n const columnIndexes = this.getColumnIndexes(tableCells);\n const headingColumns = parseInt(table.getAttribute('headingColumns')) || 0;\n // Similarly cells must be in same column section.\n return this._areIndexesInSameSection(columnIndexes, headingColumns);\n }\n /**\n * Unified check if table rows/columns indexes are in the same heading/body section.\n */\n _areIndexesInSameSection({ first, last }, headingSectionSize) {\n const firstCellIsInHeading = first < headingSectionSize;\n const lastCellIsInHeading = last < headingSectionSize;\n return firstCellIsInHeading === lastCellIsInHeading;\n }\n}\n/**\n * Creates empty rows at the given index in an existing table.\n *\n * @param insertAt The row index of row insertion.\n * @param rows The number of rows to create.\n * @param tableCellToInsert The number of cells to insert in each row.\n */\nfunction createEmptyRows(writer, table, insertAt, rows, tableCellToInsert, attributes = {}) {\n for (let i = 0; i < rows; i++) {\n const tableRow = writer.createElement('tableRow');\n writer.insert(tableRow, table, insertAt);\n createCells(tableCellToInsert, writer, writer.createPositionAt(tableRow, 'end'), attributes);\n }\n}\n/**\n * Creates cells at a given position.\n *\n * @param cells The number of cells to create\n */\nfunction createCells(cells, writer, insertPosition, attributes = {}) {\n for (let i = 0; i < cells; i++) {\n createEmptyTableCell(writer, insertPosition, attributes);\n }\n}\n/**\n * Evenly distributes the span of a cell to a number of provided cells.\n * The resulting spans will always be integer values.\n *\n * For instance breaking a span of 7 into 3 cells will return:\n *\n * ```ts\n * { newCellsSpan: 2, updatedSpan: 3 }\n * ```\n *\n * as two cells will have a span of 2 and the remainder will go the first cell so its span will change to 3.\n *\n * @param span The span value do break.\n * @param numberOfCells The number of resulting spans.\n */\nfunction breakSpanEvenly(span, numberOfCells) {\n if (span < numberOfCells) {\n return { newCellsSpan: 1, updatedSpan: 1 };\n }\n const newCellsSpan = Math.floor(span / numberOfCells);\n const updatedSpan = (span - newCellsSpan * numberOfCells) + newCellsSpan;\n return { newCellsSpan, updatedSpan };\n}\n/**\n * Updates heading columns attribute if removing a row from head section.\n */\nfunction adjustHeadingColumns(table, removedColumnIndexes, writer) {\n const headingColumns = table.getAttribute('headingColumns') || 0;\n if (headingColumns && removedColumnIndexes.first < headingColumns) {\n const headingsRemoved = Math.min(headingColumns - 1 /* Other numbers are 0-based */, removedColumnIndexes.last) -\n removedColumnIndexes.first + 1;\n writer.setAttribute('headingColumns', headingColumns - headingsRemoved, table);\n }\n}\n/**\n * Calculates a new heading rows value for removing rows from heading section.\n */\nfunction updateHeadingRows(table, { first, last }, writer) {\n const headingRows = table.getAttribute('headingRows') || 0;\n if (first < headingRows) {\n const newRows = last < headingRows ? headingRows - (last - first + 1) : first;\n updateNumericAttribute('headingRows', newRows, table, writer, 0);\n }\n}\n/**\n * Finds cells that will be:\n * - trimmed - Cells that are \"above\" removed rows sections and overlap the removed section - their rowspan must be trimmed.\n * - moved - Cells from removed rows section might stick out of. These cells are moved to the next row after a removed section.\n *\n * Sample table with overlapping & sticking out cells:\n *\n * +----+----+----+----+----+\n * | 00 | 01 | 02 | 03 | 04 |\n * +----+ + + + +\n * | 10 | | | | |\n * +----+----+ + + +\n * | 20 | 21 | | | | <-- removed row\n * + + +----+ + +\n * | | | 32 | | | <-- removed row\n * +----+ + +----+ +\n * | 40 | | | 43 | |\n * +----+----+----+----+----+\n *\n * In a table above:\n * - cells to trim: '02', '03' & '04'.\n * - cells to move: '21' & '32'.\n */\nfunction getCellsToMoveAndTrimOnRemoveRow(table, { first, last }) {\n const cellsToMove = new Map();\n const cellsToTrim = [];\n for (const { row, column, cellHeight, cell } of new TableWalker(table, { endRow: last })) {\n const lastRowOfCell = row + cellHeight - 1;\n const isCellStickingOutFromRemovedRows = row >= first && row <= last && lastRowOfCell > last;\n if (isCellStickingOutFromRemovedRows) {\n const rowspanInRemovedSection = last - row + 1;\n const rowSpanToSet = cellHeight - rowspanInRemovedSection;\n cellsToMove.set(column, {\n cell,\n rowspan: rowSpanToSet\n });\n }\n const isCellOverlappingRemovedRows = row < first && lastRowOfCell >= first;\n if (isCellOverlappingRemovedRows) {\n let rowspanAdjustment;\n // Cell fully covers removed section - trim it by removed rows count.\n if (lastRowOfCell >= last) {\n rowspanAdjustment = last - first + 1;\n }\n // Cell partially overlaps removed section - calculate cell's span that is in removed section.\n else {\n rowspanAdjustment = lastRowOfCell - first + 1;\n }\n cellsToTrim.push({\n cell,\n rowspan: cellHeight - rowspanAdjustment\n });\n }\n }\n return { cellsToMove, cellsToTrim };\n}\nfunction moveCellsToRow(table, targetRowIndex, cellsToMove, writer) {\n const tableWalker = new TableWalker(table, {\n includeAllSlots: true,\n row: targetRowIndex\n });\n const tableRowMap = [...tableWalker];\n const row = table.getChild(targetRowIndex);\n let previousCell;\n for (const { column, cell, isAnchor } of tableRowMap) {\n if (cellsToMove.has(column)) {\n const { cell: cellToMove, rowspan } = cellsToMove.get(column);\n const targetPosition = previousCell ?\n writer.createPositionAfter(previousCell) :\n writer.createPositionAt(row, 0);\n writer.move(writer.createRangeOn(cellToMove), targetPosition);\n updateNumericAttribute('rowspan', rowspan, cellToMove, writer);\n previousCell = cellToMove;\n }\n else if (isAnchor) {\n // If cell is spanned then `cell` holds reference to overlapping cell. See ckeditor/ckeditor5#6502.\n previousCell = cell;\n }\n }\n}\nfunction compareRangeOrder(rangeA, rangeB) {\n // Since table cell ranges are disjoint, it's enough to check their start positions.\n const posA = rangeA.start;\n const posB = rangeB.start;\n // Checking for equal position (returning 0) is not needed because this would be either:\n // a. Intersecting range (not allowed by model)\n // b. Collapsed range on the same position (allowed by model but should not happen).\n return posA.isBefore(posB) ? -1 : 1;\n}\n/**\n * Calculates the area of a maximum rectangle that can span over the provided row & column indexes.\n */\nfunction getBiggestRectangleArea(rows, columns) {\n const rowsIndexes = Array.from(rows.values());\n const columnIndexes = Array.from(columns.values());\n const lastRow = Math.max(...rowsIndexes);\n const firstRow = Math.min(...rowsIndexes);\n const lastColumn = Math.max(...columnIndexes);\n const firstColumn = Math.min(...columnIndexes);\n return (lastRow - firstRow + 1) * (lastColumn - firstColumn + 1);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport TableUtils from '../tableutils.js';\nimport { updateNumericAttribute } from '../utils/common.js';\nimport { removeEmptyRowsColumns } from '../utils/structure.js';\n/**\n * The merge cells command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.\n *\n * For example, to merge selected table cells:\n *\n * ```ts\n * editor.execute( 'mergeTableCells' );\n * ```\n */\nexport default class MergeCellsCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const selectedTableCells = tableUtils.getSelectedTableCells(this.editor.model.document.selection);\n this.isEnabled = tableUtils.isSelectionRectangular(selectedTableCells);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n */\n execute() {\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get(TableUtils);\n model.change(writer => {\n const selectedTableCells = tableUtils.getSelectedTableCells(model.document.selection);\n // All cells will be merged into the first one.\n const firstTableCell = selectedTableCells.shift();\n // Update target cell dimensions.\n const { mergeWidth, mergeHeight } = getMergeDimensions(firstTableCell, selectedTableCells, tableUtils);\n updateNumericAttribute('colspan', mergeWidth, firstTableCell, writer);\n updateNumericAttribute('rowspan', mergeHeight, firstTableCell, writer);\n for (const tableCell of selectedTableCells) {\n mergeTableCells(tableCell, firstTableCell, writer);\n }\n const table = firstTableCell.findAncestor('table');\n // Remove rows and columns that become empty (have no anchored cells).\n removeEmptyRowsColumns(table, tableUtils);\n writer.setSelection(firstTableCell, 'in');\n });\n }\n}\n/**\n * Merges two table cells. It will ensure that after merging cells with empty paragraphs the resulting table cell will only have one\n * paragraph. If one of the merged table cells is empty, the merged table cell will have contents of the non-empty table cell.\n * If both are empty, the merged table cell will have only one empty paragraph.\n */\nfunction mergeTableCells(cellBeingMerged, targetCell, writer) {\n if (!isEmpty(cellBeingMerged)) {\n if (isEmpty(targetCell)) {\n writer.remove(writer.createRangeIn(targetCell));\n }\n writer.move(writer.createRangeIn(cellBeingMerged), writer.createPositionAt(targetCell, 'end'));\n }\n // Remove merged table cell.\n writer.remove(cellBeingMerged);\n}\n/**\n * Checks if the passed table cell contains an empty paragraph.\n */\nfunction isEmpty(tableCell) {\n const firstTableChild = tableCell.getChild(0);\n return tableCell.childCount == 1 && firstTableChild.is('element', 'paragraph') && firstTableChild.isEmpty;\n}\nfunction getMergeDimensions(firstTableCell, selectedTableCells, tableUtils) {\n let maxWidthOffset = 0;\n let maxHeightOffset = 0;\n for (const tableCell of selectedTableCells) {\n const { row, column } = tableUtils.getCellLocation(tableCell);\n maxWidthOffset = getMaxOffset(tableCell, column, maxWidthOffset, 'colspan');\n maxHeightOffset = getMaxOffset(tableCell, row, maxHeightOffset, 'rowspan');\n }\n // Update table cell span attribute and merge set selection on a merged contents.\n const { row: firstCellRow, column: firstCellColumn } = tableUtils.getCellLocation(firstTableCell);\n const mergeWidth = maxWidthOffset - firstCellColumn;\n const mergeHeight = maxHeightOffset - firstCellRow;\n return { mergeWidth, mergeHeight };\n}\nfunction getMaxOffset(tableCell, start, currentMaxOffset, which) {\n const dimensionValue = parseInt(tableCell.getAttribute(which) || '1');\n return Math.max(currentMaxOffset, start + dimensionValue);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/selectrowcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The select row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.\n *\n * To select the rows containing the selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'selectTableRow' );\n * ```\n */\nexport default class SelectRowCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // It does not affect data so should be enabled in read-only mode.\n this.affectsData = false;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n this.isEnabled = selectedCells.length > 0;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const referenceCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const rowIndexes = tableUtils.getRowIndexes(referenceCells);\n const table = referenceCells[0].findAncestor('table');\n const rangesToSelect = [];\n for (let rowIndex = rowIndexes.first; rowIndex <= rowIndexes.last; rowIndex++) {\n for (const cell of table.getChild(rowIndex).getChildren()) {\n rangesToSelect.push(model.createRangeOn(cell));\n }\n }\n model.change(writer => {\n writer.setSelection(rangesToSelect);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/selectcolumncommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport TableWalker from '../tablewalker.js';\n/**\n * The select column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.\n *\n * To select the columns containing the selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'selectTableColumn' );\n * ```\n */\nexport default class SelectColumnCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // It does not affect data so should be enabled in read-only mode.\n this.affectsData = false;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n this.isEnabled = selectedCells.length > 0;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const model = this.editor.model;\n const referenceCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const firstCell = referenceCells[0];\n const lastCell = referenceCells.pop();\n const table = firstCell.findAncestor('table');\n const startLocation = tableUtils.getCellLocation(firstCell);\n const endLocation = tableUtils.getCellLocation(lastCell);\n const startColumn = Math.min(startLocation.column, endLocation.column);\n const endColumn = Math.max(startLocation.column, endLocation.column);\n const rangesToSelect = [];\n for (const cellInfo of new TableWalker(table, { startColumn, endColumn })) {\n rangesToSelect.push(model.createRangeOn(cellInfo.cell));\n }\n model.change(writer => {\n writer.setSelection(rangesToSelect);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableWalker from './../tablewalker.js';\nimport { createEmptyTableCell, updateNumericAttribute } from '../utils/common.js';\n/**\n * Injects a table layout post-fixer into the model.\n *\n * The role of the table layout post-fixer is to ensure that the table rows have the correct structure\n * after a {@link module:engine/model/model~Model#change `change()`} block was executed.\n *\n * The correct structure means that:\n *\n * * All table rows have the same size.\n * * None of the table cells extend vertically beyond their section (either header or body).\n * * A table cell has always at least one element as a child.\n *\n * If the table structure is not correct, the post-fixer will automatically correct it in two steps:\n *\n * 1. It will clip table cells that extend beyond their section.\n * 2. It will add empty table cells to the rows that are narrower than the widest table row.\n *\n * ## Clipping overlapping table cells\n *\n * Such situation may occur when pasting a table (or a part of a table) to the editor from external sources.\n *\n * For example, see the following table which has a cell (FOO) with the rowspan attribute (2):\n *\n * ```xml\n * <table headingRows=\"1\">\n * <tableRow>\n * <tableCell rowspan=\"2\"><paragraph>FOO</paragraph></tableCell>\n * <tableCell colspan=\"2\"><paragraph>BAR</paragraph></tableCell>\n * </tableRow>\n * <tableRow>\n * <tableCell><paragraph>BAZ</paragraph></tableCell>\n * <tableCell><paragraph>XYZ</paragraph></tableCell>\n * </tableRow>\n * </table>\n * ```\n *\n * It will be rendered in the view as:\n *\n * ```xml\n * <table>\n * <thead>\n * <tr>\n * <td rowspan=\"2\">FOO</td>\n * <td colspan=\"2\">BAR</td>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>BAZ</td>\n * <td>XYZ</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * In the above example the table will be rendered as a table with two rows: one in the header and second one in the body.\n * The table cell (FOO) cannot span over multiple rows as it would extend from the header to the body section.\n * The `rowspan` attribute must be changed to (1). The value (1) is the default value of the `rowspan` attribute\n * so the `rowspan` attribute will be removed from the model.\n *\n * The table cell with BAZ in the content will be in the first column of the table.\n *\n * ## Adding missing table cells\n *\n * The table post-fixer will insert empty table cells to equalize table row sizes (the number of columns).\n * The size of a table row is calculated by counting column spans of table cells, both horizontal (from the same row) and\n * vertical (from the rows above).\n *\n * In the above example, the table row in the body section of the table is narrower then the row from the header: it has two cells\n * with the default colspan (1). The header row has one cell with colspan (1) and the second with colspan (2).\n * The table cell (FOO) does not extend beyond the head section (and as such will be fixed in the first step of this post-fixer).\n * The post-fixer will add a missing table cell to the row in the body section of the table.\n *\n * The table from the above example will be fixed and rendered to the view as below:\n *\n * ```xml\n * <table>\n * <thead>\n * <tr>\n * <td rowspan=\"2\">FOO</td>\n * <td colspan=\"2\">BAR</td>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>BAZ</td>\n * <td>XYZ</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * ## Collaboration and undo - Expectations vs post-fixer results\n *\n * The table post-fixer only ensures proper structure without a deeper analysis of the nature of the change. As such, it might lead\n * to a structure which was not intended by the user. In particular, it will also fix undo steps (in conjunction with collaboration)\n * in which the editor content might not return to the original state.\n *\n * This will usually happen when one or more users change the size of the table.\n *\n * As an example see the table below:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * and the user actions:\n *\n * 1. Both users have a table with two rows and two columns.\n * 2. User A adds a column at the end of the table. This will insert empty table cells to two rows.\n * 3. User B adds a row at the end of the table. This will insert a row with two empty table cells.\n * 4. Both users will have a table as below:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * <td>(empty, inserted by A)</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * <td>(empty, inserted by A)</td>\n * </tr>\n * <tr>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by B)</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * The last row is shorter then others so the table post-fixer will add an empty row to the last row:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * <td>(empty, inserted by A)</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * <td>(empty, inserted by A)</td>\n * </tr>\n * <tr>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by the post-fixer)</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * Unfortunately undo does not know the nature of the changes and depending on which user applies the post-fixer changes, undoing them\n * might lead to a broken table. If User B undoes inserting the column to the table, the undo engine will undo only the operations of\n * inserting empty cells to rows from the initial table state (row 1 and 2) but the cell in the post-fixed row will remain:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * </tr>\n * <tr>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by a post-fixer)</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * After undo, the table post-fixer will detect that two rows are shorter than others and will fix the table to:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * <td>(empty, inserted by a post-fixer after undo)</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * <td>(empty, inserted by a post-fixer after undo)</td>\n * </tr>\n * <tr>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by a post-fixer)</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n */\nexport default function injectTableLayoutPostFixer(model) {\n model.document.registerPostFixer(writer => tableLayoutPostFixer(writer, model));\n}\n/**\n * The table layout post-fixer.\n */\nfunction tableLayoutPostFixer(writer, model) {\n const changes = model.document.differ.getChanges();\n let wasFixed = false;\n // Do not analyze the same table more then once - may happen for multiple changes in the same table.\n const analyzedTables = new Set();\n for (const entry of changes) {\n let table = null;\n if (entry.type == 'insert' && entry.name == 'table') {\n table = entry.position.nodeAfter;\n }\n // Fix table on adding/removing table cells and rows.\n if ((entry.type == 'insert' || entry.type == 'remove') && (entry.name == 'tableRow' || entry.name == 'tableCell')) {\n table = entry.position.findAncestor('table');\n }\n // Fix table on any table's attribute change - including attributes of table cells.\n if (isTableAttributeEntry(entry)) {\n table = entry.range.start.findAncestor('table');\n }\n if (table && !analyzedTables.has(table)) {\n // Step 1: correct rowspans of table cells if necessary.\n // The wasFixed flag should be true if any of tables in batch was fixed - might be more then one.\n wasFixed = fixTableCellsRowspan(table, writer) || wasFixed;\n // Step 2: fix table rows sizes.\n wasFixed = fixTableRowsSizes(table, writer) || wasFixed;\n analyzedTables.add(table);\n }\n }\n return wasFixed;\n}\n/**\n * Fixes the invalid value of the `rowspan` attribute because a table cell cannot vertically extend beyond the table section it belongs to.\n *\n * @returns Returns `true` if the table was fixed.\n */\nfunction fixTableCellsRowspan(table, writer) {\n let wasFixed = false;\n const cellsToTrim = findCellsToTrim(table);\n if (cellsToTrim.length) {\n // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: trimming cells row-spans (${ cellsToTrim.length }).` );\n wasFixed = true;\n for (const data of cellsToTrim) {\n updateNumericAttribute('rowspan', data.rowspan, data.cell, writer, 1);\n }\n }\n return wasFixed;\n}\n/**\n * Makes all table rows in a table the same size.\n *\n * @returns Returns `true` if the table was fixed.\n */\nfunction fixTableRowsSizes(table, writer) {\n let wasFixed = false;\n const childrenLengths = getChildrenLengths(table);\n const rowsToRemove = [];\n // Find empty rows.\n for (const [rowIndex, size] of childrenLengths.entries()) {\n // Ignore all non-row models.\n if (!size && table.getChild(rowIndex).is('element', 'tableRow')) {\n rowsToRemove.push(rowIndex);\n }\n }\n // Remove empty rows.\n if (rowsToRemove.length) {\n // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: remove empty rows (${ rowsToRemove.length }).` );\n wasFixed = true;\n for (const rowIndex of rowsToRemove.reverse()) {\n writer.remove(table.getChild(rowIndex));\n childrenLengths.splice(rowIndex, 1);\n }\n }\n // Filter out everything that's not a table row.\n const rowsLengths = childrenLengths.filter((row, rowIndex) => table.getChild(rowIndex).is('element', 'tableRow'));\n // Verify if all the rows have the same number of columns.\n const tableSize = rowsLengths[0];\n const isValid = rowsLengths.every(length => length === tableSize);\n if (!isValid) {\n // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: adding missing cells.' );\n // Find the maximum number of columns.\n const maxColumns = rowsLengths.reduce((prev, current) => current > prev ? current : prev, 0);\n for (const [rowIndex, size] of rowsLengths.entries()) {\n const columnsToInsert = maxColumns - size;\n if (columnsToInsert) {\n for (let i = 0; i < columnsToInsert; i++) {\n createEmptyTableCell(writer, writer.createPositionAt(table.getChild(rowIndex), 'end'));\n }\n wasFixed = true;\n }\n }\n }\n return wasFixed;\n}\n/**\n * Searches for table cells that extend beyond the table section to which they belong to. It will return an array of objects\n * that stores table cells to be trimmed and the correct value of the `rowspan` attribute to set.\n */\nfunction findCellsToTrim(table) {\n const headingRows = parseInt(table.getAttribute('headingRows') || '0');\n const maxRows = Array.from(table.getChildren())\n .reduce((count, row) => row.is('element', 'tableRow') ? count + 1 : count, 0);\n const cellsToTrim = [];\n for (const { row, cell, cellHeight } of new TableWalker(table)) {\n // Skip cells that do not expand over its row.\n if (cellHeight < 2) {\n continue;\n }\n const isInHeader = row < headingRows;\n // Row limit is either end of header section or whole table as table body is after the header.\n const rowLimit = isInHeader ? headingRows : maxRows;\n // If table cell expands over its limit reduce it height to proper value.\n if (row + cellHeight > rowLimit) {\n const newRowspan = rowLimit - row;\n cellsToTrim.push({ cell, rowspan: newRowspan });\n }\n }\n return cellsToTrim;\n}\n/**\n * Returns an array with lengths of rows assigned to the corresponding row index.\n */\nfunction getChildrenLengths(table) {\n // TableWalker will not provide items for the empty rows, we need to pre-fill this array.\n const lengths = new Array(table.childCount).fill(0);\n for (const { rowIndex } of new TableWalker(table, { includeAllSlots: true })) {\n lengths[rowIndex]++;\n }\n return lengths;\n}\n/**\n * Checks if the differ entry for an attribute change is one of the table's attributes.\n */\nfunction isTableAttributeEntry(entry) {\n if (entry.type !== 'attribute') {\n return false;\n }\n const key = entry.attributeKey;\n return key === 'headingRows' || key === 'colspan' || key === 'rowspan';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Injects a table cell post-fixer into the model which inserts a `paragraph` element into empty table cells.\n *\n * A table cell must contain at least one block element as a child. An empty table cell will have an empty `paragraph` as a child.\n *\n * ```xml\n * <table>\n * <tableRow>\n * <tableCell></tableCell>\n * </tableRow>\n * </table>\n * ```\n *\n * Will be fixed to:\n *\n * ```xml\n * <table>\n * <tableRow>\n * <tableCell><paragraph></paragraph></tableCell>\n * </tableRow>\n * </table>\n * ```\n */\nexport default function injectTableCellParagraphPostFixer(model) {\n model.document.registerPostFixer(writer => tableCellContentsPostFixer(writer, model));\n}\n/**\n * The table cell contents post-fixer.\n */\nfunction tableCellContentsPostFixer(writer, model) {\n const changes = model.document.differ.getChanges();\n let wasFixed = false;\n for (const entry of changes) {\n if (entry.type == 'insert' && entry.name == 'table') {\n wasFixed = fixTable(entry.position.nodeAfter, writer) || wasFixed;\n }\n if (entry.type == 'insert' && entry.name == 'tableRow') {\n wasFixed = fixTableRow(entry.position.nodeAfter, writer) || wasFixed;\n }\n if (entry.type == 'insert' && entry.name == 'tableCell') {\n wasFixed = fixTableCellContent(entry.position.nodeAfter, writer) || wasFixed;\n }\n if ((entry.type == 'remove' || entry.type == 'insert') && checkTableCellChange(entry)) {\n wasFixed = fixTableCellContent(entry.position.parent, writer) || wasFixed;\n }\n }\n return wasFixed;\n}\n/**\n * Fixes all table cells in a table.\n */\nfunction fixTable(table, writer) {\n let wasFixed = false;\n for (const row of table.getChildren()) {\n if (row.is('element', 'tableRow')) {\n wasFixed = fixTableRow(row, writer) || wasFixed;\n }\n }\n return wasFixed;\n}\n/**\n * Fixes all table cells in a table row.\n */\nfunction fixTableRow(tableRow, writer) {\n let wasFixed = false;\n for (const tableCell of tableRow.getChildren()) {\n wasFixed = fixTableCellContent(tableCell, writer) || wasFixed;\n }\n return wasFixed;\n}\n/**\n * Fixes all table cell content by:\n * - Adding a paragraph to a table cell without any child.\n * - Wrapping direct $text in a `<paragraph>`.\n */\nfunction fixTableCellContent(tableCell, writer) {\n // Insert paragraph to an empty table cell.\n if (tableCell.childCount == 0) {\n // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: insert paragraph in empty cell.' );\n writer.insertElement('paragraph', tableCell);\n return true;\n }\n // Check table cell children for directly placed text nodes.\n // Temporary solution. See https://github.com/ckeditor/ckeditor5/issues/1464.\n const textNodes = Array.from(tableCell.getChildren()).filter(child => child.is('$text'));\n // @if CK_DEBUG_TABLE // textNodes.length && console.log( 'Post-fixing table: wrap cell content with paragraph.' );\n for (const child of textNodes) {\n writer.wrap(writer.createRangeOn(child), 'paragraph');\n }\n // Return true when there were text nodes to fix.\n return !!textNodes.length;\n}\n/**\n * Checks if a differ change should fix the table cell. This happens on:\n * - Removing content from the table cell (i.e. `tableCell` can be left empty).\n * - Adding a text node directly into a table cell.\n */\nfunction checkTableCellChange(entry) {\n if (!entry.position.parent.is('element', 'tableCell')) {\n return false;\n }\n return entry.type == 'insert' && entry.name == '$text' || entry.type == 'remove';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isSingleParagraphWithoutAttributes } from './downcast.js';\n/**\n * A table cell refresh handler which marks the table cell in the differ to have it re-rendered.\n *\n * Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block\n * element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.\n *\n * When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is\n * re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.\n */\nexport default function tableCellRefreshHandler(model, editing) {\n const differ = model.document.differ;\n // Stores cells to be refreshed, so the table cell will be refreshed once for multiple changes.\n const cellsToCheck = new Set();\n for (const change of differ.getChanges()) {\n const parent = change.type == 'attribute' ? change.range.start.parent : change.position.parent;\n if (parent.is('element', 'tableCell')) {\n cellsToCheck.add(parent);\n }\n }\n for (const tableCell of cellsToCheck.values()) {\n const paragraphsToRefresh = Array.from(tableCell.getChildren())\n .filter(child => shouldRefresh(child, editing.mapper));\n for (const paragraph of paragraphsToRefresh) {\n editing.reconvertItem(paragraph);\n }\n }\n}\n/**\n * Check if given model element needs refreshing.\n */\nfunction shouldRefresh(child, mapper) {\n if (!child.is('element', 'paragraph')) {\n return false;\n }\n const viewElement = mapper.toViewElement(child);\n if (!viewElement) {\n return false;\n }\n return isSingleParagraphWithoutAttributes(child) !== viewElement.is('element', 'span');\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableediting.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableediting.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport upcastTable, { ensureParagraphInTableCell, skipEmptyTableRow, upcastTableFigure } from './converters/upcasttable.js';\nimport { convertParagraphInTableCell, downcastCell, downcastRow, downcastTable } from './converters/downcast.js';\nimport InsertTableCommand from './commands/inserttablecommand.js';\nimport InsertRowCommand from './commands/insertrowcommand.js';\nimport InsertColumnCommand from './commands/insertcolumncommand.js';\nimport SplitCellCommand from './commands/splitcellcommand.js';\nimport MergeCellCommand from './commands/mergecellcommand.js';\nimport RemoveRowCommand from './commands/removerowcommand.js';\nimport RemoveColumnCommand from './commands/removecolumncommand.js';\nimport SetHeaderRowCommand from './commands/setheaderrowcommand.js';\nimport SetHeaderColumnCommand from './commands/setheadercolumncommand.js';\nimport MergeCellsCommand from './commands/mergecellscommand.js';\nimport SelectRowCommand from './commands/selectrowcommand.js';\nimport SelectColumnCommand from './commands/selectcolumncommand.js';\nimport TableUtils from '../src/tableutils.js';\nimport injectTableLayoutPostFixer from './converters/table-layout-post-fixer.js';\nimport injectTableCellParagraphPostFixer from './converters/table-cell-paragraph-post-fixer.js';\nimport tableHeadingsRefreshHandler from './converters/table-headings-refresh-handler.js';\nimport tableCellRefreshHandler from './converters/table-cell-refresh-handler.js';\nimport '../theme/tableediting.css';\n/**\n * The table editing feature.\n */\nexport default class TableEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableUtils];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._additionalSlots = [];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const schema = model.schema;\n const conversion = editor.conversion;\n const tableUtils = editor.plugins.get(TableUtils);\n schema.register('table', {\n inheritAllFrom: '$blockObject',\n allowAttributes: ['headingRows', 'headingColumns']\n });\n schema.register('tableRow', {\n allowIn: 'table',\n isLimit: true\n });\n schema.register('tableCell', {\n allowContentOf: '$container',\n allowIn: 'tableRow',\n allowAttributes: ['colspan', 'rowspan'],\n isLimit: true,\n isSelectable: true\n });\n // Figure conversion.\n conversion.for('upcast').add(upcastTableFigure());\n // Table conversion.\n conversion.for('upcast').add(upcastTable());\n conversion.for('editingDowncast').elementToStructure({\n model: {\n name: 'table',\n attributes: ['headingRows']\n },\n view: downcastTable(tableUtils, {\n asWidget: true,\n additionalSlots: this._additionalSlots\n })\n });\n conversion.for('dataDowncast').elementToStructure({\n model: {\n name: 'table',\n attributes: ['headingRows']\n },\n view: downcastTable(tableUtils, {\n additionalSlots: this._additionalSlots\n })\n });\n // Table row conversion.\n conversion.for('upcast').elementToElement({ model: 'tableRow', view: 'tr' });\n conversion.for('upcast').add(skipEmptyTableRow());\n conversion.for('downcast').elementToElement({\n model: 'tableRow',\n view: downcastRow()\n });\n // Table cell conversion.\n conversion.for('upcast').elementToElement({ model: 'tableCell', view: 'td' });\n conversion.for('upcast').elementToElement({ model: 'tableCell', view: 'th' });\n conversion.for('upcast').add(ensureParagraphInTableCell('td'));\n conversion.for('upcast').add(ensureParagraphInTableCell('th'));\n conversion.for('editingDowncast').elementToElement({\n model: 'tableCell',\n view: downcastCell({ asWidget: true })\n });\n conversion.for('dataDowncast').elementToElement({\n model: 'tableCell',\n view: downcastCell()\n });\n // Duplicates code - needed to properly refresh paragraph inside a table cell.\n conversion.for('editingDowncast').elementToElement({\n model: 'paragraph',\n view: convertParagraphInTableCell({ asWidget: true }),\n converterPriority: 'high'\n });\n conversion.for('dataDowncast').elementToElement({\n model: 'paragraph',\n view: convertParagraphInTableCell(),\n converterPriority: 'high'\n });\n // Table attributes conversion.\n conversion.for('downcast').attributeToAttribute({ model: 'colspan', view: 'colspan' });\n conversion.for('upcast').attributeToAttribute({\n model: { key: 'colspan', value: upcastCellSpan('colspan') },\n view: 'colspan'\n });\n conversion.for('downcast').attributeToAttribute({ model: 'rowspan', view: 'rowspan' });\n conversion.for('upcast').attributeToAttribute({\n model: { key: 'rowspan', value: upcastCellSpan('rowspan') },\n view: 'rowspan'\n });\n // Define the config.\n editor.config.define('table.defaultHeadings.rows', 0);\n editor.config.define('table.defaultHeadings.columns', 0);\n // Define all the commands.\n editor.commands.add('insertTable', new InsertTableCommand(editor));\n editor.commands.add('insertTableRowAbove', new InsertRowCommand(editor, { order: 'above' }));\n editor.commands.add('insertTableRowBelow', new InsertRowCommand(editor, { order: 'below' }));\n editor.commands.add('insertTableColumnLeft', new InsertColumnCommand(editor, { order: 'left' }));\n editor.commands.add('insertTableColumnRight', new InsertColumnCommand(editor, { order: 'right' }));\n editor.commands.add('removeTableRow', new RemoveRowCommand(editor));\n editor.commands.add('removeTableColumn', new RemoveColumnCommand(editor));\n editor.commands.add('splitTableCellVertically', new SplitCellCommand(editor, { direction: 'vertically' }));\n editor.commands.add('splitTableCellHorizontally', new SplitCellCommand(editor, { direction: 'horizontally' }));\n editor.commands.add('mergeTableCells', new MergeCellsCommand(editor));\n editor.commands.add('mergeTableCellRight', new MergeCellCommand(editor, { direction: 'right' }));\n editor.commands.add('mergeTableCellLeft', new MergeCellCommand(editor, { direction: 'left' }));\n editor.commands.add('mergeTableCellDown', new MergeCellCommand(editor, { direction: 'down' }));\n editor.commands.add('mergeTableCellUp', new MergeCellCommand(editor, { direction: 'up' }));\n editor.commands.add('setTableColumnHeader', new SetHeaderColumnCommand(editor));\n editor.commands.add('setTableRowHeader', new SetHeaderRowCommand(editor));\n editor.commands.add('selectTableRow', new SelectRowCommand(editor));\n editor.commands.add('selectTableColumn', new SelectColumnCommand(editor));\n injectTableLayoutPostFixer(model);\n injectTableCellParagraphPostFixer(model);\n this.listenTo(model.document, 'change:data', () => {\n tableHeadingsRefreshHandler(model, editor.editing);\n tableCellRefreshHandler(model, editor.editing);\n });\n }\n /**\n * Registers downcast handler for the additional table slot.\n */\n registerAdditionalSlot(slotHandler) {\n this._additionalSlots.push(slotHandler);\n }\n}\n/**\n * Returns fixed colspan and rowspan attrbutes values.\n *\n * @param type colspan or rowspan.\n * @returns conversion value function.\n */\nfunction upcastCellSpan(type) {\n return (cell) => {\n const span = parseInt(cell.getAttribute(type));\n if (Number.isNaN(span) || span <= 0) {\n return null;\n }\n return span;\n };\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableWalker from '../tablewalker.js';\n/**\n * A table headings refresh handler which marks the table cells or rows in the differ to have it re-rendered\n * if the headings attribute changed.\n *\n * Table heading rows and heading columns are represented in the model by a `headingRows` and `headingColumns` attributes.\n *\n * When table headings attribute changes, all the cells/rows are marked to re-render to change between `<td>` and `<th>`.\n */\nexport default function tableHeadingsRefreshHandler(model, editing) {\n const differ = model.document.differ;\n for (const change of differ.getChanges()) {\n let table;\n let isRowChange = false;\n if (change.type == 'attribute') {\n const element = change.range.start.nodeAfter;\n if (!element || !element.is('element', 'table')) {\n continue;\n }\n if (change.attributeKey != 'headingRows' && change.attributeKey != 'headingColumns') {\n continue;\n }\n table = element;\n isRowChange = change.attributeKey == 'headingRows';\n }\n else if (change.name == 'tableRow' || change.name == 'tableCell') {\n table = change.position.findAncestor('table');\n isRowChange = change.name == 'tableRow';\n }\n if (!table) {\n continue;\n }\n const headingRows = table.getAttribute('headingRows') || 0;\n const headingColumns = table.getAttribute('headingColumns') || 0;\n const tableWalker = new TableWalker(table);\n for (const tableSlot of tableWalker) {\n const isHeading = tableSlot.row < headingRows || tableSlot.column < headingColumns;\n const expectedElementName = isHeading ? 'th' : 'td';\n const viewElement = editing.mapper.toViewElement(tableSlot.cell);\n if (viewElement && viewElement.is('element') && viewElement.name != expectedElementName) {\n editing.reconvertItem((isRowChange ? tableSlot.cell.parent : tableSlot.cell));\n }\n }\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./inserttable.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./inserttable.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/ui/inserttableview\n */\nimport { View, ButtonView, addKeyboardHandlingForGrid } from 'ckeditor5/src/ui.js';\nimport { KeystrokeHandler, FocusTracker } from 'ckeditor5/src/utils.js';\nimport './../../theme/inserttable.css';\n/**\n * The table size view.\n *\n * It renders a 10x10 grid to choose the inserted table size.\n */\nexport default class InsertTableView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.items = this._createGridCollection();\n this.keystrokes = new KeystrokeHandler();\n this.focusTracker = new FocusTracker();\n this.set('rows', 0);\n this.set('columns', 0);\n this.bind('label').to(this, 'columns', this, 'rows', (columns, rows) => `${rows} × ${columns}`);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck']\n },\n children: [\n {\n tag: 'div',\n attributes: {\n class: ['ck-insert-table-dropdown__grid']\n },\n on: {\n 'mouseover@.ck-insert-table-dropdown-grid-box': bind.to('boxover')\n },\n children: this.items\n },\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-insert-table-dropdown__label'\n ],\n 'aria-hidden': true\n },\n children: [\n {\n text: bind.to('label')\n }\n ]\n }\n ],\n on: {\n mousedown: bind.to(evt => {\n evt.preventDefault();\n }),\n click: bind.to(() => {\n this.fire('execute');\n })\n }\n });\n // #rows and #columns are set via changes to #focusTracker on mouse over.\n this.on('boxover', (evt, domEvt) => {\n const { row, column } = domEvt.target.dataset;\n this.items.get((parseInt(row, 10) - 1) * 10 + (parseInt(column, 10) - 1)).focus();\n });\n // This allows the #rows and #columns to be updated when:\n // * the user navigates the grid using the keyboard,\n // * the user moves the mouse over grid items.\n this.focusTracker.on('change:focusedElement', (evt, name, focusedElement) => {\n if (!focusedElement) {\n return;\n }\n const { row, column } = focusedElement.dataset;\n // As row & column indexes are zero-based transform it to number of selected rows & columns.\n this.set({\n rows: parseInt(row),\n columns: parseInt(column)\n });\n });\n this.on('change:columns', () => this._highlightGridBoxes());\n this.on('change:rows', () => this._highlightGridBoxes());\n }\n render() {\n super.render();\n addKeyboardHandlingForGrid({\n keystrokeHandler: this.keystrokes,\n focusTracker: this.focusTracker,\n gridItems: this.items,\n numberOfColumns: 10,\n uiLanguageDirection: this.locale && this.locale.uiLanguageDirection\n });\n for (const item of this.items) {\n this.focusTracker.add(item.element);\n }\n this.keystrokes.listenTo(this.element);\n }\n /**\n * Resets the rows and columns selection.\n */\n reset() {\n this.set({\n rows: 1,\n columns: 1\n });\n }\n /**\n * @inheritDoc\n */\n focus() {\n this.items.get(0).focus();\n }\n /**\n * @inheritDoc\n */\n focusLast() {\n this.items.get(0).focus();\n }\n /**\n * Highlights grid boxes depending on rows and columns selected.\n */\n _highlightGridBoxes() {\n const rows = this.rows;\n const columns = this.columns;\n this.items.map((boxView, index) => {\n // Translate box index to the row & column index.\n const itemRow = Math.floor(index / 10);\n const itemColumn = index % 10;\n // Grid box is highlighted when its row & column index belongs to selected number of rows & columns.\n const isOn = itemRow < rows && itemColumn < columns;\n boxView.set('isOn', isOn);\n });\n }\n /**\n * Creates a new Button for the grid.\n *\n * @param locale The locale instance.\n * @param row Row number.\n * @param column Column number.\n * @param label The grid button label.\n */\n _createGridButton(locale, row, column, label) {\n const button = new ButtonView(locale);\n button.set({\n label,\n class: 'ck-insert-table-dropdown-grid-box'\n });\n button.extendTemplate({\n attributes: {\n 'data-row': row,\n 'data-column': column\n }\n });\n return button;\n }\n /**\n * @returns A view collection containing boxes to be placed in a table grid.\n */\n _createGridCollection() {\n const boxes = [];\n // Add grid boxes to table selection view.\n for (let index = 0; index < 100; index++) {\n const row = Math.floor(index / 10);\n const column = index % 10;\n const label = `${row + 1} × ${column + 1}`;\n boxes.push(this._createGridButton(this.locale, row + 1, column + 1, label));\n }\n return this.createCollection(boxes);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableui\n */\nimport { icons, Plugin } from 'ckeditor5/src/core.js';\nimport { addListToDropdown, createDropdown, ViewModel, SplitButtonView, SwitchButtonView, MenuBarMenuView } from 'ckeditor5/src/ui.js';\nimport { Collection } from 'ckeditor5/src/utils.js';\nimport InsertTableView from './ui/inserttableview.js';\nimport tableColumnIcon from './../theme/icons/table-column.svg';\nimport tableRowIcon from './../theme/icons/table-row.svg';\nimport tableMergeCellIcon from './../theme/icons/table-merge-cell.svg';\n/**\n * The table UI plugin. It introduces:\n *\n * * The `'insertTable'` dropdown,\n * * The `'menuBar:insertTable'` menu bar menu,\n * * The `'tableColumn'` dropdown,\n * * The `'tableRow'` dropdown,\n * * The `'mergeTableCells'` split button.\n *\n * The `'tableColumn'`, `'tableRow'` and `'mergeTableCells'` dropdowns work best with {@link module:table/tabletoolbar~TableToolbar}.\n */\nexport default class TableUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = this.editor.t;\n const contentLanguageDirection = editor.locale.contentLanguageDirection;\n const isContentLtr = contentLanguageDirection === 'ltr';\n editor.ui.componentFactory.add('insertTable', locale => {\n const command = editor.commands.get('insertTable');\n const dropdownView = createDropdown(locale);\n dropdownView.bind('isEnabled').to(command);\n // Decorate dropdown's button.\n dropdownView.buttonView.set({\n icon: icons.table,\n label: t('Insert table'),\n tooltip: true\n });\n let insertTableView;\n dropdownView.on('change:isOpen', () => {\n if (insertTableView) {\n return;\n }\n // Prepare custom view for dropdown's panel.\n insertTableView = new InsertTableView(locale);\n dropdownView.panelView.children.add(insertTableView);\n insertTableView.delegate('execute').to(dropdownView);\n dropdownView.on('execute', () => {\n editor.execute('insertTable', { rows: insertTableView.rows, columns: insertTableView.columns });\n editor.editing.view.focus();\n });\n });\n return dropdownView;\n });\n editor.ui.componentFactory.add('menuBar:insertTable', locale => {\n const command = editor.commands.get('insertTable');\n const menuView = new MenuBarMenuView(locale);\n const insertTableView = new InsertTableView(locale);\n insertTableView.delegate('execute').to(menuView);\n menuView.on('change:isOpen', (event, name, isOpen) => {\n if (!isOpen) {\n insertTableView.reset();\n }\n });\n insertTableView.on('execute', () => {\n editor.execute('insertTable', { rows: insertTableView.rows, columns: insertTableView.columns });\n editor.editing.view.focus();\n });\n menuView.buttonView.set({\n label: t('Table'),\n icon: icons.table\n });\n menuView.panelView.children.add(insertTableView);\n menuView.bind('isEnabled').to(command);\n return menuView;\n });\n editor.ui.componentFactory.add('tableColumn', locale => {\n const options = [\n {\n type: 'switchbutton',\n model: {\n commandName: 'setTableColumnHeader',\n label: t('Header column'),\n bindIsOn: true\n }\n },\n { type: 'separator' },\n {\n type: 'button',\n model: {\n commandName: isContentLtr ? 'insertTableColumnLeft' : 'insertTableColumnRight',\n label: t('Insert column left')\n }\n },\n {\n type: 'button',\n model: {\n commandName: isContentLtr ? 'insertTableColumnRight' : 'insertTableColumnLeft',\n label: t('Insert column right')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'removeTableColumn',\n label: t('Delete column')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'selectTableColumn',\n label: t('Select column')\n }\n }\n ];\n return this._prepareDropdown(t('Column'), tableColumnIcon, options, locale);\n });\n editor.ui.componentFactory.add('tableRow', locale => {\n const options = [\n {\n type: 'switchbutton',\n model: {\n commandName: 'setTableRowHeader',\n label: t('Header row'),\n bindIsOn: true\n }\n },\n { type: 'separator' },\n {\n type: 'button',\n model: {\n commandName: 'insertTableRowAbove',\n label: t('Insert row above')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'insertTableRowBelow',\n label: t('Insert row below')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'removeTableRow',\n label: t('Delete row')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'selectTableRow',\n label: t('Select row')\n }\n }\n ];\n return this._prepareDropdown(t('Row'), tableRowIcon, options, locale);\n });\n editor.ui.componentFactory.add('mergeTableCells', locale => {\n const options = [\n {\n type: 'button',\n model: {\n commandName: 'mergeTableCellUp',\n label: t('Merge cell up')\n }\n },\n {\n type: 'button',\n model: {\n commandName: isContentLtr ? 'mergeTableCellRight' : 'mergeTableCellLeft',\n label: t('Merge cell right')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'mergeTableCellDown',\n label: t('Merge cell down')\n }\n },\n {\n type: 'button',\n model: {\n commandName: isContentLtr ? 'mergeTableCellLeft' : 'mergeTableCellRight',\n label: t('Merge cell left')\n }\n },\n { type: 'separator' },\n {\n type: 'button',\n model: {\n commandName: 'splitTableCellVertically',\n label: t('Split cell vertically')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'splitTableCellHorizontally',\n label: t('Split cell horizontally')\n }\n }\n ];\n return this._prepareMergeSplitButtonDropdown(t('Merge cells'), tableMergeCellIcon, options, locale);\n });\n }\n /**\n * Creates a dropdown view from a set of options.\n *\n * @param label The dropdown button label.\n * @param icon An icon for the dropdown button.\n * @param options The list of options for the dropdown.\n */\n _prepareDropdown(label, icon, options, locale) {\n const editor = this.editor;\n const dropdownView = createDropdown(locale);\n const commands = this._fillDropdownWithListOptions(dropdownView, options);\n // Decorate dropdown's button.\n dropdownView.buttonView.set({\n label,\n icon,\n tooltip: true\n });\n // Make dropdown button disabled when all options are disabled.\n dropdownView.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => {\n return areEnabled.some(isEnabled => isEnabled);\n });\n this.listenTo(dropdownView, 'execute', evt => {\n editor.execute(evt.source.commandName);\n // Toggling a switch button view should not move the focus to the editable.\n if (!(evt.source instanceof SwitchButtonView)) {\n editor.editing.view.focus();\n }\n });\n return dropdownView;\n }\n /**\n * Creates a dropdown view with a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} for\n * merge (and split)–related commands.\n *\n * @param label The dropdown button label.\n * @param icon An icon for the dropdown button.\n * @param options The list of options for the dropdown.\n */\n _prepareMergeSplitButtonDropdown(label, icon, options, locale) {\n const editor = this.editor;\n const dropdownView = createDropdown(locale, SplitButtonView);\n const mergeCommandName = 'mergeTableCells';\n // Main command.\n const mergeCommand = editor.commands.get(mergeCommandName);\n // Subcommands in the dropdown.\n const commands = this._fillDropdownWithListOptions(dropdownView, options);\n dropdownView.buttonView.set({\n label,\n icon,\n tooltip: true,\n isEnabled: true\n });\n // Make dropdown button disabled when all options are disabled together with the main command.\n dropdownView.bind('isEnabled').toMany([mergeCommand, ...commands], 'isEnabled', (...areEnabled) => {\n return areEnabled.some(isEnabled => isEnabled);\n });\n // Merge selected table cells when the main part of the split button is clicked.\n this.listenTo(dropdownView.buttonView, 'execute', () => {\n editor.execute(mergeCommandName);\n editor.editing.view.focus();\n });\n // Execute commands for events coming from the list in the dropdown panel.\n this.listenTo(dropdownView, 'execute', evt => {\n editor.execute(evt.source.commandName);\n editor.editing.view.focus();\n });\n return dropdownView;\n }\n /**\n * Injects a {@link module:ui/list/listview~ListView} into the passed dropdown with buttons\n * which execute editor commands as configured in passed options.\n *\n * @param options The list of options for the dropdown.\n * @returns Commands the list options are interacting with.\n */\n _fillDropdownWithListOptions(dropdownView, options) {\n const editor = this.editor;\n const commands = [];\n const itemDefinitions = new Collection();\n for (const option of options) {\n addListOption(option, editor, commands, itemDefinitions);\n }\n addListToDropdown(dropdownView, itemDefinitions);\n return commands;\n }\n}\n/**\n * Adds an option to a list view.\n *\n * @param option A configuration option.\n * @param commands The list of commands to update.\n * @param itemDefinitions A collection of dropdown items to update with the given option.\n */\nfunction addListOption(option, editor, commands, itemDefinitions) {\n if (option.type === 'button' || option.type === 'switchbutton') {\n const model = option.model = new ViewModel(option.model);\n const { commandName, bindIsOn } = option.model;\n const command = editor.commands.get(commandName);\n commands.push(command);\n model.set({ commandName });\n model.bind('isEnabled').to(command);\n if (bindIsOn) {\n model.bind('isOn').to(command, 'value');\n }\n model.set({\n withText: true\n });\n }\n itemDefinitions.add(option);\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\\\" opacity=\\\".6\\\"/><path d=\\\"M18 7v1H2V7h16zm0 5v1H2v-1h16z\\\" opacity=\\\".6\\\"/><path d=\\\"M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\\\" opacity=\\\".6\\\"/><path d=\\\"M7 2h1v16H7V2zm5 0h1v16h-1V2z\\\" opacity=\\\".6\\\"/><path d=\\\"M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\\\" opacity=\\\".6\\\"/><path d=\\\"M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z\\\" opacity=\\\".6\\\"/><path d=\\\"M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z\\\"/></svg>\";","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableselection.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableselection.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableselection\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { first } from 'ckeditor5/src/utils.js';\nimport TableWalker from './tablewalker.js';\nimport TableUtils from './tableutils.js';\nimport { cropTableToDimensions, adjustLastRowIndex, adjustLastColumnIndex } from './utils/structure.js';\nimport '../theme/tableselection.css';\n/**\n * This plugin enables the advanced table cells, rows and columns selection.\n * It is loaded automatically by the {@link module:table/table~Table} plugin.\n */\nexport default class TableSelection extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableSelection';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableUtils, TableUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n this.listenTo(model, 'deleteContent', (evt, args) => this._handleDeleteContent(evt, args), { priority: 'high' });\n this.listenTo(view.document, 'insertText', (evt, data) => this._handleInsertTextEvent(evt, data), { priority: 'high' });\n this._defineSelectionConverter();\n this._enablePluginDisabling(); // sic!\n }\n /**\n * Returns the currently selected table cells or `null` if it is not a table cells selection.\n */\n getSelectedTableCells() {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const selection = this.editor.model.document.selection;\n const selectedCells = tableUtils.getSelectedTableCells(selection);\n if (selectedCells.length == 0) {\n return null;\n }\n // This should never happen, but let's know if it ever happens.\n // @if CK_DEBUG //\tif ( selectedCells.length != selection.rangeCount ) {\n // @if CK_DEBUG //\t\tconsole.warn( 'Mixed selection warning. The selection contains table cells and some other ranges.' );\n // @if CK_DEBUG //\t}\n return selectedCells;\n }\n /**\n * Returns the selected table fragment as a document fragment.\n */\n getSelectionAsFragment() {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const selectedCells = this.getSelectedTableCells();\n if (!selectedCells) {\n return null;\n }\n return this.editor.model.change(writer => {\n const documentFragment = writer.createDocumentFragment();\n const { first: firstColumn, last: lastColumn } = tableUtils.getColumnIndexes(selectedCells);\n const { first: firstRow, last: lastRow } = tableUtils.getRowIndexes(selectedCells);\n const sourceTable = selectedCells[0].findAncestor('table');\n let adjustedLastRow = lastRow;\n let adjustedLastColumn = lastColumn;\n // If the selection is rectangular there could be a case of all cells in the last row/column spanned over\n // next row/column so the real lastRow/lastColumn should be updated.\n if (tableUtils.isSelectionRectangular(selectedCells)) {\n const dimensions = {\n firstColumn,\n lastColumn,\n firstRow,\n lastRow\n };\n adjustedLastRow = adjustLastRowIndex(sourceTable, dimensions);\n adjustedLastColumn = adjustLastColumnIndex(sourceTable, dimensions);\n }\n const cropDimensions = {\n startRow: firstRow,\n startColumn: firstColumn,\n endRow: adjustedLastRow,\n endColumn: adjustedLastColumn\n };\n const table = cropTableToDimensions(sourceTable, cropDimensions, writer);\n writer.insert(table, documentFragment, 0);\n return documentFragment;\n });\n }\n /**\n * Sets the model selection based on given anchor and target cells (can be the same cell).\n * Takes care of setting the backward flag.\n *\n * ```ts\n * const modelRoot = editor.model.document.getRoot();\n * const firstCell = modelRoot.getNodeByPath( [ 0, 0, 0 ] );\n * const lastCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );\n *\n * const tableSelection = editor.plugins.get( 'TableSelection' );\n * tableSelection.setCellSelection( firstCell, lastCell );\n * ```\n */\n setCellSelection(anchorCell, targetCell) {\n const cellsToSelect = this._getCellsToSelect(anchorCell, targetCell);\n this.editor.model.change(writer => {\n writer.setSelection(cellsToSelect.cells.map(cell => writer.createRangeOn(cell)), { backward: cellsToSelect.backward });\n });\n }\n /**\n * Returns the focus cell from the current selection.\n */\n getFocusCell() {\n const selection = this.editor.model.document.selection;\n const focusCellRange = [...selection.getRanges()].pop();\n const element = focusCellRange.getContainedElement();\n if (element && element.is('element', 'tableCell')) {\n return element;\n }\n return null;\n }\n /**\n * Returns the anchor cell from the current selection.\n */\n getAnchorCell() {\n const selection = this.editor.model.document.selection;\n const anchorCellRange = first(selection.getRanges());\n const element = anchorCellRange.getContainedElement();\n if (element && element.is('element', 'tableCell')) {\n return element;\n }\n return null;\n }\n /**\n * Defines a selection converter which marks the selected cells with a specific class.\n *\n * The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the\n * selection is backward or not, the last cell will usually be close to the \"focus\" end of the selection\n * (a selection has anchor and focus).\n *\n * The real DOM selection is then hidden with CSS.\n */\n _defineSelectionConverter() {\n const editor = this.editor;\n const highlighted = new Set();\n editor.conversion.for('editingDowncast').add(dispatcher => dispatcher.on('selection', (evt, data, conversionApi) => {\n const viewWriter = conversionApi.writer;\n clearHighlightedTableCells(viewWriter);\n const selectedCells = this.getSelectedTableCells();\n if (!selectedCells) {\n return;\n }\n for (const tableCell of selectedCells) {\n const viewElement = conversionApi.mapper.toViewElement(tableCell);\n viewWriter.addClass('ck-editor__editable_selected', viewElement);\n highlighted.add(viewElement);\n }\n const lastViewCell = conversionApi.mapper.toViewElement(selectedCells[selectedCells.length - 1]);\n viewWriter.setSelection(lastViewCell, 0);\n }, { priority: 'lowest' }));\n function clearHighlightedTableCells(viewWriter) {\n for (const previouslyHighlighted of highlighted) {\n viewWriter.removeClass('ck-editor__editable_selected', previouslyHighlighted);\n }\n highlighted.clear();\n }\n }\n /**\n * Creates a listener that reacts to changes in {@link #isEnabled} and, if the plugin was disabled,\n * it collapses the multi-cell selection to a regular selection placed inside a table cell.\n *\n * This listener helps features that disable the table selection plugin bring the selection\n * to a clear state they can work with (for instance, because they don't support multiple cell selection).\n */\n _enablePluginDisabling() {\n const editor = this.editor;\n this.on('change:isEnabled', () => {\n if (!this.isEnabled) {\n const selectedCells = this.getSelectedTableCells();\n if (!selectedCells) {\n return;\n }\n editor.model.change(writer => {\n const position = writer.createPositionAt(selectedCells[0], 0);\n const range = editor.model.schema.getNearestSelectionRange(position);\n writer.setSelection(range);\n });\n }\n });\n }\n /**\n * Overrides the default `model.deleteContent()` behavior over a selected table fragment.\n *\n * @param args Delete content method arguments.\n */\n _handleDeleteContent(event, args) {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const selection = args[0];\n const options = args[1];\n const model = this.editor.model;\n const isBackward = !options || options.direction == 'backward';\n const selectedTableCells = tableUtils.getSelectedTableCells(selection);\n if (!selectedTableCells.length) {\n return;\n }\n event.stop();\n model.change(writer => {\n const tableCellToSelect = selectedTableCells[isBackward ? selectedTableCells.length - 1 : 0];\n model.change(writer => {\n for (const tableCell of selectedTableCells) {\n model.deleteContent(writer.createSelection(tableCell, 'in'));\n }\n });\n const rangeToSelect = model.schema.getNearestSelectionRange(writer.createPositionAt(tableCellToSelect, 0));\n // Note: we ignore the case where rangeToSelect may be null because deleteContent() will always (unless someone broke it)\n // create an empty paragraph to accommodate the selection.\n if (selection.is('documentSelection')) {\n writer.setSelection(rangeToSelect);\n }\n else {\n selection.setTo(rangeToSelect);\n }\n });\n }\n /**\n * This handler makes it possible to remove the content of all selected cells by starting to type.\n * If you take a look at {@link #_defineSelectionConverter} you will find out that despite the multi-cell selection being set\n * in the model, the view selection is collapsed in the last cell (because most browsers are unable to render multi-cell selections;\n * yes, it's a hack).\n *\n * When multiple cells are selected in the model and the user starts to type, the\n * {@link module:engine/view/document~Document#event:insertText} event carries information provided by the\n * beforeinput DOM event, that in turn only knows about this collapsed DOM selection in the last cell.\n *\n * As a result, the selected cells have no chance to be cleaned up. To fix this, this listener intercepts\n * the event and injects the custom view selection in the data that translates correctly to the actual state\n * of the multi-cell selection in the model.\n *\n * @param data Insert text event data.\n */\n _handleInsertTextEvent(evt, data) {\n const editor = this.editor;\n const selectedCells = this.getSelectedTableCells();\n if (!selectedCells) {\n return;\n }\n const view = editor.editing.view;\n const mapper = editor.editing.mapper;\n const viewRanges = selectedCells.map(tableCell => view.createRangeOn(mapper.toViewElement(tableCell)));\n data.selection = view.createSelection(viewRanges);\n }\n /**\n * Returns an array of table cells that should be selected based on the\n * given anchor cell and target (focus) cell.\n *\n * The cells are returned in a reverse direction if the selection is backward.\n */\n _getCellsToSelect(anchorCell, targetCell) {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const startLocation = tableUtils.getCellLocation(anchorCell);\n const endLocation = tableUtils.getCellLocation(targetCell);\n const startRow = Math.min(startLocation.row, endLocation.row);\n const endRow = Math.max(startLocation.row, endLocation.row);\n const startColumn = Math.min(startLocation.column, endLocation.column);\n const endColumn = Math.max(startLocation.column, endLocation.column);\n // 2-dimensional array of the selected cells to ease flipping the order of cells for backward selections.\n const selectionMap = new Array(endRow - startRow + 1).fill(null).map(() => []);\n const walkerOptions = {\n startRow,\n endRow,\n startColumn,\n endColumn\n };\n for (const { row, cell } of new TableWalker(anchorCell.findAncestor('table'), walkerOptions)) {\n selectionMap[row - startRow].push(cell);\n }\n const flipVertically = endLocation.row < startLocation.row;\n const flipHorizontally = endLocation.column < startLocation.column;\n if (flipVertically) {\n selectionMap.reverse();\n }\n if (flipHorizontally) {\n selectionMap.forEach(row => row.reverse());\n }\n return {\n cells: selectionMap.flat(),\n backward: flipVertically || flipHorizontally\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { ClipboardPipeline, ClipboardMarkersUtils } from 'ckeditor5/src/clipboard.js';\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport TableSelection from './tableselection.js';\nimport TableWalker from './tablewalker.js';\nimport TableUtils from './tableutils.js';\nimport { cropTableToDimensions, getHorizontallyOverlappingCells, getVerticallyOverlappingCells, removeEmptyRowsColumns, splitHorizontally, splitVertically, trimTableCellIfNeeded, adjustLastRowIndex, adjustLastColumnIndex } from './utils/structure.js';\n/**\n * This plugin adds support for copying/cutting/pasting fragments of tables.\n * It is loaded automatically by the {@link module:table/table~Table} plugin.\n */\nexport default class TableClipboard extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableClipboard';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardMarkersUtils, ClipboardPipeline, TableSelection, TableUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n this.listenTo(viewDocument, 'copy', (evt, data) => this._onCopyCut(evt, data));\n this.listenTo(viewDocument, 'cut', (evt, data) => this._onCopyCut(evt, data));\n this.listenTo(editor.model, 'insertContent', (evt, [content, selectable]) => this._onInsertContent(evt, content, selectable), { priority: 'high' });\n this.decorate('_replaceTableSlotCell');\n }\n /**\n * Copies table content to a clipboard on \"copy\" & \"cut\" events.\n *\n * @param evt An object containing information about the handled event.\n * @param data Clipboard event data.\n */\n _onCopyCut(evt, data) {\n const view = this.editor.editing.view;\n const tableSelection = this.editor.plugins.get(TableSelection);\n const clipboardMarkersUtils = this.editor.plugins.get(ClipboardMarkersUtils);\n if (!tableSelection.getSelectedTableCells()) {\n return;\n }\n if (evt.name == 'cut' && !this.editor.model.canEditAt(this.editor.model.document.selection)) {\n return;\n }\n data.preventDefault();\n evt.stop();\n this.editor.model.enqueueChange({ isUndoable: evt.name === 'cut' }, () => {\n const documentFragment = clipboardMarkersUtils._copySelectedFragmentWithMarkers(evt.name, this.editor.model.document.selection, () => tableSelection.getSelectionAsFragment());\n view.document.fire('clipboardOutput', {\n dataTransfer: data.dataTransfer,\n content: this.editor.data.toView(documentFragment),\n method: evt.name\n });\n });\n }\n /**\n * Overrides default {@link module:engine/model/model~Model#insertContent `model.insertContent()`} method to handle pasting table inside\n * selected table fragment.\n *\n * Depending on selected table fragment:\n * - If a selected table fragment is smaller than paste table it will crop pasted table to match dimensions.\n * - If dimensions are equal it will replace selected table fragment with a pasted table contents.\n *\n * @param content The content to insert.\n * @param selectable The selection into which the content should be inserted.\n * If not provided the current model document selection will be used.\n */\n _onInsertContent(evt, content, selectable) {\n if (selectable && !selectable.is('documentSelection')) {\n return;\n }\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get(TableUtils);\n const clipboardMarkersUtils = this.editor.plugins.get(ClipboardMarkersUtils);\n // We might need to crop table before inserting so reference might change.\n const pastedTable = this.getTableIfOnlyTableInContent(content, model);\n if (!pastedTable) {\n return;\n }\n const selectedTableCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n if (!selectedTableCells.length) {\n removeEmptyRowsColumns(pastedTable, tableUtils);\n return;\n }\n // Override default model.insertContent() handling at this point.\n evt.stop();\n if (content.is('documentFragment')) {\n clipboardMarkersUtils._pasteMarkersIntoTransformedElement(content.markers, writer => this._replaceSelectedCells(pastedTable, selectedTableCells, writer));\n }\n else {\n this.editor.model.change(writer => {\n this._replaceSelectedCells(pastedTable, selectedTableCells, writer);\n });\n }\n }\n /**\n * Inserts provided `selectedTableCells` into `pastedTable`.\n */\n _replaceSelectedCells(pastedTable, selectedTableCells, writer) {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const pastedDimensions = {\n width: tableUtils.getColumns(pastedTable),\n height: tableUtils.getRows(pastedTable)\n };\n // Prepare the table for pasting.\n const selection = prepareTableForPasting(selectedTableCells, pastedDimensions, writer, tableUtils);\n // Beyond this point we operate on a fixed content table with rectangular selection and proper last row/column values.\n const selectionHeight = selection.lastRow - selection.firstRow + 1;\n const selectionWidth = selection.lastColumn - selection.firstColumn + 1;\n // Crop pasted table if:\n // - Pasted table dimensions exceeds selection area.\n // - Pasted table has broken layout (ie some cells sticks out by the table dimensions established by the first and last row).\n //\n // Note: The table dimensions are established by the width of the first row and the total number of rows.\n // It is possible to programmatically create a table that has rows which would have cells anchored beyond first row width but\n // such table will not be created by other editing solutions.\n const cropDimensions = {\n startRow: 0,\n startColumn: 0,\n endRow: Math.min(selectionHeight, pastedDimensions.height) - 1,\n endColumn: Math.min(selectionWidth, pastedDimensions.width) - 1\n };\n pastedTable = cropTableToDimensions(pastedTable, cropDimensions, writer);\n // Content table to which we insert a pasted table.\n const selectedTable = selectedTableCells[0].findAncestor('table');\n const cellsToSelect = this._replaceSelectedCellsWithPasted(pastedTable, pastedDimensions, selectedTable, selection, writer);\n if (this.editor.plugins.get('TableSelection').isEnabled) {\n // Selection ranges must be sorted because the first and last selection ranges are considered\n // as anchor/focus cell ranges for multi-cell selection.\n const selectionRanges = tableUtils.sortRanges(cellsToSelect.map(cell => writer.createRangeOn(cell)));\n writer.setSelection(selectionRanges);\n }\n else {\n // Set selection inside first cell if multi-cell selection is disabled.\n writer.setSelection(cellsToSelect[0], 0);\n }\n return selectedTable;\n }\n /**\n * Replaces the part of selectedTable with pastedTable.\n */\n _replaceSelectedCellsWithPasted(pastedTable, pastedDimensions, selectedTable, selection, writer) {\n const { width: pastedWidth, height: pastedHeight } = pastedDimensions;\n // Holds two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.\n const pastedTableLocationMap = createLocationMap(pastedTable, pastedWidth, pastedHeight);\n const selectedTableMap = [...new TableWalker(selectedTable, {\n startRow: selection.firstRow,\n endRow: selection.lastRow,\n startColumn: selection.firstColumn,\n endColumn: selection.lastColumn,\n includeAllSlots: true\n })];\n // Selection must be set to pasted cells (some might be removed or new created).\n const cellsToSelect = [];\n // Store next cell insert position.\n let insertPosition;\n // Content table replace cells algorithm iterates over a selected table fragment and:\n //\n // - Removes existing table cells at current slot (location).\n // - Inserts cell from a pasted table for a matched slots.\n //\n // This ensures proper table geometry after the paste\n for (const tableSlot of selectedTableMap) {\n const { row, column } = tableSlot;\n // Save the insert position for current row start.\n if (column === selection.firstColumn) {\n insertPosition = tableSlot.getPositionBefore();\n }\n // Map current table slot location to an pasted table slot location.\n const pastedRow = row - selection.firstRow;\n const pastedColumn = column - selection.firstColumn;\n const pastedCell = pastedTableLocationMap[pastedRow % pastedHeight][pastedColumn % pastedWidth];\n // Clone cell to insert (to duplicate its attributes and children).\n // Cloning is required to support repeating pasted table content when inserting to a bigger selection.\n const cellToInsert = pastedCell ? writer.cloneElement(pastedCell) : null;\n // Replace the cell from the current slot with new table cell.\n const newTableCell = this._replaceTableSlotCell(tableSlot, cellToInsert, insertPosition, writer);\n // The cell was only removed.\n if (!newTableCell) {\n continue;\n }\n // Trim the cell if it's row/col-spans would exceed selection area.\n trimTableCellIfNeeded(newTableCell, row, column, selection.lastRow, selection.lastColumn, writer);\n cellsToSelect.push(newTableCell);\n insertPosition = writer.createPositionAfter(newTableCell);\n }\n // If there are any headings, all the cells that overlap from heading must be splitted.\n const headingRows = parseInt(selectedTable.getAttribute('headingRows') || '0');\n const headingColumns = parseInt(selectedTable.getAttribute('headingColumns') || '0');\n const areHeadingRowsIntersectingSelection = selection.firstRow < headingRows && headingRows <= selection.lastRow;\n const areHeadingColumnsIntersectingSelection = selection.firstColumn < headingColumns && headingColumns <= selection.lastColumn;\n if (areHeadingRowsIntersectingSelection) {\n const columnsLimit = { first: selection.firstColumn, last: selection.lastColumn };\n const newCells = doHorizontalSplit(selectedTable, headingRows, columnsLimit, writer, selection.firstRow);\n cellsToSelect.push(...newCells);\n }\n if (areHeadingColumnsIntersectingSelection) {\n const rowsLimit = { first: selection.firstRow, last: selection.lastRow };\n const newCells = doVerticalSplit(selectedTable, headingColumns, rowsLimit, writer);\n cellsToSelect.push(...newCells);\n }\n return cellsToSelect;\n }\n /**\n * Replaces a single table slot.\n *\n * @returns Inserted table cell or null if slot should remain empty.\n * @private\n */\n _replaceTableSlotCell(tableSlot, cellToInsert, insertPosition, writer) {\n const { cell, isAnchor } = tableSlot;\n // If the slot is occupied by a cell in a selected table - remove it.\n // The slot of this cell will be either:\n // - Replaced by a pasted table cell.\n // - Spanned by a previously pasted table cell.\n if (isAnchor) {\n writer.remove(cell);\n }\n // There is no cell to insert (might be spanned by other cell in a pasted table) - advance to the next content table slot.\n if (!cellToInsert) {\n return null;\n }\n writer.insert(cellToInsert, insertPosition);\n return cellToInsert;\n }\n /**\n * Extracts the table for pasting into a table.\n *\n * @param content The content to insert.\n * @param model The editor model.\n */\n getTableIfOnlyTableInContent(content, model) {\n if (!content.is('documentFragment') && !content.is('element')) {\n return null;\n }\n // Table passed directly.\n if (content.is('element', 'table')) {\n return content;\n }\n // We do not support mixed content when pasting table into table.\n // See: https://github.com/ckeditor/ckeditor5/issues/6817.\n if (content.childCount == 1 && content.getChild(0).is('element', 'table')) {\n return content.getChild(0);\n }\n // If there are only whitespaces around a table then use that table for pasting.\n const contentRange = model.createRangeIn(content);\n for (const element of contentRange.getItems()) {\n if (element.is('element', 'table')) {\n // Stop checking if there is some content before table.\n const rangeBefore = model.createRange(contentRange.start, model.createPositionBefore(element));\n if (model.hasContent(rangeBefore, { ignoreWhitespaces: true })) {\n return null;\n }\n // Stop checking if there is some content after table.\n const rangeAfter = model.createRange(model.createPositionAfter(element), contentRange.end);\n if (model.hasContent(rangeAfter, { ignoreWhitespaces: true })) {\n return null;\n }\n // There wasn't any content neither before nor after.\n return element;\n }\n }\n return null;\n }\n}\n/**\n * Prepares a table for pasting and returns adjusted selection dimensions.\n */\nfunction prepareTableForPasting(selectedTableCells, pastedDimensions, writer, tableUtils) {\n const selectedTable = selectedTableCells[0].findAncestor('table');\n const columnIndexes = tableUtils.getColumnIndexes(selectedTableCells);\n const rowIndexes = tableUtils.getRowIndexes(selectedTableCells);\n const selection = {\n firstColumn: columnIndexes.first,\n lastColumn: columnIndexes.last,\n firstRow: rowIndexes.first,\n lastRow: rowIndexes.last\n };\n // Single cell selected - expand selection to pasted table dimensions.\n const shouldExpandSelection = selectedTableCells.length === 1;\n if (shouldExpandSelection) {\n selection.lastRow += pastedDimensions.height - 1;\n selection.lastColumn += pastedDimensions.width - 1;\n expandTableSize(selectedTable, selection.lastRow + 1, selection.lastColumn + 1, tableUtils);\n }\n // In case of expanding selection we do not reset the selection so in this case we will always try to fix selection\n // like in the case of a non-rectangular area. This might be fixed by re-setting selected cells array but this shortcut is safe.\n if (shouldExpandSelection || !tableUtils.isSelectionRectangular(selectedTableCells)) {\n // For a non-rectangular selection (ie in which some cells sticks out from a virtual selection rectangle) we need to create\n // a table layout that has a rectangular selection. This will split cells so the selection become rectangular.\n // Beyond this point we will operate on fixed content table.\n splitCellsToRectangularSelection(selectedTable, selection, writer);\n }\n // However a selected table fragment might be invalid if examined alone. Ie such table fragment:\n //\n // +---+---+---+---+\n // 0 | a | b | c | d |\n // + + +---+---+\n // 1 | | e | f | g |\n // + +---+ +---+\n // 2 | | h | | i | <- last row, each cell has rowspan = 2,\n // + + + + + so we need to return 3, not 2\n // 3 | | | | |\n // +---+---+---+---+\n //\n // is invalid as the cells \"h\" and \"i\" have rowspans.\n // This case needs only adjusting the selection dimension as the rest of the algorithm operates on empty slots also.\n else {\n selection.lastRow = adjustLastRowIndex(selectedTable, selection);\n selection.lastColumn = adjustLastColumnIndex(selectedTable, selection);\n }\n return selection;\n}\n/**\n * Expand table (in place) to expected size.\n */\nfunction expandTableSize(table, expectedHeight, expectedWidth, tableUtils) {\n const tableWidth = tableUtils.getColumns(table);\n const tableHeight = tableUtils.getRows(table);\n if (expectedWidth > tableWidth) {\n tableUtils.insertColumns(table, {\n at: tableWidth,\n columns: expectedWidth - tableWidth\n });\n }\n if (expectedHeight > tableHeight) {\n tableUtils.insertRows(table, {\n at: tableHeight,\n rows: expectedHeight - tableHeight\n });\n }\n}\n/**\n * Returns two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.\n *\n * At given row & column location it might be one of:\n *\n * * cell - cell from pasted table anchored at this location.\n * * null - if no cell is anchored at this location.\n *\n * For instance, from a table below:\n *\n * +----+----+----+----+\n * | 00 | 01 | 02 | 03 |\n * + +----+----+----+\n * | | 11 | 13 |\n * +----+ +----+\n * | 20 | | 23 |\n * +----+----+----+----+\n *\n * The method will return an array (numbers represents cell element):\n *\n * ```ts\n * const map = [\n * [ '00', '01', '02', '03' ],\n * [ null, '11', null, '13' ],\n * [ '20', null, null, '23' ]\n * ]\n * ```\n *\n * This allows for a quick access to table at give row & column. For instance to access table cell \"13\" from pasted table call:\n *\n * ```ts\n * const cell = map[ 1 ][ 3 ]\n * ```\n */\nfunction createLocationMap(table, width, height) {\n // Create height x width (row x column) two-dimensional table to store cells.\n const map = new Array(height).fill(null)\n .map(() => new Array(width).fill(null));\n for (const { column, row, cell } of new TableWalker(table)) {\n map[row][column] = cell;\n }\n return map;\n}\n/**\n * Make selected cells rectangular by splitting the cells that stand out from a rectangular selection.\n *\n * In the table below a selection is shown with \"::\" and slots with anchor cells are named.\n *\n * +----+----+----+----+----+ +----+----+----+----+----+\n * | 00 | 01 | 02 | 03 | | 00 | 01 | 02 | 03 |\n * + +----+ +----+----+ | ::::::::::::::::----+\n * | | 11 | | 13 | 14 | | ::11 | | 13:: 14 | <- first row\n * +----+----+ + +----+ +----::---| | ::----+\n * | 20 | 21 | | | 24 | select cells: | 20 ::21 | | :: 24 |\n * +----+----+ +----+----+ 11 -> 33 +----::---| |---::----+\n * | 30 | | 33 | 34 | | 30 :: | | 33:: 34 | <- last row\n * + + +----+ + | :::::::::::::::: +\n * | | | 43 | | | | | 43 | |\n * +----+----+----+----+----+ +----+----+----+----+----+\n * ^ ^\n * first & last columns\n *\n * Will update table to:\n *\n * +----+----+----+----+----+\n * | 00 | 01 | 02 | 03 |\n * + +----+----+----+----+\n * | | 11 | | 13 | 14 |\n * +----+----+ + +----+\n * | 20 | 21 | | | 24 |\n * +----+----+ +----+----+\n * | 30 | | | 33 | 34 |\n * + +----+----+----+ +\n * | | | | 43 | |\n * +----+----+----+----+----+\n *\n * In th example above:\n * - Cell \"02\" which have `rowspan = 4` must be trimmed at first and at after last row.\n * - Cell \"03\" which have `rowspan = 2` and `colspan = 2` must be trimmed at first column and after last row.\n * - Cells \"00\", \"03\" & \"30\" which cannot be cut by this algorithm as they are outside the trimmed area.\n * - Cell \"13\" cannot be cut as it is inside the trimmed area.\n */\nfunction splitCellsToRectangularSelection(table, dimensions, writer) {\n const { firstRow, lastRow, firstColumn, lastColumn } = dimensions;\n const rowIndexes = { first: firstRow, last: lastRow };\n const columnIndexes = { first: firstColumn, last: lastColumn };\n // 1. Split cells vertically in two steps as first step might create cells that needs to split again.\n doVerticalSplit(table, firstColumn, rowIndexes, writer);\n doVerticalSplit(table, lastColumn + 1, rowIndexes, writer);\n // 2. Split cells horizontally in two steps as first step might create cells that needs to split again.\n doHorizontalSplit(table, firstRow, columnIndexes, writer);\n doHorizontalSplit(table, lastRow + 1, columnIndexes, writer, firstRow);\n}\nfunction doHorizontalSplit(table, splitRow, limitColumns, writer, startRow = 0) {\n // If selection starts at first row then no split is needed.\n if (splitRow < 1) {\n return;\n }\n const overlappingCells = getVerticallyOverlappingCells(table, splitRow, startRow);\n // Filter out cells that are not touching insides of the rectangular selection.\n const cellsToSplit = overlappingCells.filter(({ column, cellWidth }) => isAffectedBySelection(column, cellWidth, limitColumns));\n return cellsToSplit.map(({ cell }) => splitHorizontally(cell, splitRow, writer));\n}\nfunction doVerticalSplit(table, splitColumn, limitRows, writer) {\n // If selection starts at first column then no split is needed.\n if (splitColumn < 1) {\n return;\n }\n const overlappingCells = getHorizontallyOverlappingCells(table, splitColumn);\n // Filter out cells that are not touching insides of the rectangular selection.\n const cellsToSplit = overlappingCells.filter(({ row, cellHeight }) => isAffectedBySelection(row, cellHeight, limitRows));\n return cellsToSplit.map(({ cell, column }) => splitVertically(cell, column, splitColumn, writer));\n}\n/**\n * Checks if cell at given row (column) is affected by a rectangular selection defined by first/last column (row).\n *\n * The same check is used for row as for column.\n */\nfunction isAffectedBySelection(index, span, limit) {\n const endIndex = index + span - 1;\n const { first, last } = limit;\n const isInsideSelection = index >= first && index <= last;\n const overlapsSelectionFromOutside = index < first && endIndex >= first;\n return isInsideSelection || overlapsSelectionFromOutside;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablekeyboard\n */\nimport TableSelection from './tableselection.js';\nimport TableWalker from './tablewalker.js';\nimport TableUtils from './tableutils.js';\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { getLocalizedArrowKeyCodeDirection } from 'ckeditor5/src/utils.js';\n/**\n * This plugin enables keyboard navigation for tables.\n * It is loaded automatically by the {@link module:table/table~Table} plugin.\n */\nexport default class TableKeyboard extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableKeyboard';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableSelection, TableUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const t = editor.t;\n this.listenTo(viewDocument, 'arrowKey', (...args) => this._onArrowKey(...args), { context: 'table' });\n this.listenTo(viewDocument, 'tab', (...args) => this._handleTabOnSelectedTable(...args), { context: 'figure' });\n this.listenTo(viewDocument, 'tab', (...args) => this._handleTab(...args), { context: ['th', 'td'] });\n // Add the information about the keystrokes to the accessibility database.\n editor.accessibility.addKeystrokeInfoGroup({\n id: 'table',\n label: t('Keystrokes that can be used in a table cell'),\n keystrokes: [\n {\n label: t('Move the selection to the next cell'),\n keystroke: 'Tab'\n },\n {\n label: t('Move the selection to the previous cell'),\n keystroke: 'Shift+Tab'\n },\n {\n label: t('Insert a new table row (when in the last cell of a table)'),\n keystroke: 'Tab'\n },\n {\n label: t('Navigate through the table'),\n keystroke: [['arrowup'], ['arrowright'], ['arrowdown'], ['arrowleft']]\n }\n ]\n });\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:tab tab} events for the <kbd>Tab</kbd> key executed\n * when the table widget is selected.\n */\n _handleTabOnSelectedTable(bubblingEventInfo, domEventData) {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const selectedElement = selection.getSelectedElement();\n if (!selectedElement || !selectedElement.is('element', 'table')) {\n return;\n }\n domEventData.preventDefault();\n domEventData.stopPropagation();\n bubblingEventInfo.stop();\n editor.model.change(writer => {\n writer.setSelection(writer.createRangeIn(selectedElement.getChild(0).getChild(0)));\n });\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:tab tab} events for the <kbd>Tab</kbd> key executed\n * inside table cells.\n */\n _handleTab(bubblingEventInfo, domEventData) {\n const editor = this.editor;\n const tableUtils = this.editor.plugins.get(TableUtils);\n const tableSelection = this.editor.plugins.get('TableSelection');\n const selection = editor.model.document.selection;\n const isForward = !domEventData.shiftKey;\n let tableCell = tableUtils.getTableCellsContainingSelection(selection)[0];\n if (!tableCell) {\n tableCell = tableSelection.getFocusCell();\n }\n if (!tableCell) {\n return;\n }\n domEventData.preventDefault();\n domEventData.stopPropagation();\n bubblingEventInfo.stop();\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const currentRowIndex = table.getChildIndex(tableRow);\n const currentCellIndex = tableRow.getChildIndex(tableCell);\n const isFirstCellInRow = currentCellIndex === 0;\n if (!isForward && isFirstCellInRow && currentRowIndex === 0) {\n // Set the selection over the whole table if the selection was in the first table cell.\n editor.model.change(writer => {\n writer.setSelection(writer.createRangeOn(table));\n });\n return;\n }\n const isLastCellInRow = currentCellIndex === tableRow.childCount - 1;\n const isLastRow = currentRowIndex === tableUtils.getRows(table) - 1;\n if (isForward && isLastRow && isLastCellInRow) {\n editor.execute('insertTableRowBelow');\n // Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled\n // or it got overwritten) set the selection over the whole table to mirror the first cell case.\n if (currentRowIndex === tableUtils.getRows(table) - 1) {\n editor.model.change(writer => {\n writer.setSelection(writer.createRangeOn(table));\n });\n return;\n }\n }\n let cellToFocus;\n // Move to the first cell in the next row.\n if (isForward && isLastCellInRow) {\n const nextRow = table.getChild(currentRowIndex + 1);\n cellToFocus = nextRow.getChild(0);\n }\n // Move to the last cell in the previous row.\n else if (!isForward && isFirstCellInRow) {\n const previousRow = table.getChild(currentRowIndex - 1);\n cellToFocus = previousRow.getChild(previousRow.childCount - 1);\n }\n // Move to the next/previous cell.\n else {\n cellToFocus = tableRow.getChild(currentCellIndex + (isForward ? 1 : -1));\n }\n editor.model.change(writer => {\n writer.setSelection(writer.createRangeIn(cellToFocus));\n });\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:keydown keydown} events.\n */\n _onArrowKey(eventInfo, domEventData) {\n const editor = this.editor;\n const keyCode = domEventData.keyCode;\n const direction = getLocalizedArrowKeyCodeDirection(keyCode, editor.locale.contentLanguageDirection);\n const wasHandled = this._handleArrowKeys(direction, domEventData.shiftKey);\n if (wasHandled) {\n domEventData.preventDefault();\n domEventData.stopPropagation();\n eventInfo.stop();\n }\n }\n /**\n * Handles arrow keys to move the selection around the table.\n *\n * @param direction The direction of the arrow key.\n * @param expandSelection If the current selection should be expanded.\n * @returns Returns `true` if key was handled.\n */\n _handleArrowKeys(direction, expandSelection) {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const tableSelection = this.editor.plugins.get('TableSelection');\n const model = this.editor.model;\n const selection = model.document.selection;\n const isForward = ['right', 'down'].includes(direction);\n // In case one or more table cells are selected (from outside),\n // move the selection to a cell adjacent to the selected table fragment.\n const selectedCells = tableUtils.getSelectedTableCells(selection);\n if (selectedCells.length) {\n let focusCell;\n if (expandSelection) {\n focusCell = tableSelection.getFocusCell();\n }\n else {\n focusCell = isForward ? selectedCells[selectedCells.length - 1] : selectedCells[0];\n }\n this._navigateFromCellInDirection(focusCell, direction, expandSelection);\n return true;\n }\n // Abort if we're not in a table cell.\n const tableCell = selection.focus.findAncestor('tableCell');\n /* istanbul ignore if: paranoid check -- @preserve */\n if (!tableCell) {\n return false;\n }\n // When the selection is not collapsed.\n if (!selection.isCollapsed) {\n if (expandSelection) {\n // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.\n // Selection for sure will not approach cell edge.\n //\n // With a special case when all cell content is selected - then selection should expand to the other cell.\n // Note: When the entire cell gets selected using CTRL+A, the selection is always forward.\n if (selection.isBackward == isForward && !selection.containsEntireContent(tableCell)) {\n return false;\n }\n }\n else {\n const selectedElement = selection.getSelectedElement();\n // It will collapse for non-object selected so it's not going to move to other cell.\n if (!selectedElement || !model.schema.isObject(selectedElement)) {\n return false;\n }\n }\n }\n // Let's check if the selection is at the beginning/end of the cell.\n if (this._isSelectionAtCellEdge(selection, tableCell, isForward)) {\n this._navigateFromCellInDirection(tableCell, direction, expandSelection);\n return true;\n }\n return false;\n }\n /**\n * Returns `true` if the selection is at the boundary of a table cell according to the navigation direction.\n *\n * @param selection The current selection.\n * @param tableCell The current table cell element.\n * @param isForward The expected navigation direction.\n */\n _isSelectionAtCellEdge(selection, tableCell, isForward) {\n const model = this.editor.model;\n const schema = this.editor.model.schema;\n const focus = isForward ? selection.getLastPosition() : selection.getFirstPosition();\n // If the current limit element is not table cell we are for sure not at the cell edge.\n // Also `modifySelection` will not let us out of it.\n if (!schema.getLimitElement(focus).is('element', 'tableCell')) {\n const boundaryPosition = model.createPositionAt(tableCell, isForward ? 'end' : 0);\n return boundaryPosition.isTouching(focus);\n }\n const probe = model.createSelection(focus);\n model.modifySelection(probe, { direction: isForward ? 'forward' : 'backward' });\n // If there was no change in the focus position, then it's not possible to move the selection there.\n return focus.isEqual(probe.focus);\n }\n /**\n * Moves the selection from the given table cell in the specified direction.\n *\n * @param focusCell The table cell that is current multi-cell selection focus.\n * @param direction Direction in which selection should move.\n * @param expandSelection If the current selection should be expanded. Default value is false.\n */\n _navigateFromCellInDirection(focusCell, direction, expandSelection = false) {\n const model = this.editor.model;\n const table = focusCell.findAncestor('table');\n const tableMap = [...new TableWalker(table, { includeAllSlots: true })];\n const { row: lastRow, column: lastColumn } = tableMap[tableMap.length - 1];\n const currentCellInfo = tableMap.find(({ cell }) => cell == focusCell);\n let { row, column } = currentCellInfo;\n switch (direction) {\n case 'left':\n column--;\n break;\n case 'up':\n row--;\n break;\n case 'right':\n column += currentCellInfo.cellWidth;\n break;\n case 'down':\n row += currentCellInfo.cellHeight;\n break;\n }\n const isOutsideVertically = row < 0 || row > lastRow;\n const isBeforeFirstCell = column < 0 && row <= 0;\n const isAfterLastCell = column > lastColumn && row >= lastRow;\n // Note that if the table cell at the end of a row is row-spanned then isAfterLastCell will never be true.\n // However, we don't know if user was navigating on the last row or not, so let's stay in the table.\n if (isOutsideVertically || isBeforeFirstCell || isAfterLastCell) {\n model.change(writer => {\n writer.setSelection(writer.createRangeOn(table));\n });\n return;\n }\n if (column < 0) {\n column = expandSelection ? 0 : lastColumn;\n row--;\n }\n else if (column > lastColumn) {\n column = expandSelection ? lastColumn : 0;\n row++;\n }\n const cellToSelect = tableMap.find(cellInfo => cellInfo.row == row && cellInfo.column == column).cell;\n const isForward = ['right', 'down'].includes(direction);\n const tableSelection = this.editor.plugins.get('TableSelection');\n if (expandSelection && tableSelection.isEnabled) {\n const anchorCell = tableSelection.getAnchorCell() || focusCell;\n tableSelection.setCellSelection(anchorCell, cellToSelect);\n }\n else {\n const positionToSelect = model.createPositionAt(cellToSelect, isForward ? 0 : 'end');\n model.change(writer => {\n writer.setSelection(positionToSelect);\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablemouse/mouseeventsobserver\n */\nimport { DomEventObserver } from 'ckeditor5/src/engine.js';\n/**\n * The mouse selection event observer.\n *\n * It registers listeners for the following DOM events:\n *\n * - `'mousemove'`\n * - `'mouseleave'`\n *\n * Note that this observer is disabled by default. To enable this observer, it needs to be added to\n * {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.\n *\n * The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.\n */\nexport default class MouseEventsObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n this.domEventType = [\n 'mousemove', 'mouseleave'\n ];\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n this.fire(domEvent.type, domEvent);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablemouse\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport TableSelection from './tableselection.js';\nimport MouseEventsObserver from './tablemouse/mouseeventsobserver.js';\nimport TableUtils from './tableutils.js';\n/**\n * This plugin enables a table cells' selection with the mouse.\n * It is loaded automatically by the {@link module:table/table~Table} plugin.\n */\nexport default class TableMouse extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableMouse';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableSelection, TableUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Currently the MouseObserver only handles `mousedown` and `mouseup` events.\n // TODO move to the engine?\n editor.editing.view.addObserver(MouseEventsObserver);\n this._enableShiftClickSelection();\n this._enableMouseDragSelection();\n }\n /**\n * Enables making cells selection by <kbd>Shift</kbd>+click. Creates a selection from the cell which previously held\n * the selection to the cell which was clicked. It can be the same cell, in which case it selects a single cell.\n */\n _enableShiftClickSelection() {\n const editor = this.editor;\n const tableUtils = editor.plugins.get(TableUtils);\n let blockSelectionChange = false;\n const tableSelection = editor.plugins.get(TableSelection);\n this.listenTo(editor.editing.view.document, 'mousedown', (evt, domEventData) => {\n const selection = editor.model.document.selection;\n if (!this.isEnabled || !tableSelection.isEnabled) {\n return;\n }\n if (!domEventData.domEvent.shiftKey) {\n return;\n }\n const anchorCell = tableSelection.getAnchorCell() || tableUtils.getTableCellsContainingSelection(selection)[0];\n if (!anchorCell) {\n return;\n }\n const targetCell = this._getModelTableCellFromDomEvent(domEventData);\n if (targetCell && haveSameTableParent(anchorCell, targetCell)) {\n blockSelectionChange = true;\n tableSelection.setCellSelection(anchorCell, targetCell);\n domEventData.preventDefault();\n }\n });\n this.listenTo(editor.editing.view.document, 'mouseup', () => {\n blockSelectionChange = false;\n });\n // We need to ignore a `selectionChange` event that is fired after we render our new table cells selection.\n // When downcasting table cells selection to the view, we put the view selection in the last selected cell\n // in a place that may not be natively a \"correct\" location. This is – we put it directly in the `<td>` element.\n // All browsers fire the native `selectionchange` event.\n // However, all browsers except Safari return the selection in the exact place where we put it\n // (even though it's visually normalized). Safari returns `<td><p>^foo` that makes our selection observer\n // fire our `selectionChange` event (because the view selection that we set in the first step differs from the DOM selection).\n // Since `selectionChange` is fired, we automatically update the model selection that moves it that paragraph.\n // This breaks our dear cells selection.\n //\n // Theoretically this issue concerns only Safari that is the only browser that do normalize the selection.\n // However, to avoid code branching and to have a good coverage for this event blocker, I enabled it for all browsers.\n //\n // Note: I'm keeping the `blockSelectionChange` state separately for shift+click and mouse drag (exact same logic)\n // so I don't have to try to analyze whether they don't overlap in some weird cases. Probably they don't.\n // But I have other things to do, like writing this comment.\n this.listenTo(editor.editing.view.document, 'selectionChange', evt => {\n if (blockSelectionChange) {\n // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );\n evt.stop();\n }\n }, { priority: 'highest' });\n }\n /**\n * Enables making cells selection by dragging.\n *\n * The selection is made only on mousemove. Mouse tracking is started on mousedown.\n * However, the cells selection is enabled only after the mouse cursor left the anchor cell.\n * Thanks to that normal text selection within one cell works just fine. However, you can still select\n * just one cell by leaving the anchor cell and moving back to it.\n */\n _enableMouseDragSelection() {\n const editor = this.editor;\n let anchorCell, targetCell;\n let beganCellSelection = false;\n let blockSelectionChange = false;\n const tableSelection = editor.plugins.get(TableSelection);\n this.listenTo(editor.editing.view.document, 'mousedown', (evt, domEventData) => {\n if (!this.isEnabled || !tableSelection.isEnabled) {\n return;\n }\n // Make sure to not conflict with the shift+click listener and any other possible handler.\n if (domEventData.domEvent.shiftKey || domEventData.domEvent.ctrlKey || domEventData.domEvent.altKey) {\n return;\n }\n anchorCell = this._getModelTableCellFromDomEvent(domEventData);\n });\n this.listenTo(editor.editing.view.document, 'mousemove', (evt, domEventData) => {\n if (!domEventData.domEvent.buttons) {\n return;\n }\n if (!anchorCell) {\n return;\n }\n const newTargetCell = this._getModelTableCellFromDomEvent(domEventData);\n if (newTargetCell && haveSameTableParent(anchorCell, newTargetCell)) {\n targetCell = newTargetCell;\n // Switch to the cell selection mode after the mouse cursor left the anchor cell.\n // Switch off only on mouseup (makes selecting a single cell possible).\n if (!beganCellSelection && targetCell != anchorCell) {\n beganCellSelection = true;\n }\n }\n // Yep, not making a cell selection yet. See method docs.\n if (!beganCellSelection) {\n return;\n }\n blockSelectionChange = true;\n tableSelection.setCellSelection(anchorCell, targetCell);\n domEventData.preventDefault();\n });\n this.listenTo(editor.editing.view.document, 'mouseup', () => {\n beganCellSelection = false;\n blockSelectionChange = false;\n anchorCell = null;\n targetCell = null;\n });\n // See the explanation in `_enableShiftClickSelection()`.\n this.listenTo(editor.editing.view.document, 'selectionChange', evt => {\n if (blockSelectionChange) {\n // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );\n evt.stop();\n }\n }, { priority: 'highest' });\n }\n /**\n * Returns the model table cell element based on the target element of the passed DOM event.\n *\n * @returns Returns the table cell or `undefined`.\n */\n _getModelTableCellFromDomEvent(domEventData) {\n // Note: Work with positions (not element mapping) because the target element can be an attribute or other non-mapped element.\n const viewTargetElement = domEventData.target;\n const viewPosition = this.editor.editing.view.createPositionAt(viewTargetElement, 0);\n const modelPosition = this.editor.editing.mapper.toModelPosition(viewPosition);\n const modelElement = modelPosition.parent;\n return modelElement.findAncestor('tableCell', { includeSelf: true });\n }\n}\nfunction haveSameTableParent(cellA, cellB) {\n return cellA.parent.parent == cellB.parent.parent;\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./table.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./table.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isWidget } from 'ckeditor5/src/widget.js';\n/**\n * Depending on the position of the selection either return the selected table or the table higher in the hierarchy.\n */\nexport function getSelectionAffectedTableWidget(selection) {\n const selectedTable = getSelectedTableWidget(selection);\n if (selectedTable) {\n return selectedTable;\n }\n return getTableWidgetAncestor(selection);\n}\n/**\n * Returns a table widget editing view element if one is selected.\n */\nexport function getSelectedTableWidget(selection) {\n const viewElement = selection.getSelectedElement();\n if (viewElement && isTableWidget(viewElement)) {\n return viewElement;\n }\n return null;\n}\n/**\n * Returns a table widget editing view element if one is among the selection's ancestors.\n */\nexport function getTableWidgetAncestor(selection) {\n const selectionPosition = selection.getFirstPosition();\n if (!selectionPosition) {\n return null;\n }\n let parent = selectionPosition.parent;\n while (parent) {\n if (parent.is('element') && isTableWidget(parent)) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n}\n/**\n * Checks if a given view element is a table widget.\n */\nfunction isTableWidget(viewElement) {\n return !!viewElement.getCustomProperty('table') && isWidget(viewElement);\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorinput.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorinput.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/ui/colorinputview\n */\nimport { View, InputTextView, createDropdown, FocusCycler, ViewCollection, ColorSelectorView } from 'ckeditor5/src/ui.js';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';\nimport '../../theme/colorinput.css';\n/**\n * The color input view class. It allows the user to type in a color (hex, rgb, etc.)\n * or choose it from the configurable color palette with a preview.\n *\n * @internal\n */\nexport default class ColorInputView extends View {\n /**\n * Creates an instance of the color input view.\n *\n * @param locale The locale instance.\n * @param options The input options.\n * @param options.colorDefinitions The colors to be displayed in the palette inside the input's dropdown.\n * @param options.columns The number of columns in which the colors will be displayed.\n * @param options.defaultColorValue If specified, the color input view will replace the \"Remove color\" button with\n * the \"Restore default\" button. Instead of clearing the input field, the default color value will be set.\n */\n constructor(locale, options) {\n super(locale);\n this.set('value', '');\n this.set('isReadOnly', false);\n this.set('isFocused', false);\n this.set('isEmpty', true);\n this.options = options;\n this.focusTracker = new FocusTracker();\n this._focusables = new ViewCollection();\n this.dropdownView = this._createDropdownView();\n this.inputView = this._createInputTextView();\n this.keystrokes = new KeystrokeHandler();\n this._stillTyping = false;\n this.focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate items backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.\n focusPrevious: 'shift + tab',\n // Navigate items forwards using the <kbd>Tab</kbd> key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-input-color'\n ]\n },\n children: [\n this.dropdownView,\n this.inputView\n ]\n });\n this.on('change:value', (evt, name, inputValue) => this._setInputValue(inputValue));\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n [this.inputView, this.dropdownView.buttonView].forEach(view => {\n this.focusTracker.add(view.element);\n this._focusables.add(view);\n });\n this.keystrokes.listenTo(this.element);\n }\n /**\n * Focuses the view.\n */\n focus(direction) {\n if (direction === -1) {\n this.focusCycler.focusLast();\n }\n else {\n this.focusCycler.focusFirst();\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Creates and configures the {@link #dropdownView}.\n */\n _createDropdownView() {\n const locale = this.locale;\n const t = locale.t;\n const bind = this.bindTemplate;\n const colorSelector = this._createColorSelector(locale);\n const dropdown = createDropdown(locale);\n const colorPreview = new View();\n colorPreview.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-input-color__button__preview'\n ],\n style: {\n backgroundColor: bind.to('value')\n }\n },\n children: [{\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-input-color__button__preview__no-color-indicator',\n bind.if('value', 'ck-hidden', value => value != '')\n ]\n }\n }]\n });\n dropdown.buttonView.extendTemplate({\n attributes: {\n class: 'ck-input-color__button'\n }\n });\n dropdown.buttonView.children.add(colorPreview);\n dropdown.buttonView.label = t('Color picker');\n dropdown.buttonView.tooltip = true;\n dropdown.panelPosition = locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';\n dropdown.panelView.children.add(colorSelector);\n dropdown.bind('isEnabled').to(this, 'isReadOnly', value => !value);\n dropdown.on('change:isOpen', (evt, name, isVisible) => {\n if (isVisible) {\n colorSelector.updateSelectedColors();\n colorSelector.showColorGridsFragment();\n }\n });\n return dropdown;\n }\n /**\n * Creates and configures an instance of {@link module:ui/inputtext/inputtextview~InputTextView}.\n *\n * @returns A configured instance to be set as {@link #inputView}.\n */\n _createInputTextView() {\n const locale = this.locale;\n const inputView = new InputTextView(locale);\n inputView.extendTemplate({\n on: {\n blur: inputView.bindTemplate.to('blur')\n }\n });\n inputView.value = this.value;\n inputView.bind('isReadOnly', 'hasError').to(this);\n this.bind('isFocused', 'isEmpty').to(inputView);\n inputView.on('input', () => {\n const inputValue = inputView.element.value;\n // Check if the value matches one of our defined colors' label.\n const mappedColor = this.options.colorDefinitions.find(def => inputValue === def.label);\n this._stillTyping = true;\n this.value = mappedColor && mappedColor.color || inputValue;\n });\n inputView.on('blur', () => {\n this._stillTyping = false;\n this._setInputValue(inputView.element.value);\n });\n inputView.delegate('input').to(this);\n return inputView;\n }\n /**\n * Creates and configures the panel with \"color grid\" and \"color picker\" inside the {@link #dropdownView}.\n */\n _createColorSelector(locale) {\n const t = locale.t;\n const defaultColor = this.options.defaultColorValue || '';\n const removeColorButtonLabel = defaultColor ? t('Restore default') : t('Remove color');\n const colorSelector = new ColorSelectorView(locale, {\n colors: this.options.colorDefinitions,\n columns: this.options.columns,\n removeButtonLabel: removeColorButtonLabel,\n colorPickerLabel: t('Color picker'),\n colorPickerViewConfig: this.options.colorPickerConfig === false ? false : {\n ...this.options.colorPickerConfig,\n hideInput: true\n }\n });\n colorSelector.appendUI();\n colorSelector.on('execute', (evt, data) => {\n if (data.source === 'colorPickerSaveButton') {\n this.dropdownView.isOpen = false;\n return;\n }\n this.value = data.value || defaultColor;\n // Trigger the listener that actually applies the set value.\n this.fire('input');\n if (data.source !== 'colorPicker') {\n this.dropdownView.isOpen = false;\n }\n });\n /**\n * Color is saved before changes in color picker. In case \"cancel button\" is pressed\n * this color will be applied.\n */\n let backupColor = this.value;\n colorSelector.on('colorPicker:cancel', () => {\n /**\n * Revert color to previous value before changes in color picker.\n */\n this.value = backupColor;\n this.fire('input');\n this.dropdownView.isOpen = false;\n });\n colorSelector.colorGridsFragmentView.colorPickerButtonView.on('execute', () => {\n /**\n * Save color value before changes in color picker.\n */\n backupColor = this.value;\n });\n colorSelector.bind('selectedColor').to(this, 'value');\n return colorSelector;\n }\n /**\n * Sets {@link #inputView}'s value property to the color value or color label,\n * if there is one and the user is not typing.\n *\n * Handles cases like:\n *\n * * Someone picks the color in the grid.\n * * The color is set from the plugin level.\n *\n * @param inputValue Color value to be set.\n */\n _setInputValue(inputValue) {\n if (!this._stillTyping) {\n const normalizedInputValue = normalizeColor(inputValue);\n // Check if the value matches one of our defined colors.\n const mappedColor = this.options.colorDefinitions.find(def => normalizedInputValue === normalizeColor(def.color));\n if (mappedColor) {\n this.inputView.value = mappedColor.label;\n }\n else {\n this.inputView.value = inputValue || '';\n }\n }\n }\n}\n/**\n * Normalizes color value, by stripping extensive whitespace.\n * For example., transforms:\n * * ` rgb( 25 50 0 )` to `rgb(25 50 0)`,\n * * \"\\t rgb( 25 , 50,0 )\t\t\" to `rgb(25 50 0)`.\n *\n * @param colorString The value to be normalized.\n */\nfunction normalizeColor(colorString) {\n return colorString\n // Remove any whitespace right after `(` or `,`.\n .replace(/([(,])\\s+/g, '$1')\n // Remove any whitespace at the beginning or right before the end, `)`, `,`, or another whitespace.\n .replace(/^\\s+|\\s+(?=[),\\s]|$)/g, '')\n // Then, replace `,` or whitespace with a single space.\n .replace(/,|\\s/g, ' ');\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/utils/ui/table-properties\n */\nimport { ButtonView, ViewModel } from 'ckeditor5/src/ui.js';\nimport { Collection } from 'ckeditor5/src/utils.js';\nimport { isColor, isLength, isPercentage } from 'ckeditor5/src/engine.js';\nimport ColorInputView from '../../ui/colorinputview.js';\nconst isEmpty = (val) => val === '';\n/**\n * Returns an object containing pairs of CSS border style values and their localized UI\n * labels. Used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}\n * and {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}.\n *\n * @param t The \"t\" function provided by the editor that is used to localize strings.\n */\nexport function getBorderStyleLabels(t) {\n return {\n none: t('None'),\n solid: t('Solid'),\n dotted: t('Dotted'),\n dashed: t('Dashed'),\n double: t('Double'),\n groove: t('Groove'),\n ridge: t('Ridge'),\n inset: t('Inset'),\n outset: t('Outset')\n };\n}\n/**\n * Returns a localized error string that can be displayed next to color (background, border)\n * fields that have an invalid value.\n *\n * @param t The \"t\" function provided by the editor that is used to localize strings.\n */\nexport function getLocalizedColorErrorText(t) {\n return t('The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".');\n}\n/**\n * Returns a localized error string that can be displayed next to length (padding, border width)\n * fields that have an invalid value.\n *\n * @param t The \"t\" function provided by the editor that is used to localize strings.\n */\nexport function getLocalizedLengthErrorText(t) {\n return t('The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".');\n}\n/**\n * Returns `true` when the passed value is an empty string or a valid CSS color expression.\n * Otherwise, `false` is returned.\n *\n * See {@link module:engine/view/styles/utils~isColor}.\n */\nexport function colorFieldValidator(value) {\n value = value.trim().toLowerCase();\n return isEmpty(value) || isColor(value);\n}\n/**\n * Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.\n * Otherwise, `false` is returned.\n *\n * See {@link module:engine/view/styles/utils~isLength}.\n * See {@link module:engine/view/styles/utils~isPercentage}.\n */\nexport function lengthFieldValidator(value) {\n value = value.trim();\n return isEmpty(value) || isNumberString(value) || isLength(value) || isPercentage(value);\n}\n/**\n * Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.\n * Otherwise, `false` is returned.\n *\n * See {@link module:engine/view/styles/utils~isLength}.\n */\nexport function lineWidthFieldValidator(value) {\n value = value.trim();\n return isEmpty(value) || isNumberString(value) || isLength(value);\n}\n/**\n * Generates item definitions for a UI dropdown that allows changing the border style of a table or a table cell.\n *\n * @param defaultStyle The default border.\n */\nexport function getBorderStyleDefinitions(view, defaultStyle) {\n const itemDefinitions = new Collection();\n const styleLabels = getBorderStyleLabels(view.t);\n for (const style in styleLabels) {\n const definition = {\n type: 'button',\n model: new ViewModel({\n _borderStyleValue: style,\n label: styleLabels[style],\n role: 'menuitemradio',\n withText: true\n })\n };\n if (style === 'none') {\n definition.model.bind('isOn').to(view, 'borderStyle', value => {\n if (defaultStyle === 'none') {\n return !value;\n }\n return value === style;\n });\n }\n else {\n definition.model.bind('isOn').to(view, 'borderStyle', value => {\n return value === style;\n });\n }\n itemDefinitions.add(definition);\n }\n return itemDefinitions;\n}\n/**\n * A helper that fills a toolbar with buttons that:\n *\n * * have some labels,\n * * have some icons,\n * * set a certain UI view property value upon execution.\n *\n * @param nameToValue A function that maps a button name to a value. By default names are the same as values.\n */\nexport function fillToolbar(options) {\n const { view, icons, toolbar, labels, propertyName, nameToValue, defaultValue } = options;\n for (const name in labels) {\n const button = new ButtonView(view.locale);\n button.set({\n label: labels[name],\n icon: icons[name],\n tooltip: labels[name]\n });\n // If specified the `nameToValue()` callback, map the value based on the option's name.\n const buttonValue = nameToValue ? nameToValue(name) : name;\n button.bind('isOn').to(view, propertyName, value => {\n // `value` comes from `view[ propertyName ]`.\n let valueToCompare = value;\n // If it's empty, and the `defaultValue` is specified, use it instead.\n if (value === '' && defaultValue) {\n valueToCompare = defaultValue;\n }\n return buttonValue === valueToCompare;\n });\n button.on('execute', () => {\n view[propertyName] = buttonValue;\n });\n toolbar.items.add(button);\n }\n}\n/**\n * A default color palette used by various user interfaces related to tables, for instance,\n * by {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI} or\n * {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI}.\n *\n * The color palette follows the {@link module:table/tableconfig~TableColorConfig table color configuration format}\n * and contains the following color definitions:\n *\n * ```ts\n * const defaultColors = [\n * {\n * color: 'hsl(0, 0%, 0%)',\n * label: 'Black'\n * },\n * {\n * color: 'hsl(0, 0%, 30%)',\n * label: 'Dim grey'\n * },\n * {\n * color: 'hsl(0, 0%, 60%)',\n * label: 'Grey'\n * },\n * {\n * color: 'hsl(0, 0%, 90%)',\n * label: 'Light grey'\n * },\n * {\n * color: 'hsl(0, 0%, 100%)',\n * label: 'White',\n * hasBorder: true\n * },\n * {\n * color: 'hsl(0, 75%, 60%)',\n * label: 'Red'\n * },\n * {\n * color: 'hsl(30, 75%, 60%)',\n * label: 'Orange'\n * },\n * {\n * color: 'hsl(60, 75%, 60%)',\n * label: 'Yellow'\n * },\n * {\n * color: 'hsl(90, 75%, 60%)',\n * label: 'Light green'\n * },\n * {\n * color: 'hsl(120, 75%, 60%)',\n * label: 'Green'\n * },\n * {\n * color: 'hsl(150, 75%, 60%)',\n * label: 'Aquamarine'\n * },\n * {\n * color: 'hsl(180, 75%, 60%)',\n * label: 'Turquoise'\n * },\n * {\n * color: 'hsl(210, 75%, 60%)',\n * label: 'Light blue'\n * },\n * {\n * color: 'hsl(240, 75%, 60%)',\n * label: 'Blue'\n * },\n * {\n * color: 'hsl(270, 75%, 60%)',\n * label: 'Purple'\n * }\n * ];\n * ```\n */\nexport const defaultColors = [\n {\n color: 'hsl(0, 0%, 0%)',\n label: 'Black'\n },\n {\n color: 'hsl(0, 0%, 30%)',\n label: 'Dim grey'\n },\n {\n color: 'hsl(0, 0%, 60%)',\n label: 'Grey'\n },\n {\n color: 'hsl(0, 0%, 90%)',\n label: 'Light grey'\n },\n {\n color: 'hsl(0, 0%, 100%)',\n label: 'White',\n hasBorder: true\n },\n {\n color: 'hsl(0, 75%, 60%)',\n label: 'Red'\n },\n {\n color: 'hsl(30, 75%, 60%)',\n label: 'Orange'\n },\n {\n color: 'hsl(60, 75%, 60%)',\n label: 'Yellow'\n },\n {\n color: 'hsl(90, 75%, 60%)',\n label: 'Light green'\n },\n {\n color: 'hsl(120, 75%, 60%)',\n label: 'Green'\n },\n {\n color: 'hsl(150, 75%, 60%)',\n label: 'Aquamarine'\n },\n {\n color: 'hsl(180, 75%, 60%)',\n label: 'Turquoise'\n },\n {\n color: 'hsl(210, 75%, 60%)',\n label: 'Light blue'\n },\n {\n color: 'hsl(240, 75%, 60%)',\n label: 'Blue'\n },\n {\n color: 'hsl(270, 75%, 60%)',\n label: 'Purple'\n }\n];\n/**\n * Returns a creator for a color input with a label.\n *\n * For given options, it returns a function that creates an instance of a\n * {@link module:table/ui/colorinputview~ColorInputView color input} logically related to\n * a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in the DOM.\n *\n * The helper does the following:\n *\n * * It sets the color input `id` and `ariaDescribedById` attributes.\n * * It binds the color input `isReadOnly` to the labeled view.\n * * It binds the color input `hasError` to the labeled view.\n * * It enables a logic that cleans up the error when the user starts typing in the color input.\n *\n * Usage:\n *\n * ```ts\n * const colorInputCreator = getLabeledColorInputCreator( {\n * colorConfig: [ ... ],\n * columns: 3,\n * } );\n *\n * const labeledInputView = new LabeledFieldView( locale, colorInputCreator );\n * console.log( labeledInputView.view ); // A color input instance.\n * ```\n *\n * @internal\n * @param options Color input options.\n * @param options.colorConfig The configuration of the color palette displayed in the input's dropdown.\n * @param options.columns The configuration of the number of columns the color palette consists of in the input's dropdown.\n * @param options.defaultColorValue If specified, the color input view will replace the \"Remove color\" button with\n * the \"Restore default\" button. Instead of clearing the input field, the default color value will be set.\n * @param options.colorPickerConfig The configuration of the color picker. You could disable it or define your output format.\n */\nexport function getLabeledColorInputCreator(options) {\n return (labeledFieldView, viewUid, statusUid) => {\n const colorInputView = new ColorInputView(labeledFieldView.locale, {\n colorDefinitions: colorConfigToColorGridDefinitions(options.colorConfig),\n columns: options.columns,\n defaultColorValue: options.defaultColorValue,\n colorPickerConfig: options.colorPickerConfig\n });\n colorInputView.inputView.set({\n id: viewUid,\n ariaDescribedById: statusUid\n });\n colorInputView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);\n colorInputView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);\n colorInputView.on('input', () => {\n // UX: Make the error text disappear and disable the error indicator as the user\n // starts fixing the errors.\n labeledFieldView.errorText = null;\n });\n labeledFieldView.bind('isEmpty', 'isFocused').to(colorInputView);\n return colorInputView;\n };\n}\n/**\n * A simple helper method to detect number strings.\n * I allows full number notation, so omitting 0 is not allowed:\n */\nfunction isNumberString(value) {\n const parsedValue = parseFloat(value);\n return !Number.isNaN(parsedValue) && value === String(parsedValue);\n}\nfunction colorConfigToColorGridDefinitions(colorConfig) {\n return colorConfig.map(item => ({\n color: item.model,\n label: item.label,\n options: {\n hasBorder: item.hasBorder\n }\n }));\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./formrow.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./formrow.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/ui/formrowview\n */\nimport { View } from 'ckeditor5/src/ui.js';\nimport '../../theme/formrow.css';\n/**\n * The class representing a single row in a complex form,\n * used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}.\n *\n * **Note**: For now this class is private. When more use cases arrive (beyond ckeditor5-table),\n * it will become a component in ckeditor5-ui.\n *\n * @internal\n */\nexport default class FormRowView extends View {\n /**\n * Creates an instance of the form row class.\n *\n * @param locale The locale instance.\n * @param options.labelView When passed, the row gets the `group` and `aria-labelledby`\n * DOM attributes and gets described by the label.\n */\n constructor(locale, options = {}) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('class', options.class || null);\n this.children = this.createCollection();\n if (options.children) {\n options.children.forEach(child => this.children.add(child));\n }\n this.set('_role', null);\n this.set('_ariaLabelledBy', null);\n if (options.labelView) {\n this.set({\n _role: 'group',\n _ariaLabelledBy: options.labelView.id\n });\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-form__row',\n bind.to('class')\n ],\n role: bind.to('_role'),\n 'aria-labelledby': bind.to('_ariaLabelledBy')\n },\n children: this.children\n });\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./form.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./form.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableform.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableform.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecellproperties.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecellproperties.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties/ui/tablecellpropertiesview\n */\nimport { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui.js';\nimport { KeystrokeHandler, FocusTracker } from 'ckeditor5/src/utils.js';\nimport { icons } from 'ckeditor5/src/core.js';\nimport { fillToolbar, getBorderStyleDefinitions, getBorderStyleLabels, getLabeledColorInputCreator } from '../../utils/ui/table-properties.js';\nimport FormRowView from '../../ui/formrowview.js';\nimport '../../../theme/form.css';\nimport '../../../theme/tableform.css';\nimport '../../../theme/tablecellproperties.css';\n/**\n * The class representing a table cell properties form, allowing users to customize\n * certain style aspects of a table cell, for instance, border, padding, text alignment, etc..\n */\nexport default class TableCellPropertiesView extends View {\n /**\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param options Additional configuration of the view.\n * @param options.borderColors A configuration of the border color palette used by the\n * {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView#borderColorInput}.\n * @param options.backgroundColors A configuration of the background color palette used by the\n * {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView#backgroundInput}.\n * @param options.defaultTableCellProperties The default table cell properties.\n */\n constructor(locale, options) {\n super(locale);\n this.set({\n borderStyle: '',\n borderWidth: '',\n borderColor: '',\n padding: '',\n backgroundColor: '',\n width: '',\n height: '',\n horizontalAlignment: '',\n verticalAlignment: ''\n });\n this.options = options;\n const { borderStyleDropdown, borderWidthInput, borderColorInput, borderRowLabel } = this._createBorderFields();\n const { backgroundRowLabel, backgroundInput } = this._createBackgroundFields();\n const { widthInput, operatorLabel, heightInput, dimensionsLabel } = this._createDimensionFields();\n const { horizontalAlignmentToolbar, verticalAlignmentToolbar, alignmentLabel } = this._createAlignmentFields();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.children = this.createCollection();\n this.borderStyleDropdown = borderStyleDropdown;\n this.borderWidthInput = borderWidthInput;\n this.borderColorInput = borderColorInput;\n this.backgroundInput = backgroundInput;\n this.paddingInput = this._createPaddingField();\n this.widthInput = widthInput;\n this.heightInput = heightInput;\n this.horizontalAlignmentToolbar = horizontalAlignmentToolbar;\n this.verticalAlignmentToolbar = verticalAlignmentToolbar;\n // Defer creating to make sure other fields are present and the Save button can\n // bind its #isEnabled to their error messages so there's no way to save unless all\n // fields are valid.\n const { saveButtonView, cancelButtonView } = this._createActionButtons();\n this.saveButtonView = saveButtonView;\n this.cancelButtonView = cancelButtonView;\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n // Form header.\n this.children.add(new FormHeaderView(locale, {\n label: this.t('Cell properties')\n }));\n // Border row.\n this.children.add(new FormRowView(locale, {\n labelView: borderRowLabel,\n children: [\n borderRowLabel,\n borderStyleDropdown,\n borderColorInput,\n borderWidthInput\n ],\n class: 'ck-table-form__border-row'\n }));\n // Background.\n this.children.add(new FormRowView(locale, {\n labelView: backgroundRowLabel,\n children: [\n backgroundRowLabel,\n backgroundInput\n ],\n class: 'ck-table-form__background-row'\n }));\n // Dimensions row and padding.\n this.children.add(new FormRowView(locale, {\n children: [\n // Dimensions row.\n new FormRowView(locale, {\n labelView: dimensionsLabel,\n children: [\n dimensionsLabel,\n widthInput,\n operatorLabel,\n heightInput\n ],\n class: 'ck-table-form__dimensions-row'\n }),\n // Padding row.\n new FormRowView(locale, {\n children: [\n this.paddingInput\n ],\n class: 'ck-table-cell-properties-form__padding-row'\n })\n ]\n }));\n // Text alignment row.\n this.children.add(new FormRowView(locale, {\n labelView: alignmentLabel,\n children: [\n alignmentLabel,\n horizontalAlignmentToolbar,\n verticalAlignmentToolbar\n ],\n class: 'ck-table-cell-properties-form__alignment-row'\n }));\n // Action row.\n this.children.add(new FormRowView(locale, {\n children: [\n this.saveButtonView,\n this.cancelButtonView\n ],\n class: 'ck-table-form__action-row'\n }));\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-form',\n 'ck-table-form',\n 'ck-table-cell-properties-form'\n ],\n // https://github.com/ckeditor/ckeditor5-link/issues/90\n tabindex: '-1'\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Enable the \"submit\" event for this view. It can be triggered by the #saveButtonView\n // which is of the \"submit\" DOM \"type\".\n submitHandler({\n view: this\n });\n // Maintain continuous focus cycling over views that have focusable children and focus cyclers themselves.\n [this.borderColorInput, this.backgroundInput].forEach(view => {\n this._focusCycler.chain(view.fieldView.focusCycler);\n });\n [\n this.borderStyleDropdown,\n this.borderColorInput,\n this.borderWidthInput,\n this.backgroundInput,\n this.widthInput,\n this.heightInput,\n this.paddingInput,\n this.horizontalAlignmentToolbar,\n this.verticalAlignmentToolbar,\n this.saveButtonView,\n this.cancelButtonView\n ].forEach(view => {\n // Register the view as focusable.\n this._focusables.add(view);\n // Register the view in the focus tracker.\n this.focusTracker.add(view.element);\n });\n // Mainly for closing using \"Esc\" and navigation using \"Tab\".\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist focusable field in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #borderStyleDropdown},\n * * {@link #borderWidthInput},\n * * {@link #borderColorInput}.\n */\n _createBorderFields() {\n const defaultTableCellProperties = this.options.defaultTableCellProperties;\n const defaultBorder = {\n style: defaultTableCellProperties.borderStyle,\n width: defaultTableCellProperties.borderWidth,\n color: defaultTableCellProperties.borderColor\n };\n const colorInputCreator = getLabeledColorInputCreator({\n colorConfig: this.options.borderColors,\n columns: 5,\n defaultColorValue: defaultBorder.color,\n colorPickerConfig: this.options.colorPickerConfig\n });\n const locale = this.locale;\n const t = this.t;\n const accessibleLabel = t('Style');\n // -- Group label ---------------------------------------------\n const borderRowLabel = new LabelView(locale);\n borderRowLabel.text = t('Border');\n // -- Style ---------------------------------------------------\n const styleLabels = getBorderStyleLabels(t);\n const borderStyleDropdown = new LabeledFieldView(locale, createLabeledDropdown);\n borderStyleDropdown.set({\n label: accessibleLabel,\n class: 'ck-table-form__border-style'\n });\n borderStyleDropdown.fieldView.buttonView.set({\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined,\n isOn: false,\n withText: true,\n tooltip: accessibleLabel\n });\n borderStyleDropdown.fieldView.buttonView.bind('label').to(this, 'borderStyle', value => {\n return styleLabels[value ? value : 'none'];\n });\n borderStyleDropdown.fieldView.on('execute', evt => {\n this.borderStyle = evt.source._borderStyleValue;\n });\n borderStyleDropdown.bind('isEmpty').to(this, 'borderStyle', value => !value);\n addListToDropdown(borderStyleDropdown.fieldView, getBorderStyleDefinitions(this, defaultBorder.style), {\n role: 'menu',\n ariaLabel: accessibleLabel\n });\n // -- Width ---------------------------------------------------\n const borderWidthInput = new LabeledFieldView(locale, createLabeledInputText);\n borderWidthInput.set({\n label: t('Width'),\n class: 'ck-table-form__border-width'\n });\n borderWidthInput.fieldView.bind('value').to(this, 'borderWidth');\n borderWidthInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);\n borderWidthInput.fieldView.on('input', () => {\n this.borderWidth = borderWidthInput.fieldView.element.value;\n });\n // -- Color ---------------------------------------------------\n const borderColorInput = new LabeledFieldView(locale, colorInputCreator);\n borderColorInput.set({\n label: t('Color'),\n class: 'ck-table-form__border-color'\n });\n borderColorInput.fieldView.bind('value').to(this, 'borderColor');\n borderColorInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);\n borderColorInput.fieldView.on('input', () => {\n this.borderColor = borderColorInput.fieldView.value;\n });\n // Reset the border color and width fields depending on the `border-style` value.\n this.on('change:borderStyle', (evt, name, newValue, oldValue) => {\n // When removing the border (`border-style:none`), clear the remaining `border-*` properties.\n // See: https://github.com/ckeditor/ckeditor5/issues/6227.\n if (!isBorderStyleSet(newValue)) {\n this.borderColor = '';\n this.borderWidth = '';\n }\n // When setting the `border-style` from `none`, set the default `border-color` and `border-width` properties.\n if (!isBorderStyleSet(oldValue)) {\n this.borderColor = defaultBorder.color;\n this.borderWidth = defaultBorder.width;\n }\n });\n return {\n borderRowLabel,\n borderStyleDropdown,\n borderColorInput,\n borderWidthInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #backgroundInput}.\n */\n _createBackgroundFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Group label ---------------------------------------------\n const backgroundRowLabel = new LabelView(locale);\n backgroundRowLabel.text = t('Background');\n // -- Background color input -----------------------------------\n const colorInputCreator = getLabeledColorInputCreator({\n colorConfig: this.options.backgroundColors,\n columns: 5,\n defaultColorValue: this.options.defaultTableCellProperties.backgroundColor,\n colorPickerConfig: this.options.colorPickerConfig\n });\n const backgroundInput = new LabeledFieldView(locale, colorInputCreator);\n backgroundInput.set({\n label: t('Color'),\n class: 'ck-table-cell-properties-form__background'\n });\n backgroundInput.fieldView.bind('value').to(this, 'backgroundColor');\n backgroundInput.fieldView.on('input', () => {\n this.backgroundColor = backgroundInput.fieldView.value;\n });\n return {\n backgroundRowLabel,\n backgroundInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #widthInput}.\n * * {@link #heightInput}.\n */\n _createDimensionFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Label ---------------------------------------------------\n const dimensionsLabel = new LabelView(locale);\n dimensionsLabel.text = t('Dimensions');\n // -- Width ---------------------------------------------------\n const widthInput = new LabeledFieldView(locale, createLabeledInputText);\n widthInput.set({\n label: t('Width'),\n class: 'ck-table-form__dimensions-row__width'\n });\n widthInput.fieldView.bind('value').to(this, 'width');\n widthInput.fieldView.on('input', () => {\n this.width = widthInput.fieldView.element.value;\n });\n // -- Operator ---------------------------------------------------\n const operatorLabel = new View(locale);\n operatorLabel.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck-table-form__dimension-operator'\n ]\n },\n children: [\n { text: '×' }\n ]\n });\n // -- Height ---------------------------------------------------\n const heightInput = new LabeledFieldView(locale, createLabeledInputText);\n heightInput.set({\n label: t('Height'),\n class: 'ck-table-form__dimensions-row__height'\n });\n heightInput.fieldView.bind('value').to(this, 'height');\n heightInput.fieldView.on('input', () => {\n this.height = heightInput.fieldView.element.value;\n });\n return {\n dimensionsLabel,\n widthInput,\n operatorLabel,\n heightInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #paddingInput}.\n */\n _createPaddingField() {\n const locale = this.locale;\n const t = this.t;\n const paddingInput = new LabeledFieldView(locale, createLabeledInputText);\n paddingInput.set({\n label: t('Padding'),\n class: 'ck-table-cell-properties-form__padding'\n });\n paddingInput.fieldView.bind('value').to(this, 'padding');\n paddingInput.fieldView.on('input', () => {\n this.padding = paddingInput.fieldView.element.value;\n });\n return paddingInput;\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #horizontalAlignmentToolbar},\n * * {@link #verticalAlignmentToolbar}.\n */\n _createAlignmentFields() {\n const locale = this.locale;\n const t = this.t;\n const alignmentLabel = new LabelView(locale);\n const ALIGNMENT_ICONS = {\n left: icons.alignLeft,\n center: icons.alignCenter,\n right: icons.alignRight,\n justify: icons.alignJustify,\n top: icons.alignTop,\n middle: icons.alignMiddle,\n bottom: icons.alignBottom\n };\n alignmentLabel.text = t('Table cell text alignment');\n // -- Horizontal ---------------------------------------------------\n const horizontalAlignmentToolbar = new ToolbarView(locale);\n const isContentRTL = locale.contentLanguageDirection === 'rtl';\n horizontalAlignmentToolbar.set({\n isCompact: true,\n ariaLabel: t('Horizontal text alignment toolbar')\n });\n fillToolbar({\n view: this,\n icons: ALIGNMENT_ICONS,\n toolbar: horizontalAlignmentToolbar,\n labels: this._horizontalAlignmentLabels,\n propertyName: 'horizontalAlignment',\n nameToValue: name => {\n // For the RTL content, we want to swap the buttons \"align to the left\" and \"align to the right\".\n if (isContentRTL) {\n if (name === 'left') {\n return 'right';\n }\n else if (name === 'right') {\n return 'left';\n }\n }\n return name;\n },\n defaultValue: this.options.defaultTableCellProperties.horizontalAlignment\n });\n // -- Vertical -----------------------------------------------------\n const verticalAlignmentToolbar = new ToolbarView(locale);\n verticalAlignmentToolbar.set({\n isCompact: true,\n ariaLabel: t('Vertical text alignment toolbar')\n });\n fillToolbar({\n view: this,\n icons: ALIGNMENT_ICONS,\n toolbar: verticalAlignmentToolbar,\n labels: this._verticalAlignmentLabels,\n propertyName: 'verticalAlignment',\n defaultValue: this.options.defaultTableCellProperties.verticalAlignment\n });\n return {\n horizontalAlignmentToolbar,\n verticalAlignmentToolbar,\n alignmentLabel\n };\n }\n /**\n * Creates the following form controls:\n *\n * * {@link #saveButtonView},\n * * {@link #cancelButtonView}.\n */\n _createActionButtons() {\n const locale = this.locale;\n const t = this.t;\n const saveButtonView = new ButtonView(locale);\n const cancelButtonView = new ButtonView(locale);\n const fieldsThatShouldValidateToSave = [\n this.borderWidthInput,\n this.borderColorInput,\n this.backgroundInput,\n this.paddingInput\n ];\n saveButtonView.set({\n label: t('Save'),\n icon: icons.check,\n class: 'ck-button-save',\n type: 'submit',\n withText: true\n });\n saveButtonView.bind('isEnabled').toMany(fieldsThatShouldValidateToSave, 'errorText', (...errorTexts) => {\n return errorTexts.every(errorText => !errorText);\n });\n cancelButtonView.set({\n label: t('Cancel'),\n icon: icons.cancel,\n class: 'ck-button-cancel',\n withText: true\n });\n cancelButtonView.delegate('execute').to(this, 'cancel');\n return {\n saveButtonView, cancelButtonView\n };\n }\n /**\n * Provides localized labels for {@link #horizontalAlignmentToolbar} buttons.\n */\n get _horizontalAlignmentLabels() {\n const locale = this.locale;\n const t = this.t;\n const left = t('Align cell text to the left');\n const center = t('Align cell text to the center');\n const right = t('Align cell text to the right');\n const justify = t('Justify cell text');\n // Returns object with a proper order of labels.\n if (locale.uiLanguageDirection === 'rtl') {\n return { right, center, left, justify };\n }\n else {\n return { left, center, right, justify };\n }\n }\n /**\n * Provides localized labels for {@link #verticalAlignmentToolbar} buttons.\n */\n get _verticalAlignmentLabels() {\n const t = this.t;\n return {\n top: t('Align cell text to the top'),\n middle: t('Align cell text to the middle'),\n bottom: t('Align cell text to the bottom')\n };\n }\n}\nfunction isBorderStyleSet(value) {\n return value !== 'none';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/utils/ui/contextualballoon\n */\nimport { Rect } from 'ckeditor5/src/utils.js';\nimport { BalloonPanelView } from 'ckeditor5/src/ui.js';\nimport { getSelectionAffectedTableWidget, getTableWidgetAncestor } from './widget.js';\nimport { getSelectionAffectedTable } from '../common.js';\nconst BALLOON_POSITIONS = /* #__PURE__ */ (() => [\n BalloonPanelView.defaultPositions.northArrowSouth,\n BalloonPanelView.defaultPositions.northArrowSouthWest,\n BalloonPanelView.defaultPositions.northArrowSouthEast,\n BalloonPanelView.defaultPositions.southArrowNorth,\n BalloonPanelView.defaultPositions.southArrowNorthWest,\n BalloonPanelView.defaultPositions.southArrowNorthEast,\n BalloonPanelView.defaultPositions.viewportStickyNorth\n])();\n/**\n * A helper utility that positions the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance\n * with respect to the table in the editor content, if one is selected.\n *\n * @param editor The editor instance.\n * @param target Either \"cell\" or \"table\". Determines the target the balloon will be attached to.\n */\nexport function repositionContextualBalloon(editor, target) {\n const balloon = editor.plugins.get('ContextualBalloon');\n const selection = editor.editing.view.document.selection;\n let position;\n if (target === 'cell') {\n if (getTableWidgetAncestor(selection)) {\n position = getBalloonCellPositionData(editor);\n }\n }\n else if (getSelectionAffectedTableWidget(selection)) {\n position = getBalloonTablePositionData(editor);\n }\n if (position) {\n balloon.updatePosition(position);\n }\n}\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected table in the editor content.\n *\n * @param editor The editor instance.\n */\nexport function getBalloonTablePositionData(editor) {\n const selection = editor.model.document.selection;\n const modelTable = getSelectionAffectedTable(selection);\n const viewTable = editor.editing.mapper.toViewElement(modelTable);\n return {\n target: editor.editing.view.domConverter.mapViewToDom(viewTable),\n positions: BALLOON_POSITIONS\n };\n}\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected table cell in the editor content.\n *\n * @param editor The editor instance.\n */\nexport function getBalloonCellPositionData(editor) {\n const mapper = editor.editing.mapper;\n const domConverter = editor.editing.view.domConverter;\n const selection = editor.model.document.selection;\n if (selection.rangeCount > 1) {\n return {\n target: () => createBoundingRect(selection.getRanges(), editor),\n positions: BALLOON_POSITIONS\n };\n }\n const modelTableCell = getTableCellAtPosition(selection.getFirstPosition());\n const viewTableCell = mapper.toViewElement(modelTableCell);\n return {\n target: domConverter.mapViewToDom(viewTableCell),\n positions: BALLOON_POSITIONS\n };\n}\n/**\n * Returns the first selected table cell from a multi-cell or in-cell selection.\n *\n * @param position Document position.\n */\nfunction getTableCellAtPosition(position) {\n const isTableCellSelected = position.nodeAfter && position.nodeAfter.is('element', 'tableCell');\n return isTableCellSelected ? position.nodeAfter : position.findAncestor('tableCell');\n}\n/**\n * Returns bounding rectangle for given model ranges.\n *\n * @param ranges Model ranges that the bounding rect should be returned for.\n * @param editor The editor instance.\n */\nfunction createBoundingRect(ranges, editor) {\n const mapper = editor.editing.mapper;\n const domConverter = editor.editing.view.domConverter;\n const rects = Array.from(ranges).map(range => {\n const modelTableCell = getTableCellAtPosition(range.start);\n const viewTableCell = mapper.toViewElement(modelTableCell);\n return new Rect(domConverter.mapViewToDom(viewTableCell));\n });\n return Rect.getBoundingRect(rects);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isObject } from 'lodash-es';\n/**\n * Returns a string if all four values of box sides are equal.\n *\n * If a string is passed, it is treated as a single value (pass-through).\n *\n * ```ts\n * // Returns 'foo':\n * getSingleValue( { top: 'foo', right: 'foo', bottom: 'foo', left: 'foo' } );\n * getSingleValue( 'foo' );\n *\n * // Returns undefined:\n * getSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );\n * getSingleValue( { top: 'foo', right: 'foo' } );\n * ```\n */\nexport function getSingleValue(objectOrString) {\n if (!objectOrString || !isObject(objectOrString)) {\n return objectOrString;\n }\n const { top, right, bottom, left } = objectOrString;\n if (top == right && right == bottom && bottom == left) {\n return top;\n }\n}\n/**\n * Adds a unit to a value if the value is a number or a string representing a number.\n *\n * **Note**: It does nothing to non-numeric values.\n *\n * ```ts\n * getSingleValue( 25, 'px' ); // '25px'\n * getSingleValue( 25, 'em' ); // '25em'\n * getSingleValue( '25em', 'px' ); // '25em'\n * getSingleValue( 'foo', 'px' ); // 'foo'\n * ```\n *\n * @param defaultUnit A default unit added to a numeric value.\n */\nexport function addDefaultUnitToNumericValue(value, defaultUnit) {\n const numericValue = parseFloat(value);\n if (Number.isNaN(numericValue)) {\n return value;\n }\n if (String(numericValue) !== String(value)) {\n return value;\n }\n return `${numericValue}${defaultUnit}`;\n}\n/**\n * Returns the normalized configuration.\n *\n * @param options.includeAlignmentProperty Whether the \"alignment\" property should be added.\n * @param options.includePaddingProperty Whether the \"padding\" property should be added.\n * @param options.includeVerticalAlignmentProperty Whether the \"verticalAlignment\" property should be added.\n * @param options.includeHorizontalAlignmentProperty Whether the \"horizontalAlignment\" property should be added.\n * @param options.isRightToLeftContent Whether the content is right-to-left.\n */\nexport function getNormalizedDefaultProperties(config, options = {}) {\n const normalizedConfig = {\n borderStyle: 'none',\n borderWidth: '',\n borderColor: '',\n backgroundColor: '',\n width: '',\n height: '',\n ...config\n };\n if (options.includeAlignmentProperty && !normalizedConfig.alignment) {\n normalizedConfig.alignment = 'center';\n }\n if (options.includePaddingProperty && !normalizedConfig.padding) {\n normalizedConfig.padding = '';\n }\n if (options.includeVerticalAlignmentProperty && !normalizedConfig.verticalAlignment) {\n normalizedConfig.verticalAlignment = 'middle';\n }\n if (options.includeHorizontalAlignmentProperty && !normalizedConfig.horizontalAlignment) {\n normalizedConfig.horizontalAlignment = options.isRightToLeftContent ? 'right' : 'left';\n }\n return normalizedConfig;\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties/tablecellpropertiesui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, clickOutsideHandler, ContextualBalloon, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui.js';\nimport TableCellPropertiesView from './ui/tablecellpropertiesview.js';\nimport { colorFieldValidator, getLocalizedColorErrorText, getLocalizedLengthErrorText, defaultColors, lengthFieldValidator, lineWidthFieldValidator } from '../utils/ui/table-properties.js';\nimport { debounce } from 'lodash-es';\nimport { getTableWidgetAncestor } from '../utils/ui/widget.js';\nimport { getBalloonCellPositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon.js';\nimport tableCellProperties from './../../theme/icons/table-cell-properties.svg';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties.js';\nconst ERROR_TEXT_TIMEOUT = 500;\n// Map of view properties and related commands.\nconst propertyToCommandMap = {\n borderStyle: 'tableCellBorderStyle',\n borderColor: 'tableCellBorderColor',\n borderWidth: 'tableCellBorderWidth',\n height: 'tableCellHeight',\n width: 'tableCellWidth',\n padding: 'tableCellPadding',\n backgroundColor: 'tableCellBackgroundColor',\n horizontalAlignment: 'tableCellHorizontalAlignment',\n verticalAlignment: 'tableCellVerticalAlignment'\n};\n/**\n * The table cell properties UI plugin. It introduces the `'tableCellProperties'` button\n * that opens a form allowing to specify the visual styling of a table cell.\n *\n * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.\n */\nexport default class TableCellPropertiesUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCellPropertiesUI';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('table.tableCellProperties', {\n borderColors: defaultColors,\n backgroundColors: defaultColors\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n this._defaultTableCellProperties = getNormalizedDefaultProperties(editor.config.get('table.tableCellProperties.defaultProperties'), {\n includeVerticalAlignmentProperty: true,\n includeHorizontalAlignmentProperty: true,\n includePaddingProperty: true,\n isRightToLeftContent: editor.locale.contentLanguageDirection === 'rtl'\n });\n this._balloon = editor.plugins.get(ContextualBalloon);\n this.view = null;\n this._isReady = false;\n editor.ui.componentFactory.add('tableCellProperties', locale => {\n const view = new ButtonView(locale);\n view.set({\n label: t('Cell properties'),\n icon: tableCellProperties,\n tooltip: true\n });\n this.listenTo(view, 'execute', () => this._showView());\n const commands = Object.values(propertyToCommandMap)\n .map(commandName => editor.commands.get(commandName));\n view.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => (areEnabled.some(isCommandEnabled => isCommandEnabled)));\n return view;\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed.\n // See https://github.com/ckeditor/ckeditor5/issues/1341.\n if (this.view) {\n this.view.destroy();\n }\n }\n /**\n * Creates the {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView} instance.\n *\n * @returns The cell properties form view instance.\n */\n _createPropertiesView() {\n const editor = this.editor;\n const config = editor.config.get('table.tableCellProperties');\n const borderColorsConfig = normalizeColorOptions(config.borderColors);\n const localizedBorderColors = getLocalizedColorOptions(editor.locale, borderColorsConfig);\n const backgroundColorsConfig = normalizeColorOptions(config.backgroundColors);\n const localizedBackgroundColors = getLocalizedColorOptions(editor.locale, backgroundColorsConfig);\n const hasColorPicker = config.colorPicker !== false;\n const view = new TableCellPropertiesView(editor.locale, {\n borderColors: localizedBorderColors,\n backgroundColors: localizedBackgroundColors,\n defaultTableCellProperties: this._defaultTableCellProperties,\n colorPickerConfig: hasColorPicker ? (config.colorPicker || {}) : false\n });\n const t = editor.t;\n // Render the view so its #element is available for the clickOutsideHandler.\n view.render();\n this.listenTo(view, 'submit', () => {\n this._hideView();\n });\n this.listenTo(view, 'cancel', () => {\n // https://github.com/ckeditor/ckeditor5/issues/6180\n if (this._undoStepBatch.operations.length) {\n editor.execute('undo', this._undoStepBatch);\n }\n this._hideView();\n });\n // Close the balloon on Esc key press.\n view.keystrokes.set('Esc', (data, cancel) => {\n this._hideView();\n cancel();\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: view,\n activator: () => this._isViewInBalloon,\n contextElements: [this._balloon.view.element],\n callback: () => this._hideView()\n });\n const colorErrorText = getLocalizedColorErrorText(t);\n const lengthErrorText = getLocalizedLengthErrorText(t);\n // Create the \"UI -> editor data\" binding.\n // These listeners update the editor data (via table commands) when any observable\n // property of the view has changed. They also validate the value and display errors in the UI\n // when necessary. This makes the view live, which means the changes are\n // visible in the editing as soon as the user types or changes fields' values.\n view.on('change:borderStyle', this._getPropertyChangeCallback('tableCellBorderStyle'));\n view.on('change:borderColor', this._getValidatedPropertyChangeCallback({\n viewField: view.borderColorInput,\n commandName: 'tableCellBorderColor',\n errorText: colorErrorText,\n validator: colorFieldValidator\n }));\n view.on('change:borderWidth', this._getValidatedPropertyChangeCallback({\n viewField: view.borderWidthInput,\n commandName: 'tableCellBorderWidth',\n errorText: lengthErrorText,\n validator: lineWidthFieldValidator\n }));\n view.on('change:padding', this._getValidatedPropertyChangeCallback({\n viewField: view.paddingInput,\n commandName: 'tableCellPadding',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:width', this._getValidatedPropertyChangeCallback({\n viewField: view.widthInput,\n commandName: 'tableCellWidth',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:height', this._getValidatedPropertyChangeCallback({\n viewField: view.heightInput,\n commandName: 'tableCellHeight',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:backgroundColor', this._getValidatedPropertyChangeCallback({\n viewField: view.backgroundInput,\n commandName: 'tableCellBackgroundColor',\n errorText: colorErrorText,\n validator: colorFieldValidator\n }));\n view.on('change:horizontalAlignment', this._getPropertyChangeCallback('tableCellHorizontalAlignment'));\n view.on('change:verticalAlignment', this._getPropertyChangeCallback('tableCellVerticalAlignment'));\n return view;\n }\n /**\n * In this method the \"editor data -> UI\" binding is happening.\n *\n * When executed, this method obtains selected cell property values from various table commands\n * and passes them to the {@link #view}.\n *\n * This way, the UI stays up–to–date with the editor data.\n */\n _fillViewFormFromCommandValues() {\n const commands = this.editor.commands;\n const borderStyleCommand = commands.get('tableCellBorderStyle');\n Object.entries(propertyToCommandMap)\n .map(([property, commandName]) => {\n const defaultValue = this._defaultTableCellProperties[property] || '';\n return [\n property,\n commands.get(commandName).value || defaultValue\n ];\n })\n .forEach(([property, value]) => {\n // Do not set the `border-color` and `border-width` fields if `border-style:none`.\n if ((property === 'borderColor' || property === 'borderWidth') && borderStyleCommand.value === 'none') {\n return;\n }\n this.view.set(property, value);\n });\n this._isReady = true;\n }\n /**\n * Shows the {@link #view} in the {@link #_balloon}.\n *\n * **Note**: Each time a view is shown, a new {@link #_undoStepBatch} is created. It contains\n * all changes made to the document when the view is visible, allowing a single undo step\n * for all of them.\n */\n _showView() {\n const editor = this.editor;\n if (!this.view) {\n this.view = this._createPropertiesView();\n }\n this.listenTo(editor.ui, 'update', () => {\n this._updateView();\n });\n // Update the view with the model values.\n this._fillViewFormFromCommandValues();\n this._balloon.add({\n view: this.view,\n position: getBalloonCellPositionData(editor)\n });\n // Create a new batch. Clicking \"Cancel\" will undo this batch.\n this._undoStepBatch = editor.model.createBatch();\n // Basic a11y.\n this.view.focus();\n }\n /**\n * Removes the {@link #view} from the {@link #_balloon}.\n */\n _hideView() {\n const editor = this.editor;\n this.stopListening(editor.ui, 'update');\n this._isReady = false;\n // Blur any input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n this.view.saveButtonView.focus();\n this._balloon.remove(this.view);\n // Make sure the focus is not lost in the process by putting it directly\n // into the editing view.\n this.editor.editing.view.focus();\n }\n /**\n * Repositions the {@link #_balloon} or hides the {@link #view} if a table cell is no longer selected.\n */\n _updateView() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n if (!getTableWidgetAncestor(viewDocument.selection)) {\n this._hideView();\n }\n else if (this._isViewVisible) {\n repositionContextualBalloon(editor, 'cell');\n }\n }\n /**\n * Returns `true` when the {@link #view} is visible in the {@link #_balloon}.\n */\n get _isViewVisible() {\n return !!this.view && this._balloon.visibleView === this.view;\n }\n /**\n * Returns `true` when the {@link #view} is in the {@link #_balloon}.\n */\n get _isViewInBalloon() {\n return !!this.view && this._balloon.hasView(this.view);\n }\n /**\n * Creates a callback that when executed upon the {@link #view view's} property change\n * executes a related editor command with the new property value.\n *\n * @param defaultValue The default value of the command.\n */\n _getPropertyChangeCallback(commandName) {\n return (evt, propertyName, newValue) => {\n if (!this._isReady) {\n return;\n }\n this.editor.execute(commandName, {\n value: newValue,\n batch: this._undoStepBatch\n });\n };\n }\n /**\n * Creates a callback that when executed upon the {@link #view view's} property change:\n * * Executes a related editor command with the new property value if the value is valid,\n * * Or sets the error text next to the invalid field, if the value did not pass the validation.\n */\n _getValidatedPropertyChangeCallback(options) {\n const { commandName, viewField, validator, errorText } = options;\n const setErrorTextDebounced = debounce(() => {\n viewField.errorText = errorText;\n }, ERROR_TEXT_TIMEOUT);\n return (evt, propertyName, newValue) => {\n setErrorTextDebounced.cancel();\n // Do not execute the command on initial call (opening the table properties view).\n if (!this._isReady) {\n return;\n }\n if (validator(newValue)) {\n this.editor.execute(commandName, {\n value: newValue,\n batch: this._undoStepBatch\n });\n viewField.errorText = null;\n }\n else {\n setErrorTextDebounced();\n }\n };\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z\\\" opacity=\\\".6\\\"/><path d=\\\"m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties/commands/tablecellpropertycommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\n/**\n * The table cell attribute command.\n *\n * The command is a base command for other table cell property commands.\n */\nexport default class TableCellPropertyCommand extends Command {\n /**\n * Creates a new `TableCellPropertyCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param attributeName Table cell attribute name.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, attributeName, defaultValue) {\n super(editor);\n this.attributeName = attributeName;\n this._defaultValue = defaultValue;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedTableCells = tableUtils.getSelectionAffectedTableCells(editor.model.document.selection);\n this.isEnabled = !!selectedTableCells.length;\n this.value = this._getSingleValue(selectedTableCells);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options.value If set, the command will set the attribute on selected table cells.\n * If it is not set, the command will remove the attribute from the selected table cells.\n * @param options.batch Pass the model batch instance to the command to aggregate changes,\n * for example to allow a single undo step for multiple executions.\n */\n execute(options = {}) {\n const { value, batch } = options;\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const tableCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const valueToSet = this._getValueToSet(value);\n model.enqueueChange(batch, writer => {\n if (valueToSet) {\n tableCells.forEach(tableCell => writer.setAttribute(this.attributeName, valueToSet, tableCell));\n }\n else {\n tableCells.forEach(tableCell => writer.removeAttribute(this.attributeName, tableCell));\n }\n });\n }\n /**\n * Returns the attribute value for a table cell.\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = tableCell.getAttribute(this.attributeName);\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * Returns the proper model value. It can be used to add a default unit to numeric values.\n */\n _getValueToSet(value) {\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * Returns a single value for all selected table cells. If the value is the same for all cells,\n * it will be returned (`undefined` otherwise).\n */\n _getSingleValue(tableCells) {\n const firstCellValue = this._getAttribute(tableCells[0]);\n const everyCellHasAttribute = tableCells.every(tableCells => this._getAttribute(tableCells) === firstCellValue);\n return everyCellHasAttribute ? firstCellValue : undefined;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from '../../tablecellproperties/commands/tablecellpropertycommand.js';\nimport { addDefaultUnitToNumericValue } from '../../utils/table-properties.js';\n/**\n * The table cell width command.\n *\n * The command is registered by the {@link module:table/tablecellwidth/tablecellwidthediting~TableCellWidthEditing} as\n * the `'tableCellWidth'` editor command.\n *\n * To change the width of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellWidth', {\n * value: '50px'\n * } );\n * ```\n *\n * **Note**: This command adds a default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableCellWidth', {\n * value: '50'\n * } );\n * ```\n *\n * will set the `width` attribute to `'50px'` in the model.\n */\nexport default class TableCellWidthCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellWidthCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellWidth', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n value = addDefaultUnitToNumericValue(value, 'px');\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellwidth/tablecellwidthediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport TableEditing from './../tableediting.js';\nimport TableCellWidthCommand from './commands/tablecellwidthcommand.js';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties.js';\nimport { enableProperty } from '../utils/common.js';\n/**\n * The table cell width editing feature.\n *\n * Introduces `tableCellWidth` table cell model attribute alongside with its converters\n * and a command.\n */\nexport default class TableCellWidthEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCellWidthEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const defaultTableCellProperties = getNormalizedDefaultProperties(editor.config.get('table.tableCellProperties.defaultProperties'));\n enableProperty(editor.model.schema, editor.conversion, {\n modelAttribute: 'tableCellWidth',\n styleName: 'width',\n defaultValue: defaultTableCellProperties.width\n });\n editor.commands.add('tableCellWidth', new TableCellWidthCommand(editor, defaultTableCellProperties.width));\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand.js';\nimport { addDefaultUnitToNumericValue, getSingleValue } from '../../utils/table-properties.js';\n/**\n * The table cell padding command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellPadding'` editor command.\n *\n * To change the padding of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellPadding', {\n * value: '5px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableCellPadding', {\n * value: '5'\n * } );\n * ```\n *\n * will set the `padding` attribute to `'5px'` in the model.\n */\nexport default class TableCellPaddingCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellPaddingCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellPadding', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = getSingleValue(tableCell.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n const newValue = addDefaultUnitToNumericValue(value, 'px');\n if (newValue === this._defaultValue) {\n return;\n }\n return newValue;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand.js';\nimport { addDefaultUnitToNumericValue } from '../../utils/table-properties.js';\n/**\n * The table cell height command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellHeight'` editor command.\n *\n * To change the height of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellHeight', {\n * value: '50px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableCellHeight', {\n * value: '50'\n * } );\n * ```\n *\n * will set the `height` attribute to `'50px'` in the model.\n */\nexport default class TableCellHeightCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellHeightCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellHeight', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n const newValue = addDefaultUnitToNumericValue(value, 'px');\n if (newValue === this._defaultValue) {\n return;\n }\n return newValue;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand.js';\n/**\n * The table cell background color command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellBackgroundColor'` editor command.\n *\n * To change the background color of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellBackgroundColor', {\n * value: '#f00'\n * } );\n * ```\n */\nexport default class TableCellBackgroundColorCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellBackgroundColorCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellBackgroundColor', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand.js';\n/**\n * The table cell vertical alignment command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellVerticalAlignment'` editor command.\n *\n * To change the vertical text alignment of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellVerticalAlignment', {\n * value: 'top'\n * } );\n * ```\n *\n * The following values, corresponding to the\n * [`vertical-align` CSS attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align), are allowed:\n *\n * * `'top'`\n * * `'bottom'`\n *\n * The `'middle'` value is the default one so there is no need to set it.\n */\nexport default class TableCellVerticalAlignmentCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellVerticalAlignmentCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value for the \"alignment\" attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellVerticalAlignment', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand.js';\n/**\n * The table cell horizontal alignment command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellHorizontalAlignment'` editor command.\n *\n * To change the horizontal text alignment of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellHorizontalAlignment', {\n * value: 'right'\n * } );\n * ```\n */\nexport default class TableCellHorizontalAlignmentCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellHorizontalAlignmentCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value for the \"alignment\" attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellHorizontalAlignment', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand.js';\nimport { getSingleValue } from '../../utils/table-properties.js';\n/**\n * The table cell border style command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellBorderStyle'` editor command.\n *\n * To change the border style of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellBorderStyle', {\n * value: 'dashed'\n * } );\n * ```\n */\nexport default class TableCellBorderStyleCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellBorderStyleCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellBorderStyle', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = getSingleValue(tableCell.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand.js';\nimport { getSingleValue } from '../../utils/table-properties.js';\n/**\n * The table cell border color command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellBorderColor'` editor command.\n *\n * To change the border color of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellBorderColor', {\n * value: '#f00'\n * } );\n * ```\n */\nexport default class TableCellBorderColorCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellBorderColorCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellBorderColor', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = getSingleValue(tableCell.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand.js';\nimport { addDefaultUnitToNumericValue, getSingleValue } from '../../utils/table-properties.js';\n/**\n * The table cell border width command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellBorderWidth'` editor command.\n *\n * To change the border width of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellBorderWidth', {\n * value: '5px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableCellBorderWidth', {\n * value: '5'\n * } );\n * ```\n *\n * will set the `borderWidth` attribute to `'5px'` in the model.\n */\nexport default class TableCellBorderWidthCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellBorderWidthCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellBorderWidth', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = getSingleValue(tableCell.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n const newValue = addDefaultUnitToNumericValue(value, 'px');\n if (newValue === this._defaultValue) {\n return;\n }\n return newValue;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties/tablecellpropertiesediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { addBorderRules, addPaddingRules, addBackgroundRules } from 'ckeditor5/src/engine.js';\nimport { downcastAttributeToStyle, upcastBorderStyles } from './../converters/tableproperties.js';\nimport TableEditing from './../tableediting.js';\nimport TableCellWidthEditing from '../tablecellwidth/tablecellwidthediting.js';\nimport TableCellPaddingCommand from './commands/tablecellpaddingcommand.js';\nimport TableCellHeightCommand from './commands/tablecellheightcommand.js';\nimport TableCellBackgroundColorCommand from './commands/tablecellbackgroundcolorcommand.js';\nimport TableCellVerticalAlignmentCommand from './commands/tablecellverticalalignmentcommand.js';\nimport TableCellHorizontalAlignmentCommand from './commands/tablecellhorizontalalignmentcommand.js';\nimport TableCellBorderStyleCommand from './commands/tablecellborderstylecommand.js';\nimport TableCellBorderColorCommand from './commands/tablecellbordercolorcommand.js';\nimport TableCellBorderWidthCommand from './commands/tablecellborderwidthcommand.js';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties.js';\nimport { enableProperty } from '../utils/common.js';\nconst VALIGN_VALUES_REG_EXP = /^(top|middle|bottom)$/;\nconst ALIGN_VALUES_REG_EXP = /^(left|center|right|justify)$/;\n/**\n * The table cell properties editing feature.\n *\n * Introduces table cell model attributes and their conversion:\n *\n * - border: `tableCellBorderStyle`, `tableCellBorderColor` and `tableCellBorderWidth`\n * - background color: `tableCellBackgroundColor`\n * - cell padding: `tableCellPadding`\n * - horizontal and vertical alignment: `tableCellHorizontalAlignment`, `tableCellVerticalAlignment`\n * - cell width and height: `tableCellWidth`, `tableCellHeight`\n *\n * It also registers commands used to manipulate the above attributes:\n *\n * - border: the `'tableCellBorderStyle'`, `'tableCellBorderColor'` and `'tableCellBorderWidth'` commands\n * - background color: the `'tableCellBackgroundColor'` command\n * - cell padding: the `'tableCellPadding'` command\n * - horizontal and vertical alignment: the `'tableCellHorizontalAlignment'` and `'tableCellVerticalAlignment'` commands\n * - width and height: the `'tableCellWidth'` and `'tableCellHeight'` commands\n */\nexport default class TableCellPropertiesEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCellPropertiesEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing, TableCellWidthEditing];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n editor.config.define('table.tableCellProperties.defaultProperties', {});\n const defaultTableCellProperties = getNormalizedDefaultProperties(editor.config.get('table.tableCellProperties.defaultProperties'), {\n includeVerticalAlignmentProperty: true,\n includeHorizontalAlignmentProperty: true,\n includePaddingProperty: true,\n isRightToLeftContent: editor.locale.contentLanguageDirection === 'rtl'\n });\n editor.data.addStyleProcessorRules(addBorderRules);\n enableBorderProperties(schema, conversion, {\n color: defaultTableCellProperties.borderColor,\n style: defaultTableCellProperties.borderStyle,\n width: defaultTableCellProperties.borderWidth\n });\n editor.commands.add('tableCellBorderStyle', new TableCellBorderStyleCommand(editor, defaultTableCellProperties.borderStyle));\n editor.commands.add('tableCellBorderColor', new TableCellBorderColorCommand(editor, defaultTableCellProperties.borderColor));\n editor.commands.add('tableCellBorderWidth', new TableCellBorderWidthCommand(editor, defaultTableCellProperties.borderWidth));\n enableProperty(schema, conversion, {\n modelAttribute: 'tableCellHeight',\n styleName: 'height',\n defaultValue: defaultTableCellProperties.height\n });\n editor.commands.add('tableCellHeight', new TableCellHeightCommand(editor, defaultTableCellProperties.height));\n editor.data.addStyleProcessorRules(addPaddingRules);\n enableProperty(schema, conversion, {\n modelAttribute: 'tableCellPadding',\n styleName: 'padding',\n reduceBoxSides: true,\n defaultValue: defaultTableCellProperties.padding\n });\n editor.commands.add('tableCellPadding', new TableCellPaddingCommand(editor, defaultTableCellProperties.padding));\n editor.data.addStyleProcessorRules(addBackgroundRules);\n enableProperty(schema, conversion, {\n modelAttribute: 'tableCellBackgroundColor',\n styleName: 'background-color',\n defaultValue: defaultTableCellProperties.backgroundColor\n });\n editor.commands.add('tableCellBackgroundColor', new TableCellBackgroundColorCommand(editor, defaultTableCellProperties.backgroundColor));\n enableHorizontalAlignmentProperty(schema, conversion, defaultTableCellProperties.horizontalAlignment);\n editor.commands.add('tableCellHorizontalAlignment', new TableCellHorizontalAlignmentCommand(editor, defaultTableCellProperties.horizontalAlignment));\n enableVerticalAlignmentProperty(schema, conversion, defaultTableCellProperties.verticalAlignment);\n editor.commands.add('tableCellVerticalAlignment', new TableCellVerticalAlignmentCommand(editor, defaultTableCellProperties.verticalAlignment));\n }\n}\n/**\n * Enables the `'tableCellBorderStyle'`, `'tableCellBorderColor'` and `'tableCellBorderWidth'` attributes for table cells.\n *\n * @param defaultBorder The default border values.\n * @param defaultBorder.color The default `tableCellBorderColor` value.\n * @param defaultBorder.style The default `tableCellBorderStyle` value.\n * @param defaultBorder.width The default `tableCellBorderWidth` value.\n */\nfunction enableBorderProperties(schema, conversion, defaultBorder) {\n const modelAttributes = {\n width: 'tableCellBorderWidth',\n color: 'tableCellBorderColor',\n style: 'tableCellBorderStyle'\n };\n schema.extend('tableCell', {\n allowAttributes: Object.values(modelAttributes)\n });\n upcastBorderStyles(conversion, 'td', modelAttributes, defaultBorder);\n upcastBorderStyles(conversion, 'th', modelAttributes, defaultBorder);\n downcastAttributeToStyle(conversion, { modelElement: 'tableCell', modelAttribute: modelAttributes.style, styleName: 'border-style' });\n downcastAttributeToStyle(conversion, { modelElement: 'tableCell', modelAttribute: modelAttributes.color, styleName: 'border-color' });\n downcastAttributeToStyle(conversion, { modelElement: 'tableCell', modelAttribute: modelAttributes.width, styleName: 'border-width' });\n}\n/**\n * Enables the `'tableCellHorizontalAlignment'` attribute for table cells.\n *\n * @param defaultValue The default horizontal alignment value.\n */\nfunction enableHorizontalAlignmentProperty(schema, conversion, defaultValue) {\n schema.extend('tableCell', {\n allowAttributes: ['tableCellHorizontalAlignment']\n });\n conversion.for('downcast')\n .attributeToAttribute({\n model: {\n name: 'tableCell',\n key: 'tableCellHorizontalAlignment'\n },\n view: alignment => ({\n key: 'style',\n value: {\n 'text-align': alignment\n }\n })\n });\n conversion.for('upcast')\n // Support for the `text-align:*;` CSS definition for the table cell alignment.\n .attributeToAttribute({\n view: {\n name: /^(td|th)$/,\n styles: {\n 'text-align': ALIGN_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableCellHorizontalAlignment',\n value: (viewElement) => {\n const align = viewElement.getStyle('text-align');\n return align === defaultValue ? null : align;\n }\n }\n })\n // Support for the `align` attribute as the backward compatibility while pasting from other sources.\n .attributeToAttribute({\n view: {\n name: /^(td|th)$/,\n attributes: {\n align: ALIGN_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableCellHorizontalAlignment',\n value: (viewElement) => {\n const align = viewElement.getAttribute('align');\n return align === defaultValue ? null : align;\n }\n }\n });\n}\n/**\n * Enables the `'verticalAlignment'` attribute for table cells.\n *\n * @param defaultValue The default vertical alignment value.\n */\nfunction enableVerticalAlignmentProperty(schema, conversion, defaultValue) {\n schema.extend('tableCell', {\n allowAttributes: ['tableCellVerticalAlignment']\n });\n conversion.for('downcast')\n .attributeToAttribute({\n model: {\n name: 'tableCell',\n key: 'tableCellVerticalAlignment'\n },\n view: alignment => ({\n key: 'style',\n value: {\n 'vertical-align': alignment\n }\n })\n });\n conversion.for('upcast')\n // Support for the `vertical-align:*;` CSS definition for the table cell alignment.\n .attributeToAttribute({\n view: {\n name: /^(td|th)$/,\n styles: {\n 'vertical-align': VALIGN_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableCellVerticalAlignment',\n value: (viewElement) => {\n const align = viewElement.getStyle('vertical-align');\n return align === defaultValue ? null : align;\n }\n }\n })\n // Support for the `align` attribute as the backward compatibility while pasting from other sources.\n .attributeToAttribute({\n view: {\n name: /^(td|th)$/,\n attributes: {\n valign: VALIGN_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableCellVerticalAlignment',\n value: (viewElement) => {\n const valign = viewElement.getAttribute('valign');\n return valign === defaultValue ? null : valign;\n }\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { getSelectionAffectedTable } from '../../utils/common.js';\n/**\n * The table cell attribute command.\n *\n * This command is a base command for other table property commands.\n */\nexport default class TablePropertyCommand extends Command {\n /**\n * Creates a new `TablePropertyCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param attributeName Table cell attribute name.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, attributeName, defaultValue) {\n super(editor);\n this.attributeName = attributeName;\n this._defaultValue = defaultValue;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const table = getSelectionAffectedTable(selection);\n this.isEnabled = !!table;\n this.value = this._getValue(table);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options.value If set, the command will set the attribute on the selected table.\n * If not set, the command will remove the attribute from the selected table.\n * @param options.batch Pass the model batch instance to the command to aggregate changes,\n * for example, to allow a single undo step for multiple executions.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const { value, batch } = options;\n const table = getSelectionAffectedTable(selection);\n const valueToSet = this._getValueToSet(value);\n model.enqueueChange(batch, writer => {\n if (valueToSet) {\n writer.setAttribute(this.attributeName, valueToSet, table);\n }\n else {\n writer.removeAttribute(this.attributeName, table);\n }\n });\n }\n /**\n * Returns the attribute value for a table.\n */\n _getValue(table) {\n if (!table) {\n return;\n }\n const value = table.getAttribute(this.attributeName);\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * Returns the proper model value. It can be used to add a default unit to numeric values.\n */\n _getValueToSet(value) {\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand.js';\n/**\n * The table background color command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableBackgroundColor'` editor command.\n *\n * To change the background color of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableBackgroundColor', {\n * value: '#f00'\n * } );\n * ```\n */\nexport default class TableBackgroundColorCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableBackgroundColorCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableBackgroundColor', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand.js';\nimport { getSingleValue } from '../../utils/table-properties.js';\n/**\n * The table border color command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableBorderColor'` editor command.\n *\n * To change the border color of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableBorderColor', {\n * value: '#f00'\n * } );\n * ```\n */\nexport default class TableBorderColorCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableBorderColorCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableBorderColor', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValue(table) {\n if (!table) {\n return;\n }\n const value = getSingleValue(table.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand.js';\nimport { getSingleValue } from '../../utils/table-properties.js';\n/**\n * The table style border command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableBorderStyle'` editor command.\n *\n * To change the border style of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableBorderStyle', {\n * value: 'dashed'\n * } );\n * ```\n */\nexport default class TableBorderStyleCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableBorderStyleCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableBorderStyle', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValue(table) {\n if (!table) {\n return;\n }\n const value = getSingleValue(table.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand.js';\nimport { addDefaultUnitToNumericValue, getSingleValue } from '../../utils/table-properties.js';\n/**\n * The table width border command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableBorderWidth'` editor command.\n *\n * To change the border width of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableBorderWidth', {\n * value: '5px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableBorderWidth', {\n * value: '5'\n * } );\n * ```\n *\n * will set the `borderWidth` attribute to `'5px'` in the model.\n */\nexport default class TableBorderWidthCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableBorderWidthCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableBorderWidth', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValue(table) {\n if (!table) {\n return;\n }\n const value = getSingleValue(table.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n const newValue = addDefaultUnitToNumericValue(value, 'px');\n if (newValue === this._defaultValue) {\n return;\n }\n return newValue;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/commands/tablewidthcommand\n */\nimport TablePropertyCommand from './tablepropertycommand.js';\nimport { addDefaultUnitToNumericValue } from '../../utils/table-properties.js';\n/**\n * The table width command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableWidth'` editor command.\n *\n * To change the width of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableWidth', {\n * value: '400px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableWidth', {\n * value: '50'\n * } );\n * ```\n *\n * will set the `width` attribute to `'50px'` in the model.\n */\nexport default class TableWidthCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableWidthCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableWidth', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n value = addDefaultUnitToNumericValue(value, 'px');\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/commands/tableheightcommand\n */\nimport TablePropertyCommand from './tablepropertycommand.js';\nimport { addDefaultUnitToNumericValue } from '../../utils/table-properties.js';\n/**\n * The table height command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableHeight'` editor command.\n *\n * To change the height of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableHeight', {\n * value: '500px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableHeight', {\n * value: '50'\n * } );\n * ```\n *\n * will set the `height` attribute to `'50px'` in the model.\n */\nexport default class TableHeightCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableHeightCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableHeight', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n value = addDefaultUnitToNumericValue(value, 'px');\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand.js';\n/**\n * The table alignment command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableAlignment'` editor command.\n *\n * To change the alignment of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableAlignment', {\n * value: 'right'\n * } );\n * ```\n */\nexport default class TableAlignmentCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableAlignmentCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value for the \"alignment\" attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableAlignment', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/tablepropertiesediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { addBackgroundRules, addBorderRules } from 'ckeditor5/src/engine.js';\nimport TableEditing from '../tableediting.js';\nimport { downcastAttributeToStyle, downcastTableAttribute, upcastBorderStyles, upcastStyleToAttribute } from '../converters/tableproperties.js';\nimport TableBackgroundColorCommand from './commands/tablebackgroundcolorcommand.js';\nimport TableBorderColorCommand from './commands/tablebordercolorcommand.js';\nimport TableBorderStyleCommand from './commands/tableborderstylecommand.js';\nimport TableBorderWidthCommand from './commands/tableborderwidthcommand.js';\nimport TableWidthCommand from './commands/tablewidthcommand.js';\nimport TableHeightCommand from './commands/tableheightcommand.js';\nimport TableAlignmentCommand from './commands/tablealignmentcommand.js';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties.js';\nconst ALIGN_VALUES_REG_EXP = /^(left|center|right)$/;\nconst FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;\n/**\n * The table properties editing feature.\n *\n * Introduces table's model attributes and their conversion:\n *\n * - border: `tableBorderStyle`, `tableBorderColor` and `tableBorderWidth`\n * - background color: `tableBackgroundColor`\n * - horizontal alignment: `tableAlignment`\n * - width & height: `tableWidth` & `tableHeight`\n *\n * It also registers commands used to manipulate the above attributes:\n *\n * - border: `'tableBorderStyle'`, `'tableBorderColor'` and `'tableBorderWidth'` commands\n * - background color: `'tableBackgroundColor'`\n * - horizontal alignment: `'tableAlignment'`\n * - width & height: `'tableWidth'` & `'tableHeight'`\n */\nexport default class TablePropertiesEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TablePropertiesEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n editor.config.define('table.tableProperties.defaultProperties', {});\n const defaultTableProperties = getNormalizedDefaultProperties(editor.config.get('table.tableProperties.defaultProperties'), {\n includeAlignmentProperty: true\n });\n editor.data.addStyleProcessorRules(addBorderRules);\n enableBorderProperties(schema, conversion, {\n color: defaultTableProperties.borderColor,\n style: defaultTableProperties.borderStyle,\n width: defaultTableProperties.borderWidth\n });\n editor.commands.add('tableBorderColor', new TableBorderColorCommand(editor, defaultTableProperties.borderColor));\n editor.commands.add('tableBorderStyle', new TableBorderStyleCommand(editor, defaultTableProperties.borderStyle));\n editor.commands.add('tableBorderWidth', new TableBorderWidthCommand(editor, defaultTableProperties.borderWidth));\n enableAlignmentProperty(schema, conversion, defaultTableProperties.alignment);\n editor.commands.add('tableAlignment', new TableAlignmentCommand(editor, defaultTableProperties.alignment));\n enableTableToFigureProperty(schema, conversion, {\n modelAttribute: 'tableWidth',\n styleName: 'width',\n defaultValue: defaultTableProperties.width\n });\n editor.commands.add('tableWidth', new TableWidthCommand(editor, defaultTableProperties.width));\n enableTableToFigureProperty(schema, conversion, {\n modelAttribute: 'tableHeight',\n styleName: 'height',\n defaultValue: defaultTableProperties.height\n });\n editor.commands.add('tableHeight', new TableHeightCommand(editor, defaultTableProperties.height));\n editor.data.addStyleProcessorRules(addBackgroundRules);\n enableProperty(schema, conversion, {\n modelAttribute: 'tableBackgroundColor',\n styleName: 'background-color',\n defaultValue: defaultTableProperties.backgroundColor\n });\n editor.commands.add('tableBackgroundColor', new TableBackgroundColorCommand(editor, defaultTableProperties.backgroundColor));\n }\n}\n/**\n * Enables `tableBorderStyle'`, `tableBorderColor'` and `tableBorderWidth'` attributes for table.\n *\n * @param defaultBorder The default border values.\n * @param defaultBorder.color The default `tableBorderColor` value.\n * @param defaultBorder.style The default `tableBorderStyle` value.\n * @param defaultBorder.width The default `tableBorderWidth` value.\n */\nfunction enableBorderProperties(schema, conversion, defaultBorder) {\n const modelAttributes = {\n width: 'tableBorderWidth',\n color: 'tableBorderColor',\n style: 'tableBorderStyle'\n };\n schema.extend('table', {\n allowAttributes: Object.values(modelAttributes)\n });\n upcastBorderStyles(conversion, 'table', modelAttributes, defaultBorder);\n downcastTableAttribute(conversion, { modelAttribute: modelAttributes.color, styleName: 'border-color' });\n downcastTableAttribute(conversion, { modelAttribute: modelAttributes.style, styleName: 'border-style' });\n downcastTableAttribute(conversion, { modelAttribute: modelAttributes.width, styleName: 'border-width' });\n}\n/**\n * Enables the `'alignment'` attribute for table.\n *\n * @param defaultValue The default alignment value.\n */\nfunction enableAlignmentProperty(schema, conversion, defaultValue) {\n schema.extend('table', {\n allowAttributes: ['tableAlignment']\n });\n conversion.for('downcast')\n .attributeToAttribute({\n model: {\n name: 'table',\n key: 'tableAlignment'\n },\n view: alignment => ({\n key: 'style',\n value: {\n // Model: `alignment:center` => CSS: `float:none`.\n float: alignment === 'center' ? 'none' : alignment\n }\n }),\n converterPriority: 'high'\n });\n conversion.for('upcast')\n // Support for the `float:*;` CSS definition for the table alignment.\n .attributeToAttribute({\n view: {\n name: /^(table|figure)$/,\n styles: {\n float: FLOAT_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableAlignment',\n value: (viewElement) => {\n let align = viewElement.getStyle('float');\n // CSS: `float:none` => Model: `alignment:center`.\n if (align === 'none') {\n align = 'center';\n }\n return align === defaultValue ? null : align;\n }\n }\n })\n // Support for the `align` attribute as the backward compatibility while pasting from other sources.\n .attributeToAttribute({\n view: {\n attributes: {\n align: ALIGN_VALUES_REG_EXP\n }\n },\n model: {\n name: 'table',\n key: 'tableAlignment',\n value: (viewElement) => {\n const align = viewElement.getAttribute('align');\n return align === defaultValue ? null : align;\n }\n }\n });\n}\n/**\n * Enables conversion for an attribute for simple view-model mappings.\n *\n * @param options.defaultValue The default value for the specified `modelAttribute`.\n */\nfunction enableProperty(schema, conversion, options) {\n const { modelAttribute } = options;\n schema.extend('table', {\n allowAttributes: [modelAttribute]\n });\n upcastStyleToAttribute(conversion, { viewElement: 'table', ...options });\n downcastTableAttribute(conversion, options);\n}\n/**\n * Enables conversion for an attribute for simple view (figure) to model (table) mappings.\n */\nfunction enableTableToFigureProperty(schema, conversion, options) {\n const { modelAttribute } = options;\n schema.extend('table', {\n allowAttributes: [modelAttribute]\n });\n upcastStyleToAttribute(conversion, {\n viewElement: /^(table|figure)$/,\n shouldUpcast: (element) => !(element.name == 'table' && element.parent.name == 'figure'),\n ...options\n });\n downcastAttributeToStyle(conversion, { modelElement: 'table', ...options });\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableproperties.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableproperties.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/ui/tablepropertiesview\n */\nimport { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui.js';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';\nimport { icons } from 'ckeditor5/src/core.js';\nimport { fillToolbar, getBorderStyleDefinitions, getBorderStyleLabels, getLabeledColorInputCreator } from '../../utils/ui/table-properties.js';\nimport FormRowView from '../../ui/formrowview.js';\nimport '../../../theme/form.css';\nimport '../../../theme/tableform.css';\nimport '../../../theme/tableproperties.css';\n/**\n * The class representing a table properties form, allowing users to customize\n * certain style aspects of a table, for instance, border, background color, alignment, etc..\n */\nexport default class TablePropertiesView extends View {\n /**\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param options Additional configuration of the view.\n */\n constructor(locale, options) {\n super(locale);\n this.set({\n borderStyle: '',\n borderWidth: '',\n borderColor: '',\n backgroundColor: '',\n width: '',\n height: '',\n alignment: ''\n });\n this.options = options;\n const { borderStyleDropdown, borderWidthInput, borderColorInput, borderRowLabel } = this._createBorderFields();\n const { backgroundRowLabel, backgroundInput } = this._createBackgroundFields();\n const { widthInput, operatorLabel, heightInput, dimensionsLabel } = this._createDimensionFields();\n const { alignmentToolbar, alignmentLabel } = this._createAlignmentFields();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.children = this.createCollection();\n this.borderStyleDropdown = borderStyleDropdown;\n this.borderWidthInput = borderWidthInput;\n this.borderColorInput = borderColorInput;\n this.backgroundInput = backgroundInput;\n this.widthInput = widthInput;\n this.heightInput = heightInput;\n this.alignmentToolbar = alignmentToolbar;\n // Defer creating to make sure other fields are present and the Save button can\n // bind its #isEnabled to their error messages so there's no way to save unless all\n // fields are valid.\n const { saveButtonView, cancelButtonView } = this._createActionButtons();\n this.saveButtonView = saveButtonView;\n this.cancelButtonView = cancelButtonView;\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n // Form header.\n this.children.add(new FormHeaderView(locale, {\n label: this.t('Table properties')\n }));\n // Border row.\n this.children.add(new FormRowView(locale, {\n labelView: borderRowLabel,\n children: [\n borderRowLabel,\n borderStyleDropdown,\n borderColorInput,\n borderWidthInput\n ],\n class: 'ck-table-form__border-row'\n }));\n // Background row.\n this.children.add(new FormRowView(locale, {\n labelView: backgroundRowLabel,\n children: [\n backgroundRowLabel,\n backgroundInput\n ],\n class: 'ck-table-form__background-row'\n }));\n this.children.add(new FormRowView(locale, {\n children: [\n // Dimensions row.\n new FormRowView(locale, {\n labelView: dimensionsLabel,\n children: [\n dimensionsLabel,\n widthInput,\n operatorLabel,\n heightInput\n ],\n class: 'ck-table-form__dimensions-row'\n }),\n // Alignment row.\n new FormRowView(locale, {\n labelView: alignmentLabel,\n children: [\n alignmentLabel,\n alignmentToolbar\n ],\n class: 'ck-table-properties-form__alignment-row'\n })\n ]\n }));\n // Action row.\n this.children.add(new FormRowView(locale, {\n children: [\n this.saveButtonView,\n this.cancelButtonView\n ],\n class: 'ck-table-form__action-row'\n }));\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-form',\n 'ck-table-form',\n 'ck-table-properties-form'\n ],\n // https://github.com/ckeditor/ckeditor5-link/issues/90\n tabindex: '-1'\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Enable the \"submit\" event for this view. It can be triggered by the #saveButtonView\n // which is of the \"submit\" DOM \"type\".\n submitHandler({\n view: this\n });\n // Maintain continuous focus cycling over views that have focusable children and focus cyclers themselves.\n [this.borderColorInput, this.backgroundInput].forEach(view => {\n this._focusCycler.chain(view.fieldView.focusCycler);\n });\n [\n this.borderStyleDropdown,\n this.borderColorInput,\n this.borderWidthInput,\n this.backgroundInput,\n this.widthInput,\n this.heightInput,\n this.alignmentToolbar,\n this.saveButtonView,\n this.cancelButtonView\n ].forEach(view => {\n // Register the view as focusable.\n this._focusables.add(view);\n // Register the view in the focus tracker.\n this.focusTracker.add(view.element);\n });\n // Mainly for closing using \"Esc\" and navigation using \"Tab\".\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist focusable field in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #borderStyleDropdown},\n * * {@link #borderWidthInput},\n * * {@link #borderColorInput}.\n */\n _createBorderFields() {\n const defaultTableProperties = this.options.defaultTableProperties;\n const defaultBorder = {\n style: defaultTableProperties.borderStyle,\n width: defaultTableProperties.borderWidth,\n color: defaultTableProperties.borderColor\n };\n const colorInputCreator = getLabeledColorInputCreator({\n colorConfig: this.options.borderColors,\n columns: 5,\n defaultColorValue: defaultBorder.color,\n colorPickerConfig: this.options.colorPickerConfig\n });\n const locale = this.locale;\n const t = this.t;\n const accessibleLabel = t('Style');\n // -- Group label ---------------------------------------------\n const borderRowLabel = new LabelView(locale);\n borderRowLabel.text = t('Border');\n // -- Style ---------------------------------------------------\n const styleLabels = getBorderStyleLabels(t);\n const borderStyleDropdown = new LabeledFieldView(locale, createLabeledDropdown);\n borderStyleDropdown.set({\n label: accessibleLabel,\n class: 'ck-table-form__border-style'\n });\n borderStyleDropdown.fieldView.buttonView.set({\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined,\n isOn: false,\n withText: true,\n tooltip: accessibleLabel\n });\n borderStyleDropdown.fieldView.buttonView.bind('label').to(this, 'borderStyle', value => {\n return styleLabels[value ? value : 'none'];\n });\n borderStyleDropdown.fieldView.on('execute', evt => {\n this.borderStyle = evt.source._borderStyleValue;\n });\n borderStyleDropdown.bind('isEmpty').to(this, 'borderStyle', value => !value);\n addListToDropdown(borderStyleDropdown.fieldView, getBorderStyleDefinitions(this, defaultBorder.style), {\n role: 'menu',\n ariaLabel: accessibleLabel\n });\n // -- Width ---------------------------------------------------\n const borderWidthInput = new LabeledFieldView(locale, createLabeledInputText);\n borderWidthInput.set({\n label: t('Width'),\n class: 'ck-table-form__border-width'\n });\n borderWidthInput.fieldView.bind('value').to(this, 'borderWidth');\n borderWidthInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);\n borderWidthInput.fieldView.on('input', () => {\n this.borderWidth = borderWidthInput.fieldView.element.value;\n });\n // -- Color ---------------------------------------------------\n const borderColorInput = new LabeledFieldView(locale, colorInputCreator);\n borderColorInput.set({\n label: t('Color'),\n class: 'ck-table-form__border-color'\n });\n borderColorInput.fieldView.bind('value').to(this, 'borderColor');\n borderColorInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);\n borderColorInput.fieldView.on('input', () => {\n this.borderColor = borderColorInput.fieldView.value;\n });\n // Reset the border color and width fields depending on the `border-style` value.\n this.on('change:borderStyle', (evt, name, newValue, oldValue) => {\n // When removing the border (`border-style:none`), clear the remaining `border-*` properties.\n // See: https://github.com/ckeditor/ckeditor5/issues/6227.\n if (!isBorderStyleSet(newValue)) {\n this.borderColor = '';\n this.borderWidth = '';\n }\n // When setting the `border-style` from `none`, set the default `border-color` and `border-width` properties.\n if (!isBorderStyleSet(oldValue)) {\n this.borderColor = defaultBorder.color;\n this.borderWidth = defaultBorder.width;\n }\n });\n return {\n borderRowLabel,\n borderStyleDropdown,\n borderColorInput,\n borderWidthInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #backgroundInput}.\n */\n _createBackgroundFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Group label ---------------------------------------------\n const backgroundRowLabel = new LabelView(locale);\n backgroundRowLabel.text = t('Background');\n // -- Background color input -----------------------------------\n const backgroundInputCreator = getLabeledColorInputCreator({\n colorConfig: this.options.backgroundColors,\n columns: 5,\n defaultColorValue: this.options.defaultTableProperties.backgroundColor,\n colorPickerConfig: this.options.colorPickerConfig\n });\n const backgroundInput = new LabeledFieldView(locale, backgroundInputCreator);\n backgroundInput.set({\n label: t('Color'),\n class: 'ck-table-properties-form__background'\n });\n backgroundInput.fieldView.bind('value').to(this, 'backgroundColor');\n backgroundInput.fieldView.on('input', () => {\n this.backgroundColor = backgroundInput.fieldView.value;\n });\n return {\n backgroundRowLabel,\n backgroundInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #widthInput},\n * * {@link #heightInput}.\n */\n _createDimensionFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Label ---------------------------------------------------\n const dimensionsLabel = new LabelView(locale);\n dimensionsLabel.text = t('Dimensions');\n // -- Width ---------------------------------------------------\n const widthInput = new LabeledFieldView(locale, createLabeledInputText);\n widthInput.set({\n label: t('Width'),\n class: 'ck-table-form__dimensions-row__width'\n });\n widthInput.fieldView.bind('value').to(this, 'width');\n widthInput.fieldView.on('input', () => {\n this.width = widthInput.fieldView.element.value;\n });\n // -- Operator ---------------------------------------------------\n const operatorLabel = new View(locale);\n operatorLabel.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck-table-form__dimension-operator'\n ]\n },\n children: [\n { text: '×' }\n ]\n });\n // -- Height ---------------------------------------------------\n const heightInput = new LabeledFieldView(locale, createLabeledInputText);\n heightInput.set({\n label: t('Height'),\n class: 'ck-table-form__dimensions-row__height'\n });\n heightInput.fieldView.bind('value').to(this, 'height');\n heightInput.fieldView.on('input', () => {\n this.height = heightInput.fieldView.element.value;\n });\n return {\n dimensionsLabel,\n widthInput,\n operatorLabel,\n heightInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #alignmentToolbar}.\n */\n _createAlignmentFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Label ---------------------------------------------------\n const alignmentLabel = new LabelView(locale);\n alignmentLabel.text = t('Alignment');\n // -- Toolbar ---------------------------------------------------\n const alignmentToolbar = new ToolbarView(locale);\n alignmentToolbar.set({\n isCompact: true,\n ariaLabel: t('Table alignment toolbar')\n });\n fillToolbar({\n view: this,\n icons: {\n left: icons.objectLeft,\n center: icons.objectCenter,\n right: icons.objectRight\n },\n toolbar: alignmentToolbar,\n labels: this._alignmentLabels,\n propertyName: 'alignment',\n defaultValue: this.options.defaultTableProperties.alignment\n });\n return {\n alignmentLabel,\n alignmentToolbar\n };\n }\n /**\n * Creates the following form controls:\n *\n * * {@link #saveButtonView},\n * * {@link #cancelButtonView}.\n */\n _createActionButtons() {\n const locale = this.locale;\n const t = this.t;\n const saveButtonView = new ButtonView(locale);\n const cancelButtonView = new ButtonView(locale);\n const fieldsThatShouldValidateToSave = [\n this.borderWidthInput,\n this.borderColorInput,\n this.backgroundInput,\n this.widthInput,\n this.heightInput\n ];\n saveButtonView.set({\n label: t('Save'),\n icon: icons.check,\n class: 'ck-button-save',\n type: 'submit',\n withText: true\n });\n saveButtonView.bind('isEnabled').toMany(fieldsThatShouldValidateToSave, 'errorText', (...errorTexts) => {\n return errorTexts.every(errorText => !errorText);\n });\n cancelButtonView.set({\n label: t('Cancel'),\n icon: icons.cancel,\n class: 'ck-button-cancel',\n withText: true\n });\n cancelButtonView.delegate('execute').to(this, 'cancel');\n return {\n saveButtonView, cancelButtonView\n };\n }\n /**\n * Provides localized labels for {@link #alignmentToolbar} buttons.\n */\n get _alignmentLabels() {\n const locale = this.locale;\n const t = this.t;\n const left = t('Align table to the left');\n const center = t('Center table');\n const right = t('Align table to the right');\n // Returns object with a proper order of labels.\n if (locale.uiLanguageDirection === 'rtl') {\n return { right, center, left };\n }\n else {\n return { left, center, right };\n }\n }\n}\nfunction isBorderStyleSet(value) {\n return value !== 'none';\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z\\\" opacity=\\\".6\\\"/><path d=\\\"m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/tablepropertiesui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, ContextualBalloon, clickOutsideHandler, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui.js';\nimport { debounce } from 'lodash-es';\nimport TablePropertiesView from './ui/tablepropertiesview.js';\nimport tableProperties from './../../theme/icons/table-properties.svg';\nimport { colorFieldValidator, getLocalizedColorErrorText, getLocalizedLengthErrorText, lengthFieldValidator, lineWidthFieldValidator, defaultColors } from '../utils/ui/table-properties.js';\nimport { getSelectionAffectedTableWidget } from '../utils/ui/widget.js';\nimport { getBalloonTablePositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon.js';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties.js';\nconst ERROR_TEXT_TIMEOUT = 500;\n// Map of view properties and related commands.\nconst propertyToCommandMap = {\n borderStyle: 'tableBorderStyle',\n borderColor: 'tableBorderColor',\n borderWidth: 'tableBorderWidth',\n backgroundColor: 'tableBackgroundColor',\n width: 'tableWidth',\n height: 'tableHeight',\n alignment: 'tableAlignment'\n};\n/**\n * The table properties UI plugin. It introduces the `'tableProperties'` button\n * that opens a form allowing to specify visual styling of an entire table.\n *\n * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.\n */\nexport default class TablePropertiesUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TablePropertiesUI';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * The properties form view displayed inside the balloon.\n */\n this.view = null;\n editor.config.define('table.tableProperties', {\n borderColors: defaultColors,\n backgroundColors: defaultColors\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n this._defaultTableProperties = getNormalizedDefaultProperties(editor.config.get('table.tableProperties.defaultProperties'), {\n includeAlignmentProperty: true\n });\n this._balloon = editor.plugins.get(ContextualBalloon);\n editor.ui.componentFactory.add('tableProperties', locale => {\n const view = new ButtonView(locale);\n view.set({\n label: t('Table properties'),\n icon: tableProperties,\n tooltip: true\n });\n this.listenTo(view, 'execute', () => this._showView());\n const commands = Object.values(propertyToCommandMap)\n .map(commandName => editor.commands.get(commandName));\n view.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => (areEnabled.some(isCommandEnabled => isCommandEnabled)));\n return view;\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed.\n // See https://github.com/ckeditor/ckeditor5/issues/1341.\n if (this.view) {\n this.view.destroy();\n }\n }\n /**\n * Creates the {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView} instance.\n *\n * @returns The table properties form view instance.\n */\n _createPropertiesView() {\n const editor = this.editor;\n const config = editor.config.get('table.tableProperties');\n const borderColorsConfig = normalizeColorOptions(config.borderColors);\n const localizedBorderColors = getLocalizedColorOptions(editor.locale, borderColorsConfig);\n const backgroundColorsConfig = normalizeColorOptions(config.backgroundColors);\n const localizedBackgroundColors = getLocalizedColorOptions(editor.locale, backgroundColorsConfig);\n const hasColorPicker = config.colorPicker !== false;\n const view = new TablePropertiesView(editor.locale, {\n borderColors: localizedBorderColors,\n backgroundColors: localizedBackgroundColors,\n defaultTableProperties: this._defaultTableProperties,\n colorPickerConfig: hasColorPicker ? (config.colorPicker || {}) : false\n });\n const t = editor.t;\n // Render the view so its #element is available for the clickOutsideHandler.\n view.render();\n this.listenTo(view, 'submit', () => {\n this._hideView();\n });\n this.listenTo(view, 'cancel', () => {\n // https://github.com/ckeditor/ckeditor5/issues/6180\n if (this._undoStepBatch.operations.length) {\n editor.execute('undo', this._undoStepBatch);\n }\n this._hideView();\n });\n // Close the balloon on Esc key press.\n view.keystrokes.set('Esc', (data, cancel) => {\n this._hideView();\n cancel();\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: view,\n activator: () => this._isViewInBalloon,\n contextElements: [this._balloon.view.element],\n callback: () => this._hideView()\n });\n const colorErrorText = getLocalizedColorErrorText(t);\n const lengthErrorText = getLocalizedLengthErrorText(t);\n // Create the \"UI -> editor data\" binding.\n // These listeners update the editor data (via table commands) when any observable\n // property of the view has changed. They also validate the value and display errors in the UI\n // when necessary. This makes the view live, which means the changes are\n // visible in the editing as soon as the user types or changes fields' values.\n view.on('change:borderStyle', this._getPropertyChangeCallback('tableBorderStyle'));\n view.on('change:borderColor', this._getValidatedPropertyChangeCallback({\n viewField: view.borderColorInput,\n commandName: 'tableBorderColor',\n errorText: colorErrorText,\n validator: colorFieldValidator\n }));\n view.on('change:borderWidth', this._getValidatedPropertyChangeCallback({\n viewField: view.borderWidthInput,\n commandName: 'tableBorderWidth',\n errorText: lengthErrorText,\n validator: lineWidthFieldValidator\n }));\n view.on('change:backgroundColor', this._getValidatedPropertyChangeCallback({\n viewField: view.backgroundInput,\n commandName: 'tableBackgroundColor',\n errorText: colorErrorText,\n validator: colorFieldValidator\n }));\n view.on('change:width', this._getValidatedPropertyChangeCallback({\n viewField: view.widthInput,\n commandName: 'tableWidth',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:height', this._getValidatedPropertyChangeCallback({\n viewField: view.heightInput,\n commandName: 'tableHeight',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:alignment', this._getPropertyChangeCallback('tableAlignment'));\n return view;\n }\n /**\n * In this method the \"editor data -> UI\" binding is happening.\n *\n * When executed, this method obtains selected table property values from various table commands\n * and passes them to the {@link #view}.\n *\n * This way, the UI stays up–to–date with the editor data.\n */\n _fillViewFormFromCommandValues() {\n const commands = this.editor.commands;\n const borderStyleCommand = commands.get('tableBorderStyle');\n Object.entries(propertyToCommandMap)\n .map(([property, commandName]) => {\n const propertyKey = property;\n const defaultValue = this._defaultTableProperties[propertyKey] || '';\n return [propertyKey, (commands.get(commandName).value || defaultValue)];\n })\n .forEach(([property, value]) => {\n // Do not set the `border-color` and `border-width` fields if `border-style:none`.\n if ((property === 'borderColor' || property === 'borderWidth') && borderStyleCommand.value === 'none') {\n return;\n }\n this.view.set(property, value);\n });\n this._isReady = true;\n }\n /**\n * Shows the {@link #view} in the {@link #_balloon}.\n *\n * **Note**: Each time a view is shown, the new {@link #_undoStepBatch} is created that contains\n * all changes made to the document when the view is visible, allowing a single undo step\n * for all of them.\n */\n _showView() {\n const editor = this.editor;\n if (!this.view) {\n this.view = this._createPropertiesView();\n }\n this.listenTo(editor.ui, 'update', () => {\n this._updateView();\n });\n // Update the view with the model values.\n this._fillViewFormFromCommandValues();\n this._balloon.add({\n view: this.view,\n position: getBalloonTablePositionData(editor)\n });\n // Create a new batch. Clicking \"Cancel\" will undo this batch.\n this._undoStepBatch = editor.model.createBatch();\n // Basic a11y.\n this.view.focus();\n }\n /**\n * Removes the {@link #view} from the {@link #_balloon}.\n */\n _hideView() {\n const editor = this.editor;\n this.stopListening(editor.ui, 'update');\n this._isReady = false;\n // Blur any input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n this.view.saveButtonView.focus();\n this._balloon.remove(this.view);\n // Make sure the focus is not lost in the process by putting it directly\n // into the editing view.\n this.editor.editing.view.focus();\n }\n /**\n * Repositions the {@link #_balloon} or hides the {@link #view} if a table is no longer selected.\n */\n _updateView() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n if (!getSelectionAffectedTableWidget(viewDocument.selection)) {\n this._hideView();\n }\n else if (this._isViewVisible) {\n repositionContextualBalloon(editor, 'table');\n }\n }\n /**\n * Returns `true` when the {@link #view} is the visible in the {@link #_balloon}.\n */\n get _isViewVisible() {\n return !!this.view && this._balloon.visibleView === this.view;\n }\n /**\n * Returns `true` when the {@link #view} is in the {@link #_balloon}.\n */\n get _isViewInBalloon() {\n return !!this.view && this._balloon.hasView(this.view);\n }\n /**\n * Creates a callback that when executed upon {@link #view view's} property change\n * executes a related editor command with the new property value.\n *\n * If new value will be set to the default value, the command will not be executed.\n *\n * @param commandName The command that will be executed.\n */\n _getPropertyChangeCallback(commandName) {\n return (evt, propertyName, newValue) => {\n // Do not execute the command on initial call (opening the table properties view).\n if (!this._isReady) {\n return;\n }\n this.editor.execute(commandName, {\n value: newValue,\n batch: this._undoStepBatch\n });\n };\n }\n /**\n * Creates a callback that when executed upon {@link #view view's} property change:\n * * executes a related editor command with the new property value if the value is valid,\n * * or sets the error text next to the invalid field, if the value did not pass the validation.\n */\n _getValidatedPropertyChangeCallback(options) {\n const { commandName, viewField, validator, errorText } = options;\n const setErrorTextDebounced = debounce(() => {\n viewField.errorText = errorText;\n }, ERROR_TEXT_TIMEOUT);\n return (evt, propertyName, newValue) => {\n setErrorTextDebounced.cancel();\n // Do not execute the command on initial call (opening the table properties view).\n if (!this._isReady) {\n return;\n }\n if (validator(newValue)) {\n this.editor.execute(commandName, {\n value: newValue,\n batch: this._undoStepBatch\n });\n viewField.errorText = null;\n }\n else {\n setErrorTextDebounced();\n }\n };\n }\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecaption.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecaption.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecolumnresize.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecolumnresize.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/utils\n */\n/**\n * Normalizes CSS length value to 'px'.\n *\n * @internal\n */\nexport function convertCssLengthToPx(value) {\n const numericValue = parseFloat(value);\n if (value.endsWith('pt')) {\n // 1pt = 1in / 72\n return toPx(numericValue * 96 / 72);\n }\n else if (value.endsWith('pc')) {\n // 1pc = 12pt = 1in / 6.\n return toPx(numericValue * 12 * 96 / 72);\n }\n else if (value.endsWith('in')) {\n // 1in = 2.54cm = 96px\n return toPx(numericValue * 96);\n }\n else if (value.endsWith('cm')) {\n // 1cm = 96px / 2.54\n return toPx(numericValue * 96 / 2.54);\n }\n else if (value.endsWith('mm')) {\n // 1mm = 1cm / 10\n return toPx(numericValue / 10 * 96 / 2.54);\n }\n return value;\n}\n/**\n * Returns true for value with 'px' unit.\n *\n * @internal\n */\nexport function isPx(value) {\n return value !== undefined && value.endsWith('px');\n}\n/**\n * Returns a rounded 'px' value.\n *\n * @internal\n */\nexport function toPx(value) {\n return value.toFixed(2).replace(/\\.?0+$/, '') + 'px';\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/list\n */\nimport { Matcher, UpcastWriter } from 'ckeditor5/src/engine.js';\nimport { convertCssLengthToPx, isPx, toPx } from './utils.js';\n/**\n * Transforms Word specific list-like elements to the semantic HTML lists.\n *\n * Lists in Word are represented by block elements with special attributes like:\n *\n * ```xml\n * <p class=MsoListParagraphCxSpFirst style='mso-list:l1 level1 lfo1'>...</p> // Paragraph based list.\n * <h1 style='mso-list:l0 level1 lfo1'>...</h1> // Heading 1 based list.\n * ```\n *\n * @param documentFragment The view structure to be transformed.\n * @param stylesString Styles from which list-like elements styling will be extracted.\n */\nexport function transformListItemLikeElementsIntoLists(documentFragment, stylesString, hasMultiLevelListPlugin) {\n if (!documentFragment.childCount) {\n return;\n }\n const writer = new UpcastWriter(documentFragment.document);\n const itemLikeElements = findAllItemLikeElements(documentFragment, writer);\n if (!itemLikeElements.length) {\n return;\n }\n const encounteredLists = {};\n const stack = [];\n for (const itemLikeElement of itemLikeElements) {\n if (itemLikeElement.indent !== undefined) {\n if (!isListContinuation(itemLikeElement)) {\n stack.length = 0;\n }\n // Combined list ID for addressing encounter lists counters.\n const originalListId = `${itemLikeElement.id}:${itemLikeElement.indent}`;\n // Normalized list item indentation.\n const indent = Math.min(itemLikeElement.indent - 1, stack.length);\n // Trimming of the list stack on list ID change.\n if (indent < stack.length && stack[indent].id !== itemLikeElement.id) {\n stack.length = indent;\n }\n // Trimming of the list stack on lower indent list encountered.\n if (indent < stack.length - 1) {\n stack.length = indent + 1;\n }\n else {\n const listStyle = detectListStyle(itemLikeElement, stylesString);\n // Create a new OL/UL if required (greater indent or different list type).\n if (indent > stack.length - 1 || stack[indent].listElement.name != listStyle.type) {\n // Check if there is some start index to set from a previous list.\n if (indent == 0 &&\n listStyle.type == 'ol' &&\n itemLikeElement.id !== undefined &&\n encounteredLists[originalListId]) {\n listStyle.startIndex = encounteredLists[originalListId];\n }\n const listElement = createNewEmptyList(listStyle, writer, hasMultiLevelListPlugin);\n // Apply list padding only if we have margins for the item and the parent item.\n if (isPx(itemLikeElement.marginLeft) &&\n (indent == 0 || isPx(stack[indent - 1].marginLeft))) {\n let marginLeft = itemLikeElement.marginLeft;\n if (indent > 0) {\n // Convert the padding from absolute to relative.\n marginLeft = toPx(parseFloat(marginLeft) - parseFloat(stack[indent - 1].marginLeft));\n }\n writer.setStyle('padding-left', marginLeft, listElement);\n }\n // Insert the new OL/UL.\n if (stack.length == 0) {\n const parent = itemLikeElement.element.parent;\n const index = parent.getChildIndex(itemLikeElement.element) + 1;\n writer.insertChild(index, listElement, parent);\n }\n else {\n const parentListItems = stack[indent - 1].listItemElements;\n writer.appendChild(listElement, parentListItems[parentListItems.length - 1]);\n }\n // Update the list stack for other items to reference.\n stack[indent] = {\n ...itemLikeElement,\n listElement,\n listItemElements: []\n };\n // Prepare list counter for start index.\n if (indent == 0 && itemLikeElement.id !== undefined) {\n encounteredLists[originalListId] = listStyle.startIndex || 1;\n }\n }\n }\n // Use LI if it is already it or create a new LI element.\n // https://github.com/ckeditor/ckeditor5/issues/15964\n const listItem = itemLikeElement.element.name == 'li' ? itemLikeElement.element : writer.createElement('li');\n // Append the LI to OL/UL.\n writer.appendChild(listItem, stack[indent].listElement);\n stack[indent].listItemElements.push(listItem);\n // Increment list counter.\n if (indent == 0 && itemLikeElement.id !== undefined) {\n encounteredLists[originalListId]++;\n }\n // Append list block to LI.\n if (itemLikeElement.element != listItem) {\n writer.appendChild(itemLikeElement.element, listItem);\n }\n // Clean list block.\n removeBulletElement(itemLikeElement.element, writer);\n writer.removeStyle('text-indent', itemLikeElement.element); // #12361\n writer.removeStyle('margin-left', itemLikeElement.element);\n }\n else {\n // Other blocks in a list item.\n const stackItem = stack.find(stackItem => stackItem.marginLeft == itemLikeElement.marginLeft);\n // This might be a paragraph that has known margin, but it is not a real list block.\n if (stackItem) {\n const listItems = stackItem.listItemElements;\n // Append block to LI.\n writer.appendChild(itemLikeElement.element, listItems[listItems.length - 1]);\n writer.removeStyle('margin-left', itemLikeElement.element);\n }\n else {\n stack.length = 0;\n }\n }\n }\n}\n/**\n * Removes paragraph wrapping content inside a list item.\n */\nexport function unwrapParagraphInListItem(documentFragment, writer) {\n for (const value of writer.createRangeIn(documentFragment)) {\n const element = value.item;\n if (element.is('element', 'li')) {\n // Google Docs allows for single paragraph inside LI.\n const firstChild = element.getChild(0);\n if (firstChild && firstChild.is('element', 'p')) {\n writer.unwrapElement(firstChild);\n }\n }\n }\n}\n/**\n * Finds all list-like elements in a given document fragment.\n *\n * @param documentFragment Document fragment in which to look for list-like nodes.\n * @returns Array of found list-like items. Each item is an object containing:\n */\nfunction findAllItemLikeElements(documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const itemLikeElements = [];\n const foundMargins = new Set();\n for (const item of range.getItems()) {\n // https://github.com/ckeditor/ckeditor5/issues/15964\n if (!item.is('element') || !item.name.match(/^(p|h\\d+|li|div)$/)) {\n continue;\n }\n // Try to rely on margin-left style to find paragraphs visually aligned with previously encountered list item.\n let marginLeft = getMarginLeftNormalized(item);\n // Ignore margin-left 0 style if there is no MsoList... class.\n if (marginLeft !== undefined &&\n parseFloat(marginLeft) == 0 &&\n !Array.from(item.getClassNames()).find(className => className.startsWith('MsoList'))) {\n marginLeft = undefined;\n }\n // List item or a following list item block.\n if (item.hasStyle('mso-list') || marginLeft !== undefined && foundMargins.has(marginLeft)) {\n const itemData = getListItemData(item);\n itemLikeElements.push({\n element: item,\n id: itemData.id,\n order: itemData.order,\n indent: itemData.indent,\n marginLeft\n });\n if (marginLeft !== undefined) {\n foundMargins.add(marginLeft);\n }\n }\n // Clear found margins as we found block after a list.\n else {\n foundMargins.clear();\n }\n }\n return itemLikeElements;\n}\n/**\n * Whether the given element is possibly a list continuation. Previous element was wrapped into a list\n * or the current element already is inside a list.\n */\nfunction isListContinuation(currentItem) {\n const previousSibling = currentItem.element.previousSibling;\n if (!previousSibling) {\n // If it's a li inside ul or ol like in here: https://github.com/ckeditor/ckeditor5/issues/15964.\n return isList(currentItem.element.parent);\n }\n // Even with the same id the list does not have to be continuous (#43).\n return isList(previousSibling);\n}\nfunction isList(element) {\n return element.is('element', 'ol') || element.is('element', 'ul');\n}\n/**\n * Extracts list item style from the provided CSS.\n *\n * List item style is extracted from the CSS stylesheet. Each list with its specific style attribute\n * value (`mso-list:l1 level1 lfo1`) has its dedicated properties in a CSS stylesheet defined with a selector like:\n *\n * ```css\n * @list l1:level1 { ... }\n * ```\n *\n * It contains `mso-level-number-format` property which defines list numbering/bullet style. If this property\n * is not defined it means default `decimal` numbering.\n *\n * Here CSS string representation is used as `mso-level-number-format` property is an invalid CSS property\n * and will be removed during CSS parsing.\n *\n * @param listLikeItem List-like item for which list style will be searched for. Usually\n * a result of `findAllItemLikeElements()` function.\n * @param stylesString CSS stylesheet.\n * @returns An object with properties:\n *\n * * type - List type, could be `ul` or `ol`.\n * * startIndex - List start index, valid only for ordered lists.\n * * style - List style, for example: `decimal`, `lower-roman`, etc. It is extracted\n * directly from Word stylesheet and adjusted to represent proper values for the CSS `list-style-type` property.\n * If it cannot be adjusted, the `null` value is returned.\n */\nfunction detectListStyle(listLikeItem, stylesString) {\n const listStyleRegexp = new RegExp(`@list l${listLikeItem.id}:level${listLikeItem.indent}\\\\s*({[^}]*)`, 'gi');\n const listStyleTypeRegex = /mso-level-number-format:([^;]{0,100});/gi;\n const listStartIndexRegex = /mso-level-start-at:\\s{0,100}([0-9]{0,10})\\s{0,100};/gi;\n const legalStyleListRegex = new RegExp(`@list\\\\s+l${listLikeItem.id}:level\\\\d\\\\s*{[^{]*mso-level-text:\"%\\\\d\\\\\\\\.`, 'gi');\n const multiLevelNumberFormatTypeRegex = new RegExp(`@list l${listLikeItem.id}:level\\\\d\\\\s*{[^{]*mso-level-number-format:`, 'gi');\n const legalStyleListMatch = legalStyleListRegex.exec(stylesString);\n const multiLevelNumberFormatMatch = multiLevelNumberFormatTypeRegex.exec(stylesString);\n // Multi level lists in Word have mso-level-number-format attribute except legal lists,\n // so we used that. If list has legal list match and doesn't has mso-level-number-format\n // then this is legal-list.\n const islegalStyleList = legalStyleListMatch && !multiLevelNumberFormatMatch;\n const listStyleMatch = listStyleRegexp.exec(stylesString);\n let listStyleType = 'decimal'; // Decimal is default one.\n let type = 'ol'; // <ol> is default list.\n let startIndex = null;\n if (listStyleMatch && listStyleMatch[1]) {\n const listStyleTypeMatch = listStyleTypeRegex.exec(listStyleMatch[1]);\n if (listStyleTypeMatch && listStyleTypeMatch[1]) {\n listStyleType = listStyleTypeMatch[1].trim();\n type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul';\n }\n // Styles for the numbered lists are always defined in the Word CSS stylesheet.\n // Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes\n // this tag is missing. And because of that, we cannot depend on that. We need to predict the list style value\n // based on the list style marker element.\n if (listStyleType === 'bullet') {\n const bulletedStyle = findBulletedListStyle(listLikeItem.element);\n if (bulletedStyle) {\n listStyleType = bulletedStyle;\n }\n }\n else {\n const listStartIndexMatch = listStartIndexRegex.exec(listStyleMatch[1]);\n if (listStartIndexMatch && listStartIndexMatch[1]) {\n startIndex = parseInt(listStartIndexMatch[1]);\n }\n }\n if (islegalStyleList) {\n type = 'ol';\n }\n }\n return {\n type,\n startIndex,\n style: mapListStyleDefinition(listStyleType),\n isLegalStyleList: islegalStyleList\n };\n}\n/**\n * Tries to extract the `list-style-type` value based on the marker element for bulleted list.\n */\nfunction findBulletedListStyle(element) {\n // https://github.com/ckeditor/ckeditor5/issues/15964\n if (element.name == 'li' && element.parent.name == 'ul' && element.parent.hasAttribute('type')) {\n return element.parent.getAttribute('type');\n }\n const listMarkerElement = findListMarkerNode(element);\n if (!listMarkerElement) {\n return null;\n }\n const listMarker = listMarkerElement._data;\n if (listMarker === 'o') {\n return 'circle';\n }\n else if (listMarker === '·') {\n return 'disc';\n }\n // Word returns '§' instead of 'â– ' for the square list style.\n else if (listMarker === '§') {\n return 'square';\n }\n return null;\n}\n/**\n * Tries to find a text node that represents the marker element (list-style-type).\n */\nfunction findListMarkerNode(element) {\n // If the first child is a text node, it is the data for the element.\n // The list-style marker is not present here.\n if (element.getChild(0).is('$text')) {\n return null;\n }\n for (const childNode of element.getChildren()) {\n // The list-style marker will be inside the `<span>` element. Let's ignore all non-span elements.\n // It may happen that the `<a>` element is added as the first child. Most probably, it's an anchor element.\n if (!childNode.is('element', 'span')) {\n continue;\n }\n const textNodeOrElement = childNode.getChild(0);\n if (!textNodeOrElement) {\n continue;\n }\n // If already found the marker element, use it.\n if (textNodeOrElement.is('$text')) {\n return textNodeOrElement;\n }\n return textNodeOrElement.getChild(0);\n }\n /* istanbul ignore next -- @preserve */\n return null;\n}\n/**\n * Parses the `list-style-type` value extracted directly from the Word CSS stylesheet and returns proper CSS definition.\n */\nfunction mapListStyleDefinition(value) {\n if (value.startsWith('arabic-leading-zero')) {\n return 'decimal-leading-zero';\n }\n switch (value) {\n case 'alpha-upper':\n return 'upper-alpha';\n case 'alpha-lower':\n return 'lower-alpha';\n case 'roman-upper':\n return 'upper-roman';\n case 'roman-lower':\n return 'lower-roman';\n case 'circle':\n case 'disc':\n case 'square':\n return value;\n default:\n return null;\n }\n}\n/**\n * Creates a new list OL/UL element.\n */\nfunction createNewEmptyList(listStyle, writer, hasMultiLevelListPlugin) {\n const list = writer.createElement(listStyle.type);\n // We do not support modifying the marker for a particular list item.\n // Set the value for the `list-style-type` property directly to the list container.\n if (listStyle.style) {\n writer.setStyle('list-style-type', listStyle.style, list);\n }\n if (listStyle.startIndex && listStyle.startIndex > 1) {\n writer.setAttribute('start', listStyle.startIndex, list);\n }\n if (listStyle.isLegalStyleList && hasMultiLevelListPlugin) {\n writer.addClass('legal-list', list);\n }\n return list;\n}\n/**\n * Extracts list item information from Word specific list-like element style:\n *\n * ```\n * `style=\"mso-list:l1 level1 lfo1\"`\n * ```\n *\n * where:\n *\n * ```\n * * `l1` is a list id (however it does not mean this is a continuous list - see #43),\n * * `level1` is a list item indentation level,\n * * `lfo1` is a list insertion order in a document.\n * ```\n *\n * @param element Element from which style data is extracted.\n */\nfunction getListItemData(element) {\n const listStyle = element.getStyle('mso-list');\n if (listStyle === undefined) {\n return {};\n }\n const idMatch = listStyle.match(/(^|\\s{1,100})l(\\d+)/i);\n const orderMatch = listStyle.match(/\\s{0,100}lfo(\\d+)/i);\n const indentMatch = listStyle.match(/\\s{0,100}level(\\d+)/i);\n if (idMatch && orderMatch && indentMatch) {\n return {\n id: idMatch[2],\n order: orderMatch[1],\n indent: parseInt(indentMatch[1])\n };\n }\n return {\n indent: 1 // Handle empty mso-list style as a marked for default list item.\n };\n}\n/**\n * Removes span with a numbering/bullet from a given element.\n */\nfunction removeBulletElement(element, writer) {\n // Matcher for finding `span` elements holding lists numbering/bullets.\n const bulletMatcher = new Matcher({\n name: 'span',\n styles: {\n 'mso-list': 'Ignore'\n }\n });\n const range = writer.createRangeIn(element);\n for (const value of range) {\n if (value.type === 'elementStart' && bulletMatcher.match(value.item)) {\n writer.remove(value.item);\n }\n }\n}\n/**\n * Returns element left margin normalized to 'px' if possible.\n */\nfunction getMarginLeftNormalized(element) {\n const value = element.getStyle('margin-left');\n if (value === undefined || value.endsWith('px')) {\n return value;\n }\n return convertCssLengthToPx(value);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/image\n */\n/* globals btoa */\nimport { Matcher, UpcastWriter } from 'ckeditor5/src/engine.js';\n/**\n * Replaces source attribute of all `<img>` elements representing regular\n * images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data.\n *\n * @param documentFragment Document fragment on which transform images.\n * @param rtfData The RTF data from which images representation will be used.\n */\nexport function replaceImagesSourceWithBase64(documentFragment, rtfData) {\n if (!documentFragment.childCount) {\n return;\n }\n const upcastWriter = new UpcastWriter(documentFragment.document);\n const shapesIds = findAllShapesIds(documentFragment, upcastWriter);\n removeAllImgElementsRepresentingShapes(shapesIds, documentFragment, upcastWriter);\n insertMissingImgs(shapesIds, documentFragment, upcastWriter);\n removeAllShapeElements(documentFragment, upcastWriter);\n const images = findAllImageElementsWithLocalSource(documentFragment, upcastWriter);\n if (images.length) {\n replaceImagesFileSourceWithInlineRepresentation(images, extractImageDataFromRtf(rtfData), upcastWriter);\n }\n}\n/**\n * Converts given HEX string to base64 representation.\n *\n * @internal\n * @param hexString The HEX string to be converted.\n * @returns Base64 representation of a given HEX string.\n */\nexport function _convertHexToBase64(hexString) {\n return btoa(hexString.match(/\\w{2}/g).map(char => {\n return String.fromCharCode(parseInt(char, 16));\n }).join(''));\n}\n/**\n * Finds all shapes (`<v:*>...</v:*>`) ids. Shapes can represent images (canvas)\n * or Word shapes (which does not have RTF or Blob representation).\n *\n * @param documentFragment Document fragment from which to extract shape ids.\n * @returns Array of shape ids.\n */\nfunction findAllShapesIds(documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const shapeElementsMatcher = new Matcher({\n name: /v:(.+)/\n });\n const shapesIds = [];\n for (const value of range) {\n if (value.type != 'elementStart') {\n continue;\n }\n const el = value.item;\n const previousSibling = el.previousSibling;\n const prevSiblingName = previousSibling && previousSibling.is('element') ? previousSibling.name : null;\n // List of ids which should not be considered as shapes.\n // https://github.com/ckeditor/ckeditor5/pull/15847#issuecomment-1941543983\n const exceptionIds = ['Chart'];\n const isElementAShape = shapeElementsMatcher.match(el);\n const hasElementGfxdataAttribute = el.getAttribute('o:gfxdata');\n const isPreviousSiblingAShapeType = prevSiblingName === 'v:shapetype';\n const isElementIdInExceptionsArray = hasElementGfxdataAttribute &&\n exceptionIds.some(item => el.getAttribute('id').includes(item));\n // If shape element has 'o:gfxdata' attribute and is not directly before\n // `<v:shapetype>` element it means that it represents a Word shape.\n if (isElementAShape &&\n hasElementGfxdataAttribute &&\n !isPreviousSiblingAShapeType &&\n !isElementIdInExceptionsArray) {\n shapesIds.push(value.item.getAttribute('id'));\n }\n }\n return shapesIds;\n}\n/**\n * Removes all `<img>` elements which represents Word shapes and not regular images.\n *\n * @param shapesIds Shape ids which will be checked against `<img>` elements.\n * @param documentFragment Document fragment from which to remove `<img>` elements.\n */\nfunction removeAllImgElementsRepresentingShapes(shapesIds, documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const imageElementsMatcher = new Matcher({\n name: 'img'\n });\n const imgs = [];\n for (const value of range) {\n if (value.item.is('element') && imageElementsMatcher.match(value.item)) {\n const el = value.item;\n const shapes = el.getAttribute('v:shapes') ? el.getAttribute('v:shapes').split(' ') : [];\n if (shapes.length && shapes.every(shape => shapesIds.indexOf(shape) > -1)) {\n imgs.push(el);\n // Shapes may also have empty source while content is paste in some browsers (Safari).\n }\n else if (!el.getAttribute('src')) {\n imgs.push(el);\n }\n }\n }\n for (const img of imgs) {\n writer.remove(img);\n }\n}\n/**\n * Removes all shape elements (`<v:*>...</v:*>`) so they do not pollute the output structure.\n *\n * @param documentFragment Document fragment from which to remove shape elements.\n */\nfunction removeAllShapeElements(documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const shapeElementsMatcher = new Matcher({\n name: /v:(.+)/\n });\n const shapes = [];\n for (const value of range) {\n if (value.type == 'elementStart' && shapeElementsMatcher.match(value.item)) {\n shapes.push(value.item);\n }\n }\n for (const shape of shapes) {\n writer.remove(shape);\n }\n}\n/**\n * Inserts `img` tags if there is none after a shape.\n */\nfunction insertMissingImgs(shapeIds, documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const shapes = [];\n for (const value of range) {\n if (value.type == 'elementStart' && value.item.is('element', 'v:shape')) {\n const id = value.item.getAttribute('id');\n if (shapeIds.includes(id)) {\n continue;\n }\n if (!containsMatchingImg(value.item.parent.getChildren(), id)) {\n shapes.push(value.item);\n }\n }\n }\n for (const shape of shapes) {\n const attrs = {\n src: findSrc(shape)\n };\n if (shape.hasAttribute('alt')) {\n attrs.alt = shape.getAttribute('alt');\n }\n const img = writer.createElement('img', attrs);\n writer.insertChild(shape.index + 1, img, shape.parent);\n }\n function containsMatchingImg(nodes, id) {\n for (const node of nodes) {\n /* istanbul ignore else -- @preserve */\n if (node.is('element')) {\n if (node.name == 'img' && node.getAttribute('v:shapes') == id) {\n return true;\n }\n if (containsMatchingImg(node.getChildren(), id)) {\n return true;\n }\n }\n }\n return false;\n }\n function findSrc(shape) {\n for (const child of shape.getChildren()) {\n /* istanbul ignore else -- @preserve */\n if (child.is('element') && child.getAttribute('src')) {\n return child.getAttribute('src');\n }\n }\n }\n}\n/**\n * Finds all `<img>` elements in a given document fragment which have source pointing to local `file://` resource.\n *\n * @param documentFragment Document fragment in which to look for `<img>` elements.\n * @returns result All found images grouped by source type.\n */\nfunction findAllImageElementsWithLocalSource(documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const imageElementsMatcher = new Matcher({\n name: 'img'\n });\n const imgs = [];\n for (const value of range) {\n if (value.item.is('element') && imageElementsMatcher.match(value.item)) {\n if (value.item.getAttribute('src').startsWith('file://')) {\n imgs.push(value.item);\n }\n }\n }\n return imgs;\n}\n/**\n * Extracts all images HEX representations from a given RTF data.\n *\n * @param rtfData The RTF data from which to extract images HEX representation.\n * @returns Array of found HEX representations. Each array item is an object containing:\n *\n * * hex Image representation in HEX format.\n * * type Type of image, `image/png` or `image/jpeg`.\n */\nfunction extractImageDataFromRtf(rtfData) {\n if (!rtfData) {\n return [];\n }\n const regexPictureHeader = /{\\\\pict[\\s\\S]+?\\\\bliptag-?\\d+(\\\\blipupi-?\\d+)?({\\\\\\*\\\\blipuid\\s?[\\da-fA-F]+)?[\\s}]*?/;\n const regexPicture = new RegExp('(?:(' + regexPictureHeader.source + '))([\\\\da-fA-F\\\\s]+)\\\\}', 'g');\n const images = rtfData.match(regexPicture);\n const result = [];\n if (images) {\n for (const image of images) {\n let imageType = false;\n if (image.includes('\\\\pngblip')) {\n imageType = 'image/png';\n }\n else if (image.includes('\\\\jpegblip')) {\n imageType = 'image/jpeg';\n }\n if (imageType) {\n result.push({\n hex: image.replace(regexPictureHeader, '').replace(/[^\\da-fA-F]/g, ''),\n type: imageType\n });\n }\n }\n }\n return result;\n}\n/**\n * Replaces `src` attribute value of all given images with the corresponding base64 image representation.\n *\n * @param imageElements Array of image elements which will have its source replaced.\n * @param imagesHexSources Array of images hex sources (usually the result of `extractImageDataFromRtf()` function).\n * The array should be the same length as `imageElements` parameter.\n */\nfunction replaceImagesFileSourceWithInlineRepresentation(imageElements, imagesHexSources, writer) {\n // Assume there is an equal amount of image elements and images HEX sources so they can be matched accordingly based on existing order.\n if (imageElements.length === imagesHexSources.length) {\n for (let i = 0; i < imageElements.length; i++) {\n const newSrc = `data:${imagesHexSources[i].type};base64,${_convertHexToBase64(imagesHexSources[i].hex)}`;\n writer.setAttribute('src', newSrc, imageElements[i]);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/normalizers/mswordnormalizer\n */\nimport { transformListItemLikeElementsIntoLists } from '../filters/list.js';\nimport { replaceImagesSourceWithBase64 } from '../filters/image.js';\nimport removeMSAttributes from '../filters/removemsattributes.js';\nconst msWordMatch1 = /<meta\\s*name=\"?generator\"?\\s*content=\"?microsoft\\s*word\\s*\\d+\"?\\/?>/i;\nconst msWordMatch2 = /xmlns:o=\"urn:schemas-microsoft-com/i;\n/**\n * Normalizer for the content pasted from Microsoft Word.\n */\nexport default class MSWordNormalizer {\n /**\n * Creates a new `MSWordNormalizer` instance.\n *\n * @param document View document.\n */\n constructor(document, hasMultiLevelListPlugin = false) {\n this.document = document;\n this.hasMultiLevelListPlugin = hasMultiLevelListPlugin;\n }\n /**\n * @inheritDoc\n */\n isActive(htmlString) {\n return msWordMatch1.test(htmlString) || msWordMatch2.test(htmlString);\n }\n /**\n * @inheritDoc\n */\n execute(data) {\n const { body: documentFragment, stylesString } = data._parsedData;\n transformListItemLikeElementsIntoLists(documentFragment, stylesString, this.hasMultiLevelListPlugin);\n replaceImagesSourceWithBase64(documentFragment, data.dataTransfer.getData('text/rtf'));\n removeMSAttributes(documentFragment);\n data.content = documentFragment;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/removemsattributes\n */\nimport { UpcastWriter } from 'ckeditor5/src/engine.js';\n/**\n * Cleanup MS attributes like styles, attributes and elements.\n *\n * @param documentFragment element `data.content` obtained from clipboard.\n */\nexport default function removeMSAttributes(documentFragment) {\n const elementsToUnwrap = [];\n const writer = new UpcastWriter(documentFragment.document);\n for (const { item } of writer.createRangeIn(documentFragment)) {\n if (!item.is('element')) {\n continue;\n }\n for (const className of item.getClassNames()) {\n if (/\\bmso/gi.exec(className)) {\n writer.removeClass(className, item);\n }\n }\n for (const styleName of item.getStyleNames()) {\n if (/\\bmso/gi.exec(styleName)) {\n writer.removeStyle(styleName, item);\n }\n }\n if (item.is('element', 'w:sdt') ||\n item.is('element', 'w:sdtpr') && item.isEmpty ||\n item.is('element', 'o:p') && item.isEmpty) {\n elementsToUnwrap.push(item);\n }\n }\n for (const item of elementsToUnwrap) {\n const itemParent = item.parent;\n const childIndex = itemParent.getChildIndex(item);\n writer.insertChild(childIndex, item.getChildren(), itemParent);\n writer.remove(item);\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/br\n */\nimport { DomConverter, ViewDocument } from 'ckeditor5/src/engine.js';\n/**\n * Transforms `<br>` elements that are siblings to some block element into a paragraphs.\n *\n * @param documentFragment The view structure to be transformed.\n */\nexport default function transformBlockBrsToParagraphs(documentFragment, writer) {\n const viewDocument = new ViewDocument(writer.document.stylesProcessor);\n const domConverter = new DomConverter(viewDocument, { renderingMode: 'data' });\n const blockElements = domConverter.blockElements;\n const inlineObjectElements = domConverter.inlineObjectElements;\n const elementsToReplace = [];\n for (const value of writer.createRangeIn(documentFragment)) {\n const element = value.item;\n if (element.is('element', 'br')) {\n const nextSibling = findSibling(element, 'forward', writer, { blockElements, inlineObjectElements });\n const previousSibling = findSibling(element, 'backward', writer, { blockElements, inlineObjectElements });\n const nextSiblingIsBlock = isBlockViewElement(nextSibling, blockElements);\n const previousSiblingIsBlock = isBlockViewElement(previousSibling, blockElements);\n // If the <br> is surrounded by blocks then convert it to a paragraph:\n // * <p>foo</p>[<br>]<p>bar</p> -> <p>foo</p>[<p></p>]<p>bar</p>\n // * <p>foo</p>[<br>] -> <p>foo</p>[<p></p>]\n // * [<br>]<p>foo</p> -> [<p></p>]<p>foo</p>\n if (previousSiblingIsBlock || nextSiblingIsBlock) {\n elementsToReplace.push(element);\n }\n }\n }\n for (const element of elementsToReplace) {\n if (element.hasClass('Apple-interchange-newline')) {\n writer.remove(element);\n }\n else {\n writer.replace(element, writer.createElement('p'));\n }\n }\n}\n/**\n * Returns sibling node, threats inline elements as transparent (but should stop on an inline objects).\n */\nfunction findSibling(viewElement, direction, writer, { blockElements, inlineObjectElements }) {\n let position = writer.createPositionAt(viewElement, direction == 'forward' ? 'after' : 'before');\n // Find first position that is just before a first:\n // * text node,\n // * block element,\n // * inline object element.\n // It's ignoring any inline (non-object) elements like span, strong, etc.\n position = position.getLastMatchingPosition(({ item }) => (item.is('element') &&\n !blockElements.includes(item.name) &&\n !inlineObjectElements.includes(item.name)), { direction });\n return direction == 'forward' ? position.nodeAfter : position.nodeBefore;\n}\n/**\n * Returns true for view elements that are listed as block view elements.\n */\nfunction isBlockViewElement(node, blockElements) {\n return !!node && node.is('element') && blockElements.includes(node.name);\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/normalizers/googledocsnormalizer\n */\nimport { UpcastWriter } from 'ckeditor5/src/engine.js';\nimport removeBoldWrapper from '../filters/removeboldwrapper.js';\nimport transformBlockBrsToParagraphs from '../filters/br.js';\nimport { unwrapParagraphInListItem } from '../filters/list.js';\nconst googleDocsMatch = /id=(\"|')docs-internal-guid-[-0-9a-f]+(\"|')/i;\n/**\n * Normalizer for the content pasted from Google Docs.\n */\nexport default class GoogleDocsNormalizer {\n /**\n * Creates a new `GoogleDocsNormalizer` instance.\n *\n * @param document View document.\n */\n constructor(document) {\n this.document = document;\n }\n /**\n * @inheritDoc\n */\n isActive(htmlString) {\n return googleDocsMatch.test(htmlString);\n }\n /**\n * @inheritDoc\n */\n execute(data) {\n const writer = new UpcastWriter(this.document);\n const { body: documentFragment } = data._parsedData;\n removeBoldWrapper(documentFragment, writer);\n unwrapParagraphInListItem(documentFragment, writer);\n transformBlockBrsToParagraphs(documentFragment, writer);\n data.content = documentFragment;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes the `<b>` tag wrapper added by Google Docs to a copied content.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeBoldWrapper(documentFragment, writer) {\n for (const child of documentFragment.getChildren()) {\n if (child.is('element', 'b') && child.getStyle('font-weight') === 'normal') {\n const childIndex = documentFragment.getChildIndex(child);\n writer.remove(child);\n writer.insertChild(childIndex, child.getChildren(), documentFragment);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/normalizers/googlesheetsnormalizer\n */\nimport { UpcastWriter } from 'ckeditor5/src/engine.js';\nimport removeXmlns from '../filters/removexmlns.js';\nimport removeGoogleSheetsTag from '../filters/removegooglesheetstag.js';\nimport removeInvalidTableWidth from '../filters/removeinvalidtablewidth.js';\nimport removeStyleBlock from '../filters/removestyleblock.js';\nconst googleSheetsMatch = /<google-sheets-html-origin/i;\n/**\n * Normalizer for the content pasted from Google Sheets.\n */\nexport default class GoogleSheetsNormalizer {\n /**\n * Creates a new `GoogleSheetsNormalizer` instance.\n *\n * @param document View document.\n */\n constructor(document) {\n this.document = document;\n }\n /**\n * @inheritDoc\n */\n isActive(htmlString) {\n return googleSheetsMatch.test(htmlString);\n }\n /**\n * @inheritDoc\n */\n execute(data) {\n const writer = new UpcastWriter(this.document);\n const { body: documentFragment } = data._parsedData;\n removeGoogleSheetsTag(documentFragment, writer);\n removeXmlns(documentFragment, writer);\n removeInvalidTableWidth(documentFragment, writer);\n removeStyleBlock(documentFragment, writer);\n data.content = documentFragment;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes the `<google-sheets-html-origin>` tag wrapper added by Google Sheets to a copied content.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeGoogleSheetsTag(documentFragment, writer) {\n for (const child of documentFragment.getChildren()) {\n if (child.is('element', 'google-sheets-html-origin')) {\n const childIndex = documentFragment.getChildIndex(child);\n writer.remove(child);\n writer.insertChild(childIndex, child.getChildren(), documentFragment);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes the `xmlns` attribute from table pasted from Google Sheets.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeXmlns(documentFragment, writer) {\n for (const child of documentFragment.getChildren()) {\n if (child.is('element', 'table') && child.hasAttribute('xmlns')) {\n writer.removeAttribute('xmlns', child);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes the `width:0px` style from table pasted from Google Sheets.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeInvalidTableWidth(documentFragment, writer) {\n for (const child of documentFragment.getChildren()) {\n if (child.is('element', 'table') && child.getStyle('width') === '0px') {\n writer.removeStyle('width', child);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes `<style>` block added by Google Sheets to a copied content.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeStyleBlock(documentFragment, writer) {\n for (const child of Array.from(documentFragment.getChildren())) {\n if (child.is('element', 'style')) {\n writer.remove(child);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/space\n */\n/**\n * Replaces last space preceding elements closing tag with ` `. Such operation prevents spaces from being removed\n * during further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDomInlineNodes}).\n * This method also takes into account Word specific `<o:p></o:p>` empty tags.\n * Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).\n *\n * @param htmlString HTML string in which spacing should be normalized.\n * @returns Input HTML with spaces normalized.\n */\nexport function normalizeSpacing(htmlString) {\n // Run normalizeSafariSpaceSpans() two times to cover nested spans.\n return normalizeSafariSpaceSpans(normalizeSafariSpaceSpans(htmlString))\n // Remove all \\r\\n from \"spacerun spans\" so the last replace line doesn't strip all whitespaces.\n .replace(/(<span\\s+style=['\"]mso-spacerun:yes['\"]>[^\\S\\r\\n]*?)[\\r\\n]+([^\\S\\r\\n]*<\\/span>)/g, '$1$2')\n .replace(/<span\\s+style=['\"]mso-spacerun:yes['\"]><\\/span>/g, '')\n .replace(/(<span\\s+style=['\"]letter-spacing:[^'\"]+?['\"]>)[\\r\\n]+(<\\/span>)/g, '$1 $2')\n .replace(/ <\\//g, '\\u00A0</')\n .replace(/ <o:p><\\/o:p>/g, '\\u00A0<o:p></o:p>')\n // Remove <o:p> block filler from empty paragraph. Safari uses \\u00A0 instead of .\n .replace(/<o:p>( |\\u00A0)<\\/o:p>/g, '')\n // Remove all whitespaces when they contain any \\r or \\n.\n .replace(/>([^\\S\\r\\n]*[\\r\\n]\\s*)</g, '><');\n}\n/**\n * Normalizes spacing in special Word `spacerun spans` (`<span style='mso-spacerun:yes'>\\s+</span>`) by replacing\n * all spaces with ` ` pairs. This prevents spaces from being removed during further DOM/View processing\n * (see especially {@link module:engine/view/domconverter~DomConverter#_processDomInlineNodes}).\n *\n * @param htmlDocument Native `Document` object in which spacing should be normalized.\n */\nexport function normalizeSpacerunSpans(htmlDocument) {\n htmlDocument.querySelectorAll('span[style*=spacerun]').forEach(el => {\n const htmlElement = el;\n const innerTextLength = htmlElement.innerText.length || 0;\n htmlElement.innerText = Array(innerTextLength + 1).join('\\u00A0 ').substr(0, innerTextLength);\n });\n}\n/**\n * Normalizes specific spacing generated by Safari when content pasted from Word (`<span class=\"Apple-converted-space\"> </span>`)\n * by replacing all spaces sequences longer than 1 space with ` ` pairs. This prevents spaces from being removed during\n * further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).\n *\n * This function is similar to {@link module:clipboard/utils/normalizeclipboarddata normalizeClipboardData util} but uses\n * regular spaces / sequence for replacement.\n *\n * @param htmlString HTML string in which spacing should be normalized\n * @returns Input HTML with spaces normalized.\n */\nfunction normalizeSafariSpaceSpans(htmlString) {\n return htmlString.replace(/<span(?: class=\"Apple-converted-space\"|)>(\\s+)<\\/span>/g, (fullMatch, spaces) => {\n return spaces.length === 1 ? ' ' : Array(spaces.length + 1).join('\\u00A0 ').substr(0, spaces.length);\n });\n}\n","var highlightRegExp = /highlight-(?:text|source)-([a-z0-9]+)/;\n\nfunction highlightedCodeBlock (turndownService) {\n turndownService.addRule('highlightedCodeBlock', {\n filter: function (node) {\n var firstChild = node.firstChild;\n return (\n node.nodeName === 'DIV' &&\n highlightRegExp.test(node.className) &&\n firstChild &&\n firstChild.nodeName === 'PRE'\n )\n },\n replacement: function (content, node, options) {\n var className = node.className || '';\n var language = (className.match(highlightRegExp) || [null, ''])[1];\n\n return (\n '\\n\\n' + options.fence + language + '\\n' +\n node.firstChild.textContent +\n '\\n' + options.fence + '\\n\\n'\n )\n }\n });\n}\n\nfunction strikethrough (turndownService) {\n turndownService.addRule('strikethrough', {\n filter: ['del', 's', 'strike'],\n replacement: function (content) {\n return '~' + content + '~'\n }\n });\n}\n\nvar indexOf = Array.prototype.indexOf;\nvar every = Array.prototype.every;\nvar rules = {};\n\nrules.tableCell = {\n filter: ['th', 'td'],\n replacement: function (content, node) {\n return cell(content, node)\n }\n};\n\nrules.tableRow = {\n filter: 'tr',\n replacement: function (content, node) {\n var borderCells = '';\n var alignMap = { left: ':--', right: '--:', center: ':-:' };\n\n if (isHeadingRow(node)) {\n for (var i = 0; i < node.childNodes.length; i++) {\n var border = '---';\n var align = (\n node.childNodes[i].getAttribute('align') || ''\n ).toLowerCase();\n\n if (align) border = alignMap[align] || border;\n\n borderCells += cell(border, node.childNodes[i]);\n }\n }\n return '\\n' + content + (borderCells ? '\\n' + borderCells : '')\n }\n};\n\nrules.table = {\n // Only convert tables with a heading row.\n // Tables with no heading row are kept using `keep` (see below).\n filter: function (node) {\n return node.nodeName === 'TABLE' && isHeadingRow(node.rows[0])\n },\n\n replacement: function (content) {\n // Ensure there are no blank lines\n content = content.replace('\\n\\n', '\\n');\n return '\\n\\n' + content + '\\n\\n'\n }\n};\n\nrules.tableSection = {\n filter: ['thead', 'tbody', 'tfoot'],\n replacement: function (content) {\n return content\n }\n};\n\n// A tr is a heading row if:\n// - the parent is a THEAD\n// - or if its the first child of the TABLE or the first TBODY (possibly\n// following a blank THEAD)\n// - and every cell is a TH\nfunction isHeadingRow (tr) {\n var parentNode = tr.parentNode;\n return (\n parentNode.nodeName === 'THEAD' ||\n (\n parentNode.firstChild === tr &&\n (parentNode.nodeName === 'TABLE' || isFirstTbody(parentNode)) &&\n every.call(tr.childNodes, function (n) { return n.nodeName === 'TH' })\n )\n )\n}\n\nfunction isFirstTbody (element) {\n var previousSibling = element.previousSibling;\n return (\n element.nodeName === 'TBODY' && (\n !previousSibling ||\n (\n previousSibling.nodeName === 'THEAD' &&\n /^\\s*$/i.test(previousSibling.textContent)\n )\n )\n )\n}\n\nfunction cell (content, node) {\n var index = indexOf.call(node.parentNode.childNodes, node);\n var prefix = ' ';\n if (index === 0) prefix = '| ';\n return prefix + content + ' |'\n}\n\nfunction tables (turndownService) {\n turndownService.keep(function (node) {\n return node.nodeName === 'TABLE' && !isHeadingRow(node.rows[0])\n });\n for (var key in rules) turndownService.addRule(key, rules[key]);\n}\n\nfunction taskListItems (turndownService) {\n turndownService.addRule('taskListItems', {\n filter: function (node) {\n return node.type === 'checkbox' && node.parentNode.nodeName === 'LI'\n },\n replacement: function (content, node) {\n return (node.checked ? '[x]' : '[ ]') + ' '\n }\n });\n}\n\nfunction gfm (turndownService) {\n turndownService.use([\n highlightedCodeBlock,\n strikethrough,\n tables,\n taskListItems\n ]);\n}\n\nexport { gfm, highlightedCodeBlock, strikethrough, tables, taskListItems };\n","function extend (destination) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (source.hasOwnProperty(key)) destination[key] = source[key];\n }\n }\n return destination\n}\n\nfunction repeat (character, count) {\n return Array(count + 1).join(character)\n}\n\nfunction trimLeadingNewlines (string) {\n return string.replace(/^\\n*/, '')\n}\n\nfunction trimTrailingNewlines (string) {\n // avoid match-at-end regexp bottleneck, see #370\n var indexEnd = string.length;\n while (indexEnd > 0 && string[indexEnd - 1] === '\\n') indexEnd--;\n return string.substring(0, indexEnd)\n}\n\nvar blockElements = [\n 'ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'BODY', 'CANVAS',\n 'CENTER', 'DD', 'DIR', 'DIV', 'DL', 'DT', 'FIELDSET', 'FIGCAPTION', 'FIGURE',\n 'FOOTER', 'FORM', 'FRAMESET', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEADER',\n 'HGROUP', 'HR', 'HTML', 'ISINDEX', 'LI', 'MAIN', 'MENU', 'NAV', 'NOFRAMES',\n 'NOSCRIPT', 'OL', 'OUTPUT', 'P', 'PRE', 'SECTION', 'TABLE', 'TBODY', 'TD',\n 'TFOOT', 'TH', 'THEAD', 'TR', 'UL'\n];\n\nfunction isBlock (node) {\n return is(node, blockElements)\n}\n\nvar voidElements = [\n 'AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT',\n 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'\n];\n\nfunction isVoid (node) {\n return is(node, voidElements)\n}\n\nfunction hasVoid (node) {\n return has(node, voidElements)\n}\n\nvar meaningfulWhenBlankElements = [\n 'A', 'TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TH', 'TD', 'IFRAME', 'SCRIPT',\n 'AUDIO', 'VIDEO'\n];\n\nfunction isMeaningfulWhenBlank (node) {\n return is(node, meaningfulWhenBlankElements)\n}\n\nfunction hasMeaningfulWhenBlank (node) {\n return has(node, meaningfulWhenBlankElements)\n}\n\nfunction is (node, tagNames) {\n return tagNames.indexOf(node.nodeName) >= 0\n}\n\nfunction has (node, tagNames) {\n return (\n node.getElementsByTagName &&\n tagNames.some(function (tagName) {\n return node.getElementsByTagName(tagName).length\n })\n )\n}\n\nvar rules = {};\n\nrules.paragraph = {\n filter: 'p',\n\n replacement: function (content) {\n return '\\n\\n' + content + '\\n\\n'\n }\n};\n\nrules.lineBreak = {\n filter: 'br',\n\n replacement: function (content, node, options) {\n return options.br + '\\n'\n }\n};\n\nrules.heading = {\n filter: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n\n replacement: function (content, node, options) {\n var hLevel = Number(node.nodeName.charAt(1));\n\n if (options.headingStyle === 'setext' && hLevel < 3) {\n var underline = repeat((hLevel === 1 ? '=' : '-'), content.length);\n return (\n '\\n\\n' + content + '\\n' + underline + '\\n\\n'\n )\n } else {\n return '\\n\\n' + repeat('#', hLevel) + ' ' + content + '\\n\\n'\n }\n }\n};\n\nrules.blockquote = {\n filter: 'blockquote',\n\n replacement: function (content) {\n content = content.replace(/^\\n+|\\n+$/g, '');\n content = content.replace(/^/gm, '> ');\n return '\\n\\n' + content + '\\n\\n'\n }\n};\n\nrules.list = {\n filter: ['ul', 'ol'],\n\n replacement: function (content, node) {\n var parent = node.parentNode;\n if (parent.nodeName === 'LI' && parent.lastElementChild === node) {\n return '\\n' + content\n } else {\n return '\\n\\n' + content + '\\n\\n'\n }\n }\n};\n\nrules.listItem = {\n filter: 'li',\n\n replacement: function (content, node, options) {\n content = content\n .replace(/^\\n+/, '') // remove leading newlines\n .replace(/\\n+$/, '\\n') // replace trailing newlines with just a single one\n .replace(/\\n/gm, '\\n '); // indent\n var prefix = options.bulletListMarker + ' ';\n var parent = node.parentNode;\n if (parent.nodeName === 'OL') {\n var start = parent.getAttribute('start');\n var index = Array.prototype.indexOf.call(parent.children, node);\n prefix = (start ? Number(start) + index : index + 1) + '. ';\n }\n return (\n prefix + content + (node.nextSibling && !/\\n$/.test(content) ? '\\n' : '')\n )\n }\n};\n\nrules.indentedCodeBlock = {\n filter: function (node, options) {\n return (\n options.codeBlockStyle === 'indented' &&\n node.nodeName === 'PRE' &&\n node.firstChild &&\n node.firstChild.nodeName === 'CODE'\n )\n },\n\n replacement: function (content, node, options) {\n return (\n '\\n\\n ' +\n node.firstChild.textContent.replace(/\\n/g, '\\n ') +\n '\\n\\n'\n )\n }\n};\n\nrules.fencedCodeBlock = {\n filter: function (node, options) {\n return (\n options.codeBlockStyle === 'fenced' &&\n node.nodeName === 'PRE' &&\n node.firstChild &&\n node.firstChild.nodeName === 'CODE'\n )\n },\n\n replacement: function (content, node, options) {\n var className = node.firstChild.getAttribute('class') || '';\n var language = (className.match(/language-(\\S+)/) || [null, ''])[1];\n var code = node.firstChild.textContent;\n\n var fenceChar = options.fence.charAt(0);\n var fenceSize = 3;\n var fenceInCodeRegex = new RegExp('^' + fenceChar + '{3,}', 'gm');\n\n var match;\n while ((match = fenceInCodeRegex.exec(code))) {\n if (match[0].length >= fenceSize) {\n fenceSize = match[0].length + 1;\n }\n }\n\n var fence = repeat(fenceChar, fenceSize);\n\n return (\n '\\n\\n' + fence + language + '\\n' +\n code.replace(/\\n$/, '') +\n '\\n' + fence + '\\n\\n'\n )\n }\n};\n\nrules.horizontalRule = {\n filter: 'hr',\n\n replacement: function (content, node, options) {\n return '\\n\\n' + options.hr + '\\n\\n'\n }\n};\n\nrules.inlineLink = {\n filter: function (node, options) {\n return (\n options.linkStyle === 'inlined' &&\n node.nodeName === 'A' &&\n node.getAttribute('href')\n )\n },\n\n replacement: function (content, node) {\n var href = node.getAttribute('href');\n if (href) href = href.replace(/([()])/g, '\\\\$1');\n var title = cleanAttribute(node.getAttribute('title'));\n if (title) title = ' \"' + title.replace(/\"/g, '\\\\\"') + '\"';\n return '[' + content + '](' + href + title + ')'\n }\n};\n\nrules.referenceLink = {\n filter: function (node, options) {\n return (\n options.linkStyle === 'referenced' &&\n node.nodeName === 'A' &&\n node.getAttribute('href')\n )\n },\n\n replacement: function (content, node, options) {\n var href = node.getAttribute('href');\n var title = cleanAttribute(node.getAttribute('title'));\n if (title) title = ' \"' + title + '\"';\n var replacement;\n var reference;\n\n switch (options.linkReferenceStyle) {\n case 'collapsed':\n replacement = '[' + content + '][]';\n reference = '[' + content + ']: ' + href + title;\n break\n case 'shortcut':\n replacement = '[' + content + ']';\n reference = '[' + content + ']: ' + href + title;\n break\n default:\n var id = this.references.length + 1;\n replacement = '[' + content + '][' + id + ']';\n reference = '[' + id + ']: ' + href + title;\n }\n\n this.references.push(reference);\n return replacement\n },\n\n references: [],\n\n append: function (options) {\n var references = '';\n if (this.references.length) {\n references = '\\n\\n' + this.references.join('\\n') + '\\n\\n';\n this.references = []; // Reset references\n }\n return references\n }\n};\n\nrules.emphasis = {\n filter: ['em', 'i'],\n\n replacement: function (content, node, options) {\n if (!content.trim()) return ''\n return options.emDelimiter + content + options.emDelimiter\n }\n};\n\nrules.strong = {\n filter: ['strong', 'b'],\n\n replacement: function (content, node, options) {\n if (!content.trim()) return ''\n return options.strongDelimiter + content + options.strongDelimiter\n }\n};\n\nrules.code = {\n filter: function (node) {\n var hasSiblings = node.previousSibling || node.nextSibling;\n var isCodeBlock = node.parentNode.nodeName === 'PRE' && !hasSiblings;\n\n return node.nodeName === 'CODE' && !isCodeBlock\n },\n\n replacement: function (content) {\n if (!content) return ''\n content = content.replace(/\\r?\\n|\\r/g, ' ');\n\n var extraSpace = /^`|^ .*?[^ ].* $|`$/.test(content) ? ' ' : '';\n var delimiter = '`';\n var matches = content.match(/`+/gm) || [];\n while (matches.indexOf(delimiter) !== -1) delimiter = delimiter + '`';\n\n return delimiter + extraSpace + content + extraSpace + delimiter\n }\n};\n\nrules.image = {\n filter: 'img',\n\n replacement: function (content, node) {\n var alt = cleanAttribute(node.getAttribute('alt'));\n var src = node.getAttribute('src') || '';\n var title = cleanAttribute(node.getAttribute('title'));\n var titlePart = title ? ' \"' + title + '\"' : '';\n return src ? '![' + alt + ']' + '(' + src + titlePart + ')' : ''\n }\n};\n\nfunction cleanAttribute (attribute) {\n return attribute ? attribute.replace(/(\\n+\\s*)+/g, '\\n') : ''\n}\n\n/**\n * Manages a collection of rules used to convert HTML to Markdown\n */\n\nfunction Rules (options) {\n this.options = options;\n this._keep = [];\n this._remove = [];\n\n this.blankRule = {\n replacement: options.blankReplacement\n };\n\n this.keepReplacement = options.keepReplacement;\n\n this.defaultRule = {\n replacement: options.defaultReplacement\n };\n\n this.array = [];\n for (var key in options.rules) this.array.push(options.rules[key]);\n}\n\nRules.prototype = {\n add: function (key, rule) {\n this.array.unshift(rule);\n },\n\n keep: function (filter) {\n this._keep.unshift({\n filter: filter,\n replacement: this.keepReplacement\n });\n },\n\n remove: function (filter) {\n this._remove.unshift({\n filter: filter,\n replacement: function () {\n return ''\n }\n });\n },\n\n forNode: function (node) {\n if (node.isBlank) return this.blankRule\n var rule;\n\n if ((rule = findRule(this.array, node, this.options))) return rule\n if ((rule = findRule(this._keep, node, this.options))) return rule\n if ((rule = findRule(this._remove, node, this.options))) return rule\n\n return this.defaultRule\n },\n\n forEach: function (fn) {\n for (var i = 0; i < this.array.length; i++) fn(this.array[i], i);\n }\n};\n\nfunction findRule (rules, node, options) {\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n if (filterValue(rule, node, options)) return rule\n }\n return void 0\n}\n\nfunction filterValue (rule, node, options) {\n var filter = rule.filter;\n if (typeof filter === 'string') {\n if (filter === node.nodeName.toLowerCase()) return true\n } else if (Array.isArray(filter)) {\n if (filter.indexOf(node.nodeName.toLowerCase()) > -1) return true\n } else if (typeof filter === 'function') {\n if (filter.call(rule, node, options)) return true\n } else {\n throw new TypeError('`filter` needs to be a string, array, or function')\n }\n}\n\n/**\n * The collapseWhitespace function is adapted from collapse-whitespace\n * by Luc Thevenard.\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2014 Luc Thevenard <lucthevenard@gmail.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * collapseWhitespace(options) removes extraneous whitespace from an the given element.\n *\n * @param {Object} options\n */\nfunction collapseWhitespace (options) {\n var element = options.element;\n var isBlock = options.isBlock;\n var isVoid = options.isVoid;\n var isPre = options.isPre || function (node) {\n return node.nodeName === 'PRE'\n };\n\n if (!element.firstChild || isPre(element)) return\n\n var prevText = null;\n var keepLeadingWs = false;\n\n var prev = null;\n var node = next(prev, element, isPre);\n\n while (node !== element) {\n if (node.nodeType === 3 || node.nodeType === 4) { // Node.TEXT_NODE or Node.CDATA_SECTION_NODE\n var text = node.data.replace(/[ \\r\\n\\t]+/g, ' ');\n\n if ((!prevText || / $/.test(prevText.data)) &&\n !keepLeadingWs && text[0] === ' ') {\n text = text.substr(1);\n }\n\n // `text` might be empty at this point.\n if (!text) {\n node = remove(node);\n continue\n }\n\n node.data = text;\n\n prevText = node;\n } else if (node.nodeType === 1) { // Node.ELEMENT_NODE\n if (isBlock(node) || node.nodeName === 'BR') {\n if (prevText) {\n prevText.data = prevText.data.replace(/ $/, '');\n }\n\n prevText = null;\n keepLeadingWs = false;\n } else if (isVoid(node) || isPre(node)) {\n // Avoid trimming space around non-block, non-BR void elements and inline PRE.\n prevText = null;\n keepLeadingWs = true;\n } else if (prevText) {\n // Drop protection if set previously.\n keepLeadingWs = false;\n }\n } else {\n node = remove(node);\n continue\n }\n\n var nextNode = next(prev, node, isPre);\n prev = node;\n node = nextNode;\n }\n\n if (prevText) {\n prevText.data = prevText.data.replace(/ $/, '');\n if (!prevText.data) {\n remove(prevText);\n }\n }\n}\n\n/**\n * remove(node) removes the given node from the DOM and returns the\n * next node in the sequence.\n *\n * @param {Node} node\n * @return {Node} node\n */\nfunction remove (node) {\n var next = node.nextSibling || node.parentNode;\n\n node.parentNode.removeChild(node);\n\n return next\n}\n\n/**\n * next(prev, current, isPre) returns the next node in the sequence, given the\n * current and previous nodes.\n *\n * @param {Node} prev\n * @param {Node} current\n * @param {Function} isPre\n * @return {Node}\n */\nfunction next (prev, current, isPre) {\n if ((prev && prev.parentNode === current) || isPre(current)) {\n return current.nextSibling || current.parentNode\n }\n\n return current.firstChild || current.nextSibling || current.parentNode\n}\n\n/*\n * Set up window for Node.js\n */\n\nvar root = (typeof window !== 'undefined' ? window : {});\n\n/*\n * Parsing HTML strings\n */\n\nfunction canParseHTMLNatively () {\n var Parser = root.DOMParser;\n var canParse = false;\n\n // Adapted from https://gist.github.com/1129031\n // Firefox/Opera/IE throw errors on unsupported types\n try {\n // WebKit returns null on unsupported types\n if (new Parser().parseFromString('', 'text/html')) {\n canParse = true;\n }\n } catch (e) {}\n\n return canParse\n}\n\nfunction createHTMLParser () {\n var Parser = function () {};\n\n {\n if (shouldUseActiveX()) {\n Parser.prototype.parseFromString = function (string) {\n var doc = new window.ActiveXObject('htmlfile');\n doc.designMode = 'on'; // disable on-page scripts\n doc.open();\n doc.write(string);\n doc.close();\n return doc\n };\n } else {\n Parser.prototype.parseFromString = function (string) {\n var doc = document.implementation.createHTMLDocument('');\n doc.open();\n doc.write(string);\n doc.close();\n return doc\n };\n }\n }\n return Parser\n}\n\nfunction shouldUseActiveX () {\n var useActiveX = false;\n try {\n document.implementation.createHTMLDocument('').open();\n } catch (e) {\n if (root.ActiveXObject) useActiveX = true;\n }\n return useActiveX\n}\n\nvar HTMLParser = canParseHTMLNatively() ? root.DOMParser : createHTMLParser();\n\nfunction RootNode (input, options) {\n var root;\n if (typeof input === 'string') {\n var doc = htmlParser().parseFromString(\n // DOM parsers arrange elements in the <head> and <body>.\n // Wrapping in a custom element ensures elements are reliably arranged in\n // a single element.\n '<x-turndown id=\"turndown-root\">' + input + '</x-turndown>',\n 'text/html'\n );\n root = doc.getElementById('turndown-root');\n } else {\n root = input.cloneNode(true);\n }\n collapseWhitespace({\n element: root,\n isBlock: isBlock,\n isVoid: isVoid,\n isPre: options.preformattedCode ? isPreOrCode : null\n });\n\n return root\n}\n\nvar _htmlParser;\nfunction htmlParser () {\n _htmlParser = _htmlParser || new HTMLParser();\n return _htmlParser\n}\n\nfunction isPreOrCode (node) {\n return node.nodeName === 'PRE' || node.nodeName === 'CODE'\n}\n\nfunction Node (node, options) {\n node.isBlock = isBlock(node);\n node.isCode = node.nodeName === 'CODE' || node.parentNode.isCode;\n node.isBlank = isBlank(node);\n node.flankingWhitespace = flankingWhitespace(node, options);\n return node\n}\n\nfunction isBlank (node) {\n return (\n !isVoid(node) &&\n !isMeaningfulWhenBlank(node) &&\n /^\\s*$/i.test(node.textContent) &&\n !hasVoid(node) &&\n !hasMeaningfulWhenBlank(node)\n )\n}\n\nfunction flankingWhitespace (node, options) {\n if (node.isBlock || (options.preformattedCode && node.isCode)) {\n return { leading: '', trailing: '' }\n }\n\n var edges = edgeWhitespace(node.textContent);\n\n // abandon leading ASCII WS if left-flanked by ASCII WS\n if (edges.leadingAscii && isFlankedByWhitespace('left', node, options)) {\n edges.leading = edges.leadingNonAscii;\n }\n\n // abandon trailing ASCII WS if right-flanked by ASCII WS\n if (edges.trailingAscii && isFlankedByWhitespace('right', node, options)) {\n edges.trailing = edges.trailingNonAscii;\n }\n\n return { leading: edges.leading, trailing: edges.trailing }\n}\n\nfunction edgeWhitespace (string) {\n var m = string.match(/^(([ \\t\\r\\n]*)(\\s*))(?:(?=\\S)[\\s\\S]*\\S)?((\\s*?)([ \\t\\r\\n]*))$/);\n return {\n leading: m[1], // whole string for whitespace-only strings\n leadingAscii: m[2],\n leadingNonAscii: m[3],\n trailing: m[4], // empty for whitespace-only strings\n trailingNonAscii: m[5],\n trailingAscii: m[6]\n }\n}\n\nfunction isFlankedByWhitespace (side, node, options) {\n var sibling;\n var regExp;\n var isFlanked;\n\n if (side === 'left') {\n sibling = node.previousSibling;\n regExp = / $/;\n } else {\n sibling = node.nextSibling;\n regExp = /^ /;\n }\n\n if (sibling) {\n if (sibling.nodeType === 3) {\n isFlanked = regExp.test(sibling.nodeValue);\n } else if (options.preformattedCode && sibling.nodeName === 'CODE') {\n isFlanked = false;\n } else if (sibling.nodeType === 1 && !isBlock(sibling)) {\n isFlanked = regExp.test(sibling.textContent);\n }\n }\n return isFlanked\n}\n\nvar reduce = Array.prototype.reduce;\nvar escapes = [\n [/\\\\/g, '\\\\\\\\'],\n [/\\*/g, '\\\\*'],\n [/^-/g, '\\\\-'],\n [/^\\+ /g, '\\\\+ '],\n [/^(=+)/g, '\\\\$1'],\n [/^(#{1,6}) /g, '\\\\$1 '],\n [/`/g, '\\\\`'],\n [/^~~~/g, '\\\\~~~'],\n [/\\[/g, '\\\\['],\n [/\\]/g, '\\\\]'],\n [/^>/g, '\\\\>'],\n [/_/g, '\\\\_'],\n [/^(\\d+)\\. /g, '$1\\\\. ']\n];\n\nfunction TurndownService (options) {\n if (!(this instanceof TurndownService)) return new TurndownService(options)\n\n var defaults = {\n rules: rules,\n headingStyle: 'setext',\n hr: '* * *',\n bulletListMarker: '*',\n codeBlockStyle: 'indented',\n fence: '```',\n emDelimiter: '_',\n strongDelimiter: '**',\n linkStyle: 'inlined',\n linkReferenceStyle: 'full',\n br: ' ',\n preformattedCode: false,\n blankReplacement: function (content, node) {\n return node.isBlock ? '\\n\\n' : ''\n },\n keepReplacement: function (content, node) {\n return node.isBlock ? '\\n\\n' + node.outerHTML + '\\n\\n' : node.outerHTML\n },\n defaultReplacement: function (content, node) {\n return node.isBlock ? '\\n\\n' + content + '\\n\\n' : content\n }\n };\n this.options = extend({}, defaults, options);\n this.rules = new Rules(this.options);\n}\n\nTurndownService.prototype = {\n /**\n * The entry point for converting a string or DOM node to Markdown\n * @public\n * @param {String|HTMLElement} input The string or DOM node to convert\n * @returns A Markdown representation of the input\n * @type String\n */\n\n turndown: function (input) {\n if (!canConvert(input)) {\n throw new TypeError(\n input + ' is not a string, or an element/document/fragment node.'\n )\n }\n\n if (input === '') return ''\n\n var output = process.call(this, new RootNode(input, this.options));\n return postProcess.call(this, output)\n },\n\n /**\n * Add one or more plugins\n * @public\n * @param {Function|Array} plugin The plugin or array of plugins to add\n * @returns The Turndown instance for chaining\n * @type Object\n */\n\n use: function (plugin) {\n if (Array.isArray(plugin)) {\n for (var i = 0; i < plugin.length; i++) this.use(plugin[i]);\n } else if (typeof plugin === 'function') {\n plugin(this);\n } else {\n throw new TypeError('plugin must be a Function or an Array of Functions')\n }\n return this\n },\n\n /**\n * Adds a rule\n * @public\n * @param {String} key The unique key of the rule\n * @param {Object} rule The rule\n * @returns The Turndown instance for chaining\n * @type Object\n */\n\n addRule: function (key, rule) {\n this.rules.add(key, rule);\n return this\n },\n\n /**\n * Keep a node (as HTML) that matches the filter\n * @public\n * @param {String|Array|Function} filter The unique key of the rule\n * @returns The Turndown instance for chaining\n * @type Object\n */\n\n keep: function (filter) {\n this.rules.keep(filter);\n return this\n },\n\n /**\n * Remove a node that matches the filter\n * @public\n * @param {String|Array|Function} filter The unique key of the rule\n * @returns The Turndown instance for chaining\n * @type Object\n */\n\n remove: function (filter) {\n this.rules.remove(filter);\n return this\n },\n\n /**\n * Escapes Markdown syntax\n * @public\n * @param {String} string The string to escape\n * @returns A string with Markdown syntax escaped\n * @type String\n */\n\n escape: function (string) {\n return escapes.reduce(function (accumulator, escape) {\n return accumulator.replace(escape[0], escape[1])\n }, string)\n }\n};\n\n/**\n * Reduces a DOM node down to its Markdown string equivalent\n * @private\n * @param {HTMLElement} parentNode The node to convert\n * @returns A Markdown representation of the node\n * @type String\n */\n\nfunction process (parentNode) {\n var self = this;\n return reduce.call(parentNode.childNodes, function (output, node) {\n node = new Node(node, self.options);\n\n var replacement = '';\n if (node.nodeType === 3) {\n replacement = node.isCode ? node.nodeValue : self.escape(node.nodeValue);\n } else if (node.nodeType === 1) {\n replacement = replacementForNode.call(self, node);\n }\n\n return join(output, replacement)\n }, '')\n}\n\n/**\n * Appends strings as each rule requires and trims the output\n * @private\n * @param {String} output The conversion output\n * @returns A trimmed version of the ouput\n * @type String\n */\n\nfunction postProcess (output) {\n var self = this;\n this.rules.forEach(function (rule) {\n if (typeof rule.append === 'function') {\n output = join(output, rule.append(self.options));\n }\n });\n\n return output.replace(/^[\\t\\r\\n]+/, '').replace(/[\\t\\r\\n\\s]+$/, '')\n}\n\n/**\n * Converts an element node to its Markdown equivalent\n * @private\n * @param {HTMLElement} node The node to convert\n * @returns A Markdown representation of the node\n * @type String\n */\n\nfunction replacementForNode (node) {\n var rule = this.rules.forNode(node);\n var content = process.call(this, node);\n var whitespace = node.flankingWhitespace;\n if (whitespace.leading || whitespace.trailing) content = content.trim();\n return (\n whitespace.leading +\n rule.replacement(content, node, this.options) +\n whitespace.trailing\n )\n}\n\n/**\n * Joins replacement to the current output with appropriate number of new lines\n * @private\n * @param {String} output The current conversion output\n * @param {String} replacement The string to append to the output\n * @returns Joined output\n * @type String\n */\n\nfunction join (output, replacement) {\n var s1 = trimTrailingNewlines(output);\n var s2 = trimLeadingNewlines(replacement);\n var nls = Math.max(output.length - s1.length, replacement.length - s2.length);\n var separator = '\\n\\n'.substring(0, nls);\n\n return s1 + separator + s2\n}\n\n/**\n * Determines whether an input can be converted\n * @private\n * @param {String|HTMLElement} input Describe this parameter\n * @returns Describe what it returns\n * @type String|Object|Array|Boolean|Number\n */\n\nfunction canConvert (input) {\n return (\n input != null && (\n typeof input === 'string' ||\n (input.nodeType && (\n input.nodeType === 1 || input.nodeType === 9 || input.nodeType === 11\n ))\n )\n )\n}\n\nexport default TurndownService;\n","/**\n * Replace whitespace of text nodes within the given parents in the given root element.\n * @param {*} root An HTMLElement to look for text nodes within\n * @param {*} allowed_whitespace_nodes String array of allowed text nodes ( ['STRONG', 'EM'] ... )\n * @param {*} allowed_raw_nodes String array of allowed raw text nodes ( ['PRE', 'CODE'] ... )\n */\nexport function textNodesPreprocessor(root, allowed_whitespace_nodes, allowed_raw_nodes) {\n\tallowed_whitespace_nodes = allowed_whitespace_nodes.map(el => el.toUpperCase());\n\tallowed_raw_nodes = allowed_raw_nodes.map(el => el.toUpperCase());\n\n\tlet walker = document.createNodeIterator(\n\t\troot,\n\t\t// Only consider text nodes\n\t\tNodeFilter.SHOW_TEXT,\n\t);\n\n\tlet node;\n\twhile (node = walker.nextNode()) {\n\t\t// Strip NBSP whitespace in given nodes\n\t\tif (node.parentElement && allowed_whitespace_nodes.indexOf(node.parentElement.nodeName) >= 0) {\n\t\t\tnode.nodeValue = node.nodeValue\n\t\t\t\t.replace(/^[\\u00a0]+/g, ' ')\n\t\t\t\t.replace(/[\\u00a0]+$/g, ' ');\n\t\t}\n\n\t\t// Re-encode < and > that would otherwise be output as HTML by turndown\n\t\t// https://github.com/domchristie/turndown/issues/106\n\t\tif (!hasParentOfType(node, allowed_raw_nodes)) {\n\t\t\tnode.nodeValue = _.escape(node.nodeValue);\n\t\t}\n\t}\n}\n\n/**\n * Replace links of A elements with their computed .href attribute\n * https://community.ooject.com/wp/29742\n * @param {} root\n * @param {*} allowed_whitespace_nodes\n * @param {*} allowed_raw_nodes\n */\nexport function linkPreprocessor(root, _allowed_whitespace_nodes, _allowed_raw_nodes) {\n\tlet walker = document.createNodeIterator(\n\t\troot,\n\t\t// Only consider element nodes\n\t\tNodeFilter.SHOW_ELEMENT,\n\t\t// Accept only A tags\n\t\tfunction (node) {\n\t\t\treturn node.nodeName.toLowerCase() === 'a' ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n\t\t}\n\t);\n\n\tlet node;\n\twhile (node = walker.nextNode()) {\n\t\t// node.href is properly escaped, while the attribute is not\n\t\t// and turndown uses the getAttribute version\n\t\tnode.setAttribute('href', node.href);\n\t}\n}\n\nexport function breaksPreprocessor(root, _allowed_whitespace_nodes, _allowed_raw_nodes) {\n\tlet walker = document.createNodeIterator(\n\t\troot,\n\t\tNodeFilter.SHOW_ELEMENT,\n\t\t{\n\t\t\tacceptNode: function (node) {\n\t\t\t\tif (node.tagName === 'P' && node.childNodes.length === 0 && (!node.parentElement || node.parentElement.tagName === 'LI')) {\n\t\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\n\tlet node;\n\twhile (node = walker.nextNode()) {\n\t\tnode.appendChild(document.createElement('br'));\n\t}\n}\n\nexport function hasParentOfType(node, tagNames) {\n\tlet parent = node.parentElement;\n\n\twhile (parent) {\n\t\tif (tagNames.indexOf(parent.tagName) >= 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tparent = parent.parentElement;\n\t}\n\n\treturn false;\n}\n","\nexport const PAGE_BREAK_MARKDOWN = '<br style=\"page-break-after:always;\">';\nexport function isPageBreakNode(node) {\n\tconst style = node.getAttribute('style') || '';\n\treturn style.includes('page-break-');\n}\n","/* eslint-disable no-bitwise */\n\nconst decodeCache = {}\n\nfunction getDecodeCache (exclude) {\n let cache = decodeCache[exclude]\n if (cache) { return cache }\n\n cache = decodeCache[exclude] = []\n\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i)\n cache.push(ch)\n }\n\n for (let i = 0; i < exclude.length; i++) {\n const ch = exclude.charCodeAt(i)\n cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2)\n }\n\n return cache\n}\n\n// Decode percent-encoded string.\n//\nfunction decode (string, exclude) {\n if (typeof exclude !== 'string') {\n exclude = decode.defaultChars\n }\n\n const cache = getDecodeCache(exclude)\n\n return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) {\n let result = ''\n\n for (let i = 0, l = seq.length; i < l; i += 3) {\n const b1 = parseInt(seq.slice(i + 1, i + 3), 16)\n\n if (b1 < 0x80) {\n result += cache[b1]\n continue\n }\n\n if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {\n // 110xxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n\n if ((b2 & 0xC0) === 0x80) {\n const chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F)\n\n if (chr < 0x80) {\n result += '\\ufffd\\ufffd'\n } else {\n result += String.fromCharCode(chr)\n }\n\n i += 3\n continue\n }\n }\n\n if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16)\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n const chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F)\n\n if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {\n result += '\\ufffd\\ufffd\\ufffd'\n } else {\n result += String.fromCharCode(chr)\n }\n\n i += 6\n continue\n }\n }\n\n if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {\n // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16)\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16)\n const b4 = parseInt(seq.slice(i + 10, i + 12), 16)\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {\n let chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F)\n\n if (chr < 0x10000 || chr > 0x10FFFF) {\n result += '\\ufffd\\ufffd\\ufffd\\ufffd'\n } else {\n chr -= 0x10000\n result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF))\n }\n\n i += 9\n continue\n }\n }\n\n result += '\\ufffd'\n }\n\n return result\n })\n}\n\ndecode.defaultChars = ';/?:@&=+$,#'\ndecode.componentChars = ''\n\nexport default decode\n","const encodeCache = {}\n\n// Create a lookup array where anything but characters in `chars` string\n// and alphanumeric chars is percent-encoded.\n//\nfunction getEncodeCache (exclude) {\n let cache = encodeCache[exclude]\n if (cache) { return cache }\n\n cache = encodeCache[exclude] = []\n\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i)\n\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch)\n } else {\n cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2))\n }\n }\n\n for (let i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i]\n }\n\n return cache\n}\n\n// Encode unsafe characters with percent-encoding, skipping already\n// encoded sequences.\n//\n// - string - string to encode\n// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n//\nfunction encode (string, exclude, keepEscaped) {\n if (typeof exclude !== 'string') {\n // encode(string, keepEscaped)\n keepEscaped = exclude\n exclude = encode.defaultChars\n }\n\n if (typeof keepEscaped === 'undefined') {\n keepEscaped = true\n }\n\n const cache = getEncodeCache(exclude)\n let result = ''\n\n for (let i = 0, l = string.length; i < l; i++) {\n const code = string.charCodeAt(i)\n\n if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3)\n i += 2\n continue\n }\n }\n\n if (code < 128) {\n result += cache[code]\n continue\n }\n\n if (code >= 0xD800 && code <= 0xDFFF) {\n if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {\n const nextCode = string.charCodeAt(i + 1)\n if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += encodeURIComponent(string[i] + string[i + 1])\n i++\n continue\n }\n }\n result += '%EF%BF%BD'\n continue\n }\n\n result += encodeURIComponent(string[i])\n }\n\n return result\n}\n\nencode.defaultChars = \";/?:@&=+$,-_.!~*'()#\"\nencode.componentChars = \"-_.!~*'()\"\n\nexport default encode\n","export default function format (url) {\n let result = ''\n\n result += url.protocol || ''\n result += url.slashes ? '//' : ''\n result += url.auth ? url.auth + '@' : ''\n\n if (url.hostname && url.hostname.indexOf(':') !== -1) {\n // ipv6 address\n result += '[' + url.hostname + ']'\n } else {\n result += url.hostname || ''\n }\n\n result += url.port ? ':' + url.port : ''\n result += url.pathname || ''\n result += url.search || ''\n result += url.hash || ''\n\n return result\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n//\n// Changes from joyent/node:\n//\n// 1. No leading slash in paths,\n// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`\n//\n// 2. Backslashes are not replaced with slashes,\n// so `http:\\\\example.org\\` is treated like a relative path\n//\n// 3. Trailing colon is treated like a part of the path,\n// i.e. in `http://example.org:foo` pathname is `:foo`\n//\n// 4. Nothing is URL-encoded in the resulting object,\n// (in joyent/node some chars in auth and paths are encoded)\n//\n// 5. `url.parse()` does not have `parseQueryString` argument\n//\n// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,\n// which can be constructed using other parts of the url.\n//\n\nfunction Url () {\n this.protocol = null\n this.slashes = null\n this.auth = null\n this.port = null\n this.hostname = null\n this.hash = null\n this.search = null\n this.pathname = null\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nconst protocolPattern = /^([a-z0-9.+-]+:)/i\nconst portPattern = /:[0-9]*$/\n\n// Special case for a simple path URL\n/* eslint-disable-next-line no-useless-escape */\nconst simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/\n\n// RFC 2396: characters reserved for delimiting URLs.\n// We actually just auto-escape these.\nconst delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t']\n\n// RFC 2396: characters not allowed for various reasons.\nconst unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims)\n\n// Allowed by RFCs, but cause of XSS attacks. Always escape these.\nconst autoEscape = ['\\''].concat(unwise)\n// Characters that are never ever allowed in a hostname.\n// Note that any invalid chars are also handled, but these\n// are the ones that are *expected* to be seen, so we fast-path\n// them.\nconst nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape)\nconst hostEndingChars = ['/', '?', '#']\nconst hostnameMaxLen = 255\nconst hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/\nconst hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/\n// protocols that can allow \"unsafe\" and \"unwise\" chars.\n// protocols that never have a hostname.\nconst hostlessProtocol = {\n javascript: true,\n 'javascript:': true\n}\n// protocols that always contain a // bit.\nconst slashedProtocol = {\n http: true,\n https: true,\n ftp: true,\n gopher: true,\n file: true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n}\n\nfunction urlParse (url, slashesDenoteHost) {\n if (url && url instanceof Url) return url\n\n const u = new Url()\n u.parse(url, slashesDenoteHost)\n return u\n}\n\nUrl.prototype.parse = function (url, slashesDenoteHost) {\n let lowerProto, hec, slashes\n let rest = url\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim()\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n const simplePath = simplePathPattern.exec(rest)\n if (simplePath) {\n this.pathname = simplePath[1]\n if (simplePath[2]) {\n this.search = simplePath[2]\n }\n return this\n }\n }\n\n let proto = protocolPattern.exec(rest)\n if (proto) {\n proto = proto[0]\n lowerProto = proto.toLowerCase()\n this.protocol = proto\n rest = rest.substr(proto.length)\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n /* eslint-disable-next-line no-useless-escape */\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n slashes = rest.substr(0, 2) === '//'\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2)\n this.slashes = true\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n let hostEnd = -1\n for (let i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i])\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec\n }\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n let auth, atSign\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@')\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd)\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign)\n rest = rest.slice(atSign + 1)\n this.auth = auth\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1\n for (let i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i])\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec\n }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) {\n hostEnd = rest.length\n }\n\n if (rest[hostEnd - 1] === ':') { hostEnd-- }\n const host = rest.slice(0, hostEnd)\n rest = rest.slice(hostEnd)\n\n // pull out port.\n this.parseHost(host)\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || ''\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n const ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']'\n\n // validate a little.\n if (!ipv6Hostname) {\n const hostparts = this.hostname.split(/\\./)\n for (let i = 0, l = hostparts.length; i < l; i++) {\n const part = hostparts[i]\n if (!part) { continue }\n if (!part.match(hostnamePartPattern)) {\n let newpart = ''\n for (let j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x'\n } else {\n newpart += part[j]\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n const validParts = hostparts.slice(0, i)\n const notHost = hostparts.slice(i + 1)\n const bit = part.match(hostnamePartStart)\n if (bit) {\n validParts.push(bit[1])\n notHost.unshift(bit[2])\n }\n if (notHost.length) {\n rest = notHost.join('.') + rest\n }\n this.hostname = validParts.join('.')\n break\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = ''\n }\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2)\n }\n }\n\n // chop off from the tail first.\n const hash = rest.indexOf('#')\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash)\n rest = rest.slice(0, hash)\n }\n const qm = rest.indexOf('?')\n if (qm !== -1) {\n this.search = rest.substr(qm)\n rest = rest.slice(0, qm)\n }\n if (rest) { this.pathname = rest }\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = ''\n }\n\n return this\n}\n\nUrl.prototype.parseHost = function (host) {\n let port = portPattern.exec(host)\n if (port) {\n port = port[0]\n if (port !== ':') {\n this.port = port.substr(1)\n }\n host = host.substr(0, host.length - port.length)\n }\n if (host) { this.hostname = host }\n}\n\nexport default urlParse\n","export default /[!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1B7D\\u1B7E\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]|\\uD800[\\uDD00-\\uDD02\\uDF9F\\uDFD0]|\\uD801\\uDD6F|\\uD802[\\uDC57\\uDD1F\\uDD3F\\uDE50-\\uDE58\\uDE7F\\uDEF0-\\uDEF6\\uDF39-\\uDF3F\\uDF99-\\uDF9C]|\\uD803[\\uDEAD\\uDF55-\\uDF59\\uDF86-\\uDF89]|\\uD804[\\uDC47-\\uDC4D\\uDCBB\\uDCBC\\uDCBE-\\uDCC1\\uDD40-\\uDD43\\uDD74\\uDD75\\uDDC5-\\uDDC8\\uDDCD\\uDDDB\\uDDDD-\\uDDDF\\uDE38-\\uDE3D\\uDEA9]|\\uD805[\\uDC4B-\\uDC4F\\uDC5A\\uDC5B\\uDC5D\\uDCC6\\uDDC1-\\uDDD7\\uDE41-\\uDE43\\uDE60-\\uDE6C\\uDEB9\\uDF3C-\\uDF3E]|\\uD806[\\uDC3B\\uDD44-\\uDD46\\uDDE2\\uDE3F-\\uDE46\\uDE9A-\\uDE9C\\uDE9E-\\uDEA2\\uDF00-\\uDF09]|\\uD807[\\uDC41-\\uDC45\\uDC70\\uDC71\\uDEF7\\uDEF8\\uDF43-\\uDF4F\\uDFFF]|\\uD809[\\uDC70-\\uDC74]|\\uD80B[\\uDFF1\\uDFF2]|\\uD81A[\\uDE6E\\uDE6F\\uDEF5\\uDF37-\\uDF3B\\uDF44]|\\uD81B[\\uDE97-\\uDE9A\\uDFE2]|\\uD82F\\uDC9F|\\uD836[\\uDE87-\\uDE8B]|\\uD83A[\\uDD5E\\uDD5F]/","export default /[\\$\\+<->\\^`\\|~\\xA2-\\xA6\\xA8\\xA9\\xAC\\xAE-\\xB1\\xB4\\xB8\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u0888\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C0\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2B95\\u2B97-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A\\uAB6B\\uFB29\\uFBB2-\\uFBC2\\uFD40-\\uFD4F\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uF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-\\uDE53\\uDE60-\\uDE6D\\uDE70-\\uDE7C\\uDE80-\\uDE88\\uDE90-\\uDEBD\\uDEBF-\\uDEC5\\uDECE-\\uDEDB\\uDEE0-\\uDEE8\\uDEF0-\\uDEF8\\uDF00-\\uDF92\\uDF94-\\uDFCA]/","export default /[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/","export default /[\\0-\\x1F\\x7F-\\x9F]/","export default /[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u0890\\u0891\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804[\\uDCBD\\uDCCD]|\\uD80D[\\uDC30-\\uDC3F]|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/","export default /[ \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]/","// Generated using scripts/write-decode-map.ts\nexport default new Uint16Array(\n// prettier-ignore\n\"\\u1d41<\\xd5\\u0131\\u028a\\u049d\\u057b\\u05d0\\u0675\\u06de\\u07a2\\u07d6\\u080f\\u0a4a\\u0a91\\u0da1\\u0e6d\\u0f09\\u0f26\\u10ca\\u1228\\u12e1\\u1415\\u149d\\u14c3\\u14df\\u1525\\0\\0\\0\\0\\0\\0\\u156b\\u16cd\\u198d\\u1c12\\u1ddd\\u1f7e\\u2060\\u21b0\\u228d\\u23c0\\u23fb\\u2442\\u2824\\u2912\\u2d08\\u2e48\\u2fce\\u3016\\u32ba\\u3639\\u37ac\\u38fe\\u3a28\\u3a71\\u3ae0\\u3b2e\\u0800EMabcfglmnoprstu\\\\bfms\\x7f\\x84\\x8b\\x90\\x95\\x98\\xa6\\xb3\\xb9\\xc8\\xcflig\\u803b\\xc6\\u40c6P\\u803b&\\u4026cute\\u803b\\xc1\\u40c1reve;\\u4102\\u0100iyx}rc\\u803b\\xc2\\u40c2;\\u4410r;\\uc000\\ud835\\udd04rave\\u803b\\xc0\\u40c0pha;\\u4391acr;\\u4100d;\\u6a53\\u0100gp\\x9d\\xa1on;\\u4104f;\\uc000\\ud835\\udd38plyFunction;\\u6061ing\\u803b\\xc5\\u40c5\\u0100cs\\xbe\\xc3r;\\uc000\\ud835\\udc9cign;\\u6254ilde\\u803b\\xc3\\u40c3ml\\u803b\\xc4\\u40c4\\u0400aceforsu\\xe5\\xfb\\xfe\\u0117\\u011c\\u0122\\u0127\\u012a\\u0100cr\\xea\\xf2kslash;\\u6216\\u0176\\xf6\\xf8;\\u6ae7ed;\\u6306y;\\u4411\\u0180crt\\u0105\\u010b\\u0114ause;\\u6235noullis;\\u612ca;\\u4392r;\\uc000\\ud835\\udd05pf;\\uc000\\ud835\\udd39eve;\\u42d8c\\xf2\\u0113mpeq;\\u624e\\u0700HOacdefhilorsu\\u014d\\u0151\\u0156\\u0180\\u019e\\u01a2\\u01b5\\u01b7\\u01ba\\u01dc\\u0215\\u0273\\u0278\\u027ecy;\\u4427PY\\u803b\\xa9\\u40a9\\u0180cpy\\u015d\\u0162\\u017aute;\\u4106\\u0100;i\\u0167\\u0168\\u62d2talDifferentialD;\\u6145leys;\\u612d\\u0200aeio\\u0189\\u018e\\u0194\\u0198ron;\\u410cdil\\u803b\\xc7\\u40c7rc;\\u4108nint;\\u6230ot;\\u410a\\u0100dn\\u01a7\\u01adilla;\\u40b8terDot;\\u40b7\\xf2\\u017fi;\\u43a7rcle\\u0200DMPT\\u01c7\\u01cb\\u01d1\\u01d6ot;\\u6299inus;\\u6296lus;\\u6295imes;\\u6297o\\u0100cs\\u01e2\\u01f8kwiseContourIntegral;\\u6232eCurly\\u0100DQ\\u0203\\u020foubleQuote;\\u601duote;\\u6019\\u0200lnpu\\u021e\\u0228\\u0247\\u0255on\\u0100;e\\u0225\\u0226\\u6237;\\u6a74\\u0180git\\u022f\\u0236\\u023aruent;\\u6261nt;\\u622fourIntegral;\\u622e\\u0100fr\\u024c\\u024e;\\u6102oduct;\\u6210nterClockwiseContourIntegral;\\u6233oss;\\u6a2fcr;\\uc000\\ud835\\udc9ep\\u0100;C\\u0284\\u0285\\u62d3ap;\\u624d\\u0580DJSZacefios\\u02a0\\u02ac\\u02b0\\u02b4\\u02b8\\u02cb\\u02d7\\u02e1\\u02e6\\u0333\\u048d\\u0100;o\\u0179\\u02a5trahd;\\u6911cy;\\u4402cy;\\u4405cy;\\u440f\\u0180grs\\u02bf\\u02c4\\u02c7ger;\\u6021r;\\u61a1hv;\\u6ae4\\u0100ay\\u02d0\\u02d5ron;\\u410e;\\u4414l\\u0100;t\\u02dd\\u02de\\u6207a;\\u4394r;\\uc000\\ud835\\udd07\\u0100af\\u02eb\\u0327\\u0100cm\\u02f0\\u0322ritical\\u0200ADGT\\u0300\\u0306\\u0316\\u031ccute;\\u40b4o\\u0174\\u030b\\u030d;\\u42d9bleAcute;\\u42ddrave;\\u4060ilde;\\u42dcond;\\u62c4ferentialD;\\u6146\\u0470\\u033d\\0\\0\\0\\u0342\\u0354\\0\\u0405f;\\uc000\\ud835\\udd3b\\u0180;DE\\u0348\\u0349\\u034d\\u40a8ot;\\u60dcqual;\\u6250ble\\u0300CDLRUV\\u0363\\u0372\\u0382\\u03cf\\u03e2\\u03f8ontourIntegra\\xec\\u0239o\\u0274\\u0379\\0\\0\\u037b\\xbb\\u0349nArrow;\\u61d3\\u0100eo\\u0387\\u03a4ft\\u0180ART\\u0390\\u0396\\u03a1rrow;\\u61d0ightArrow;\\u61d4e\\xe5\\u02cang\\u0100LR\\u03ab\\u03c4eft\\u0100AR\\u03b3\\u03b9rrow;\\u67f8ightArrow;\\u67faightArrow;\\u67f9ight\\u0100AT\\u03d8\\u03derrow;\\u61d2ee;\\u62a8p\\u0241\\u03e9\\0\\0\\u03efrrow;\\u61d1ownArrow;\\u61d5erticalBar;\\u6225n\\u0300ABLRTa\\u0412\\u042a\\u0430\\u045e\\u047f\\u037crrow\\u0180;BU\\u041d\\u041e\\u0422\\u6193ar;\\u6913pArrow;\\u61f5reve;\\u4311eft\\u02d2\\u043a\\0\\u0446\\0\\u0450ightVector;\\u6950eeVector;\\u695eector\\u0100;B\\u0459\\u045a\\u61bdar;\\u6956ight\\u01d4\\u0467\\0\\u0471eeVector;\\u695fector\\u0100;B\\u047a\\u047b\\u61c1ar;\\u6957ee\\u0100;A\\u0486\\u0487\\u62a4rrow;\\u61a7\\u0100ct\\u0492\\u0497r;\\uc000\\ud835\\udc9frok;\\u4110\\u0800NTacdfglmopqstux\\u04bd\\u04c0\\u04c4\\u04cb\\u04de\\u04e2\\u04e7\\u04ee\\u04f5\\u0521\\u052f\\u0536\\u0552\\u055d\\u0560\\u0565G;\\u414aH\\u803b\\xd0\\u40d0cute\\u803b\\xc9\\u40c9\\u0180aiy\\u04d2\\u04d7\\u04dcron;\\u411arc\\u803b\\xca\\u40ca;\\u442dot;\\u4116r;\\uc000\\ud835\\udd08rave\\u803b\\xc8\\u40c8ement;\\u6208\\u0100ap\\u04fa\\u04fecr;\\u4112ty\\u0253\\u0506\\0\\0\\u0512mallSquare;\\u65fberySmallSquare;\\u65ab\\u0100gp\\u0526\\u052aon;\\u4118f;\\uc000\\ud835\\udd3csilon;\\u4395u\\u0100ai\\u053c\\u0549l\\u0100;T\\u0542\\u0543\\u6a75ilde;\\u6242librium;\\u61cc\\u0100ci\\u0557\\u055ar;\\u6130m;\\u6a73a;\\u4397ml\\u803b\\xcb\\u40cb\\u0100ip\\u056a\\u056fsts;\\u6203onentialE;\\u6147\\u0280cfios\\u0585\\u0588\\u058d\\u05b2\\u05ccy;\\u4424r;\\uc000\\ud835\\udd09lled\\u0253\\u0597\\0\\0\\u05a3mallSquare;\\u65fcerySmallSquare;\\u65aa\\u0370\\u05ba\\0\\u05bf\\0\\0\\u05c4f;\\uc000\\ud835\\udd3dAll;\\u6200riertrf;\\u6131c\\xf2\\u05cb\\u0600JTabcdfgorst\\u05e8\\u05ec\\u05ef\\u05fa\\u0600\\u0612\\u0616\\u061b\\u061d\\u0623\\u066c\\u0672cy;\\u4403\\u803b>\\u403emma\\u0100;d\\u05f7\\u05f8\\u4393;\\u43dcreve;\\u411e\\u0180eiy\\u0607\\u060c\\u0610dil;\\u4122rc;\\u411c;\\u4413ot;\\u4120r;\\uc000\\ud835\\udd0a;\\u62d9pf;\\uc000\\ud835\\udd3eeater\\u0300EFGLST\\u0635\\u0644\\u064e\\u0656\\u065b\\u0666qual\\u0100;L\\u063e\\u063f\\u6265ess;\\u62dbullEqual;\\u6267reater;\\u6aa2ess;\\u6277lantEqual;\\u6a7eilde;\\u6273cr;\\uc000\\ud835\\udca2;\\u626b\\u0400Aacfiosu\\u0685\\u068b\\u0696\\u069b\\u069e\\u06aa\\u06be\\u06caRDcy;\\u442a\\u0100ct\\u0690\\u0694ek;\\u42c7;\\u405eirc;\\u4124r;\\u610clbertSpace;\\u610b\\u01f0\\u06af\\0\\u06b2f;\\u610dizontalLine;\\u6500\\u0100ct\\u06c3\\u06c5\\xf2\\u06a9rok;\\u4126mp\\u0144\\u06d0\\u06d8ownHum\\xf0\\u012fqual;\\u624f\\u0700EJOacdfgmnostu\\u06fa\\u06fe\\u0703\\u0707\\u070e\\u071a\\u071e\\u0721\\u0728\\u0744\\u0778\\u078b\\u078f\\u0795cy;\\u4415lig;\\u4132cy;\\u4401cute\\u803b\\xcd\\u40cd\\u0100iy\\u0713\\u0718rc\\u803b\\xce\\u40ce;\\u4418ot;\\u4130r;\\u6111rave\\u803b\\xcc\\u40cc\\u0180;ap\\u0720\\u072f\\u073f\\u0100cg\\u0734\\u0737r;\\u412ainaryI;\\u6148lie\\xf3\\u03dd\\u01f4\\u0749\\0\\u0762\\u0100;e\\u074d\\u074e\\u622c\\u0100gr\\u0753\\u0758ral;\\u622bsection;\\u62c2isible\\u0100CT\\u076c\\u0772omma;\\u6063imes;\\u6062\\u0180gpt\\u077f\\u0783\\u0788on;\\u412ef;\\uc000\\ud835\\udd40a;\\u4399cr;\\u6110ilde;\\u4128\\u01eb\\u079a\\0\\u079ecy;\\u4406l\\u803b\\xcf\\u40cf\\u0280cfosu\\u07ac\\u07b7\\u07bc\\u07c2\\u07d0\\u0100iy\\u07b1\\u07b5rc;\\u4134;\\u4419r;\\uc000\\ud835\\udd0dpf;\\uc000\\ud835\\udd41\\u01e3\\u07c7\\0\\u07ccr;\\uc000\\ud835\\udca5rcy;\\u4408kcy;\\u4404\\u0380HJacfos\\u07e4\\u07e8\\u07ec\\u07f1\\u07fd\\u0802\\u0808cy;\\u4425cy;\\u440cppa;\\u439a\\u0100ey\\u07f6\\u07fbdil;\\u4136;\\u441ar;\\uc000\\ud835\\udd0epf;\\uc000\\ud835\\udd42cr;\\uc000\\ud835\\udca6\\u0580JTaceflmost\\u0825\\u0829\\u082c\\u0850\\u0863\\u09b3\\u09b8\\u09c7\\u09cd\\u0a37\\u0a47cy;\\u4409\\u803b<\\u403c\\u0280cmnpr\\u0837\\u083c\\u0841\\u0844\\u084dute;\\u4139bda;\\u439bg;\\u67ealacetrf;\\u6112r;\\u619e\\u0180aey\\u0857\\u085c\\u0861ron;\\u413ddil;\\u413b;\\u441b\\u0100fs\\u0868\\u0970t\\u0500ACDFRTUVar\\u087e\\u08a9\\u08b1\\u08e0\\u08e6\\u08fc\\u092f\\u095b\\u0390\\u096a\\u0100nr\\u0883\\u088fgleBracket;\\u67e8row\\u0180;BR\\u0899\\u089a\\u089e\\u6190ar;\\u61e4ightArrow;\\u61c6eiling;\\u6308o\\u01f5\\u08b7\\0\\u08c3bleBracket;\\u67e6n\\u01d4\\u08c8\\0\\u08d2eeVector;\\u6961ector\\u0100;B\\u08db\\u08dc\\u61c3ar;\\u6959loor;\\u630aight\\u0100AV\\u08ef\\u08f5rrow;\\u6194ector;\\u694e\\u0100er\\u0901\\u0917e\\u0180;AV\\u0909\\u090a\\u0910\\u62a3rrow;\\u61a4ector;\\u695aiangle\\u0180;BE\\u0924\\u0925\\u0929\\u62b2ar;\\u69cfqual;\\u62b4p\\u0180DTV\\u0937\\u0942\\u094cownVector;\\u6951eeVector;\\u6960ector\\u0100;B\\u0956\\u0957\\u61bfar;\\u6958ector\\u0100;B\\u0965\\u0966\\u61bcar;\\u6952ight\\xe1\\u039cs\\u0300EFGLST\\u097e\\u098b\\u0995\\u099d\\u09a2\\u09adqualGreater;\\u62daullEqual;\\u6266reater;\\u6276ess;\\u6aa1lantEqual;\\u6a7dilde;\\u6272r;\\uc000\\ud835\\udd0f\\u0100;e\\u09bd\\u09be\\u62d8ftarrow;\\u61daidot;\\u413f\\u0180npw\\u09d4\\u0a16\\u0a1bg\\u0200LRlr\\u09de\\u09f7\\u0a02\\u0a10eft\\u0100AR\\u09e6\\u09ecrrow;\\u67f5ightArrow;\\u67f7ightArrow;\\u67f6eft\\u0100ar\\u03b3\\u0a0aight\\xe1\\u03bfight\\xe1\\u03caf;\\uc000\\ud835\\udd43er\\u0100LR\\u0a22\\u0a2ceftArrow;\\u6199ightArrow;\\u6198\\u0180cht\\u0a3e\\u0a40\\u0a42\\xf2\\u084c;\\u61b0rok;\\u4141;\\u626a\\u0400acefiosu\\u0a5a\\u0a5d\\u0a60\\u0a77\\u0a7c\\u0a85\\u0a8b\\u0a8ep;\\u6905y;\\u441c\\u0100dl\\u0a65\\u0a6fiumSpace;\\u605flintrf;\\u6133r;\\uc000\\ud835\\udd10nusPlus;\\u6213pf;\\uc000\\ud835\\udd44c\\xf2\\u0a76;\\u439c\\u0480Jacefostu\\u0aa3\\u0aa7\\u0aad\\u0ac0\\u0b14\\u0b19\\u0d91\\u0d97\\u0d9ecy;\\u440acute;\\u4143\\u0180aey\\u0ab4\\u0ab9\\u0aberon;\\u4147dil;\\u4145;\\u441d\\u0180gsw\\u0ac7\\u0af0\\u0b0eative\\u0180MTV\\u0ad3\\u0adf\\u0ae8ediumSpace;\\u600bhi\\u0100cn\\u0ae6\\u0ad8\\xeb\\u0ad9eryThi\\xee\\u0ad9ted\\u0100GL\\u0af8\\u0b06reaterGreate\\xf2\\u0673essLes\\xf3\\u0a48Line;\\u400ar;\\uc000\\ud835\\udd11\\u0200Bnpt\\u0b22\\u0b28\\u0b37\\u0b3areak;\\u6060BreakingSpace;\\u40a0f;\\u6115\\u0680;CDEGHLNPRSTV\\u0b55\\u0b56\\u0b6a\\u0b7c\\u0ba1\\u0beb\\u0c04\\u0c5e\\u0c84\\u0ca6\\u0cd8\\u0d61\\u0d85\\u6aec\\u0100ou\\u0b5b\\u0b64ngruent;\\u6262pCap;\\u626doubleVerticalBar;\\u6226\\u0180lqx\\u0b83\\u0b8a\\u0b9bement;\\u6209ual\\u0100;T\\u0b92\\u0b93\\u6260ilde;\\uc000\\u2242\\u0338ists;\\u6204reater\\u0380;EFGLST\\u0bb6\\u0bb7\\u0bbd\\u0bc9\\u0bd3\\u0bd8\\u0be5\\u626fqual;\\u6271ullEqual;\\uc000\\u2267\\u0338reater;\\uc000\\u226b\\u0338ess;\\u6279lantEqual;\\uc000\\u2a7e\\u0338ilde;\\u6275ump\\u0144\\u0bf2\\u0bfdownHump;\\uc000\\u224e\\u0338qual;\\uc000\\u224f\\u0338e\\u0100fs\\u0c0a\\u0c27tTriangle\\u0180;BE\\u0c1a\\u0c1b\\u0c21\\u62eaar;\\uc000\\u29cf\\u0338qual;\\u62ecs\\u0300;EGLST\\u0c35\\u0c36\\u0c3c\\u0c44\\u0c4b\\u0c58\\u626equal;\\u6270reater;\\u6278ess;\\uc000\\u226a\\u0338lantEqual;\\uc000\\u2a7d\\u0338ilde;\\u6274ested\\u0100GL\\u0c68\\u0c79reaterGreater;\\uc000\\u2aa2\\u0338essLess;\\uc000\\u2aa1\\u0338recedes\\u0180;ES\\u0c92\\u0c93\\u0c9b\\u6280qual;\\uc000\\u2aaf\\u0338lantEqual;\\u62e0\\u0100ei\\u0cab\\u0cb9verseElement;\\u620cghtTriangle\\u0180;BE\\u0ccb\\u0ccc\\u0cd2\\u62ebar;\\uc000\\u29d0\\u0338qual;\\u62ed\\u0100qu\\u0cdd\\u0d0cuareSu\\u0100bp\\u0ce8\\u0cf9set\\u0100;E\\u0cf0\\u0cf3\\uc000\\u228f\\u0338qual;\\u62e2erset\\u0100;E\\u0d03\\u0d06\\uc000\\u2290\\u0338qual;\\u62e3\\u0180bcp\\u0d13\\u0d24\\u0d4eset\\u0100;E\\u0d1b\\u0d1e\\uc000\\u2282\\u20d2qual;\\u6288ceeds\\u0200;EST\\u0d32\\u0d33\\u0d3b\\u0d46\\u6281qual;\\uc000\\u2ab0\\u0338lantEqual;\\u62e1ilde;\\uc000\\u227f\\u0338erset\\u0100;E\\u0d58\\u0d5b\\uc000\\u2283\\u20d2qual;\\u6289ilde\\u0200;EFT\\u0d6e\\u0d6f\\u0d75\\u0d7f\\u6241qual;\\u6244ullEqual;\\u6247ilde;\\u6249erticalBar;\\u6224cr;\\uc000\\ud835\\udca9ilde\\u803b\\xd1\\u40d1;\\u439d\\u0700Eacdfgmoprstuv\\u0dbd\\u0dc2\\u0dc9\\u0dd5\\u0ddb\\u0de0\\u0de7\\u0dfc\\u0e02\\u0e20\\u0e22\\u0e32\\u0e3f\\u0e44lig;\\u4152cute\\u803b\\xd3\\u40d3\\u0100iy\\u0dce\\u0dd3rc\\u803b\\xd4\\u40d4;\\u441eblac;\\u4150r;\\uc000\\ud835\\udd12rave\\u803b\\xd2\\u40d2\\u0180aei\\u0dee\\u0df2\\u0df6cr;\\u414cga;\\u43a9cron;\\u439fpf;\\uc000\\ud835\\udd46enCurly\\u0100DQ\\u0e0e\\u0e1aoubleQuote;\\u601cuote;\\u6018;\\u6a54\\u0100cl\\u0e27\\u0e2cr;\\uc000\\ud835\\udcaaash\\u803b\\xd8\\u40d8i\\u016c\\u0e37\\u0e3cde\\u803b\\xd5\\u40d5es;\\u6a37ml\\u803b\\xd6\\u40d6er\\u0100BP\\u0e4b\\u0e60\\u0100ar\\u0e50\\u0e53r;\\u603eac\\u0100ek\\u0e5a\\u0e5c;\\u63deet;\\u63b4arenthesis;\\u63dc\\u0480acfhilors\\u0e7f\\u0e87\\u0e8a\\u0e8f\\u0e92\\u0e94\\u0e9d\\u0eb0\\u0efcrtialD;\\u6202y;\\u441fr;\\uc000\\ud835\\udd13i;\\u43a6;\\u43a0usMinus;\\u40b1\\u0100ip\\u0ea2\\u0eadncareplan\\xe5\\u069df;\\u6119\\u0200;eio\\u0eb9\\u0eba\\u0ee0\\u0ee4\\u6abbcedes\\u0200;EST\\u0ec8\\u0ec9\\u0ecf\\u0eda\\u627aqual;\\u6aaflantEqual;\\u627cilde;\\u627eme;\\u6033\\u0100dp\\u0ee9\\u0eeeuct;\\u620fortion\\u0100;a\\u0225\\u0ef9l;\\u621d\\u0100ci\\u0f01\\u0f06r;\\uc000\\ud835\\udcab;\\u43a8\\u0200Ufos\\u0f11\\u0f16\\u0f1b\\u0f1fOT\\u803b\\\"\\u4022r;\\uc000\\ud835\\udd14pf;\\u611acr;\\uc000\\ud835\\udcac\\u0600BEacefhiorsu\\u0f3e\\u0f43\\u0f47\\u0f60\\u0f73\\u0fa7\\u0faa\\u0fad\\u1096\\u10a9\\u10b4\\u10bearr;\\u6910G\\u803b\\xae\\u40ae\\u0180cnr\\u0f4e\\u0f53\\u0f56ute;\\u4154g;\\u67ebr\\u0100;t\\u0f5c\\u0f5d\\u61a0l;\\u6916\\u0180aey\\u0f67\\u0f6c\\u0f71ron;\\u4158dil;\\u4156;\\u4420\\u0100;v\\u0f78\\u0f79\\u611cerse\\u0100EU\\u0f82\\u0f99\\u0100lq\\u0f87\\u0f8eement;\\u620builibrium;\\u61cbpEquilibrium;\\u696fr\\xbb\\u0f79o;\\u43a1ght\\u0400ACDFTUVa\\u0fc1\\u0feb\\u0ff3\\u1022\\u1028\\u105b\\u1087\\u03d8\\u0100nr\\u0fc6\\u0fd2gleBracket;\\u67e9row\\u0180;BL\\u0fdc\\u0fdd\\u0fe1\\u6192ar;\\u61e5eftArrow;\\u61c4eiling;\\u6309o\\u01f5\\u0ff9\\0\\u1005bleBracket;\\u67e7n\\u01d4\\u100a\\0\\u1014eeVector;\\u695dector\\u0100;B\\u101d\\u101e\\u61c2ar;\\u6955loor;\\u630b\\u0100er\\u102d\\u1043e\\u0180;AV\\u1035\\u1036\\u103c\\u62a2rrow;\\u61a6ector;\\u695biangle\\u0180;BE\\u1050\\u1051\\u1055\\u62b3ar;\\u69d0qual;\\u62b5p\\u0180DTV\\u1063\\u106e\\u1078ownVector;\\u694feeVector;\\u695cector\\u0100;B\\u1082\\u1083\\u61bear;\\u6954ector\\u0100;B\\u1091\\u1092\\u61c0ar;\\u6953\\u0100pu\\u109b\\u109ef;\\u611dndImplies;\\u6970ightarrow;\\u61db\\u0100ch\\u10b9\\u10bcr;\\u611b;\\u61b1leDelayed;\\u69f4\\u0680HOacfhimoqstu\\u10e4\\u10f1\\u10f7\\u10fd\\u1119\\u111e\\u1151\\u1156\\u1161\\u1167\\u11b5\\u11bb\\u11bf\\u0100Cc\\u10e9\\u10eeHcy;\\u4429y;\\u4428FTcy;\\u442ccute;\\u415a\\u0280;aeiy\\u1108\\u1109\\u110e\\u1113\\u1117\\u6abcron;\\u4160dil;\\u415erc;\\u415c;\\u4421r;\\uc000\\ud835\\udd16ort\\u0200DLRU\\u112a\\u1134\\u113e\\u1149ownArrow\\xbb\\u041eeftArrow\\xbb\\u089aightArrow\\xbb\\u0fddpArrow;\\u6191gma;\\u43a3allCircle;\\u6218pf;\\uc000\\ud835\\udd4a\\u0272\\u116d\\0\\0\\u1170t;\\u621aare\\u0200;ISU\\u117b\\u117c\\u1189\\u11af\\u65a1ntersection;\\u6293u\\u0100bp\\u118f\\u119eset\\u0100;E\\u1197\\u1198\\u628fqual;\\u6291erset\\u0100;E\\u11a8\\u11a9\\u6290qual;\\u6292nion;\\u6294cr;\\uc000\\ud835\\udcaear;\\u62c6\\u0200bcmp\\u11c8\\u11db\\u1209\\u120b\\u0100;s\\u11cd\\u11ce\\u62d0et\\u0100;E\\u11cd\\u11d5qual;\\u6286\\u0100ch\\u11e0\\u1205eeds\\u0200;EST\\u11ed\\u11ee\\u11f4\\u11ff\\u627bqual;\\u6ab0lantEqual;\\u627dilde;\\u627fTh\\xe1\\u0f8c;\\u6211\\u0180;es\\u1212\\u1213\\u1223\\u62d1rset\\u0100;E\\u121c\\u121d\\u6283qual;\\u6287et\\xbb\\u1213\\u0580HRSacfhiors\\u123e\\u1244\\u1249\\u1255\\u125e\\u1271\\u1276\\u129f\\u12c2\\u12c8\\u12d1ORN\\u803b\\xde\\u40deADE;\\u6122\\u0100Hc\\u124e\\u1252cy;\\u440by;\\u4426\\u0100bu\\u125a\\u125c;\\u4009;\\u43a4\\u0180aey\\u1265\\u126a\\u126fron;\\u4164dil;\\u4162;\\u4422r;\\uc000\\ud835\\udd17\\u0100ei\\u127b\\u1289\\u01f2\\u1280\\0\\u1287efore;\\u6234a;\\u4398\\u0100cn\\u128e\\u1298kSpace;\\uc000\\u205f\\u200aSpace;\\u6009lde\\u0200;EFT\\u12ab\\u12ac\\u12b2\\u12bc\\u623cqual;\\u6243ullEqual;\\u6245ilde;\\u6248pf;\\uc000\\ud835\\udd4bipleDot;\\u60db\\u0100ct\\u12d6\\u12dbr;\\uc000\\ud835\\udcafrok;\\u4166\\u0ae1\\u12f7\\u130e\\u131a\\u1326\\0\\u132c\\u1331\\0\\0\\0\\0\\0\\u1338\\u133d\\u1377\\u1385\\0\\u13ff\\u1404\\u140a\\u1410\\u0100cr\\u12fb\\u1301ute\\u803b\\xda\\u40dar\\u0100;o\\u1307\\u1308\\u619fcir;\\u6949r\\u01e3\\u1313\\0\\u1316y;\\u440eve;\\u416c\\u0100iy\\u131e\\u1323rc\\u803b\\xdb\\u40db;\\u4423blac;\\u4170r;\\uc000\\ud835\\udd18rave\\u803b\\xd9\\u40d9acr;\\u416a\\u0100di\\u1341\\u1369er\\u0100BP\\u1348\\u135d\\u0100ar\\u134d\\u1350r;\\u405fac\\u0100ek\\u1357\\u1359;\\u63dfet;\\u63b5arenthesis;\\u63ddon\\u0100;P\\u1370\\u1371\\u62c3lus;\\u628e\\u0100gp\\u137b\\u137fon;\\u4172f;\\uc000\\ud835\\udd4c\\u0400ADETadps\\u1395\\u13ae\\u13b8\\u13c4\\u03e8\\u13d2\\u13d7\\u13f3rrow\\u0180;BD\\u1150\\u13a0\\u13a4ar;\\u6912ownArrow;\\u61c5ownArrow;\\u6195quilibrium;\\u696eee\\u0100;A\\u13cb\\u13cc\\u62a5rrow;\\u61a5own\\xe1\\u03f3er\\u0100LR\\u13de\\u13e8eftArrow;\\u6196ightArrow;\\u6197i\\u0100;l\\u13f9\\u13fa\\u43d2on;\\u43a5ing;\\u416ecr;\\uc000\\ud835\\udcb0ilde;\\u4168ml\\u803b\\xdc\\u40dc\\u0480Dbcdefosv\\u1427\\u142c\\u1430\\u1433\\u143e\\u1485\\u148a\\u1490\\u1496ash;\\u62abar;\\u6aeby;\\u4412ash\\u0100;l\\u143b\\u143c\\u62a9;\\u6ae6\\u0100er\\u1443\\u1445;\\u62c1\\u0180bty\\u144c\\u1450\\u147aar;\\u6016\\u0100;i\\u144f\\u1455cal\\u0200BLST\\u1461\\u1465\\u146a\\u1474ar;\\u6223ine;\\u407ceparator;\\u6758ilde;\\u6240ThinSpace;\\u600ar;\\uc000\\ud835\\udd19pf;\\uc000\\ud835\\udd4dcr;\\uc000\\ud835\\udcb1dash;\\u62aa\\u0280cefos\\u14a7\\u14ac\\u14b1\\u14b6\\u14bcirc;\\u4174dge;\\u62c0r;\\uc000\\ud835\\udd1apf;\\uc000\\ud835\\udd4ecr;\\uc000\\ud835\\udcb2\\u0200fios\\u14cb\\u14d0\\u14d2\\u14d8r;\\uc000\\ud835\\udd1b;\\u439epf;\\uc000\\ud835\\udd4fcr;\\uc000\\ud835\\udcb3\\u0480AIUacfosu\\u14f1\\u14f5\\u14f9\\u14fd\\u1504\\u150f\\u1514\\u151a\\u1520cy;\\u442fcy;\\u4407cy;\\u442ecute\\u803b\\xdd\\u40dd\\u0100iy\\u1509\\u150drc;\\u4176;\\u442br;\\uc000\\ud835\\udd1cpf;\\uc000\\ud835\\udd50cr;\\uc000\\ud835\\udcb4ml;\\u4178\\u0400Hacdefos\\u1535\\u1539\\u153f\\u154b\\u154f\\u155d\\u1560\\u1564cy;\\u4416cute;\\u4179\\u0100ay\\u1544\\u1549ron;\\u417d;\\u4417ot;\\u417b\\u01f2\\u1554\\0\\u155boWidt\\xe8\\u0ad9a;\\u4396r;\\u6128pf;\\u6124cr;\\uc000\\ud835\\udcb5\\u0be1\\u1583\\u158a\\u1590\\0\\u15b0\\u15b6\\u15bf\\0\\0\\0\\0\\u15c6\\u15db\\u15eb\\u165f\\u166d\\0\\u1695\\u169b\\u16b2\\u16b9\\0\\u16becute\\u803b\\xe1\\u40e1reve;\\u4103\\u0300;Ediuy\\u159c\\u159d\\u15a1\\u15a3\\u15a8\\u15ad\\u623e;\\uc000\\u223e\\u0333;\\u623frc\\u803b\\xe2\\u40e2te\\u80bb\\xb4\\u0306;\\u4430lig\\u803b\\xe6\\u40e6\\u0100;r\\xb2\\u15ba;\\uc000\\ud835\\udd1erave\\u803b\\xe0\\u40e0\\u0100ep\\u15ca\\u15d6\\u0100fp\\u15cf\\u15d4sym;\\u6135\\xe8\\u15d3ha;\\u43b1\\u0100ap\\u15dfc\\u0100cl\\u15e4\\u15e7r;\\u4101g;\\u6a3f\\u0264\\u15f0\\0\\0\\u160a\\u0280;adsv\\u15fa\\u15fb\\u15ff\\u1601\\u1607\\u6227nd;\\u6a55;\\u6a5clope;\\u6a58;\\u6a5a\\u0380;elmrsz\\u1618\\u1619\\u161b\\u161e\\u163f\\u164f\\u1659\\u6220;\\u69a4e\\xbb\\u1619sd\\u0100;a\\u1625\\u1626\\u6221\\u0461\\u1630\\u1632\\u1634\\u1636\\u1638\\u163a\\u163c\\u163e;\\u69a8;\\u69a9;\\u69aa;\\u69ab;\\u69ac;\\u69ad;\\u69ae;\\u69aft\\u0100;v\\u1645\\u1646\\u621fb\\u0100;d\\u164c\\u164d\\u62be;\\u699d\\u0100pt\\u1654\\u1657h;\\u6222\\xbb\\xb9arr;\\u637c\\u0100gp\\u1663\\u1667on;\\u4105f;\\uc000\\ud835\\udd52\\u0380;Eaeiop\\u12c1\\u167b\\u167d\\u1682\\u1684\\u1687\\u168a;\\u6a70cir;\\u6a6f;\\u624ad;\\u624bs;\\u4027rox\\u0100;e\\u12c1\\u1692\\xf1\\u1683ing\\u803b\\xe5\\u40e5\\u0180cty\\u16a1\\u16a6\\u16a8r;\\uc000\\ud835\\udcb6;\\u402amp\\u0100;e\\u12c1\\u16af\\xf1\\u0288ilde\\u803b\\xe3\\u40e3ml\\u803b\\xe4\\u40e4\\u0100ci\\u16c2\\u16c8onin\\xf4\\u0272nt;\\u6a11\\u0800Nabcdefiklnoprsu\\u16ed\\u16f1\\u1730\\u173c\\u1743\\u1748\\u1778\\u177d\\u17e0\\u17e6\\u1839\\u1850\\u170d\\u193d\\u1948\\u1970ot;\\u6aed\\u0100cr\\u16f6\\u171ek\\u0200ceps\\u1700\\u1705\\u170d\\u1713ong;\\u624cpsilon;\\u43f6rime;\\u6035im\\u0100;e\\u171a\\u171b\\u623dq;\\u62cd\\u0176\\u1722\\u1726ee;\\u62bded\\u0100;g\\u172c\\u172d\\u6305e\\xbb\\u172drk\\u0100;t\\u135c\\u1737brk;\\u63b6\\u0100oy\\u1701\\u1741;\\u4431quo;\\u601e\\u0280cmprt\\u1753\\u175b\\u1761\\u1764\\u1768aus\\u0100;e\\u010a\\u0109ptyv;\\u69b0s\\xe9\\u170cno\\xf5\\u0113\\u0180ahw\\u176f\\u1771\\u1773;\\u43b2;\\u6136een;\\u626cr;\\uc000\\ud835\\udd1fg\\u0380costuvw\\u178d\\u179d\\u17b3\\u17c1\\u17d5\\u17db\\u17de\\u0180aiu\\u1794\\u1796\\u179a\\xf0\\u0760rc;\\u65efp\\xbb\\u1371\\u0180dpt\\u17a4\\u17a8\\u17adot;\\u6a00lus;\\u6a01imes;\\u6a02\\u0271\\u17b9\\0\\0\\u17becup;\\u6a06ar;\\u6605riangle\\u0100du\\u17cd\\u17d2own;\\u65bdp;\\u65b3plus;\\u6a04e\\xe5\\u1444\\xe5\\u14adarow;\\u690d\\u0180ako\\u17ed\\u1826\\u1835\\u0100cn\\u17f2\\u1823k\\u0180lst\\u17fa\\u05ab\\u1802ozenge;\\u69ebriangle\\u0200;dlr\\u1812\\u1813\\u1818\\u181d\\u65b4own;\\u65beeft;\\u65c2ight;\\u65b8k;\\u6423\\u01b1\\u182b\\0\\u1833\\u01b2\\u182f\\0\\u1831;\\u6592;\\u65914;\\u6593ck;\\u6588\\u0100eo\\u183e\\u184d\\u0100;q\\u1843\\u1846\\uc000=\\u20e5uiv;\\uc000\\u2261\\u20e5t;\\u6310\\u0200ptwx\\u1859\\u185e\\u1867\\u186cf;\\uc000\\ud835\\udd53\\u0100;t\\u13cb\\u1863om\\xbb\\u13cctie;\\u62c8\\u0600DHUVbdhmptuv\\u1885\\u1896\\u18aa\\u18bb\\u18d7\\u18db\\u18ec\\u18ff\\u1905\\u190a\\u1910\\u1921\\u0200LRlr\\u188e\\u1890\\u1892\\u1894;\\u6557;\\u6554;\\u6556;\\u6553\\u0280;DUdu\\u18a1\\u18a2\\u18a4\\u18a6\\u18a8\\u6550;\\u6566;\\u6569;\\u6564;\\u6567\\u0200LRlr\\u18b3\\u18b5\\u18b7\\u18b9;\\u655d;\\u655a;\\u655c;\\u6559\\u0380;HLRhlr\\u18ca\\u18cb\\u18cd\\u18cf\\u18d1\\u18d3\\u18d5\\u6551;\\u656c;\\u6563;\\u6560;\\u656b;\\u6562;\\u655fox;\\u69c9\\u0200LRlr\\u18e4\\u18e6\\u18e8\\u18ea;\\u6555;\\u6552;\\u6510;\\u650c\\u0280;DUdu\\u06bd\\u18f7\\u18f9\\u18fb\\u18fd;\\u6565;\\u6568;\\u652c;\\u6534inus;\\u629flus;\\u629eimes;\\u62a0\\u0200LRlr\\u1919\\u191b\\u191d\\u191f;\\u655b;\\u6558;\\u6518;\\u6514\\u0380;HLRhlr\\u1930\\u1931\\u1933\\u1935\\u1937\\u1939\\u193b\\u6502;\\u656a;\\u6561;\\u655e;\\u653c;\\u6524;\\u651c\\u0100ev\\u0123\\u1942bar\\u803b\\xa6\\u40a6\\u0200ceio\\u1951\\u1956\\u195a\\u1960r;\\uc000\\ud835\\udcb7mi;\\u604fm\\u0100;e\\u171a\\u171cl\\u0180;bh\\u1968\\u1969\\u196b\\u405c;\\u69c5sub;\\u67c8\\u016c\\u1974\\u197el\\u0100;e\\u1979\\u197a\\u6022t\\xbb\\u197ap\\u0180;Ee\\u012f\\u1985\\u1987;\\u6aae\\u0100;q\\u06dc\\u06db\\u0ce1\\u19a7\\0\\u19e8\\u1a11\\u1a15\\u1a32\\0\\u1a37\\u1a50\\0\\0\\u1ab4\\0\\0\\u1ac1\\0\\0\\u1b21\\u1b2e\\u1b4d\\u1b52\\0\\u1bfd\\0\\u1c0c\\u0180cpr\\u19ad\\u19b2\\u19ddute;\\u4107\\u0300;abcds\\u19bf\\u19c0\\u19c4\\u19ca\\u19d5\\u19d9\\u6229nd;\\u6a44rcup;\\u6a49\\u0100au\\u19cf\\u19d2p;\\u6a4bp;\\u6a47ot;\\u6a40;\\uc000\\u2229\\ufe00\\u0100eo\\u19e2\\u19e5t;\\u6041\\xee\\u0693\\u0200aeiu\\u19f0\\u19fb\\u1a01\\u1a05\\u01f0\\u19f5\\0\\u19f8s;\\u6a4don;\\u410ddil\\u803b\\xe7\\u40e7rc;\\u4109ps\\u0100;s\\u1a0c\\u1a0d\\u6a4cm;\\u6a50ot;\\u410b\\u0180dmn\\u1a1b\\u1a20\\u1a26il\\u80bb\\xb8\\u01adptyv;\\u69b2t\\u8100\\xa2;e\\u1a2d\\u1a2e\\u40a2r\\xe4\\u01b2r;\\uc000\\ud835\\udd20\\u0180cei\\u1a3d\\u1a40\\u1a4dy;\\u4447ck\\u0100;m\\u1a47\\u1a48\\u6713ark\\xbb\\u1a48;\\u43c7r\\u0380;Ecefms\\u1a5f\\u1a60\\u1a62\\u1a6b\\u1aa4\\u1aaa\\u1aae\\u65cb;\\u69c3\\u0180;el\\u1a69\\u1a6a\\u1a6d\\u42c6q;\\u6257e\\u0261\\u1a74\\0\\0\\u1a88rrow\\u0100lr\\u1a7c\\u1a81eft;\\u61baight;\\u61bb\\u0280RSacd\\u1a92\\u1a94\\u1a96\\u1a9a\\u1a9f\\xbb\\u0f47;\\u64c8st;\\u629birc;\\u629aash;\\u629dnint;\\u6a10id;\\u6aefcir;\\u69c2ubs\\u0100;u\\u1abb\\u1abc\\u6663it\\xbb\\u1abc\\u02ec\\u1ac7\\u1ad4\\u1afa\\0\\u1b0aon\\u0100;e\\u1acd\\u1ace\\u403a\\u0100;q\\xc7\\xc6\\u026d\\u1ad9\\0\\0\\u1ae2a\\u0100;t\\u1ade\\u1adf\\u402c;\\u4040\\u0180;fl\\u1ae8\\u1ae9\\u1aeb\\u6201\\xee\\u1160e\\u0100mx\\u1af1\\u1af6ent\\xbb\\u1ae9e\\xf3\\u024d\\u01e7\\u1afe\\0\\u1b07\\u0100;d\\u12bb\\u1b02ot;\\u6a6dn\\xf4\\u0246\\u0180fry\\u1b10\\u1b14\\u1b17;\\uc000\\ud835\\udd54o\\xe4\\u0254\\u8100\\xa9;s\\u0155\\u1b1dr;\\u6117\\u0100ao\\u1b25\\u1b29rr;\\u61b5ss;\\u6717\\u0100cu\\u1b32\\u1b37r;\\uc000\\ud835\\udcb8\\u0100bp\\u1b3c\\u1b44\\u0100;e\\u1b41\\u1b42\\u6acf;\\u6ad1\\u0100;e\\u1b49\\u1b4a\\u6ad0;\\u6ad2dot;\\u62ef\\u0380delprvw\\u1b60\\u1b6c\\u1b77\\u1b82\\u1bac\\u1bd4\\u1bf9arr\\u0100lr\\u1b68\\u1b6a;\\u6938;\\u6935\\u0270\\u1b72\\0\\0\\u1b75r;\\u62dec;\\u62dfarr\\u0100;p\\u1b7f\\u1b80\\u61b6;\\u693d\\u0300;bcdos\\u1b8f\\u1b90\\u1b96\\u1ba1\\u1ba5\\u1ba8\\u622arcap;\\u6a48\\u0100au\\u1b9b\\u1b9ep;\\u6a46p;\\u6a4aot;\\u628dr;\\u6a45;\\uc000\\u222a\\ufe00\\u0200alrv\\u1bb5\\u1bbf\\u1bde\\u1be3rr\\u0100;m\\u1bbc\\u1bbd\\u61b7;\\u693cy\\u0180evw\\u1bc7\\u1bd4\\u1bd8q\\u0270\\u1bce\\0\\0\\u1bd2re\\xe3\\u1b73u\\xe3\\u1b75ee;\\u62ceedge;\\u62cfen\\u803b\\xa4\\u40a4earrow\\u0100lr\\u1bee\\u1bf3eft\\xbb\\u1b80ight\\xbb\\u1bbde\\xe4\\u1bdd\\u0100ci\\u1c01\\u1c07onin\\xf4\\u01f7nt;\\u6231lcty;\\u632d\\u0980AHabcdefhijlorstuwz\\u1c38\\u1c3b\\u1c3f\\u1c5d\\u1c69\\u1c75\\u1c8a\\u1c9e\\u1cac\\u1cb7\\u1cfb\\u1cff\\u1d0d\\u1d7b\\u1d91\\u1dab\\u1dbb\\u1dc6\\u1dcdr\\xf2\\u0381ar;\\u6965\\u0200glrs\\u1c48\\u1c4d\\u1c52\\u1c54ger;\\u6020eth;\\u6138\\xf2\\u1133h\\u0100;v\\u1c5a\\u1c5b\\u6010\\xbb\\u090a\\u016b\\u1c61\\u1c67arow;\\u690fa\\xe3\\u0315\\u0100ay\\u1c6e\\u1c73ron;\\u410f;\\u4434\\u0180;ao\\u0332\\u1c7c\\u1c84\\u0100gr\\u02bf\\u1c81r;\\u61catseq;\\u6a77\\u0180glm\\u1c91\\u1c94\\u1c98\\u803b\\xb0\\u40b0ta;\\u43b4ptyv;\\u69b1\\u0100ir\\u1ca3\\u1ca8sht;\\u697f;\\uc000\\ud835\\udd21ar\\u0100lr\\u1cb3\\u1cb5\\xbb\\u08dc\\xbb\\u101e\\u0280aegsv\\u1cc2\\u0378\\u1cd6\\u1cdc\\u1ce0m\\u0180;os\\u0326\\u1cca\\u1cd4nd\\u0100;s\\u0326\\u1cd1uit;\\u6666amma;\\u43ddin;\\u62f2\\u0180;io\\u1ce7\\u1ce8\\u1cf8\\u40f7de\\u8100\\xf7;o\\u1ce7\\u1cf0ntimes;\\u62c7n\\xf8\\u1cf7cy;\\u4452c\\u026f\\u1d06\\0\\0\\u1d0arn;\\u631eop;\\u630d\\u0280lptuw\\u1d18\\u1d1d\\u1d22\\u1d49\\u1d55lar;\\u4024f;\\uc000\\ud835\\udd55\\u0280;emps\\u030b\\u1d2d\\u1d37\\u1d3d\\u1d42q\\u0100;d\\u0352\\u1d33ot;\\u6251inus;\\u6238lus;\\u6214quare;\\u62a1blebarwedg\\xe5\\xfan\\u0180adh\\u112e\\u1d5d\\u1d67ownarrow\\xf3\\u1c83arpoon\\u0100lr\\u1d72\\u1d76ef\\xf4\\u1cb4igh\\xf4\\u1cb6\\u0162\\u1d7f\\u1d85karo\\xf7\\u0f42\\u026f\\u1d8a\\0\\0\\u1d8ern;\\u631fop;\\u630c\\u0180cot\\u1d98\\u1da3\\u1da6\\u0100ry\\u1d9d\\u1da1;\\uc000\\ud835\\udcb9;\\u4455l;\\u69f6rok;\\u4111\\u0100dr\\u1db0\\u1db4ot;\\u62f1i\\u0100;f\\u1dba\\u1816\\u65bf\\u0100ah\\u1dc0\\u1dc3r\\xf2\\u0429a\\xf2\\u0fa6angle;\\u69a6\\u0100ci\\u1dd2\\u1dd5y;\\u445fgrarr;\\u67ff\\u0900Dacdefglmnopqrstux\\u1e01\\u1e09\\u1e19\\u1e38\\u0578\\u1e3c\\u1e49\\u1e61\\u1e7e\\u1ea5\\u1eaf\\u1ebd\\u1ee1\\u1f2a\\u1f37\\u1f44\\u1f4e\\u1f5a\\u0100Do\\u1e06\\u1d34o\\xf4\\u1c89\\u0100cs\\u1e0e\\u1e14ute\\u803b\\xe9\\u40e9ter;\\u6a6e\\u0200aioy\\u1e22\\u1e27\\u1e31\\u1e36ron;\\u411br\\u0100;c\\u1e2d\\u1e2e\\u6256\\u803b\\xea\\u40ealon;\\u6255;\\u444dot;\\u4117\\u0100Dr\\u1e41\\u1e45ot;\\u6252;\\uc000\\ud835\\udd22\\u0180;rs\\u1e50\\u1e51\\u1e57\\u6a9aave\\u803b\\xe8\\u40e8\\u0100;d\\u1e5c\\u1e5d\\u6a96ot;\\u6a98\\u0200;ils\\u1e6a\\u1e6b\\u1e72\\u1e74\\u6a99nters;\\u63e7;\\u6113\\u0100;d\\u1e79\\u1e7a\\u6a95ot;\\u6a97\\u0180aps\\u1e85\\u1e89\\u1e97cr;\\u4113ty\\u0180;sv\\u1e92\\u1e93\\u1e95\\u6205et\\xbb\\u1e93p\\u01001;\\u1e9d\\u1ea4\\u0133\\u1ea1\\u1ea3;\\u6004;\\u6005\\u6003\\u0100gs\\u1eaa\\u1eac;\\u414bp;\\u6002\\u0100gp\\u1eb4\\u1eb8on;\\u4119f;\\uc000\\ud835\\udd56\\u0180als\\u1ec4\\u1ece\\u1ed2r\\u0100;s\\u1eca\\u1ecb\\u62d5l;\\u69e3us;\\u6a71i\\u0180;lv\\u1eda\\u1edb\\u1edf\\u43b5on\\xbb\\u1edb;\\u43f5\\u0200csuv\\u1eea\\u1ef3\\u1f0b\\u1f23\\u0100io\\u1eef\\u1e31rc\\xbb\\u1e2e\\u0269\\u1ef9\\0\\0\\u1efb\\xed\\u0548ant\\u0100gl\\u1f02\\u1f06tr\\xbb\\u1e5dess\\xbb\\u1e7a\\u0180aei\\u1f12\\u1f16\\u1f1als;\\u403dst;\\u625fv\\u0100;D\\u0235\\u1f20D;\\u6a78parsl;\\u69e5\\u0100Da\\u1f2f\\u1f33ot;\\u6253rr;\\u6971\\u0180cdi\\u1f3e\\u1f41\\u1ef8r;\\u612fo\\xf4\\u0352\\u0100ah\\u1f49\\u1f4b;\\u43b7\\u803b\\xf0\\u40f0\\u0100mr\\u1f53\\u1f57l\\u803b\\xeb\\u40ebo;\\u60ac\\u0180cip\\u1f61\\u1f64\\u1f67l;\\u4021s\\xf4\\u056e\\u0100eo\\u1f6c\\u1f74ctatio\\xee\\u0559nential\\xe5\\u0579\\u09e1\\u1f92\\0\\u1f9e\\0\\u1fa1\\u1fa7\\0\\0\\u1fc6\\u1fcc\\0\\u1fd3\\0\\u1fe6\\u1fea\\u2000\\0\\u2008\\u205allingdotse\\xf1\\u1e44y;\\u4444male;\\u6640\\u0180ilr\\u1fad\\u1fb3\\u1fc1lig;\\u8000\\ufb03\\u0269\\u1fb9\\0\\0\\u1fbdg;\\u8000\\ufb00ig;\\u8000\\ufb04;\\uc000\\ud835\\udd23lig;\\u8000\\ufb01lig;\\uc000fj\\u0180alt\\u1fd9\\u1fdc\\u1fe1t;\\u666dig;\\u8000\\ufb02ns;\\u65b1of;\\u4192\\u01f0\\u1fee\\0\\u1ff3f;\\uc000\\ud835\\udd57\\u0100ak\\u05bf\\u1ff7\\u0100;v\\u1ffc\\u1ffd\\u62d4;\\u6ad9artint;\\u6a0d\\u0100ao\\u200c\\u2055\\u0100cs\\u2011\\u2052\\u03b1\\u201a\\u2030\\u2038\\u2045\\u2048\\0\\u2050\\u03b2\\u2022\\u2025\\u2027\\u202a\\u202c\\0\\u202e\\u803b\\xbd\\u40bd;\\u6153\\u803b\\xbc\\u40bc;\\u6155;\\u6159;\\u615b\\u01b3\\u2034\\0\\u2036;\\u6154;\\u6156\\u02b4\\u203e\\u2041\\0\\0\\u2043\\u803b\\xbe\\u40be;\\u6157;\\u615c5;\\u6158\\u01b6\\u204c\\0\\u204e;\\u615a;\\u615d8;\\u615el;\\u6044wn;\\u6322cr;\\uc000\\ud835\\udcbb\\u0880Eabcdefgijlnorstv\\u2082\\u2089\\u209f\\u20a5\\u20b0\\u20b4\\u20f0\\u20f5\\u20fa\\u20ff\\u2103\\u2112\\u2138\\u0317\\u213e\\u2152\\u219e\\u0100;l\\u064d\\u2087;\\u6a8c\\u0180cmp\\u2090\\u2095\\u209dute;\\u41f5ma\\u0100;d\\u209c\\u1cda\\u43b3;\\u6a86reve;\\u411f\\u0100iy\\u20aa\\u20aerc;\\u411d;\\u4433ot;\\u4121\\u0200;lqs\\u063e\\u0642\\u20bd\\u20c9\\u0180;qs\\u063e\\u064c\\u20c4lan\\xf4\\u0665\\u0200;cdl\\u0665\\u20d2\\u20d5\\u20e5c;\\u6aa9ot\\u0100;o\\u20dc\\u20dd\\u6a80\\u0100;l\\u20e2\\u20e3\\u6a82;\\u6a84\\u0100;e\\u20ea\\u20ed\\uc000\\u22db\\ufe00s;\\u6a94r;\\uc000\\ud835\\udd24\\u0100;g\\u0673\\u061bmel;\\u6137cy;\\u4453\\u0200;Eaj\\u065a\\u210c\\u210e\\u2110;\\u6a92;\\u6aa5;\\u6aa4\\u0200Eaes\\u211b\\u211d\\u2129\\u2134;\\u6269p\\u0100;p\\u2123\\u2124\\u6a8arox\\xbb\\u2124\\u0100;q\\u212e\\u212f\\u6a88\\u0100;q\\u212e\\u211bim;\\u62e7pf;\\uc000\\ud835\\udd58\\u0100ci\\u2143\\u2146r;\\u610am\\u0180;el\\u066b\\u214e\\u2150;\\u6a8e;\\u6a90\\u8300>;cdlqr\\u05ee\\u2160\\u216a\\u216e\\u2173\\u2179\\u0100ci\\u2165\\u2167;\\u6aa7r;\\u6a7aot;\\u62d7Par;\\u6995uest;\\u6a7c\\u0280adels\\u2184\\u216a\\u2190\\u0656\\u219b\\u01f0\\u2189\\0\\u218epro\\xf8\\u209er;\\u6978q\\u0100lq\\u063f\\u2196les\\xf3\\u2088i\\xed\\u066b\\u0100en\\u21a3\\u21adrtneqq;\\uc000\\u2269\\ufe00\\xc5\\u21aa\\u0500Aabcefkosy\\u21c4\\u21c7\\u21f1\\u21f5\\u21fa\\u2218\\u221d\\u222f\\u2268\\u227dr\\xf2\\u03a0\\u0200ilmr\\u21d0\\u21d4\\u21d7\\u21dbrs\\xf0\\u1484f\\xbb\\u2024il\\xf4\\u06a9\\u0100dr\\u21e0\\u21e4cy;\\u444a\\u0180;cw\\u08f4\\u21eb\\u21efir;\\u6948;\\u61adar;\\u610firc;\\u4125\\u0180alr\\u2201\\u220e\\u2213rts\\u0100;u\\u2209\\u220a\\u6665it\\xbb\\u220alip;\\u6026con;\\u62b9r;\\uc000\\ud835\\udd25s\\u0100ew\\u2223\\u2229arow;\\u6925arow;\\u6926\\u0280amopr\\u223a\\u223e\\u2243\\u225e\\u2263rr;\\u61fftht;\\u623bk\\u0100lr\\u2249\\u2253eftarrow;\\u61a9ightarrow;\\u61aaf;\\uc000\\ud835\\udd59bar;\\u6015\\u0180clt\\u226f\\u2274\\u2278r;\\uc000\\ud835\\udcbdas\\xe8\\u21f4rok;\\u4127\\u0100bp\\u2282\\u2287ull;\\u6043hen\\xbb\\u1c5b\\u0ae1\\u22a3\\0\\u22aa\\0\\u22b8\\u22c5\\u22ce\\0\\u22d5\\u22f3\\0\\0\\u22f8\\u2322\\u2367\\u2362\\u237f\\0\\u2386\\u23aa\\u23b4cute\\u803b\\xed\\u40ed\\u0180;iy\\u0771\\u22b0\\u22b5rc\\u803b\\xee\\u40ee;\\u4438\\u0100cx\\u22bc\\u22bfy;\\u4435cl\\u803b\\xa1\\u40a1\\u0100fr\\u039f\\u22c9;\\uc000\\ud835\\udd26rave\\u803b\\xec\\u40ec\\u0200;ino\\u073e\\u22dd\\u22e9\\u22ee\\u0100in\\u22e2\\u22e6nt;\\u6a0ct;\\u622dfin;\\u69dcta;\\u6129lig;\\u4133\\u0180aop\\u22fe\\u231a\\u231d\\u0180cgt\\u2305\\u2308\\u2317r;\\u412b\\u0180elp\\u071f\\u230f\\u2313in\\xe5\\u078ear\\xf4\\u0720h;\\u4131f;\\u62b7ed;\\u41b5\\u0280;cfot\\u04f4\\u232c\\u2331\\u233d\\u2341are;\\u6105in\\u0100;t\\u2338\\u2339\\u621eie;\\u69dddo\\xf4\\u2319\\u0280;celp\\u0757\\u234c\\u2350\\u235b\\u2361al;\\u62ba\\u0100gr\\u2355\\u2359er\\xf3\\u1563\\xe3\\u234darhk;\\u6a17rod;\\u6a3c\\u0200cgpt\\u236f\\u2372\\u2376\\u237by;\\u4451on;\\u412ff;\\uc000\\ud835\\udd5aa;\\u43b9uest\\u803b\\xbf\\u40bf\\u0100ci\\u238a\\u238fr;\\uc000\\ud835\\udcben\\u0280;Edsv\\u04f4\\u239b\\u239d\\u23a1\\u04f3;\\u62f9ot;\\u62f5\\u0100;v\\u23a6\\u23a7\\u62f4;\\u62f3\\u0100;i\\u0777\\u23aelde;\\u4129\\u01eb\\u23b8\\0\\u23bccy;\\u4456l\\u803b\\xef\\u40ef\\u0300cfmosu\\u23cc\\u23d7\\u23dc\\u23e1\\u23e7\\u23f5\\u0100iy\\u23d1\\u23d5rc;\\u4135;\\u4439r;\\uc000\\ud835\\udd27ath;\\u4237pf;\\uc000\\ud835\\udd5b\\u01e3\\u23ec\\0\\u23f1r;\\uc000\\ud835\\udcbfrcy;\\u4458kcy;\\u4454\\u0400acfghjos\\u240b\\u2416\\u2422\\u2427\\u242d\\u2431\\u2435\\u243bppa\\u0100;v\\u2413\\u2414\\u43ba;\\u43f0\\u0100ey\\u241b\\u2420dil;\\u4137;\\u443ar;\\uc000\\ud835\\udd28reen;\\u4138cy;\\u4445cy;\\u445cpf;\\uc000\\ud835\\udd5ccr;\\uc000\\ud835\\udcc0\\u0b80ABEHabcdefghjlmnoprstuv\\u2470\\u2481\\u2486\\u248d\\u2491\\u250e\\u253d\\u255a\\u2580\\u264e\\u265e\\u2665\\u2679\\u267d\\u269a\\u26b2\\u26d8\\u275d\\u2768\\u278b\\u27c0\\u2801\\u2812\\u0180art\\u2477\\u247a\\u247cr\\xf2\\u09c6\\xf2\\u0395ail;\\u691barr;\\u690e\\u0100;g\\u0994\\u248b;\\u6a8bar;\\u6962\\u0963\\u24a5\\0\\u24aa\\0\\u24b1\\0\\0\\0\\0\\0\\u24b5\\u24ba\\0\\u24c6\\u24c8\\u24cd\\0\\u24f9ute;\\u413amptyv;\\u69b4ra\\xee\\u084cbda;\\u43bbg\\u0180;dl\\u088e\\u24c1\\u24c3;\\u6991\\xe5\\u088e;\\u6a85uo\\u803b\\xab\\u40abr\\u0400;bfhlpst\\u0899\\u24de\\u24e6\\u24e9\\u24eb\\u24ee\\u24f1\\u24f5\\u0100;f\\u089d\\u24e3s;\\u691fs;\\u691d\\xeb\\u2252p;\\u61abl;\\u6939im;\\u6973l;\\u61a2\\u0180;ae\\u24ff\\u2500\\u2504\\u6aabil;\\u6919\\u0100;s\\u2509\\u250a\\u6aad;\\uc000\\u2aad\\ufe00\\u0180abr\\u2515\\u2519\\u251drr;\\u690crk;\\u6772\\u0100ak\\u2522\\u252cc\\u0100ek\\u2528\\u252a;\\u407b;\\u405b\\u0100es\\u2531\\u2533;\\u698bl\\u0100du\\u2539\\u253b;\\u698f;\\u698d\\u0200aeuy\\u2546\\u254b\\u2556\\u2558ron;\\u413e\\u0100di\\u2550\\u2554il;\\u413c\\xec\\u08b0\\xe2\\u2529;\\u443b\\u0200cqrs\\u2563\\u2566\\u256d\\u257da;\\u6936uo\\u0100;r\\u0e19\\u1746\\u0100du\\u2572\\u2577har;\\u6967shar;\\u694bh;\\u61b2\\u0280;fgqs\\u258b\\u258c\\u0989\\u25f3\\u25ff\\u6264t\\u0280ahlrt\\u2598\\u25a4\\u25b7\\u25c2\\u25e8rrow\\u0100;t\\u0899\\u25a1a\\xe9\\u24f6arpoon\\u0100du\\u25af\\u25b4own\\xbb\\u045ap\\xbb\\u0966eftarrows;\\u61c7ight\\u0180ahs\\u25cd\\u25d6\\u25derrow\\u0100;s\\u08f4\\u08a7arpoon\\xf3\\u0f98quigarro\\xf7\\u21f0hreetimes;\\u62cb\\u0180;qs\\u258b\\u0993\\u25falan\\xf4\\u09ac\\u0280;cdgs\\u09ac\\u260a\\u260d\\u261d\\u2628c;\\u6aa8ot\\u0100;o\\u2614\\u2615\\u6a7f\\u0100;r\\u261a\\u261b\\u6a81;\\u6a83\\u0100;e\\u2622\\u2625\\uc000\\u22da\\ufe00s;\\u6a93\\u0280adegs\\u2633\\u2639\\u263d\\u2649\\u264bppro\\xf8\\u24c6ot;\\u62d6q\\u0100gq\\u2643\\u2645\\xf4\\u0989gt\\xf2\\u248c\\xf4\\u099bi\\xed\\u09b2\\u0180ilr\\u2655\\u08e1\\u265asht;\\u697c;\\uc000\\ud835\\udd29\\u0100;E\\u099c\\u2663;\\u6a91\\u0161\\u2669\\u2676r\\u0100du\\u25b2\\u266e\\u0100;l\\u0965\\u2673;\\u696alk;\\u6584cy;\\u4459\\u0280;acht\\u0a48\\u2688\\u268b\\u2691\\u2696r\\xf2\\u25c1orne\\xf2\\u1d08ard;\\u696bri;\\u65fa\\u0100io\\u269f\\u26a4dot;\\u4140ust\\u0100;a\\u26ac\\u26ad\\u63b0che\\xbb\\u26ad\\u0200Eaes\\u26bb\\u26bd\\u26c9\\u26d4;\\u6268p\\u0100;p\\u26c3\\u26c4\\u6a89rox\\xbb\\u26c4\\u0100;q\\u26ce\\u26cf\\u6a87\\u0100;q\\u26ce\\u26bbim;\\u62e6\\u0400abnoptwz\\u26e9\\u26f4\\u26f7\\u271a\\u272f\\u2741\\u2747\\u2750\\u0100nr\\u26ee\\u26f1g;\\u67ecr;\\u61fdr\\xeb\\u08c1g\\u0180lmr\\u26ff\\u270d\\u2714eft\\u0100ar\\u09e6\\u2707ight\\xe1\\u09f2apsto;\\u67fcight\\xe1\\u09fdparrow\\u0100lr\\u2725\\u2729ef\\xf4\\u24edight;\\u61ac\\u0180afl\\u2736\\u2739\\u273dr;\\u6985;\\uc000\\ud835\\udd5dus;\\u6a2dimes;\\u6a34\\u0161\\u274b\\u274fst;\\u6217\\xe1\\u134e\\u0180;ef\\u2757\\u2758\\u1800\\u65cange\\xbb\\u2758ar\\u0100;l\\u2764\\u2765\\u4028t;\\u6993\\u0280achmt\\u2773\\u2776\\u277c\\u2785\\u2787r\\xf2\\u08a8orne\\xf2\\u1d8car\\u0100;d\\u0f98\\u2783;\\u696d;\\u600eri;\\u62bf\\u0300achiqt\\u2798\\u279d\\u0a40\\u27a2\\u27ae\\u27bbquo;\\u6039r;\\uc000\\ud835\\udcc1m\\u0180;eg\\u09b2\\u27aa\\u27ac;\\u6a8d;\\u6a8f\\u0100bu\\u252a\\u27b3o\\u0100;r\\u0e1f\\u27b9;\\u601arok;\\u4142\\u8400<;cdhilqr\\u082b\\u27d2\\u2639\\u27dc\\u27e0\\u27e5\\u27ea\\u27f0\\u0100ci\\u27d7\\u27d9;\\u6aa6r;\\u6a79re\\xe5\\u25f2mes;\\u62c9arr;\\u6976uest;\\u6a7b\\u0100Pi\\u27f5\\u27f9ar;\\u6996\\u0180;ef\\u2800\\u092d\\u181b\\u65c3r\\u0100du\\u2807\\u280dshar;\\u694ahar;\\u6966\\u0100en\\u2817\\u2821rtneqq;\\uc000\\u2268\\ufe00\\xc5\\u281e\\u0700Dacdefhilnopsu\\u2840\\u2845\\u2882\\u288e\\u2893\\u28a0\\u28a5\\u28a8\\u28da\\u28e2\\u28e4\\u0a83\\u28f3\\u2902Dot;\\u623a\\u0200clpr\\u284e\\u2852\\u2863\\u287dr\\u803b\\xaf\\u40af\\u0100et\\u2857\\u2859;\\u6642\\u0100;e\\u285e\\u285f\\u6720se\\xbb\\u285f\\u0100;s\\u103b\\u2868to\\u0200;dlu\\u103b\\u2873\\u2877\\u287bow\\xee\\u048cef\\xf4\\u090f\\xf0\\u13d1ker;\\u65ae\\u0100oy\\u2887\\u288cmma;\\u6a29;\\u443cash;\\u6014asuredangle\\xbb\\u1626r;\\uc000\\ud835\\udd2ao;\\u6127\\u0180cdn\\u28af\\u28b4\\u28c9ro\\u803b\\xb5\\u40b5\\u0200;acd\\u1464\\u28bd\\u28c0\\u28c4s\\xf4\\u16a7ir;\\u6af0ot\\u80bb\\xb7\\u01b5us\\u0180;bd\\u28d2\\u1903\\u28d3\\u6212\\u0100;u\\u1d3c\\u28d8;\\u6a2a\\u0163\\u28de\\u28e1p;\\u6adb\\xf2\\u2212\\xf0\\u0a81\\u0100dp\\u28e9\\u28eeels;\\u62a7f;\\uc000\\ud835\\udd5e\\u0100ct\\u28f8\\u28fdr;\\uc000\\ud835\\udcc2pos\\xbb\\u159d\\u0180;lm\\u2909\\u290a\\u290d\\u43bctimap;\\u62b8\\u0c00GLRVabcdefghijlmoprstuvw\\u2942\\u2953\\u297e\\u2989\\u2998\\u29da\\u29e9\\u2a15\\u2a1a\\u2a58\\u2a5d\\u2a83\\u2a95\\u2aa4\\u2aa8\\u2b04\\u2b07\\u2b44\\u2b7f\\u2bae\\u2c34\\u2c67\\u2c7c\\u2ce9\\u0100gt\\u2947\\u294b;\\uc000\\u22d9\\u0338\\u0100;v\\u2950\\u0bcf\\uc000\\u226b\\u20d2\\u0180elt\\u295a\\u2972\\u2976ft\\u0100ar\\u2961\\u2967rrow;\\u61cdightarrow;\\u61ce;\\uc000\\u22d8\\u0338\\u0100;v\\u297b\\u0c47\\uc000\\u226a\\u20d2ightarrow;\\u61cf\\u0100Dd\\u298e\\u2993ash;\\u62afash;\\u62ae\\u0280bcnpt\\u29a3\\u29a7\\u29ac\\u29b1\\u29ccla\\xbb\\u02deute;\\u4144g;\\uc000\\u2220\\u20d2\\u0280;Eiop\\u0d84\\u29bc\\u29c0\\u29c5\\u29c8;\\uc000\\u2a70\\u0338d;\\uc000\\u224b\\u0338s;\\u4149ro\\xf8\\u0d84ur\\u0100;a\\u29d3\\u29d4\\u666el\\u0100;s\\u29d3\\u0b38\\u01f3\\u29df\\0\\u29e3p\\u80bb\\xa0\\u0b37mp\\u0100;e\\u0bf9\\u0c00\\u0280aeouy\\u29f4\\u29fe\\u2a03\\u2a10\\u2a13\\u01f0\\u29f9\\0\\u29fb;\\u6a43on;\\u4148dil;\\u4146ng\\u0100;d\\u0d7e\\u2a0aot;\\uc000\\u2a6d\\u0338p;\\u6a42;\\u443dash;\\u6013\\u0380;Aadqsx\\u0b92\\u2a29\\u2a2d\\u2a3b\\u2a41\\u2a45\\u2a50rr;\\u61d7r\\u0100hr\\u2a33\\u2a36k;\\u6924\\u0100;o\\u13f2\\u13f0ot;\\uc000\\u2250\\u0338ui\\xf6\\u0b63\\u0100ei\\u2a4a\\u2a4ear;\\u6928\\xed\\u0b98ist\\u0100;s\\u0ba0\\u0b9fr;\\uc000\\ud835\\udd2b\\u0200Eest\\u0bc5\\u2a66\\u2a79\\u2a7c\\u0180;qs\\u0bbc\\u2a6d\\u0be1\\u0180;qs\\u0bbc\\u0bc5\\u2a74lan\\xf4\\u0be2i\\xed\\u0bea\\u0100;r\\u0bb6\\u2a81\\xbb\\u0bb7\\u0180Aap\\u2a8a\\u2a8d\\u2a91r\\xf2\\u2971rr;\\u61aear;\\u6af2\\u0180;sv\\u0f8d\\u2a9c\\u0f8c\\u0100;d\\u2aa1\\u2aa2\\u62fc;\\u62facy;\\u445a\\u0380AEadest\\u2ab7\\u2aba\\u2abe\\u2ac2\\u2ac5\\u2af6\\u2af9r\\xf2\\u2966;\\uc000\\u2266\\u0338rr;\\u619ar;\\u6025\\u0200;fqs\\u0c3b\\u2ace\\u2ae3\\u2aeft\\u0100ar\\u2ad4\\u2ad9rro\\xf7\\u2ac1ightarro\\xf7\\u2a90\\u0180;qs\\u0c3b\\u2aba\\u2aealan\\xf4\\u0c55\\u0100;s\\u0c55\\u2af4\\xbb\\u0c36i\\xed\\u0c5d\\u0100;r\\u0c35\\u2afei\\u0100;e\\u0c1a\\u0c25i\\xe4\\u0d90\\u0100pt\\u2b0c\\u2b11f;\\uc000\\ud835\\udd5f\\u8180\\xac;in\\u2b19\\u2b1a\\u2b36\\u40acn\\u0200;Edv\\u0b89\\u2b24\\u2b28\\u2b2e;\\uc000\\u22f9\\u0338ot;\\uc000\\u22f5\\u0338\\u01e1\\u0b89\\u2b33\\u2b35;\\u62f7;\\u62f6i\\u0100;v\\u0cb8\\u2b3c\\u01e1\\u0cb8\\u2b41\\u2b43;\\u62fe;\\u62fd\\u0180aor\\u2b4b\\u2b63\\u2b69r\\u0200;ast\\u0b7b\\u2b55\\u2b5a\\u2b5flle\\xec\\u0b7bl;\\uc000\\u2afd\\u20e5;\\uc000\\u2202\\u0338lint;\\u6a14\\u0180;ce\\u0c92\\u2b70\\u2b73u\\xe5\\u0ca5\\u0100;c\\u0c98\\u2b78\\u0100;e\\u0c92\\u2b7d\\xf1\\u0c98\\u0200Aait\\u2b88\\u2b8b\\u2b9d\\u2ba7r\\xf2\\u2988rr\\u0180;cw\\u2b94\\u2b95\\u2b99\\u619b;\\uc000\\u2933\\u0338;\\uc000\\u219d\\u0338ghtarrow\\xbb\\u2b95ri\\u0100;e\\u0ccb\\u0cd6\\u0380chimpqu\\u2bbd\\u2bcd\\u2bd9\\u2b04\\u0b78\\u2be4\\u2bef\\u0200;cer\\u0d32\\u2bc6\\u0d37\\u2bc9u\\xe5\\u0d45;\\uc000\\ud835\\udcc3ort\\u026d\\u2b05\\0\\0\\u2bd6ar\\xe1\\u2b56m\\u0100;e\\u0d6e\\u2bdf\\u0100;q\\u0d74\\u0d73su\\u0100bp\\u2beb\\u2bed\\xe5\\u0cf8\\xe5\\u0d0b\\u0180bcp\\u2bf6\\u2c11\\u2c19\\u0200;Ees\\u2bff\\u2c00\\u0d22\\u2c04\\u6284;\\uc000\\u2ac5\\u0338et\\u0100;e\\u0d1b\\u2c0bq\\u0100;q\\u0d23\\u2c00c\\u0100;e\\u0d32\\u2c17\\xf1\\u0d38\\u0200;Ees\\u2c22\\u2c23\\u0d5f\\u2c27\\u6285;\\uc000\\u2ac6\\u0338et\\u0100;e\\u0d58\\u2c2eq\\u0100;q\\u0d60\\u2c23\\u0200gilr\\u2c3d\\u2c3f\\u2c45\\u2c47\\xec\\u0bd7lde\\u803b\\xf1\\u40f1\\xe7\\u0c43iangle\\u0100lr\\u2c52\\u2c5ceft\\u0100;e\\u0c1a\\u2c5a\\xf1\\u0c26ight\\u0100;e\\u0ccb\\u2c65\\xf1\\u0cd7\\u0100;m\\u2c6c\\u2c6d\\u43bd\\u0180;es\\u2c74\\u2c75\\u2c79\\u4023ro;\\u6116p;\\u6007\\u0480DHadgilrs\\u2c8f\\u2c94\\u2c99\\u2c9e\\u2ca3\\u2cb0\\u2cb6\\u2cd3\\u2ce3ash;\\u62adarr;\\u6904p;\\uc000\\u224d\\u20d2ash;\\u62ac\\u0100et\\u2ca8\\u2cac;\\uc000\\u2265\\u20d2;\\uc000>\\u20d2nfin;\\u69de\\u0180Aet\\u2cbd\\u2cc1\\u2cc5rr;\\u6902;\\uc000\\u2264\\u20d2\\u0100;r\\u2cca\\u2ccd\\uc000<\\u20d2ie;\\uc000\\u22b4\\u20d2\\u0100At\\u2cd8\\u2cdcrr;\\u6903rie;\\uc000\\u22b5\\u20d2im;\\uc000\\u223c\\u20d2\\u0180Aan\\u2cf0\\u2cf4\\u2d02rr;\\u61d6r\\u0100hr\\u2cfa\\u2cfdk;\\u6923\\u0100;o\\u13e7\\u13e5ear;\\u6927\\u1253\\u1a95\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\u2d2d\\0\\u2d38\\u2d48\\u2d60\\u2d65\\u2d72\\u2d84\\u1b07\\0\\0\\u2d8d\\u2dab\\0\\u2dc8\\u2dce\\0\\u2ddc\\u2e19\\u2e2b\\u2e3e\\u2e43\\u0100cs\\u2d31\\u1a97ute\\u803b\\xf3\\u40f3\\u0100iy\\u2d3c\\u2d45r\\u0100;c\\u1a9e\\u2d42\\u803b\\xf4\\u40f4;\\u443e\\u0280abios\\u1aa0\\u2d52\\u2d57\\u01c8\\u2d5alac;\\u4151v;\\u6a38old;\\u69bclig;\\u4153\\u0100cr\\u2d69\\u2d6dir;\\u69bf;\\uc000\\ud835\\udd2c\\u036f\\u2d79\\0\\0\\u2d7c\\0\\u2d82n;\\u42dbave\\u803b\\xf2\\u40f2;\\u69c1\\u0100bm\\u2d88\\u0df4ar;\\u69b5\\u0200acit\\u2d95\\u2d98\\u2da5\\u2da8r\\xf2\\u1a80\\u0100ir\\u2d9d\\u2da0r;\\u69beoss;\\u69bbn\\xe5\\u0e52;\\u69c0\\u0180aei\\u2db1\\u2db5\\u2db9cr;\\u414dga;\\u43c9\\u0180cdn\\u2dc0\\u2dc5\\u01cdron;\\u43bf;\\u69b6pf;\\uc000\\ud835\\udd60\\u0180ael\\u2dd4\\u2dd7\\u01d2r;\\u69b7rp;\\u69b9\\u0380;adiosv\\u2dea\\u2deb\\u2dee\\u2e08\\u2e0d\\u2e10\\u2e16\\u6228r\\xf2\\u1a86\\u0200;efm\\u2df7\\u2df8\\u2e02\\u2e05\\u6a5dr\\u0100;o\\u2dfe\\u2dff\\u6134f\\xbb\\u2dff\\u803b\\xaa\\u40aa\\u803b\\xba\\u40bagof;\\u62b6r;\\u6a56lope;\\u6a57;\\u6a5b\\u0180clo\\u2e1f\\u2e21\\u2e27\\xf2\\u2e01ash\\u803b\\xf8\\u40f8l;\\u6298i\\u016c\\u2e2f\\u2e34de\\u803b\\xf5\\u40f5es\\u0100;a\\u01db\\u2e3as;\\u6a36ml\\u803b\\xf6\\u40f6bar;\\u633d\\u0ae1\\u2e5e\\0\\u2e7d\\0\\u2e80\\u2e9d\\0\\u2ea2\\u2eb9\\0\\0\\u2ecb\\u0e9c\\0\\u2f13\\0\\0\\u2f2b\\u2fbc\\0\\u2fc8r\\u0200;ast\\u0403\\u2e67\\u2e72\\u0e85\\u8100\\xb6;l\\u2e6d\\u2e6e\\u40b6le\\xec\\u0403\\u0269\\u2e78\\0\\0\\u2e7bm;\\u6af3;\\u6afdy;\\u443fr\\u0280cimpt\\u2e8b\\u2e8f\\u2e93\\u1865\\u2e97nt;\\u4025od;\\u402eil;\\u6030enk;\\u6031r;\\uc000\\ud835\\udd2d\\u0180imo\\u2ea8\\u2eb0\\u2eb4\\u0100;v\\u2ead\\u2eae\\u43c6;\\u43d5ma\\xf4\\u0a76ne;\\u660e\\u0180;tv\\u2ebf\\u2ec0\\u2ec8\\u43c0chfork\\xbb\\u1ffd;\\u43d6\\u0100au\\u2ecf\\u2edfn\\u0100ck\\u2ed5\\u2eddk\\u0100;h\\u21f4\\u2edb;\\u610e\\xf6\\u21f4s\\u0480;abcdemst\\u2ef3\\u2ef4\\u1908\\u2ef9\\u2efd\\u2f04\\u2f06\\u2f0a\\u2f0e\\u402bcir;\\u6a23ir;\\u6a22\\u0100ou\\u1d40\\u2f02;\\u6a25;\\u6a72n\\u80bb\\xb1\\u0e9dim;\\u6a26wo;\\u6a27\\u0180ipu\\u2f19\\u2f20\\u2f25ntint;\\u6a15f;\\uc000\\ud835\\udd61nd\\u803b\\xa3\\u40a3\\u0500;Eaceinosu\\u0ec8\\u2f3f\\u2f41\\u2f44\\u2f47\\u2f81\\u2f89\\u2f92\\u2f7e\\u2fb6;\\u6ab3p;\\u6ab7u\\xe5\\u0ed9\\u0100;c\\u0ece\\u2f4c\\u0300;acens\\u0ec8\\u2f59\\u2f5f\\u2f66\\u2f68\\u2f7eppro\\xf8\\u2f43urlye\\xf1\\u0ed9\\xf1\\u0ece\\u0180aes\\u2f6f\\u2f76\\u2f7approx;\\u6ab9qq;\\u6ab5im;\\u62e8i\\xed\\u0edfme\\u0100;s\\u2f88\\u0eae\\u6032\\u0180Eas\\u2f78\\u2f90\\u2f7a\\xf0\\u2f75\\u0180dfp\\u0eec\\u2f99\\u2faf\\u0180als\\u2fa0\\u2fa5\\u2faalar;\\u632eine;\\u6312urf;\\u6313\\u0100;t\\u0efb\\u2fb4\\xef\\u0efbrel;\\u62b0\\u0100ci\\u2fc0\\u2fc5r;\\uc000\\ud835\\udcc5;\\u43c8ncsp;\\u6008\\u0300fiopsu\\u2fda\\u22e2\\u2fdf\\u2fe5\\u2feb\\u2ff1r;\\uc000\\ud835\\udd2epf;\\uc000\\ud835\\udd62rime;\\u6057cr;\\uc000\\ud835\\udcc6\\u0180aeo\\u2ff8\\u3009\\u3013t\\u0100ei\\u2ffe\\u3005rnion\\xf3\\u06b0nt;\\u6a16st\\u0100;e\\u3010\\u3011\\u403f\\xf1\\u1f19\\xf4\\u0f14\\u0a80ABHabcdefhilmnoprstux\\u3040\\u3051\\u3055\\u3059\\u30e0\\u310e\\u312b\\u3147\\u3162\\u3172\\u318e\\u3206\\u3215\\u3224\\u3229\\u3258\\u326e\\u3272\\u3290\\u32b0\\u32b7\\u0180art\\u3047\\u304a\\u304cr\\xf2\\u10b3\\xf2\\u03ddail;\\u691car\\xf2\\u1c65ar;\\u6964\\u0380cdenqrt\\u3068\\u3075\\u3078\\u307f\\u308f\\u3094\\u30cc\\u0100eu\\u306d\\u3071;\\uc000\\u223d\\u0331te;\\u4155i\\xe3\\u116emptyv;\\u69b3g\\u0200;del\\u0fd1\\u3089\\u308b\\u308d;\\u6992;\\u69a5\\xe5\\u0fd1uo\\u803b\\xbb\\u40bbr\\u0580;abcfhlpstw\\u0fdc\\u30ac\\u30af\\u30b7\\u30b9\\u30bc\\u30be\\u30c0\\u30c3\\u30c7\\u30cap;\\u6975\\u0100;f\\u0fe0\\u30b4s;\\u6920;\\u6933s;\\u691e\\xeb\\u225d\\xf0\\u272el;\\u6945im;\\u6974l;\\u61a3;\\u619d\\u0100ai\\u30d1\\u30d5il;\\u691ao\\u0100;n\\u30db\\u30dc\\u6236al\\xf3\\u0f1e\\u0180abr\\u30e7\\u30ea\\u30eer\\xf2\\u17e5rk;\\u6773\\u0100ak\\u30f3\\u30fdc\\u0100ek\\u30f9\\u30fb;\\u407d;\\u405d\\u0100es\\u3102\\u3104;\\u698cl\\u0100du\\u310a\\u310c;\\u698e;\\u6990\\u0200aeuy\\u3117\\u311c\\u3127\\u3129ron;\\u4159\\u0100di\\u3121\\u3125il;\\u4157\\xec\\u0ff2\\xe2\\u30fa;\\u4440\\u0200clqs\\u3134\\u3137\\u313d\\u3144a;\\u6937dhar;\\u6969uo\\u0100;r\\u020e\\u020dh;\\u61b3\\u0180acg\\u314e\\u315f\\u0f44l\\u0200;ips\\u0f78\\u3158\\u315b\\u109cn\\xe5\\u10bbar\\xf4\\u0fa9t;\\u65ad\\u0180ilr\\u3169\\u1023\\u316esht;\\u697d;\\uc000\\ud835\\udd2f\\u0100ao\\u3177\\u3186r\\u0100du\\u317d\\u317f\\xbb\\u047b\\u0100;l\\u1091\\u3184;\\u696c\\u0100;v\\u318b\\u318c\\u43c1;\\u43f1\\u0180gns\\u3195\\u31f9\\u31fcht\\u0300ahlrst\\u31a4\\u31b0\\u31c2\\u31d8\\u31e4\\u31eerrow\\u0100;t\\u0fdc\\u31ada\\xe9\\u30c8arpoon\\u0100du\\u31bb\\u31bfow\\xee\\u317ep\\xbb\\u1092eft\\u0100ah\\u31ca\\u31d0rrow\\xf3\\u0feaarpoon\\xf3\\u0551ightarrows;\\u61c9quigarro\\xf7\\u30cbhreetimes;\\u62ccg;\\u42daingdotse\\xf1\\u1f32\\u0180ahm\\u320d\\u3210\\u3213r\\xf2\\u0feaa\\xf2\\u0551;\\u600foust\\u0100;a\\u321e\\u321f\\u63b1che\\xbb\\u321fmid;\\u6aee\\u0200abpt\\u3232\\u323d\\u3240\\u3252\\u0100nr\\u3237\\u323ag;\\u67edr;\\u61fer\\xeb\\u1003\\u0180afl\\u3247\\u324a\\u324er;\\u6986;\\uc000\\ud835\\udd63us;\\u6a2eimes;\\u6a35\\u0100ap\\u325d\\u3267r\\u0100;g\\u3263\\u3264\\u4029t;\\u6994olint;\\u6a12ar\\xf2\\u31e3\\u0200achq\\u327b\\u3280\\u10bc\\u3285quo;\\u603ar;\\uc000\\ud835\\udcc7\\u0100bu\\u30fb\\u328ao\\u0100;r\\u0214\\u0213\\u0180hir\\u3297\\u329b\\u32a0re\\xe5\\u31f8mes;\\u62cai\\u0200;efl\\u32aa\\u1059\\u1821\\u32ab\\u65b9tri;\\u69celuhar;\\u6968;\\u611e\\u0d61\\u32d5\\u32db\\u32df\\u332c\\u3338\\u3371\\0\\u337a\\u33a4\\0\\0\\u33ec\\u33f0\\0\\u3428\\u3448\\u345a\\u34ad\\u34b1\\u34ca\\u34f1\\0\\u3616\\0\\0\\u3633cute;\\u415bqu\\xef\\u27ba\\u0500;Eaceinpsy\\u11ed\\u32f3\\u32f5\\u32ff\\u3302\\u330b\\u330f\\u331f\\u3326\\u3329;\\u6ab4\\u01f0\\u32fa\\0\\u32fc;\\u6ab8on;\\u4161u\\xe5\\u11fe\\u0100;d\\u11f3\\u3307il;\\u415frc;\\u415d\\u0180Eas\\u3316\\u3318\\u331b;\\u6ab6p;\\u6abaim;\\u62e9olint;\\u6a13i\\xed\\u1204;\\u4441ot\\u0180;be\\u3334\\u1d47\\u3335\\u62c5;\\u6a66\\u0380Aacmstx\\u3346\\u334a\\u3357\\u335b\\u335e\\u3363\\u336drr;\\u61d8r\\u0100hr\\u3350\\u3352\\xeb\\u2228\\u0100;o\\u0a36\\u0a34t\\u803b\\xa7\\u40a7i;\\u403bwar;\\u6929m\\u0100in\\u3369\\xf0nu\\xf3\\xf1t;\\u6736r\\u0100;o\\u3376\\u2055\\uc000\\ud835\\udd30\\u0200acoy\\u3382\\u3386\\u3391\\u33a0rp;\\u666f\\u0100hy\\u338b\\u338fcy;\\u4449;\\u4448rt\\u026d\\u3399\\0\\0\\u339ci\\xe4\\u1464ara\\xec\\u2e6f\\u803b\\xad\\u40ad\\u0100gm\\u33a8\\u33b4ma\\u0180;fv\\u33b1\\u33b2\\u33b2\\u43c3;\\u43c2\\u0400;deglnpr\\u12ab\\u33c5\\u33c9\\u33ce\\u33d6\\u33de\\u33e1\\u33e6ot;\\u6a6a\\u0100;q\\u12b1\\u12b0\\u0100;E\\u33d3\\u33d4\\u6a9e;\\u6aa0\\u0100;E\\u33db\\u33dc\\u6a9d;\\u6a9fe;\\u6246lus;\\u6a24arr;\\u6972ar\\xf2\\u113d\\u0200aeit\\u33f8\\u3408\\u340f\\u3417\\u0100ls\\u33fd\\u3404lsetm\\xe9\\u336ahp;\\u6a33parsl;\\u69e4\\u0100dl\\u1463\\u3414e;\\u6323\\u0100;e\\u341c\\u341d\\u6aaa\\u0100;s\\u3422\\u3423\\u6aac;\\uc000\\u2aac\\ufe00\\u0180flp\\u342e\\u3433\\u3442tcy;\\u444c\\u0100;b\\u3438\\u3439\\u402f\\u0100;a\\u343e\\u343f\\u69c4r;\\u633ff;\\uc000\\ud835\\udd64a\\u0100dr\\u344d\\u0402es\\u0100;u\\u3454\\u3455\\u6660it\\xbb\\u3455\\u0180csu\\u3460\\u3479\\u349f\\u0100au\\u3465\\u346fp\\u0100;s\\u1188\\u346b;\\uc000\\u2293\\ufe00p\\u0100;s\\u11b4\\u3475;\\uc000\\u2294\\ufe00u\\u0100bp\\u347f\\u348f\\u0180;es\\u1197\\u119c\\u3486et\\u0100;e\\u1197\\u348d\\xf1\\u119d\\u0180;es\\u11a8\\u11ad\\u3496et\\u0100;e\\u11a8\\u349d\\xf1\\u11ae\\u0180;af\\u117b\\u34a6\\u05b0r\\u0165\\u34ab\\u05b1\\xbb\\u117car\\xf2\\u1148\\u0200cemt\\u34b9\\u34be\\u34c2\\u34c5r;\\uc000\\ud835\\udcc8tm\\xee\\xf1i\\xec\\u3415ar\\xe6\\u11be\\u0100ar\\u34ce\\u34d5r\\u0100;f\\u34d4\\u17bf\\u6606\\u0100an\\u34da\\u34edight\\u0100ep\\u34e3\\u34eapsilo\\xee\\u1ee0h\\xe9\\u2eafs\\xbb\\u2852\\u0280bcmnp\\u34fb\\u355e\\u1209\\u358b\\u358e\\u0480;Edemnprs\\u350e\\u350f\\u3511\\u3515\\u351e\\u3523\\u352c\\u3531\\u3536\\u6282;\\u6ac5ot;\\u6abd\\u0100;d\\u11da\\u351aot;\\u6ac3ult;\\u6ac1\\u0100Ee\\u3528\\u352a;\\u6acb;\\u628alus;\\u6abfarr;\\u6979\\u0180eiu\\u353d\\u3552\\u3555t\\u0180;en\\u350e\\u3545\\u354bq\\u0100;q\\u11da\\u350feq\\u0100;q\\u352b\\u3528m;\\u6ac7\\u0100bp\\u355a\\u355c;\\u6ad5;\\u6ad3c\\u0300;acens\\u11ed\\u356c\\u3572\\u3579\\u357b\\u3326ppro\\xf8\\u32faurlye\\xf1\\u11fe\\xf1\\u11f3\\u0180aes\\u3582\\u3588\\u331bppro\\xf8\\u331aq\\xf1\\u3317g;\\u666a\\u0680123;Edehlmnps\\u35a9\\u35ac\\u35af\\u121c\\u35b2\\u35b4\\u35c0\\u35c9\\u35d5\\u35da\\u35df\\u35e8\\u35ed\\u803b\\xb9\\u40b9\\u803b\\xb2\\u40b2\\u803b\\xb3\\u40b3;\\u6ac6\\u0100os\\u35b9\\u35bct;\\u6abeub;\\u6ad8\\u0100;d\\u1222\\u35c5ot;\\u6ac4s\\u0100ou\\u35cf\\u35d2l;\\u67c9b;\\u6ad7arr;\\u697bult;\\u6ac2\\u0100Ee\\u35e4\\u35e6;\\u6acc;\\u628blus;\\u6ac0\\u0180eiu\\u35f4\\u3609\\u360ct\\u0180;en\\u121c\\u35fc\\u3602q\\u0100;q\\u1222\\u35b2eq\\u0100;q\\u35e7\\u35e4m;\\u6ac8\\u0100bp\\u3611\\u3613;\\u6ad4;\\u6ad6\\u0180Aan\\u361c\\u3620\\u362drr;\\u61d9r\\u0100hr\\u3626\\u3628\\xeb\\u222e\\u0100;o\\u0a2b\\u0a29war;\\u692alig\\u803b\\xdf\\u40df\\u0be1\\u3651\\u365d\\u3660\\u12ce\\u3673\\u3679\\0\\u367e\\u36c2\\0\\0\\0\\0\\0\\u36db\\u3703\\0\\u3709\\u376c\\0\\0\\0\\u3787\\u0272\\u3656\\0\\0\\u365bget;\\u6316;\\u43c4r\\xeb\\u0e5f\\u0180aey\\u3666\\u366b\\u3670ron;\\u4165dil;\\u4163;\\u4442lrec;\\u6315r;\\uc000\\ud835\\udd31\\u0200eiko\\u3686\\u369d\\u36b5\\u36bc\\u01f2\\u368b\\0\\u3691e\\u01004f\\u1284\\u1281a\\u0180;sv\\u3698\\u3699\\u369b\\u43b8ym;\\u43d1\\u0100cn\\u36a2\\u36b2k\\u0100as\\u36a8\\u36aeppro\\xf8\\u12c1im\\xbb\\u12acs\\xf0\\u129e\\u0100as\\u36ba\\u36ae\\xf0\\u12c1rn\\u803b\\xfe\\u40fe\\u01ec\\u031f\\u36c6\\u22e7es\\u8180\\xd7;bd\\u36cf\\u36d0\\u36d8\\u40d7\\u0100;a\\u190f\\u36d5r;\\u6a31;\\u6a30\\u0180eps\\u36e1\\u36e3\\u3700\\xe1\\u2a4d\\u0200;bcf\\u0486\\u36ec\\u36f0\\u36f4ot;\\u6336ir;\\u6af1\\u0100;o\\u36f9\\u36fc\\uc000\\ud835\\udd65rk;\\u6ada\\xe1\\u3362rime;\\u6034\\u0180aip\\u370f\\u3712\\u3764d\\xe5\\u1248\\u0380adempst\\u3721\\u374d\\u3740\\u3751\\u3757\\u375c\\u375fngle\\u0280;dlqr\\u3730\\u3731\\u3736\\u3740\\u3742\\u65b5own\\xbb\\u1dbbeft\\u0100;e\\u2800\\u373e\\xf1\\u092e;\\u625cight\\u0100;e\\u32aa\\u374b\\xf1\\u105aot;\\u65ecinus;\\u6a3alus;\\u6a39b;\\u69cdime;\\u6a3bezium;\\u63e2\\u0180cht\\u3772\\u377d\\u3781\\u0100ry\\u3777\\u377b;\\uc000\\ud835\\udcc9;\\u4446cy;\\u445brok;\\u4167\\u0100io\\u378b\\u378ex\\xf4\\u1777head\\u0100lr\\u3797\\u37a0eftarro\\xf7\\u084fightarrow\\xbb\\u0f5d\\u0900AHabcdfghlmoprstuw\\u37d0\\u37d3\\u37d7\\u37e4\\u37f0\\u37fc\\u380e\\u381c\\u3823\\u3834\\u3851\\u385d\\u386b\\u38a9\\u38cc\\u38d2\\u38ea\\u38f6r\\xf2\\u03edar;\\u6963\\u0100cr\\u37dc\\u37e2ute\\u803b\\xfa\\u40fa\\xf2\\u1150r\\u01e3\\u37ea\\0\\u37edy;\\u445eve;\\u416d\\u0100iy\\u37f5\\u37farc\\u803b\\xfb\\u40fb;\\u4443\\u0180abh\\u3803\\u3806\\u380br\\xf2\\u13adlac;\\u4171a\\xf2\\u13c3\\u0100ir\\u3813\\u3818sht;\\u697e;\\uc000\\ud835\\udd32rave\\u803b\\xf9\\u40f9\\u0161\\u3827\\u3831r\\u0100lr\\u382c\\u382e\\xbb\\u0957\\xbb\\u1083lk;\\u6580\\u0100ct\\u3839\\u384d\\u026f\\u383f\\0\\0\\u384arn\\u0100;e\\u3845\\u3846\\u631cr\\xbb\\u3846op;\\u630fri;\\u65f8\\u0100al\\u3856\\u385acr;\\u416b\\u80bb\\xa8\\u0349\\u0100gp\\u3862\\u3866on;\\u4173f;\\uc000\\ud835\\udd66\\u0300adhlsu\\u114b\\u3878\\u387d\\u1372\\u3891\\u38a0own\\xe1\\u13b3arpoon\\u0100lr\\u3888\\u388cef\\xf4\\u382digh\\xf4\\u382fi\\u0180;hl\\u3899\\u389a\\u389c\\u43c5\\xbb\\u13faon\\xbb\\u389aparrows;\\u61c8\\u0180cit\\u38b0\\u38c4\\u38c8\\u026f\\u38b6\\0\\0\\u38c1rn\\u0100;e\\u38bc\\u38bd\\u631dr\\xbb\\u38bdop;\\u630eng;\\u416fri;\\u65f9cr;\\uc000\\ud835\\udcca\\u0180dir\\u38d9\\u38dd\\u38e2ot;\\u62f0lde;\\u4169i\\u0100;f\\u3730\\u38e8\\xbb\\u1813\\u0100am\\u38ef\\u38f2r\\xf2\\u38a8l\\u803b\\xfc\\u40fcangle;\\u69a7\\u0780ABDacdeflnoprsz\\u391c\\u391f\\u3929\\u392d\\u39b5\\u39b8\\u39bd\\u39df\\u39e4\\u39e8\\u39f3\\u39f9\\u39fd\\u3a01\\u3a20r\\xf2\\u03f7ar\\u0100;v\\u3926\\u3927\\u6ae8;\\u6ae9as\\xe8\\u03e1\\u0100nr\\u3932\\u3937grt;\\u699c\\u0380eknprst\\u34e3\\u3946\\u394b\\u3952\\u395d\\u3964\\u3996app\\xe1\\u2415othin\\xe7\\u1e96\\u0180hir\\u34eb\\u2ec8\\u3959op\\xf4\\u2fb5\\u0100;h\\u13b7\\u3962\\xef\\u318d\\u0100iu\\u3969\\u396dgm\\xe1\\u33b3\\u0100bp\\u3972\\u3984setneq\\u0100;q\\u397d\\u3980\\uc000\\u228a\\ufe00;\\uc000\\u2acb\\ufe00setneq\\u0100;q\\u398f\\u3992\\uc000\\u228b\\ufe00;\\uc000\\u2acc\\ufe00\\u0100hr\\u399b\\u399fet\\xe1\\u369ciangle\\u0100lr\\u39aa\\u39afeft\\xbb\\u0925ight\\xbb\\u1051y;\\u4432ash\\xbb\\u1036\\u0180elr\\u39c4\\u39d2\\u39d7\\u0180;be\\u2dea\\u39cb\\u39cfar;\\u62bbq;\\u625alip;\\u62ee\\u0100bt\\u39dc\\u1468a\\xf2\\u1469r;\\uc000\\ud835\\udd33tr\\xe9\\u39aesu\\u0100bp\\u39ef\\u39f1\\xbb\\u0d1c\\xbb\\u0d59pf;\\uc000\\ud835\\udd67ro\\xf0\\u0efbtr\\xe9\\u39b4\\u0100cu\\u3a06\\u3a0br;\\uc000\\ud835\\udccb\\u0100bp\\u3a10\\u3a18n\\u0100Ee\\u3980\\u3a16\\xbb\\u397en\\u0100Ee\\u3992\\u3a1e\\xbb\\u3990igzag;\\u699a\\u0380cefoprs\\u3a36\\u3a3b\\u3a56\\u3a5b\\u3a54\\u3a61\\u3a6airc;\\u4175\\u0100di\\u3a40\\u3a51\\u0100bg\\u3a45\\u3a49ar;\\u6a5fe\\u0100;q\\u15fa\\u3a4f;\\u6259erp;\\u6118r;\\uc000\\ud835\\udd34pf;\\uc000\\ud835\\udd68\\u0100;e\\u1479\\u3a66at\\xe8\\u1479cr;\\uc000\\ud835\\udccc\\u0ae3\\u178e\\u3a87\\0\\u3a8b\\0\\u3a90\\u3a9b\\0\\0\\u3a9d\\u3aa8\\u3aab\\u3aaf\\0\\0\\u3ac3\\u3ace\\0\\u3ad8\\u17dc\\u17dftr\\xe9\\u17d1r;\\uc000\\ud835\\udd35\\u0100Aa\\u3a94\\u3a97r\\xf2\\u03c3r\\xf2\\u09f6;\\u43be\\u0100Aa\\u3aa1\\u3aa4r\\xf2\\u03b8r\\xf2\\u09eba\\xf0\\u2713is;\\u62fb\\u0180dpt\\u17a4\\u3ab5\\u3abe\\u0100fl\\u3aba\\u17a9;\\uc000\\ud835\\udd69im\\xe5\\u17b2\\u0100Aa\\u3ac7\\u3acar\\xf2\\u03cer\\xf2\\u0a01\\u0100cq\\u3ad2\\u17b8r;\\uc000\\ud835\\udccd\\u0100pt\\u17d6\\u3adcr\\xe9\\u17d4\\u0400acefiosu\\u3af0\\u3afd\\u3b08\\u3b0c\\u3b11\\u3b15\\u3b1b\\u3b21c\\u0100uy\\u3af6\\u3afbte\\u803b\\xfd\\u40fd;\\u444f\\u0100iy\\u3b02\\u3b06rc;\\u4177;\\u444bn\\u803b\\xa5\\u40a5r;\\uc000\\ud835\\udd36cy;\\u4457pf;\\uc000\\ud835\\udd6acr;\\uc000\\ud835\\udcce\\u0100cm\\u3b26\\u3b29y;\\u444el\\u803b\\xff\\u40ff\\u0500acdefhiosw\\u3b42\\u3b48\\u3b54\\u3b58\\u3b64\\u3b69\\u3b6d\\u3b74\\u3b7a\\u3b80cute;\\u417a\\u0100ay\\u3b4d\\u3b52ron;\\u417e;\\u4437ot;\\u417c\\u0100et\\u3b5d\\u3b61tr\\xe6\\u155fa;\\u43b6r;\\uc000\\ud835\\udd37cy;\\u4436grarr;\\u61ddpf;\\uc000\\ud835\\udd6bcr;\\uc000\\ud835\\udccf\\u0100jn\\u3b85\\u3b87;\\u600dj;\\u600c\"\n .split(\"\")\n .map((c) => c.charCodeAt(0)));\n//# sourceMappingURL=decode-data-html.js.map","// Generated using scripts/write-decode-map.ts\nexport default new Uint16Array(\n// prettier-ignore\n\"\\u0200aglq\\t\\x15\\x18\\x1b\\u026d\\x0f\\0\\0\\x12p;\\u4026os;\\u4027t;\\u403et;\\u403cuot;\\u4022\"\n .split(\"\")\n .map((c) => c.charCodeAt(0)));\n//# sourceMappingURL=decode-data-xml.js.map","// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\nvar _a;\nconst decodeMap = new Map([\n [0, 65533],\n // C1 Unicode control character reference replacements\n [128, 8364],\n [130, 8218],\n [131, 402],\n [132, 8222],\n [133, 8230],\n [134, 8224],\n [135, 8225],\n [136, 710],\n [137, 8240],\n [138, 352],\n [139, 8249],\n [140, 338],\n [142, 381],\n [145, 8216],\n [146, 8217],\n [147, 8220],\n [148, 8221],\n [149, 8226],\n [150, 8211],\n [151, 8212],\n [152, 732],\n [153, 8482],\n [154, 353],\n [155, 8250],\n [156, 339],\n [158, 382],\n [159, 376],\n]);\n/**\n * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.\n */\nexport const fromCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins\n(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {\n let output = \"\";\n if (codePoint > 0xffff) {\n codePoint -= 0x10000;\n output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);\n codePoint = 0xdc00 | (codePoint & 0x3ff);\n }\n output += String.fromCharCode(codePoint);\n return output;\n};\n/**\n * Replace the given code point with a replacement character if it is a\n * surrogate or is outside the valid range. Otherwise return the code\n * point unchanged.\n */\nexport function replaceCodePoint(codePoint) {\n var _a;\n if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {\n return 0xfffd;\n }\n return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;\n}\n/**\n * Replace the code point if relevant, then convert it to a string.\n *\n * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.\n * @param codePoint The code point to decode.\n * @returns The decoded code point.\n */\nexport default function decodeCodePoint(codePoint) {\n return fromCodePoint(replaceCodePoint(codePoint));\n}\n//# sourceMappingURL=decode_codepoint.js.map","import htmlDecodeTree from \"./generated/decode-data-html.js\";\nimport xmlDecodeTree from \"./generated/decode-data-xml.js\";\nimport decodeCodePoint, { replaceCodePoint, fromCodePoint, } from \"./decode_codepoint.js\";\n// Re-export for use by eg. htmlparser2\nexport { htmlDecodeTree, xmlDecodeTree, decodeCodePoint };\nexport { replaceCodePoint, fromCodePoint } from \"./decode_codepoint.js\";\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"NUM\"] = 35] = \"NUM\";\n CharCodes[CharCodes[\"SEMI\"] = 59] = \"SEMI\";\n CharCodes[CharCodes[\"EQUALS\"] = 61] = \"EQUALS\";\n CharCodes[CharCodes[\"ZERO\"] = 48] = \"ZERO\";\n CharCodes[CharCodes[\"NINE\"] = 57] = \"NINE\";\n CharCodes[CharCodes[\"LOWER_A\"] = 97] = \"LOWER_A\";\n CharCodes[CharCodes[\"LOWER_F\"] = 102] = \"LOWER_F\";\n CharCodes[CharCodes[\"LOWER_X\"] = 120] = \"LOWER_X\";\n CharCodes[CharCodes[\"LOWER_Z\"] = 122] = \"LOWER_Z\";\n CharCodes[CharCodes[\"UPPER_A\"] = 65] = \"UPPER_A\";\n CharCodes[CharCodes[\"UPPER_F\"] = 70] = \"UPPER_F\";\n CharCodes[CharCodes[\"UPPER_Z\"] = 90] = \"UPPER_Z\";\n})(CharCodes || (CharCodes = {}));\n/** Bit that needs to be set to convert an upper case ASCII character to lower case */\nconst TO_LOWER_BIT = 0b100000;\nexport var BinTrieFlags;\n(function (BinTrieFlags) {\n BinTrieFlags[BinTrieFlags[\"VALUE_LENGTH\"] = 49152] = \"VALUE_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"BRANCH_LENGTH\"] = 16256] = \"BRANCH_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"JUMP_TABLE\"] = 127] = \"JUMP_TABLE\";\n})(BinTrieFlags || (BinTrieFlags = {}));\nfunction isNumber(code) {\n return code >= CharCodes.ZERO && code <= CharCodes.NINE;\n}\nfunction isHexadecimalCharacter(code) {\n return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||\n (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));\n}\nfunction isAsciiAlphaNumeric(code) {\n return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||\n (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||\n isNumber(code));\n}\n/**\n * Checks if the given character is a valid end character for an entity in an attribute.\n *\n * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.\n * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n */\nfunction isEntityInAttributeInvalidEnd(code) {\n return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);\n}\nvar EntityDecoderState;\n(function (EntityDecoderState) {\n EntityDecoderState[EntityDecoderState[\"EntityStart\"] = 0] = \"EntityStart\";\n EntityDecoderState[EntityDecoderState[\"NumericStart\"] = 1] = \"NumericStart\";\n EntityDecoderState[EntityDecoderState[\"NumericDecimal\"] = 2] = \"NumericDecimal\";\n EntityDecoderState[EntityDecoderState[\"NumericHex\"] = 3] = \"NumericHex\";\n EntityDecoderState[EntityDecoderState[\"NamedEntity\"] = 4] = \"NamedEntity\";\n})(EntityDecoderState || (EntityDecoderState = {}));\nexport var DecodingMode;\n(function (DecodingMode) {\n /** Entities in text nodes that can end with any character. */\n DecodingMode[DecodingMode[\"Legacy\"] = 0] = \"Legacy\";\n /** Only allow entities terminated with a semicolon. */\n DecodingMode[DecodingMode[\"Strict\"] = 1] = \"Strict\";\n /** Entities in attributes have limitations on ending characters. */\n DecodingMode[DecodingMode[\"Attribute\"] = 2] = \"Attribute\";\n})(DecodingMode || (DecodingMode = {}));\n/**\n * Token decoder with support of writing partial entities.\n */\nexport class EntityDecoder {\n constructor(\n /** The tree used to decode entities. */\n decodeTree, \n /**\n * The function that is called when a codepoint is decoded.\n *\n * For multi-byte named entities, this will be called multiple times,\n * with the second codepoint, and the same `consumed` value.\n *\n * @param codepoint The decoded codepoint.\n * @param consumed The number of bytes consumed by the decoder.\n */\n emitCodePoint, \n /** An object that is used to produce errors. */\n errors) {\n this.decodeTree = decodeTree;\n this.emitCodePoint = emitCodePoint;\n this.errors = errors;\n /** The current state of the decoder. */\n this.state = EntityDecoderState.EntityStart;\n /** Characters that were consumed while parsing an entity. */\n this.consumed = 1;\n /**\n * The result of the entity.\n *\n * Either the result index of a numeric entity, or the codepoint of a\n * numeric entity.\n */\n this.result = 0;\n /** The current index in the decode tree. */\n this.treeIndex = 0;\n /** The number of characters that were consumed in excess. */\n this.excess = 1;\n /** The mode in which the decoder is operating. */\n this.decodeMode = DecodingMode.Strict;\n }\n /** Resets the instance to make it reusable. */\n startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n }\n /**\n * Write an entity to the decoder. This can be called multiple times with partial entities.\n * If the entity is incomplete, the decoder will return -1.\n *\n * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the\n * entity is incomplete, and resume when the next string is written.\n *\n * @param string The string containing the entity (or a continuation of the entity).\n * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n write(str, offset) {\n switch (this.state) {\n case EntityDecoderState.EntityStart: {\n if (str.charCodeAt(offset) === CharCodes.NUM) {\n this.state = EntityDecoderState.NumericStart;\n this.consumed += 1;\n return this.stateNumericStart(str, offset + 1);\n }\n this.state = EntityDecoderState.NamedEntity;\n return this.stateNamedEntity(str, offset);\n }\n case EntityDecoderState.NumericStart: {\n return this.stateNumericStart(str, offset);\n }\n case EntityDecoderState.NumericDecimal: {\n return this.stateNumericDecimal(str, offset);\n }\n case EntityDecoderState.NumericHex: {\n return this.stateNumericHex(str, offset);\n }\n case EntityDecoderState.NamedEntity: {\n return this.stateNamedEntity(str, offset);\n }\n }\n }\n /**\n * Switches between the numeric decimal and hexadecimal states.\n *\n * Equivalent to the `Numeric character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericStart(str, offset) {\n if (offset >= str.length) {\n return -1;\n }\n if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {\n this.state = EntityDecoderState.NumericHex;\n this.consumed += 1;\n return this.stateNumericHex(str, offset + 1);\n }\n this.state = EntityDecoderState.NumericDecimal;\n return this.stateNumericDecimal(str, offset);\n }\n addToNumericResult(str, start, end, base) {\n if (start !== end) {\n const digitCount = end - start;\n this.result =\n this.result * Math.pow(base, digitCount) +\n parseInt(str.substr(start, digitCount), base);\n this.consumed += digitCount;\n }\n }\n /**\n * Parses a hexadecimal numeric entity.\n *\n * Equivalent to the `Hexademical character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericHex(str, offset) {\n const startIdx = offset;\n while (offset < str.length) {\n const char = str.charCodeAt(offset);\n if (isNumber(char) || isHexadecimalCharacter(char)) {\n offset += 1;\n }\n else {\n this.addToNumericResult(str, startIdx, offset, 16);\n return this.emitNumericEntity(char, 3);\n }\n }\n this.addToNumericResult(str, startIdx, offset, 16);\n return -1;\n }\n /**\n * Parses a decimal numeric entity.\n *\n * Equivalent to the `Decimal character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericDecimal(str, offset) {\n const startIdx = offset;\n while (offset < str.length) {\n const char = str.charCodeAt(offset);\n if (isNumber(char)) {\n offset += 1;\n }\n else {\n this.addToNumericResult(str, startIdx, offset, 10);\n return this.emitNumericEntity(char, 2);\n }\n }\n this.addToNumericResult(str, startIdx, offset, 10);\n return -1;\n }\n /**\n * Validate and emit a numeric entity.\n *\n * Implements the logic from the `Hexademical character reference start\n * state` and `Numeric character reference end state` in the HTML spec.\n *\n * @param lastCp The last code point of the entity. Used to see if the\n * entity was terminated with a semicolon.\n * @param expectedLength The minimum number of characters that should be\n * consumed. Used to validate that at least one digit\n * was consumed.\n * @returns The number of characters that were consumed.\n */\n emitNumericEntity(lastCp, expectedLength) {\n var _a;\n // Ensure we consumed at least one digit.\n if (this.consumed <= expectedLength) {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n // Figure out if this is a legit end of the entity\n if (lastCp === CharCodes.SEMI) {\n this.consumed += 1;\n }\n else if (this.decodeMode === DecodingMode.Strict) {\n return 0;\n }\n this.emitCodePoint(replaceCodePoint(this.result), this.consumed);\n if (this.errors) {\n if (lastCp !== CharCodes.SEMI) {\n this.errors.missingSemicolonAfterCharacterReference();\n }\n this.errors.validateNumericCharacterReference(this.result);\n }\n return this.consumed;\n }\n /**\n * Parses a named entity.\n *\n * Equivalent to the `Named character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNamedEntity(str, offset) {\n const { decodeTree } = this;\n let current = decodeTree[this.treeIndex];\n // The mask is the number of bytes of the value, including the current byte.\n let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n for (; offset < str.length; offset++, this.excess++) {\n const char = str.charCodeAt(offset);\n this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);\n if (this.treeIndex < 0) {\n return this.result === 0 ||\n // If we are parsing an attribute\n (this.decodeMode === DecodingMode.Attribute &&\n // We shouldn't have consumed any characters after the entity,\n (valueLength === 0 ||\n // And there should be no invalid characters.\n isEntityInAttributeInvalidEnd(char)))\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n current = decodeTree[this.treeIndex];\n valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n // If the branch is a value, store it and continue\n if (valueLength !== 0) {\n // If the entity is terminated by a semicolon, we are done.\n if (char === CharCodes.SEMI) {\n return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);\n }\n // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.\n if (this.decodeMode !== DecodingMode.Strict) {\n this.result = this.treeIndex;\n this.consumed += this.excess;\n this.excess = 0;\n }\n }\n }\n return -1;\n }\n /**\n * Emit a named entity that was not terminated with a semicolon.\n *\n * @returns The number of characters consumed.\n */\n emitNotTerminatedNamedEntity() {\n var _a;\n const { result, decodeTree } = this;\n const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;\n this.emitNamedEntityData(result, valueLength, this.consumed);\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();\n return this.consumed;\n }\n /**\n * Emit a named entity.\n *\n * @param result The index of the entity in the decode tree.\n * @param valueLength The number of bytes in the entity.\n * @param consumed The number of characters consumed.\n *\n * @returns The number of characters consumed.\n */\n emitNamedEntityData(result, valueLength, consumed) {\n const { decodeTree } = this;\n this.emitCodePoint(valueLength === 1\n ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH\n : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // For multi-byte values, we need to emit the second byte.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }\n /**\n * Signal to the parser that the end of the input was reached.\n *\n * Remaining data will be emitted and relevant errors will be produced.\n *\n * @returns The number of characters consumed.\n */\n end() {\n var _a;\n switch (this.state) {\n case EntityDecoderState.NamedEntity: {\n // Emit a named entity if we have one.\n return this.result !== 0 &&\n (this.decodeMode !== DecodingMode.Attribute ||\n this.result === this.treeIndex)\n ? this.emitNotTerminatedNamedEntity()\n : 0;\n }\n // Otherwise, emit a numeric entity if we have one.\n case EntityDecoderState.NumericDecimal: {\n return this.emitNumericEntity(0, 2);\n }\n case EntityDecoderState.NumericHex: {\n return this.emitNumericEntity(0, 3);\n }\n case EntityDecoderState.NumericStart: {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n case EntityDecoderState.EntityStart: {\n // Return 0 if we have no entity.\n return 0;\n }\n }\n }\n}\n/**\n * Creates a function that decodes entities in a string.\n *\n * @param decodeTree The decode tree.\n * @returns A function that decodes entities in a string.\n */\nfunction getDecoder(decodeTree) {\n let ret = \"\";\n const decoder = new EntityDecoder(decodeTree, (str) => (ret += fromCodePoint(str)));\n return function decodeWithTrie(str, decodeMode) {\n let lastIndex = 0;\n let offset = 0;\n while ((offset = str.indexOf(\"&\", offset)) >= 0) {\n ret += str.slice(lastIndex, offset);\n decoder.startEntity(decodeMode);\n const len = decoder.write(str, \n // Skip the \"&\"\n offset + 1);\n if (len < 0) {\n lastIndex = offset + decoder.end();\n break;\n }\n lastIndex = offset + len;\n // If `len` is 0, skip the current `&` and continue.\n offset = len === 0 ? lastIndex + 1 : lastIndex;\n }\n const result = ret + str.slice(lastIndex);\n // Make sure we don't keep a reference to the final string.\n ret = \"\";\n return result;\n };\n}\n/**\n * Determines the branch of the current node that is taken given the current\n * character. This function is used to traverse the trie.\n *\n * @param decodeTree The trie.\n * @param current The current node.\n * @param nodeIdx The index right after the current node and its value.\n * @param char The current character.\n * @returns The index of the next node, or -1 if no branch is taken.\n */\nexport function determineBranch(decodeTree, current, nodeIdx, char) {\n const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n const jumpOffset = current & BinTrieFlags.JUMP_TABLE;\n // Case 1: Single branch encoded in jump offset\n if (branchCount === 0) {\n return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;\n }\n // Case 2: Multiple branches encoded in jump table\n if (jumpOffset) {\n const value = char - jumpOffset;\n return value < 0 || value >= branchCount\n ? -1\n : decodeTree[nodeIdx + value] - 1;\n }\n // Case 3: Multiple branches encoded in dictionary\n // Binary search for the character.\n let lo = nodeIdx;\n let hi = lo + branchCount - 1;\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n const midVal = decodeTree[mid];\n if (midVal < char) {\n lo = mid + 1;\n }\n else if (midVal > char) {\n hi = mid - 1;\n }\n else {\n return decodeTree[mid + branchCount];\n }\n }\n return -1;\n}\nconst htmlDecoder = getDecoder(htmlDecodeTree);\nconst xmlDecoder = getDecoder(xmlDecodeTree);\n/**\n * Decodes an HTML string.\n *\n * @param str The string to decode.\n * @param mode The decoding mode.\n * @returns The decoded string.\n */\nexport function decodeHTML(str, mode = DecodingMode.Legacy) {\n return htmlDecoder(str, mode);\n}\n/**\n * Decodes an HTML string in an attribute.\n *\n * @param str The string to decode.\n * @returns The decoded string.\n */\nexport function decodeHTMLAttribute(str) {\n return htmlDecoder(str, DecodingMode.Attribute);\n}\n/**\n * Decodes an HTML string, requiring all entities to be terminated by a semicolon.\n *\n * @param str The string to decode.\n * @returns The decoded string.\n */\nexport function decodeHTMLStrict(str) {\n return htmlDecoder(str, DecodingMode.Strict);\n}\n/**\n * Decodes an XML string, requiring all entities to be terminated by a semicolon.\n *\n * @param str The string to decode.\n * @returns The decoded string.\n */\nexport function decodeXML(str) {\n return xmlDecoder(str, DecodingMode.Strict);\n}\n//# sourceMappingURL=decode.js.map","// Generated using scripts/write-encode-map.ts\nfunction restoreDiff(arr) {\n for (let i = 1; i < arr.length; i++) {\n arr[i][0] += arr[i - 1][0] + 1;\n }\n return arr;\n}\n// prettier-ignore\nexport default new Map(/* #__PURE__ */ restoreDiff([[9, \"	\"], [0, \"
\"], [22, \"!\"], [0, \""\"], [0, \"#\"], [0, \"$\"], [0, \"%\"], [0, \"&\"], [0, \"'\"], [0, \"(\"], [0, \")\"], [0, \"*\"], [0, \"+\"], [0, \",\"], [1, \".\"], [0, \"/\"], [10, \":\"], [0, \";\"], [0, { v: \"<\", n: 8402, o: \"<⃒\" }], [0, { v: \"=\", n: 8421, o: \"=⃥\" }], [0, { v: \">\", n: 8402, o: \">⃒\" }], [0, \"?\"], [0, \"@\"], [26, \"[\"], [0, \"\\"], [0, \"]\"], [0, \"^\"], [0, \"_\"], [0, \"`\"], [5, { n: 106, o: \"fj\" }], [20, \"{\"], [0, \"|\"], [0, \"}\"], [34, \" \"], [0, \"¡\"], [0, \"¢\"], [0, \"£\"], [0, \"¤\"], [0, \"¥\"], [0, \"¦\"], [0, \"§\"], [0, \"¨\"], [0, \"©\"], [0, \"ª\"], [0, \"«\"], [0, \"¬\"], [0, \"­\"], [0, \"®\"], [0, \"¯\"], [0, \"°\"], [0, \"±\"], [0, \"²\"], [0, \"³\"], [0, \"´\"], [0, \"µ\"], [0, \"¶\"], [0, \"·\"], [0, \"¸\"], [0, \"¹\"], [0, \"º\"], [0, \"»\"], [0, \"¼\"], [0, \"½\"], [0, \"¾\"], [0, \"¿\"], [0, \"À\"], [0, \"Á\"], [0, \"Â\"], [0, \"Ã\"], [0, \"Ä\"], [0, \"Å\"], [0, \"Æ\"], [0, \"Ç\"], [0, \"È\"], [0, \"É\"], [0, \"Ê\"], [0, \"Ë\"], [0, \"Ì\"], [0, \"Í\"], [0, \"Î\"], [0, \"Ï\"], [0, \"Ð\"], [0, \"Ñ\"], [0, \"Ò\"], [0, \"Ó\"], [0, \"Ô\"], [0, \"Õ\"], [0, \"Ö\"], [0, \"×\"], [0, \"Ø\"], [0, \"Ù\"], [0, \"Ú\"], [0, \"Û\"], [0, \"Ü\"], [0, \"Ý\"], [0, \"Þ\"], [0, \"ß\"], [0, \"à\"], [0, \"á\"], [0, \"â\"], [0, \"ã\"], [0, \"ä\"], [0, \"å\"], [0, \"æ\"], [0, \"ç\"], [0, \"è\"], [0, \"é\"], [0, \"ê\"], [0, \"ë\"], [0, \"ì\"], [0, \"í\"], [0, \"î\"], [0, \"ï\"], [0, \"ð\"], [0, \"ñ\"], [0, \"ò\"], [0, \"ó\"], [0, \"ô\"], [0, \"õ\"], [0, \"ö\"], [0, \"÷\"], [0, \"ø\"], [0, \"ù\"], [0, \"ú\"], [0, \"û\"], [0, \"ü\"], [0, \"ý\"], [0, \"þ\"], [0, \"ÿ\"], [0, \"Ā\"], [0, \"ā\"], [0, \"Ă\"], [0, \"ă\"], [0, \"Ą\"], [0, \"ą\"], [0, \"Ć\"], [0, \"ć\"], [0, \"Ĉ\"], [0, \"ĉ\"], [0, \"Ċ\"], [0, \"ċ\"], [0, \"Č\"], [0, \"č\"], [0, \"Ď\"], [0, \"ď\"], [0, \"Đ\"], [0, \"đ\"], [0, \"Ē\"], [0, \"ē\"], [2, \"Ė\"], [0, \"ė\"], [0, \"Ę\"], [0, \"ę\"], [0, \"Ě\"], [0, \"ě\"], [0, \"Ĝ\"], [0, \"ĝ\"], [0, \"Ğ\"], [0, \"ğ\"], [0, \"Ġ\"], [0, \"ġ\"], [0, \"Ģ\"], [1, \"Ĥ\"], [0, \"ĥ\"], [0, \"Ħ\"], [0, \"ħ\"], [0, \"Ĩ\"], [0, \"ĩ\"], [0, \"Ī\"], [0, \"ī\"], [2, \"Į\"], [0, \"į\"], [0, \"İ\"], [0, \"ı\"], [0, \"IJ\"], [0, \"ij\"], [0, \"Ĵ\"], [0, \"ĵ\"], [0, \"Ķ\"], [0, \"ķ\"], [0, \"ĸ\"], [0, \"Ĺ\"], [0, \"ĺ\"], [0, \"Ļ\"], [0, \"ļ\"], [0, \"Ľ\"], [0, \"ľ\"], [0, \"Ŀ\"], [0, \"ŀ\"], [0, \"Ł\"], [0, \"ł\"], [0, \"Ń\"], [0, \"ń\"], [0, \"Ņ\"], [0, \"ņ\"], [0, \"Ň\"], [0, \"ň\"], [0, \"ʼn\"], [0, \"Ŋ\"], [0, \"ŋ\"], [0, \"Ō\"], [0, \"ō\"], [2, \"Ő\"], [0, \"ő\"], [0, \"Œ\"], [0, \"œ\"], [0, \"Ŕ\"], [0, \"ŕ\"], [0, \"Ŗ\"], [0, \"ŗ\"], [0, \"Ř\"], [0, \"ř\"], [0, \"Ś\"], [0, \"ś\"], [0, \"Ŝ\"], [0, \"ŝ\"], [0, \"Ş\"], [0, \"ş\"], [0, \"Š\"], [0, \"š\"], [0, \"Ţ\"], [0, \"ţ\"], [0, \"Ť\"], [0, \"ť\"], [0, \"Ŧ\"], [0, \"ŧ\"], [0, \"Ũ\"], [0, \"ũ\"], [0, \"Ū\"], [0, \"ū\"], [0, \"Ŭ\"], [0, \"ŭ\"], [0, \"Ů\"], [0, \"ů\"], [0, \"Ű\"], [0, \"ű\"], [0, \"Ų\"], [0, \"ų\"], [0, \"Ŵ\"], [0, \"ŵ\"], [0, \"Ŷ\"], [0, \"ŷ\"], [0, \"Ÿ\"], [0, \"Ź\"], [0, \"ź\"], [0, \"Ż\"], [0, \"ż\"], [0, \"Ž\"], [0, \"ž\"], [19, \"ƒ\"], [34, \"Ƶ\"], [63, \"ǵ\"], [65, \"ȷ\"], [142, \"ˆ\"], [0, \"ˇ\"], [16, \"˘\"], [0, \"˙\"], [0, \"˚\"], [0, \"˛\"], [0, \"˜\"], [0, \"˝\"], [51, \"̑\"], [127, \"Α\"], [0, \"Β\"], [0, \"Γ\"], [0, \"Δ\"], [0, \"Ε\"], [0, \"Ζ\"], [0, \"Η\"], [0, \"Θ\"], [0, \"Ι\"], [0, \"Κ\"], [0, \"Λ\"], [0, \"Μ\"], [0, \"Ν\"], [0, \"Ξ\"], [0, \"Ο\"], [0, \"Π\"], [0, \"Ρ\"], [1, \"Σ\"], [0, \"Τ\"], [0, \"Υ\"], [0, \"Φ\"], [0, \"Χ\"], [0, \"Ψ\"], [0, \"Ω\"], [7, \"α\"], [0, \"β\"], [0, \"γ\"], [0, \"δ\"], [0, \"ε\"], [0, \"ζ\"], [0, \"η\"], [0, \"θ\"], [0, \"ι\"], [0, \"κ\"], [0, \"λ\"], [0, \"μ\"], [0, \"ν\"], [0, \"ξ\"], [0, \"ο\"], [0, \"π\"], [0, \"ρ\"], [0, \"ς\"], [0, \"σ\"], [0, \"τ\"], [0, \"υ\"], [0, \"φ\"], [0, \"χ\"], [0, \"ψ\"], [0, \"ω\"], [7, \"ϑ\"], [0, \"ϒ\"], [2, \"ϕ\"], [0, \"ϖ\"], [5, \"Ϝ\"], [0, \"ϝ\"], [18, \"ϰ\"], [0, \"ϱ\"], [3, \"ϵ\"], [0, \"϶\"], [10, \"Ё\"], [0, \"Ђ\"], [0, \"Ѓ\"], [0, \"Є\"], [0, \"Ѕ\"], [0, \"І\"], [0, \"Ї\"], [0, \"Ј\"], [0, \"Љ\"], [0, \"Њ\"], [0, \"Ћ\"], [0, \"Ќ\"], [1, \"Ў\"], [0, \"Џ\"], [0, \"А\"], [0, \"Б\"], [0, \"В\"], [0, \"Г\"], [0, \"Д\"], [0, \"Е\"], [0, \"Ж\"], [0, \"З\"], [0, \"И\"], [0, \"Й\"], [0, \"К\"], [0, \"Л\"], [0, \"М\"], [0, \"Н\"], [0, \"О\"], [0, \"П\"], [0, \"Р\"], [0, \"С\"], [0, \"Т\"], [0, \"У\"], [0, \"Ф\"], [0, \"Х\"], [0, \"Ц\"], [0, \"Ч\"], [0, \"Ш\"], [0, \"Щ\"], [0, \"Ъ\"], [0, \"Ы\"], [0, \"Ь\"], [0, \"Э\"], [0, \"Ю\"], [0, \"Я\"], [0, \"а\"], [0, \"б\"], [0, \"в\"], [0, \"г\"], [0, \"д\"], [0, \"е\"], [0, \"ж\"], [0, \"з\"], [0, \"и\"], [0, \"й\"], [0, \"к\"], [0, \"л\"], [0, \"м\"], [0, \"н\"], [0, \"о\"], [0, \"п\"], [0, \"р\"], [0, \"с\"], [0, \"т\"], [0, \"у\"], [0, \"ф\"], [0, \"х\"], [0, \"ц\"], [0, \"ч\"], [0, \"ш\"], [0, \"щ\"], [0, \"ъ\"], [0, \"ы\"], [0, \"ь\"], [0, \"э\"], [0, \"ю\"], [0, \"я\"], [1, \"ё\"], [0, \"ђ\"], [0, \"ѓ\"], [0, \"є\"], [0, \"ѕ\"], [0, \"і\"], [0, \"ї\"], [0, \"ј\"], [0, \"љ\"], [0, \"њ\"], [0, \"ћ\"], [0, \"ќ\"], [1, \"ў\"], [0, \"џ\"], [7074, \" \"], [0, \" \"], [0, \" \"], [0, \" \"], [1, \" \"], [0, \" \"], [0, \" \"], [0, \" \"], [0, \"​\"], [0, \"‌\"], [0, \"‍\"], [0, \"‎\"], [0, \"‏\"], [0, \"‐\"], [2, \"–\"], [0, \"—\"], [0, \"―\"], [0, \"‖\"], [1, \"‘\"], [0, \"’\"], [0, \"‚\"], [1, \"“\"], [0, \"”\"], [0, \"„\"], [1, \"†\"], [0, \"‡\"], [0, \"•\"], [2, \"‥\"], [0, \"…\"], [9, \"‰\"], [0, \"‱\"], [0, \"′\"], [0, \"″\"], [0, \"‴\"], [0, \"‵\"], [3, \"‹\"], [0, \"›\"], [3, \"‾\"], [2, \"⁁\"], [1, \"⁃\"], [0, \"⁄\"], [10, \"⁏\"], [7, \"⁗\"], [7, { v: \" \", n: 8202, o: \"  \" }], [0, \"⁠\"], [0, \"⁡\"], [0, \"⁢\"], [0, \"⁣\"], [72, \"€\"], [46, \"⃛\"], [0, \"⃜\"], [37, \"ℂ\"], [2, \"℅\"], [4, \"ℊ\"], [0, \"ℋ\"], [0, \"ℌ\"], [0, \"ℍ\"], [0, \"ℎ\"], [0, \"ℏ\"], [0, \"ℐ\"], [0, \"ℑ\"], [0, \"ℒ\"], [0, \"ℓ\"], [1, \"ℕ\"], [0, \"№\"], [0, \"℗\"], [0, \"℘\"], [0, \"ℙ\"], [0, \"ℚ\"], [0, \"ℛ\"], [0, \"ℜ\"], [0, \"ℝ\"], [0, \"℞\"], [3, \"™\"], [1, \"ℤ\"], [2, \"℧\"], [0, \"ℨ\"], [0, \"℩\"], [2, \"ℬ\"], [0, \"ℭ\"], [1, \"ℯ\"], [0, \"ℰ\"], [0, \"ℱ\"], [1, \"ℳ\"], [0, \"ℴ\"], [0, \"ℵ\"], [0, \"ℶ\"], [0, \"ℷ\"], [0, \"ℸ\"], [12, \"ⅅ\"], [0, \"ⅆ\"], [0, \"ⅇ\"], [0, \"ⅈ\"], [10, \"⅓\"], [0, \"⅔\"], [0, \"⅕\"], [0, \"⅖\"], [0, \"⅗\"], [0, \"⅘\"], [0, \"⅙\"], [0, \"⅚\"], [0, \"⅛\"], [0, \"⅜\"], [0, \"⅝\"], [0, \"⅞\"], [49, \"←\"], [0, \"↑\"], [0, \"→\"], [0, \"↓\"], [0, \"↔\"], [0, \"↕\"], [0, \"↖\"], [0, \"↗\"], [0, \"↘\"], [0, \"↙\"], [0, \"↚\"], [0, \"↛\"], [1, { v: \"↝\", n: 824, o: \"↝̸\" }], [0, \"↞\"], [0, \"↟\"], [0, \"↠\"], [0, \"↡\"], [0, \"↢\"], [0, \"↣\"], [0, \"↤\"], [0, \"↥\"], [0, \"↦\"], [0, \"↧\"], [1, \"↩\"], [0, \"↪\"], [0, \"↫\"], [0, \"↬\"], [0, \"↭\"], [0, \"↮\"], [1, \"↰\"], [0, \"↱\"], [0, \"↲\"], [0, \"↳\"], [1, \"↵\"], [0, \"↶\"], [0, \"↷\"], [2, \"↺\"], [0, \"↻\"], [0, \"↼\"], [0, \"↽\"], [0, \"↾\"], [0, \"↿\"], [0, \"⇀\"], [0, \"⇁\"], [0, \"⇂\"], [0, \"⇃\"], [0, \"⇄\"], [0, \"⇅\"], [0, \"⇆\"], [0, \"⇇\"], [0, \"⇈\"], [0, \"⇉\"], [0, \"⇊\"], [0, \"⇋\"], [0, \"⇌\"], [0, \"⇍\"], [0, \"⇎\"], [0, \"⇏\"], [0, \"⇐\"], [0, \"⇑\"], [0, \"⇒\"], [0, \"⇓\"], [0, \"⇔\"], [0, \"⇕\"], [0, \"⇖\"], [0, \"⇗\"], [0, \"⇘\"], [0, \"⇙\"], [0, \"⇚\"], [0, \"⇛\"], [1, \"⇝\"], [6, \"⇤\"], [0, \"⇥\"], [15, \"⇵\"], [7, \"⇽\"], [0, \"⇾\"], [0, \"⇿\"], [0, \"∀\"], [0, \"∁\"], [0, { v: \"∂\", n: 824, o: \"∂̸\" }], [0, \"∃\"], [0, \"∄\"], [0, \"∅\"], [1, \"∇\"], [0, \"∈\"], [0, \"∉\"], [1, \"∋\"], [0, \"∌\"], [2, \"∏\"], [0, \"∐\"], [0, \"∑\"], [0, \"−\"], [0, \"∓\"], [0, \"∔\"], [1, \"∖\"], [0, \"∗\"], [0, \"∘\"], [1, \"√\"], [2, \"∝\"], [0, \"∞\"], [0, \"∟\"], [0, { v: \"∠\", n: 8402, o: \"∠⃒\" }], [0, \"∡\"], [0, \"∢\"], [0, \"∣\"], [0, \"∤\"], [0, \"∥\"], [0, \"∦\"], [0, \"∧\"], [0, \"∨\"], [0, { v: \"∩\", n: 65024, o: \"∩︀\" }], [0, { v: \"∪\", n: 65024, o: \"∪︀\" }], [0, \"∫\"], [0, \"∬\"], [0, \"∭\"], [0, \"∮\"], [0, \"∯\"], [0, \"∰\"], [0, \"∱\"], [0, \"∲\"], [0, \"∳\"], [0, \"∴\"], [0, \"∵\"], [0, \"∶\"], [0, \"∷\"], [0, \"∸\"], [1, \"∺\"], [0, \"∻\"], [0, { v: \"∼\", n: 8402, o: \"∼⃒\" }], [0, { v: \"∽\", n: 817, o: \"∽̱\" }], [0, { v: \"∾\", n: 819, o: \"∾̳\" }], [0, \"∿\"], [0, \"≀\"], [0, \"≁\"], [0, { v: \"≂\", n: 824, o: \"≂̸\" }], [0, \"≃\"], [0, \"≄\"], [0, \"≅\"], [0, \"≆\"], [0, \"≇\"], [0, \"≈\"], [0, \"≉\"], [0, \"≊\"], [0, { v: \"≋\", n: 824, o: \"≋̸\" }], [0, \"≌\"], [0, { v: \"≍\", n: 8402, o: \"≍⃒\" }], [0, { v: \"≎\", n: 824, o: \"≎̸\" }], [0, { v: \"≏\", n: 824, o: \"≏̸\" }], [0, { v: \"≐\", n: 824, o: \"≐̸\" }], [0, \"≑\"], [0, \"≒\"], [0, \"≓\"], [0, \"≔\"], [0, \"≕\"], [0, \"≖\"], [0, \"≗\"], [1, \"≙\"], [0, \"≚\"], [1, \"≜\"], [2, \"≟\"], [0, \"≠\"], [0, { v: \"≡\", n: 8421, o: \"≡⃥\" }], [0, \"≢\"], [1, { v: \"≤\", n: 8402, o: \"≤⃒\" }], [0, { v: \"≥\", n: 8402, o: \"≥⃒\" }], [0, { v: \"≦\", n: 824, o: \"≦̸\" }], [0, { v: \"≧\", n: 824, o: \"≧̸\" }], [0, { v: \"≨\", n: 65024, o: \"≨︀\" }], [0, { v: \"≩\", n: 65024, o: \"≩︀\" }], [0, { v: \"≪\", n: new Map(/* #__PURE__ */ restoreDiff([[824, \"≪̸\"], [7577, \"≪⃒\"]])) }], [0, { v: \"≫\", n: new Map(/* #__PURE__ */ restoreDiff([[824, \"≫̸\"], [7577, \"≫⃒\"]])) }], [0, \"≬\"], [0, \"≭\"], [0, \"≮\"], [0, \"≯\"], [0, \"≰\"], [0, \"≱\"], [0, \"≲\"], [0, \"≳\"], [0, \"≴\"], [0, \"≵\"], [0, \"≶\"], [0, \"≷\"], [0, \"≸\"], [0, \"≹\"], [0, \"≺\"], [0, \"≻\"], [0, \"≼\"], [0, \"≽\"], [0, \"≾\"], [0, { v: \"≿\", n: 824, o: \"≿̸\" }], [0, \"⊀\"], [0, \"⊁\"], [0, { v: \"⊂\", n: 8402, o: \"⊂⃒\" }], [0, { v: \"⊃\", n: 8402, o: \"⊃⃒\" }], [0, \"⊄\"], [0, \"⊅\"], [0, \"⊆\"], [0, \"⊇\"], [0, \"⊈\"], [0, \"⊉\"], [0, { v: \"⊊\", n: 65024, o: \"⊊︀\" }], [0, { v: \"⊋\", n: 65024, o: \"⊋︀\" }], [1, \"⊍\"], [0, \"⊎\"], [0, { v: \"⊏\", n: 824, o: \"⊏̸\" }], [0, { v: \"⊐\", n: 824, o: \"⊐̸\" }], [0, \"⊑\"], [0, \"⊒\"], [0, { v: \"⊓\", n: 65024, o: \"⊓︀\" }], [0, { v: \"⊔\", n: 65024, o: \"⊔︀\" }], [0, \"⊕\"], [0, \"⊖\"], [0, \"⊗\"], [0, \"⊘\"], [0, \"⊙\"], [0, \"⊚\"], [0, \"⊛\"], [1, \"⊝\"], [0, \"⊞\"], [0, \"⊟\"], [0, \"⊠\"], [0, \"⊡\"], [0, \"⊢\"], [0, \"⊣\"], [0, \"⊤\"], [0, \"⊥\"], [1, \"⊧\"], [0, \"⊨\"], [0, \"⊩\"], [0, \"⊪\"], [0, \"⊫\"], [0, \"⊬\"], [0, \"⊭\"], [0, \"⊮\"], [0, \"⊯\"], [0, \"⊰\"], [1, \"⊲\"], [0, \"⊳\"], [0, { v: \"⊴\", n: 8402, o: \"⊴⃒\" }], [0, { v: \"⊵\", n: 8402, o: \"⊵⃒\" }], [0, \"⊶\"], [0, \"⊷\"], [0, \"⊸\"], [0, \"⊹\"], [0, \"⊺\"], [0, \"⊻\"], [1, \"⊽\"], [0, \"⊾\"], [0, \"⊿\"], [0, \"⋀\"], [0, \"⋁\"], [0, \"⋂\"], [0, \"⋃\"], [0, \"⋄\"], [0, \"⋅\"], [0, \"⋆\"], [0, \"⋇\"], [0, \"⋈\"], [0, \"⋉\"], [0, \"⋊\"], [0, \"⋋\"], [0, \"⋌\"], [0, \"⋍\"], [0, \"⋎\"], [0, \"⋏\"], [0, \"⋐\"], [0, \"⋑\"], [0, \"⋒\"], [0, \"⋓\"], [0, \"⋔\"], [0, \"⋕\"], [0, \"⋖\"], [0, \"⋗\"], [0, { v: \"⋘\", n: 824, o: \"⋘̸\" }], [0, { v: \"⋙\", n: 824, o: \"⋙̸\" }], [0, { v: \"⋚\", n: 65024, o: \"⋚︀\" }], [0, { v: \"⋛\", n: 65024, o: \"⋛︀\" }], [2, \"⋞\"], [0, \"⋟\"], [0, \"⋠\"], [0, \"⋡\"], [0, \"⋢\"], [0, \"⋣\"], [2, \"⋦\"], [0, \"⋧\"], [0, \"⋨\"], [0, \"⋩\"], [0, \"⋪\"], [0, \"⋫\"], [0, \"⋬\"], [0, \"⋭\"], [0, \"⋮\"], [0, \"⋯\"], [0, \"⋰\"], [0, \"⋱\"], [0, \"⋲\"], [0, \"⋳\"], [0, \"⋴\"], [0, { v: \"⋵\", n: 824, o: \"⋵̸\" }], [0, \"⋶\"], [0, \"⋷\"], [1, { v: \"⋹\", n: 824, o: \"⋹̸\" }], [0, \"⋺\"], [0, \"⋻\"], [0, \"⋼\"], [0, \"⋽\"], [0, \"⋾\"], [6, \"⌅\"], [0, \"⌆\"], [1, \"⌈\"], [0, \"⌉\"], [0, \"⌊\"], [0, \"⌋\"], [0, \"⌌\"], [0, \"⌍\"], [0, \"⌎\"], [0, \"⌏\"], [0, \"⌐\"], [1, \"⌒\"], [0, \"⌓\"], [1, \"⌕\"], [0, \"⌖\"], [5, \"⌜\"], [0, \"⌝\"], [0, \"⌞\"], [0, \"⌟\"], [2, \"⌢\"], [0, \"⌣\"], [9, \"⌭\"], [0, \"⌮\"], [7, \"⌶\"], [6, \"⌽\"], [1, \"⌿\"], [60, \"⍼\"], [51, \"⎰\"], [0, \"⎱\"], [2, \"⎴\"], [0, \"⎵\"], [0, \"⎶\"], [37, \"⏜\"], [0, \"⏝\"], [0, \"⏞\"], [0, \"⏟\"], [2, \"⏢\"], [4, \"⏧\"], [59, \"␣\"], [164, \"Ⓢ\"], [55, \"─\"], [1, \"│\"], [9, \"┌\"], [3, \"┐\"], [3, \"└\"], [3, \"┘\"], [3, \"├\"], [7, \"┤\"], [7, \"┬\"], [7, \"┴\"], [7, \"┼\"], [19, \"═\"], [0, \"║\"], [0, \"╒\"], [0, \"╓\"], [0, \"╔\"], [0, \"╕\"], [0, \"╖\"], [0, \"╗\"], [0, \"╘\"], [0, \"╙\"], [0, \"╚\"], [0, \"╛\"], [0, \"╜\"], [0, \"╝\"], [0, \"╞\"], [0, \"╟\"], [0, \"╠\"], [0, \"╡\"], [0, \"╢\"], [0, \"╣\"], [0, \"╤\"], [0, \"╥\"], [0, \"╦\"], [0, \"╧\"], [0, \"╨\"], [0, \"╩\"], [0, \"╪\"], [0, \"╫\"], [0, \"╬\"], [19, \"▀\"], [3, \"▄\"], [3, \"█\"], [8, \"░\"], [0, \"▒\"], [0, \"▓\"], [13, \"□\"], [8, \"▪\"], [0, \"▫\"], [1, \"▭\"], [0, \"▮\"], [2, \"▱\"], [1, \"△\"], [0, \"▴\"], [0, \"▵\"], [2, \"▸\"], [0, \"▹\"], [3, \"▽\"], [0, \"▾\"], [0, \"▿\"], [2, \"◂\"], [0, \"◃\"], [6, \"◊\"], [0, \"○\"], [32, \"◬\"], [2, \"◯\"], [8, \"◸\"], [0, \"◹\"], [0, \"◺\"], [0, \"◻\"], [0, \"◼\"], [8, \"★\"], [0, \"☆\"], [7, \"☎\"], [49, \"♀\"], [1, \"♂\"], [29, \"♠\"], [2, \"♣\"], [1, \"♥\"], [0, \"♦\"], [3, \"♪\"], [2, \"♭\"], [0, \"♮\"], [0, \"♯\"], [163, \"✓\"], [3, \"✗\"], [8, \"✠\"], [21, \"✶\"], [33, \"❘\"], [25, \"❲\"], [0, \"❳\"], [84, \"⟈\"], [0, \"⟉\"], [28, \"⟦\"], [0, \"⟧\"], [0, \"⟨\"], [0, \"⟩\"], [0, \"⟪\"], [0, \"⟫\"], [0, \"⟬\"], [0, \"⟭\"], [7, \"⟵\"], [0, \"⟶\"], [0, \"⟷\"], [0, \"⟸\"], [0, \"⟹\"], [0, \"⟺\"], [1, \"⟼\"], [2, \"⟿\"], [258, \"⤂\"], [0, \"⤃\"], [0, \"⤄\"], [0, \"⤅\"], [6, \"⤌\"], [0, \"⤍\"], [0, \"⤎\"], [0, \"⤏\"], [0, \"⤐\"], [0, \"⤑\"], [0, \"⤒\"], [0, \"⤓\"], [2, \"⤖\"], [2, \"⤙\"], [0, \"⤚\"], [0, \"⤛\"], [0, \"⤜\"], [0, \"⤝\"], [0, \"⤞\"], [0, \"⤟\"], [0, \"⤠\"], [2, \"⤣\"], [0, \"⤤\"], [0, \"⤥\"], [0, \"⤦\"], [0, \"⤧\"], [0, \"⤨\"], [0, \"⤩\"], [0, \"⤪\"], [8, { v: \"⤳\", n: 824, o: \"⤳̸\" }], [1, \"⤵\"], [0, \"⤶\"], [0, \"⤷\"], [0, \"⤸\"], [0, \"⤹\"], [2, \"⤼\"], [0, \"⤽\"], [7, \"⥅\"], [2, \"⥈\"], [0, \"⥉\"], [0, \"⥊\"], [0, \"⥋\"], [2, \"⥎\"], [0, \"⥏\"], [0, \"⥐\"], [0, \"⥑\"], [0, \"⥒\"], [0, \"⥓\"], [0, \"⥔\"], [0, \"⥕\"], [0, \"⥖\"], [0, \"⥗\"], [0, \"⥘\"], [0, \"⥙\"], [0, \"⥚\"], [0, \"⥛\"], [0, \"⥜\"], [0, \"⥝\"], [0, \"⥞\"], [0, \"⥟\"], [0, \"⥠\"], [0, \"⥡\"], [0, \"⥢\"], [0, \"⥣\"], [0, \"⥤\"], [0, \"⥥\"], [0, \"⥦\"], [0, \"⥧\"], [0, \"⥨\"], [0, \"⥩\"], [0, \"⥪\"], [0, \"⥫\"], [0, \"⥬\"], [0, \"⥭\"], [0, \"⥮\"], [0, \"⥯\"], [0, \"⥰\"], [0, \"⥱\"], [0, \"⥲\"], [0, \"⥳\"], [0, \"⥴\"], [0, \"⥵\"], [0, \"⥶\"], [1, \"⥸\"], [0, \"⥹\"], [1, \"⥻\"], [0, \"⥼\"], [0, \"⥽\"], [0, \"⥾\"], [0, \"⥿\"], [5, \"⦅\"], [0, \"⦆\"], [4, \"⦋\"], [0, \"⦌\"], [0, \"⦍\"], [0, \"⦎\"], [0, \"⦏\"], [0, \"⦐\"], [0, \"⦑\"], [0, \"⦒\"], [0, \"⦓\"], [0, \"⦔\"], [0, \"⦕\"], [0, \"⦖\"], [3, \"⦚\"], [1, \"⦜\"], [0, \"⦝\"], [6, \"⦤\"], [0, \"⦥\"], [0, \"⦦\"], [0, \"⦧\"], [0, \"⦨\"], [0, \"⦩\"], [0, \"⦪\"], [0, \"⦫\"], [0, \"⦬\"], [0, \"⦭\"], [0, \"⦮\"], [0, \"⦯\"], [0, \"⦰\"], [0, \"⦱\"], [0, \"⦲\"], [0, \"⦳\"], [0, \"⦴\"], [0, \"⦵\"], [0, \"⦶\"], [0, \"⦷\"], [1, \"⦹\"], [1, \"⦻\"], [0, \"⦼\"], [1, \"⦾\"], [0, \"⦿\"], [0, \"⧀\"], [0, \"⧁\"], [0, \"⧂\"], [0, \"⧃\"], [0, \"⧄\"], [0, \"⧅\"], [3, \"⧉\"], [3, \"⧍\"], [0, \"⧎\"], [0, { v: \"⧏\", n: 824, o: \"⧏̸\" }], [0, { v: \"⧐\", n: 824, o: \"⧐̸\" }], [11, \"⧜\"], [0, \"⧝\"], [0, \"⧞\"], [4, \"⧣\"], [0, \"⧤\"], [0, \"⧥\"], [5, \"⧫\"], [8, \"⧴\"], [1, \"⧶\"], [9, \"⨀\"], [0, \"⨁\"], [0, \"⨂\"], [1, \"⨄\"], [1, \"⨆\"], [5, \"⨌\"], [0, \"⨍\"], [2, \"⨐\"], [0, \"⨑\"], [0, \"⨒\"], [0, \"⨓\"], [0, \"⨔\"], [0, \"⨕\"], [0, \"⨖\"], [0, \"⨗\"], [10, \"⨢\"], [0, \"⨣\"], [0, \"⨤\"], [0, \"⨥\"], [0, \"⨦\"], [0, \"⨧\"], [1, \"⨩\"], [0, \"⨪\"], [2, \"⨭\"], [0, \"⨮\"], [0, \"⨯\"], [0, \"⨰\"], [0, \"⨱\"], [1, \"⨳\"], [0, \"⨴\"], [0, \"⨵\"], [0, \"⨶\"], [0, \"⨷\"], [0, \"⨸\"], [0, \"⨹\"], [0, \"⨺\"], [0, \"⨻\"], [0, \"⨼\"], [2, \"⨿\"], [0, \"⩀\"], [1, \"⩂\"], [0, \"⩃\"], [0, \"⩄\"], [0, \"⩅\"], [0, \"⩆\"], [0, \"⩇\"], [0, \"⩈\"], [0, \"⩉\"], [0, \"⩊\"], [0, \"⩋\"], [0, \"⩌\"], [0, \"⩍\"], [2, \"⩐\"], [2, \"⩓\"], [0, \"⩔\"], [0, \"⩕\"], [0, \"⩖\"], [0, \"⩗\"], [0, \"⩘\"], [1, \"⩚\"], [0, \"⩛\"], [0, \"⩜\"], [0, \"⩝\"], [1, \"⩟\"], [6, \"⩦\"], [3, \"⩪\"], [2, { v: \"⩭\", n: 824, o: \"⩭̸\" }], [0, \"⩮\"], [0, \"⩯\"], [0, { v: \"⩰\", n: 824, o: \"⩰̸\" }], [0, \"⩱\"], [0, \"⩲\"], [0, \"⩳\"], [0, \"⩴\"], [0, \"⩵\"], [1, \"⩷\"], [0, \"⩸\"], [0, \"⩹\"], [0, \"⩺\"], [0, \"⩻\"], [0, \"⩼\"], [0, { v: \"⩽\", n: 824, o: \"⩽̸\" }], [0, { v: \"⩾\", n: 824, o: \"⩾̸\" }], [0, \"⩿\"], [0, \"⪀\"], [0, \"⪁\"], [0, \"⪂\"], [0, \"⪃\"], [0, \"⪄\"], [0, \"⪅\"], [0, \"⪆\"], [0, \"⪇\"], [0, \"⪈\"], [0, \"⪉\"], [0, \"⪊\"], [0, \"⪋\"], [0, \"⪌\"], [0, \"⪍\"], [0, \"⪎\"], [0, \"⪏\"], [0, \"⪐\"], [0, \"⪑\"], [0, \"⪒\"], [0, \"⪓\"], [0, \"⪔\"], [0, \"⪕\"], [0, \"⪖\"], [0, \"⪗\"], [0, \"⪘\"], [0, \"⪙\"], [0, \"⪚\"], [2, \"⪝\"], [0, \"⪞\"], [0, \"⪟\"], [0, \"⪠\"], [0, { v: \"⪡\", n: 824, o: \"⪡̸\" }], [0, { v: \"⪢\", n: 824, o: \"⪢̸\" }], [1, \"⪤\"], [0, \"⪥\"], [0, \"⪦\"], [0, \"⪧\"], [0, \"⪨\"], [0, \"⪩\"], [0, \"⪪\"], [0, \"⪫\"], [0, { v: \"⪬\", n: 65024, o: \"⪬︀\" }], [0, { v: \"⪭\", n: 65024, o: \"⪭︀\" }], [0, \"⪮\"], [0, { v: \"⪯\", n: 824, o: \"⪯̸\" }], [0, { v: \"⪰\", n: 824, o: \"⪰̸\" }], [2, \"⪳\"], [0, \"⪴\"], [0, \"⪵\"], [0, \"⪶\"], [0, \"⪷\"], [0, \"⪸\"], [0, \"⪹\"], [0, \"⪺\"], [0, \"⪻\"], [0, \"⪼\"], [0, \"⪽\"], [0, \"⪾\"], [0, \"⪿\"], [0, \"⫀\"], [0, \"⫁\"], [0, \"⫂\"], [0, \"⫃\"], [0, \"⫄\"], [0, { v: \"⫅\", n: 824, o: \"⫅̸\" }], [0, { v: \"⫆\", n: 824, o: \"⫆̸\" }], [0, \"⫇\"], [0, \"⫈\"], [2, { v: \"⫋\", n: 65024, o: \"⫋︀\" }], [0, { v: \"⫌\", n: 65024, o: \"⫌︀\" }], [2, \"⫏\"], [0, \"⫐\"], [0, \"⫑\"], [0, \"⫒\"], [0, \"⫓\"], [0, \"⫔\"], [0, \"⫕\"], [0, \"⫖\"], [0, \"⫗\"], [0, \"⫘\"], [0, \"⫙\"], [0, \"⫚\"], [0, \"⫛\"], [8, \"⫤\"], [1, \"⫦\"], [0, \"⫧\"], [0, \"⫨\"], [0, \"⫩\"], [1, \"⫫\"], [0, \"⫬\"], [0, \"⫭\"], [0, \"⫮\"], [0, \"⫯\"], [0, \"⫰\"], [0, \"⫱\"], [0, \"⫲\"], [0, \"⫳\"], [9, { v: \"⫽\", n: 8421, o: \"⫽⃥\" }], [44343, { n: new Map(/* #__PURE__ */ restoreDiff([[56476, \"𝒜\"], [1, \"𝒞\"], [0, \"𝒟\"], [2, \"𝒢\"], [2, \"𝒥\"], [0, \"𝒦\"], [2, \"𝒩\"], [0, \"𝒪\"], [0, \"𝒫\"], [0, \"𝒬\"], [1, \"𝒮\"], [0, \"𝒯\"], [0, \"𝒰\"], [0, \"𝒱\"], [0, \"𝒲\"], [0, \"𝒳\"], [0, \"𝒴\"], [0, \"𝒵\"], [0, \"𝒶\"], [0, \"𝒷\"], [0, \"𝒸\"], [0, \"𝒹\"], [1, \"𝒻\"], [1, \"𝒽\"], [0, \"𝒾\"], [0, \"𝒿\"], [0, \"𝓀\"], [0, \"𝓁\"], [0, \"𝓂\"], [0, \"𝓃\"], [1, \"𝓅\"], [0, \"𝓆\"], [0, \"𝓇\"], [0, \"𝓈\"], [0, \"𝓉\"], [0, \"𝓊\"], [0, \"𝓋\"], [0, \"𝓌\"], [0, \"𝓍\"], [0, \"𝓎\"], [0, \"𝓏\"], [52, \"𝔄\"], [0, \"𝔅\"], [1, \"𝔇\"], [0, \"𝔈\"], [0, \"𝔉\"], [0, \"𝔊\"], [2, \"𝔍\"], [0, \"𝔎\"], [0, \"𝔏\"], [0, \"𝔐\"], [0, \"𝔑\"], [0, \"𝔒\"], [0, \"𝔓\"], [0, \"𝔔\"], [1, \"𝔖\"], [0, \"𝔗\"], [0, \"𝔘\"], [0, \"𝔙\"], [0, \"𝔚\"], [0, \"𝔛\"], [0, \"𝔜\"], [1, \"𝔞\"], [0, \"𝔟\"], [0, \"𝔠\"], [0, \"𝔡\"], [0, \"𝔢\"], [0, \"𝔣\"], [0, \"𝔤\"], [0, \"𝔥\"], [0, \"𝔦\"], [0, \"𝔧\"], [0, \"𝔨\"], [0, \"𝔩\"], [0, \"𝔪\"], [0, \"𝔫\"], [0, \"𝔬\"], [0, \"𝔭\"], [0, \"𝔮\"], [0, \"𝔯\"], [0, \"𝔰\"], [0, \"𝔱\"], [0, \"𝔲\"], [0, \"𝔳\"], [0, \"𝔴\"], [0, \"𝔵\"], [0, \"𝔶\"], [0, \"𝔷\"], [0, \"𝔸\"], [0, \"𝔹\"], [1, \"𝔻\"], [0, \"𝔼\"], [0, \"𝔽\"], [0, \"𝔾\"], [1, \"𝕀\"], [0, \"𝕁\"], [0, \"𝕂\"], [0, \"𝕃\"], [0, \"𝕄\"], [1, \"𝕆\"], [3, \"𝕊\"], [0, \"𝕋\"], [0, \"𝕌\"], [0, \"𝕍\"], [0, \"𝕎\"], [0, \"𝕏\"], [0, \"𝕐\"], [1, \"𝕒\"], [0, \"𝕓\"], [0, \"𝕔\"], [0, \"𝕕\"], [0, \"𝕖\"], [0, \"𝕗\"], [0, \"𝕘\"], [0, \"𝕙\"], [0, \"𝕚\"], [0, \"𝕛\"], [0, \"𝕜\"], [0, \"𝕝\"], [0, \"𝕞\"], [0, \"𝕟\"], [0, \"𝕠\"], [0, \"𝕡\"], [0, \"𝕢\"], [0, \"𝕣\"], [0, \"𝕤\"], [0, \"𝕥\"], [0, \"𝕦\"], [0, \"𝕧\"], [0, \"𝕨\"], [0, \"𝕩\"], [0, \"𝕪\"], [0, \"𝕫\"]])) }], [8906, \"ff\"], [0, \"fi\"], [0, \"fl\"], [0, \"ffi\"], [0, \"ffl\"]]));\n//# sourceMappingURL=encode-html.js.map","export const xmlReplacer = /[\"&'<>$\\x80-\\uFFFF]/g;\nconst xmlCodeMap = new Map([\n [34, \""\"],\n [38, \"&\"],\n [39, \"'\"],\n [60, \"<\"],\n [62, \">\"],\n]);\n// For compatibility with node < 4, we wrap `codePointAt`\nexport const getCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nString.prototype.codePointAt != null\n ? (str, index) => str.codePointAt(index)\n : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n (c, index) => (c.charCodeAt(index) & 0xfc00) === 0xd800\n ? (c.charCodeAt(index) - 0xd800) * 0x400 +\n c.charCodeAt(index + 1) -\n 0xdc00 +\n 0x10000\n : c.charCodeAt(index);\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using XML entities.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `ü`) will be used.\n */\nexport function encodeXML(str) {\n let ret = \"\";\n let lastIdx = 0;\n let match;\n while ((match = xmlReplacer.exec(str)) !== null) {\n const i = match.index;\n const char = str.charCodeAt(i);\n const next = xmlCodeMap.get(char);\n if (next !== undefined) {\n ret += str.substring(lastIdx, i) + next;\n lastIdx = i + 1;\n }\n else {\n ret += `${str.substring(lastIdx, i)}&#x${getCodePoint(str, i).toString(16)};`;\n // Increase by 1 if we have a surrogate pair\n lastIdx = xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800);\n }\n }\n return ret + str.substr(lastIdx);\n}\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using numeric hexadecimal reference (eg. `ü`).\n *\n * Have a look at `escapeUTF8` if you want a more concise output at the expense\n * of reduced transportability.\n *\n * @param data String to escape.\n */\nexport const escape = encodeXML;\n/**\n * Creates a function that escapes all characters matched by the given regular\n * expression using the given map of characters to escape to their entities.\n *\n * @param regex Regular expression to match characters to escape.\n * @param map Map of characters to escape to their entities.\n *\n * @returns Function that escapes all characters matched by the given regular\n * expression using the given map of characters to escape to their entities.\n */\nfunction getEscaper(regex, map) {\n return function escape(data) {\n let match;\n let lastIdx = 0;\n let result = \"\";\n while ((match = regex.exec(data))) {\n if (lastIdx !== match.index) {\n result += data.substring(lastIdx, match.index);\n }\n // We know that this character will be in the map.\n result += map.get(match[0].charCodeAt(0));\n // Every match will be of length 1\n lastIdx = match.index + 1;\n }\n return result + data.substring(lastIdx);\n };\n}\n/**\n * Encodes all characters not valid in XML documents using XML entities.\n *\n * Note that the output will be character-set dependent.\n *\n * @param data String to escape.\n */\nexport const escapeUTF8 = getEscaper(/[&<>'\"]/g, xmlCodeMap);\n/**\n * Encodes all characters that have to be escaped in HTML attributes,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n *\n * @param data String to escape.\n */\nexport const escapeAttribute = getEscaper(/[\"&\\u00A0]/g, new Map([\n [34, \""\"],\n [38, \"&\"],\n [160, \" \"],\n]));\n/**\n * Encodes all characters that have to be escaped in HTML text,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n *\n * @param data String to escape.\n */\nexport const escapeText = getEscaper(/[&<>\\u00A0]/g, new Map([\n [38, \"&\"],\n [60, \"<\"],\n [62, \">\"],\n [160, \" \"],\n]));\n//# sourceMappingURL=escape.js.map","import { decodeXML, decodeHTML, DecodingMode } from \"./decode.js\";\nimport { encodeHTML, encodeNonAsciiHTML } from \"./encode.js\";\nimport { encodeXML, escapeUTF8, escapeAttribute, escapeText, } from \"./escape.js\";\n/** The level of entities to support. */\nexport var EntityLevel;\n(function (EntityLevel) {\n /** Support only XML entities. */\n EntityLevel[EntityLevel[\"XML\"] = 0] = \"XML\";\n /** Support HTML entities, which are a superset of XML entities. */\n EntityLevel[EntityLevel[\"HTML\"] = 1] = \"HTML\";\n})(EntityLevel || (EntityLevel = {}));\nexport var EncodingMode;\n(function (EncodingMode) {\n /**\n * The output is UTF-8 encoded. Only characters that need escaping within\n * XML will be escaped.\n */\n EncodingMode[EncodingMode[\"UTF8\"] = 0] = \"UTF8\";\n /**\n * The output consists only of ASCII characters. Characters that need\n * escaping within HTML, and characters that aren't ASCII characters will\n * be escaped.\n */\n EncodingMode[EncodingMode[\"ASCII\"] = 1] = \"ASCII\";\n /**\n * Encode all characters that have an equivalent entity, as well as all\n * characters that are not ASCII characters.\n */\n EncodingMode[EncodingMode[\"Extensive\"] = 2] = \"Extensive\";\n /**\n * Encode all characters that have to be escaped in HTML attributes,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n */\n EncodingMode[EncodingMode[\"Attribute\"] = 3] = \"Attribute\";\n /**\n * Encode all characters that have to be escaped in HTML text,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n */\n EncodingMode[EncodingMode[\"Text\"] = 4] = \"Text\";\n})(EncodingMode || (EncodingMode = {}));\n/**\n * Decodes a string with entities.\n *\n * @param data String to decode.\n * @param options Decoding options.\n */\nexport function decode(data, options = EntityLevel.XML) {\n const level = typeof options === \"number\" ? options : options.level;\n if (level === EntityLevel.HTML) {\n const mode = typeof options === \"object\" ? options.mode : undefined;\n return decodeHTML(data, mode);\n }\n return decodeXML(data);\n}\n/**\n * Decodes a string with entities. Does not allow missing trailing semicolons for entities.\n *\n * @param data String to decode.\n * @param options Decoding options.\n * @deprecated Use `decode` with the `mode` set to `Strict`.\n */\nexport function decodeStrict(data, options = EntityLevel.XML) {\n var _a;\n const opts = typeof options === \"number\" ? { level: options } : options;\n (_a = opts.mode) !== null && _a !== void 0 ? _a : (opts.mode = DecodingMode.Strict);\n return decode(data, opts);\n}\n/**\n * Encodes a string with entities.\n *\n * @param data String to encode.\n * @param options Encoding options.\n */\nexport function encode(data, options = EntityLevel.XML) {\n const opts = typeof options === \"number\" ? { level: options } : options;\n // Mode `UTF8` just escapes XML entities\n if (opts.mode === EncodingMode.UTF8)\n return escapeUTF8(data);\n if (opts.mode === EncodingMode.Attribute)\n return escapeAttribute(data);\n if (opts.mode === EncodingMode.Text)\n return escapeText(data);\n if (opts.level === EntityLevel.HTML) {\n if (opts.mode === EncodingMode.ASCII) {\n return encodeNonAsciiHTML(data);\n }\n return encodeHTML(data);\n }\n // ASCII and Extensive are equivalent\n return encodeXML(data);\n}\nexport { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from \"./escape.js\";\nexport { encodeHTML, encodeNonAsciiHTML, \n// Legacy aliases (deprecated)\nencodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from \"./encode.js\";\nexport { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, \n// Legacy aliases (deprecated)\ndecodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from \"./decode.js\";\n//# sourceMappingURL=index.js.map","// Utilities\n//\n\nimport * as mdurl from 'mdurl'\nimport * as ucmicro from 'uc.micro'\nimport { decodeHTML } from 'entities'\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\n\nfunction isString (obj) { return _class(obj) === '[object String]' }\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction has (object, key) {\n return _hasOwnProperty.call(object, key)\n}\n\n// Merge objects\n//\nfunction assign (obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1)\n\n sources.forEach(function (source) {\n if (!source) { return }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be object')\n }\n\n Object.keys(source).forEach(function (key) {\n obj[key] = source[key]\n })\n })\n\n return obj\n}\n\n// Remove element from array and put another array at those position.\n// Useful for some operations with tokens\nfunction arrayReplaceAt (src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1))\n}\n\nfunction isValidEntityCode (c) {\n /* eslint no-bitwise:0 */\n // broken sequence\n if (c >= 0xD800 && c <= 0xDFFF) { return false }\n // never used\n if (c >= 0xFDD0 && c <= 0xFDEF) { return false }\n if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false }\n // control codes\n if (c >= 0x00 && c <= 0x08) { return false }\n if (c === 0x0B) { return false }\n if (c >= 0x0E && c <= 0x1F) { return false }\n if (c >= 0x7F && c <= 0x9F) { return false }\n // out of range\n if (c > 0x10FFFF) { return false }\n return true\n}\n\nfunction fromCodePoint (c) {\n /* eslint no-bitwise:0 */\n if (c > 0xffff) {\n c -= 0x10000\n const surrogate1 = 0xd800 + (c >> 10)\n const surrogate2 = 0xdc00 + (c & 0x3ff)\n\n return String.fromCharCode(surrogate1, surrogate2)\n }\n return String.fromCharCode(c)\n}\n\nconst UNESCAPE_MD_RE = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{|}~])/g\nconst ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi\nconst UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi')\n\nconst DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i\n\nfunction replaceEntityPattern (match, name) {\n if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {\n const code = name[1].toLowerCase() === 'x'\n ? parseInt(name.slice(2), 16)\n : parseInt(name.slice(1), 10)\n\n if (isValidEntityCode(code)) {\n return fromCodePoint(code)\n }\n\n return match\n }\n\n const decoded = decodeHTML(match)\n if (decoded !== match) {\n return decoded\n }\n\n return match\n}\n\n/* function replaceEntities(str) {\n if (str.indexOf('&') < 0) { return str; }\n\n return str.replace(ENTITY_RE, replaceEntityPattern);\n} */\n\nfunction unescapeMd (str) {\n if (str.indexOf('\\\\') < 0) { return str }\n return str.replace(UNESCAPE_MD_RE, '$1')\n}\n\nfunction unescapeAll (str) {\n if (str.indexOf('\\\\') < 0 && str.indexOf('&') < 0) { return str }\n\n return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {\n if (escaped) { return escaped }\n return replaceEntityPattern(match, entity)\n })\n}\n\nconst HTML_ESCAPE_TEST_RE = /[&<>\"]/\nconst HTML_ESCAPE_REPLACE_RE = /[&<>\"]/g\nconst HTML_REPLACEMENTS = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"'\n}\n\nfunction replaceUnsafeChar (ch) {\n return HTML_REPLACEMENTS[ch]\n}\n\nfunction escapeHtml (str) {\n if (HTML_ESCAPE_TEST_RE.test(str)) {\n return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar)\n }\n return str\n}\n\nconst REGEXP_ESCAPE_RE = /[.?*+^$[\\]\\\\(){}|-]/g\n\nfunction escapeRE (str) {\n return str.replace(REGEXP_ESCAPE_RE, '\\\\$&')\n}\n\nfunction isSpace (code) {\n switch (code) {\n case 0x09:\n case 0x20:\n return true\n }\n return false\n}\n\n// Zs (unicode class) || [\\t\\f\\v\\r\\n]\nfunction isWhiteSpace (code) {\n if (code >= 0x2000 && code <= 0x200A) { return true }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true\n }\n return false\n}\n\n/* eslint-disable max-len */\n\n// Currently without astral characters support.\nfunction isPunctChar (ch) {\n return ucmicro.P.test(ch) || ucmicro.S.test(ch)\n}\n\n// Markdown ASCII punctuation characters.\n//\n// !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n// http://spec.commonmark.org/0.15/#ascii-punctuation-character\n//\n// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.\n//\nfunction isMdAsciiPunct (ch) {\n switch (ch) {\n case 0x21/* ! */:\n case 0x22/* \" */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x27/* ' */:\n case 0x28/* ( */:\n case 0x29/* ) */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2C/* , */:\n case 0x2D/* - */:\n case 0x2E/* . */:\n case 0x2F/* / */:\n case 0x3A/* : */:\n case 0x3B/* ; */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x3F/* ? */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7C/* | */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true\n default:\n return false\n }\n}\n\n// Hepler to unify [reference labels].\n//\nfunction normalizeReference (str) {\n // Trim and collapse whitespace\n //\n str = str.trim().replace(/\\s+/g, ' ')\n\n // In node v10 'ẞ'.toLowerCase() === 'á¹¾', which is presumed to be a bug\n // fixed in v12 (couldn't find any details).\n //\n // So treat this one as a special case\n // (remove this when node v10 is no longer supported).\n //\n if ('ẞ'.toLowerCase() === 'á¹¾') {\n str = str.replace(/ẞ/g, 'ß')\n }\n\n // .toLowerCase().toUpperCase() should get rid of all differences\n // between letter variants.\n //\n // Simple .toLowerCase() doesn't normalize 125 code points correctly,\n // and .toUpperCase doesn't normalize 6 of them (list of exceptions:\n // Ä°, Ï´, ẞ, Ω, K, â„« - those are already uppercased, but have differently\n // uppercased versions).\n //\n // Here's an example showing how it happens. Lets take greek letter omega:\n // uppercase U+0398 (Θ), U+03f4 (Ï´) and lowercase U+03b8 (θ), U+03d1 (Ï‘)\n //\n // Unicode entries:\n // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;\n // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398\n // 03D1;GREEK THETA SYMBOL;Ll;0;L;<compat> 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398\n // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L;<compat> 0398;;;;N;;;;03B8;\n //\n // Case-insensitive comparison should treat all of them as equivalent.\n //\n // But .toLowerCase() doesn't change Ï‘ (it's already lowercase),\n // and .toUpperCase() doesn't change Ï´ (already uppercase).\n //\n // Applying first lower then upper case normalizes any character:\n // '\\u0398\\u03f4\\u03b8\\u03d1'.toLowerCase().toUpperCase() === '\\u0398\\u0398\\u0398\\u0398'\n //\n // Note: this is equivalent to unicode case folding; unicode normalization\n // is a different step that is not required here.\n //\n // Final result should be uppercased, because it's later stored in an object\n // (this avoid a conflict with Object.prototype members,\n // most notably, `__proto__`)\n //\n return str.toLowerCase().toUpperCase()\n}\n\n// Re-export libraries commonly used in both markdown-it and its plugins,\n// so plugins won't have to depend on them explicitly, which reduces their\n// bundled size (e.g. a browser build).\n//\nconst lib = { mdurl, ucmicro }\n\nexport {\n lib,\n assign,\n isString,\n has,\n unescapeMd,\n unescapeAll,\n isValidEntityCode,\n fromCodePoint,\n escapeHtml,\n arrayReplaceAt,\n isSpace,\n isWhiteSpace,\n isMdAsciiPunct,\n isPunctChar,\n escapeRE,\n normalizeReference\n}\n","// Parse link label\n//\n// this function assumes that first character (\"[\") already matches;\n// returns the end of the label\n//\n\nexport default function parseLinkLabel (state, start, disableNested) {\n let level, found, marker, prevPos\n\n const max = state.posMax\n const oldPos = state.pos\n\n state.pos = start + 1\n level = 1\n\n while (state.pos < max) {\n marker = state.src.charCodeAt(state.pos)\n if (marker === 0x5D /* ] */) {\n level--\n if (level === 0) {\n found = true\n break\n }\n }\n\n prevPos = state.pos\n state.md.inline.skipToken(state)\n if (marker === 0x5B /* [ */) {\n if (prevPos === state.pos - 1) {\n // increase level if we find text `[`, which is not a part of any token\n level++\n } else if (disableNested) {\n state.pos = oldPos\n return -1\n }\n }\n }\n\n let labelEnd = -1\n\n if (found) {\n labelEnd = state.pos\n }\n\n // restore old state\n state.pos = oldPos\n\n return labelEnd\n}\n","// Parse link destination\n//\n\nimport { unescapeAll } from '../common/utils.mjs'\n\nexport default function parseLinkDestination (str, start, max) {\n let code\n let pos = start\n\n const result = {\n ok: false,\n pos: 0,\n str: ''\n }\n\n if (str.charCodeAt(pos) === 0x3C /* < */) {\n pos++\n while (pos < max) {\n code = str.charCodeAt(pos)\n if (code === 0x0A /* \\n */) { return result }\n if (code === 0x3C /* < */) { return result }\n if (code === 0x3E /* > */) {\n result.pos = pos + 1\n result.str = unescapeAll(str.slice(start + 1, pos))\n result.ok = true\n return result\n }\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos += 2\n continue\n }\n\n pos++\n }\n\n // no closing '>'\n return result\n }\n\n // this should be ... } else { ... branch\n\n let level = 0\n while (pos < max) {\n code = str.charCodeAt(pos)\n\n if (code === 0x20) { break }\n\n // ascii control characters\n if (code < 0x20 || code === 0x7F) { break }\n\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n if (str.charCodeAt(pos + 1) === 0x20) { break }\n pos += 2\n continue\n }\n\n if (code === 0x28 /* ( */) {\n level++\n if (level > 32) { return result }\n }\n\n if (code === 0x29 /* ) */) {\n if (level === 0) { break }\n level--\n }\n\n pos++\n }\n\n if (start === pos) { return result }\n if (level !== 0) { return result }\n\n result.str = unescapeAll(str.slice(start, pos))\n result.pos = pos\n result.ok = true\n return result\n}\n","// Parse link title\n//\n\nimport { unescapeAll } from '../common/utils.mjs'\n\n// Parse link title within `str` in [start, max] range,\n// or continue previous parsing if `prev_state` is defined (equal to result of last execution).\n//\nexport default function parseLinkTitle (str, start, max, prev_state) {\n let code\n let pos = start\n\n const state = {\n // if `true`, this is a valid link title\n ok: false,\n // if `true`, this link can be continued on the next line\n can_continue: false,\n // if `ok`, it's the position of the first character after the closing marker\n pos: 0,\n // if `ok`, it's the unescaped title\n str: '',\n // expected closing marker character code\n marker: 0\n }\n\n if (prev_state) {\n // this is a continuation of a previous parseLinkTitle call on the next line,\n // used in reference links only\n state.str = prev_state.str\n state.marker = prev_state.marker\n } else {\n if (pos >= max) { return state }\n\n let marker = str.charCodeAt(pos)\n if (marker !== 0x22 /* \" */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return state }\n\n start++\n pos++\n\n // if opening marker is \"(\", switch it to closing marker \")\"\n if (marker === 0x28) { marker = 0x29 }\n\n state.marker = marker\n }\n\n while (pos < max) {\n code = str.charCodeAt(pos)\n if (code === state.marker) {\n state.pos = pos + 1\n state.str += unescapeAll(str.slice(start, pos))\n state.ok = true\n return state\n } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) {\n return state\n } else if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos++\n }\n\n pos++\n }\n\n // no closing marker found, but this link title may continue on the next line (for references)\n state.can_continue = true\n state.str += unescapeAll(str.slice(start, pos))\n return state\n}\n","/**\n * class Renderer\n *\n * Generates HTML from parsed token stream. Each instance has independent\n * copy of rules. Those can be rewritten with ease. Also, you can add new\n * rules if you create plugin and adds new token types.\n **/\n\nimport { assign, unescapeAll, escapeHtml } from './common/utils.mjs'\n\nconst default_rules = {}\n\ndefault_rules.code_inline = function (tokens, idx, options, env, slf) {\n const token = tokens[idx]\n\n return '<code' + slf.renderAttrs(token) + '>' +\n escapeHtml(token.content) +\n '</code>'\n}\n\ndefault_rules.code_block = function (tokens, idx, options, env, slf) {\n const token = tokens[idx]\n\n return '<pre' + slf.renderAttrs(token) + '><code>' +\n escapeHtml(tokens[idx].content) +\n '</code></pre>\\n'\n}\n\ndefault_rules.fence = function (tokens, idx, options, env, slf) {\n const token = tokens[idx]\n const info = token.info ? unescapeAll(token.info).trim() : ''\n let langName = ''\n let langAttrs = ''\n\n if (info) {\n const arr = info.split(/(\\s+)/g)\n langName = arr[0]\n langAttrs = arr.slice(2).join('')\n }\n\n let highlighted\n if (options.highlight) {\n highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content)\n } else {\n highlighted = escapeHtml(token.content)\n }\n\n if (highlighted.indexOf('<pre') === 0) {\n return highlighted + '\\n'\n }\n\n // If language exists, inject class gently, without modifying original token.\n // May be, one day we will add .deepClone() for token and simplify this part, but\n // now we prefer to keep things local.\n if (info) {\n const i = token.attrIndex('class')\n const tmpAttrs = token.attrs ? token.attrs.slice() : []\n\n if (i < 0) {\n tmpAttrs.push(['class', options.langPrefix + langName])\n } else {\n tmpAttrs[i] = tmpAttrs[i].slice()\n tmpAttrs[i][1] += ' ' + options.langPrefix + langName\n }\n\n // Fake token just to render attributes\n const tmpToken = {\n attrs: tmpAttrs\n }\n\n return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>\\n`\n }\n\n return `<pre><code${slf.renderAttrs(token)}>${highlighted}</code></pre>\\n`\n}\n\ndefault_rules.image = function (tokens, idx, options, env, slf) {\n const token = tokens[idx]\n\n // \"alt\" attr MUST be set, even if empty. Because it's mandatory and\n // should be placed on proper position for tests.\n //\n // Replace content with actual value\n\n token.attrs[token.attrIndex('alt')][1] =\n slf.renderInlineAsText(token.children, options, env)\n\n return slf.renderToken(tokens, idx, options)\n}\n\ndefault_rules.hardbreak = function (tokens, idx, options /*, env */) {\n return options.xhtmlOut ? '<br />\\n' : '<br>\\n'\n}\ndefault_rules.softbreak = function (tokens, idx, options /*, env */) {\n return options.breaks ? (options.xhtmlOut ? '<br />\\n' : '<br>\\n') : '\\n'\n}\n\ndefault_rules.text = function (tokens, idx /*, options, env */) {\n return escapeHtml(tokens[idx].content)\n}\n\ndefault_rules.html_block = function (tokens, idx /*, options, env */) {\n return tokens[idx].content\n}\ndefault_rules.html_inline = function (tokens, idx /*, options, env */) {\n return tokens[idx].content\n}\n\n/**\n * new Renderer()\n *\n * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.\n **/\nfunction Renderer () {\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules)\n}\n\n/**\n * Renderer.renderAttrs(token) -> String\n *\n * Render token attributes to string.\n **/\nRenderer.prototype.renderAttrs = function renderAttrs (token) {\n let i, l, result\n\n if (!token.attrs) { return '' }\n\n result = ''\n\n for (i = 0, l = token.attrs.length; i < l; i++) {\n result += ' ' + escapeHtml(token.attrs[i][0]) + '=\"' + escapeHtml(token.attrs[i][1]) + '\"'\n }\n\n return result\n}\n\n/**\n * Renderer.renderToken(tokens, idx, options) -> String\n * - tokens (Array): list of tokens\n * - idx (Numbed): token index to render\n * - options (Object): params of parser instance\n *\n * Default token renderer. Can be overriden by custom function\n * in [[Renderer#rules]].\n **/\nRenderer.prototype.renderToken = function renderToken (tokens, idx, options) {\n const token = tokens[idx]\n let result = ''\n\n // Tight list paragraphs\n if (token.hidden) {\n return ''\n }\n\n // Insert a newline between hidden paragraph and subsequent opening\n // block-level tag.\n //\n // For example, here we should insert a newline before blockquote:\n // - a\n // >\n //\n if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {\n result += '\\n'\n }\n\n // Add token name, e.g. `<img`\n result += (token.nesting === -1 ? '</' : '<') + token.tag\n\n // Encode attributes, e.g. `<img src=\"foo\"`\n result += this.renderAttrs(token)\n\n // Add a slash for self-closing tags, e.g. `<img src=\"foo\" /`\n if (token.nesting === 0 && options.xhtmlOut) {\n result += ' /'\n }\n\n // Check if we need to add a newline after this tag\n let needLf = false\n if (token.block) {\n needLf = true\n\n if (token.nesting === 1) {\n if (idx + 1 < tokens.length) {\n const nextToken = tokens[idx + 1]\n\n if (nextToken.type === 'inline' || nextToken.hidden) {\n // Block-level tag containing an inline tag.\n //\n needLf = false\n } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {\n // Opening tag + closing tag of the same type. E.g. `<li></li>`.\n //\n needLf = false\n }\n }\n }\n }\n\n result += needLf ? '>\\n' : '>'\n\n return result\n}\n\n/**\n * Renderer.renderInline(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * The same as [[Renderer.render]], but for single token of `inline` type.\n **/\nRenderer.prototype.renderInline = function (tokens, options, env) {\n let result = ''\n const rules = this.rules\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type\n\n if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this)\n } else {\n result += this.renderToken(tokens, i, options)\n }\n }\n\n return result\n}\n\n/** internal\n * Renderer.renderInlineAsText(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Special kludge for image `alt` attributes to conform CommonMark spec.\n * Don't try to use it! Spec requires to show `alt` content with stripped markup,\n * instead of simple escaping.\n **/\nRenderer.prototype.renderInlineAsText = function (tokens, options, env) {\n let result = ''\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n switch (tokens[i].type) {\n case 'text':\n result += tokens[i].content\n break\n case 'image':\n result += this.renderInlineAsText(tokens[i].children, options, env)\n break\n case 'html_inline':\n case 'html_block':\n result += tokens[i].content\n break\n case 'softbreak':\n case 'hardbreak':\n result += '\\n'\n break\n default:\n // all other tokens are skipped\n }\n }\n\n return result\n}\n\n/**\n * Renderer.render(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Takes token stream and generates HTML. Probably, you will never need to call\n * this method directly.\n **/\nRenderer.prototype.render = function (tokens, options, env) {\n let result = ''\n const rules = this.rules\n\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type\n\n if (type === 'inline') {\n result += this.renderInline(tokens[i].children, options, env)\n } else if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this)\n } else {\n result += this.renderToken(tokens, i, options, env)\n }\n }\n\n return result\n}\n\nexport default Renderer\n","/**\n * class Ruler\n *\n * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and\n * [[MarkdownIt#inline]] to manage sequences of functions (rules):\n *\n * - keep rules in defined order\n * - assign the name to each rule\n * - enable/disable rules\n * - add/replace rules\n * - allow assign rules to additional named chains (in the same)\n * - cacheing lists of active rules\n *\n * You will not need use this class directly until write plugins. For simple\n * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and\n * [[MarkdownIt.use]].\n **/\n\n/**\n * new Ruler()\n **/\nfunction Ruler () {\n // List of added rules. Each element is:\n //\n // {\n // name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ]\n // }\n //\n this.__rules__ = []\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - diginal anchor for fast filtering by charcodes.\n //\n this.__cache__ = null\n}\n\n// Helper methods, should not be used directly\n\n// Find rule index by name\n//\nRuler.prototype.__find__ = function (name) {\n for (let i = 0; i < this.__rules__.length; i++) {\n if (this.__rules__[i].name === name) {\n return i\n }\n }\n return -1\n}\n\n// Build rules lookup cache\n//\nRuler.prototype.__compile__ = function () {\n const self = this\n const chains = ['']\n\n // collect unique names\n self.__rules__.forEach(function (rule) {\n if (!rule.enabled) { return }\n\n rule.alt.forEach(function (altName) {\n if (chains.indexOf(altName) < 0) {\n chains.push(altName)\n }\n })\n })\n\n self.__cache__ = {}\n\n chains.forEach(function (chain) {\n self.__cache__[chain] = []\n self.__rules__.forEach(function (rule) {\n if (!rule.enabled) { return }\n\n if (chain && rule.alt.indexOf(chain) < 0) { return }\n\n self.__cache__[chain].push(rule.fn)\n })\n })\n}\n\n/**\n * Ruler.at(name, fn [, options])\n * - name (String): rule name to replace.\n * - fn (Function): new rule function.\n * - options (Object): new rule options (not mandatory).\n *\n * Replace rule by name with new function & options. Throws error if name not\n * found.\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * Replace existing typographer replacement rule with new one:\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.at('replacements', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.at = function (name, fn, options) {\n const index = this.__find__(name)\n const opt = options || {}\n\n if (index === -1) { throw new Error('Parser rule not found: ' + name) }\n\n this.__rules__[index].fn = fn\n this.__rules__[index].alt = opt.alt || []\n this.__cache__ = null\n}\n\n/**\n * Ruler.before(beforeName, ruleName, fn [, options])\n * - beforeName (String): new rule will be added before this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain before one with given name. See also\n * [[Ruler.after]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.before = function (beforeName, ruleName, fn, options) {\n const index = this.__find__(beforeName)\n const opt = options || {}\n\n if (index === -1) { throw new Error('Parser rule not found: ' + beforeName) }\n\n this.__rules__.splice(index, 0, {\n name: ruleName,\n enabled: true,\n fn,\n alt: opt.alt || []\n })\n\n this.__cache__ = null\n}\n\n/**\n * Ruler.after(afterName, ruleName, fn [, options])\n * - afterName (String): new rule will be added after this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain after one with given name. See also\n * [[Ruler.before]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.inline.ruler.after('text', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.after = function (afterName, ruleName, fn, options) {\n const index = this.__find__(afterName)\n const opt = options || {}\n\n if (index === -1) { throw new Error('Parser rule not found: ' + afterName) }\n\n this.__rules__.splice(index + 1, 0, {\n name: ruleName,\n enabled: true,\n fn,\n alt: opt.alt || []\n })\n\n this.__cache__ = null\n}\n\n/**\n * Ruler.push(ruleName, fn [, options])\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Push new rule to the end of chain. See also\n * [[Ruler.before]], [[Ruler.after]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.push('my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.push = function (ruleName, fn, options) {\n const opt = options || {}\n\n this.__rules__.push({\n name: ruleName,\n enabled: true,\n fn,\n alt: opt.alt || []\n })\n\n this.__cache__ = null\n}\n\n/**\n * Ruler.enable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to enable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.disable]], [[Ruler.enableOnly]].\n **/\nRuler.prototype.enable = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [list] }\n\n const result = []\n\n // Search by name and enable\n list.forEach(function (name) {\n const idx = this.__find__(name)\n\n if (idx < 0) {\n if (ignoreInvalid) { return }\n throw new Error('Rules manager: invalid rule name ' + name)\n }\n this.__rules__[idx].enabled = true\n result.push(name)\n }, this)\n\n this.__cache__ = null\n return result\n}\n\n/**\n * Ruler.enableOnly(list [, ignoreInvalid])\n * - list (String|Array): list of rule names to enable (whitelist).\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names, and disable everything else. If any rule name\n * not found - throw Error. Errors can be disabled by second param.\n *\n * See also [[Ruler.disable]], [[Ruler.enable]].\n **/\nRuler.prototype.enableOnly = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [list] }\n\n this.__rules__.forEach(function (rule) { rule.enabled = false })\n\n this.enable(list, ignoreInvalid)\n}\n\n/**\n * Ruler.disable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Disable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.enable]], [[Ruler.enableOnly]].\n **/\nRuler.prototype.disable = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [list] }\n\n const result = []\n\n // Search by name and disable\n list.forEach(function (name) {\n const idx = this.__find__(name)\n\n if (idx < 0) {\n if (ignoreInvalid) { return }\n throw new Error('Rules manager: invalid rule name ' + name)\n }\n this.__rules__[idx].enabled = false\n result.push(name)\n }, this)\n\n this.__cache__ = null\n return result\n}\n\n/**\n * Ruler.getRules(chainName) -> Array\n *\n * Return array of active functions (rules) for given chain name. It analyzes\n * rules configuration, compiles caches if not exists and returns result.\n *\n * Default chain name is `''` (empty string). It can't be skipped. That's\n * done intentionally, to keep signature monomorphic for high speed.\n **/\nRuler.prototype.getRules = function (chainName) {\n if (this.__cache__ === null) {\n this.__compile__()\n }\n\n // Chain can be empty, if rules disabled. But we still have to return Array.\n return this.__cache__[chainName] || []\n}\n\nexport default Ruler\n","// Token class\n\n/**\n * class Token\n **/\n\n/**\n * new Token(type, tag, nesting)\n *\n * Create new token and fill passed properties.\n **/\nfunction Token (type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = ''\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = ''\n\n /**\n * Token#info -> String\n *\n * Additional information:\n *\n * - Info string for \"fence\" tokens\n * - The value \"auto\" for autolink \"link_open\" and \"link_close\" tokens\n * - The string value of the item marker for ordered-list \"list_item_open\" tokens\n **/\n this.info = ''\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false\n}\n\n/**\n * Token.attrIndex(name) -> Number\n *\n * Search attribute index by name.\n **/\nToken.prototype.attrIndex = function attrIndex (name) {\n if (!this.attrs) { return -1 }\n\n const attrs = this.attrs\n\n for (let i = 0, len = attrs.length; i < len; i++) {\n if (attrs[i][0] === name) { return i }\n }\n return -1\n}\n\n/**\n * Token.attrPush(attrData)\n *\n * Add `[ name, value ]` attribute to list. Init attrs if necessary\n **/\nToken.prototype.attrPush = function attrPush (attrData) {\n if (this.attrs) {\n this.attrs.push(attrData)\n } else {\n this.attrs = [attrData]\n }\n}\n\n/**\n * Token.attrSet(name, value)\n *\n * Set `name` attribute to `value`. Override old value if exists.\n **/\nToken.prototype.attrSet = function attrSet (name, value) {\n const idx = this.attrIndex(name)\n const attrData = [name, value]\n\n if (idx < 0) {\n this.attrPush(attrData)\n } else {\n this.attrs[idx] = attrData\n }\n}\n\n/**\n * Token.attrGet(name)\n *\n * Get the value of attribute `name`, or null if it does not exist.\n **/\nToken.prototype.attrGet = function attrGet (name) {\n const idx = this.attrIndex(name)\n let value = null\n if (idx >= 0) {\n value = this.attrs[idx][1]\n }\n return value\n}\n\n/**\n * Token.attrJoin(name, value)\n *\n * Join value to existing attribute via space. Or create new attribute if not\n * exists. Useful to operate with token classes.\n **/\nToken.prototype.attrJoin = function attrJoin (name, value) {\n const idx = this.attrIndex(name)\n\n if (idx < 0) {\n this.attrPush([name, value])\n } else {\n this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value\n }\n}\n\nexport default Token\n","// Core state object\n//\n\nimport Token from '../token.mjs'\n\nfunction StateCore (src, md, env) {\n this.src = src\n this.env = env\n this.tokens = []\n this.inlineMode = false\n this.md = md // link to parser instance\n}\n\n// re-export Token class to use in core rules\nStateCore.prototype.Token = Token\n\nexport default StateCore\n","// Normalize input string\n\n// https://spec.commonmark.org/0.29/#line-ending\nconst NEWLINES_RE = /\\r\\n?|\\n/g\nconst NULL_RE = /\\0/g\n\nexport default function normalize (state) {\n let str\n\n // Normalize newlines\n str = state.src.replace(NEWLINES_RE, '\\n')\n\n // Replace NULL characters\n str = str.replace(NULL_RE, '\\uFFFD')\n\n state.src = str\n}\n","// Replace link-like texts with link nodes.\n//\n// Currently restricted by `md.validateLink()` to http/https/ftp\n//\n\nimport { arrayReplaceAt } from '../common/utils.mjs'\n\nfunction isLinkOpen (str) {\n return /^<a[>\\s]/i.test(str)\n}\nfunction isLinkClose (str) {\n return /^<\\/a\\s*>/i.test(str)\n}\n\nexport default function linkify (state) {\n const blockTokens = state.tokens\n\n if (!state.md.options.linkify) { return }\n\n for (let j = 0, l = blockTokens.length; j < l; j++) {\n if (blockTokens[j].type !== 'inline' ||\n !state.md.linkify.pretest(blockTokens[j].content)) {\n continue\n }\n\n let tokens = blockTokens[j].children\n\n let htmlLinkLevel = 0\n\n // We scan from the end, to keep position when new tags added.\n // Use reversed logic in links start/end match\n for (let i = tokens.length - 1; i >= 0; i--) {\n const currentToken = tokens[i]\n\n // Skip content of markdown links\n if (currentToken.type === 'link_close') {\n i--\n while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {\n i--\n }\n continue\n }\n\n // Skip content of html tag links\n if (currentToken.type === 'html_inline') {\n if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {\n htmlLinkLevel--\n }\n if (isLinkClose(currentToken.content)) {\n htmlLinkLevel++\n }\n }\n if (htmlLinkLevel > 0) { continue }\n\n if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {\n const text = currentToken.content\n let links = state.md.linkify.match(text)\n\n // Now split string to nodes\n const nodes = []\n let level = currentToken.level\n let lastPos = 0\n\n // forbid escape sequence at the start of the string,\n // this avoids http\\://example.com/ from being linkified as\n // http:<a href=\"//example.com/\">//example.com/</a>\n if (links.length > 0 &&\n links[0].index === 0 &&\n i > 0 &&\n tokens[i - 1].type === 'text_special') {\n links = links.slice(1)\n }\n\n for (let ln = 0; ln < links.length; ln++) {\n const url = links[ln].url\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) { continue }\n\n let urlText = links[ln].text\n\n // Linkifier might send raw hostnames like \"example.com\", where url\n // starts with domain name. So we prepend http:// in those cases,\n // and remove it afterwards.\n //\n if (!links[ln].schema) {\n urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\\/\\//, '')\n } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {\n urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '')\n } else {\n urlText = state.md.normalizeLinkText(urlText)\n }\n\n const pos = links[ln].index\n\n if (pos > lastPos) {\n const token = new state.Token('text', '', 0)\n token.content = text.slice(lastPos, pos)\n token.level = level\n nodes.push(token)\n }\n\n const token_o = new state.Token('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.level = level++\n token_o.markup = 'linkify'\n token_o.info = 'auto'\n nodes.push(token_o)\n\n const token_t = new state.Token('text', '', 0)\n token_t.content = urlText\n token_t.level = level\n nodes.push(token_t)\n\n const token_c = new state.Token('link_close', 'a', -1)\n token_c.level = --level\n token_c.markup = 'linkify'\n token_c.info = 'auto'\n nodes.push(token_c)\n\n lastPos = links[ln].lastIndex\n }\n if (lastPos < text.length) {\n const token = new state.Token('text', '', 0)\n token.content = text.slice(lastPos)\n token.level = level\n nodes.push(token)\n }\n\n // replace current node\n blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes)\n }\n }\n }\n}\n","// Simple typographic replacements\n//\n// (c) (C) → ©\n// (tm) (TM) → â„¢\n// (r) (R) → ®\n// +- → ±\n// ... → … (also ?.... → ?.., !.... → !..)\n// ???????? → ???, !!!!! → !!!, `,,` → `,`\n// -- → –, --- → —\n//\n\n// TODO:\n// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾\n// - multiplications 2 x 4 -> 2 × 4\n\nconst RARE_RE = /\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/\n\n// Workaround for phantomjs - need regex without /g flag,\n// or root check will fail every second time\nconst SCOPED_ABBR_TEST_RE = /\\((c|tm|r)\\)/i\n\nconst SCOPED_ABBR_RE = /\\((c|tm|r)\\)/ig\nconst SCOPED_ABBR = {\n c: '©',\n r: '®',\n tm: 'â„¢'\n}\n\nfunction replaceFn (match, name) {\n return SCOPED_ABBR[name.toLowerCase()]\n}\n\nfunction replace_scoped (inlineTokens) {\n let inside_autolink = 0\n\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i]\n\n if (token.type === 'text' && !inside_autolink) {\n token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn)\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++\n }\n }\n}\n\nfunction replace_rare (inlineTokens) {\n let inside_autolink = 0\n\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i]\n\n if (token.type === 'text' && !inside_autolink) {\n if (RARE_RE.test(token.content)) {\n token.content = token.content\n .replace(/\\+-/g, '±')\n // .., ..., ....... -> …\n // but ?..... & !..... -> ?.. & !..\n .replace(/\\.{2,}/g, '…').replace(/([?!])…/g, '$1..')\n .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')\n // em-dash\n .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\\u2014')\n // en-dash\n .replace(/(^|\\s)--(?=\\s|$)/mg, '$1\\u2013')\n .replace(/(^|[^-\\s])--(?=[^-\\s]|$)/mg, '$1\\u2013')\n }\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++\n }\n }\n}\n\nexport default function replace (state) {\n let blkIdx\n\n if (!state.md.options.typographer) { return }\n\n for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== 'inline') { continue }\n\n if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {\n replace_scoped(state.tokens[blkIdx].children)\n }\n\n if (RARE_RE.test(state.tokens[blkIdx].content)) {\n replace_rare(state.tokens[blkIdx].children)\n }\n }\n}\n","// Convert straight quotation marks to typographic ones\n//\n\nimport { isWhiteSpace, isPunctChar, isMdAsciiPunct } from '../common/utils.mjs'\n\nconst QUOTE_TEST_RE = /['\"]/\nconst QUOTE_RE = /['\"]/g\nconst APOSTROPHE = '\\u2019' /* ’ */\n\nfunction replaceAt (str, index, ch) {\n return str.slice(0, index) + ch + str.slice(index + 1)\n}\n\nfunction process_inlines (tokens, state) {\n let j\n\n const stack = []\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n\n const thisLevel = tokens[i].level\n\n for (j = stack.length - 1; j >= 0; j--) {\n if (stack[j].level <= thisLevel) { break }\n }\n stack.length = j + 1\n\n if (token.type !== 'text') { continue }\n\n let text = token.content\n let pos = 0\n let max = text.length\n\n /* eslint no-labels:0,block-scoped-var:0 */\n OUTER:\n while (pos < max) {\n QUOTE_RE.lastIndex = pos\n const t = QUOTE_RE.exec(text)\n if (!t) { break }\n\n let canOpen = true\n let canClose = true\n pos = t.index + 1\n const isSingle = (t[0] === \"'\")\n\n // Find previous character,\n // default to space if it's the beginning of the line\n //\n let lastChar = 0x20\n\n if (t.index - 1 >= 0) {\n lastChar = text.charCodeAt(t.index - 1)\n } else {\n for (j = i - 1; j >= 0; j--) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // lastChar defaults to 0x20\n if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n\n lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1)\n break\n }\n }\n\n // Find next character,\n // default to space if it's the end of the line\n //\n let nextChar = 0x20\n\n if (pos < max) {\n nextChar = text.charCodeAt(pos)\n } else {\n for (j = i + 1; j < tokens.length; j++) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // nextChar defaults to 0x20\n if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n\n nextChar = tokens[j].content.charCodeAt(0)\n break\n }\n }\n\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar))\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar))\n\n const isLastWhiteSpace = isWhiteSpace(lastChar)\n const isNextWhiteSpace = isWhiteSpace(nextChar)\n\n if (isNextWhiteSpace) {\n canOpen = false\n } else if (isNextPunctChar) {\n if (!(isLastWhiteSpace || isLastPunctChar)) {\n canOpen = false\n }\n }\n\n if (isLastWhiteSpace) {\n canClose = false\n } else if (isLastPunctChar) {\n if (!(isNextWhiteSpace || isNextPunctChar)) {\n canClose = false\n }\n }\n\n if (nextChar === 0x22 /* \" */ && t[0] === '\"') {\n if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {\n // special case: 1\"\" - count first quote as an inch\n canClose = canOpen = false\n }\n }\n\n if (canOpen && canClose) {\n // Replace quotes in the middle of punctuation sequence, but not\n // in the middle of the words, i.e.:\n //\n // 1. foo \" bar \" baz - not replaced\n // 2. foo-\"-bar-\"-baz - replaced\n // 3. foo\"bar\"baz - not replaced\n //\n canOpen = isLastPunctChar\n canClose = isNextPunctChar\n }\n\n if (!canOpen && !canClose) {\n // middle of word\n if (isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE)\n }\n continue\n }\n\n if (canClose) {\n // this could be a closing quote, rewind the stack to get a match\n for (j = stack.length - 1; j >= 0; j--) {\n let item = stack[j]\n if (stack[j].level < thisLevel) { break }\n if (item.single === isSingle && stack[j].level === thisLevel) {\n item = stack[j]\n\n let openQuote\n let closeQuote\n if (isSingle) {\n openQuote = state.md.options.quotes[2]\n closeQuote = state.md.options.quotes[3]\n } else {\n openQuote = state.md.options.quotes[0]\n closeQuote = state.md.options.quotes[1]\n }\n\n // replace token.content *before* tokens[item.token].content,\n // because, if they are pointing at the same token, replaceAt\n // could mess up indices when quote length != 1\n token.content = replaceAt(token.content, t.index, closeQuote)\n tokens[item.token].content = replaceAt(\n tokens[item.token].content, item.pos, openQuote)\n\n pos += closeQuote.length - 1\n if (item.token === i) { pos += openQuote.length - 1 }\n\n text = token.content\n max = text.length\n\n stack.length = j\n continue OUTER\n }\n }\n }\n\n if (canOpen) {\n stack.push({\n token: i,\n pos: t.index,\n single: isSingle,\n level: thisLevel\n })\n } else if (canClose && isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE)\n }\n }\n }\n}\n\nexport default function smartquotes (state) {\n /* eslint max-depth:0 */\n if (!state.md.options.typographer) { return }\n\n for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== 'inline' ||\n !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {\n continue\n }\n\n process_inlines(state.tokens[blkIdx].children, state)\n }\n}\n","/** internal\n * class Core\n *\n * Top-level rules executor. Glues block/inline parsers and does intermediate\n * transformations.\n **/\n\nimport Ruler from './ruler.mjs'\nimport StateCore from './rules_core/state_core.mjs'\n\nimport r_normalize from './rules_core/normalize.mjs'\nimport r_block from './rules_core/block.mjs'\nimport r_inline from './rules_core/inline.mjs'\nimport r_linkify from './rules_core/linkify.mjs'\nimport r_replacements from './rules_core/replacements.mjs'\nimport r_smartquotes from './rules_core/smartquotes.mjs'\nimport r_text_join from './rules_core/text_join.mjs'\n\nconst _rules = [\n ['normalize', r_normalize],\n ['block', r_block],\n ['inline', r_inline],\n ['linkify', r_linkify],\n ['replacements', r_replacements],\n ['smartquotes', r_smartquotes],\n // `text_join` finds `text_special` tokens (for escape sequences)\n // and joins them with the rest of the text\n ['text_join', r_text_join]\n]\n\n/**\n * new Core()\n **/\nfunction Core () {\n /**\n * Core#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of core rules.\n **/\n this.ruler = new Ruler()\n\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1])\n }\n}\n\n/**\n * Core.process(state)\n *\n * Executes core chain rules.\n **/\nCore.prototype.process = function (state) {\n const rules = this.ruler.getRules('')\n\n for (let i = 0, l = rules.length; i < l; i++) {\n rules[i](state)\n }\n}\n\nCore.prototype.State = StateCore\n\nexport default Core\n","export default function block (state) {\n let token\n\n if (state.inlineMode) {\n token = new state.Token('inline', '', 0)\n token.content = state.src\n token.map = [0, 1]\n token.children = []\n state.tokens.push(token)\n } else {\n state.md.block.parse(state.src, state.md, state.env, state.tokens)\n }\n}\n","export default function inline (state) {\n const tokens = state.tokens\n\n // Parse inlines\n for (let i = 0, l = tokens.length; i < l; i++) {\n const tok = tokens[i]\n if (tok.type === 'inline') {\n state.md.inline.parse(tok.content, state.md, state.env, tok.children)\n }\n }\n}\n","// Join raw text tokens with the rest of the text\n//\n// This is set as a separate rule to provide an opportunity for plugins\n// to run text replacements after text join, but before escape join.\n//\n// For example, `\\:)` shouldn't be replaced with an emoji.\n//\n\nexport default function text_join (state) {\n let curr, last\n const blockTokens = state.tokens\n const l = blockTokens.length\n\n for (let j = 0; j < l; j++) {\n if (blockTokens[j].type !== 'inline') continue\n\n const tokens = blockTokens[j].children\n const max = tokens.length\n\n for (curr = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text_special') {\n tokens[curr].type = 'text'\n }\n }\n\n for (curr = last = 0; curr < max; curr++) {\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) {\n tokens.length = last\n }\n }\n}\n","// Parser state class\n\nimport Token from '../token.mjs'\nimport { isSpace } from '../common/utils.mjs'\n\nfunction StateBlock (src, md, env, tokens) {\n this.src = src\n\n // link to parser instance\n this.md = md\n\n this.env = env\n\n //\n // Internal state vartiables\n //\n\n this.tokens = tokens\n\n this.bMarks = [] // line begin offsets for fast jumps\n this.eMarks = [] // line end offsets for fast jumps\n this.tShift = [] // offsets of the first non-space characters (tabs not expanded)\n this.sCount = [] // indents for each line (tabs expanded)\n\n // An amount of virtual spaces (tabs expanded) between beginning\n // of each line (bMarks) and real beginning of that line.\n //\n // It exists only as a hack because blockquotes override bMarks\n // losing information in the process.\n //\n // It's used only when expanding tabs, you can think about it as\n // an initial tab length, e.g. bsCount=21 applied to string `\\t123`\n // means first tab should be expanded to 4-21%4 === 3 spaces.\n //\n this.bsCount = []\n\n // block parser variables\n\n // required block content indent (for example, if we are\n // inside a list, it would be positioned after list marker)\n this.blkIndent = 0\n this.line = 0 // line index in src\n this.lineMax = 0 // lines count\n this.tight = false // loose/tight mode for lists\n this.ddIndent = -1 // indent of the current dd block (-1 if there isn't any)\n this.listIndent = -1 // indent of the current list block (-1 if there isn't any)\n\n // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'\n // used in lists to determine if they interrupt a paragraph\n this.parentType = 'root'\n\n this.level = 0\n\n // Create caches\n // Generate markers.\n const s = this.src\n\n for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {\n const ch = s.charCodeAt(pos)\n\n if (!indent_found) {\n if (isSpace(ch)) {\n indent++\n\n if (ch === 0x09) {\n offset += 4 - offset % 4\n } else {\n offset++\n }\n continue\n } else {\n indent_found = true\n }\n }\n\n if (ch === 0x0A || pos === len - 1) {\n if (ch !== 0x0A) { pos++ }\n this.bMarks.push(start)\n this.eMarks.push(pos)\n this.tShift.push(indent)\n this.sCount.push(offset)\n this.bsCount.push(0)\n\n indent_found = false\n indent = 0\n offset = 0\n start = pos + 1\n }\n }\n\n // Push fake entry to simplify cache bounds checks\n this.bMarks.push(s.length)\n this.eMarks.push(s.length)\n this.tShift.push(0)\n this.sCount.push(0)\n this.bsCount.push(0)\n\n this.lineMax = this.bMarks.length - 1 // don't count last fake line\n}\n\n// Push new token to \"stream\".\n//\nStateBlock.prototype.push = function (type, tag, nesting) {\n const token = new Token(type, tag, nesting)\n token.block = true\n\n if (nesting < 0) this.level-- // closing tag\n token.level = this.level\n if (nesting > 0) this.level++ // opening tag\n\n this.tokens.push(token)\n return token\n}\n\nStateBlock.prototype.isEmpty = function isEmpty (line) {\n return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]\n}\n\nStateBlock.prototype.skipEmptyLines = function skipEmptyLines (from) {\n for (let max = this.lineMax; from < max; from++) {\n if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {\n break\n }\n }\n return from\n}\n\n// Skip spaces from given position.\nStateBlock.prototype.skipSpaces = function skipSpaces (pos) {\n for (let max = this.src.length; pos < max; pos++) {\n const ch = this.src.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n }\n return pos\n}\n\n// Skip spaces from given position in reverse.\nStateBlock.prototype.skipSpacesBack = function skipSpacesBack (pos, min) {\n if (pos <= min) { return pos }\n\n while (pos > min) {\n if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1 }\n }\n return pos\n}\n\n// Skip char codes from given position\nStateBlock.prototype.skipChars = function skipChars (pos, code) {\n for (let max = this.src.length; pos < max; pos++) {\n if (this.src.charCodeAt(pos) !== code) { break }\n }\n return pos\n}\n\n// Skip char codes reverse from given position - 1\nStateBlock.prototype.skipCharsBack = function skipCharsBack (pos, code, min) {\n if (pos <= min) { return pos }\n\n while (pos > min) {\n if (code !== this.src.charCodeAt(--pos)) { return pos + 1 }\n }\n return pos\n}\n\n// cut lines range from source.\nStateBlock.prototype.getLines = function getLines (begin, end, indent, keepLastLF) {\n if (begin >= end) {\n return ''\n }\n\n const queue = new Array(end - begin)\n\n for (let i = 0, line = begin; line < end; line++, i++) {\n let lineIndent = 0\n const lineStart = this.bMarks[line]\n let first = lineStart\n let last\n\n if (line + 1 < end || keepLastLF) {\n // No need for bounds check because we have fake entry on tail.\n last = this.eMarks[line] + 1\n } else {\n last = this.eMarks[line]\n }\n\n while (first < last && lineIndent < indent) {\n const ch = this.src.charCodeAt(first)\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4\n } else {\n lineIndent++\n }\n } else if (first - lineStart < this.tShift[line]) {\n // patched tShift masked characters to look like spaces (blockquotes, list markers)\n lineIndent++\n } else {\n break\n }\n\n first++\n }\n\n if (lineIndent > indent) {\n // partially expanding tabs in code blocks, e.g '\\t\\tfoobar'\n // with indent=2 becomes ' \\tfoobar'\n queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last)\n } else {\n queue[i] = this.src.slice(first, last)\n }\n }\n\n return queue.join('')\n}\n\n// re-export Token class to use in block rules\nStateBlock.prototype.Token = Token\n\nexport default StateBlock\n","// GFM table, https://github.github.com/gfm/#tables-extension-\n\nimport { isSpace } from '../common/utils.mjs'\n\n// Limit the amount of empty autocompleted cells in a table,\n// see https://github.com/markdown-it/markdown-it/issues/1000,\n//\n// Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k.\n// We set it to 65k, which can expand user input by a factor of x370\n// (256x256 square is 1.8kB expanded into 650kB).\nconst MAX_AUTOCOMPLETED_CELLS = 0x10000\n\nfunction getLine (state, line) {\n const pos = state.bMarks[line] + state.tShift[line]\n const max = state.eMarks[line]\n\n return state.src.slice(pos, max)\n}\n\nfunction escapedSplit (str) {\n const result = []\n const max = str.length\n\n let pos = 0\n let ch = str.charCodeAt(pos)\n let isEscaped = false\n let lastPos = 0\n let current = ''\n\n while (pos < max) {\n if (ch === 0x7c/* | */) {\n if (!isEscaped) {\n // pipe separating cells, '|'\n result.push(current + str.substring(lastPos, pos))\n current = ''\n lastPos = pos + 1\n } else {\n // escaped pipe, '\\|'\n current += str.substring(lastPos, pos - 1)\n lastPos = pos\n }\n }\n\n isEscaped = (ch === 0x5c/* \\ */)\n pos++\n\n ch = str.charCodeAt(pos)\n }\n\n result.push(current + str.substring(lastPos))\n\n return result\n}\n\nexport default function table (state, startLine, endLine, silent) {\n // should have at least two lines\n if (startLine + 2 > endLine) { return false }\n\n let nextLine = startLine + 1\n\n if (state.sCount[nextLine] < state.blkIndent) { return false }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false }\n\n // first character of the second line should be '|', '-', ':',\n // and no other characters are allowed but spaces;\n // basically, this is the equivalent of /^[-:|][-:|\\s]*$/ regexp\n\n let pos = state.bMarks[nextLine] + state.tShift[nextLine]\n if (pos >= state.eMarks[nextLine]) { return false }\n\n const firstCh = state.src.charCodeAt(pos++)\n if (firstCh !== 0x7C/* | */ && firstCh !== 0x2D/* - */ && firstCh !== 0x3A/* : */) { return false }\n\n if (pos >= state.eMarks[nextLine]) { return false }\n\n const secondCh = state.src.charCodeAt(pos++)\n if (secondCh !== 0x7C/* | */ && secondCh !== 0x2D/* - */ && secondCh !== 0x3A/* : */ && !isSpace(secondCh)) {\n return false\n }\n\n // if first character is '-', then second character must not be a space\n // (due to parsing ambiguity with list)\n if (firstCh === 0x2D/* - */ && isSpace(secondCh)) { return false }\n\n while (pos < state.eMarks[nextLine]) {\n const ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false }\n\n pos++\n }\n\n let lineText = getLine(state, startLine + 1)\n let columns = lineText.split('|')\n const aligns = []\n for (let i = 0; i < columns.length; i++) {\n const t = columns[i].trim()\n if (!t) {\n // allow empty columns before and after table, but not in between columns;\n // e.g. allow ` |---| `, disallow ` ---||--- `\n if (i === 0 || i === columns.length - 1) {\n continue\n } else {\n return false\n }\n }\n\n if (!/^:?-+:?$/.test(t)) { return false }\n if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {\n aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right')\n } else if (t.charCodeAt(0) === 0x3A/* : */) {\n aligns.push('left')\n } else {\n aligns.push('')\n }\n }\n\n lineText = getLine(state, startLine).trim()\n if (lineText.indexOf('|') === -1) { return false }\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n columns = escapedSplit(lineText)\n if (columns.length && columns[0] === '') columns.shift()\n if (columns.length && columns[columns.length - 1] === '') columns.pop()\n\n // header row will define an amount of columns in the entire table,\n // and align row should be exactly the same (the rest of the rows can differ)\n const columnCount = columns.length\n if (columnCount === 0 || columnCount !== aligns.length) { return false }\n\n if (silent) { return true }\n\n const oldParentType = state.parentType\n state.parentType = 'table'\n\n // use 'blockquote' lists for termination because it's\n // the most similar to tables\n const terminatorRules = state.md.block.ruler.getRules('blockquote')\n\n const token_to = state.push('table_open', 'table', 1)\n const tableLines = [startLine, 0]\n token_to.map = tableLines\n\n const token_tho = state.push('thead_open', 'thead', 1)\n token_tho.map = [startLine, startLine + 1]\n\n const token_htro = state.push('tr_open', 'tr', 1)\n token_htro.map = [startLine, startLine + 1]\n\n for (let i = 0; i < columns.length; i++) {\n const token_ho = state.push('th_open', 'th', 1)\n if (aligns[i]) {\n token_ho.attrs = [['style', 'text-align:' + aligns[i]]]\n }\n\n const token_il = state.push('inline', '', 0)\n token_il.content = columns[i].trim()\n token_il.children = []\n\n state.push('th_close', 'th', -1)\n }\n\n state.push('tr_close', 'tr', -1)\n state.push('thead_close', 'thead', -1)\n\n let tbodyLines\n let autocompletedCells = 0\n\n for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n if (terminate) { break }\n lineText = getLine(state, nextLine).trim()\n if (!lineText) { break }\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break }\n columns = escapedSplit(lineText)\n if (columns.length && columns[0] === '') columns.shift()\n if (columns.length && columns[columns.length - 1] === '') columns.pop()\n\n // note: autocomplete count can be negative if user specifies more columns than header,\n // but that does not affect intended use (which is limiting expansion)\n autocompletedCells += columnCount - columns.length\n if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { break }\n\n if (nextLine === startLine + 2) {\n const token_tbo = state.push('tbody_open', 'tbody', 1)\n token_tbo.map = tbodyLines = [startLine + 2, 0]\n }\n\n const token_tro = state.push('tr_open', 'tr', 1)\n token_tro.map = [nextLine, nextLine + 1]\n\n for (let i = 0; i < columnCount; i++) {\n const token_tdo = state.push('td_open', 'td', 1)\n if (aligns[i]) {\n token_tdo.attrs = [['style', 'text-align:' + aligns[i]]]\n }\n\n const token_il = state.push('inline', '', 0)\n token_il.content = columns[i] ? columns[i].trim() : ''\n token_il.children = []\n\n state.push('td_close', 'td', -1)\n }\n state.push('tr_close', 'tr', -1)\n }\n\n if (tbodyLines) {\n state.push('tbody_close', 'tbody', -1)\n tbodyLines[1] = nextLine\n }\n\n state.push('table_close', 'table', -1)\n tableLines[1] = nextLine\n\n state.parentType = oldParentType\n state.line = nextLine\n return true\n}\n","// Lists\n\nimport { isSpace } from '../common/utils.mjs'\n\n// Search `[-+*][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipBulletListMarker (state, startLine) {\n const max = state.eMarks[startLine]\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n\n const marker = state.src.charCodeAt(pos++)\n // Check bullet\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x2B/* + */) {\n return -1\n }\n\n if (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (!isSpace(ch)) {\n // \" -test \" - is not a list item\n return -1\n }\n }\n\n return pos\n}\n\n// Search `\\d+[.)][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipOrderedListMarker (state, startLine) {\n const start = state.bMarks[startLine] + state.tShift[startLine]\n const max = state.eMarks[startLine]\n let pos = start\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1 }\n\n let ch = state.src.charCodeAt(pos++)\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1 }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1 }\n\n ch = state.src.charCodeAt(pos++)\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1 }\n\n continue\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break\n }\n\n return -1\n }\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos)\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1\n }\n }\n return pos\n}\n\nfunction markTightParagraphs (state, idx) {\n const level = state.level + 2\n\n for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) {\n if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {\n state.tokens[i + 2].hidden = true\n state.tokens[i].hidden = true\n i += 2\n }\n }\n}\n\nexport default function list (state, startLine, endLine, silent) {\n let max, pos, start, token\n let nextLine = startLine\n let tight = true\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false }\n\n // Special case:\n // - item 1\n // - item 2\n // - item 3\n // - item 4\n // - this one is a paragraph continuation\n if (state.listIndent >= 0 &&\n state.sCount[nextLine] - state.listIndent >= 4 &&\n state.sCount[nextLine] < state.blkIndent) {\n return false\n }\n\n let isTerminatingParagraph = false\n\n // limit conditions when list can interrupt\n // a paragraph (validation mode only)\n if (silent && state.parentType === 'paragraph') {\n // Next list item should still terminate previous list item;\n //\n // This code can fail if plugins use blkIndent as well as lists,\n // but I hope the spec gets fixed long before that happens.\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n isTerminatingParagraph = true\n }\n }\n\n // Detect list type and position after marker\n let isOrdered\n let markerValue\n let posAfterMarker\n if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {\n isOrdered = true\n start = state.bMarks[nextLine] + state.tShift[nextLine]\n markerValue = Number(state.src.slice(start, posAfterMarker - 1))\n\n // If we're starting a new ordered list right after\n // a paragraph, it should start with 1.\n if (isTerminatingParagraph && markerValue !== 1) return false\n } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {\n isOrdered = false\n } else {\n return false\n }\n\n // If we're starting a new unordered list right after\n // a paragraph, first line should not be empty.\n if (isTerminatingParagraph) {\n if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false\n }\n\n // For validation mode we can terminate immediately\n if (silent) { return true }\n\n // We should terminate list on style change. Remember first one to compare.\n const markerCharCode = state.src.charCodeAt(posAfterMarker - 1)\n\n // Start list\n const listTokIdx = state.tokens.length\n\n if (isOrdered) {\n token = state.push('ordered_list_open', 'ol', 1)\n if (markerValue !== 1) {\n token.attrs = [['start', markerValue]]\n }\n } else {\n token = state.push('bullet_list_open', 'ul', 1)\n }\n\n const listLines = [nextLine, 0]\n token.map = listLines\n token.markup = String.fromCharCode(markerCharCode)\n\n //\n // Iterate list items\n //\n\n let prevEmptyEnd = false\n const terminatorRules = state.md.block.ruler.getRules('list')\n\n const oldParentType = state.parentType\n state.parentType = 'list'\n\n while (nextLine < endLine) {\n pos = posAfterMarker\n max = state.eMarks[nextLine]\n\n const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine])\n let offset = initial\n\n while (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine]) % 4\n } else if (ch === 0x20) {\n offset++\n } else {\n break\n }\n\n pos++\n }\n\n const contentStart = pos\n let indentAfterMarker\n\n if (contentStart >= max) {\n // trimming space in \"- \\n 3\" case, indent is 1 here\n indentAfterMarker = 1\n } else {\n indentAfterMarker = offset - initial\n }\n\n // If we have more than 4 spaces, the indent is 1\n // (the rest is just indented code block)\n if (indentAfterMarker > 4) { indentAfterMarker = 1 }\n\n // \" - test\"\n // ^^^^^ - calculating total length of this thing\n const indent = initial + indentAfterMarker\n\n // Run subparser & write tokens\n token = state.push('list_item_open', 'li', 1)\n token.markup = String.fromCharCode(markerCharCode)\n const itemLines = [nextLine, 0]\n token.map = itemLines\n if (isOrdered) {\n token.info = state.src.slice(start, posAfterMarker - 1)\n }\n\n // change current state, then restore it after parser subcall\n const oldTight = state.tight\n const oldTShift = state.tShift[nextLine]\n const oldSCount = state.sCount[nextLine]\n\n // - example list\n // ^ listIndent position will be here\n // ^ blkIndent position will be here\n //\n const oldListIndent = state.listIndent\n state.listIndent = state.blkIndent\n state.blkIndent = indent\n\n state.tight = true\n state.tShift[nextLine] = contentStart - state.bMarks[nextLine]\n state.sCount[nextLine] = offset\n\n if (contentStart >= max && state.isEmpty(nextLine + 1)) {\n // workaround for this case\n // (list item is empty, list terminates before \"foo\"):\n // ~~~~~~~~\n // -\n //\n // foo\n // ~~~~~~~~\n state.line = Math.min(state.line + 2, endLine)\n } else {\n state.md.block.tokenize(state, nextLine, endLine, true)\n }\n\n // If any of list item is tight, mark list as tight\n if (!state.tight || prevEmptyEnd) {\n tight = false\n }\n // Item become loose if finish with empty line,\n // but we should filter last element, because it means list finish\n prevEmptyEnd = (state.line - nextLine) > 1 && state.isEmpty(state.line - 1)\n\n state.blkIndent = state.listIndent\n state.listIndent = oldListIndent\n state.tShift[nextLine] = oldTShift\n state.sCount[nextLine] = oldSCount\n state.tight = oldTight\n\n token = state.push('list_item_close', 'li', -1)\n token.markup = String.fromCharCode(markerCharCode)\n\n nextLine = state.line\n itemLines[1] = nextLine\n\n if (nextLine >= endLine) { break }\n\n //\n // Try to check if list is terminated or continued.\n //\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break }\n\n // fail if terminating block found\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n\n // fail if list has another type\n if (isOrdered) {\n posAfterMarker = skipOrderedListMarker(state, nextLine)\n if (posAfterMarker < 0) { break }\n start = state.bMarks[nextLine] + state.tShift[nextLine]\n } else {\n posAfterMarker = skipBulletListMarker(state, nextLine)\n if (posAfterMarker < 0) { break }\n }\n\n if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break }\n }\n\n // Finalize list\n if (isOrdered) {\n token = state.push('ordered_list_close', 'ol', -1)\n } else {\n token = state.push('bullet_list_close', 'ul', -1)\n }\n token.markup = String.fromCharCode(markerCharCode)\n\n listLines[1] = nextLine\n state.line = nextLine\n\n state.parentType = oldParentType\n\n // mark paragraphs tight if needed\n if (tight) {\n markTightParagraphs(state, listTokIdx)\n }\n\n return true\n}\n","// List of valid html blocks names, according to commonmark spec\n// https://spec.commonmark.org/0.30/#html-blocks\n\nexport default [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n","// Regexps to match html elements\n\nconst attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'\n\nconst unquoted = '[^\"\\'=<>`\\\\x00-\\\\x20]+'\nconst single_quoted = \"'[^']*'\"\nconst double_quoted = '\"[^\"]*\"'\n\nconst attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'\n\nconst attribute = '(?:\\\\s+' + attr_name + '(?:\\\\s*=\\\\s*' + attr_value + ')?)'\n\nconst open_tag = '<[A-Za-z][A-Za-z0-9\\\\-]*' + attribute + '*\\\\s*\\\\/?>'\n\nconst close_tag = '<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>'\nconst comment = '<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->'\nconst processing = '<[?][\\\\s\\\\S]*?[?]>'\nconst declaration = '<![A-Za-z][^>]*>'\nconst cdata = '<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>'\n\nconst HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +\n '|' + processing + '|' + declaration + '|' + cdata + ')')\nconst HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')')\n\nexport { HTML_TAG_RE, HTML_OPEN_CLOSE_TAG_RE }\n","// HTML block\n\nimport block_names from '../common/html_blocks.mjs'\nimport { HTML_OPEN_CLOSE_TAG_RE } from '../common/html_re.mjs'\n\n// An array of opening and corresponding closing sequences for html tags,\n// last argument defines whether it can terminate a paragraph or not\n//\nconst HTML_SEQUENCES = [\n [/^<(script|pre|style|textarea)(?=(\\s|>|$))/i, /<\\/(script|pre|style|textarea)>/i, true],\n [/^<!--/, /-->/, true],\n [/^<\\?/, /\\?>/, true],\n [/^<![A-Z]/, />/, true],\n [/^<!\\[CDATA\\[/, /\\]\\]>/, true],\n [new RegExp('^</?(' + block_names.join('|') + ')(?=(\\\\s|/?>|$))', 'i'), /^$/, true],\n [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\\\s*$'), /^$/, false]\n]\n\nexport default function html_block (state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (!state.md.options.html) { return false }\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }\n\n let lineText = state.src.slice(pos, max)\n\n let i = 0\n for (; i < HTML_SEQUENCES.length; i++) {\n if (HTML_SEQUENCES[i][0].test(lineText)) { break }\n }\n if (i === HTML_SEQUENCES.length) { return false }\n\n if (silent) {\n // true if this sequence can be a terminator, false otherwise\n return HTML_SEQUENCES[i][2]\n }\n\n let nextLine = startLine + 1\n\n // If we are here - we detected HTML block.\n // Let's roll down till block end.\n if (!HTML_SEQUENCES[i][1].test(lineText)) {\n for (; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) { break }\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n lineText = state.src.slice(pos, max)\n\n if (HTML_SEQUENCES[i][1].test(lineText)) {\n if (lineText.length !== 0) { nextLine++ }\n break\n }\n }\n }\n\n state.line = nextLine\n\n const token = state.push('html_block', '', 0)\n token.map = [startLine, nextLine]\n token.content = state.getLines(startLine, nextLine, state.blkIndent, true)\n\n return true\n}\n","/** internal\n * class ParserBlock\n *\n * Block-level tokenizer.\n **/\n\nimport Ruler from './ruler.mjs'\nimport StateBlock from './rules_block/state_block.mjs'\n\nimport r_table from './rules_block/table.mjs'\nimport r_code from './rules_block/code.mjs'\nimport r_fence from './rules_block/fence.mjs'\nimport r_blockquote from './rules_block/blockquote.mjs'\nimport r_hr from './rules_block/hr.mjs'\nimport r_list from './rules_block/list.mjs'\nimport r_reference from './rules_block/reference.mjs'\nimport r_html_block from './rules_block/html_block.mjs'\nimport r_heading from './rules_block/heading.mjs'\nimport r_lheading from './rules_block/lheading.mjs'\nimport r_paragraph from './rules_block/paragraph.mjs'\n\nconst _rules = [\n // First 2 params - rule name & source. Secondary array - list of rules,\n // which can be terminated by this one.\n ['table', r_table, ['paragraph', 'reference']],\n ['code', r_code],\n ['fence', r_fence, ['paragraph', 'reference', 'blockquote', 'list']],\n ['blockquote', r_blockquote, ['paragraph', 'reference', 'blockquote', 'list']],\n ['hr', r_hr, ['paragraph', 'reference', 'blockquote', 'list']],\n ['list', r_list, ['paragraph', 'reference', 'blockquote']],\n ['reference', r_reference],\n ['html_block', r_html_block, ['paragraph', 'reference', 'blockquote']],\n ['heading', r_heading, ['paragraph', 'reference', 'blockquote']],\n ['lheading', r_lheading],\n ['paragraph', r_paragraph]\n]\n\n/**\n * new ParserBlock()\n **/\nfunction ParserBlock () {\n /**\n * ParserBlock#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of block rules.\n **/\n this.ruler = new Ruler()\n\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() })\n }\n}\n\n// Generate tokens for input range\n//\nParserBlock.prototype.tokenize = function (state, startLine, endLine) {\n const rules = this.ruler.getRules('')\n const len = rules.length\n const maxNesting = state.md.options.maxNesting\n let line = startLine\n let hasEmptyLines = false\n\n while (line < endLine) {\n state.line = line = state.skipEmptyLines(line)\n if (line >= endLine) { break }\n\n // Termination condition for nested calls.\n // Nested calls currently used for blockquotes & lists\n if (state.sCount[line] < state.blkIndent) { break }\n\n // If nesting level exceeded - skip tail to the end. That's not ordinary\n // situation and we should not care about content.\n if (state.level >= maxNesting) {\n state.line = endLine\n break\n }\n\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.line`\n // - update `state.tokens`\n // - return true\n const prevLine = state.line\n let ok = false\n\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, line, endLine, false)\n if (ok) {\n if (prevLine >= state.line) {\n throw new Error(\"block rule didn't increment state.line\")\n }\n break\n }\n }\n\n // this can only happen if user disables paragraph rule\n if (!ok) throw new Error('none of the block rules matched')\n\n // set state.tight if we had an empty line before current tag\n // i.e. latest empty line should not count\n state.tight = !hasEmptyLines\n\n // paragraph might \"eat\" one newline after it in nested lists\n if (state.isEmpty(state.line - 1)) {\n hasEmptyLines = true\n }\n\n line = state.line\n\n if (line < endLine && state.isEmpty(line)) {\n hasEmptyLines = true\n line++\n state.line = line\n }\n }\n}\n\n/**\n * ParserBlock.parse(str, md, env, outTokens)\n *\n * Process input string and push block tokens into `outTokens`\n **/\nParserBlock.prototype.parse = function (src, md, env, outTokens) {\n if (!src) { return }\n\n const state = new this.State(src, md, env, outTokens)\n\n this.tokenize(state, state.line, state.lineMax)\n}\n\nParserBlock.prototype.State = StateBlock\n\nexport default ParserBlock\n","// Code block (4 spaces padded)\n\nexport default function code (state, startLine, endLine/*, silent */) {\n if (state.sCount[startLine] - state.blkIndent < 4) { return false }\n\n let nextLine = startLine + 1\n let last = nextLine\n\n while (nextLine < endLine) {\n if (state.isEmpty(nextLine)) {\n nextLine++\n continue\n }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n nextLine++\n last = nextLine\n continue\n }\n break\n }\n\n state.line = last\n\n const token = state.push('code_block', 'code', 0)\n token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\\n'\n token.map = [startLine, state.line]\n\n return true\n}\n","// fences (``` lang, ~~~ lang)\n\nexport default function fence (state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (pos + 3 > max) { return false }\n\n const marker = state.src.charCodeAt(pos)\n\n if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {\n return false\n }\n\n // scan marker length\n let mem = pos\n pos = state.skipChars(pos, marker)\n\n let len = pos - mem\n\n if (len < 3) { return false }\n\n const markup = state.src.slice(mem, pos)\n const params = state.src.slice(pos, max)\n\n if (marker === 0x60 /* ` */) {\n if (params.indexOf(String.fromCharCode(marker)) >= 0) {\n return false\n }\n }\n\n // Since start is found, we can report success here in validation mode\n if (silent) { return true }\n\n // search end of block\n let nextLine = startLine\n let haveEndMarker = false\n\n for (;;) {\n nextLine++\n if (nextLine >= endLine) {\n // unclosed block should be autoclosed by end of document.\n // also block seems to be autoclosed by end of parent\n break\n }\n\n pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n\n if (pos < max && state.sCount[nextLine] < state.blkIndent) {\n // non-empty line with negative indent should stop the list:\n // - ```\n // test\n break\n }\n\n if (state.src.charCodeAt(pos) !== marker) { continue }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n // closing fence should be indented less than 4 spaces\n continue\n }\n\n pos = state.skipChars(pos, marker)\n\n // closing code fence must be at least as long as the opening one\n if (pos - mem < len) { continue }\n\n // make sure tail has spaces only\n pos = state.skipSpaces(pos)\n\n if (pos < max) { continue }\n\n haveEndMarker = true\n // found!\n break\n }\n\n // If a fence has heading spaces, they should be removed from its inner block\n len = state.sCount[startLine]\n\n state.line = nextLine + (haveEndMarker ? 1 : 0)\n\n const token = state.push('fence', 'code', 0)\n token.info = params\n token.content = state.getLines(startLine + 1, nextLine, len, true)\n token.markup = markup\n token.map = [startLine, state.line]\n\n return true\n}\n","// Block quotes\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function blockquote (state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n const oldLineMax = state.lineMax\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n // check the block quote marker\n if (state.src.charCodeAt(pos) !== 0x3E/* > */) { return false }\n\n // we know that it's going to be a valid blockquote,\n // so no point trying to find the end of it in silent mode\n if (silent) { return true }\n\n const oldBMarks = []\n const oldBSCount = []\n const oldSCount = []\n const oldTShift = []\n\n const terminatorRules = state.md.block.ruler.getRules('blockquote')\n\n const oldParentType = state.parentType\n state.parentType = 'blockquote'\n let lastLineEmpty = false\n let nextLine\n\n // Search the end of the block\n //\n // Block ends with either:\n // 1. an empty line outside:\n // ```\n // > test\n //\n // ```\n // 2. an empty line inside:\n // ```\n // >\n // test\n // ```\n // 3. another tag:\n // ```\n // > test\n // - - -\n // ```\n for (nextLine = startLine; nextLine < endLine; nextLine++) {\n // check if it's outdented, i.e. it's inside list item and indented\n // less than said list item:\n //\n // ```\n // 1. anything\n // > current blockquote\n // 2. checking this line\n // ```\n const isOutdented = state.sCount[nextLine] < state.blkIndent\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine]\n max = state.eMarks[nextLine]\n\n if (pos >= max) {\n // Case 1: line is not inside the blockquote, and this line is empty.\n break\n }\n\n if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {\n // This line is inside the blockquote.\n\n // set offset past spaces and \">\"\n let initial = state.sCount[nextLine] + 1\n let spaceAfterMarker\n let adjustTab\n\n // skip one optional space after '>'\n if (state.src.charCodeAt(pos) === 0x20 /* space */) {\n // ' > test '\n // ^ -- position start of line here:\n pos++\n initial++\n adjustTab = false\n spaceAfterMarker = true\n } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {\n spaceAfterMarker = true\n\n if ((state.bsCount[nextLine] + initial) % 4 === 3) {\n // ' >\\t test '\n // ^ -- position start of line here (tab has width===1)\n pos++\n initial++\n adjustTab = false\n } else {\n // ' >\\t test '\n // ^ -- position start of line here + shift bsCount slightly\n // to make extra space appear\n adjustTab = true\n }\n } else {\n spaceAfterMarker = false\n }\n\n let offset = initial\n oldBMarks.push(state.bMarks[nextLine])\n state.bMarks[nextLine] = pos\n\n while (pos < max) {\n const ch = state.src.charCodeAt(pos)\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4\n } else {\n offset++\n }\n } else {\n break\n }\n\n pos++\n }\n\n lastLineEmpty = pos >= max\n\n oldBSCount.push(state.bsCount[nextLine])\n state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0)\n\n oldSCount.push(state.sCount[nextLine])\n state.sCount[nextLine] = offset - initial\n\n oldTShift.push(state.tShift[nextLine])\n state.tShift[nextLine] = pos - state.bMarks[nextLine]\n continue\n }\n\n // Case 2: line is not inside the blockquote, and the last line was empty.\n if (lastLineEmpty) { break }\n\n // Case 3: another tag found.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n if (terminate) {\n // Quirk to enforce \"hard termination mode\" for paragraphs;\n // normally if you call `tokenize(state, startLine, nextLine)`,\n // paragraphs will look below nextLine for paragraph continuation,\n // but if blockquote is terminated by another tag, they shouldn't\n state.lineMax = nextLine\n\n if (state.blkIndent !== 0) {\n // state.blkIndent was non-zero, we now set it to zero,\n // so we need to re-calculate all offsets to appear as\n // if indent wasn't changed\n oldBMarks.push(state.bMarks[nextLine])\n oldBSCount.push(state.bsCount[nextLine])\n oldTShift.push(state.tShift[nextLine])\n oldSCount.push(state.sCount[nextLine])\n state.sCount[nextLine] -= state.blkIndent\n }\n\n break\n }\n\n oldBMarks.push(state.bMarks[nextLine])\n oldBSCount.push(state.bsCount[nextLine])\n oldTShift.push(state.tShift[nextLine])\n oldSCount.push(state.sCount[nextLine])\n\n // A negative indentation means that this is a paragraph continuation\n //\n state.sCount[nextLine] = -1\n }\n\n const oldIndent = state.blkIndent\n state.blkIndent = 0\n\n const token_o = state.push('blockquote_open', 'blockquote', 1)\n token_o.markup = '>'\n const lines = [startLine, 0]\n token_o.map = lines\n\n state.md.block.tokenize(state, startLine, nextLine)\n\n const token_c = state.push('blockquote_close', 'blockquote', -1)\n token_c.markup = '>'\n\n state.lineMax = oldLineMax\n state.parentType = oldParentType\n lines[1] = state.line\n\n // Restore original tShift; this might not be necessary since the parser\n // has already been here, but just to make sure we can do that.\n for (let i = 0; i < oldTShift.length; i++) {\n state.bMarks[i + startLine] = oldBMarks[i]\n state.tShift[i + startLine] = oldTShift[i]\n state.sCount[i + startLine] = oldSCount[i]\n state.bsCount[i + startLine] = oldBSCount[i]\n }\n state.blkIndent = oldIndent\n\n return true\n}\n","// Horizontal rule\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function hr (state, startLine, endLine, silent) {\n const max = state.eMarks[startLine]\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n const marker = state.src.charCodeAt(pos++)\n\n // Check hr marker\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x5F/* _ */) {\n return false\n }\n\n // markers can be mixed with spaces, but there should be at least 3 of them\n\n let cnt = 1\n while (pos < max) {\n const ch = state.src.charCodeAt(pos++)\n if (ch !== marker && !isSpace(ch)) { return false }\n if (ch === marker) { cnt++ }\n }\n\n if (cnt < 3) { return false }\n\n if (silent) { return true }\n\n state.line = startLine + 1\n\n const token = state.push('hr', 'hr', 0)\n token.map = [startLine, state.line]\n token.markup = Array(cnt + 1).join(String.fromCharCode(marker))\n\n return true\n}\n","import { isSpace, normalizeReference } from '../common/utils.mjs'\n\nexport default function reference (state, startLine, _endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n let nextLine = startLine + 1\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false }\n\n function getNextLine (nextLine) {\n const endLine = state.lineMax\n\n if (nextLine >= endLine || state.isEmpty(nextLine)) {\n // empty line or end of input\n return null\n }\n\n let isContinuation = false\n\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { isContinuation = true }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { isContinuation = true }\n\n if (!isContinuation) {\n const terminatorRules = state.md.block.ruler.getRules('reference')\n const oldParentType = state.parentType\n state.parentType = 'reference'\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n\n state.parentType = oldParentType\n if (terminate) {\n // terminated by another block\n return null\n }\n }\n\n const pos = state.bMarks[nextLine] + state.tShift[nextLine]\n const max = state.eMarks[nextLine]\n\n // max + 1 explicitly includes the newline\n return state.src.slice(pos, max + 1)\n }\n\n let str = state.src.slice(pos, max + 1)\n\n max = str.length\n let labelEnd = -1\n\n for (pos = 1; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x5B /* [ */) {\n return false\n } else if (ch === 0x5D /* ] */) {\n labelEnd = pos\n break\n } else if (ch === 0x0A /* \\n */) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (ch === 0x5C /* \\ */) {\n pos++\n if (pos < max && str.charCodeAt(pos) === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n }\n }\n }\n\n if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false }\n\n // [label]: destination 'title'\n // ^^^ skip optional whitespace here\n for (pos = labelEnd + 2; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (isSpace(ch)) {\n /* eslint no-empty:0 */\n } else {\n break\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^^^^^ parse this\n const destRes = state.md.helpers.parseLinkDestination(str, pos, max)\n if (!destRes.ok) { return false }\n\n const href = state.md.normalizeLink(destRes.str)\n if (!state.md.validateLink(href)) { return false }\n\n pos = destRes.pos\n\n // save cursor state, we could require to rollback later\n const destEndPos = pos\n const destEndLineNo = nextLine\n\n // [label]: destination 'title'\n // ^^^ skipping those spaces\n const start = pos\n for (; pos < max; pos++) {\n const ch = str.charCodeAt(pos)\n if (ch === 0x0A) {\n const lineContent = getNextLine(nextLine)\n if (lineContent !== null) {\n str += lineContent\n max = str.length\n nextLine++\n }\n } else if (isSpace(ch)) {\n /* eslint no-empty:0 */\n } else {\n break\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^ parse this\n let titleRes = state.md.helpers.parseLinkTitle(str, pos, max)\n while (titleRes.can_continue) {\n const lineContent = getNextLine(nextLine)\n if (lineContent === null) break\n str += lineContent\n pos = max\n max = str.length\n nextLine++\n titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes)\n }\n let title\n\n if (pos < max && start !== pos && titleRes.ok) {\n title = titleRes.str\n pos = titleRes.pos\n } else {\n title = ''\n pos = destEndPos\n nextLine = destEndLineNo\n }\n\n // skip trailing spaces until the rest of the line\n while (pos < max) {\n const ch = str.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n pos++\n }\n\n if (pos < max && str.charCodeAt(pos) !== 0x0A) {\n if (title) {\n // garbage at the end of the line after title,\n // but it could still be a valid reference if we roll back\n title = ''\n pos = destEndPos\n nextLine = destEndLineNo\n while (pos < max) {\n const ch = str.charCodeAt(pos)\n if (!isSpace(ch)) { break }\n pos++\n }\n }\n }\n\n if (pos < max && str.charCodeAt(pos) !== 0x0A) {\n // garbage at the end of the line\n return false\n }\n\n const label = normalizeReference(str.slice(1, labelEnd))\n if (!label) {\n // CommonMark 0.20 disallows empty labels\n return false\n }\n\n // Reference can not terminate anything. This check is for safety only.\n /* istanbul ignore if */\n if (silent) { return true }\n\n if (typeof state.env.references === 'undefined') {\n state.env.references = {}\n }\n if (typeof state.env.references[label] === 'undefined') {\n state.env.references[label] = { title, href }\n }\n\n state.line = nextLine\n return true\n}\n","// heading (#, ##, ...)\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function heading (state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine]\n let max = state.eMarks[startLine]\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n let ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x23/* # */ || pos >= max) { return false }\n\n // count heading level\n let level = 1\n ch = state.src.charCodeAt(++pos)\n while (ch === 0x23/* # */ && pos < max && level <= 6) {\n level++\n ch = state.src.charCodeAt(++pos)\n }\n\n if (level > 6 || (pos < max && !isSpace(ch))) { return false }\n\n if (silent) { return true }\n\n // Let's cut tails like ' ### ' from the end of string\n\n max = state.skipSpacesBack(max, pos)\n const tmp = state.skipCharsBack(max, 0x23, pos) // #\n if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {\n max = tmp\n }\n\n state.line = startLine + 1\n\n const token_o = state.push('heading_open', 'h' + String(level), 1)\n token_o.markup = '########'.slice(0, level)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = state.src.slice(pos, max).trim()\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n const token_c = state.push('heading_close', 'h' + String(level), -1)\n token_c.markup = '########'.slice(0, level)\n\n return true\n}\n","// lheading (---, ===)\n\nexport default function lheading (state, startLine, endLine/*, silent */) {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false }\n\n const oldParentType = state.parentType\n state.parentType = 'paragraph' // use paragraph to match terminatorRules\n\n // jump line-by-line until empty one or EOF\n let level = 0\n let marker\n let nextLine = startLine + 1\n\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n //\n // Check for underline in setext header\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n let pos = state.bMarks[nextLine] + state.tShift[nextLine]\n const max = state.eMarks[nextLine]\n\n if (pos < max) {\n marker = state.src.charCodeAt(pos)\n\n if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {\n pos = state.skipChars(pos, marker)\n pos = state.skipSpaces(pos)\n\n if (pos >= max) {\n level = (marker === 0x3D/* = */ ? 1 : 2)\n break\n }\n }\n }\n }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n if (!level) {\n // Didn't find valid underline\n return false\n }\n\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim()\n\n state.line = nextLine + 1\n\n const token_o = state.push('heading_open', 'h' + String(level), 1)\n token_o.markup = String.fromCharCode(marker)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line - 1]\n token_i.children = []\n\n const token_c = state.push('heading_close', 'h' + String(level), -1)\n token_c.markup = String.fromCharCode(marker)\n\n state.parentType = oldParentType\n\n return true\n}\n","// Paragraph\n\nexport default function paragraph (state, startLine, endLine) {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n const oldParentType = state.parentType\n let nextLine = startLine + 1\n state.parentType = 'paragraph'\n\n // jump line-by-line until empty one or EOF\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim()\n\n state.line = nextLine\n\n const token_o = state.push('paragraph_open', 'p', 1)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n state.push('paragraph_close', 'p', -1)\n\n state.parentType = oldParentType\n\n return true\n}\n","// Inline parser state\n\nimport Token from '../token.mjs'\nimport { isWhiteSpace, isPunctChar, isMdAsciiPunct } from '../common/utils.mjs'\n\nfunction StateInline (src, md, env, outTokens) {\n this.src = src\n this.env = env\n this.md = md\n this.tokens = outTokens\n this.tokens_meta = Array(outTokens.length)\n\n this.pos = 0\n this.posMax = this.src.length\n this.level = 0\n this.pending = ''\n this.pendingLevel = 0\n\n // Stores { start: end } pairs. Useful for backtrack\n // optimization of pairs parse (emphasis, strikes).\n this.cache = {}\n\n // List of emphasis-like delimiters for current tag\n this.delimiters = []\n\n // Stack of delimiter lists for upper level tags\n this._prev_delimiters = []\n\n // backtick length => last seen position\n this.backticks = {}\n this.backticksScanned = false\n\n // Counter used to disable inline linkify-it execution\n // inside <a> and markdown links\n this.linkLevel = 0\n}\n\n// Flush pending text\n//\nStateInline.prototype.pushPending = function () {\n const token = new Token('text', '', 0)\n token.content = this.pending\n token.level = this.pendingLevel\n this.tokens.push(token)\n this.pending = ''\n return token\n}\n\n// Push new token to \"stream\".\n// If pending text exists - flush it as text token\n//\nStateInline.prototype.push = function (type, tag, nesting) {\n if (this.pending) {\n this.pushPending()\n }\n\n const token = new Token(type, tag, nesting)\n let token_meta = null\n\n if (nesting < 0) {\n // closing tag\n this.level--\n this.delimiters = this._prev_delimiters.pop()\n }\n\n token.level = this.level\n\n if (nesting > 0) {\n // opening tag\n this.level++\n this._prev_delimiters.push(this.delimiters)\n this.delimiters = []\n token_meta = { delimiters: this.delimiters }\n }\n\n this.pendingLevel = this.level\n this.tokens.push(token)\n this.tokens_meta.push(token_meta)\n return token\n}\n\n// Scan a sequence of emphasis-like markers, and determine whether\n// it can start an emphasis sequence or end an emphasis sequence.\n//\n// - start - position to scan from (it should point at a valid marker);\n// - canSplitWord - determine if these markers can be found inside a word\n//\nStateInline.prototype.scanDelims = function (start, canSplitWord) {\n const max = this.posMax\n const marker = this.src.charCodeAt(start)\n\n // treat beginning of the line as a whitespace\n const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20\n\n let pos = start\n while (pos < max && this.src.charCodeAt(pos) === marker) { pos++ }\n\n const count = pos - start\n\n // treat end of the line as a whitespace\n const nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20\n\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar))\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar))\n\n const isLastWhiteSpace = isWhiteSpace(lastChar)\n const isNextWhiteSpace = isWhiteSpace(nextChar)\n\n const left_flanking =\n !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar)\n const right_flanking =\n !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar)\n\n const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar)\n const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar)\n\n return { can_open, can_close, length: count }\n}\n\n// re-export Token class to use in block rules\nStateInline.prototype.Token = Token\n\nexport default StateInline\n","// Skip text characters for text token, place those to pending buffer\n// and increment current pos\n\n// Rule to skip pure text\n// '{}$%@~+=:' reserved for extentions\n\n// !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n\n// !!!! Don't confuse with \"Markdown ASCII Punctuation\" chars\n// http://spec.commonmark.org/0.15/#ascii-punctuation-character\nfunction isTerminatorChar (ch) {\n switch (ch) {\n case 0x0A/* \\n */:\n case 0x21/* ! */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2D/* - */:\n case 0x3A/* : */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true\n default:\n return false\n }\n}\n\nexport default function text (state, silent) {\n let pos = state.pos\n\n while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {\n pos++\n }\n\n if (pos === state.pos) { return false }\n\n if (!silent) { state.pending += state.src.slice(state.pos, pos) }\n\n state.pos = pos\n\n return true\n}\n\n// Alternative implementation, for memory.\n//\n// It costs 10% of performance, but allows extend terminators list, if place it\n// to `ParserInline` property. Probably, will switch to it sometime, such\n// flexibility required.\n\n/*\nvar TERMINATOR_RE = /[\\n!#$%&*+\\-:<=>@[\\\\\\]^_`{}~]/;\n\nmodule.exports = function text(state, silent) {\n var pos = state.pos,\n idx = state.src.slice(pos).search(TERMINATOR_RE);\n\n // first char is terminator -> empty text\n if (idx === 0) { return false; }\n\n // no terminator -> text till end of string\n if (idx < 0) {\n if (!silent) { state.pending += state.src.slice(pos); }\n state.pos = state.src.length;\n return true;\n }\n\n if (!silent) { state.pending += state.src.slice(pos, pos + idx); }\n\n state.pos += idx;\n\n return true;\n}; */\n","// Process links like https://example.org/\n\n// RFC3986: scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\nconst SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i\n\nexport default function linkify (state, silent) {\n if (!state.md.options.linkify) return false\n if (state.linkLevel > 0) return false\n\n const pos = state.pos\n const max = state.posMax\n\n if (pos + 3 > max) return false\n if (state.src.charCodeAt(pos) !== 0x3A/* : */) return false\n if (state.src.charCodeAt(pos + 1) !== 0x2F/* / */) return false\n if (state.src.charCodeAt(pos + 2) !== 0x2F/* / */) return false\n\n const match = state.pending.match(SCHEME_RE)\n if (!match) return false\n\n const proto = match[1]\n\n const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length))\n if (!link) return false\n\n let url = link.url\n\n // invalid link, but still detected by linkify somehow;\n // need to check to prevent infinite loop below\n if (url.length <= proto.length) return false\n\n // disallow '*' at the end of the link (conflicts with emphasis)\n url = url.replace(/\\*+$/, '')\n\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) return false\n\n if (!silent) {\n state.pending = state.pending.slice(0, -proto.length)\n\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'linkify'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'linkify'\n token_c.info = 'auto'\n }\n\n state.pos += url.length - proto.length\n return true\n}\n","// Process escaped chars and hardbreaks\n\nimport { isSpace } from '../common/utils.mjs'\n\nconst ESCAPED = []\n\nfor (let i = 0; i < 256; i++) { ESCAPED.push(0) }\n\n'\\\\!\"#$%&\\'()*+,./:;<=>?@[]^_`{|}~-'\n .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1 })\n\nexport default function escape (state, silent) {\n let pos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(pos) !== 0x5C/* \\ */) return false\n pos++\n\n // '\\' at the end of the inline block\n if (pos >= max) return false\n\n let ch1 = state.src.charCodeAt(pos)\n\n if (ch1 === 0x0A) {\n if (!silent) {\n state.push('hardbreak', 'br', 0)\n }\n\n pos++\n // skip leading whitespaces from next line\n while (pos < max) {\n ch1 = state.src.charCodeAt(pos)\n if (!isSpace(ch1)) break\n pos++\n }\n\n state.pos = pos\n return true\n }\n\n let escapedStr = state.src[pos]\n\n if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) {\n const ch2 = state.src.charCodeAt(pos + 1)\n\n if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {\n escapedStr += state.src[pos + 1]\n pos++\n }\n }\n\n const origStr = '\\\\' + escapedStr\n\n if (!silent) {\n const token = state.push('text_special', '', 0)\n\n if (ch1 < 256 && ESCAPED[ch1] !== 0) {\n token.content = escapedStr\n } else {\n token.content = origStr\n }\n\n token.markup = origStr\n token.info = 'escape'\n }\n\n state.pos = pos + 1\n return true\n}\n","// ~~strike through~~\n//\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nfunction strikethrough_tokenize (state, silent) {\n const start = state.pos\n const marker = state.src.charCodeAt(start)\n\n if (silent) { return false }\n\n if (marker !== 0x7E/* ~ */) { return false }\n\n const scanned = state.scanDelims(state.pos, true)\n let len = scanned.length\n const ch = String.fromCharCode(marker)\n\n if (len < 2) { return false }\n\n let token\n\n if (len % 2) {\n token = state.push('text', '', 0)\n token.content = ch\n len--\n }\n\n for (let i = 0; i < len; i += 2) {\n token = state.push('text', '', 0)\n token.content = ch + ch\n\n state.delimiters.push({\n marker,\n length: 0, // disable \"rule of 3\" length checks meant for emphasis\n token: state.tokens.length - 1,\n end: -1,\n open: scanned.can_open,\n close: scanned.can_close\n })\n }\n\n state.pos += scanned.length\n\n return true\n}\n\nfunction postProcess (state, delimiters) {\n let token\n const loneMarkers = []\n const max = delimiters.length\n\n for (let i = 0; i < max; i++) {\n const startDelim = delimiters[i]\n\n if (startDelim.marker !== 0x7E/* ~ */) {\n continue\n }\n\n if (startDelim.end === -1) {\n continue\n }\n\n const endDelim = delimiters[startDelim.end]\n\n token = state.tokens[startDelim.token]\n token.type = 's_open'\n token.tag = 's'\n token.nesting = 1\n token.markup = '~~'\n token.content = ''\n\n token = state.tokens[endDelim.token]\n token.type = 's_close'\n token.tag = 's'\n token.nesting = -1\n token.markup = '~~'\n token.content = ''\n\n if (state.tokens[endDelim.token - 1].type === 'text' &&\n state.tokens[endDelim.token - 1].content === '~') {\n loneMarkers.push(endDelim.token - 1)\n }\n }\n\n // If a marker sequence has an odd number of characters, it's splitted\n // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the\n // start of the sequence.\n //\n // So, we have to move all those markers after subsequent s_close tags.\n //\n while (loneMarkers.length) {\n const i = loneMarkers.pop()\n let j = i + 1\n\n while (j < state.tokens.length && state.tokens[j].type === 's_close') {\n j++\n }\n\n j--\n\n if (i !== j) {\n token = state.tokens[j]\n state.tokens[j] = state.tokens[i]\n state.tokens[i] = token\n }\n }\n}\n\n// Walk through delimiter list and replace text tokens with tags\n//\nfunction strikethrough_postProcess (state) {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n postProcess(state, state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess(state, tokens_meta[curr].delimiters)\n }\n }\n}\n\nexport default {\n tokenize: strikethrough_tokenize,\n postProcess: strikethrough_postProcess\n}\n","// Process *this* and _that_\n//\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nfunction emphasis_tokenize (state, silent) {\n const start = state.pos\n const marker = state.src.charCodeAt(start)\n\n if (silent) { return false }\n\n if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false }\n\n const scanned = state.scanDelims(state.pos, marker === 0x2A)\n\n for (let i = 0; i < scanned.length; i++) {\n const token = state.push('text', '', 0)\n token.content = String.fromCharCode(marker)\n\n state.delimiters.push({\n // Char code of the starting marker (number).\n //\n marker,\n\n // Total length of these series of delimiters.\n //\n length: scanned.length,\n\n // A position of the token this delimiter corresponds to.\n //\n token: state.tokens.length - 1,\n\n // If this delimiter is matched as a valid opener, `end` will be\n // equal to its position, otherwise it's `-1`.\n //\n end: -1,\n\n // Boolean flags that determine if this delimiter could open or close\n // an emphasis.\n //\n open: scanned.can_open,\n close: scanned.can_close\n })\n }\n\n state.pos += scanned.length\n\n return true\n}\n\nfunction postProcess (state, delimiters) {\n const max = delimiters.length\n\n for (let i = max - 1; i >= 0; i--) {\n const startDelim = delimiters[i]\n\n if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {\n continue\n }\n\n // Process only opening markers\n if (startDelim.end === -1) {\n continue\n }\n\n const endDelim = delimiters[startDelim.end]\n\n // If the previous delimiter has the same marker and is adjacent to this one,\n // merge those into one strong delimiter.\n //\n // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`\n //\n const isStrong = i > 0 &&\n delimiters[i - 1].end === startDelim.end + 1 &&\n // check that first two markers match and adjacent\n delimiters[i - 1].marker === startDelim.marker &&\n delimiters[i - 1].token === startDelim.token - 1 &&\n // check that last two markers are adjacent (we can safely assume they match)\n delimiters[startDelim.end + 1].token === endDelim.token + 1\n\n const ch = String.fromCharCode(startDelim.marker)\n\n const token_o = state.tokens[startDelim.token]\n token_o.type = isStrong ? 'strong_open' : 'em_open'\n token_o.tag = isStrong ? 'strong' : 'em'\n token_o.nesting = 1\n token_o.markup = isStrong ? ch + ch : ch\n token_o.content = ''\n\n const token_c = state.tokens[endDelim.token]\n token_c.type = isStrong ? 'strong_close' : 'em_close'\n token_c.tag = isStrong ? 'strong' : 'em'\n token_c.nesting = -1\n token_c.markup = isStrong ? ch + ch : ch\n token_c.content = ''\n\n if (isStrong) {\n state.tokens[delimiters[i - 1].token].content = ''\n state.tokens[delimiters[startDelim.end + 1].token].content = ''\n i--\n }\n }\n}\n\n// Walk through delimiter list and replace text tokens with tags\n//\nfunction emphasis_post_process (state) {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n postProcess(state, state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess(state, tokens_meta[curr].delimiters)\n }\n }\n}\n\nexport default {\n tokenize: emphasis_tokenize,\n postProcess: emphasis_post_process\n}\n","// Process autolinks '<protocol:...>'\n\n/* eslint max-len:0 */\nconst EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/\n/* eslint-disable-next-line no-control-regex */\nconst AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\\x00-\\x20]*)$/\n\nexport default function autolink (state, silent) {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }\n\n const start = state.pos\n const max = state.posMax\n\n for (;;) {\n if (++pos >= max) return false\n\n const ch = state.src.charCodeAt(pos)\n\n if (ch === 0x3C /* < */) return false\n if (ch === 0x3E /* > */) break\n }\n\n const url = state.src.slice(start + 1, pos)\n\n if (AUTOLINK_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(url)\n if (!state.md.validateLink(fullUrl)) { return false }\n\n if (!silent) {\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'autolink'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'autolink'\n token_c.info = 'auto'\n }\n\n state.pos += url.length + 2\n return true\n }\n\n if (EMAIL_RE.test(url)) {\n const fullUrl = state.md.normalizeLink('mailto:' + url)\n if (!state.md.validateLink(fullUrl)) { return false }\n\n if (!silent) {\n const token_o = state.push('link_open', 'a', 1)\n token_o.attrs = [['href', fullUrl]]\n token_o.markup = 'autolink'\n token_o.info = 'auto'\n\n const token_t = state.push('text', '', 0)\n token_t.content = state.md.normalizeLinkText(url)\n\n const token_c = state.push('link_close', 'a', -1)\n token_c.markup = 'autolink'\n token_c.info = 'auto'\n }\n\n state.pos += url.length + 2\n return true\n }\n\n return false\n}\n","// Process html entity - {, ¯, ", ...\n\nimport { decodeHTML } from 'entities'\nimport { isValidEntityCode, fromCodePoint } from '../common/utils.mjs'\n\nconst DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i\nconst NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i\n\nexport default function entity (state, silent) {\n const pos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(pos) !== 0x26/* & */) return false\n\n if (pos + 1 >= max) return false\n\n const ch = state.src.charCodeAt(pos + 1)\n\n if (ch === 0x23 /* # */) {\n const match = state.src.slice(pos).match(DIGITAL_RE)\n if (match) {\n if (!silent) {\n const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10)\n\n const token = state.push('text_special', '', 0)\n token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD)\n token.markup = match[0]\n token.info = 'entity'\n }\n state.pos += match[0].length\n return true\n }\n } else {\n const match = state.src.slice(pos).match(NAMED_RE)\n if (match) {\n const decoded = decodeHTML(match[0])\n if (decoded !== match[0]) {\n if (!silent) {\n const token = state.push('text_special', '', 0)\n token.content = decoded\n token.markup = match[0]\n token.info = 'entity'\n }\n state.pos += match[0].length\n return true\n }\n }\n }\n\n return false\n}\n","// For each opening emphasis-like marker find a matching closing one\n//\n\nfunction processDelimiters (delimiters) {\n const openersBottom = {}\n const max = delimiters.length\n\n if (!max) return\n\n // headerIdx is the first delimiter of the current (where closer is) delimiter run\n let headerIdx = 0\n let lastTokenIdx = -2 // needs any value lower than -1\n const jumps = []\n\n for (let closerIdx = 0; closerIdx < max; closerIdx++) {\n const closer = delimiters[closerIdx]\n\n jumps.push(0)\n\n // markers belong to same delimiter run if:\n // - they have adjacent tokens\n // - AND markers are the same\n //\n if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {\n headerIdx = closerIdx\n }\n\n lastTokenIdx = closer.token\n\n // Length is only used for emphasis-specific \"rule of 3\",\n // if it's not defined (in strikethrough or 3rd party plugins),\n // we can default it to 0 to disable those checks.\n //\n closer.length = closer.length || 0\n\n if (!closer.close) continue\n\n // Previously calculated lower bounds (previous fails)\n // for each marker, each delimiter length modulo 3,\n // and for whether this closer can be an opener;\n // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460\n /* eslint-disable-next-line no-prototype-builtins */\n if (!openersBottom.hasOwnProperty(closer.marker)) {\n openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]\n }\n\n const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length % 3)]\n\n let openerIdx = headerIdx - jumps[headerIdx] - 1\n\n let newMinOpenerIdx = openerIdx\n\n for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {\n const opener = delimiters[openerIdx]\n\n if (opener.marker !== closer.marker) continue\n\n if (opener.open && opener.end < 0) {\n let isOddMatch = false\n\n // from spec:\n //\n // If one of the delimiters can both open and close emphasis, then the\n // sum of the lengths of the delimiter runs containing the opening and\n // closing delimiters must not be a multiple of 3 unless both lengths\n // are multiples of 3.\n //\n if (opener.close || closer.open) {\n if ((opener.length + closer.length) % 3 === 0) {\n if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {\n isOddMatch = true\n }\n }\n }\n\n if (!isOddMatch) {\n // If previous delimiter cannot be an opener, we can safely skip\n // the entire sequence in future checks. This is required to make\n // sure algorithm has linear complexity (see *_*_*_*_*_... case).\n //\n const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open\n ? jumps[openerIdx - 1] + 1\n : 0\n\n jumps[closerIdx] = closerIdx - openerIdx + lastJump\n jumps[openerIdx] = lastJump\n\n closer.open = false\n opener.end = closerIdx\n opener.close = false\n newMinOpenerIdx = -1\n // treat next token as start of run,\n // it optimizes skips in **<...>**a**<...>** pathological case\n lastTokenIdx = -2\n break\n }\n }\n }\n\n if (newMinOpenerIdx !== -1) {\n // If match for this delimiter run failed, we want to set lower bound for\n // future lookups. This is required to make sure algorithm has linear\n // complexity.\n //\n // See details here:\n // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442\n //\n openersBottom[closer.marker][(closer.open ? 3 : 0) + ((closer.length || 0) % 3)] = newMinOpenerIdx\n }\n }\n}\n\nexport default function link_pairs (state) {\n const tokens_meta = state.tokens_meta\n const max = state.tokens_meta.length\n\n processDelimiters(state.delimiters)\n\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n processDelimiters(tokens_meta[curr].delimiters)\n }\n }\n}\n","/** internal\n * class ParserInline\n *\n * Tokenizes paragraph content.\n **/\n\nimport Ruler from './ruler.mjs'\nimport StateInline from './rules_inline/state_inline.mjs'\n\nimport r_text from './rules_inline/text.mjs'\nimport r_linkify from './rules_inline/linkify.mjs'\nimport r_newline from './rules_inline/newline.mjs'\nimport r_escape from './rules_inline/escape.mjs'\nimport r_backticks from './rules_inline/backticks.mjs'\nimport r_strikethrough from './rules_inline/strikethrough.mjs'\nimport r_emphasis from './rules_inline/emphasis.mjs'\nimport r_link from './rules_inline/link.mjs'\nimport r_image from './rules_inline/image.mjs'\nimport r_autolink from './rules_inline/autolink.mjs'\nimport r_html_inline from './rules_inline/html_inline.mjs'\nimport r_entity from './rules_inline/entity.mjs'\n\nimport r_balance_pairs from './rules_inline/balance_pairs.mjs'\nimport r_fragments_join from './rules_inline/fragments_join.mjs'\n\n// Parser rules\n\nconst _rules = [\n ['text', r_text],\n ['linkify', r_linkify],\n ['newline', r_newline],\n ['escape', r_escape],\n ['backticks', r_backticks],\n ['strikethrough', r_strikethrough.tokenize],\n ['emphasis', r_emphasis.tokenize],\n ['link', r_link],\n ['image', r_image],\n ['autolink', r_autolink],\n ['html_inline', r_html_inline],\n ['entity', r_entity]\n]\n\n// `rule2` ruleset was created specifically for emphasis/strikethrough\n// post-processing and may be changed in the future.\n//\n// Don't use this for anything except pairs (plugins working with `balance_pairs`).\n//\nconst _rules2 = [\n ['balance_pairs', r_balance_pairs],\n ['strikethrough', r_strikethrough.postProcess],\n ['emphasis', r_emphasis.postProcess],\n // rules for pairs separate '**' into its own text tokens, which may be left unused,\n // rule below merges unused segments back with the rest of the text\n ['fragments_join', r_fragments_join]\n]\n\n/**\n * new ParserInline()\n **/\nfunction ParserInline () {\n /**\n * ParserInline#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of inline rules.\n **/\n this.ruler = new Ruler()\n\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1])\n }\n\n /**\n * ParserInline#ruler2 -> Ruler\n *\n * [[Ruler]] instance. Second ruler used for post-processing\n * (e.g. in emphasis-like rules).\n **/\n this.ruler2 = new Ruler()\n\n for (let i = 0; i < _rules2.length; i++) {\n this.ruler2.push(_rules2[i][0], _rules2[i][1])\n }\n}\n\n// Skip single token by running all rules in validation mode;\n// returns `true` if any rule reported success\n//\nParserInline.prototype.skipToken = function (state) {\n const pos = state.pos\n const rules = this.ruler.getRules('')\n const len = rules.length\n const maxNesting = state.md.options.maxNesting\n const cache = state.cache\n\n if (typeof cache[pos] !== 'undefined') {\n state.pos = cache[pos]\n return\n }\n\n let ok = false\n\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n // Increment state.level and decrement it later to limit recursion.\n // It's harmless to do here, because no tokens are created. But ideally,\n // we'd need a separate private state variable for this purpose.\n //\n state.level++\n ok = rules[i](state, true)\n state.level--\n\n if (ok) {\n if (pos >= state.pos) { throw new Error(\"inline rule didn't increment state.pos\") }\n break\n }\n }\n } else {\n // Too much nesting, just skip until the end of the paragraph.\n //\n // NOTE: this will cause links to behave incorrectly in the following case,\n // when an amount of `[` is exactly equal to `maxNesting + 1`:\n //\n // [[[[[[[[[[[[[[[[[[[[[foo]()\n //\n // TODO: remove this workaround when CM standard will allow nested links\n // (we can replace it by preventing links from being parsed in\n // validation mode)\n //\n state.pos = state.posMax\n }\n\n if (!ok) { state.pos++ }\n cache[pos] = state.pos\n}\n\n// Generate tokens for input range\n//\nParserInline.prototype.tokenize = function (state) {\n const rules = this.ruler.getRules('')\n const len = rules.length\n const end = state.posMax\n const maxNesting = state.md.options.maxNesting\n\n while (state.pos < end) {\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.pos`\n // - update `state.tokens`\n // - return true\n const prevPos = state.pos\n let ok = false\n\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, false)\n if (ok) {\n if (prevPos >= state.pos) { throw new Error(\"inline rule didn't increment state.pos\") }\n break\n }\n }\n }\n\n if (ok) {\n if (state.pos >= end) { break }\n continue\n }\n\n state.pending += state.src[state.pos++]\n }\n\n if (state.pending) {\n state.pushPending()\n }\n}\n\n/**\n * ParserInline.parse(str, md, env, outTokens)\n *\n * Process input string and push inline tokens into `outTokens`\n **/\nParserInline.prototype.parse = function (str, md, env, outTokens) {\n const state = new this.State(str, md, env, outTokens)\n\n this.tokenize(state)\n\n const rules = this.ruler2.getRules('')\n const len = rules.length\n\n for (let i = 0; i < len; i++) {\n rules[i](state)\n }\n}\n\nParserInline.prototype.State = StateInline\n\nexport default ParserInline\n","// Proceess '\\n'\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function newline (state, silent) {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x0A/* \\n */) { return false }\n\n const pmax = state.pending.length - 1\n const max = state.posMax\n\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {\n // Find whitespaces tail of pending chars.\n let ws = pmax - 1\n while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--\n\n state.pending = state.pending.slice(0, ws)\n state.push('hardbreak', 'br', 0)\n } else {\n state.pending = state.pending.slice(0, -1)\n state.push('softbreak', 'br', 0)\n }\n } else {\n state.push('softbreak', 'br', 0)\n }\n }\n\n pos++\n\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++ }\n\n state.pos = pos\n return true\n}\n","// Parse backticks\n\nexport default function backtick (state, silent) {\n let pos = state.pos\n const ch = state.src.charCodeAt(pos)\n\n if (ch !== 0x60/* ` */) { return false }\n\n const start = pos\n pos++\n const max = state.posMax\n\n // scan marker length\n while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++ }\n\n const marker = state.src.slice(start, pos)\n const openerLength = marker.length\n\n if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {\n if (!silent) state.pending += marker\n state.pos += openerLength\n return true\n }\n\n let matchEnd = pos\n let matchStart\n\n // Nothing found in the cache, scan until the end of the line (or until marker is found)\n while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {\n matchEnd = matchStart + 1\n\n // scan marker length\n while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++ }\n\n const closerLength = matchEnd - matchStart\n\n if (closerLength === openerLength) {\n // Found matching closer length.\n if (!silent) {\n const token = state.push('code_inline', 'code', 0)\n token.markup = marker\n token.content = state.src.slice(pos, matchStart)\n .replace(/\\n/g, ' ')\n .replace(/^ (.+) $/, '$1')\n }\n state.pos = matchEnd\n return true\n }\n\n // Some different length found, put it in cache as upper limit of where closer can be found\n state.backticks[closerLength] = matchStart\n }\n\n // Scanned through the end, didn't find anything\n state.backticksScanned = true\n\n if (!silent) state.pending += marker\n state.pos += openerLength\n return true\n}\n","// Process [link](<to> \"stuff\")\n\nimport { normalizeReference, isSpace } from '../common/utils.mjs'\n\nexport default function link (state, silent) {\n let code, label, res, ref\n let href = ''\n let title = ''\n let start = state.pos\n let parseReference = true\n\n if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false }\n\n const oldPos = state.pos\n const max = state.posMax\n const labelStart = state.pos + 1\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true)\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false }\n\n let pos = labelEnd + 1\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // might have found a valid shortcut link, disable reference parsing\n parseReference = false\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n pos++\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n if (pos >= max) { return false }\n\n // [link]( <href> \"title\" )\n // ^^^^^^ parsing link destination\n start = pos\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax)\n if (res.ok) {\n href = state.md.normalizeLink(res.str)\n if (state.md.validateLink(href)) {\n pos = res.pos\n } else {\n href = ''\n }\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n start = pos\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n\n // [link]( <href> \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax)\n if (pos < max && start !== pos && res.ok) {\n title = res.str\n pos = res.pos\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n }\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n // parsing a valid shortcut link failed, fallback to reference\n parseReference = true\n }\n pos++\n }\n\n if (parseReference) {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1\n pos = state.md.helpers.parseLinkLabel(state, pos)\n if (pos >= 0) {\n label = state.src.slice(start, pos++)\n } else {\n pos = labelEnd + 1\n }\n } else {\n pos = labelEnd + 1\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd) }\n\n ref = state.env.references[normalizeReference(label)]\n if (!ref) {\n state.pos = oldPos\n return false\n }\n href = ref.href\n title = ref.title\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n state.pos = labelStart\n state.posMax = labelEnd\n\n const token_o = state.push('link_open', 'a', 1)\n const attrs = [['href', href]]\n token_o.attrs = attrs\n if (title) {\n attrs.push(['title', title])\n }\n\n state.linkLevel++\n state.md.inline.tokenize(state)\n state.linkLevel--\n\n state.push('link_close', 'a', -1)\n }\n\n state.pos = pos\n state.posMax = max\n return true\n}\n","// Process \n\nimport { normalizeReference, isSpace } from '../common/utils.mjs'\n\nexport default function image (state, silent) {\n let code, content, label, pos, ref, res, title, start\n let href = ''\n const oldPos = state.pos\n const max = state.posMax\n\n if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false }\n if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false }\n\n const labelStart = state.pos + 2\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false)\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false }\n\n pos = labelEnd + 1\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n pos++\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n if (pos >= max) { return false }\n\n // [link]( <href> \"title\" )\n // ^^^^^^ parsing link destination\n start = pos\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax)\n if (res.ok) {\n href = state.md.normalizeLink(res.str)\n if (state.md.validateLink(href)) {\n pos = res.pos\n } else {\n href = ''\n }\n }\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n start = pos\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n\n // [link]( <href> \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax)\n if (pos < max && start !== pos && res.ok) {\n title = res.str\n pos = res.pos\n\n // [link]( <href> \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos)\n if (!isSpace(code) && code !== 0x0A) { break }\n }\n } else {\n title = ''\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n state.pos = oldPos\n return false\n }\n pos++\n } else {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1\n pos = state.md.helpers.parseLinkLabel(state, pos)\n if (pos >= 0) {\n label = state.src.slice(start, pos++)\n } else {\n pos = labelEnd + 1\n }\n } else {\n pos = labelEnd + 1\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd) }\n\n ref = state.env.references[normalizeReference(label)]\n if (!ref) {\n state.pos = oldPos\n return false\n }\n href = ref.href\n title = ref.title\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n content = state.src.slice(labelStart, labelEnd)\n\n const tokens = []\n state.md.inline.parse(\n content,\n state.md,\n state.env,\n tokens\n )\n\n const token = state.push('image', 'img', 0)\n const attrs = [['src', href], ['alt', '']]\n token.attrs = attrs\n token.children = tokens\n token.content = content\n\n if (title) {\n attrs.push(['title', title])\n }\n }\n\n state.pos = pos\n state.posMax = max\n return true\n}\n","// Process html tags\n\nimport { HTML_TAG_RE } from '../common/html_re.mjs'\n\nfunction isLinkOpen (str) {\n return /^<a[>\\s]/i.test(str)\n}\nfunction isLinkClose (str) {\n return /^<\\/a\\s*>/i.test(str)\n}\n\nfunction isLetter (ch) {\n /* eslint no-bitwise:0 */\n const lc = ch | 0x20 // to lower case\n return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */)\n}\n\nexport default function html_inline (state, silent) {\n if (!state.md.options.html) { return false }\n\n // Check start\n const max = state.posMax\n const pos = state.pos\n if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||\n pos + 2 >= max) {\n return false\n }\n\n // Quick fail on second char\n const ch = state.src.charCodeAt(pos + 1)\n if (ch !== 0x21/* ! */ &&\n ch !== 0x3F/* ? */ &&\n ch !== 0x2F/* / */ &&\n !isLetter(ch)) {\n return false\n }\n\n const match = state.src.slice(pos).match(HTML_TAG_RE)\n if (!match) { return false }\n\n if (!silent) {\n const token = state.push('html_inline', '', 0)\n token.content = match[0]\n\n if (isLinkOpen(token.content)) state.linkLevel++\n if (isLinkClose(token.content)) state.linkLevel--\n }\n state.pos += match[0].length\n return true\n}\n","// Clean up tokens after emphasis and strikethrough postprocessing:\n// merge adjacent text nodes into one and re-calculate all token levels\n//\n// This is necessary because initially emphasis delimiter markers (*, _, ~)\n// are treated as their own separate text tokens. Then emphasis rule either\n// leaves them as text (needed to merge with adjacent text) or turns them\n// into opening/closing tags (which messes up levels inside).\n//\n\nexport default function fragments_join (state) {\n let curr, last\n let level = 0\n const tokens = state.tokens\n const max = state.tokens.length\n\n for (curr = last = 0; curr < max; curr++) {\n // re-calculate levels after emphasis/strikethrough turns some text nodes\n // into opening/closing tags\n if (tokens[curr].nesting < 0) level-- // closing tag\n tokens[curr].level = level\n if (tokens[curr].nesting > 0) level++ // opening tag\n\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content\n } else {\n if (curr !== last) { tokens[last] = tokens[curr] }\n\n last++\n }\n }\n\n if (curr !== last) {\n tokens.length = last\n }\n}\n","import reFactory from './lib/re.mjs'\n\n//\n// Helpers\n//\n\n// Merge objects\n//\nfunction assign (obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1)\n\n sources.forEach(function (source) {\n if (!source) { return }\n\n Object.keys(source).forEach(function (key) {\n obj[key] = source[key]\n })\n })\n\n return obj\n}\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\nfunction isString (obj) { return _class(obj) === '[object String]' }\nfunction isObject (obj) { return _class(obj) === '[object Object]' }\nfunction isRegExp (obj) { return _class(obj) === '[object RegExp]' }\nfunction isFunction (obj) { return _class(obj) === '[object Function]' }\n\nfunction escapeRE (str) { return str.replace(/[.?*+^$[\\]\\\\(){}|-]/g, '\\\\$&') }\n\n//\n\nconst defaultOptions = {\n fuzzyLink: true,\n fuzzyEmail: true,\n fuzzyIP: false\n}\n\nfunction isOptionsObj (obj) {\n return Object.keys(obj || {}).reduce(function (acc, k) {\n /* eslint-disable-next-line no-prototype-builtins */\n return acc || defaultOptions.hasOwnProperty(k)\n }, false)\n}\n\nconst defaultSchemas = {\n 'http:': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.http = new RegExp(\n '^\\\\/\\\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'\n )\n }\n if (self.re.http.test(tail)) {\n return tail.match(self.re.http)[0].length\n }\n return 0\n }\n },\n 'https:': 'http:',\n 'ftp:': 'http:',\n '//': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.no_http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.no_http = new RegExp(\n '^' +\n self.re.src_auth +\n // Don't allow single-level domains, because of false positives like '//test'\n // with code comments\n '(?:localhost|(?:(?:' + self.re.src_domain + ')\\\\.)+' + self.re.src_domain_root + ')' +\n self.re.src_port +\n self.re.src_host_terminator +\n self.re.src_path,\n\n 'i'\n )\n }\n\n if (self.re.no_http.test(tail)) {\n // should not be `://` & `///`, that protects from errors in protocol name\n if (pos >= 3 && text[pos - 3] === ':') { return 0 }\n if (pos >= 3 && text[pos - 3] === '/') { return 0 }\n return tail.match(self.re.no_http)[0].length\n }\n return 0\n }\n },\n 'mailto:': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.mailto) {\n self.re.mailto = new RegExp(\n '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'\n )\n }\n if (self.re.mailto.test(tail)) {\n return tail.match(self.re.mailto)[0].length\n }\n return 0\n }\n }\n}\n\n// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)\n/* eslint-disable-next-line max-len */\nconst tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'\n\n// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead\nconst tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|')\n\nfunction resetScanCache (self) {\n self.__index__ = -1\n self.__text_cache__ = ''\n}\n\nfunction createValidator (re) {\n return function (text, pos) {\n const tail = text.slice(pos)\n\n if (re.test(tail)) {\n return tail.match(re)[0].length\n }\n return 0\n }\n}\n\nfunction createNormalizer () {\n return function (match, self) {\n self.normalize(match)\n }\n}\n\n// Schemas compiler. Build regexps.\n//\nfunction compile (self) {\n // Load & clone RE patterns.\n const re = self.re = reFactory(self.__opts__)\n\n // Define dynamic patterns\n const tlds = self.__tlds__.slice()\n\n self.onCompile()\n\n if (!self.__tlds_replaced__) {\n tlds.push(tlds_2ch_src_re)\n }\n tlds.push(re.src_xn)\n\n re.src_tlds = tlds.join('|')\n\n function untpl (tpl) { return tpl.replace('%TLDS%', re.src_tlds) }\n\n re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i')\n re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i')\n re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i')\n re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i')\n\n //\n // Compile each schema\n //\n\n const aliases = []\n\n self.__compiled__ = {} // Reset compiled data\n\n function schemaError (name, val) {\n throw new Error('(LinkifyIt) Invalid schema \"' + name + '\": ' + val)\n }\n\n Object.keys(self.__schemas__).forEach(function (name) {\n const val = self.__schemas__[name]\n\n // skip disabled methods\n if (val === null) { return }\n\n const compiled = { validate: null, link: null }\n\n self.__compiled__[name] = compiled\n\n if (isObject(val)) {\n if (isRegExp(val.validate)) {\n compiled.validate = createValidator(val.validate)\n } else if (isFunction(val.validate)) {\n compiled.validate = val.validate\n } else {\n schemaError(name, val)\n }\n\n if (isFunction(val.normalize)) {\n compiled.normalize = val.normalize\n } else if (!val.normalize) {\n compiled.normalize = createNormalizer()\n } else {\n schemaError(name, val)\n }\n\n return\n }\n\n if (isString(val)) {\n aliases.push(name)\n return\n }\n\n schemaError(name, val)\n })\n\n //\n // Compile postponed aliases\n //\n\n aliases.forEach(function (alias) {\n if (!self.__compiled__[self.__schemas__[alias]]) {\n // Silently fail on missed schemas to avoid errons on disable.\n // schemaError(alias, self.__schemas__[alias]);\n return\n }\n\n self.__compiled__[alias].validate =\n self.__compiled__[self.__schemas__[alias]].validate\n self.__compiled__[alias].normalize =\n self.__compiled__[self.__schemas__[alias]].normalize\n })\n\n //\n // Fake record for guessed links\n //\n self.__compiled__[''] = { validate: null, normalize: createNormalizer() }\n\n //\n // Build schema condition\n //\n const slist = Object.keys(self.__compiled__)\n .filter(function (name) {\n // Filter disabled & fake schemas\n return name.length > 0 && self.__compiled__[name]\n })\n .map(escapeRE)\n .join('|')\n // (?!_) cause 1.5x slowdown\n self.re.schema_test = RegExp('(^|(?!_)(?:[><\\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i')\n self.re.schema_search = RegExp('(^|(?!_)(?:[><\\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig')\n self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i')\n\n self.re.pretest = RegExp(\n '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@',\n 'i'\n )\n\n //\n // Cleanup\n //\n\n resetScanCache(self)\n}\n\n/**\n * class Match\n *\n * Match result. Single element of array, returned by [[LinkifyIt#match]]\n **/\nfunction Match (self, shift) {\n const start = self.__index__\n const end = self.__last_index__\n const text = self.__text_cache__.slice(start, end)\n\n /**\n * Match#schema -> String\n *\n * Prefix (protocol) for matched string.\n **/\n this.schema = self.__schema__.toLowerCase()\n /**\n * Match#index -> Number\n *\n * First position of matched string.\n **/\n this.index = start + shift\n /**\n * Match#lastIndex -> Number\n *\n * Next position after matched string.\n **/\n this.lastIndex = end + shift\n /**\n * Match#raw -> String\n *\n * Matched string.\n **/\n this.raw = text\n /**\n * Match#text -> String\n *\n * Notmalized text of matched string.\n **/\n this.text = text\n /**\n * Match#url -> String\n *\n * Normalized url of matched string.\n **/\n this.url = text\n}\n\nfunction createMatch (self, shift) {\n const match = new Match(self, shift)\n\n self.__compiled__[match.schema].normalize(match, self)\n\n return match\n}\n\n/**\n * class LinkifyIt\n **/\n\n/**\n * new LinkifyIt(schemas, options)\n * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Creates new linkifier instance with optional additional schemas.\n * Can be called without `new` keyword for convenience.\n *\n * By default understands:\n *\n * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n * - \"fuzzy\" links and emails (example.com, foo@bar.com).\n *\n * `schemas` is an object, where each key/value describes protocol/rule:\n *\n * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`\n * for example). `linkify-it` makes shure that prefix is not preceeded with\n * alphanumeric char and symbols. Only whitespaces and punctuation allowed.\n * - __value__ - rule to check tail after link prefix\n * - _String_ - just alias to existing rule\n * - _Object_\n * - _validate_ - validator function (should return matched length on success),\n * or `RegExp`.\n * - _normalize_ - optional function to normalize text & url of matched result\n * (for example, for @twitter mentions).\n *\n * `options`:\n *\n * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.\n * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts\n * like version numbers. Default `false`.\n * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.\n *\n **/\nfunction LinkifyIt (schemas, options) {\n if (!(this instanceof LinkifyIt)) {\n return new LinkifyIt(schemas, options)\n }\n\n if (!options) {\n if (isOptionsObj(schemas)) {\n options = schemas\n schemas = {}\n }\n }\n\n this.__opts__ = assign({}, defaultOptions, options)\n\n // Cache last tested result. Used to skip repeating steps on next `match` call.\n this.__index__ = -1\n this.__last_index__ = -1 // Next scan position\n this.__schema__ = ''\n this.__text_cache__ = ''\n\n this.__schemas__ = assign({}, defaultSchemas, schemas)\n this.__compiled__ = {}\n\n this.__tlds__ = tlds_default\n this.__tlds_replaced__ = false\n\n this.re = {}\n\n compile(this)\n}\n\n/** chainable\n * LinkifyIt#add(schema, definition)\n * - schema (String): rule name (fixed pattern prefix)\n * - definition (String|RegExp|Object): schema definition\n *\n * Add new rule definition. See constructor description for details.\n **/\nLinkifyIt.prototype.add = function add (schema, definition) {\n this.__schemas__[schema] = definition\n compile(this)\n return this\n}\n\n/** chainable\n * LinkifyIt#set(options)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Set recognition options for links without schema.\n **/\nLinkifyIt.prototype.set = function set (options) {\n this.__opts__ = assign(this.__opts__, options)\n return this\n}\n\n/**\n * LinkifyIt#test(text) -> Boolean\n *\n * Searches linkifiable pattern and returns `true` on success or `false` on fail.\n **/\nLinkifyIt.prototype.test = function test (text) {\n // Reset scan cache\n this.__text_cache__ = text\n this.__index__ = -1\n\n if (!text.length) { return false }\n\n let m, ml, me, len, shift, next, re, tld_pos, at_pos\n\n // try to scan for link with schema - that's the most simple rule\n if (this.re.schema_test.test(text)) {\n re = this.re.schema_search\n re.lastIndex = 0\n while ((m = re.exec(text)) !== null) {\n len = this.testSchemaAt(text, m[2], re.lastIndex)\n if (len) {\n this.__schema__ = m[2]\n this.__index__ = m.index + m[1].length\n this.__last_index__ = m.index + m[0].length + len\n break\n }\n }\n }\n\n if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {\n // guess schemaless links\n tld_pos = text.search(this.re.host_fuzzy_test)\n if (tld_pos >= 0) {\n // if tld is located after found link - no need to check fuzzy pattern\n if (this.__index__ < 0 || tld_pos < this.__index__) {\n if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {\n shift = ml.index + ml[1].length\n\n if (this.__index__ < 0 || shift < this.__index__) {\n this.__schema__ = ''\n this.__index__ = shift\n this.__last_index__ = ml.index + ml[0].length\n }\n }\n }\n }\n }\n\n if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {\n // guess schemaless emails\n at_pos = text.indexOf('@')\n if (at_pos >= 0) {\n // We can't skip this check, because this cases are possible:\n // 192.168.1.1@gmail.com, my.in@example.com\n if ((me = text.match(this.re.email_fuzzy)) !== null) {\n shift = me.index + me[1].length\n next = me.index + me[0].length\n\n if (this.__index__ < 0 || shift < this.__index__ ||\n (shift === this.__index__ && next > this.__last_index__)) {\n this.__schema__ = 'mailto:'\n this.__index__ = shift\n this.__last_index__ = next\n }\n }\n }\n }\n\n return this.__index__ >= 0\n}\n\n/**\n * LinkifyIt#pretest(text) -> Boolean\n *\n * Very quick check, that can give false positives. Returns true if link MAY BE\n * can exists. Can be used for speed optimization, when you need to check that\n * link NOT exists.\n **/\nLinkifyIt.prototype.pretest = function pretest (text) {\n return this.re.pretest.test(text)\n}\n\n/**\n * LinkifyIt#testSchemaAt(text, name, position) -> Number\n * - text (String): text to scan\n * - name (String): rule (schema) name\n * - position (Number): text offset to check from\n *\n * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly\n * at given position. Returns length of found pattern (0 on fail).\n **/\nLinkifyIt.prototype.testSchemaAt = function testSchemaAt (text, schema, pos) {\n // If not supported schema check requested - terminate\n if (!this.__compiled__[schema.toLowerCase()]) {\n return 0\n }\n return this.__compiled__[schema.toLowerCase()].validate(text, pos, this)\n}\n\n/**\n * LinkifyIt#match(text) -> Array|null\n *\n * Returns array of found link descriptions or `null` on fail. We strongly\n * recommend to use [[LinkifyIt#test]] first, for best speed.\n *\n * ##### Result match description\n *\n * - __schema__ - link schema, can be empty for fuzzy links, or `//` for\n * protocol-neutral links.\n * - __index__ - offset of matched text\n * - __lastIndex__ - index of next char after mathch end\n * - __raw__ - matched text\n * - __text__ - normalized text\n * - __url__ - link, generated from matched text\n **/\nLinkifyIt.prototype.match = function match (text) {\n const result = []\n let shift = 0\n\n // Try to take previous element from cache, if .test() called before\n if (this.__index__ >= 0 && this.__text_cache__ === text) {\n result.push(createMatch(this, shift))\n shift = this.__last_index__\n }\n\n // Cut head if cache was used\n let tail = shift ? text.slice(shift) : text\n\n // Scan string until end reached\n while (this.test(tail)) {\n result.push(createMatch(this, shift))\n\n tail = tail.slice(this.__last_index__)\n shift += this.__last_index__\n }\n\n if (result.length) {\n return result\n }\n\n return null\n}\n\n/**\n * LinkifyIt#matchAtStart(text) -> Match|null\n *\n * Returns fully-formed (not fuzzy) link if it starts at the beginning\n * of the string, and null otherwise.\n **/\nLinkifyIt.prototype.matchAtStart = function matchAtStart (text) {\n // Reset scan cache\n this.__text_cache__ = text\n this.__index__ = -1\n\n if (!text.length) return null\n\n const m = this.re.schema_at_start.exec(text)\n if (!m) return null\n\n const len = this.testSchemaAt(text, m[2], m[0].length)\n if (!len) return null\n\n this.__schema__ = m[2]\n this.__index__ = m.index + m[1].length\n this.__last_index__ = m.index + m[0].length + len\n\n return createMatch(this, 0)\n}\n\n/** chainable\n * LinkifyIt#tlds(list [, keepOld]) -> this\n * - list (Array): list of tlds\n * - keepOld (Boolean): merge with current list if `true` (`false` by default)\n *\n * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)\n * to avoid false positives. By default this algorythm used:\n *\n * - hostname with any 2-letter root zones are ok.\n * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф\n * are ok.\n * - encoded (`xn--...`) root zones are ok.\n *\n * If list is replaced, then exact match for 2-chars root zones will be checked.\n **/\nLinkifyIt.prototype.tlds = function tlds (list, keepOld) {\n list = Array.isArray(list) ? list : [list]\n\n if (!keepOld) {\n this.__tlds__ = list.slice()\n this.__tlds_replaced__ = true\n compile(this)\n return this\n }\n\n this.__tlds__ = this.__tlds__.concat(list)\n .sort()\n .filter(function (el, idx, arr) {\n return el !== arr[idx - 1]\n })\n .reverse()\n\n compile(this)\n return this\n}\n\n/**\n * LinkifyIt#normalize(match)\n *\n * Default normalizer (if schema does not define it's own).\n **/\nLinkifyIt.prototype.normalize = function normalize (match) {\n // Do minimal possible changes by default. Need to collect feedback prior\n // to move forward https://github.com/markdown-it/linkify-it/issues/1\n\n if (!match.schema) { match.url = 'http://' + match.url }\n\n if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {\n match.url = 'mailto:' + match.url\n }\n}\n\n/**\n * LinkifyIt#onCompile()\n *\n * Override to modify basic RegExp-s.\n **/\nLinkifyIt.prototype.onCompile = function onCompile () {\n}\n\nexport default LinkifyIt\n","import { Any, Cc, Z, P } from 'uc.micro'\n\nexport default function (opts) {\n const re = {}\n opts = opts || {}\n\n re.src_Any = Any.source\n re.src_Cc = Cc.source\n re.src_Z = Z.source\n re.src_P = P.source\n\n // \\p{\\Z\\P\\Cc\\CF} (white spaces + control + format + punctuation)\n re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|')\n\n // \\p{\\Z\\Cc} (white spaces + control)\n re.src_ZCc = [re.src_Z, re.src_Cc].join('|')\n\n // Experimental. List of chars, completely prohibited in links\n // because can separate it from other part of text\n const text_separators = '[><\\uff5c]'\n\n // All possible word characters (everything without punctuation, spaces & controls)\n // Defined via punctuation & spaces to save space\n // Should be something like \\p{\\L\\N\\S\\M} (\\w but without `_`)\n re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'\n // The same as abothe but without [0-9]\n // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';\n\n re.src_ip4 =\n\n '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'\n\n // Prohibit any of \"@/[]()\" in user/pass to avoid wrong domain fetch.\n re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\\\[\\\\]()]).)+@)?'\n\n re.src_port =\n\n '(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?'\n\n re.src_host_terminator =\n\n '(?=$|' + text_separators + '|' + re.src_ZPCc + ')' +\n '(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\\\d|\\\\.-|\\\\.(?!$|' + re.src_ZPCc + '))'\n\n re.src_path =\n\n '(?:' +\n '[/?#]' +\n '(?:' +\n '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\\\]{}.,\"\\'?!\\\\-;]).|' +\n '\\\\[(?:(?!' + re.src_ZCc + '|\\\\]).)*\\\\]|' +\n '\\\\((?:(?!' + re.src_ZCc + '|[)]).)*\\\\)|' +\n '\\\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\\\}|' +\n '\\\\\"(?:(?!' + re.src_ZCc + '|[\"]).)+\\\\\"|' +\n \"\\\\'(?:(?!\" + re.src_ZCc + \"|[']).)+\\\\'|\" +\n\n // allow `I'm_king` if no pair found\n \"\\\\'(?=\" + re.src_pseudo_letter + '|[-])|' +\n\n // google has many dots in \"google search\" links (#66, #81).\n // github has ... in commit range links,\n // Restrict to\n // - english\n // - percent-encoded\n // - parts of file path\n // - params separator\n // until more examples found.\n '\\\\.{2,}[a-zA-Z0-9%/&]|' +\n\n '\\\\.(?!' + re.src_ZCc + '|[.]|$)|' +\n (opts['---']\n ? '\\\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate\n : '\\\\-+|'\n ) +\n // allow `,,,` in paths\n ',(?!' + re.src_ZCc + '|$)|' +\n\n // allow `;` if not followed by space-like char\n ';(?!' + re.src_ZCc + '|$)|' +\n\n // allow `!!!` in paths, but not at the end\n '\\\\!+(?!' + re.src_ZCc + '|[!]|$)|' +\n\n '\\\\?(?!' + re.src_ZCc + '|[?]|$)' +\n ')+' +\n '|\\\\/' +\n ')?'\n\n // Allow anything in markdown spec, forbid quote (\") at the first position\n // because emails enclosed in quotes are far more common\n re.src_email_name =\n\n '[\\\\-;:&=\\\\+\\\\$,\\\\.a-zA-Z0-9_][\\\\-;:&=\\\\+\\\\$,\\\\\"\\\\.a-zA-Z0-9_]*'\n\n re.src_xn =\n\n 'xn--[a-z0-9\\\\-]{1,59}'\n\n // More to read about domain names\n // http://serverfault.com/questions/638260/\n\n re.src_domain_root =\n\n // Allow letters & digits (http://test1)\n '(?:' +\n re.src_xn +\n '|' +\n re.src_pseudo_letter + '{1,63}' +\n ')'\n\n re.src_domain =\n\n '(?:' +\n re.src_xn +\n '|' +\n '(?:' + re.src_pseudo_letter + ')' +\n '|' +\n '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +\n ')'\n\n re.src_host =\n\n '(?:' +\n // Don't need IP check, because digits are already allowed in normal domain names\n // src_ip4 +\n // '|' +\n '(?:(?:(?:' + re.src_domain + ')\\\\.)*' + re.src_domain/* _root */ + ')' +\n ')'\n\n re.tpl_host_fuzzy =\n\n '(?:' +\n re.src_ip4 +\n '|' +\n '(?:(?:(?:' + re.src_domain + ')\\\\.)+(?:%TLDS%))' +\n ')'\n\n re.tpl_host_no_ip_fuzzy =\n\n '(?:(?:(?:' + re.src_domain + ')\\\\.)+(?:%TLDS%))'\n\n re.src_host_strict =\n\n re.src_host + re.src_host_terminator\n\n re.tpl_host_fuzzy_strict =\n\n re.tpl_host_fuzzy + re.src_host_terminator\n\n re.src_host_port_strict =\n\n re.src_host + re.src_port + re.src_host_terminator\n\n re.tpl_host_port_fuzzy_strict =\n\n re.tpl_host_fuzzy + re.src_port + re.src_host_terminator\n\n re.tpl_host_port_no_ip_fuzzy_strict =\n\n re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator\n\n //\n // Main rules\n //\n\n // Rude test fuzzy links by host, for quick deny\n re.tpl_host_fuzzy_test =\n\n 'localhost|www\\\\.|\\\\.\\\\d{1,3}\\\\.|(?:\\\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'\n\n re.tpl_email_fuzzy =\n\n '(^|' + text_separators + '|\"|\\\\(|' + re.src_ZCc + ')' +\n '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'\n\n re.tpl_link_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n '(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|' + re.src_ZPCc + '))' +\n '((?![$+<=>^`|\\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'\n\n re.tpl_link_no_ip_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n '(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|' + re.src_ZPCc + '))' +\n '((?![$+<=>^`|\\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'\n\n return re\n}\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7F]/; // Note: U+007F DEL is excluded too.\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, callback) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = callback(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(domain, callback) {\n\tconst parts = domain.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tdomain = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tdomain = domain.replace(regexSeparators, '\\x2E');\n\tconst labels = domain.split('.');\n\tconst encoded = map(labels, callback).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint >= 0x30 && codePoint < 0x3A) {\n\t\treturn 26 + (codePoint - 0x30);\n\t}\n\tif (codePoint >= 0x41 && codePoint < 0x5B) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint >= 0x61 && codePoint < 0x7B) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tconst oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\t\t\tif (digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tconst inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tconst basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue === n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.3.1',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;\n","// Main parser class\n\nimport * as utils from './common/utils.mjs'\nimport * as helpers from './helpers/index.mjs'\nimport Renderer from './renderer.mjs'\nimport ParserCore from './parser_core.mjs'\nimport ParserBlock from './parser_block.mjs'\nimport ParserInline from './parser_inline.mjs'\nimport LinkifyIt from 'linkify-it'\nimport * as mdurl from 'mdurl'\nimport punycode from 'punycode.js'\n\nimport cfg_default from './presets/default.mjs'\nimport cfg_zero from './presets/zero.mjs'\nimport cfg_commonmark from './presets/commonmark.mjs'\n\nconst config = {\n default: cfg_default,\n zero: cfg_zero,\n commonmark: cfg_commonmark\n}\n\n//\n// This validator can prohibit more than really needed to prevent XSS. It's a\n// tradeoff to keep code simple and to be secure by default.\n//\n// If you need different setup - override validator method as you wish. Or\n// replace it with dummy function and use external sanitizer.\n//\n\nconst BAD_PROTO_RE = /^(vbscript|javascript|file|data):/\nconst GOOD_DATA_RE = /^data:image\\/(gif|png|jpeg|webp);/\n\nfunction validateLink (url) {\n // url should be normalized at this point, and existing entities are decoded\n const str = url.trim().toLowerCase()\n\n return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true\n}\n\nconst RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:']\n\nfunction normalizeLink (url) {\n const parsed = mdurl.parse(url, true)\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toASCII(parsed.hostname)\n } catch (er) { /**/ }\n }\n }\n\n return mdurl.encode(mdurl.format(parsed))\n}\n\nfunction normalizeLinkText (url) {\n const parsed = mdurl.parse(url, true)\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toUnicode(parsed.hostname)\n } catch (er) { /**/ }\n }\n }\n\n // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720\n return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + '%')\n}\n\n/**\n * class MarkdownIt\n *\n * Main parser/renderer class.\n *\n * ##### Usage\n *\n * ```javascript\n * // node.js, \"classic\" way:\n * var MarkdownIt = require('markdown-it'),\n * md = new MarkdownIt();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // node.js, the same, but with sugar:\n * var md = require('markdown-it')();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // browser without AMD, added to \"window\" on script load\n * // Note, there are no dash.\n * var md = window.markdownit();\n * var result = md.render('# markdown-it rulezz!');\n * ```\n *\n * Single line rendering, without paragraph wrap:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * var result = md.renderInline('__markdown-it__ rulezz!');\n * ```\n **/\n\n/**\n * new MarkdownIt([presetName, options])\n * - presetName (String): optional, `commonmark` / `zero`\n * - options (Object)\n *\n * Creates parser instanse with given config. Can be called without `new`.\n *\n * ##### presetName\n *\n * MarkdownIt provides named presets as a convenience to quickly\n * enable/disable active syntax rules and options for common use cases.\n *\n * - [\"commonmark\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) -\n * configures parser to strict [CommonMark](http://commonmark.org/) mode.\n * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) -\n * similar to GFM, used when no preset name given. Enables all available rules,\n * but still without html, typographer & autolinker.\n * - [\"zero\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) -\n * all rules disabled. Useful to quickly setup your config via `.enable()`.\n * For example, when you need only `bold` and `italic` markup and nothing else.\n *\n * ##### options:\n *\n * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!\n * That's not safe! You may need external sanitizer to protect output from XSS.\n * It's better to extend features via plugins, instead of enabling HTML.\n * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags\n * (`<br />`). This is needed only for full CommonMark compatibility. In real\n * world you will need HTML output.\n * - __breaks__ - `false`. Set `true` to convert `\\n` in paragraphs into `<br>`.\n * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.\n * Can be useful for external highlighters.\n * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.\n * - __typographer__ - `false`. Set `true` to enable [some language-neutral\n * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) +\n * quotes beautification (smartquotes).\n * - __quotes__ - `“â€â€˜â€™`, String or Array. Double + single quotes replacement\n * pairs, when typographer enabled and smartquotes on. For example, you can\n * use `'«»„“'` for Russian, `'„“‚‘'` for German, and\n * `['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›']` for French (including nbsp).\n * - __highlight__ - `null`. Highlighter function for fenced code blocks.\n * Highlighter `function (str, lang)` should return escaped HTML. It can also\n * return empty string if the source was not changed and should be escaped\n * externaly. If result starts with <pre... internal wrapper is skipped.\n *\n * ##### Example\n *\n * ```javascript\n * // commonmark mode\n * var md = require('markdown-it')('commonmark');\n *\n * // default mode\n * var md = require('markdown-it')();\n *\n * // enable everything\n * var md = require('markdown-it')({\n * html: true,\n * linkify: true,\n * typographer: true\n * });\n * ```\n *\n * ##### Syntax highlighting\n *\n * ```js\n * var hljs = require('highlight.js') // https://highlightjs.org/\n *\n * var md = require('markdown-it')({\n * highlight: function (str, lang) {\n * if (lang && hljs.getLanguage(lang)) {\n * try {\n * return hljs.highlight(str, { language: lang, ignoreIllegals: true }).value;\n * } catch (__) {}\n * }\n *\n * return ''; // use external default escaping\n * }\n * });\n * ```\n *\n * Or with full wrapper override (if you need assign class to `<pre>` or `<code>`):\n *\n * ```javascript\n * var hljs = require('highlight.js') // https://highlightjs.org/\n *\n * // Actual default values\n * var md = require('markdown-it')({\n * highlight: function (str, lang) {\n * if (lang && hljs.getLanguage(lang)) {\n * try {\n * return '<pre><code class=\"hljs\">' +\n * hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +\n * '</code></pre>';\n * } catch (__) {}\n * }\n *\n * return '<pre><code class=\"hljs\">' + md.utils.escapeHtml(str) + '</code></pre>';\n * }\n * });\n * ```\n *\n **/\nfunction MarkdownIt (presetName, options) {\n if (!(this instanceof MarkdownIt)) {\n return new MarkdownIt(presetName, options)\n }\n\n if (!options) {\n if (!utils.isString(presetName)) {\n options = presetName || {}\n presetName = 'default'\n }\n }\n\n /**\n * MarkdownIt#inline -> ParserInline\n *\n * Instance of [[ParserInline]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.inline = new ParserInline()\n\n /**\n * MarkdownIt#block -> ParserBlock\n *\n * Instance of [[ParserBlock]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.block = new ParserBlock()\n\n /**\n * MarkdownIt#core -> Core\n *\n * Instance of [[Core]] chain executor. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.core = new ParserCore()\n\n /**\n * MarkdownIt#renderer -> Renderer\n *\n * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering\n * rules for new token types, generated by plugins.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * function myToken(tokens, idx, options, env, self) {\n * //...\n * return result;\n * };\n *\n * md.renderer.rules['my_token'] = myToken\n * ```\n *\n * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs).\n **/\n this.renderer = new Renderer()\n\n /**\n * MarkdownIt#linkify -> LinkifyIt\n *\n * [linkify-it](https://github.com/markdown-it/linkify-it) instance.\n * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs)\n * rule.\n **/\n this.linkify = new LinkifyIt()\n\n /**\n * MarkdownIt#validateLink(url) -> Boolean\n *\n * Link validation function. CommonMark allows too much in links. By default\n * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas\n * except some embedded image types.\n *\n * You can change this behaviour:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * // enable everything\n * md.validateLink = function () { return true; }\n * ```\n **/\n this.validateLink = validateLink\n\n /**\n * MarkdownIt#normalizeLink(url) -> String\n *\n * Function used to encode link url to a machine-readable format,\n * which includes url-encoding, punycode, etc.\n **/\n this.normalizeLink = normalizeLink\n\n /**\n * MarkdownIt#normalizeLinkText(url) -> String\n *\n * Function used to decode link url to a human-readable format`\n **/\n this.normalizeLinkText = normalizeLinkText\n\n // Expose utils & helpers for easy acces from plugins\n\n /**\n * MarkdownIt#utils -> utils\n *\n * Assorted utility functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs).\n **/\n this.utils = utils\n\n /**\n * MarkdownIt#helpers -> helpers\n *\n * Link components parser functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).\n **/\n this.helpers = utils.assign({}, helpers)\n\n this.options = {}\n this.configure(presetName)\n\n if (options) { this.set(options) }\n}\n\n/** chainable\n * MarkdownIt.set(options)\n *\n * Set parser options (in the same format as in constructor). Probably, you\n * will never need it, but you can change options after constructor call.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .set({ html: true, breaks: true })\n * .set({ typographer, true });\n * ```\n *\n * __Note:__ To achieve the best possible performance, don't modify a\n * `markdown-it` instance options on the fly. If you need multiple configurations\n * it's best to create multiple instances and initialize each with separate\n * config.\n **/\nMarkdownIt.prototype.set = function (options) {\n utils.assign(this.options, options)\n return this\n}\n\n/** chainable, internal\n * MarkdownIt.configure(presets)\n *\n * Batch load of all options and compenent settings. This is internal method,\n * and you probably will not need it. But if you will - see available presets\n * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)\n *\n * We strongly recommend to use presets instead of direct config loads. That\n * will give better compatibility with next versions.\n **/\nMarkdownIt.prototype.configure = function (presets) {\n const self = this\n\n if (utils.isString(presets)) {\n const presetName = presets\n presets = config[presetName]\n if (!presets) { throw new Error('Wrong `markdown-it` preset \"' + presetName + '\", check name') }\n }\n\n if (!presets) { throw new Error('Wrong `markdown-it` preset, can\\'t be empty') }\n\n if (presets.options) { self.set(presets.options) }\n\n if (presets.components) {\n Object.keys(presets.components).forEach(function (name) {\n if (presets.components[name].rules) {\n self[name].ruler.enableOnly(presets.components[name].rules)\n }\n if (presets.components[name].rules2) {\n self[name].ruler2.enableOnly(presets.components[name].rules2)\n }\n })\n }\n return this\n}\n\n/** chainable\n * MarkdownIt.enable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to enable\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable list or rules. It will automatically find appropriate components,\n * containing rules with given names. If rule not found, and `ignoreInvalid`\n * not set - throws exception.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .enable(['sub', 'sup'])\n * .disable('smartquotes');\n * ```\n **/\nMarkdownIt.prototype.enable = function (list, ignoreInvalid) {\n let result = []\n\n if (!Array.isArray(list)) { list = [list] }\n\n ['core', 'block', 'inline'].forEach(function (chain) {\n result = result.concat(this[chain].ruler.enable(list, true))\n }, this)\n\n result = result.concat(this.inline.ruler2.enable(list, true))\n\n const missed = list.filter(function (name) { return result.indexOf(name) < 0 })\n\n if (missed.length && !ignoreInvalid) {\n throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed)\n }\n\n return this\n}\n\n/** chainable\n * MarkdownIt.disable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * The same as [[MarkdownIt.enable]], but turn specified rules off.\n **/\nMarkdownIt.prototype.disable = function (list, ignoreInvalid) {\n let result = []\n\n if (!Array.isArray(list)) { list = [list] }\n\n ['core', 'block', 'inline'].forEach(function (chain) {\n result = result.concat(this[chain].ruler.disable(list, true))\n }, this)\n\n result = result.concat(this.inline.ruler2.disable(list, true))\n\n const missed = list.filter(function (name) { return result.indexOf(name) < 0 })\n\n if (missed.length && !ignoreInvalid) {\n throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed)\n }\n return this\n}\n\n/** chainable\n * MarkdownIt.use(plugin, params)\n *\n * Load specified plugin with given params into current parser instance.\n * It's just a sugar to call `plugin(md, params)` with curring.\n *\n * ##### Example\n *\n * ```javascript\n * var iterator = require('markdown-it-for-inline');\n * var md = require('markdown-it')()\n * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {\n * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');\n * });\n * ```\n **/\nMarkdownIt.prototype.use = function (plugin /*, params, ... */) {\n const args = [this].concat(Array.prototype.slice.call(arguments, 1))\n plugin.apply(plugin, args)\n return this\n}\n\n/** internal\n * MarkdownIt.parse(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Parse input string and return list of block tokens (special token type\n * \"inline\" will contain list of inline tokens). You should not call this\n * method directly, until you write custom renderer (for example, to produce\n * AST).\n *\n * `env` is used to pass data between \"distributed\" rules and return additional\n * metadata like reference info, needed for the renderer. It also can be used to\n * inject data in specific cases. Usually, you will be ok to pass `{}`,\n * and then pass updated object to renderer.\n **/\nMarkdownIt.prototype.parse = function (src, env) {\n if (typeof src !== 'string') {\n throw new Error('Input data should be a String')\n }\n\n const state = new this.core.State(src, this, env)\n\n this.core.process(state)\n\n return state.tokens\n}\n\n/**\n * MarkdownIt.render(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Render markdown string into html. It does all magic for you :).\n *\n * `env` can be used to inject additional metadata (`{}` by default).\n * But you will not need it with high probability. See also comment\n * in [[MarkdownIt.parse]].\n **/\nMarkdownIt.prototype.render = function (src, env) {\n env = env || {}\n\n return this.renderer.render(this.parse(src, env), this.options, env)\n}\n\n/** internal\n * MarkdownIt.parseInline(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the\n * block tokens list with the single `inline` element, containing parsed inline\n * tokens in `children` property. Also updates `env` object.\n **/\nMarkdownIt.prototype.parseInline = function (src, env) {\n const state = new this.core.State(src, this, env)\n\n state.inlineMode = true\n this.core.process(state)\n\n return state.tokens\n}\n\n/**\n * MarkdownIt.renderInline(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Similar to [[MarkdownIt.render]] but for single paragraph content. Result\n * will NOT be wrapped into `<p>` tags.\n **/\nMarkdownIt.prototype.renderInline = function (src, env) {\n env = env || {}\n\n return this.renderer.render(this.parseInline(src, env), this.options, env)\n}\n\nexport default MarkdownIt\n","// markdown-it default options\n\nexport default {\n options: {\n // Enable HTML tags in source\n html: false,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: false,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “â€â€˜â€™ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 100\n },\n\n components: {\n core: {},\n block: {},\n inline: {}\n }\n}\n","// \"Zero\" preset, with nothing enabled. Useful for manual configuring of simple\n// modes. For example, to parse bold/italic only.\n\nexport default {\n options: {\n // Enable HTML tags in source\n html: false,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: false,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “â€â€˜â€™ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 20\n },\n\n components: {\n\n core: {\n rules: [\n 'normalize',\n 'block',\n 'inline',\n 'text_join'\n ]\n },\n\n block: {\n rules: [\n 'paragraph'\n ]\n },\n\n inline: {\n rules: [\n 'text'\n ],\n rules2: [\n 'balance_pairs',\n 'fragments_join'\n ]\n }\n }\n}\n","// Commonmark default options\n\nexport default {\n options: {\n // Enable HTML tags in source\n html: true,\n\n // Use '/' to close single tags (<br />)\n xhtmlOut: true,\n\n // Convert '\\n' in paragraphs into <br>\n breaks: false,\n\n // CSS language prefix for fenced blocks\n langPrefix: 'language-',\n\n // autoconvert URL-like texts to links\n linkify: false,\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “â€â€˜â€™ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with <pre... internal wrapper is skipped.\n //\n // function (/*str, lang*/) { return ''; }\n //\n highlight: null,\n\n // Internal protection, recursion limit\n maxNesting: 20\n },\n\n components: {\n\n core: {\n rules: [\n 'normalize',\n 'block',\n 'inline',\n 'text_join'\n ]\n },\n\n block: {\n rules: [\n 'blockquote',\n 'code',\n 'fence',\n 'heading',\n 'hr',\n 'html_block',\n 'lheading',\n 'list',\n 'reference',\n 'paragraph'\n ]\n },\n\n inline: {\n rules: [\n 'autolink',\n 'backticks',\n 'emphasis',\n 'entity',\n 'escape',\n 'html_inline',\n 'image',\n 'link',\n 'newline',\n 'text'\n ],\n rules2: [\n 'balance_pairs',\n 'emphasis',\n 'fragments_join'\n ]\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module markdown-gfm/commonmarkdataprocessor\n */\n\n/* eslint-env browser */\n\nimport {HtmlDataProcessor, DomConverter} from '@ckeditor/ckeditor5-engine';\nimport {highlightedCodeBlock} from 'turndown-plugin-gfm';\nimport TurndownService from 'turndown';\nimport {textNodesPreprocessor, linkPreprocessor, breaksPreprocessor} from './utils/preprocessor';\nimport {fixTasklistWhitespaces} from './utils/fix-tasklist-whitespaces';\nimport {fixBreaksInTables, fixBreaksInLists, fixBreaksOnRootLevel} from \"./utils/fix-breaks\";\nimport markdownIt from 'markdown-it';\nimport markdownItTaskLists from 'markdown-it-task-lists';\nimport {isPageBreakNode, PAGE_BREAK_MARKDOWN} from \"./utils/page-breaks\";\n\nexport const originalSrcAttribute = 'data-original-src';\n\n/**\n * This data processor implementation uses CommonMark as input/output data.\n *\n * @implements module:engine/dataprocessor/dataprocessor~DataProcessor\n */\nexport default class CommonMarkDataProcessor {\n\tconstructor(document) {\n\t\tthis._htmlDP = new HtmlDataProcessor(document);\n\t\tthis._domConverter = new DomConverter(document);\n\t}\n\n\t/**\n\t * Converts the provided CommonMark string to view tree.\n\t *\n\t * @param {String} data A CommonMark string.\n\t * @returns {module:engine/view/documentfragment~DocumentFragment} The converted view element.\n\t */\n\ttoView(data) {\n\t\tconst md = markdownIt({\n\t\t\t// Output html\n\t\t\thtml: true,\n\t\t\tbreaks: true,\n\t\t\t// Use GFM language fence prefix\n\t\t\tlangPrefix: 'language-'\n\t\t});\n\n\t\t// Use tasklist plugin\n\t\tlet parser = md.use(markdownItTaskLists, {label: true});\n\n\t\tconst previousRenderer = parser.renderer.rules.code_block;\n\t\tmd.renderer.rules.code_block = function (tokens, idx, options, env, self) {\n\t\t\t// markdown-it adds a newline to the end of code blocks, we need to remove it\n\t\t\ttokens[idx].content = tokens[idx].content.replace(/\\n$/, '');\n\t\t\treturn previousRenderer(tokens, idx, options, env, self);\n\t\t};\n\n\t\tconst html = parser.render(data);\n\n\t\t// Convert input HTML data to DOM DocumentFragment.\n\t\tconst domFragment = this._htmlDP._toDom(html);\n\n\t\t// Fix duplicate whitespace in task lists\n\t\tfixTasklistWhitespaces(domFragment);\n\n\t\t// Fix for multiple empty lines in markdown\n\t\tfixBreaksOnRootLevel(domFragment)\n\n\t\t// Fix for multiple empty lines in html tables\n\t\tfixBreaksInTables(domFragment)\n\n\t\t// Fix for multiple empty lines in markdown lists\n\t\tfixBreaksInLists(domFragment)\n\n\t\tconst viewFragment = this._domConverter.domToView(domFragment);\n\n\t\t// Convert DOM DocumentFragment to view DocumentFragment.\n\t\treturn viewFragment;\n\t}\n\n\t/**\n\t * Converts the provided {@link module:engine/view/documentfragment~DocumentFragment} to data format — in this\n\t * case to a CommonMark string.\n\t *\n\t * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment\n\t * @returns {String} CommonMark string.\n\t */\n\ttoData(viewFragment) {\n\t\t// Convert view DocumentFragment to DOM DocumentFragment.\n\t\tconst domFragment = this._domConverter.viewToDom(viewFragment, document);\n\n\t\t// Replace leading and trailing nbsp at the end of strong and em tags\n\t\t// with single spaces\n\t\ttextNodesPreprocessor(\n\t\t\tdomFragment,\n\t\t\t['strong', 'em'],\n\t\t\t// Ensure tables are allowed to have HTML contents\n\t\t\t// OP#29457\n\t\t\t['pre', 'code', 'table']\n\t\t);\n\n\t\t// Replace link attributes with their computed href attribute\n\t\tlinkPreprocessor(domFragment);\n\n\t\t// Turndown is filtering out empty paragraphs <p></p>, so we need to fix that with <p><br></p>\n\t\tbreaksPreprocessor(domFragment);\n\n\t\tconst blankReplacement = function (content, node) {\n\t\t\tif (node.tagName === 'CODE') {\n\t\t\t\t// we don't want to remove code silently\n\t\t\t\tconst prefix = (node.getAttribute('class') || '').replace('language-', '');\n\t\t\t\tconst textContent = node.textContent || '';\n\n\t\t\t\treturn \"```\" + prefix + '\\n' + (textContent.length ? textContent : '\\n') + \"```\\n\";\n\t\t\t\t// we don't want to remove pre silently\n\t\t\t} else if (node.tagName === 'PRE') {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t\treturn node.isBlock ? '\\n\\n' : ''\n\t\t};\n\n\t\t// Use Turndown to convert DOM fragment to markdown\n\t\tconst turndownService = new TurndownService({\n\t\t\theadingStyle: 'atx',\n\t\t\tcodeBlockStyle: 'fenced',\n\t\t\tblankReplacement: blankReplacement,\n\t\t});\n\n\t\tturndownService.use([\n\t\t\thighlightedCodeBlock,\n\t\t]);\n\n\t\t// Replace todolist with markdown representation\n\t\tturndownService.addRule('todolist', {\n\t\t\tfilter: function (node) {\n\t\t\t\t// check if we're a todo list item\n\t\t\t\tif (node.nodeName !== 'LI') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Check for a parent ul, this LI might however be in an OL item\n\t\t\t\tconst parentUl = node.closest('ul');\n\t\t\t\treturn parentUl && parentUl.classList.contains('todo-list');\n\t\t\t},\n\t\t\treplacement: function (content, node, options) {\n\t\t\t\tcontent = content\n\t\t\t\t\t.replace(/^\\n+/, '') // remove leading newlines\n\t\t\t\t\t.replace(/\\n+$/, '\\n') // replace trailing newlines with just a single one\n\t\t\t\t\t.replace(/\\n/gm, '\\n '); // indent\n\n\t\t\t\tconst prefix = options.bulletListMarker + ' ';\n\t\t\t\tconst input = node.querySelector('input[type=checkbox]');\n\t\t\t\tconst tasklist = (input && input.checked) ? '[x] ' : '[ ] ';\n\t\t\t\treturn prefix + tasklist + content + (node.nextSibling && !/\\n$/.test(content) ? '\\n' : '');\n\t\t\t}\n\t\t});\n\n\t\tturndownService.addRule('imageFigure', {\n\t\t\tfilter: 'img',\n\t\t\treplacement: function (content, node) {\n\t\t\t\tconst parent = node.parentElement;\n\t\t\t\tif (parent && parent.classList.contains('op-uc-figure--content')) {\n\t\t\t\t\treturn parent.parentElement.outerHTML;\n\t\t\t\t}\n\n\t\t\t\treturn node.outerHTML;\n\t\t\t}\n\t\t});\n\n\t\t// Remove figcaption text, it is processed together with the\n\t\t// figure and the image in the imageFigure rule\n\t\tturndownService.addRule('figcaption', {\n\t\t\tfilter: 'figcaption',\n\t\t\treplacement: function (_content, _node) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t});\n\n\t\tturndownService.addRule('markdownTables', {\n\t\t\tfilter: function (node) {\n\t\t\t\treturn node.nodeName === 'TABLE' && (!node.parentElement || node.parentElement.nodeName !== 'FIGURE');\n\t\t\t},\n\t\t\treplacement: function (_content, node) {\n\t\t\t\treturn node.outerHTML; // we do not convert back to markdown, but use HTML for tables\n\t\t\t}\n\t\t});\n\n\t\t// Keep HTML tables and remove filler elements\n\t\tturndownService.addRule('htmlTables', {\n\t\t\tfilter: function (node) {\n\t\t\t\tconst tables = node.getElementsByTagName('table');\n\t\t\t\t// check if we're a todo list item\n\t\t\t\treturn node.nodeName === 'FIGURE' && tables.length;\n\t\t\t},\n\t\t\treplacement: function (_content, node) {\n\t\t\t\t// Remove filler attribute, but keep empty lines\n\t\t\t\tnode.querySelectorAll('td br[data-cke-filler]')\n\t\t\t\t\t.forEach((node) => node.removeAttribute('data-cke-filler'));\n\n\t\t\t\treturn node.outerHTML;\n\t\t\t}\n\t\t});\n\n\t\tturndownService.addRule('strikethrough', {\n\t\t\tfilter: ['del', 's', 'strike'],\n\t\t\treplacement: function (content) {\n\t\t\t\treturn '~~' + content + '~~'\n\t\t\t}\n\t\t});\n\n\t\tturndownService.addRule('openProjectMacros', {\n\t\t\tfilter: ['macro'],\n\t\t\treplacement: (_content, node) => {\n\t\t\t\tnode.innerHTML = '';\n\t\t\t\tconst outer = node.outerHTML;\n\t\t\t\treturn outer.replace(\"</macro>\", \"\\n</macro>\")\n\t\t\t}\n\t\t});\n\n\t\tturndownService.addRule('mentions', {\n\t\t\tfilter: (node) => {\n\t\t\t\treturn (\n\t\t\t\t\tnode.nodeName === 'MENTION' &&\n\t\t\t\t\tnode.classList.contains('mention')\n\t\t\t\t)\n\t\t\t},\n\t\t\treplacement: (_content, node) => node.outerHTML,\n\t\t});\n\n\t\tturndownService.addRule('emptyParagraphs', {\n\t\t\tfilter: (node) => {\n\t\t\t\treturn (\n\t\t\t\t\t(node.nodeName === 'P') &&\n\t\t\t\t\t((node.childNodes.length === 0) ||\n\t\t\t\t\t\t(node.childNodes.length === 1 && node.childNodes[0].nodeName === 'BR')\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t},\n\t\t\treplacement: (_content, node) => {\n\t\t\t\tif (!node.parentElement && !node.nextSibling && !node.previousSibling) { //document with only one empty paragraph\n\t\t\t\t\treturn '';\n\t\t\t\t} else if (node.childNodes.length === 1 && isPageBreakNode(node.childNodes[0])) {\n\t\t\t\t\treturn PAGE_BREAK_MARKDOWN + '\\n\\n'\n\t\t\t\t} else {\n\t\t\t\t\treturn '<br>\\n\\n'\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tturndownService.addRule('openProjectPageBreak', {\n\t\t\tfilter: (node) => {\n\t\t\t\treturn (\n\t\t\t\t\tnode.nodeName === 'DIV' &&\n\t\t\t\t\tnode.classList.contains('page-break')\n\t\t\t\t)\n\t\t\t},\n\t\t\treplacement: (_content, _node) => {\n\t\t\t\t// return the page break in a format CKEditor detects as page break if rereading it\n\t\t\t\treturn PAGE_BREAK_MARKDOWN;\n\t\t\t}\n\t\t});\n\n\t\tlet turndown = turndownService.turndown(domFragment);\n\n\t\t// Escape non-breaking space characters\n\t\treturn turndown.replace(/\\u00A0/, ' ').replace('###turndown-ignore###\\n', '');\n\t}\n}\n","\n/**\n * Remove multiple whitespaces in task list text nodes\n */\nexport function fixTasklistWhitespaces(root) {\n\tlet walker = document.createNodeIterator(\n\t\troot,\n\t\t// Only consider text nodes\n\t\tNodeFilter.SHOW_TEXT,\n\t );\n\n\tlet node;\n\twhile(node = walker.nextNode()) {\n\t\t// Remove duplicate whitespace in tasklists\n\t\tif (node.previousElementSibling\n\t\t\t&& node.previousElementSibling.classList.contains('task-list-item-checkbox')) {\n\t\t\tnode.textContent = node.textContent.replace(/^\\s+/, '');\n\t\t}\n\t}\n}\n","import {isPageBreakNode} from \"./page-breaks\";\n\n/**\n * Remove breaks in empty table paragraphs\n *\n * CKEditor adds a superfluous break for paragraphs in tables containing only a break\n * e.g. `<td><p>Demo<p><p><br></p><p>End</p></td>` converted to `<td><p>Demo<p><p><br><br data-ck-filler=\"true\"></p><p>End</p></td>`\n * to avoid this, we remove the breaks, so CKEditor can add `<br data-ck-filler=\"true\">`\n * e.g. `<td><p>Demo<p><p><br></p><p>End</p></td>` converted to `<td><p>Demo<p><p><br data-ck-filler=\"true\"></p><p>End</p></td>` */\nexport function fixBreaksInTables(root) {\n\tconst walker = document.createNodeIterator(\n\t\troot,\n\t\t// Only consider element nodes\n\t\tNodeFilter.SHOW_ELEMENT,\n\t\t// Only except text nodes whose parent is one of parents\n\t\t{\n\t\t\tacceptNode: function (node) {\n\t\t\t\tif (node.tagName === 'P' && node.parentElement &&\n\t\t\t\t\tnode.parentElement.tagName === 'TD' &&\n\t\t\t\t\t(node.childNodes.length === 1 && node.childNodes[0].nodeName === 'BR')) {\n\t\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\n\tlet node;\n\twhile (node = walker.nextNode()) {\n\t\tnode.childNodes[0].remove();\n\t}\n}\n\n/**\n * Converts root level breaks into paragraphs\n *\n * CKEditor creates a paragraph for all consecutive breaks at the root level and adds an own filler break element\n * e.g. `<p>Demo<p><br><br><p>End</p>` converted to `<p>Demo</p><p><br><br><br data-ck-filler=\"true\"><p>End</p>`\n * to avoid these, we exchange all root level breaks with paragraphs\n * e.g. `<p>Demo<p><br><br><p>End</p>` will be converted to `<p>Demo</p><p></p><p></p><p>End</p>`\n * (except for page breaks, which are kept but are wrapped in a paragraph)\n */\nexport function fixBreaksOnRootLevel(root) {\n\tlet walker = document.createNodeIterator(\n\t\troot,\n\t\tNodeFilter.SHOW_ELEMENT,\n\t\t{\n\t\t\tacceptNode: function (node) {\n\t\t\t\tif (node.tagName === 'BR' && !node.parentElement) {\n\t\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\n\tlet node;\n\tlet list = []\n\twhile (node = walker.nextNode()) {\n\t\tlist.push(node);\n\t}\n\tfor (const node of list) {\n\t\tconst p = document.createElement('p');\n\t\troot.insertBefore(p, node);\n\t\tif (isPageBreakNode(node)) {\n\t\t\tp.appendChild(node);\n\t\t} else {\n\t\t\tnode.remove();\n\t\t}\n\t}\n}\n\n/**\n * Converts breaks in lists into paragraphs\n *\n * CKEditor creates a paragraph for all consecutive breaks and adds an own filler break element\n * e.g. `<li><p>Start</p><br><br><p>End</p></li>` converted to\n * `<li><p>Demo</p><p><br><br><br data-ck-filler=\"true\"></p><p>End</p>`\n * to avoid these, we exchange all root level breaks with paragraphs\n * e.g. `<li><p>Start</p><br><br><p>End</p></li>` will be converted to\n * `<li><p>Start</p><p></p><p></p><p>End</p></li>>`\n */\nexport function fixBreaksInLists(root) {\n\tconst walker = document.createNodeIterator(\n\t\troot,\n\t\tNodeFilter.SHOW_ELEMENT,\n\t\t{\n\t\t\tacceptNode: function (node) {\n\t\t\t\tif (node.tagName === 'BR' && node.parentElement && node.parentElement.tagName === 'LI') {\n\t\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\n\tlet node;\n\tlet list = []\n\twhile (node = walker.nextNode()) {\n\t\tlist.push(node);\n\t}\n\tfor (const node of list) {\n\t\tnode.parentElement.insertBefore(document.createElement('p'), node);\n\t\tnode.remove();\n\t}\n}\n","export default \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\"?>\\n<svg\\n xmlns:dc=\\\"http://purl.org/dc/elements/1.1/\\\"\\n xmlns:cc=\\\"http://creativecommons.org/ns#\\\"\\n xmlns:rdf=\\\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\\\"\\n xmlns:svg=\\\"http://www.w3.org/2000/svg\\\"\\n xmlns=\\\"http://www.w3.org/2000/svg\\\"\\n xmlns:sodipodi=\\\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\\\"\\n xmlns:inkscape=\\\"http://www.inkscape.org/namespaces/inkscape\\\"\\n class=\\\"ck ck-icon ck-button__icon\\\"\\n viewBox=\\\"0 0 20 20\\\"\\n version=\\\"1.1\\\"\\n id=\\\"svg10\\\"\\n sodipodi:docname=\\\"source.svg\\\"\\n inkscape:version=\\\"0.92.3 (2405546, 2018-03-11)\\\">\\n <defs\\n id=\\\"defs14\\\" />\\n <sodipodi:namedview\\n pagecolor=\\\"#ffffff\\\"\\n bordercolor=\\\"#666666\\\"\\n borderopacity=\\\"1\\\"\\n objecttolerance=\\\"10\\\"\\n gridtolerance=\\\"10\\\"\\n guidetolerance=\\\"10\\\"\\n inkscape:pageopacity=\\\"0\\\"\\n inkscape:pageshadow=\\\"2\\\"\\n inkscape:window-width=\\\"640\\\"\\n inkscape:window-height=\\\"480\\\"\\n id=\\\"namedview12\\\"\\n showgrid=\\\"false\\\"\\n inkscape:zoom=\\\"33.37544\\\"\\n inkscape:cx=\\\"10.656564\\\"\\n inkscape:cy=\\\"13.670445\\\"\\n inkscape:current-layer=\\\"svg10\\\" />\\n <g\\n id=\\\"g8\\\"\\n style=\\\"fill:#000000;fill-rule:evenodd\\\"\\n transform=\\\"matrix(0.8751128,0,0,0.8751128,4.2423992,5.525391)\\\">\\n <g\\n id=\\\"g6\\\"\\n style=\\\"fill:#000000\\\">\\n <g\\n transform=\\\"translate(2,5.6)\\\"\\n id=\\\"g4\\\"\\n style=\\\"fill:#000000\\\">\\n <path\\n d=\\\"M 10.5,0.1 15.7,4 v 1.3 l -5.6,4 C 10,9.5 9.8,9.5 9.6,9.5 9.3,9.4 9,8.8 9,8.5 L 9.3,8.1 14,4.6 9.5,1.4 9.3,1.2 C 9.2,0.9 9.2,0.6 9.3,0.4 9.5,0.2 9.8,0 10.1,0 a 0.8,0.8 0 0 1 0.4,0.1 z M 5.3,0.1 0,4 v 1.3 l 5.6,4 C 5.7,9.5 5.9,9.5 6.1,9.5 6.4,9.4 6.8,8.8 6.7,8.5 6.7,8.4 6.7,8.2 6.5,8.1 L 1.5,4.6 6.2,1.4 6.4,1.2 C 6.5,0.9 6.5,0.6 6.4,0.4 6.2,0.2 5.9,0 5.6,0 A 0.8,0.8 0 0 0 5.3,0.1 Z\\\"\\n id=\\\"path2\\\"\\n inkscape:connector-curvature=\\\"0\\\"\\n style=\\\"fill:#000000\\\" />\\n </g>\\n </g>\\n </g>\\n <metadata\\n id=\\\"metadata4596\\\">\\n <rdf:RDF>\\n <cc:Work\\n rdf:about=\\\"\\\">\\n <dc:title></dc:title>\\n <dc:format>image/svg+xml</dc:format>\\n <dc:type\\n rdf:resource=\\\"http://purl.org/dc/dcmitype/StillImage\\\" />\\n </cc:Work>\\n </rdf:RDF>\\n </metadata>\\n <path\\n style=\\\"stroke-width:0.0390625\\\"\\n d=\\\"M 1.2772336,0.02277222 V 20.022772 H 6.2381712 V 18.225897 H 3.0741087 V 1.8196472 h 8.2031253 l 3.554687,3.59375 v 3.5546875 h 1.796875 V 4.6712097 L 12.019421,0.02277222 Z\\\"\\n id=\\\"path2-3\\\"\\n inkscape:connector-curvature=\\\"0\\\" />\\n</svg>\\n\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module mention/mentioncommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { CKEditorError, toMap } from 'ckeditor5/src/utils.js';\nimport { _addMentionAttributes } from './mentionediting.js';\nconst BRACKET_PAIRS = {\n '(': ')',\n '[': ']',\n '{': '}'\n};\n/**\n * The mention command.\n *\n * The command is registered by {@link module:mention/mentionediting~MentionEditing} as `'mention'`.\n *\n * To insert a mention into a range, execute the command and specify a mention object with a range to replace:\n *\n * ```ts\n * const focus = editor.model.document.selection.focus;\n *\n * // It will replace one character before the selection focus with the '#1234' text\n * // with the mention attribute filled with passed attributes.\n * editor.execute( 'mention', {\n * \tmarker: '#',\n * \tmention: {\n * \t\tid: '#1234',\n * \t\tname: 'Foo',\n * \t\ttitle: 'Big Foo'\n * \t},\n * \trange: editor.model.createRange( focus.getShiftedBy( -1 ), focus )\n * } );\n *\n * // It will replace one character before the selection focus with the 'The \"Big Foo\"' text\n * // with the mention attribute filled with passed attributes.\n * editor.execute( 'mention', {\n * \tmarker: '#',\n * \tmention: {\n * \t\tid: '#1234',\n * \t\tname: 'Foo',\n * \t\ttitle: 'Big Foo'\n * \t},\n * \ttext: 'The \"Big Foo\"',\n * \trange: editor.model.createRange( focus.getShiftedBy( -1 ), focus )\n * } );\n *\t```\n */\nexport default class MentionCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // Since this command may pass range in execution parameters, it should be checked directly in execute block.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'mention');\n }\n /**\n * Executes the command.\n *\n * @param options Options for the executed command.\n * @param options.mention The mention object to insert. When a string is passed, it will be used to create a plain\n * object with the name attribute that equals the passed string.\n * @param options.marker The marker character (e.g. `'@'`).\n * @param options.text The text of the inserted mention. Defaults to the full mention string composed from `marker` and\n * `mention` string or `mention.id` if an object is passed.\n * @param options.range The range to replace.\n * Note that the replaced range might be shorter than the inserted text with the mention attribute.\n * @fires execute\n */\n execute(options) {\n const model = this.editor.model;\n const document = model.document;\n const selection = document.selection;\n const mentionData = typeof options.mention == 'string' ? { id: options.mention } : options.mention;\n const mentionID = mentionData.id;\n const range = options.range || selection.getFirstRange();\n // Don't execute command if range is in non-editable place.\n if (!model.canEditAt(range)) {\n return;\n }\n const mentionText = options.text || mentionID;\n const mention = _addMentionAttributes({ _text: mentionText, id: mentionID }, mentionData);\n if (options.marker.length != 1) {\n /**\n * The marker must be a single character.\n *\n * Correct markers: `'@'`, `'#'`.\n *\n * Incorrect markers: `'@@'`, `'[@'`.\n *\n * See {@link module:mention/mentionconfig~MentionConfig}.\n *\n * @error mentioncommand-incorrect-marker\n */\n throw new CKEditorError('mentioncommand-incorrect-marker', this);\n }\n if (mentionID.charAt(0) != options.marker) {\n /**\n * The feed item ID must start with the marker character.\n *\n * Correct mention feed setting:\n *\n * ```ts\n * mentions: [\n * \t{\n * \t\tmarker: '@',\n * \t\tfeed: [ '@Ann', '@Barney', ... ]\n * \t}\n * ]\n * ```\n *\n * Incorrect mention feed setting:\n *\n * ```ts\n * mentions: [\n * \t{\n * \t\tmarker: '@',\n * \t\tfeed: [ 'Ann', 'Barney', ... ]\n * \t}\n * ]\n * ```\n *\n * See {@link module:mention/mentionconfig~MentionConfig}.\n *\n * @error mentioncommand-incorrect-id\n */\n throw new CKEditorError('mentioncommand-incorrect-id', this);\n }\n model.change(writer => {\n const currentAttributes = toMap(selection.getAttributes());\n const attributesWithMention = new Map(currentAttributes.entries());\n attributesWithMention.set('mention', mention);\n // Replace a range with the text with a mention.\n const insertionRange = model.insertContent(writer.createText(mentionText, attributesWithMention), range);\n const nodeBefore = insertionRange.start.nodeBefore;\n const nodeAfter = insertionRange.end.nodeAfter;\n const isFollowedByWhiteSpace = nodeAfter && nodeAfter.is('$text') && nodeAfter.data.startsWith(' ');\n let isInsertedInBrackets = false;\n if (nodeBefore && nodeAfter && nodeBefore.is('$text') && nodeAfter.is('$text')) {\n const precedingCharacter = nodeBefore.data.slice(-1);\n const isPrecededByOpeningBracket = precedingCharacter in BRACKET_PAIRS;\n const isFollowedByBracketClosure = isPrecededByOpeningBracket && nodeAfter.data.startsWith(BRACKET_PAIRS[precedingCharacter]);\n isInsertedInBrackets = isPrecededByOpeningBracket && isFollowedByBracketClosure;\n }\n // Don't add a white space if either of the following is true:\n // * there's already one after the mention;\n // * the mention was inserted in the empty matching brackets.\n // https://github.com/ckeditor/ckeditor5/issues/4651\n if (!isInsertedInBrackets && !isFollowedByWhiteSpace) {\n model.insertContent(writer.createText(' ', currentAttributes), range.start.getShiftedBy(mentionText.length));\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module mention/mentionediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { uid } from 'ckeditor5/src/utils.js';\nimport MentionCommand from './mentioncommand.js';\n/**\n * The mention editing feature.\n *\n * It introduces the {@link module:mention/mentioncommand~MentionCommand command} and the `mention`\n * attribute in the {@link module:engine/model/model~Model model} which renders in the {@link module:engine/view/view view}\n * as a `<span class=\"mention\" data-mention=\"@mention\">`.\n */\nexport default class MentionEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'MentionEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const doc = model.document;\n // Allow the mention attribute on all text nodes.\n model.schema.extend('$text', { allowAttributes: 'mention' });\n // Upcast conversion.\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'span',\n key: 'data-mention',\n classes: 'mention'\n },\n model: {\n key: 'mention',\n value: (viewElement) => _toMentionAttribute(viewElement)\n }\n });\n // Downcast conversion.\n editor.conversion.for('downcast').attributeToElement({\n model: 'mention',\n view: createViewMentionElement\n });\n editor.conversion.for('downcast').add(preventPartialMentionDowncast);\n doc.registerPostFixer(writer => removePartialMentionPostFixer(writer, doc, model.schema));\n doc.registerPostFixer(writer => extendAttributeOnMentionPostFixer(writer, doc));\n doc.registerPostFixer(writer => selectionMentionAttributePostFixer(writer, doc));\n editor.commands.add('mention', new MentionCommand(editor));\n }\n}\n/**\n * @internal\n */\nexport function _addMentionAttributes(baseMentionData, data) {\n return Object.assign({ uid: uid() }, baseMentionData, data || {});\n}\n/**\n * Creates a mention attribute value from the provided view element and optional data.\n *\n * This function is exposed as\n * {@link module:mention/mention~Mention#toMentionAttribute `editor.plugins.get( 'Mention' ).toMentionAttribute()`}.\n *\n * @internal\n */\nexport function _toMentionAttribute(viewElementOrMention, data) {\n const dataMention = viewElementOrMention.getAttribute('data-mention');\n const textNode = viewElementOrMention.getChild(0);\n // Do not convert empty mentions.\n if (!textNode) {\n return;\n }\n const baseMentionData = {\n id: dataMention,\n _text: textNode.data\n };\n return _addMentionAttributes(baseMentionData, data);\n}\n/**\n * A converter that blocks partial mention from being converted.\n *\n * This converter is registered with 'highest' priority in order to consume mention attribute before it is converted by\n * any other converters. This converter only consumes partial mention - those whose `_text` attribute is not equal to text with mention\n * attribute. This may happen when copying part of mention text.\n */\nfunction preventPartialMentionDowncast(dispatcher) {\n dispatcher.on('attribute:mention', (evt, data, conversionApi) => {\n const mention = data.attributeNewValue;\n if (!data.item.is('$textProxy') || !mention) {\n return;\n }\n const start = data.range.start;\n const textNode = start.textNode || start.nodeAfter;\n if (textNode.data != mention._text) {\n // Consume item to prevent partial mention conversion.\n conversionApi.consumable.consume(data.item, evt.name);\n }\n }, { priority: 'highest' });\n}\n/**\n * Creates a mention element from the mention data.\n */\nfunction createViewMentionElement(mention, { writer }) {\n if (!mention) {\n return;\n }\n const attributes = {\n class: 'mention',\n 'data-mention': mention.id\n };\n const options = {\n id: mention.uid,\n priority: 20\n };\n return writer.createAttributeElement('span', attributes, options);\n}\n/**\n * Model post-fixer that disallows typing with selection when the selection is placed after the text node with the mention attribute or\n * before a text node with mention attribute.\n */\nfunction selectionMentionAttributePostFixer(writer, doc) {\n const selection = doc.selection;\n const focus = selection.focus;\n if (selection.isCollapsed && selection.hasAttribute('mention') && shouldNotTypeWithMentionAt(focus)) {\n writer.removeSelectionAttribute('mention');\n return true;\n }\n return false;\n}\n/**\n * Helper function to detect if mention attribute should be removed from selection.\n * This check makes only sense if the selection has mention attribute.\n *\n * The mention attribute should be removed from a selection when selection focus is placed:\n * a) after a text node\n * b) the position is at parents start - the selection will set attributes from node after.\n */\nfunction shouldNotTypeWithMentionAt(position) {\n const isAtStart = position.isAtStart;\n const isAfterAMention = position.nodeBefore && position.nodeBefore.is('$text');\n return isAfterAMention || isAtStart;\n}\n/**\n * Model post-fixer that removes the mention attribute from the modified text node.\n */\nfunction removePartialMentionPostFixer(writer, doc, schema) {\n const changes = doc.differ.getChanges();\n let wasChanged = false;\n for (const change of changes) {\n if (change.type == 'attribute') {\n continue;\n }\n // Checks the text node on the current position.\n const position = change.position;\n if (change.name == '$text') {\n const nodeAfterInsertedTextNode = position.textNode && position.textNode.nextSibling;\n // Checks the text node where the change occurred.\n wasChanged = checkAndFix(position.textNode, writer) || wasChanged;\n // Occurs on paste inside a text node with mention.\n wasChanged = checkAndFix(nodeAfterInsertedTextNode, writer) || wasChanged;\n wasChanged = checkAndFix(position.nodeBefore, writer) || wasChanged;\n wasChanged = checkAndFix(position.nodeAfter, writer) || wasChanged;\n }\n // Checks text nodes in inserted elements (might occur when splitting a paragraph or pasting content inside text with mention).\n if (change.name != '$text' && change.type == 'insert') {\n const insertedNode = position.nodeAfter;\n for (const item of writer.createRangeIn(insertedNode).getItems()) {\n wasChanged = checkAndFix(item, writer) || wasChanged;\n }\n }\n // Inserted inline elements might break mention.\n if (change.type == 'insert' && schema.isInline(change.name)) {\n const nodeAfterInserted = position.nodeAfter && position.nodeAfter.nextSibling;\n wasChanged = checkAndFix(position.nodeBefore, writer) || wasChanged;\n wasChanged = checkAndFix(nodeAfterInserted, writer) || wasChanged;\n }\n }\n return wasChanged;\n}\n/**\n * This post-fixer will extend the attribute applied on the part of the mention so the whole text node of the mention will have\n * the added attribute.\n */\nfunction extendAttributeOnMentionPostFixer(writer, doc) {\n const changes = doc.differ.getChanges();\n let wasChanged = false;\n for (const change of changes) {\n if (change.type === 'attribute' && change.attributeKey != 'mention') {\n // Checks the node on the left side of the range...\n const nodeBefore = change.range.start.nodeBefore;\n // ... and on the right side of the range.\n const nodeAfter = change.range.end.nodeAfter;\n for (const node of [nodeBefore, nodeAfter]) {\n if (isBrokenMentionNode(node) && node.getAttribute(change.attributeKey) != change.attributeNewValue) {\n writer.setAttribute(change.attributeKey, change.attributeNewValue, node);\n wasChanged = true;\n }\n }\n }\n }\n return wasChanged;\n}\n/**\n * Checks if a node has a correct mention attribute if present.\n * Returns `true` if the node is text and has a mention attribute whose text does not match the expected mention text.\n */\nfunction isBrokenMentionNode(node) {\n if (!node || !(node.is('$text') || node.is('$textProxy')) || !node.hasAttribute('mention')) {\n return false;\n }\n const text = node.data;\n const mention = node.getAttribute('mention');\n const expectedText = mention._text;\n return text != expectedText;\n}\n/**\n * Fixes a mention on a text node if it needs a fix.\n */\nfunction checkAndFix(textNode, writer) {\n if (isBrokenMentionNode(textNode)) {\n writer.removeAttribute('mention', textNode);\n return true;\n }\n return false;\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./mentionui.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./mentionui.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module mention/ui/mentionsview\n */\nimport { ListView } from 'ckeditor5/src/ui.js';\nimport { Rect } from 'ckeditor5/src/utils.js';\nimport '../../theme/mentionui.css';\n/**\n * The mention ui view.\n */\nexport default class MentionsView extends ListView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.extendTemplate({\n attributes: {\n class: [\n 'ck-mentions'\n ],\n tabindex: '-1'\n }\n });\n }\n /**\n * {@link #select Selects} the first item.\n */\n selectFirst() {\n this.select(0);\n }\n /**\n * Selects next item to the currently {@link #select selected}.\n *\n * If the last item is already selected, it will select the first item.\n */\n selectNext() {\n const item = this.selected;\n const index = this.items.getIndex(item);\n this.select(index + 1);\n }\n /**\n * Selects previous item to the currently {@link #select selected}.\n *\n * If the first item is already selected, it will select the last item.\n */\n selectPrevious() {\n const item = this.selected;\n const index = this.items.getIndex(item);\n this.select(index - 1);\n }\n /**\n * Marks item at a given index as selected.\n *\n * Handles selection cycling when passed index is out of bounds:\n * - if the index is lower than 0, it will select the last item,\n * - if the index is higher than the last item index, it will select the first item.\n *\n * @param index Index of an item to be marked as selected.\n */\n select(index) {\n let indexToGet = 0;\n if (index > 0 && index < this.items.length) {\n indexToGet = index;\n }\n else if (index < 0) {\n indexToGet = this.items.length - 1;\n }\n const item = this.items.get(indexToGet);\n // Return early if item is already selected.\n if (this.selected === item) {\n return;\n }\n // Remove highlight of previously selected item.\n if (this.selected) {\n this.selected.removeHighlight();\n }\n item.highlight();\n this.selected = item;\n // Scroll the mentions view to the selected element.\n if (!this._isItemVisibleInScrolledArea(item)) {\n this.element.scrollTop = item.element.offsetTop;\n }\n }\n /**\n * Triggers the `execute` event on the {@link #select selected} item.\n */\n executeSelected() {\n this.selected.fire('execute');\n }\n /**\n * Checks if an item is visible in the scrollable area.\n *\n * The item is considered visible when:\n * - its top boundary is inside the scrollable rect\n * - its bottom boundary is inside the scrollable rect (the whole item must be visible)\n */\n _isItemVisibleInScrolledArea(item) {\n return new Rect(this.element).contains(new Rect(item.element));\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module mention/ui/domwrapperview\n */\nimport { View } from 'ckeditor5/src/ui.js';\n/**\n * This class wraps DOM element as a CKEditor5 UI View.\n *\n * It allows to render any DOM element and use it in mentions list.\n */\nexport default class DomWrapperView extends View {\n /**\n * Creates an instance of {@link module:mention/ui/domwrapperview~DomWrapperView} class.\n *\n * Also see {@link #render}.\n */\n constructor(locale, domElement) {\n super(locale);\n // Disable template rendering on this view.\n this.template = undefined;\n this.domElement = domElement;\n // Render dom wrapper as a button.\n this.domElement.classList.add('ck-button');\n this.set('isOn', false);\n // Handle isOn state as in buttons.\n this.on('change:isOn', (evt, name, isOn) => {\n if (isOn) {\n this.domElement.classList.add('ck-on');\n this.domElement.classList.remove('ck-off');\n }\n else {\n this.domElement.classList.add('ck-off');\n this.domElement.classList.remove('ck-on');\n }\n });\n // Pass click event as execute event.\n this.listenTo(this.domElement, 'click', () => {\n this.fire('execute');\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.element = this.domElement;\n }\n /**\n * Focuses the DOM element.\n */\n focus() {\n this.domElement.focus();\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module mention/ui/mentionlistitemview\n */\nimport { ListItemView } from 'ckeditor5/src/ui.js';\nexport default class MentionListItemView extends ListItemView {\n highlight() {\n const child = this.children.first;\n child.isOn = true;\n }\n removeHighlight() {\n const child = this.children.first;\n child.isOn = false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module mention/mentionui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, ContextualBalloon, clickOutsideHandler } from 'ckeditor5/src/ui.js';\nimport { CKEditorError, Collection, Rect, env, keyCodes, logWarning } from 'ckeditor5/src/utils.js';\nimport { TextWatcher } from 'ckeditor5/src/typing.js';\nimport { debounce } from 'lodash-es';\nimport MentionsView from './ui/mentionsview.js';\nimport DomWrapperView from './ui/domwrapperview.js';\nimport MentionListItemView from './ui/mentionlistitemview.js';\nconst VERTICAL_SPACING = 3;\n// The key codes that mention UI handles when it is open (without commit keys).\nconst defaultHandledKeyCodes = [\n keyCodes.arrowup,\n keyCodes.arrowdown,\n keyCodes.esc\n];\n// Dropdown commit key codes.\nconst defaultCommitKeyCodes = [\n keyCodes.enter,\n keyCodes.tab\n];\n/**\n * The mention UI feature.\n */\nexport default class MentionUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'MentionUI';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._items = new Collection();\n this._mentionsView = this._createMentionView();\n this._mentionsConfigurations = new Map();\n this._requestFeedDebounced = debounce(this._requestFeed, 100);\n editor.config.define('mention', { feeds: [] });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const commitKeys = editor.config.get('mention.commitKeys') || defaultCommitKeyCodes;\n const handledKeyCodes = defaultHandledKeyCodes.concat(commitKeys);\n this._balloon = editor.plugins.get(ContextualBalloon);\n // Key listener that handles navigation in mention view.\n editor.editing.view.document.on('keydown', (evt, data) => {\n if (isHandledKey(data.keyCode) && this._isUIVisible) {\n data.preventDefault();\n evt.stop(); // Required for Enter key overriding.\n if (data.keyCode == keyCodes.arrowdown) {\n this._mentionsView.selectNext();\n }\n if (data.keyCode == keyCodes.arrowup) {\n this._mentionsView.selectPrevious();\n }\n if (commitKeys.includes(data.keyCode)) {\n this._mentionsView.executeSelected();\n }\n if (data.keyCode == keyCodes.esc) {\n this._hideUIAndRemoveMarker();\n }\n }\n }, { priority: 'highest' }); // Required to override the Enter key.\n // Close the dropdown upon clicking outside of the plugin UI.\n clickOutsideHandler({\n emitter: this._mentionsView,\n activator: () => this._isUIVisible,\n contextElements: () => [this._balloon.view.element],\n callback: () => this._hideUIAndRemoveMarker()\n });\n const feeds = editor.config.get('mention.feeds');\n for (const mentionDescription of feeds) {\n const { feed, marker, dropdownLimit } = mentionDescription;\n if (!isValidMentionMarker(marker)) {\n /**\n * The marker must be a single character.\n *\n * Correct markers: `'@'`, `'#'`.\n *\n * Incorrect markers: `'$$'`, `'[@'`.\n *\n * See {@link module:mention/mentionconfig~MentionConfig}.\n *\n * @error mentionconfig-incorrect-marker\n * @param marker Configured marker\n */\n throw new CKEditorError('mentionconfig-incorrect-marker', null, { marker });\n }\n const feedCallback = typeof feed == 'function' ? feed.bind(this.editor) : createFeedCallback(feed);\n const itemRenderer = mentionDescription.itemRenderer;\n const definition = { marker, feedCallback, itemRenderer, dropdownLimit };\n this._mentionsConfigurations.set(marker, definition);\n }\n this._setupTextWatcher(feeds);\n this.listenTo(editor, 'change:isReadOnly', () => {\n this._hideUIAndRemoveMarker();\n });\n this.on('requestFeed:response', (evt, data) => this._handleFeedResponse(data));\n this.on('requestFeed:error', () => this._hideUIAndRemoveMarker());\n /**\n * Checks if a given key code is handled by the mention UI.\n */\n function isHandledKey(keyCode) {\n return handledKeyCodes.includes(keyCode);\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).\n this._mentionsView.destroy();\n }\n /**\n * Returns true when {@link #_mentionsView} is in the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon} and it is\n * currently visible.\n */\n get _isUIVisible() {\n return this._balloon.visibleView === this._mentionsView;\n }\n /**\n * Creates the {@link #_mentionsView}.\n */\n _createMentionView() {\n const locale = this.editor.locale;\n const mentionsView = new MentionsView(locale);\n mentionsView.items.bindTo(this._items).using(data => {\n const { item, marker } = data;\n const { dropdownLimit: markerDropdownLimit } = this._mentionsConfigurations.get(marker);\n // Set to 10 by default for backwards compatibility. See: #10479\n const dropdownLimit = markerDropdownLimit || this.editor.config.get('mention.dropdownLimit') || 10;\n if (mentionsView.items.length >= dropdownLimit) {\n return null;\n }\n const listItemView = new MentionListItemView(locale);\n const view = this._renderItem(item, marker);\n view.delegate('execute').to(listItemView);\n listItemView.children.add(view);\n listItemView.item = item;\n listItemView.marker = marker;\n listItemView.on('execute', () => {\n mentionsView.fire('execute', {\n item,\n marker\n });\n });\n return listItemView;\n });\n mentionsView.on('execute', (evt, data) => {\n const editor = this.editor;\n const model = editor.model;\n const item = data.item;\n const marker = data.marker;\n const mentionMarker = editor.model.markers.get('mention');\n // Create a range on matched text.\n const end = model.createPositionAt(model.document.selection.focus);\n const start = model.createPositionAt(mentionMarker.getStart());\n const range = model.createRange(start, end);\n this._hideUIAndRemoveMarker();\n editor.execute('mention', {\n mention: item,\n text: item.text,\n marker,\n range\n });\n editor.editing.view.focus();\n });\n return mentionsView;\n }\n /**\n * Returns item renderer for the marker.\n */\n _getItemRenderer(marker) {\n const { itemRenderer } = this._mentionsConfigurations.get(marker);\n return itemRenderer;\n }\n /**\n * Requests a feed from a configured callbacks.\n */\n _requestFeed(marker, feedText) {\n // @if CK_DEBUG_MENTION // console.log( '%c[Feed]%c Requesting for', 'color: blue', 'color: black', `\"${ feedText }\"` );\n // Store the last requested feed - it is used to discard any out-of order requests.\n this._lastRequested = feedText;\n const { feedCallback } = this._mentionsConfigurations.get(marker);\n const feedResponse = feedCallback(feedText);\n const isAsynchronous = feedResponse instanceof Promise;\n // For synchronous feeds (e.g. callbacks, arrays) fire the response event immediately.\n if (!isAsynchronous) {\n this.fire('requestFeed:response', { feed: feedResponse, marker, feedText });\n return;\n }\n // Handle the asynchronous responses.\n feedResponse\n .then(response => {\n // Check the feed text of this response with the last requested one so either:\n if (this._lastRequested == feedText) {\n // It is the same and fire the response event.\n this.fire('requestFeed:response', { feed: response, marker, feedText });\n }\n else {\n // It is different - most probably out-of-order one, so fire the discarded event.\n this.fire('requestFeed:discarded', { feed: response, marker, feedText });\n }\n })\n .catch(error => {\n this.fire('requestFeed:error', { error });\n /**\n * The callback used for obtaining mention autocomplete feed thrown and error and the mention UI was hidden or\n * not displayed at all.\n *\n * @error mention-feed-callback-error\n */\n logWarning('mention-feed-callback-error', { marker });\n });\n }\n /**\n * Registers a text watcher for the marker.\n */\n _setupTextWatcher(feeds) {\n const editor = this.editor;\n const feedsWithPattern = feeds.map(feed => ({\n ...feed,\n pattern: createRegExp(feed.marker, feed.minimumCharacters || 0)\n }));\n const watcher = new TextWatcher(editor.model, createTestCallback(feedsWithPattern));\n watcher.on('matched', (evt, data) => {\n const markerDefinition = getLastValidMarkerInText(feedsWithPattern, data.text);\n const selection = editor.model.document.selection;\n const focus = selection.focus;\n const markerPosition = editor.model.createPositionAt(focus.parent, markerDefinition.position);\n if (isPositionInExistingMention(focus) || isMarkerInExistingMention(markerPosition)) {\n this._hideUIAndRemoveMarker();\n return;\n }\n const feedText = requestFeedText(markerDefinition, data.text);\n const matchedTextLength = markerDefinition.marker.length + feedText.length;\n // Create a marker range.\n const start = focus.getShiftedBy(-matchedTextLength);\n const end = focus.getShiftedBy(-feedText.length);\n const markerRange = editor.model.createRange(start, end);\n // @if CK_DEBUG_MENTION // console.group( '%c[TextWatcher]%c matched', 'color: red', 'color: black', `\"${ feedText }\"` );\n // @if CK_DEBUG_MENTION // console.log( 'data#text', `\"${ data.text }\"` );\n // @if CK_DEBUG_MENTION // console.log( 'data#range', data.range.start.path, data.range.end.path );\n // @if CK_DEBUG_MENTION // console.log( 'marker definition', markerDefinition );\n // @if CK_DEBUG_MENTION // console.log( 'marker range', markerRange.start.path, markerRange.end.path );\n if (checkIfStillInCompletionMode(editor)) {\n const mentionMarker = editor.model.markers.get('mention');\n // Update the marker - user might've moved the selection to other mention trigger.\n editor.model.change(writer => {\n // @if CK_DEBUG_MENTION // console.log( '%c[Editing]%c Updating the marker.', 'color: purple', 'color: black' );\n writer.updateMarker(mentionMarker, { range: markerRange });\n });\n }\n else {\n editor.model.change(writer => {\n // @if CK_DEBUG_MENTION // console.log( '%c[Editing]%c Adding the marker.', 'color: purple', 'color: black' );\n writer.addMarker('mention', { range: markerRange, usingOperation: false, affectsData: false });\n });\n }\n this._requestFeedDebounced(markerDefinition.marker, feedText);\n // @if CK_DEBUG_MENTION // console.groupEnd();\n });\n watcher.on('unmatched', () => {\n this._hideUIAndRemoveMarker();\n });\n const mentionCommand = editor.commands.get('mention');\n watcher.bind('isEnabled').to(mentionCommand);\n return watcher;\n }\n /**\n * Handles the feed response event data.\n */\n _handleFeedResponse(data) {\n const { feed, marker } = data;\n // eslint-disable-next-line max-len\n // @if CK_DEBUG_MENTION // console.log( `%c[Feed]%c Response for \"${ data.feedText }\" (${ feed.length })`, 'color: blue', 'color: black', feed );\n // If the marker is not in the document happens when the selection had changed and the 'mention' marker was removed.\n if (!checkIfStillInCompletionMode(this.editor)) {\n return;\n }\n // Reset the view.\n this._items.clear();\n for (const feedItem of feed) {\n const item = typeof feedItem != 'object' ? { id: feedItem, text: feedItem } : feedItem;\n this._items.add({ item, marker });\n }\n const mentionMarker = this.editor.model.markers.get('mention');\n if (this._items.length) {\n this._showOrUpdateUI(mentionMarker);\n }\n else {\n // Do not show empty mention UI.\n this._hideUIAndRemoveMarker();\n }\n }\n /**\n * Shows the mentions balloon. If the panel is already visible, it will reposition it.\n */\n _showOrUpdateUI(markerMarker) {\n if (this._isUIVisible) {\n // @if CK_DEBUG_MENTION // console.log( '%c[UI]%c Updating position.', 'color: green', 'color: black' );\n // Update balloon position as the mention list view may change its size.\n this._balloon.updatePosition(this._getBalloonPanelPositionData(markerMarker, this._mentionsView.position));\n }\n else {\n // @if CK_DEBUG_MENTION // console.log( '%c[UI]%c Showing the UI.', 'color: green', 'color: black' );\n this._balloon.add({\n view: this._mentionsView,\n position: this._getBalloonPanelPositionData(markerMarker, this._mentionsView.position),\n singleViewMode: true\n });\n }\n this._mentionsView.position = this._balloon.view.position;\n this._mentionsView.selectFirst();\n }\n /**\n * Hides the mentions balloon and removes the 'mention' marker from the markers collection.\n */\n _hideUIAndRemoveMarker() {\n // Remove the mention view from balloon before removing marker - it is used by balloon position target().\n if (this._balloon.hasView(this._mentionsView)) {\n // @if CK_DEBUG_MENTION // console.log( '%c[UI]%c Hiding the UI.', 'color: green', 'color: black' );\n this._balloon.remove(this._mentionsView);\n }\n if (checkIfStillInCompletionMode(this.editor)) {\n // @if CK_DEBUG_MENTION // console.log( '%c[Editing]%c Removing marker.', 'color: purple', 'color: black' );\n this.editor.model.change(writer => writer.removeMarker('mention'));\n }\n // Make the last matched position on panel view undefined so the #_getBalloonPanelPositionData() method will return all positions\n // on the next call.\n this._mentionsView.position = undefined;\n }\n /**\n * Renders a single item in the autocomplete list.\n */\n _renderItem(item, marker) {\n const editor = this.editor;\n let view;\n let label = item.id;\n const renderer = this._getItemRenderer(marker);\n if (renderer) {\n const renderResult = renderer(item);\n if (typeof renderResult != 'string') {\n view = new DomWrapperView(editor.locale, renderResult);\n }\n else {\n label = renderResult;\n }\n }\n if (!view) {\n const buttonView = new ButtonView(editor.locale);\n buttonView.label = label;\n buttonView.withText = true;\n view = buttonView;\n }\n return view;\n }\n /**\n * Creates a position options object used to position the balloon panel.\n *\n * @param mentionMarker\n * @param preferredPosition The name of the last matched position name.\n */\n _getBalloonPanelPositionData(mentionMarker, preferredPosition) {\n const editor = this.editor;\n const editing = editor.editing;\n const domConverter = editing.view.domConverter;\n const mapper = editing.mapper;\n const uiLanguageDirection = editor.locale.uiLanguageDirection;\n return {\n target: () => {\n let modelRange = mentionMarker.getRange();\n // Target the UI to the model selection range - the marker has been removed so probably the UI will not be shown anyway.\n // The logic is used by ContextualBalloon to display another panel in the same place.\n if (modelRange.start.root.rootName == '$graveyard') {\n modelRange = editor.model.document.selection.getFirstRange();\n }\n const viewRange = mapper.toViewRange(modelRange);\n const rangeRects = Rect.getDomRangeRects(domConverter.viewRangeToDom(viewRange));\n return rangeRects.pop();\n },\n limiter: () => {\n const view = this.editor.editing.view;\n const viewDocument = view.document;\n const editableElement = viewDocument.selection.editableElement;\n if (editableElement) {\n return view.domConverter.mapViewToDom(editableElement.root);\n }\n return null;\n },\n positions: getBalloonPanelPositions(preferredPosition, uiLanguageDirection)\n };\n }\n}\n/**\n * Returns the balloon positions data callbacks.\n */\nfunction getBalloonPanelPositions(preferredPosition, uiLanguageDirection) {\n const positions = {\n // Positions the panel to the southeast of the caret rectangle.\n 'caret_se': (targetRect) => {\n return {\n top: targetRect.bottom + VERTICAL_SPACING,\n left: targetRect.right,\n name: 'caret_se',\n config: {\n withArrow: false\n }\n };\n },\n // Positions the panel to the northeast of the caret rectangle.\n 'caret_ne': (targetRect, balloonRect) => {\n return {\n top: targetRect.top - balloonRect.height - VERTICAL_SPACING,\n left: targetRect.right,\n name: 'caret_ne',\n config: {\n withArrow: false\n }\n };\n },\n // Positions the panel to the southwest of the caret rectangle.\n 'caret_sw': (targetRect, balloonRect) => {\n return {\n top: targetRect.bottom + VERTICAL_SPACING,\n left: targetRect.right - balloonRect.width,\n name: 'caret_sw',\n config: {\n withArrow: false\n }\n };\n },\n // Positions the panel to the northwest of the caret rect.\n 'caret_nw': (targetRect, balloonRect) => {\n return {\n top: targetRect.top - balloonRect.height - VERTICAL_SPACING,\n left: targetRect.right - balloonRect.width,\n name: 'caret_nw',\n config: {\n withArrow: false\n }\n };\n }\n };\n // Returns only the last position if it was matched to prevent the panel from jumping after the first match.\n if (Object.prototype.hasOwnProperty.call(positions, preferredPosition)) {\n return [\n positions[preferredPosition]\n ];\n }\n // By default, return all position callbacks ordered depending on the UI language direction.\n return uiLanguageDirection !== 'rtl' ? [\n positions.caret_se,\n positions.caret_sw,\n positions.caret_ne,\n positions.caret_nw\n ] : [\n positions.caret_sw,\n positions.caret_se,\n positions.caret_nw,\n positions.caret_ne\n ];\n}\n/**\n * Returns a marker definition of the last valid occurring marker in a given string.\n * If there is no valid marker in a string, it returns undefined.\n *\n * Example of returned object:\n *\n * ```ts\n * {\n * \tmarker: '@',\n * \tposition: 4,\n * \tminimumCharacters: 0\n * }\n * ````\n *\n * @param feedsWithPattern Registered feeds in editor for mention plugin with created RegExp for matching marker.\n * @param text String to find the marker in\n * @returns Matched marker's definition\n */\nfunction getLastValidMarkerInText(feedsWithPattern, text) {\n let lastValidMarker;\n for (const feed of feedsWithPattern) {\n const currentMarkerLastIndex = text.lastIndexOf(feed.marker);\n if (currentMarkerLastIndex > 0 && !text.substring(currentMarkerLastIndex - 1).match(feed.pattern)) {\n continue;\n }\n if (!lastValidMarker || currentMarkerLastIndex >= lastValidMarker.position) {\n lastValidMarker = {\n marker: feed.marker,\n position: currentMarkerLastIndex,\n minimumCharacters: feed.minimumCharacters,\n pattern: feed.pattern\n };\n }\n }\n return lastValidMarker;\n}\n/**\n * Creates a RegExp pattern for the marker.\n *\n * Function has to be exported to achieve 100% code coverage.\n */\nexport function createRegExp(marker, minimumCharacters) {\n const numberOfCharacters = minimumCharacters == 0 ? '*' : `{${minimumCharacters},}`;\n const openAfterCharacters = env.features.isRegExpUnicodePropertySupported ? '\\\\p{Ps}\\\\p{Pi}\"\\'' : '\\\\(\\\\[{\"\\'';\n const mentionCharacters = '.';\n // I wanted to make an util out of it, but since this regexp uses \"u\" flag, it became difficult.\n // When \"u\" flag is used, the regexp has \"strict\" escaping rules, i.e. if you try to escape a character that does not need\n // to be escaped, RegExp() will throw. It made it difficult to write a generic util, because different characters are\n // allowed in different context. For example, escaping \"-\" sometimes was correct, but sometimes it threw an error.\n marker = marker.replace(/[.*+?^${}()\\-|[\\]\\\\]/g, '\\\\$&');\n // The pattern consists of 3 groups:\n //\n // - 0 (non-capturing): Opening sequence - start of the line, space or an opening punctuation character like \"(\" or \"\\\"\",\n // - 1: The marker character,\n // - 2: Mention input (taking the minimal length into consideration to trigger the UI),\n //\n // The pattern matches up to the caret (end of string switch - $).\n // (0: opening sequence )(1: marker )(2: typed mention )$\n const pattern = `(?:^|[ ${openAfterCharacters}])([${marker}])(${mentionCharacters}${numberOfCharacters})$`;\n return new RegExp(pattern, 'u');\n}\n/**\n * Creates a test callback for the marker to be used in the text watcher instance.\n *\n * @param feedsWithPattern Feeds of mention plugin configured in editor with RegExp to match marker in text\n */\nfunction createTestCallback(feedsWithPattern) {\n const textMatcher = (text) => {\n const markerDefinition = getLastValidMarkerInText(feedsWithPattern, text);\n if (!markerDefinition) {\n return false;\n }\n let splitStringFrom = 0;\n if (markerDefinition.position !== 0) {\n splitStringFrom = markerDefinition.position - 1;\n }\n const textToTest = text.substring(splitStringFrom);\n return markerDefinition.pattern.test(textToTest);\n };\n return textMatcher;\n}\n/**\n * Creates a text matcher from the marker.\n */\nfunction requestFeedText(markerDefinition, text) {\n let splitStringFrom = 0;\n if (markerDefinition.position !== 0) {\n splitStringFrom = markerDefinition.position - 1;\n }\n const regExp = createRegExp(markerDefinition.marker, 0);\n const textToMatch = text.substring(splitStringFrom);\n const match = textToMatch.match(regExp);\n return match[2];\n}\n/**\n * The default feed callback.\n */\nfunction createFeedCallback(feedItems) {\n return (feedText) => {\n const filteredItems = feedItems\n // Make the default mention feed case-insensitive.\n .filter(item => {\n // Item might be defined as object.\n const itemId = typeof item == 'string' ? item : String(item.id);\n // The default feed is case insensitive.\n return itemId.toLowerCase().includes(feedText.toLowerCase());\n });\n return filteredItems;\n };\n}\n/**\n * Checks if position in inside or right after a text with a mention.\n */\nfunction isPositionInExistingMention(position) {\n // The text watcher listens only to changed range in selection - so the selection attributes are not yet available\n // and you cannot use selection.hasAttribute( 'mention' ) just yet.\n // See https://github.com/ckeditor/ckeditor5-engine/issues/1723.\n const hasMention = position.textNode && position.textNode.hasAttribute('mention');\n const nodeBefore = position.nodeBefore;\n return hasMention || nodeBefore && nodeBefore.is('$text') && nodeBefore.hasAttribute('mention');\n}\n/**\n * Checks if the closest marker offset is at the beginning of a mention.\n *\n * See https://github.com/ckeditor/ckeditor5/issues/11400.\n */\nfunction isMarkerInExistingMention(markerPosition) {\n const nodeAfter = markerPosition.nodeAfter;\n return nodeAfter && nodeAfter.is('$text') && nodeAfter.hasAttribute('mention');\n}\n/**\n * Checks if string is a valid mention marker.\n */\nfunction isValidMentionMarker(marker) {\n return marker && marker.length == 1;\n}\n/**\n * Checks the mention plugins is in completion mode (e.g. when typing is after a valid mention string like @foo).\n */\nfunction checkIfStillInCompletionMode(editor) {\n return editor.model.markers.has('mention');\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./mention.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./mention.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module page-break/pagebreakcommand\n */\nimport { Command } from 'ckeditor5/src/core.js';\nimport { findOptimalInsertionRange } from 'ckeditor5/src/widget.js';\n/**\n * The page break command.\n *\n * The command is registered by {@link module:page-break/pagebreakediting~PageBreakEditing} as `'pageBreak'`.\n *\n * To insert a page break at the current selection, execute the command:\n *\n *\t\teditor.execute( 'pageBreak' );\n */\nexport default class PageBreakCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n this.isEnabled = isPageBreakAllowedInParent(selection, schema, model);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n */\n execute() {\n const model = this.editor.model;\n model.change(writer => {\n const pageBreakElement = writer.createElement('pageBreak');\n model.insertObject(pageBreakElement, null, null, {\n setSelection: 'after'\n });\n });\n }\n}\n/**\n * Checks if a page break is allowed by the schema in the optimal insertion parent.\n */\nfunction isPageBreakAllowedInParent(selection, schema, model) {\n const parent = getInsertPageBreakParent(selection, model);\n return schema.checkChild(parent, 'pageBreak');\n}\n/**\n * Returns a node that will be used to insert a page break with `model.insertContent` to check if the page break can be placed there.\n */\nfunction getInsertPageBreakParent(selection, model) {\n const insertionRange = findOptimalInsertionRange(selection, model);\n const parent = insertionRange.start.parent;\n if (parent.isEmpty && !parent.is('element', '$root')) {\n return parent.parent;\n }\n return parent;\n}\n","\n import API from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../style-loader/dist/runtime/singletonStyleDomAPI.js\";\n import insertFn from \"!../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../style-loader/dist/runtime/setAttributesWithAttributesAndNonce.js\";\n import insertStyleElement from \"!../../../style-loader/dist/runtime/insertStyleElement.js\";\n \n import content, * as namedExport from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./pagebreak.css\";\n \n \n\nvar options = {\"attributes\":{\"data-cke\":true}};\n\n;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./pagebreak.css\";\n export default content && content.locals ? content.locals : undefined;\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module page-break/pagebreakediting\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { toWidget } from 'ckeditor5/src/widget.js';\nimport PageBreakCommand from './pagebreakcommand.js';\nimport '../theme/pagebreak.css';\n/**\n * The page break editing feature.\n */\nexport default class PageBreakEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PageBreakEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const t = editor.t;\n const conversion = editor.conversion;\n schema.register('pageBreak', {\n inheritAllFrom: '$blockObject'\n });\n conversion.for('dataDowncast').elementToStructure({\n model: 'pageBreak',\n view: (modelElement, { writer }) => {\n const divElement = writer.createContainerElement('div', {\n class: 'page-break',\n // If user has no `.ck-content` styles, it should always break a page during print.\n style: 'page-break-after: always'\n }, \n // For a rationale of using span inside a div see:\n // https://github.com/ckeditor/ckeditor5-page-break/pull/1#discussion_r328934062.\n writer.createContainerElement('span', {\n style: 'display: none'\n }));\n return divElement;\n }\n });\n conversion.for('editingDowncast').elementToStructure({\n model: 'pageBreak',\n view: (modelElement, { writer }) => {\n const label = t('Page break');\n const viewWrapper = writer.createContainerElement('div');\n const viewLabelElement = writer.createRawElement('span', { class: 'page-break__label' }, function (domElement) {\n domElement.innerText = t('Page break');\n });\n writer.addClass('page-break', viewWrapper);\n writer.insert(writer.createPositionAt(viewWrapper, 0), viewLabelElement);\n return toPageBreakWidget(viewWrapper, writer, label);\n }\n });\n conversion.for('upcast')\n .elementToElement({\n view: element => {\n // For upcast conversion it's enough if we check for element style and verify if it's empty\n // or contains only hidden span element.\n const hasPageBreakBefore = element.getStyle('page-break-before') == 'always';\n const hasPageBreakAfter = element.getStyle('page-break-after') == 'always';\n if (!hasPageBreakBefore && !hasPageBreakAfter) {\n return null;\n }\n // The \"page break\" div accepts only single child or no child at all.\n if (element.childCount == 1) {\n const viewSpan = element.getChild(0);\n // The child must be the \"span\" element that is not displayed.\n if (!viewSpan.is('element', 'span') || viewSpan.getStyle('display') != 'none') {\n return null;\n }\n }\n else if (element.childCount > 1) {\n return null;\n }\n return { name: true };\n },\n model: 'pageBreak',\n // This conversion must be checked before <br> conversion because some editors use\n // <br style=\"page-break-before:always\"> as a page break marker.\n converterPriority: 'high'\n });\n editor.commands.add('pageBreak', new PageBreakCommand(editor));\n }\n}\n/**\n * Converts a given {@link module:engine/view/element~Element} to a page break widget:\n * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to\n * recognize the page break widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n */\nfunction toPageBreakWidget(viewElement, writer, label) {\n writer.setCustomProperty('pageBreak', true, viewElement);\n return toWidget(viewElement, writer, { label });\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module page-break/pagebreakui\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';\nimport pageBreakIcon from '../theme/icons/pagebreak.svg';\n/**\n * The page break UI plugin.\n */\nexport default class PageBreakUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PageBreakUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Add pageBreak button to feature components.\n editor.ui.componentFactory.add('pageBreak', () => {\n const view = this._createButton(ButtonView);\n view.set({\n tooltip: true\n });\n return view;\n });\n editor.ui.componentFactory.add('menuBar:pageBreak', () => this._createButton(MenuBarMenuListItemButtonView));\n }\n /**\n * Creates a button for page break command to use either in toolbar or in menu bar.\n */\n _createButton(ButtonClass) {\n const editor = this.editor;\n const locale = editor.locale;\n const command = editor.commands.get('pageBreak');\n const view = new ButtonClass(editor.locale);\n const t = locale.t;\n view.set({\n label: t('Page break'),\n icon: pageBreakIcon\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', () => {\n editor.execute('pageBreak');\n editor.editing.view.focus();\n });\n return view;\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M3.598.687h1.5v5h-1.5zm14.5 0h1.5v5h-1.5z\\\"/><path d=\\\"M19.598 4.187v1.5h-16v-1.5zm-16 14.569h1.5v-5h-1.5zm14.5 0h1.5v-5h-1.5z\\\"/><path d=\\\"M19.598 15.256v-1.5h-16v1.5zM5.081 9h6v2h-6zm8 0h6v2h-6zm-9.483 1L0 12.5v-5z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module autosave/autosave\n */\nimport { Plugin, PendingActions } from 'ckeditor5/src/core.js';\nimport { DomEmitterMixin } from 'ckeditor5/src/utils.js';\nimport { debounce } from 'lodash-es';\n/* globals window */\n/**\n * The {@link module:autosave/autosave~Autosave} plugin allows you to automatically save the data (e.g. send it to the server)\n * when needed (when the user changed the content).\n *\n * It listens to the {@link module:engine/model/document~Document#event:change:data `editor.model.document#change:data`}\n * and `window#beforeunload` events and calls the\n * {@link module:autosave/autosave~AutosaveAdapter#save `config.autosave.save()`} function.\n *\n * ```ts\n * ClassicEditor\n * \t.create( document.querySelector( '#editor' ), {\n * \t\tplugins: [ ArticlePluginSet, Autosave ],\n * \t\ttoolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ],\n * \t\timage: {\n * \t\t\ttoolbar: [ 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ],\n * \t\t},\n * \t\tautosave: {\n * \t\t\tsave( editor: Editor ) {\n * \t\t\t\t// The saveData() function must return a promise\n * \t\t\t\t// which should be resolved when the data is successfully saved.\n * \t\t\t\treturn saveData( editor.getData() );\n * \t\t\t}\n * \t\t}\n * \t} );\n * ```\n *\n * Read more about this feature in the {@glink features/autosave Autosave} feature guide.\n */\nexport default class Autosave extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Autosave';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [PendingActions];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * An action that will be added to the pending action manager for actions happening in that plugin.\n */\n this._action = null;\n const config = editor.config.get('autosave') || {};\n // A minimum amount of time that needs to pass after the last action.\n // After that time the provided save callbacks are being called.\n const waitingTime = config.waitingTime || 1000;\n this.set('state', 'synchronized');\n this._debouncedSave = debounce(this._save.bind(this), waitingTime);\n this._lastDocumentVersion = editor.model.document.version;\n this._savePromise = null;\n this._domEmitter = new (DomEmitterMixin())();\n this._config = config;\n this._pendingActions = editor.plugins.get(PendingActions);\n this._makeImmediateSave = false;\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const doc = editor.model.document;\n // Add the listener only after the editor is initialized to prevent firing save callback on data init.\n this.listenTo(editor, 'ready', () => {\n this.listenTo(doc, 'change:data', (evt, batch) => {\n if (!this._saveCallbacks.length) {\n return;\n }\n if (!batch.isLocal) {\n return;\n }\n if (this.state === 'synchronized') {\n this.state = 'waiting';\n // Set pending action already when we are waiting for the autosave callback.\n this._setPendingAction();\n }\n if (this.state === 'waiting') {\n this._debouncedSave();\n }\n // If the plugin is in `saving` state, it will change its state later basing on the `document.version`.\n // If the `document.version` will be higher than stored `#_lastDocumentVersion`, then it means, that some `change:data`\n // event has fired in the meantime.\n });\n });\n // Flush on the editor's destroy listener with the highest priority to ensure that\n // `editor.getData()` will be called before plugins are destroyed.\n this.listenTo(editor, 'destroy', () => this._flush(), { priority: 'highest' });\n // It's not possible to easy test it because karma uses `beforeunload` event\n // to warn before full page reload and this event cannot be dispatched manually.\n /* istanbul ignore next -- @preserve */\n this._domEmitter.listenTo(window, 'beforeunload', (evtInfo, domEvt) => {\n if (this._pendingActions.hasAny) {\n domEvt.returnValue = this._pendingActions.first.message;\n }\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n // There's no need for canceling or flushing the throttled save, as\n // it's done on the editor's destroy event with the highest priority.\n this._domEmitter.stopListening();\n super.destroy();\n }\n /**\n * Immediately calls autosave callback. All previously queued (debounced) callbacks are cleared. If there is already an autosave\n * callback in progress, then the requested save will be performed immediately after the current callback finishes.\n *\n * @returns A promise that will be resolved when the autosave callback is finished.\n */\n save() {\n this._debouncedSave.cancel();\n return this._save();\n }\n /**\n * Invokes the remaining `_save()` method call.\n */\n _flush() {\n this._debouncedSave.flush();\n }\n /**\n * If the adapter is set and a new document version exists,\n * the `_save()` method creates a pending action and calls the `adapter.save()` method.\n * It waits for the result and then removes the created pending action.\n *\n * @returns A promise that will be resolved when the autosave callback is finished.\n */\n _save() {\n if (this._savePromise) {\n this._makeImmediateSave = this.editor.model.document.version > this._lastDocumentVersion;\n return this._savePromise;\n }\n // Make sure there is a pending action (in case if `_save()` was called through manual `save()` call).\n this._setPendingAction();\n this.state = 'saving';\n this._lastDocumentVersion = this.editor.model.document.version;\n // Wait one promise cycle to be sure that save callbacks are not called inside a conversion or when the editor's state changes.\n this._savePromise = Promise.resolve()\n // Make autosave callback.\n .then(() => Promise.all(this._saveCallbacks.map(cb => cb(this.editor))))\n // When the autosave callback is finished, always clear `this._savePromise`, no matter if it was successful or not.\n .finally(() => {\n this._savePromise = null;\n })\n // If the save was successful, we have three scenarios:\n //\n // 1. If a save was requested when an autosave callback was already processed, we need to immediately call\n // another autosave callback. In this case, `this._savePromise` will not be resolved until the next callback is done.\n // 2. Otherwise, if changes happened to the model, make a delayed autosave callback (like the change just happened).\n // 3. If no changes happened to the model, return to the `synchronized` state.\n .then(() => {\n if (this._makeImmediateSave) {\n this._makeImmediateSave = false;\n // Start another autosave callback. Return a promise that will be resolved after the new autosave callback.\n // This way promises returned by `_save()` will not be resolved until all changes are saved.\n //\n // If `save()` was called when another (most often automatic) autosave callback was already processed,\n // the promise returned by `save()` call will be resolved only after new changes have been saved.\n //\n // Note that it would not work correctly if `this._savePromise` is not cleared.\n return this._save();\n }\n else {\n if (this.editor.model.document.version > this._lastDocumentVersion) {\n this.state = 'waiting';\n this._debouncedSave();\n }\n else {\n this.state = 'synchronized';\n this._pendingActions.remove(this._action);\n this._action = null;\n }\n }\n })\n // In case of an error, retry the autosave callback after a delay (and also throw the original error).\n .catch(err => {\n // Change state to `error` so that listeners handling autosave error can be called.\n this.state = 'error';\n // Then, immediately change to the `saving` state as described above.\n // Being in the `saving` state ensures that the autosave callback won't be delayed further by the `change:data` listener.\n this.state = 'saving';\n this._debouncedSave();\n throw err;\n });\n return this._savePromise;\n }\n /**\n * Creates a pending action if it is not set already.\n */\n _setPendingAction() {\n const t = this.editor.t;\n if (!this._action) {\n this._action = this._pendingActions.add(t('Saving changes'));\n }\n }\n /**\n * Saves callbacks.\n */\n get _saveCallbacks() {\n const saveCallbacks = [];\n if (this.adapter && this.adapter.save) {\n saveCallbacks.push(this.adapter.save);\n }\n if (this._config.save) {\n saveCallbacks.push(this._config.save);\n }\n return saveCallbacks;\n }\n}\n","// Description: Utility functions for the history log plugin.\n\nexport function countWords(str) {\n return str.trim().split(/\\s+/).length;\n}\n\n/**\n * Basic hash function based on DJB \"33-times\" algorithm.\n */\nexport function generateHash(str) {\n const len = str.length;\n let h = 5381;\n\n for (let i = 0; i < len; i++) {\n h = h * 33 ^ str.charCodeAt(i);\n }\n return h >>> 0;\n}\n","import * as LZString from \"lz-string\";\nimport {generateHash} from \"./utils\";\nimport {OP_CONTENT_REVISION_KEY} from \"./op-content-revisions\";\nimport {getOPService} from \"../op-context/op-context\";\n\nexport function loadFromLocalStorage(storageKey) {\n const compressed = localStorage.getItem(storageKey);\n\n if (!compressed) {\n return null;\n }\n\n try {\n return JSON.parse(LZString.decompress(compressed));\n } catch (e) {\n console.error(\"Failed to load CKEditor revisions from localStorage: \" + e.toString());\n return null;\n }\n}\n\nexport async function saveInLocalStorage(editor) {\n const timestamp = Date.now();\n const key = editor.config.get(OP_CONTENT_REVISION_KEY);\n const content = await editor.getData();\n\n // Do not try to save if content is undefined\n if (!content) {\n console.warn(\"Trying to save snapshot but data is not defined.\");\n }\n\n const item = {\n timestamp,\n hash: generateHash(content),\n content,\n };\n\n const record = loadFromLocalStorage(key);\n const items = record?.items || [];\n\n // Unless there is a entry with a matching hash, append new save\n const match = items.find(saved => item.hash === saved.hash);\n if (!match) {\n items.push(item);\n }\n\n try {\n const compressed = LZString.compress(JSON.stringify({ items, updatedAt: timestamp}));\n\n localStorage.setItem(key, compressed);\n } catch (e) {\n const notifications = getOPService(editor, \"notifications\");\n notifications.addError(\"Failed to save CKEditor data to localStorage: \" + e.toString());\n }\n\n return true;\n}\n","/**\n * @file registers the history_log toolbar button and binds functionality to it.\n */\nimport {Plugin} from \"ckeditor5/src/core\";\nimport {addListToDropdown, createDropdown, Notification} from \"ckeditor5/src/ui\";\nimport {Collection} from \"ckeditor5/src/utils\";\nimport {loadFromLocalStorage} from \"./storage\";\nimport {countWords, generateHash} from \"./utils\";\n\nimport imageIcon from \"./../../icons/revisions.svg\";\nimport {getOPI18n, getOPService} from \"../op-context/op-context\";\nimport {OP_CONTENT_REVISION_KEY} from \"./op-content-revisions\";\n\nexport default class OpContentRevisionsUI extends Plugin {\n\n init() {\n const editor = this.editor;\n const i18n = getOPI18n(editor);\n\n editor.ui.componentFactory.add(\"opContentRevisions\", locale => {\n const dropdownView = createDropdown(locale);\n const collection = new Collection();\n\n // Create a dropdown with a list inside the panel.\n addListToDropdown(dropdownView, collection, {\n role: \"menu\",\n ariaLabel: i18n.t('js.editor.revisions'),\n });\n\n // Create dropdown model.\n dropdownView.buttonView.set({\n label: i18n.t('js.editor.revisions'),\n icon: imageIcon,\n tooltip: true,\n });\n\n // Populate the dropdown with the history when the button is clicked.\n this.listenTo(dropdownView.buttonView, \"execute\", async () => {\n collection.clear();\n addAvailableRevisions(editor, collection);\n });\n\n dropdownView.on(\"execute\", (evt) => {\n const { timestamp } = evt.source;\n\n if (timestamp) {\n editor.execute(\"opContentRevisionApply\", timestamp);\n }\n });\n\n return dropdownView;\n });\n }\n\n}\n\nfunction addAvailableRevisions(editor, collection) {\n const key = editor.config.get(OP_CONTENT_REVISION_KEY);\n const record = loadFromLocalStorage(key);\n const i18n = getOPI18n(editor);\n const timezoneService = getOPService(editor, \"timezone\");\n\n if (!record?.items || record.items.count <= 0) {\n const def = {\n type: \"button\",\n model: {\n label: i18n.t('js.editor.no_revisions'),\n withText: true,\n },\n };\n\n collection.add(def);\n return;\n }\n\n const currentContent = editor.getData();\n const currentHash = generateHash(currentContent);\n\n for (let index = record.items.length; index > 0; ) {\n index--;\n\n const data = record.items[index];\n const time = timezoneService.formattedRelativeDateTime(data.timestamp);\n const words = i18n.t(\"js.units.word\", { count: countWords(data.content) });\n const matches = data.hash === currentHash ? `${i18n.t('js.label_current')} - ` : \"\";\n const label = `${matches}${time} (${words})`;\n\n const def = {\n type: \"button\",\n model: {\n timestamp: data.timestamp,\n label,\n withText: true,\n },\n };\n\n collection.add(def);\n }\n}\n","export default \"<svg width=\\\"24\\\" height=\\\"24\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n<path fill-rule=\\\"evenodd\\\" clip-rule=\\\"evenodd\\\" d=\\\"M12.5256 4.01761C14.657 4.17616 16.6003 5.15921 18.0108 6.77647C19.4213 8.39374 20.1109 10.455 19.9855 12.5796C19.672 16.7972 16.1615 20 11.9927 20H11.4286C9.07774 19.8097 6.915 18.6364 5.53586 16.7338L6.82097 15.7507C7.94936 17.2728 9.67328 18.1925 11.5226 18.3193C15.0331 18.573 18.1048 15.941 18.3243 12.4528C18.4496 10.7721 17.9168 9.1548 16.7884 7.85465C15.66 6.58621 14.1241 5.79343 12.4002 5.69829C10.2061 5.53974 8.07473 6.52278 6.78962 8.2986L7.82398 8.80598L4.47016 11.5014L4 6.87161L5.3478 7.53754C6.915 5.19092 9.64194 3.82734 12.5256 4.01761ZM11.294 12.7728C11.1128 12.659 11 12.4637 11 12.2402V9.61811C11 9.26378 11.2835 8.94488 11.6732 8.94488C12.0276 8.94488 12.311 9.26378 12.311 9.61811V11.906L15.3583 14.3307C15.6417 14.5787 15.6772 14.9685 15.4646 15.252C15.3228 15.4291 15.1457 15.5 14.9331 15.5C14.7913 15.5 14.6496 15.4646 14.5433 15.3583L11.294 12.7728Z\\\" fill=\\\"black\\\"/>\\n</svg>\\n\";","import {Command} from \"ckeditor5/src/core\";\nimport {loadFromLocalStorage} from \"./storage\";\nimport {OP_CONTENT_REVISION_KEY} from \"./op-content-revisions\";\n\nexport default class OpContentRevisionsCommand extends Command {\n\n async execute (timestamp) {\n const editor = this.editor;\n const key = editor.config.get(OP_CONTENT_REVISION_KEY);\n\n const record = await loadFromLocalStorage(key);\n if (!record) {\n console.error(`Trying to load revision ${timestamp} but no record present.`)\n return;\n }\n\n const item = record.items.find(item => item.timestamp === timestamp);\n if (item) {\n editor.setData(item.content);\n setTimeout(() => {\n editor.editing.view.focus();\n });\n }\n }\n}\n","import {Plugin} from \"ckeditor5/src/core\";\nimport OpContentRevisionsUI from \"./ui\";\nimport {loadFromLocalStorage, saveInLocalStorage} from \"./storage\";\nimport OpContentRevisionsCommand from \"./command\";\nimport {getOPFieldName, getOPResource} from \"../op-context/op-context\";\nimport {Autosave} from \"@ckeditor/ckeditor5-autosave\";\n\nexport const OP_CONTENT_REVISION_KEY = \"opContentRevisionKey\";\nexport const OP_CONTENT_REVISION_PREFIX = \"op_ckeditor_rev\";\n\nexport default class OpContentRevisions extends Plugin {\n\n static get requires() {\n return [Autosave, OpContentRevisionsUI];\n }\n\n static get pluginName() {\n return \"OpContentRevisions\";\n }\n\n constructor(editor) {\n super(editor);\n\n // Define a storage key for this instance\n const revisionKey = this.createLocalStorageKey(editor);\n editor.config.define(OP_CONTENT_REVISION_KEY, revisionKey);\n }\n\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n\n editor.commands.add(\"opContentRevisionApply\", new OpContentRevisionsCommand(editor));\n\n // Remove expired revisions for all saved drafts\n editor.once(\"ready\", () => {\n const now = Date.now();\n\n // disable beforeunload hook, we have our own\n editor.plugins.get(\"Autosave\")._domEmitter.stopListening(window, \"beforeunload\");\n\n Object\n .keys(localStorage)\n .forEach((key) => {\n if (key.startsWith(OP_CONTENT_REVISION_PREFIX)) {\n const record = loadFromLocalStorage(key);\n\n // Remove data that is older than 8 hours\n if (record?.updatedAt && (now - record.updatedAt) >= 28800000) {\n localStorage.removeItem(key);\n }\n }\n });\n });\n }\n\n /**\n * Create a storage key from the given resource, if available.\n * Fall back to using the current URL path.\n */\n createLocalStorageKey(editor) {\n const resource = getOPResource(editor);\n const field = getOPFieldName(editor);\n\n let segment = \"\";\n\n if (resource?.href) {\n segment = resource.href;\n } else {\n segment = location.pathname;\n }\n\n if (field) {\n segment += `_${field}`;\n }\n\n\n return `${OP_CONTENT_REVISION_PREFIX}_${segment}`;\n }\n}\n","import OPMacroTocPlugin from './plugins/op-macro-toc-plugin';\nimport OPMacroEmbeddedTable from './plugins/op-macro-embedded-table/embedded-table-plugin';\nimport OPMacroWpButtonPlugin from './plugins/op-macro-wp-button/op-macro-wp-button-plugin';\nimport OpUploadPlugin from './plugins/op-upload-plugin';\nimport OPChildPagesPlugin from \"./plugins/op-macro-child-pages/op-macro-child-pages-plugin\";\nimport { Essentials } from '@ckeditor/ckeditor5-essentials';\nimport { CKFinderUploadAdapter } from '@ckeditor/ckeditor5-adapter-ckfinder';\nimport { Autoformat } from '@ckeditor/ckeditor5-autoformat';\nimport { Bold } from '@ckeditor/ckeditor5-basic-styles';\nimport { Code } from '@ckeditor/ckeditor5-basic-styles';\nimport { Strikethrough } from '@ckeditor/ckeditor5-basic-styles'\nimport { Italic } from '@ckeditor/ckeditor5-basic-styles';\nimport { BlockQuote } from '@ckeditor/ckeditor5-block-quote';\nimport { Heading } from '@ckeditor/ckeditor5-heading';\nimport { ImageCaption } from '@ckeditor/ckeditor5-image';\nimport { ImageStyle } from '@ckeditor/ckeditor5-image';\nimport { ImageToolbar } from '@ckeditor/ckeditor5-image';\nimport { Link } from '@ckeditor/ckeditor5-link';\nimport { List } from '@ckeditor/ckeditor5-list';\nimport { Paragraph } from '@ckeditor/ckeditor5-paragraph';\nimport { Typing } from '@ckeditor/ckeditor5-typing';\nimport OPHelpLinkPlugin from \"./plugins/op-help-link-plugin/op-help-link-plugin\";\nimport CodeBlockPlugin from \"./plugins/code-block/code-block\";\nimport OPPreviewPlugin from \"./plugins/op-preview.plugin\";\nimport { Table } from '@ckeditor/ckeditor5-table';\nimport { TableToolbar } from '@ckeditor/ckeditor5-table';\nimport { TableProperties } from '@ckeditor/ckeditor5-table';\nimport { TableCellProperties } from '@ckeditor/ckeditor5-table';\nimport { PasteFromOffice } from '@ckeditor/ckeditor5-paste-from-office';\nimport { TodoList } from '@ckeditor/ckeditor5-list';\nimport OPMacroListPlugin from \"./plugins/op-macro-list-plugin\";\nimport OPAttachmentListenerPlugin from './plugins/op-attachment-listener-plugin';\nimport OpImageAttachmentLookup from './plugins/op-image-attachment-lookup/op-image-attachment-lookup-plugin';\nimport CommonMark from './commonmark/commonmark';\nimport OPSourceCodePlugin from './plugins/op-source-code.plugin';\n// import Mention from \"../forked/ckeditor5-mention/src/mention\";\nimport { Mention } from '@ckeditor/ckeditor5-mention';\nimport {MentionCaster} from './mentions/mentions-caster';\nimport { ImageResize } from '@ckeditor/ckeditor5-image';\nimport OpCustomCssClassesPlugin from \"./plugins/op-custom-css-classes-plugin\";\nimport { ImageBlock } from '@ckeditor/ckeditor5-image';\nimport { ImageInline } from '@ckeditor/ckeditor5-image';\nimport { PageBreak } from '@ckeditor/ckeditor5-page-break';\nimport { Autosave } from '@ckeditor/ckeditor5-autosave';\nimport OpContentRevisions from \"./plugins/op-content-revisions/op-content-revisions\";\n\n// We divide our plugins into separate concerns here\n// in order to enable / disable each group by configuration\nexport const opMacroPlugins = [\n\tOPMacroTocPlugin,\n\tOPMacroEmbeddedTable,\n\tOPMacroWpButtonPlugin,\n\tOPChildPagesPlugin,\n];\n\nexport const opImageUploadPlugins = [\n\tOpUploadPlugin,\n\tOPAttachmentListenerPlugin\n];\n\nexport const builtinPlugins = [\n\tEssentials,\n\tCKFinderUploadAdapter,\n\tAutoformat,\n\tAutosave,\n\tBold,\n\tCode,\n\tItalic,\n\tStrikethrough,\n\tBlockQuote,\n\tHeading,\n\tImageBlock,\n\tImageInline,\n\tImageCaption,\n\tImageStyle,\n\tImageResize,\n\tImageToolbar,\n\tOpImageAttachmentLookup,\n\tLink,\n\tList,\n\tTodoList,\n\tPageBreak,\n\tParagraph,\n\tTyping,\n\n\t// Built-in mentions\n\tMention,\n\tMentionCaster,\n\tPasteFromOffice,\n\n\tOPHelpLinkPlugin,\n\tOPPreviewPlugin,\n\tOPSourceCodePlugin,\n\tOpContentRevisions,\n\tCodeBlockPlugin,\n\n\tCommonMark,\n\tTable,\n\tTableToolbar,\n\tTableProperties,\n\tTableCellProperties,\n\n\tOPMacroListPlugin,\n\n\tOpCustomCssClassesPlugin,\n].concat(\n\t// OpenProject Macro plugin group\n\topMacroPlugins,\n\n\t// OpenProject image upload plugins\n\topImageUploadPlugins,\n);\n","import EmbeddedTableEditing from './embedded-table-editing';\nimport { Widget } from '@ckeditor/ckeditor5-widget';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport EmbeddedTableToolbar from './embedded-table-toolbar';\n\nexport default class OPMacroEmbeddedTable extends Plugin {\n\tstatic get requires() {\n\t\treturn [ EmbeddedTableEditing, Widget, EmbeddedTableToolbar ];\n\t}\n\n\tstatic get pluginName() {\n\t\treturn 'OPMacroEmbeddedTable';\n\t}\n\n\tstatic get buttonName() {\n\t\treturn EmbeddedTableEditing.buttonName;\n\t}\n}\n","import { Widget } from '@ckeditor/ckeditor5-widget';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport OPMacroWpButtonEditing from './op-macro-wp-button-editing';\nimport OPMacroWpButtonToolbar from './op-macro-wp-button-toolbar';\n\nexport default class OPMacroWpButtonPlugin extends Plugin {\n\tstatic get requires() {\n\t\treturn [ OPMacroWpButtonEditing, Widget, OPMacroWpButtonToolbar ];\n\t}\n\n\tstatic get pluginName() {\n\t\treturn 'OPMacroWpButton';\n\t}\n\n\tstatic get buttonName() {\n\t\treturn OPMacroWpButtonEditing.buttonName;\n\t}\n}\n","import { Widget } from '@ckeditor/ckeditor5-widget';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport OPChildPagesEditing from './op-macro-child-pages-editing';\nimport OPChildPagesToolbar from './op-macro-child-pages-toolbar';\n\nexport default class OPChildPagesPlugin extends Plugin {\n\tstatic get requires() {\n\t\treturn [ OPChildPagesEditing, Widget, OPChildPagesToolbar ];\n\t}\n\n\tstatic get pluginName() {\n\t\treturn 'OPChildPages';\n\t}\n\n\tstatic get buttonName() {\n\t\treturn OPChildPagesEditing.buttonName;\n\t}\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\nimport { FileRepository } from '@ckeditor/ckeditor5-upload';\nimport OpUploadResourceAdapter from './op-upload-resource-adapter';\nimport {getOPResource} from './op-context/op-context';\nimport { ImageUpload } from '@ckeditor/ckeditor5-image';\n\nexport default class OpUploadPlugin extends Plugin {\n\n static get requires() {\n return [FileRepository, ImageUpload];\n }\n\n static get pluginName() {\n return 'OpUploadPlugin';\n }\n\n init() {\n this.editor.plugins.get('FileRepository').createUploadAdapter = (loader) => {\n\t\t\tconst resource = getOPResource(this.editor);\n\t\t\treturn new OpUploadResourceAdapter(loader, resource, this.editor);\n\t\t}\n }\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\nimport Selection from '@ckeditor/ckeditor5-engine/src/model/selection';\n\nexport default class OPAttachmentListenerPlugin extends Plugin {\n\tstatic get pluginName() {\n\t\treturn 'OPAttachmentListener';\n\t}\n\n\tinit() {\n\t\tlet editor = this.editor;\n\n\t\teditor.model.on('op:attachment-removed', (_, urls) => {\n\t\t\tthis.removeDeletedImage(urls)\n\t\t});\n\t}\n\n\tremoveDeletedImage(urls) {\n\t\tlet root = this.editor.model.document.getRoot();\n\n\t\tfor (const child of Array.from(root.getChildren())) {\n\t\t\tif (child.name === 'image' && urls.indexOf(child.getAttribute('src')) > -1) {\n\t\t\t\tconst selection = new Selection( child, 'on' );\n\n\t\t\t\tthis.editor.model.deleteContent(selection);\n\t\t\t}\n\t\t}\n\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module essentials/essentials\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Clipboard } from 'ckeditor5/src/clipboard.js';\nimport { Enter, ShiftEnter } from 'ckeditor5/src/enter.js';\nimport { SelectAll } from 'ckeditor5/src/select-all.js';\nimport { Typing } from 'ckeditor5/src/typing.js';\nimport { Undo } from 'ckeditor5/src/undo.js';\nimport { AccessibilityHelp } from 'ckeditor5/src/ui.js';\n/**\n * A plugin including all essential editing features. It represents a set of features that enables similar functionalities\n * to a `<textarea>` element.\n *\n * It includes:\n *\n * * {@link module:clipboard/clipboard~Clipboard},\n * * {@link module:enter/enter~Enter},\n * * {@link module:select-all/selectall~SelectAll},\n * * {@link module:enter/shiftenter~ShiftEnter},\n * * {@link module:typing/typing~Typing},\n * * {@link module:undo/undo~Undo}.\n *\n * This plugin set does not define any block-level containers (such as {@link module:paragraph/paragraph~Paragraph}).\n * If your editor is supposed to handle block content, make sure to include it.\n */\nexport default class Essentials extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [AccessibilityHelp, Clipboard, Enter, SelectAll, ShiftEnter, Typing, Undo];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Essentials';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport BoldEditing from './bold/boldediting.js';\nimport BoldUI from './bold/boldui.js';\n/**\n * The bold feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}\n * and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.\n */\nexport default class Bold extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [BoldEditing, BoldUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Bold';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport CodeEditing from './code/codeediting.js';\nimport CodeUI from './code/codeui.js';\nimport '../theme/code.css';\n/**\n * The code feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/code/codeediting~CodeEditing code editing feature}\n * and {@link module:basic-styles/code/codeui~CodeUI code UI feature}.\n */\nexport default class Code extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [CodeEditing, CodeUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Code';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ItalicEditing from './italic/italicediting.js';\nimport ItalicUI from './italic/italicui.js';\n/**\n * The italic feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and\n * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.\n */\nexport default class Italic extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ItalicEditing, ItalicUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Italic';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport StrikethroughEditing from './strikethrough/strikethroughediting.js';\nimport StrikethroughUI from './strikethrough/strikethroughui.js';\n/**\n * The strikethrough feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and\n * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.\n */\nexport default class Strikethrough extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [StrikethroughEditing, StrikethroughUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Strikethrough';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquote\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport BlockQuoteEditing from './blockquoteediting.js';\nimport BlockQuoteUI from './blockquoteui.js';\n/**\n * The block quote plugin.\n *\n * For more information about this feature check the {@glink api/block-quote package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:block-quote/blockquoteediting~BlockQuoteEditing block quote editing feature}\n * and {@link module:block-quote/blockquoteui~BlockQuoteUI block quote UI feature}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuote extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [BlockQuoteEditing, BlockQuoteUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuote';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/heading\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport HeadingEditing from './headingediting.js';\nimport HeadingUI from './headingui.js';\nimport '../theme/heading.css';\n/**\n * The headings feature.\n *\n * For a detailed overview, check the {@glink features/headings Headings feature} guide\n * and the {@glink api/heading package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}\n * and {@link module:heading/headingui~HeadingUI heading UI feature}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Heading extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [HeadingEditing, HeadingUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Heading';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageblock\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Widget } from 'ckeditor5/src/widget.js';\nimport ImageTextAlternative from './imagetextalternative.js';\nimport ImageBlockEditing from './image/imageblockediting.js';\nimport ImageInsertUI from './imageinsert/imageinsertui.js';\nimport '../theme/image.css';\n/**\n * The image block plugin.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n *\n * * {@link module:image/image/imageblockediting~ImageBlockEditing},\n * * {@link module:image/imagetextalternative~ImageTextAlternative}.\n *\n * Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}\n * for more information.\n */\nexport default class ImageBlock extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageBlockEditing, Widget, ImageTextAlternative, ImageInsertUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageBlock';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageinline\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Widget } from 'ckeditor5/src/widget.js';\nimport ImageTextAlternative from './imagetextalternative.js';\nimport ImageInlineEditing from './image/imageinlineediting.js';\nimport ImageInsertUI from './imageinsert/imageinsertui.js';\nimport '../theme/image.css';\n/**\n * The image inline plugin.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n *\n * * {@link module:image/image/imageinlineediting~ImageInlineEditing},\n * * {@link module:image/imagetextalternative~ImageTextAlternative}.\n *\n * Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}\n * for more information.\n */\nexport default class ImageInline extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageInlineEditing, Widget, ImageTextAlternative, ImageInsertUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageInline';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagecaption\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageCaptionEditing from './imagecaption/imagecaptionediting.js';\nimport ImageCaptionUI from './imagecaption/imagecaptionui.js';\nimport '../theme/imagecaption.css';\n/**\n * The image caption plugin.\n *\n * For a detailed overview, check the {@glink features/images/images-captions image caption} documentation.\n */\nexport default class ImageCaption extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageCaptionEditing, ImageCaptionUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCaption';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagestyle\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageStyleEditing from './imagestyle/imagestyleediting.js';\nimport ImageStyleUI from './imagestyle/imagestyleui.js';\n/**\n * The image style plugin.\n *\n * For a detailed overview of the image styles feature, check the {@glink features/images/images-styles documentation}.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n * * {@link module:image/imagestyle/imagestyleediting~ImageStyleEditing},\n * * {@link module:image/imagestyle/imagestyleui~ImageStyleUI}\n *\n * It provides a default configuration, which can be extended or overwritten.\n * Read more about the {@link module:image/imageconfig~ImageConfig#styles image styles configuration}.\n */\nexport default class ImageStyle extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageStyleEditing, ImageStyleUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageStyle';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ImageResizeButtons from './imageresize/imageresizebuttons.js';\nimport ImageResizeEditing from './imageresize/imageresizeediting.js';\nimport ImageResizeHandles from './imageresize/imageresizehandles.js';\nimport ImageCustomResizeUI from './imageresize/imagecustomresizeui.js';\nimport '../theme/imageresize.css';\n/**\n * The image resize plugin.\n *\n * It adds a possibility to resize each image using handles.\n */\nexport default class ImageResize extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageResizeEditing, ImageResizeHandles, ImageCustomResizeUI, ImageResizeButtons];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageResize';\n }\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\nimport {getOPResource} from '../op-context/op-context';\nimport {originalSrcAttribute} from '../../commonmark/commonmarkdataprocessor';\n\n\nexport function replaceImageAttachmentsByName(resource) {\n\treturn dispatcher => {\n\t\tdispatcher.on('attribute:src:imageBlock', converter, { priority: 'highest' } );\n\t\tdispatcher.on('attribute:src:imageInline', converter, { priority: 'highest' } );\n\t};\n\n\tfunction converter( evt, data, conversionApi ) {\n\n\t\t// We do not consume the attribute since we want the regular attribute\n\t\t// converter to run as well.\n\t\tlet src = data.attributeNewValue;\n\n\t\t// If the resource is not attachable or src has been nulled, do nothing\n\t\tif (!(src && resource.lookupDownloadLocationByName)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst match = resource.lookupDownloadLocationByName(src);\n\t\tdata.attributeNewValue = match || src;\n\t}\n}\n\nexport function replaceNamedAttachmentWithUrl(resource) {\n\treturn dispatcher => {\n\t\tdispatcher.on('attribute:src:imageBlock', converter, { priority: 'highest' } );\n\t\tdispatcher.on('attribute:src:imageInline', converter, { priority: 'highest' } );\n\t};\n\n\tfunction converter( evt, data, conversionApi ) {\n\n\t\t// We do not consume the attribute since we want the regular attribute\n\t\t// converter to run as well.\n\t\tlet src = data.attributeNewValue;\n\n\t\t// If the resource is not attachable or src has been nulled, do nothing\n\t\tif (!(src && resource.lookupDownloadLocationByName)) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tconst match = resource.lookupDownloadLocationByName(src);\n\t\tdata.attributeNewValue = match || src;\n\n\n\t\tconst viewWriter = conversionApi.writer;\n\t\tconst figure = conversionApi.mapper.toViewElement( data.item );\n\t\tlet img;\n\n\t\tif (data.item.name === \"imageInline\") {\n\t\t\timg = figure;\n\t\t} else {\n\t\t\timg = figure.getChild( 0 );\n\t\t}\n\n\t\tif (match) {\n\t\t\tviewWriter.setAttribute(originalSrcAttribute, src, img );\n\t\t}\n\t}\n}\n\n\nexport default class OpImageAttachmentLookup extends Plugin {\n\tstatic get pluginName() {\n\t\treturn 'OpImageAttachmentLookup';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst conversion = editor.conversion;\n\t\tconst resource = getOPResource(editor);\n\n\t\tconversion\n\t\t\t.for('editingDowncast')\n\t\t\t.add(replaceImageAttachmentsByName(resource));\n\n\t\t// Temporarily replace the src attribute with data-src attribute to avoid loading\n\t\tconversion\n\t\t\t.for('dataDowncast')\n\t\t\t.add(replaceNamedAttachmentWithUrl(resource));\n\n\t\t// Disable the native image size lookup as it breaks this method\n\t\tconst imageUtils = editor.plugins.get( 'ImageUtils' );\n\n\t\timageUtils.decorate( 'setImageNaturalSizeAttributes' );\n\n\t\timageUtils.on( 'setImageNaturalSizeAttributes', ( evt, [ element ] ) => {\n\t\t\tconsole.log( 'model image element:', { element } );\n\t\t\tevt.stop();\n\t\t}, { priority: 'highest' } );\n\t}\n\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/link\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport LinkEditing from './linkediting.js';\nimport LinkUI from './linkui.js';\nimport AutoLink from './autolink.js';\n/**\n * The link plugin.\n *\n * This is a \"glue\" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature}\n * and {@link module:link/linkui~LinkUI link UI feature}.\n */\nexport default class Link extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [LinkEditing, LinkUI, AutoLink];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Link';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport ListEditing from './list/listediting.js';\nimport ListUI from './list/listui.js';\n/**\n * The list feature.\n *\n * This is a \"glue\" plugin that loads the {@link module:list/list/listediting~ListEditing list\n * editing feature} and {@link module:list/list/listui~ListUI list UI feature}.\n */\nexport default class List extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ListEditing, ListUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'List';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/todolist\n */\nimport TodoListEditing from './todolist/todolistediting.js';\nimport TodoListUI from './todolist/todolistui.js';\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport '../theme/todolist.css';\n/**\n * The to-do list feature.\n *\n * This is a \"glue\" plugin that loads the {@link module:list/todolist/todolistediting~TodoListEditing to-do list\n * editing feature} and the {@link module:list/todolist/todolistui~TodoListUI to-do list UI feature}.\n */\nexport default class TodoList extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TodoListEditing, TodoListUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TodoList';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module page-break/pagebreak\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Widget } from 'ckeditor5/src/widget.js';\nimport PageBreakEditing from './pagebreakediting.js';\nimport PageBreakUI from './pagebreakui.js';\n/**\n * The page break feature.\n *\n * It provides the possibility to insert a page break into the rich-text editor.\n *\n * For a detailed overview, check the {@glink features/page-break Page break feature} documentation.\n */\nexport default class PageBreak extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [PageBreakEditing, PageBreakUI, Widget];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PageBreak';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module mention/mention\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport MentionEditing, { _toMentionAttribute } from './mentionediting.js';\nimport MentionUI from './mentionui.js';\nimport '../theme/mention.css';\n/**\n * The mention plugin.\n *\n * For a detailed overview, check the {@glink features/mentions Mention feature} guide.\n */\nexport default class Mention extends Plugin {\n toMentionAttribute(viewElement, data) {\n return _toMentionAttribute(viewElement, data);\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Mention';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [MentionEditing, MentionUI];\n }\n}\n","import {getPluginContext} from \"../plugins/op-context/op-context\";\nimport { ClickObserver } from '@ckeditor/ckeditor5-engine';\n\nexport function MentionCaster( editor ) {\n\tconst pluginContext = getPluginContext(editor);\n\tconst view = editor.editing.view;\n\tconst viewDocument = view.document;\n\n\tview.addObserver(ClickObserver);\n\n\t// Open mention links, in a new tab\n\teditor.listenTo(viewDocument, 'click', (evt, data) => {\n\t\tif (data.domTarget.nodeName === 'A' && data.domTarget.classList.contains('mention')) {\n\t\t\tconst link = document.createElement('a');\n\t\t\tlink.target = '_blank';\n\t\t\tlink.href = data.domTarget.attributes.href.value;\n\n\t\t\tlink.click();\n\t\t}\n\t});\n\n\t// The upcast converter will convert <mention data-id=\"id\" data-type=\"type\" data-text=\"text\">text</mention>\n\t// elements on the input HTML data to the model 'mention' attribute.\n\teditor.conversion\n\t\t.for( 'upcast' )\n\t\t.elementToAttribute( {\n\t\t\tview: {\n\t\t\t\tname: 'mention',\n\t\t\t\tkey: 'data-mention',\n\t\t\t\tclasses: 'mention',\n\t\t\t},\n\t\t\tmodel: {\n\t\t\t\tkey: 'mention',\n\t\t\t\tvalue: viewItem => {\n\t\t\t\t\tconst idNumber = viewItem.getAttribute( 'data-id' );\n\t\t\t\t\tconst type = viewItem.getAttribute( 'data-type' );\n\t\t\t\t\tconst text = viewItem.getAttribute( 'data-text' );\n\t\t\t\t\tconst link = getMentionLink(idNumber, type);\n\t\t\t\t\t// The mention feature expects that the mention attribute value\n\t\t\t\t\t// in the model is a plain object with a set of additional attributes.\n\t\t\t\t\t// In order to create a proper object use the toMentionAttribute() helper method:\n\t\t\t\t\tconst mentionAttribute = editor.plugins.get( 'Mention' ).toMentionAttribute( viewItem, {\n\t\t\t\t\t\t// Pass the properties we'll need for the editing and data downcast.\n\t\t\t\t\t\tidNumber,\n\t\t\t\t\t\tlink,\n\t\t\t\t\t\ttext,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn mentionAttribute;\n\t\t\t\t}\n\t\t\t},\n\t\t\tconverterPriority: 'high'\n\t\t} );\n\n\t// Handle mysterious corrupted mentions (<span class=\"mention\" data-type=\"\">${@user or #wp id}</span>)\n\teditor.conversion\n\t\t.for( 'upcast' )\n\t\t.elementToAttribute( {\n\t\tview: {\n\t\t\tname: 'span',\n\t\t\tkey: 'data-mention',\n\t\t\tclasses: 'mention',\n\t\t},\n\t\tmodel: {\n\t\t\tkey: 'mention',\n\t\t\tvalue: viewItem => {\n\t\t\t\tconst children = [...viewItem.getChildren()];\n\t\t\t\tconst content = children[0];\n\t\t\t\tconst text = content && content.data;\n\n\t\t\t\tif (text) {\n\t\t\t\t\tconst errorMessage = `[Invalid mention: ${text}]`;\n\t\t\t\t\tcontent._data = errorMessage;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\tconverterPriority: 'high'\n\t} );\n\n\teditor.conversion\n\t\t.for('editingDowncast')\n\t\t.attributeToElement({\n\t\t\tmodel: 'mention',\n\t\t\tconverterPriority: 'high',\n\t\t\tview: (modelAttributeValue, {writer}) => {\n\t\t\t\t// Do not convert empty attributes (lack of value means no mention).\n\t\t\t\tif ( !modelAttributeValue ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (modelAttributeValue.type === 'emoji') {\n\t\t\t\t\treturn writer.createAttributeElement('span');\n\t\t\t\t}\n\n\t\t\t\tconst element = writer.createAttributeElement(\n\t\t\t\t\t'a',\n\t\t\t\t\t{\n\t\t\t\t\t\t'class': 'mention',\n\t\t\t\t\t\t'href': modelAttributeValue.link,\n\t\t\t\t\t\t'data-mention': modelAttributeValue.text,\n\t\t\t\t\t\t'title': modelAttributeValue.text,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn element;\n\t\t\t}\n\t\t});\n\n\teditor.conversion\n\t\t.for('dataDowncast')\n\t\t.attributeToElement({\n\t\t\tmodel: 'mention',\n\t\t\tconverterPriority: 'high',\n\t\t\tview: (modelAttributeValue, {writer}) => {\n\t\t\t\t// Do not convert empty attributes (lack of value means no mention).\n\t\t\t\tif ( !modelAttributeValue ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (modelAttributeValue.type === 'emoji') {\n\t\t\t\t\treturn writer.createAttributeElement('span');\n\t\t\t\t}\n\n\t\t\t\tconst element = writer.createAttributeElement(\n\t\t\t\t\t'mention',\n\t\t\t\t\t{\n\t\t\t\t\t\t'class': 'mention',\n\t\t\t\t\t\t'data-id': modelAttributeValue.idNumber,\n\t\t\t\t\t\t'data-type': modelAttributeValue.type,\n\t\t\t\t\t\t'data-text': modelAttributeValue.text,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn element;\n\t\t\t}\n\t\t});\n\n\tfunction getMentionLink(id, type) {\n\t\tconst typePath = pluginContext.services.apiV3Service[`${type}s`].segment;\n\t\tconst base = window.OpenProject.urlRoot;\n\n\t\treturn `${base}/${typePath}/${id}`;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/pastefromoffice\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';\nimport MSWordNormalizer from './normalizers/mswordnormalizer.js';\nimport GoogleDocsNormalizer from './normalizers/googledocsnormalizer.js';\nimport GoogleSheetsNormalizer from './normalizers/googlesheetsnormalizer.js';\nimport { parseHtml } from './filters/parse.js';\n/**\n * The Paste from Office plugin.\n *\n * This plugin handles content pasted from Office apps and transforms it (if necessary)\n * to a valid structure which can then be understood by the editor features.\n *\n * Transformation is made by a set of predefined {@link module:paste-from-office/normalizer~Normalizer normalizers}.\n * This plugin includes following normalizers:\n * * {@link module:paste-from-office/normalizers/mswordnormalizer~MSWordNormalizer Microsoft Word normalizer}\n * * {@link module:paste-from-office/normalizers/googledocsnormalizer~GoogleDocsNormalizer Google Docs normalizer}\n *\n * For more information about this feature check the {@glink api/paste-from-office package page}.\n */\nexport default class PasteFromOffice extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PasteFromOffice';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n const viewDocument = editor.editing.view.document;\n const normalizers = [];\n const hasMultiLevelListPlugin = this.editor.plugins.has('MultiLevelList');\n normalizers.push(new MSWordNormalizer(viewDocument, hasMultiLevelListPlugin));\n normalizers.push(new GoogleDocsNormalizer(viewDocument));\n normalizers.push(new GoogleSheetsNormalizer(viewDocument));\n clipboardPipeline.on('inputTransformation', (evt, data) => {\n if (data._isTransformedWithPasteFromOffice) {\n return;\n }\n const codeBlock = editor.model.document.selection.getFirstPosition().parent;\n if (codeBlock.is('element', 'codeBlock')) {\n return;\n }\n const htmlString = data.dataTransfer.getData('text/html');\n const activeNormalizer = normalizers.find(normalizer => normalizer.isActive(htmlString));\n if (activeNormalizer) {\n if (!data._parsedData) {\n data._parsedData = parseHtml(htmlString, viewDocument.stylesProcessor);\n }\n activeNormalizer.execute(data);\n data._isTransformedWithPasteFromOffice = true;\n }\n }, { priority: 'high' });\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/parse\n */\n/* globals DOMParser */\nimport { DomConverter, ViewDocument } from 'ckeditor5/src/engine.js';\nimport { normalizeSpacing, normalizeSpacerunSpans } from './space.js';\n/**\n * Parses the provided HTML extracting contents of `<body>` and `<style>` tags.\n *\n * @param htmlString HTML string to be parsed.\n */\nexport function parseHtml(htmlString, stylesProcessor) {\n const domParser = new DOMParser();\n // Remove Word specific \"if comments\" so content inside is not omitted by the parser.\n htmlString = htmlString.replace(/<!--\\[if gte vml 1]>/g, '');\n // Clean the <head> section of MS Windows specific tags. See https://github.com/ckeditor/ckeditor5/issues/15333.\n // The regular expression matches the <o:SmartTagType> tag with optional attributes (with or without values).\n htmlString = htmlString.replace(/<o:SmartTagType(?:\\s+[^\\s>=]+(?:=\"[^\"]*\")?)*\\s*\\/?>/gi, '');\n const normalizedHtml = normalizeSpacing(cleanContentAfterBody(htmlString));\n // Parse htmlString as native Document object.\n const htmlDocument = domParser.parseFromString(normalizedHtml, 'text/html');\n normalizeSpacerunSpans(htmlDocument);\n // Get `innerHTML` first as transforming to View modifies the source document.\n const bodyString = htmlDocument.body.innerHTML;\n // Transform document.body to View.\n const bodyView = documentToView(htmlDocument, stylesProcessor);\n // Extract stylesheets.\n const stylesObject = extractStyles(htmlDocument);\n return {\n body: bodyView,\n bodyString,\n styles: stylesObject.styles,\n stylesString: stylesObject.stylesString\n };\n}\n/**\n * Transforms native `Document` object into {@link module:engine/view/documentfragment~DocumentFragment}. Comments are skipped.\n *\n * @param htmlDocument Native `Document` object to be transformed.\n */\nfunction documentToView(htmlDocument, stylesProcessor) {\n const viewDocument = new ViewDocument(stylesProcessor);\n const domConverter = new DomConverter(viewDocument, { renderingMode: 'data' });\n const fragment = htmlDocument.createDocumentFragment();\n const nodes = htmlDocument.body.childNodes;\n while (nodes.length > 0) {\n fragment.appendChild(nodes[0]);\n }\n return domConverter.domToView(fragment, { skipComments: true });\n}\n/**\n * Extracts both `CSSStyleSheet` and string representation from all `style` elements available in a provided `htmlDocument`.\n *\n * @param htmlDocument Native `Document` object from which styles will be extracted.\n */\nfunction extractStyles(htmlDocument) {\n const styles = [];\n const stylesString = [];\n const styleTags = Array.from(htmlDocument.getElementsByTagName('style'));\n for (const style of styleTags) {\n if (style.sheet && style.sheet.cssRules && style.sheet.cssRules.length) {\n styles.push(style.sheet);\n stylesString.push(style.innerHTML);\n }\n }\n return {\n styles,\n stylesString: stylesString.join(' ')\n };\n}\n/**\n * Removes leftover content from between closing </body> and closing </html> tag:\n *\n * ```html\n * <html><body><p>Foo Bar</p></body><span>Fo</span></html> -> <html><body><p>Foo Bar</p></body></html>\n * ```\n *\n * This function is used as specific browsers (Edge) add some random content after `body` tag when pasting from Word.\n * @param htmlString The HTML string to be cleaned.\n * @returns The HTML string with leftover content removed.\n */\nfunction cleanContentAfterBody(htmlString) {\n const bodyCloseTag = '</body>';\n const htmlCloseTag = '</html>';\n const bodyCloseIndex = htmlString.indexOf(bodyCloseTag);\n if (bodyCloseIndex < 0) {\n return htmlString;\n }\n const htmlCloseIndex = htmlString.indexOf(htmlCloseTag, bodyCloseIndex + bodyCloseTag.length);\n return htmlString.substring(0, bodyCloseIndex + bodyCloseTag.length) +\n (htmlCloseIndex >= 0 ? htmlString.substring(htmlCloseIndex) : '');\n}\n","// This SVG file import will be handled by webpack's raw-text loader.\n// This means that imageIcon will hold the source SVG.\nimport imageIcon from './../../icons/help.svg';\n\nimport { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n\nexport default class OPHelpLinkPlugin extends Plugin {\n\n\tstatic get pluginName() {\n\t\treturn 'OPHelpLinkPlugin';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst model = editor.model;\n\t\tconst helpURL = editor.config.get('openProject.helpURL');\n\n\t\teditor.ui.componentFactory.add( 'openProjectShowFormattingHelp', locale => {\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: window.I18n.t('js.inplace.link_formatting_help'),\n\t\t\t\ticon: imageIcon,\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\t// Callback executed once the image is clicked.\n\t\t\tview.on( 'execute', () => {\n\t\t\t\twindow.open(helpURL, '_blank');\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\t}\n}\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 512 512\\\"><path d=\\\"M415.462 96.978c-88.1-88.1-230.824-88.1-318.924 0-87.22 87.22-87.22 229.943 0 318.044 88.1 88.1 230.824 88.1 318.924 0 87.22-88.1 87.22-230.824 0-318.044zM246.31 437.047c-24.668 0-44.05-20.263-44.05-44.05 0-24.669 19.382-44.05 44.05-44.05 24.668 0 44.05 19.381 44.05 44.05 0 23.787-20.263 44.05-44.05 44.05zm30.835-154.176v23.787c0 12.334-4.405 16.74-15.858 16.74h-32.597c-11.453 0-15.858-4.406-15.858-16.74v-53.742c0-14.096 14.096-18.5 26.43-22.025 2.643-.88 6.167-1.762 8.81-2.643 16.74-6.167 26.43-13.215 26.43-30.835 0-6.167 0-23.787-29.073-23.787-17.62 0-33.478 7.048-43.17 10.572-5.285 2.643-7.929 3.524-11.453 3.524-5.286 0-10.572-4.405-11.453-9.691L167.9 148.958c-.88-2.643-.88-5.286-.88-7.048 0-21.145 66.075-33.479 88.1-33.479 55.503 0 93.387 36.122 93.387 88.982 0 58.146-44.05 75.767-71.362 85.458z\\\"/></svg>\";","// This SVG file import will be handled by webpack's raw-text loader.\n// This means that imageIcon will hold the source SVG.\nimport imageIcon from '../icons/preview.svg';\n\nimport { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport {getOPPath, getOPPreviewContext, getOPService} from './op-context/op-context';\nimport {enableItems, disableItems} from '../helpers/button-disabler';\n\nexport default class OPPreviewPlugin extends Plugin {\n\n\tstatic get pluginName() {\n\t\treturn 'OPPreview';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tlet previewing = false;\n\t\tlet unregisterPreview = null;\n\n\t\teditor.ui.componentFactory.add( 'preview', locale => {\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: this.label,\n\t\t\t\ticon: imageIcon,\n\t\t\t\ttooltip: true,\n\t\t\t} );\n\n\n\t\t\tlet showPreview = function(preview) {\n\t\t\t\tlet $mainEditor = jQuery(editor.ui.getEditableElement()).parent();\n\t\t\t\tlet $reference;\n\n\t\t\t\tif ($mainEditor.length) {\n\t\t\t\t\t$reference = $mainEditor;\n\t\t\t\t} else {\n\t\t\t\t\t$reference = $editable;\n\t\t\t\t}\n\n\t\t\t\tlet $previewWrapper = jQuery('<div class=\"ck-editor__preview op-uc-container\"></div>');\n\t\t\t\t$reference.siblings('.ck-editor__preview').remove();\n\n\t\t\t\tconst previewService = getOPService(editor, 'ckEditorPreview');\n\t\t\t\tunregisterPreview = previewService.render($previewWrapper[0], preview);\n\n\t\t\t\t$reference.hide();\n\t\t\t\t$reference.after($previewWrapper);\n\n\t\t\t\tdisableItems(editor, view);\n\t\t\t};\n\n\t\t\tlet getAndShowPreview = function() {\n\t\t\t\tlet link = getOPPreviewContext(editor);\n\t\t\t\tlet url = getOPPath(editor).api.v3.previewMarkup(link);\n\n\t\t\t\tjQuery\n\t\t\t\t\t.ajax({\n\t\t\t\t\t\tdata: editor.getData(),\n\t\t\t\t\t\turl: url,\n\t\t\t\t\t\tresponse_type: 'text',\n\t\t\t\t\t\tcontentType: 'text/plain; charset=UTF-8',\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t}).done(showPreview);\n\t\t\t};\n\n\t\t\tlet disablePreviewing = function() {\n\t\t\t\tlet $mainEditor = jQuery(editor.ui.getEditableElement()).parent();\n\n\t\t\t\tunregisterPreview();\n\t\t\t\t$mainEditor.siblings('.ck-editor__preview').remove();\n\t\t\t\t$mainEditor.show();\n\n\t\t\t\tenableItems(editor);\n\t\t\t};\n\n\n\t\t\t// Callback executed once the image is clicked.\n\t\t\tview.on('execute', () => {\n\t\t\t\tif (previewing) {\n\t\t\t\t\tpreviewing = false;\n\n\t\t\t\t\tdisablePreviewing();\n\t\t\t\t} else {\n\t\t\t\t\tpreviewing = true;\n\n\t\t\t\t\tgetAndShowPreview();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn view;\n\t\t} );\n\t}\n\n\tget label() {\n\t\treturn window.I18n.t('js.editor.preview');\n\t}\n}\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 512 512\\\" width=\\\"20\\\"><path d=\\\"M124 334v14c84 139 279 139 362 0v-14c-83-139-278-139-362 0zm181 91c-46 0-83-38-83-84s37-83 83-83c47 0 84 37 84 83s-37 84-84 84zm42-84c0 23-19 42-42 42s-41-19-41-42 18-42 41-42 42 19 42 42zm83-254L312-32H37v512h127v-46H83V14h210l91 92v91h46V87z\\\"/></svg>\\n\";","// This SVG file import will be handled by webpack's raw-text loader.\n// This means that imageIcon will hold the source SVG.\nimport sourceIcon from '../icons/source.svg';\nimport wysiwygIcon from '../icons/wysiwyg.svg';\n\nimport { ButtonView } from '@ckeditor/ckeditor5-ui';\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport {getOPPath, getOPPreviewContext, getOPService} from './op-context/op-context';\nimport {enableItems, disableItems} from '../helpers/button-disabler';\n\nexport default class OPSourceCodePlugin extends Plugin {\n\n\tstatic get pluginName() {\n\t\treturn 'OPSourceCode';\n\t}\n\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tlet inSourceMode = false;\n\t\tlet labels = {\n\t\t\tsource: window.I18n.t('js.editor.mode.manual'),\n\t\t\twysiwyg: window.I18n.t('js.editor.mode.wysiwyg'),\n\t\t}\n\n\n\t\teditor.ui.componentFactory.add( 'opShowSource', locale => {\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: labels.source,\n\t\t\t\tclass: '',\n\t\t\t\ticon: sourceIcon,\n\t\t\t\ttooltip: true,\n\t\t\t} );\n\n\n\t\t\tlet showSource = function(preview) {\n\t\t\t\tlet $mainEditor = jQuery(editor.ui.getEditableElement()).parent();\n\t\t\t\tlet $reference;\n\n\t\t\t\tif ($mainEditor.length) {\n\t\t\t\t\t$reference = $mainEditor;\n\t\t\t\t} else {\n\t\t\t\t\t$reference = $editable;\n\t\t\t\t}\n\n\t\t\t\tlet $sourceWrapper = jQuery('<div class=\"ck-editor__source\"></div>');\n\t\t\t\t$reference.siblings('.ck-editor__source').remove();\n\n\t\t\t\t$reference.hide();\n\t\t\t\t$reference.after($sourceWrapper);\n\n\t\t\t\tdisableItems(editor, view);\n\n\t\t\t\teditor.fire('op:source-code-enabled');\n\n\t\t\t\tview.set( {\n\t\t\t\t\tlabel: labels.wysiwyg,\n\t\t\t\t\tclass: '-source-enabled',\n\t\t\t\t\ticon: wysiwygIcon,\n\t\t\t\t\ttooltip: true,\n\t\t\t\t} );\n\n\t\t\t};\n\n\t\t\tlet hideSource = function() {\n\t\t\t\tlet $mainEditor = jQuery(editor.ui.getEditableElement()).parent();\n\n\t\t\t\teditor.fire('op:source-code-disabled');\n\n\t\t\t\t$mainEditor.siblings('.ck-editor__source').remove();\n\t\t\t\t$mainEditor.show();\n\n\t\t\t\tenableItems(editor);\n\n\t\t\t\tview.set( {\n\t\t\t\t\tlabel: labels.source,\n\t\t\t\t\tclass: '',\n\t\t\t\t\ticon: sourceIcon,\n\t\t\t\t\ttooltip: true,\n\t\t\t\t} );\n\t\t\t};\n\n\n\t\t\t// Callback executed once the image is clicked.\n\t\t\tview.on('execute', () => {\n\t\t\t\tif (inSourceMode) {\n\t\t\t\t\tinSourceMode = false;\n\t\t\t\t\thideSource();\n\t\t\t\t} else {\n\t\t\t\t\tinSourceMode = true;\n\t\t\t\t\tshowSource();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn view;\n\t\t} );\n\t}\n\n}\n","export default \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\"?>\\n<svg\\n xmlns:dc=\\\"http://purl.org/dc/elements/1.1/\\\"\\n xmlns:cc=\\\"http://creativecommons.org/ns#\\\"\\n xmlns:rdf=\\\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\\\"\\n xmlns:svg=\\\"http://www.w3.org/2000/svg\\\"\\n xmlns=\\\"http://www.w3.org/2000/svg\\\"\\n xmlns:sodipodi=\\\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\\\"\\n xmlns:inkscape=\\\"http://www.inkscape.org/namespaces/inkscape\\\"\\n viewBox=\\\"0 0 512 512\\\"\\n version=\\\"1.1\\\"\\n id=\\\"svg4\\\"\\n sodipodi:docname=\\\"wysiwyg.svg\\\"\\n inkscape:version=\\\"0.92.3 (2405546, 2018-03-11)\\\">\\n <metadata\\n id=\\\"metadata10\\\">\\n <rdf:RDF>\\n <cc:Work\\n rdf:about=\\\"\\\">\\n <dc:format>image/svg+xml</dc:format>\\n <dc:type\\n rdf:resource=\\\"http://purl.org/dc/dcmitype/StillImage\\\" />\\n </cc:Work>\\n </rdf:RDF>\\n </metadata>\\n <defs\\n id=\\\"defs8\\\" />\\n <sodipodi:namedview\\n pagecolor=\\\"#ffffff\\\"\\n bordercolor=\\\"#666666\\\"\\n borderopacity=\\\"1\\\"\\n objecttolerance=\\\"10\\\"\\n gridtolerance=\\\"10\\\"\\n guidetolerance=\\\"10\\\"\\n inkscape:pageopacity=\\\"0\\\"\\n inkscape:pageshadow=\\\"2\\\"\\n inkscape:window-width=\\\"640\\\"\\n inkscape:window-height=\\\"480\\\"\\n id=\\\"namedview6\\\"\\n showgrid=\\\"false\\\"\\n inkscape:zoom=\\\"1.3037281\\\"\\n inkscape:cx=\\\"252.52639\\\"\\n inkscape:cy=\\\"155.86537\\\"\\n inkscape:current-layer=\\\"svg4\\\" />\\n <path\\n d=\\\"m 166.9714,230.61312 h 185 v 31 h -185 z m 1,-61 h 185 v 32 h -185 z m 0,-61 h 185 v 32 h -185 z m 289,5 -118,-118.0000009 H 63.971404 V 507.61312 H 457.9714 v -394 z m -347,348 V 41.613119 h 210 l 92,92.000001 v 328 z\\\"\\n id=\\\"path2\\\"\\n inkscape:connector-curvature=\\\"0\\\"\\n sodipodi:nodetypes=\\\"cccccccccccccccccccccccccccc\\\" />\\n <rect\\n style=\\\"fill:#000000;fill-opacity:1;stroke:#353535;stroke-opacity:1\\\"\\n id=\\\"rect832\\\"\\n width=\\\"184.08746\\\"\\n height=\\\"112.75357\\\"\\n x=\\\"169.51387\\\"\\n y=\\\"313.33896\\\" />\\n</svg>\\n\";","\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport CodeBlockEditing from './code-block-editing';\nimport CodeBlockToolbar from './code-block-toolbar';\n\nexport default class CodeBlockPlugin extends Plugin {\n\tstatic get pluginName() {\n\t\treturn 'CodeBlock';\n\t}\n\n\tstatic get requires() {\n\t\treturn [ CodeBlockEditing, CodeBlockToolbar ];\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport CommonMarkDataProcessor from './commonmarkdataprocessor';\n\n// Simple plugin which loads the data processor.\nexport default function CommonMarkPlugin(editor) {\n\teditor.data.processor = new CommonMarkDataProcessor(editor.editing.view.document);\n}\n\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/table\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { Widget } from 'ckeditor5/src/widget.js';\nimport TableEditing from './tableediting.js';\nimport TableUI from './tableui.js';\nimport TableSelection from './tableselection.js';\nimport TableClipboard from './tableclipboard.js';\nimport TableKeyboard from './tablekeyboard.js';\nimport TableMouse from './tablemouse.js';\nimport '../theme/table.css';\n/**\n * The table plugin.\n *\n * For a detailed overview, check the {@glink features/tables/tables Table feature documentation}.\n *\n * This is a \"glue\" plugin that loads the following table features:\n *\n * * {@link module:table/tableediting~TableEditing editing feature},\n * * {@link module:table/tableselection~TableSelection selection feature},\n * * {@link module:table/tablekeyboard~TableKeyboard keyboard navigation feature},\n * * {@link module:table/tablemouse~TableMouse mouse selection feature},\n * * {@link module:table/tableclipboard~TableClipboard clipboard feature},\n * * {@link module:table/tableui~TableUI UI feature}.\n */\nexport default class Table extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing, TableUI, TableSelection, TableMouse, TableKeyboard, TableClipboard, Widget];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Table';\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tabletoolbar\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { WidgetToolbarRepository } from 'ckeditor5/src/widget.js';\nimport { getSelectedTableWidget, getTableWidgetAncestor } from './utils/ui/widget.js';\n/**\n * The table toolbar class. It creates toolbars for the table feature and its content (for now only for the table cell content).\n *\n * The table toolbar shows up when a table widget is selected. Its components (e.g. buttons) are created based on the\n * {@link module:table/tableconfig~TableConfig#tableToolbar `table.tableToolbar` configuration option}.\n *\n * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the\n * {@link module:table/tableconfig~TableConfig#contentToolbar `table.contentToolbar` configuration option}.\n */\nexport default class TableToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetToolbarRepository];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableToolbar';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const t = editor.t;\n const widgetToolbarRepository = editor.plugins.get(WidgetToolbarRepository);\n const tableContentToolbarItems = editor.config.get('table.contentToolbar');\n const tableToolbarItems = editor.config.get('table.tableToolbar');\n if (tableContentToolbarItems) {\n widgetToolbarRepository.register('tableContent', {\n ariaLabel: t('Table toolbar'),\n items: tableContentToolbarItems,\n getRelatedElement: getTableWidgetAncestor\n });\n }\n if (tableToolbarItems) {\n widgetToolbarRepository.register('table', {\n ariaLabel: t('Table toolbar'),\n items: tableToolbarItems,\n getRelatedElement: getSelectedTableWidget\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport TablePropertiesEditing from './tableproperties/tablepropertiesediting.js';\nimport TablePropertiesUI from './tableproperties/tablepropertiesui.js';\n/**\n * The table properties feature. Enables support for setting properties of tables (size, border, background, etc.).\n *\n * Read more in the {@glink features/tables/tables-styling Table and cell styling tools} section.\n * See also the {@link module:table/tablecellproperties~TableCellProperties} plugin.\n *\n * This is a \"glue\" plugin that loads the\n * {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing table properties editing feature} and\n * the {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI table properties UI feature}.\n */\nexport default class TableProperties extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableProperties';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TablePropertiesEditing, TablePropertiesUI];\n }\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties\n */\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport TableCellPropertiesUI from './tablecellproperties/tablecellpropertiesui.js';\nimport TableCellPropertiesEditing from './tablecellproperties/tablecellpropertiesediting.js';\n/**\n * The table cell properties feature. Enables support for setting properties of table cells (size, border, background, etc.).\n *\n * Read more in the {@glink features/tables/tables-styling Table and cell styling tools} section.\n * See also the {@link module:table/tableproperties~TableProperties} plugin.\n *\n * This is a \"glue\" plugin that loads the\n * {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing table cell properties editing feature} and\n * the {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI table cell properties UI feature}.\n */\nexport default class TableCellProperties extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCellProperties';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableCellPropertiesEditing, TableCellPropertiesUI];\n }\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\n\nimport { createDropdown, addToolbarToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils';\n\nimport {opMacroPlugins} from \"../op-plugins\";\n\n/**\n * Adding a drop down list of macros to the toolbar.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class OPMacroListPlugin extends Plugin {\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst disabledPluginNames = (editor.config.get('removePlugins') || []).map(p => p.pluginName);\n\t\tconst dropdownTooltip = window.I18n.t('js.editor.macro.dropdown.chose_macro');\n\n\t\t// Skip if we don't have any macros here\n\t\tif (editor.config.get('openProject.disableAllMacros') === true) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Register UI component.\n\t\teditor.ui.componentFactory.add( 'macroList', locale => {\n\t\t\tconst dropdownItems = [];\n\t\t\tfor ( const macroPlugin of opMacroPlugins ) {\n\t\t\t\tif (disabledPluginNames.indexOf(macroPlugin.pluginName) !== -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst listItem = editor.ui.componentFactory.create(macroPlugin.buttonName);\n\t\t\t\tdropdownItems.push(listItem);\n\t\t\t}\n\t\t\tconst dropdownView = createDropdown( locale );\n\n\t\t\taddToolbarToDropdown(dropdownView, dropdownItems, { isVertical: true, class: 'op-macro-list-button' });\n\t\t\tdropdownView.buttonView.set( {\n\t\t\t\tisOn: false,\n\t\t\t\twithText: true,\n\t\t\t\ttooltip: dropdownTooltip,\n\t\t\t\tlabel: window.I18n.t('js.editor.macro.dropdown.macros')\n\t\t\t} );\n\n\t\t\treturn dropdownView;\n\t\t} );\n\t}\n}\n","import { Plugin } from '@ckeditor/ckeditor5-core';\n\nexport default class OpCustomCssClassesPlugin extends Plugin {\n\n\tget config() {\n\t\tconst preFix = 'op-uc-';\n\t\tconst editorClasses = [`${preFix}container`, `${preFix}container_editing`];\n\t\tconst elementsWithCustomClassesMap = {\n\t\t\t'paragraph': `${preFix}p`,\n\t\t\t'heading1': `${preFix}h1`,\n\t\t\t'heading2': `${preFix}h2`,\n\t\t\t'heading3': `${preFix}h3`,\n\t\t\t'heading4': `${preFix}h4`,\n\t\t\t'heading5': `${preFix}h5`,\n\t\t\t'heading6': `${preFix}h6`,\n\t\t\t'blockQuote': `${preFix}blockquote`,\n\t\t\t'figure': `${preFix}figure`,\n\t\t\t'table': `${preFix}table`,\n\t\t\t'thead': `${preFix}table--head`,\n\t\t\t'tr': `${preFix}table--row`,\n\t\t\t'td': `${preFix}table--cell`,\n\t\t\t'th': [`${preFix}table--cell`, `${preFix}table--cell_head`],\n\t\t\t'tableCell': `${preFix}table--cell`,\n\t\t\t'tableRow': `${preFix}table--row`,\n\t\t\t'ol': `${preFix}list`,\n\t\t\t'ul': `${preFix}list`,\n\t\t\t'list': `${preFix}list`,\n\t\t\t'todo': `${preFix}list ${preFix}list_task-list`,\n\t\t\t// The list item's name in the view is 'li' while in the model is 'listItem'\n\t\t\t'listItem': `${preFix}list--item`,\n\t\t\t'li': `${preFix}list--item`,\n\t\t\t// The image's name in the view is 'img' while in the model is 'image'\n\t\t\t'imageInline': `${preFix}image ${preFix}image_inline`,\n\t\t\t'imageBlock': `${preFix}image`,\n\t\t\t'img': `${preFix}image`,\n\t\t\t'codeblock': `${preFix}code-block`,\n\t\t\t'caption': `${preFix}figure--description`,\n\t\t\t'op-macro-embedded-table': [`${preFix}placeholder`, `${preFix}embedded-table`],\n\t\t\t'op-macro-wp-button': [`${preFix}placeholder`, `${preFix}wp-button`],\n\t\t\t'op-macro-child-pages': [`${preFix}placeholder`, `${preFix}child-pages`],\n\t\t\t'op-macro-toc': [`${preFix}placeholder`, `${preFix}toc`],\n\t\t\t'content': `${preFix}figure--content`\n\t\t};\n\t\tconst attributesWithCustomClassesMap = {\n\t\t\t'code': `${preFix}code`,\n\t\t\t'linkHref': `${preFix}link`,\n\t\t\t'alignment': `${preFix}figure_align-`,\n\t\t\t'tableAlignment': `${preFix}figure_align-`,\n\t\t\t'todo': `${preFix}list_task-list`,\n\t\t\t'numbered': `${preFix}list`,\n\t\t\t'bulleted': `${preFix}list`,\n\t\t\t'listType': null,\n\t\t\t'headingColumns': null,\n\t\t\t'width': null,\n\t\t\t'uploadStatus': null\n\t\t};\n\t\tconst alignmentValuesMap = {\n\t\t\t'left': 'start',\n\t\t\t'right': 'end',\n\t\t\t'center': 'center',\n\t\t\t'default': 'center',\n\t\t};\n\n\t\treturn {\n\t\t\tpreFix,\n\t\t\teditorClasses,\n\t\t\telementsWithCustomClassesMap,\n\t\t\tattributesWithCustomClassesMap,\n\t\t\talignmentValuesMap,\n\t\t}\n\t}\n\n\tinit() {\n\t\tthis._addCustomCSSClassesToTheEditorContainer(this.editor);\n\t\tthis._addCustomCSSClassesToElements(this.config);\n\t\tthis._addCustomCSSClassesToAttributes(this.config);\n\t}\n\n\t_addCustomCSSClassesToTheEditorContainer(editor) {\n\t\teditor.sourceElement.classList.add(...this.config.editorClasses);\n\t}\n\n\t_addCustomCSSClassesToElements(config) {\n\t\tthis.editor.model.schema.extend('table', {allowAttributes: [ 'figureClasses' ]});\n\n\t\tthis.editor\n\t\t\t\t.conversion\n\t\t\t\t.for('upcast')\n\t\t\t\t.add(dispatcher => dispatcher.on(`element:table`, this._manageTableUpcast(config)), {priority: 'high'});\n\n\t\tthis.editor\n\t\t\t\t.conversion\n\t\t\t\t.for('downcast')\n\t\t\t\t.add(dispatcher => dispatcher.on(`insert`, this._manageElementsInsertion(config), {priority: 'low'}));\n\t}\n\n\t_addCustomCSSClassesToAttributes(config) {\n\t\tthis.editor\n\t\t\t\t.conversion\n\t\t\t\t.for('downcast')\n\t\t\t\t.add(dispatcher => dispatcher.on('attribute', this._manageAttributesInsertion(config), {priority: 'low'}));\n\t}\n\n\t_manageTableUpcast(config) {\n\t\treturn (evt, data, conversionApi) => {\n\t\t\tconst writer = conversionApi.writer;\n\t\t\tconst viewItem = data.viewItem;\n\t\t\tconst modelRange = data.modelRange;\n\t\t\tconst modelElement = modelRange && modelRange.start.nodeAfter;\n\n\t\t\tif (!modelElement) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the parent figure element's classes and save them as the 'figureClasses' attribute of\n\t\t\t// this table model element. In the downcast we'll take this classes to place them again\n\t\t\t// in the figure that wraps the table. This is because the figure element doesn't exist in\n\t\t\t// the model but CkEditor wraps every table and image with a <figure>.\n\t\t\tlet figureClasses = modelElement.getAttribute('figureClasses') || [];\n\t\t\tlet parentFigureRawClasses = viewItem.parent.getClassNames && viewItem.parent.getClassNames();\n\t\t\tconst parentFigureClasses = parentFigureRawClasses ? [...parentFigureRawClasses].filter(figureClass => !!figureClass) : [];\n\n\t\t\tfigureClasses = [...figureClasses, ...parentFigureClasses];\n\n\t\t\tconst alignmentClass = parentFigureClasses.filter(figureClass => figureClass.startsWith(config.attributesWithCustomClassesMap.alignment))[0];\n\t\t\tconst alignmentAlias = alignmentClass && alignmentClass.replace(config.attributesWithCustomClassesMap.alignment, '') || config.alignmentValuesMap.default;\n\t\t\tconst alignmentToApply = Object.keys(config.alignmentValuesMap).find(alignmentKey => config.alignmentValuesMap[alignmentKey] === alignmentAlias);\n\n\t\t\tif (!alignmentClass) {\n\t\t\t\tconst defaultAlignClass = `${config.attributesWithCustomClassesMap.alignment}${alignmentAlias}`;\n\t\t\t\tfigureClasses = [...figureClasses, defaultAlignClass];\n\t\t\t}\n\n\t\t\twriter.setAttribute('figureClasses', figureClasses, modelElement);\n\n\t\t\tif (alignmentToApply === 'center') {\n\t\t\t\twriter.setAttribute('alignment', null, modelElement);\n\t\t\t} else {\n\t\t\t\twriter.setAttribute('alignment', alignmentToApply, modelElement);\n\t\t\t}\n\t\t}\n\t}\n\n\t_manageElementsInsertion(config) {\n\t\treturn (evt, data, conversionApi) => {\n\t\t\tconst elementsWithCustomClasses = Object.keys(config.elementsWithCustomClassesMap);\n\t\t\tconst viewWriter = conversionApi.writer;\n\t\t\tconst elementName = data.item.name;\n\t\t\tconst modelElement = data.item;\n\t\t\tconst viewElement = conversionApi.mapper.toViewElement(modelElement);\n\t\t\tlet viewElements = [viewElement];\n\t\t\t// Images and tables are nested in a figure element, listItems are nested inside ul or ol\n\t\t\t// elements (only in the view, in the model are single elements).\n\t\t\tconst nestedElements = ['imageBlock', 'table', 'tableCell', 'tableRow', 'listItem'];\n\t\t\tconst isNestedElement = nestedElements.includes(elementName);\n\n\t\t\tif (!elementsWithCustomClasses.includes(elementName) || !viewElement) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isNestedElement) {\n\t\t\t\tif (elementName === 'listItem') {\n\t\t\t\t\tviewElements = this._manageListItems(viewWriter, modelElement, viewElement, viewElements, config);\n\t\t\t\t} else {\n\t\t\t\t\tconst figureViewElement = viewElement;\n\t\t\t\t\tconst viewChildren = Array.from(viewWriter.createRangeIn(viewElement).getItems());\n\n\t\t\t\t\tif (elementName === 'imageBlock') {\n\t\t\t\t\t\tconst image = viewChildren.find(item => item.is('element', 'img'));\n\n\t\t\t\t\t\tthis._wrapInFigureContentContainer(image, figureViewElement, config, viewWriter);\n\n\t\t\t\t\t\tviewElements = [...viewElements, image];\n\t\t\t\t\t} else if (elementName === 'table' || elementName === 'tableRow') {\n\t\t\t\t\t\tconst childrenToAdd = viewChildren.filter(viewChild => elementsWithCustomClasses.includes(viewChild.name));\n\n\t\t\t\t\t\tviewElements = [...viewElements, ...childrenToAdd];\n\n\t\t\t\t\t\tif (elementName === 'table') {\n\t\t\t\t\t\t\tconst tableAlignment = modelElement.getAttribute('tableAlignment');\n\n\t\t\t\t\t\t\tif (!tableAlignment) {\n\t\t\t\t\t\t\t\tconst defaultAlignClass = `${config.attributesWithCustomClassesMap.alignment}${config.alignmentValuesMap.default}`;\n\n\t\t\t\t\t\t\t\tviewWriter.addClass(defaultAlignClass, figureViewElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tviewElements.forEach(viewElement => {\n\t\t\t\tconst elementKey = isNestedElement ? viewElement.name : elementName;\n\t\t\t\tconst elementClasses = config.elementsWithCustomClassesMap[elementKey];\n\n\t\t\t\tviewWriter.addClass(elementClasses, viewElement);\n\t\t\t});\n\t\t}\n\t}\n\n\t_manageAttributesInsertion(config) {\n\t\treturn (evt, data, conversionApi) => {\n\t\t\tconst attributesWithCustomClasses = Object.keys(config.attributesWithCustomClassesMap);\n\t\t\tconst attributeName = data.attributeKey;\n\t\t\tconst viewWriter = conversionApi.writer;\n\t\t\tconst modelElement = data.item;\n\t\t\tconst viewElement = conversionApi.mapper.toViewElement(modelElement);\n\n\t\t\tif (!attributesWithCustomClasses.includes(attributeName)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (attributeName === 'linkHref' || attributeName === 'code') {\n\t\t\t\tconst attributeTag = attributeName === 'linkHref' ? 'a' : attributeName;\n\t\t\t\tconst attributePriority = attributeName === 'linkHref' ? 5 : 10;\n\t\t\t\tconst viewSelection = viewWriter.document.selection;\n\t\t\t\tconst viewElement = viewWriter.createAttributeElement(\n\t\t\t\t\tattributeTag,\n\t\t\t\t\t{class: config.attributesWithCustomClassesMap[attributeName]},\n\t\t\t\t\t{priority: attributePriority}\n\t\t\t\t);\n\n\t\t\t\tif (modelElement.is('selection')) {\n\t\t\t\t\tviewWriter.wrap(viewSelection.getFirstRange(), viewElement);\n\t\t\t\t} else {\n\t\t\t\t\tviewWriter.wrap(conversionApi.mapper.toViewRange(data.range), viewElement);\n\t\t\t\t}\n\t\t\t} else if (attributeName === 'tableAlignment') {\n\t\t\t\tconst figureViewElement = viewElement;\n\t\t\t\t// When the selected align is 'center', data.attributeNewValue is null\n\t\t\t\tconst alignmentToApply = config.alignmentValuesMap[data.attributeNewValue || config.alignmentValuesMap.default];\n\t\t\t\tconst alignmentClasses = Object\n\t\t\t\t\t.values(config.alignmentValuesMap)\n\t\t\t\t\t.map(alignmentValue => `${config.attributesWithCustomClassesMap[attributeName]}${alignmentValue}`);\n\n\t\t\t\talignmentClasses\n\t\t\t\t\t.filter(alignmentClass => figureViewElement.hasClass(alignmentClass))\n\t\t\t\t\t.forEach(alignmentClass => viewWriter.removeClass(alignmentClass, figureViewElement));\n\n\t\t\t\t// Remove inline alignment styles and classes, they will be handled by\n\t\t\t\t// custom classes (ie: op-uc-figure_align-center)\n\t\t\t\tif (figureViewElement.hasStyle('float')) {\n\t\t\t\t\tviewWriter.removeStyle('float', figureViewElement);\n\t\t\t\t}\n\n\t\t\t\tviewWriter.addClass(`${config.attributesWithCustomClassesMap[attributeName]}${alignmentToApply}`, figureViewElement);\n\t\t\t} else if (attributeName === 'listType') {\n\t\t\t\tconst viewElements = this._manageListItems(viewWriter, modelElement, viewElement, [viewElement], config);\n\n\t\t\t\tviewElements.forEach(viewElement => {\n\t\t\t\t\tconst elementKey = viewElement.name;\n\t\t\t\t\tconst elementClasses = config.elementsWithCustomClassesMap[elementKey];\n\n\t\t\t\t\tviewWriter.addClass(elementClasses, viewElement);\n\t\t\t\t});\n\t\t\t} else if (attributeName === 'headingColumns') {\n\t\t\t\tconst addHeadingColumns = data.attributeNewValue;\n\t\t\t\tconst viewChildren = Array.from(viewWriter.createRangeIn(viewElement).getItems());\n\t\t\t\tconst viewElements = viewChildren.filter(viewChild => Object.keys(config.elementsWithCustomClassesMap).includes(viewChild.name));\n\n\t\t\t\tif (addHeadingColumns) {\n\t\t\t\t\tviewElements.forEach(viewElement => {\n\t\t\t\t\t\tconst elementKey = viewElement.name;\n\t\t\t\t\t\tconst elementClasses = config.elementsWithCustomClassesMap[elementKey];\n\n\t\t\t\t\t\tviewWriter.addClass(elementClasses, viewElement);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tviewElements\n\t\t\t\t\t\t.filter(viewElement => viewElement.hasClass(config.elementsWithCustomClassesMap.th[1]))\n\t\t\t\t\t\t.forEach(viewElement => {\n\t\t\t\t\t\t\tconst nextSibling = viewElement.nextSibling;\n\n\t\t\t\t\t\t\tif (nextSibling && nextSibling.name !== 'th') {\n\t\t\t\t\t\t\t\tviewWriter.removeClass(config.elementsWithCustomClassesMap.th[1], viewElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (attributeName === 'width') {\n\t\t\t\tif (viewElement.hasClass('image_resized')) {\n\t\t\t\t\tviewWriter.removeClass('image_resized', viewElement);\n\t\t\t\t}\n\t\t\t} else if (attributeName === 'uploadStatus') {\n\t\t\t\tif (data.attributeNewValue === 'complete') {\n\t\t\t\t\tconst viewChildren = Array.from(viewWriter.createRangeIn(viewElement).getItems());\n\t\t\t\t\tlet placeholderElement = viewChildren.find(viewChild => viewChild.hasClass('ck-upload-placeholder-loader'));\n\n\t\t\t\t\tif (placeholderElement) {\n\t\t\t\t\t\tviewWriter.remove(viewWriter.createRangeOn(placeholderElement));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t_manageListItems(viewWriter, modelElement, viewElement, viewElements, config) {\n\t\tconst listItemElement = viewElement.findAncestor('li');\n\t\tconst listElement = viewElement.findAncestor(/^(ul|ol)$/);\n\n\n\t\tif (!listElement) {\n\t\t\treturn viewElements;\n\t\t}\n\n\t\tconst listType = modelElement.getAttribute('listType');\n\t\tconst listTypeClass = config.attributesWithCustomClassesMap[listType];\n\t\tconst previousElement = listElement.previousSibling;\n\t\tconst nextElement = listElement.nextSibling;\n\n\t\tif (listType === 'todo') {\n\t\t\tviewWriter.addClass(listTypeClass, listElement);\n\t\t} else {\n\t\t\t// Remove the op-uc-list_task-list class if present.\n\t\t\t// It could be present for example when the list type has changed\n\t\t\tconst todoListClass = config.attributesWithCustomClassesMap['todo'];\n\n\t\t\tif (listElement.hasClass(todoListClass)) {\n\t\t\t\tviewWriter.removeClass(todoListClass, listElement);\n\t\t\t}\n\t\t}\n\n\t\treturn [...viewElements, listElement, listItemElement];\n\t}\n\n\t_wrapInFigureContentContainer(element, parentElement, config, viewWriter) {\n\t\tconst containerElement = viewWriter.createContainerElement(\n\t\t\t'div',\n\t\t\t{class: config.elementsWithCustomClassesMap.content}\n\t\t);\n\n\t\tviewWriter.insert(viewWriter.createPositionAt(containerElement, 0), element);\n\t\tviewWriter.insert(viewWriter.createPositionAt(parentElement, 0), containerElement);\n\t}\n}\n","export function customItemRenderer( item ) {\n const itemElement = document.createElement( 'span' );\n\n\titemElement.classList.add( 'mention-list-item' );\n\titemElement.textContent = item.name;\n\n return itemElement;\n}\n\nexport function emojiItemRenderer( item ) {\n\tconst itemElement = document.createElement( 'span' );\n\n\titemElement.classList.add('mention-list-item' );\n\titemElement.textContent = `${item.text} ${item.name}`;\n\n\treturn itemElement;\n}\n","import {userMentions} from \"./mentions/user-mentions\";\nimport {workPackageMentions} from \"./mentions/work-package-mentions\";\nimport {customItemRenderer, emojiItemRenderer} from './mentions/mentions-item-renderer';\nimport {emojiMentions} from \"./mentions/emoji-mentions\";\nimport {saveInLocalStorage} from \"./plugins/op-content-revisions/storage\";\n\nexport const defaultConfig = {\n\tautosave: {\n\t\twaitingTime: 5000,\n\t\tsave(editor) {\n\t\t\treturn saveInLocalStorage(editor);\n\t\t},\n\t},\n\theading: {\n\t\toptions: [\n\t\t\t{model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph'},\n\t\t\t{model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1'},\n\t\t\t{model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2'},\n\t\t\t{model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3'},\n\t\t\t{model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4'},\n\t\t\t{model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5'}\n\t\t]\n\t},\n\ttoolbar: {\n\t\t// Will be defined by each build\n\t},\n\tOPMacroEmbeddedTable: {\n\t\ttoolbar: [\n\t\t\t'opEditEmbeddedTableQuery',\n\t\t]\n\t},\n\tOPMacroWpButton: {\n\t\ttoolbar: [\n\t\t\t'opEditWpMacroButton',\n\t\t]\n\t},\n\tOPWikiIncludePage: {\n\t\ttoolbar: [\n\t\t\t'opEditWikiIncludeMacroButton',\n\t\t]\n\t},\n\tOPCodeBlock: {\n\t\ttoolbar: [\n\t\t\t'opEditCodeBlock',\n\t\t]\n\t},\n\tOPChildPages: {\n\t\ttoolbar: [\n\t\t\t'opEditChildPagesMacroButton',\n\t\t]\n\t},\n\timage: {\n\t\tinsert: {\n\t\t\t// Default to inline image type by default\n\t\t\ttype: 'inline',\n\t\t},\n\t\tresizeUnit: 'px',\n\t\tresizeOptions: [\n\t\t\t{\n\t\t\t\tname: 'imageResize:original',\n\t\t\t\tvalue: null,\n\t\t\t\ticon: 'original'\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'imageResize:50',\n\t\t\t\tvalue: '50',\n\t\t\t\ticon: 'medium'\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'imageResize:75',\n\t\t\t\tvalue: '75',\n\t\t\t\ticon: 'large'\n\t\t\t}\n\t\t],\n\t\ttoolbar: [\n\t\t\t'toggleImageCaption',\n\t\t\t'imageTextAlternative',\n\t\t\t'|',\n\t\t\t'imageStyle:inline',\n\t\t\t'imageStyle:block',\n\t\t\t'|',\n\t\t\t'imageResize:original'\n\t\t]\n\t},\n\ttable: {\n\t\tcontentToolbar: [\n\t\t\t'tableColumn', 'tableRow', 'mergeTableCells',\n\t\t\t'tableProperties', 'tableCellProperties'\n\t\t]\n\t},\n\n\tmention: {\n\t\tfeeds: [\n\t\t\t{\n\t\t\t\tmarker: '@',\n\t\t\t\tfeed: userMentions,\n\t\t\t\titemRenderer: customItemRenderer,\n\t\t\t\tminimumCharacters: 0\n\t\t\t},\n\t\t\t{\n\t\t\t\tmarker: '#',\n\t\t\t\tfeed: workPackageMentions,\n\t\t\t\titemRenderer: customItemRenderer,\n\t\t\t\tminimumCharacters: 1\n\t\t\t},\n\t\t\t{\n\t\t\t\tmarker: ':',\n\t\t\t\tfeed: emojiMentions,\n\t\t\t\titemRenderer: emojiItemRenderer,\n\t\t\t\tminimumCharacters: 1\n\t\t\t}\n\t\t]\n\t},\n\n\tlanguage: 'en'\n};\n","import {\n\tgetOPResource,\n\tgetOPPath,\n\tgetPluginContext,\n\tgetOPHelper,\n} from \"../plugins/op-context/op-context\";\n\nexport function userMentions(queryText) {\n\tconst editor = this;\n\tconst resource = getOPResource(editor);\n\n\t// Unsupported context does not allow mentioning\n\tif (!(resource && resource._type === 'WorkPackage')) {\n\t\treturn [];\n\t}\n\n\tif (editor.config.get('disabledMentions').includes('user')) {\n\t\treturn [];\n\t}\n\n\tconst url = getOPPath(editor).api.v3.principals(resource, queryText) + '&select=elements/_type,elements/id,elements/name';\n\tconst pluginContext = getPluginContext(editor);\n\tconst base = window.OpenProject.urlRoot;\n\n\treturn new Promise((resolve, reject) => {\n\t\tjQuery.getJSON(url, collection => {\n\t\t\tresolve(_.uniqBy(collection._embedded.elements, (el) => el.id).map(mention => {\n\t\t\t\tconst type = mention._type.toLowerCase();\n\t\t\t\tconst text = `@${mention.name}`;\n\t\t\t\tconst id = `@${mention.id}`;\n\t\t\t\tconst idNumber = mention.id;\n\t\t\t\tconst typeSegment = pluginContext.services.apiV3Service[`${type}s`].segment;\n\t\t\t\tconst link = `${base}/${typeSegment}/${idNumber}`;\n\n\t\t\t\treturn {type, id, text, link, idNumber, name: mention.name};\n\t\t\t}));\n\t\t});\n\t})\n}\n","export function workPackageMentions(query) {\n\tlet editor = this;\n\tconst url = window.OpenProject.urlRoot + `/work_packages/auto_complete.json`;\n\tlet base = window.OpenProject.urlRoot + `/work_packages/`;\n\n\tif (editor.config.get('disabledMentions').includes('work_package')) {\n\t\treturn [];\n\t}\n\n\treturn new Promise((resolve, reject) => {\n\t\tjQuery.getJSON(url, {q: query, scope: 'all'}, collection => {\n\t\t\tresolve(collection.map(wp => {\n\t\t\t\tconst id = `#${wp.id}`;\n\t\t\t\tconst idNumber = wp.id;\n\n\t\t\t\treturn {id, idNumber, type: 'work_package', text: id, name: wp.to_s, link: base + wp.id};\n\t\t\t}));\n\t\t});\n\t})\n}\n","import emojis from './emojis.json';\n\nexport function emojiMentions(query) {\n\tfunction isNameOrKeywords( query, name, keywords ) {\n\t\tif ( name.includes(query) ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( keywords.length !== 0 ) {\n\t\t\tfor (let i = 0; i < keywords.length; i++ ) {\n\t\t\t\tif (keywords[i].includes(query)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\treturn new Promise((resolve, _reject) => {\n\t\tconst emojiStore = emojis;\n\t\tconst matches = emojiStore\n\t\t\t.filter((emoji) => isNameOrKeywords(query, emoji.id, emoji.keywords))\n\t\t\t.map((emoji) => {\n\t\t\t\treturn { id: emoji.id, name: emoji.id.replace(/:/g, \"\"), text: emoji.symbol, type: 'emoji' };\n\t\t\t});\n\n\t\tresolve(matches);\n\t})\n}\n","import {opImageUploadPlugins, opMacroPlugins} from './op-plugins';\n\nexport function configurationCustomizer(editorClass) {\n\treturn (wrapper, configuration) => {\n\t\tconst context = configuration.openProject.context;\n\n\t\t// We're going to remove some plugins from the default configuration\n\t\t// when we detect they are unsupported in the current context\n\t\tconfiguration.removePlugins = configuration.removePlugins || [];\n\n\t\t// Disable uploading if there is no resource with uploadAttachment\n\t\tconst resource = context.resource;\n\t\tif (!(resource && resource.canAddAttachments)) {\n\t\t\tconfiguration.removePlugins.push(...opImageUploadPlugins.map(el => el.pluginName))\n\t\t}\n\n\t\t// Disable macros entirely\n\t\tif (context.macros === false) {\n\t\t\tconfiguration.openProject.disableAllMacros = true;\n\t\t\tconfiguration.removePlugins.push(...opMacroPlugins.map(el => el.pluginName))\n\t\t}\n\n\t\t// Enable selective macros\n\t\tif (Array.isArray(context.macros)) {\n\t\t\tconst disabledMacros = opMacroPlugins.filter(plugin => context.macros.indexOf(plugin.pluginName) === -1);\n\t\t\tconfiguration.removePlugins.push(...disabledMacros);\n\t\t}\n\n\t\t// Disable specific mentions\n\t\tconfiguration.disabledMentions = [];\n\t\tconst disabledMentions = context.disabledMentions;\n\t\tif (Array.isArray(disabledMentions)) {\n\t\t\tconfiguration.disabledMentions = disabledMentions;\n\t\t}\n\n\t\t// Return the original promise for instance creation\n\t\treturn editorClass.create(wrapper, configuration).then(editor => {\n\t\t\treturn editor;\n\t\t});\n\t};\n}\n","import { DecoupledEditor } from '@ckeditor/ckeditor5-editor-decoupled';\nimport { EditorWatchdog } from '@ckeditor/ckeditor5-watchdog';\nimport {builtinPlugins} from './op-plugins';\nimport {defaultConfig} from \"./op-ckeditor-config\";\nimport {configurationCustomizer} from './op-config-customizer';\n\nexport class ConstrainedEditor extends DecoupledEditor {}\nexport class FullEditor extends DecoupledEditor {}\n\n// Export the two common interfaces\nwindow.OPConstrainedEditor = ConstrainedEditor;\nwindow.OPClassicEditor = FullEditor;\n\n// Export the Watchdog feature\nwindow.OPEditorWatchdog = EditorWatchdog;\n\nFullEditor.createCustomized = configurationCustomizer(FullEditor);\nFullEditor.builtinPlugins = builtinPlugins;\nFullEditor.defaultConfig = Object.assign({}, defaultConfig);\nFullEditor.defaultConfig.toolbar = {\n\t\titems: [\n\t\t\t'heading',\n\t\t\t'|',\n\t\t\t'bold',\n\t\t\t'italic',\n\t\t\t'strikethrough',\n\t\t\t'code',\n\t\t\t'insertCodeBlock',\n\t\t\t'link',\n\t\t\t'bulletedList',\n\t\t\t'numberedList',\n\t\t\t'todoList',\n\t\t\t'imageUpload',\n\t\t\t'blockQuote',\n\t\t\t'|',\n\t\t\t'insertTable',\n\t\t\t'macroList',\n\t\t\t'|',\n\t\t\t'opContentRevisions',\n\t\t\t'undo',\n\t\t\t'redo',\n\t\t\t'openProjectShowFormattingHelp',\n\t\t\t'|',\n\t\t\t'pageBreak',\n\t\t\t'|',\n\t\t\t'preview',\n\t\t\t'opShowSource',\n\t\t]\n};\n\nConstrainedEditor.createCustomized = configurationCustomizer(ConstrainedEditor);\nConstrainedEditor.builtinPlugins = builtinPlugins;\nConstrainedEditor.defaultConfig = Object.assign({}, defaultConfig);\nConstrainedEditor.defaultConfig.toolbar = {\n\titems: [\n\t\t'bold',\n\t\t'italic',\n\t\t'strikethrough',\n\t\t'code',\n\t\t'insertCodeBlock',\n\t\t'link',\n\t\t'bulletedList',\n\t\t'numberedList',\n\t\t'todoList',\n\t\t'imageUpload',\n\t\t'blockQuote',\n\t\t'|',\n\t\t'opContentRevisions',\n\t\t'undo',\n\t\t'redo',\n\t\t'openProjectShowFormattingHelp',\n\t\t'preview',\n\t\t'opShowSource'\n\t]\n};\n"],"names":["t","self","e","n","o","i","Object","keys","r","rgb","channels","labels","hsl","hsv","hwb","cmyk","xyz","lab","lch","hex","keyword","ansi16","ansi256","hcg","apple","gray","exports","Error","length","defineProperty","value","Math","min","max","s","a","l","c","d","u","floor","atan2","PI","sqrt","cos","sin","round","toString","toUpperCase","substring","match","split","map","join","parseInt","forEach","conversion","raw","distance","parent","pop","unshift","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","push","id","version","sources","names","mappings","sourcesContent","sourceRoot","URL","b","h","this","concat","String","__esModule","default","test","slice","hash","needQuotes","replace","btoa","unescape","encodeURIComponent","JSON","stringify","fromCharCode","charAt","compressToBase64","_compress","decompressFromBase64","_decompress","compressToUTF16","decompressFromUTF16","charCodeAt","compressToUint8Array","compress","Uint8Array","decompressFromUint8Array","decompress","Array","compressToEncodedURIComponent","decompressFromEncodedURIComponent","m","p","g","f","prototype","hasOwnProperty","call","pow","val","position","index","attrIndex","attrPush","attrs","level","type","content","indexOf","children","ceil","random","for","enabled","label","labelAfter","core","ruler","after","tokens","Token","identifier","base","css","media","sourceMap","supports","layer","references","updater","byIndex","splice","domAPI","update","remove","document","querySelector","window","HTMLIFrameElement","contentDocument","head","appendChild","createElement","setAttributes","attributes","insert","options","setAttribute","filter","Boolean","styleSheet","cssText","createTextNode","childNodes","removeChild","insertBefore","singleton","singletonCounter","insertStyleElement","getPrototypeOf","__proto__","then","create","getOwnPropertyNames","enumerable","get","Symbol","toStringTag","baseURI","location","href","navigator","userAgent","toLowerCase","isMac","isWindows","isGecko","isSafari","isiOS","maxTouchPoints","isAndroid","isBlink","isMediaForcedColors","matchMedia","matches","isMotionReduced","features","isRegExpUnicodePropertySupported","search","RegExp","k","isArray","w","firstIndex","lastIndexOld","lastIndexNew","y","fill","values","howMany","reverse","A","fastDiff","v","constructor","source","name","path","stop","called","off","x","E","D","normal","highest","high","low","lowest","B","priority","S","T","super","WeakSet","circularReferencesReplacer","has","add","P","context","data","is","rethrowUnexpectedError","message","stack","I","console","warn","F","M","Date","globalThis","CKEDITOR_VERSION","z","V","N","O","L","on","listenTo","once","stopListening","j","H","emitter","callbacks","_addEventListener","G","fire","W","from","callback","apply","_removeEventListener","$","return","delegate","to","Map","set","stopDelegating","delete","clear","q","childEvents","substr","lastIndexOf","U","_events","K","Z","J","Y","Q","X","ee","te","oe","configurable","bind","re","Set","size","property","ne","toMany","ie","_observable","_bindProperties","_to","_bindings","unbind","decorate","object","methodName","properties","observable","se","every","ae","le","ce","iterator","de","global","ue","he","Function","me","pe","ge","fe","be","we","ye","Ae","ke","_e","Ce","ve","xe","Ee","xmlns","createElementNS","De","Be","Se","Te","Ie","Pe","Fe","Re","ze","Ve","Ne","qe","__data__","Ue","Ze","Je","Ye","exec","IE_PROTO","Xe","et","tt","ot","nt","it","rt","st","at","Qe","ct","lt","dt","ut","pt","ft","wt","_t","Ct","At","Bt","string","St","It","Pt","Rt","Mt","writable","zt","Vt","Nt","Lt","Ht","jt","qt","propertyIsEnumerable","Ut","arguments","$t","nodeType","Gt","module","Kt","Buffer","Zt","isBuffer","Jt","Yt","Qt","Xt","oo","no","io","process","ro","require","types","binding","so","isTypedArray","ao","lo","co","Ot","uo","ho","mo","po","fo","bo","go","_o","yo","wo","Ao","vo","xo","Eo","Do","allocUnsafe","Bo","copy","So","Io","Po","Fo","getOwnPropertySymbols","Ro","To","zo","Vo","Oo","Lo","Ho","jo","qo","Uo","Wo","$o","Go","Ko","Zo","Jo","Yo","Qo","Xo","en","tn","ArrayBuffer","resolve","nn","rn","an","ln","byteLength","dn","hn","mn","valueOf","gn","buffer","byteOffset","fn","cn","lastIndex","un","pn","bn","kn","wn","yn","isMap","An","vn","isSet","xn","En","Dn","Bn","Sn","Tn","input","sn","No","Co","Mo","ko","Ft","In","Pn","Fn","_config","define","Rn","_setObjectToTarget","_setToTarget","_getFromSource","Mn","zn","defaultView","Document","ownerDocument","Node","Vn","Nn","On","capture","useCapture","passive","usePassive","_getProxyEmitter","Ln","_getAllProxyEmitters","Hn","_domNode","_options","attach","_domListeners","_createDomListener","addEventListener","detach","removeListener","removeEventListener","sort","jn","getComputedStyle","top","borderTopWidth","right","borderRightWidth","bottom","borderBottomWidth","left","borderLeftWidth","qn","Un","Wn","parentNode","offsetParent","body","$n","Gn","_source","Jn","getDomRangeRects","Kn","getBoundingRect","getBoundingClientRect","innerWidth","innerHeight","width","height","clone","moveTo","moveBy","getIntersection","getIntersectionArea","getArea","getVisible","Zn","commonAncestorContainer","HTMLElement","overflow","Yn","isEqual","contains","toAbsoluteRect","scrollX","scrollY","scrollLeft","scrollTop","excludeScrollbarsAndBorders","documentElement","clientWidth","clientHeight","direction","offsetWidth","offsetHeight","getClientRects","startContainer","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","Qn","_observerInstance","_createObserver","_element","_callback","_addElementCallback","observe","element","destroy","_deleteElementCallback","_elementCallbacks","_getElementCallbacks","unobserve","ResizeObserver","target","Xn","ei","HTMLTextAreaElement","innerHTML","ti","oi","previousSibling","ni","ii","COMMENT_NODE","ri","si","positions","limiter","fitInViewport","viewportOffsetConfig","assign","ai","targetRect","elementRect","positionedElementAncestor","viewportRect","limiterRect","li","limiterIntersectionArea","viewportIntersectionArea","config","_positioningFunctionCoordinates","_absoluteRect","_rect","_cachedRect","_cachedAbsoluteRect","ci","di","rect","alignToTop","forceScroll","viewportOffset","mi","hi","pi","gi","scrollTo","ui","getRect","ancestorOffset","limiterElement","fi","bi","ki","frameElement","wi","ctrl","cmd","alt","shift","_i","yi","Ai","Bi","pageup","pagedown","arrowleft","arrowup","arrowright","arrowdown","backspace","enter","space","esc","tab","Ci","fromEntries","entries","vi","key","keyCode","altKey","ctrlKey","shiftKey","metaKey","xi","trim","endsWith","reduce","Ei","Di","Si","Ti","Ii","Fi","Mi","Pi","Ri","zi","Vi","Oi","Hi","ji","qi","now","Wi","Ui","$i","Ni","Li","Ki","Gi","Zi","Ji","CKEDITOR_TRANSLATIONS","Qi","Xi","includes","er","uiLanguage","contentLanguage","translations","uiLanguageDirection","contentLanguageDirection","language","plural","Yi","quantity","dictionary","getPluralForm","tr","_items","_itemMap","_idProperty","idProperty","_bindToExternalToInternalMap","WeakMap","_bindToInternalToExternalMap","_skippedIndexesFromExternal","_getItemIdBeforeAdding","first","last","addMany","added","removed","getIndex","_remove","find","_bindToCollection","bindTo","as","_setUpBindToBinding","using","addItem","or","next","done","nr","_elements","_nextEventLoopTimeout","_focus","_blur","focusedElement","clearTimeout","isFocused","setTimeout","ir","_listener","preventDefault","stopPropagation","press","rr","sr","cancel","ar","lr","cr","ur","dr","matchAll","some","hr","_disableStack","editor","forceDisabled","mr","isEnabled","clearForceDisabled","isContextPlugin","pr","_affectsData","_isEnabledBasedOnSelection","model","refresh","affectsData","selection","getFirstPosition","root","rootName","canEditAt","isReadOnly","gr","execute","fr","_plugins","_context","_availablePlugins","pluginName","_contextPlugins","plugin","init","requires","pluginItem","_add","missingPlugin","requiredBy","Promise","all","plugin1","plugin2","br","_contextOwner","defaultConfig","builtinPlugins","plugins","locale","editors","initPlugins","Plugin","_addEditor","_removeEditor","_getEditorConfig","kr","Tr","Er","vr","Ar","Br","_r","Sr","locals","Ir","Pr","Fr","view","text","isDirectHost","keepOnFocus","hostElement","change","Vr","registerPostFixer","placeholder","Nr","Or","getAttribute","childCount","zr","isAttached","getChildren","anchor","isComposing","Rr","hasClass","addClass","Mr","removeClass","getChild","Lr","Hr","jr","getChildIndex","nextSibling","getPath","getAncestors","includeSelf","parentFirst","getCommonAncestor","isBefore","isAfter","_removeChildren","_fireChange","toJSON","qr","_textData","_data","isSimilar","_clone","Ur","textNode","offsetInText","offsetSize","isPartial","Wr","_patterns","$r","pattern","getElementName","getAttributeKeys","style","class","Gr","classes","getClassNames","styles","getStyleNames","getStyle","Kr","Zr","Jr","Yr","Qr","TypeError","cache","Cache","Xr","ts","os","ns","es","rs","ss","ls","cs","ds","hs","ms","ps","fs","gs","us","ks","_s","ws","ys","_styles","_styleProcessor","isEmpty","setTo","toNormalizedForm","getReducedForm","Cs","bs","_cleanEmptyObjectsOnPath","getNormalized","getStylesEntries","getAsString","As","_normalizers","_extractors","_reducers","_consumables","vs","getRelatedStyles","setNormalizer","setExtractor","setReducer","setStyleRelation","_mapStyleNames","xs","_unsafeAttributesToRender","_customProperties","_attrs","_children","_insertChild","_classes","Es","stylesProcessor","getAttributes","hasAttribute","getNormalizedStyle","hasStyle","findAncestor","getCustomProperty","getCustomProperties","getIdentity","shouldRenderUnsafeAttribute","getFillerOffset","_appendChild","_setAttribute","_removeAttribute","_addClass","_removeClass","_setStyle","_removeStyle","_setCustomProperty","_removeCustomProperty","Ds","Bs","Ss","editableElement","Ts","Is","_name","Ps","boundaries","startPosition","_position","Fs","_createAt","singleCharacters","shallow","ignoreElementEnd","_boundaryStartParent","start","_boundaryEndParent","end","skip","_next","_previous","offset","isAtEnd","_createAfter","_formatReturnValue","isAtStart","_createBefore","item","previousPosition","nextPosition","nodeAfter","nodeBefore","getShiftedBy","getLastMatchingPosition","compareWith","getWalker","Rs","isCollapsed","isFlat","getEnlarged","Ms","getTrimmed","containsPosition","containsRange","getDifference","isIntersecting","getContainedElement","getItems","getPositions","_createFromParentsAndOffsets","_createFromPositionAndShift","_createIn","_createOn","zs","_ranges","_lastRangeBackward","_isFake","_fakeSelectionLabel","isFake","fakeSelectionLabel","focus","rangeCount","isBackward","getRanges","getFirstRange","getLastRange","getLastPosition","getSelectedElement","_setRanges","_setFakeOptions","Vs","fake","backward","setFocus","_addRange","_pushRange","addedRange","intersectingRange","_selection","_setTo","_setFocus","Ns","startRange","_eventPhase","_currentTarget","eventPhase","currentTarget","Os","Ls","Us","Hs","js","qs","Ws","_postFixers","roots","getRoot","_callPostFixers","$s","_priority","_id","_clonesGroup","Ks","getElementsWithSameId","DEFAULT_PRIORITY","Gs","Zs","Js","Ys","Qs","ea","render","toDomElement","ta","oa","na","ia","_cloneGroups","_slotFactory","setSelection","setSelectionFocus","createDocumentFragment","createText","createAttributeElement","renderUnsafeAttributes","createContainerElement","createEditableElement","createEmptyElement","createUIElement","createRawElement","removeAttribute","setStyle","removeStyle","setCustomProperty","removeCustomProperty","breakAttributes","_breakAttributes","_breakAttributesRange","breakContainer","move","mergeAttributes","_removeFromClonedElementsGroup","ca","mergeContainers","ua","nodes","_insertNodes","ma","wrap","_wrapPosition","_wrapRange","unwrap","_unwrapChildren","rename","clearClonedElementsGroup","createPositionAt","createPositionAfter","createPositionBefore","createRange","createRangeOn","createRangeIn","createSelection","createSlot","_registerSlotFactory","_clearSlotFactory","ra","la","_addToClonedElementsGroup","_wrapChildren","_wrapAttributeElement","sa","_unwrapAttributeElement","aa","pa","ha","da","ga","fa","dataset","ckeFiller","innerText","ba","ka","wa","repeat","_a","ya","Aa","Ca","domTarget","getSelection","getRangeAt","collapsed","startOffset","collapse","xa","va","Ea","domDocuments","markedAttributes","markedChildren","markedTexts","_inlineFiller","_fakeSelectionContainer","domConverter","isSelecting","markToSync","mapViewToDom","_updateChildrenMappings","_isSelectionInInlineFiller","_removeInlineFiller","_getInlineFillerPosition","_needsInlineFillerAtSelection","domPositionToView","_updateAttrs","_updateChildren","inlineFillerPosition","_updateText","viewPositionToDom","Da","_updateFocus","_updateSelection","_clearTemporaryCustomProperties","viewChildrenToDom","withChildren","_diffNodeLists","_findUpdateActions","Ba","equal","_updateElementMappings","unbindDomElement","bindElements","findCorrespondingDomText","viewToDom","_updateTextNode","setDomElementAttribute","removeDomElementAttribute","normalize","Sa","_markDescendantTextToSync","domToView","Ta","_updateTextNodeInternal","insertData","deleteData","_removeDomSelection","_removeFakeSelection","_updateFakeSelection","isConnected","_updateDomSelection","className","textContent","bindFakeSelection","_fakeSelectionNeedsUpdate","parentElement","removeAllRanges","selectNodeContents","addRange","_domSelectionNeedsUpdate","setBaseAndExtent","ELEMENT_NODE","tagName","isDomSelectionCorrect","domSelectionToView","anchorNode","activeElement","mapDomToView","isBlockFiller","Ia","Pa","Fa","Ra","Ma","za","blockFillerMode","renderingMode","_domToViewMapping","_viewToDomMapping","_fakeSelectionMapping","_rawContentElementMatcher","_inlineObjectElementMatcher","_elementsWithTemporaryCustomProperties","preElements","blockElements","inlineObjectElements","unsafeElements","_domDocument","implementation","createHTMLDocument","fakeSelectionToView","bindDocumentFragments","shouldRenderAttribute","startsWith","setContentOf","DOMParser","parseFromString","createTreeWalker","NodeFilter","SHOW_ELEMENT","nextNode","getAttributeNames","_shouldRenameElement","Oa","replaceWith","_createReplacementDomElement","firstChild","append","_processDataFromViewText","createComment","HTMLTemplateElement","domElement","createAttribute","_getBlockFiller","viewElement","viewRangeToDom","setStart","setEnd","_domToView","_processDomInlineNodes","domChildrenToView","_isBlockViewElement","isDomSelectionBackward","domRangeToView","endContainer","endOffset","findCorrespondingViewText","getHostViewElement","isElement","Va","_clearDomSelection","isDocumentFragment","DOCUMENT_FRAGMENT_NODE","isEqualNode","Na","anchorOffset","focusNode","focusOffset","DOCUMENT_NODE","_isDomSelectionPositionCorrect","registerRawContentMatcher","registerInlineObjectMatcher","skipComments","_isInlineObjectElement","_createViewElement","_isViewElementWithRawContent","_isBlockDomElement","_isPreFormatted","_getTouchingInlineViewNode","_nodeEndsWithSpace","keepOriginalCase","La","_isEnabled","enable","disable","checkShouldIgnoreEventFromTarget","Ha","ja","qa","domEvent","Ua","domEventType","onDomEvent","stopObserving","Wa","keystroke","$a","Ga","Za","Ja","Ka","Ya","Qa","Xa","el","tl","NaN","ol","nl","il","leading","maxWait","trailing","flush","rl","_fireSelectionChangeDoneDebounced","_handleSelectionMove","oldSelection","newSelection","domSelection","ll","cl","dl","ul","hl","ml","pl","gl","fl","kl","_l","yl","Al","Cl","vl","bl","wl","xl","El","Dl","childList","characterData","subtree","_domElements","_mutationObserver","MutationObserver","_onMutations","takeRecords","disconnect","_isBogusBrMutation","node","Bl","mutations","removedNodes","addedNodes","Sl","_renderTimeoutId","_isFocusChanging","_handleFocus","_handleBlur","_clearTimeout","Tl","mutationObserver","getObserver","focusObserver","_documents","_clearInfiniteLoopInterval","setInterval","_clearInfiniteLoop","_documentIsSelectingInactivityTimeoutDebounced","_loopbackCounter","endDocumentIsSelecting","_handleSelectionChange","clearInterval","_reportInfiniteLoop","hasDomSelection","forceRender","Il","Pl","_files","cacheFiles","Fl","_native","files","getData","setData","effectAllowed","dropEffect","setDragImage","isCanceled","mozUserCancelled","items","kind","getAsFile","Rl","getTargetRanges","dataTransfer","inputType","targetRanges","Ml","zl","Vl","Nl","domRoots","_initialDomRootAttributes","_observers","_ongoingChange","_postFixersInProgress","_renderingDisabled","_hasChangedSinceTheLastRendering","_renderer","_writer","addObserver","Xs","extend","_render","relatedTarget","attachDomRoot","updateContenteditableAttribute","detachDomRoot","getDomRoot","disableObservers","enableObservers","scrollToTheSelection","isRenderingInProgress","_disableRendering","Ol","Ll","getChildStartOffset","_setAttributesTo","_clearAttributes","Hl","_nodes","maxOffset","getNode","getNodeIndex","getNodeStartOffset","indexToOffset","offsetToIndex","nodeList","_removeNodes","jl","fromJSON","ql","Ul","getNodeByPath","Wl","Gl","stickiness","_visitedParent","Kl","Zl","$l","Jl","getParentPath","getCommonPath","isTouching","Yl","Ql","hasSameParentAs","getTransformedByOperation","_getTransformedByInsertOperation","_getTransformedByMoveOperation","_getTransformedBySplitOperation","_getTransformedByMergeOperation","_getTransformedByInsertion","_getTransformedByMove","sourcePosition","targetPosition","movedRange","_getCombined","splitPosition","moveTargetPosition","graveyardPosition","insertionPosition","_getTransformedByDeletion","deletionPosition","graveyard","Xl","containsItem","getJoined","getMinimalFlatRanges","getTransformedByOperations","_createFromRanges","ec","_modelToViewMapping","_viewToModelMapping","_viewToModelLengthCallbacks","_markerNameToElements","_elementToMarkerNames","_deferredBindingRemovals","_unboundMarkerNames","viewPosition","modelPosition","findPositionIn","findMappedViewAncestor","_toModelOffset","unbindViewElement","toModelElement","defer","unbindModelElement","toViewElement","bindElementToMarker","unbindElementFromMarkerName","flushUnboundMarkerNames","flushDeferredBindings","clearBindings","toModelRange","toModelPosition","toViewRange","toViewPosition","mapper","isPhantom","markerNameToElements","registerViewToModelLength","getModelLength","_moveViewPositionToTextNode","tc","_consumable","_textProxyRegistry","oc","_getSymbolForTextProxy","consume","revert","verifyAllConsumed","event","description","_addSymbolForTextProxy","nc","_conversionApi","dispatcher","_firedEventsMap","convertChanges","_createConversionApi","getRefreshedItems","getMarkersToRemove","_convertMarkerRemove","range","_reduceChanges","getChanges","_convertInsert","_convertReinsert","_convertRemove","_convertAttribute","attributeKey","attributeOldValue","attributeNewValue","getRange","_convertMarkerAdd","getMarkersToAdd","consumable","convert","convertSelection","getMarkersAtPosition","_addConsumablesForSelection","ic","markerName","markerRange","doNotAddConsumables","_addConsumablesForInsert","rc","_testAndFire","_addConsumablesForRange","reconversion","changes","_testAndFireAddAttributes","writer","convertItem","convertChildren","convertAttributes","canReuseView","sc","_replaceAllRanges","directChange","_popRange","attributeKeys","getSelectedBlocks","cc","uc","lc","hc","containsEntireContent","_checkRange","_removeAllRanges","ac","schema","isBlock","dc","isLimit","mc","pc","toRange","fromRange","isDocumentOperation","gc","fc","bc","kc","hasOwnRange","isGravityOverridden","markers","updateMarkers","_updateAttributes","observeMarkers","_getStoredAttributes","getStoredAttributes","_overrideGravity","overrideGravity","_restoreGravity","restoreGravity","_getStoreAttributeKey","_isStoreAttributeKey","_attributePriority","_selectionRestorePosition","_hasChangedRange","_overriddenGravityRegister","_observedMarkers","_model","_document","_fixGraveyardSelection","_validateSelectionRanges","_updateMarker","differ","enqueueChange","_getDefaultRange","uid","_prepareRange","_validateSelectionRange","oldMarkers","_getSurroundingAttributes","wc","isObject","getNearestSelectionRange","isInline","checkAttribute","getAttributeProperties","copyFromObject","_c","_dispatchers","yc","elementToElement","Dc","Bc","vc","zc","preflight","Rc","Fc","converterPriority","Pc","elementToStructure","checkChild","elementName","modeOrFilter","flat","attributeToElement","Sc","Cc","attributeToAttribute","Tc","markerToElement","xc","isOpening","markerToHighlight","Ic","Ac","markerToData","group","Ec","reconvertedElements","Mc","Vc","getRoots","insertElement","Nc","createContext","Oc","Lc","Hc","elementToAttribute","Uc","Wc","jc","elementToMarker","dataToMarker","qc","$c","modelCursor","modelRange","viewItem","safeInsert","updateConversionResult","Kc","getLimitElement","isSelectable","Jc","Zc","Yc","downcastDispatcher","reconvertMarker","_refresh","reconvertItem","_refreshItem","Qc","ed","consumablesFromElement","createFrom","Xc","_canConsumeName","_test","_consume","_revert","td","_sourceDefinitions","_attributeProperties","_customChildChecks","_customAttributeChecks","_genericCheckSymbol","od","getDefinition","register","itemName","_clearCache","getDefinitions","_compiledDefinitions","_compile","isRegistered","isContent","_checkContextMatch","_evaluateAttributeChecks","allowAttributes","checkMerge","addChildCheck","addAttributeCheck","setAttributeProperties","checkAttributeInSelection","getValidRanges","_getValidRangesForRange","walker","findAllowedParent","setAllowedAttributes","removeDisallowedAttributes","gd","getAttributesWithProperty","nd","rd","sd","ad","ld","cd","dd","ud","hd","allowIn","allowChildren","_evaluateChildChecks","trimLast","findOptimalInsertionRange","pd","getItem","getNames","disallowIn","disallowChildren","allowContentOf","allowWhere","disallowAttributes","allowAttributesOf","inheritTypesFrom","md","inheritAllFrom","fd","_splitParts","_cursorParents","_modelCursor","_emptyElementsToKeep","conversionApi","store","_convertItem","_convertChildren","_safeInsert","_updateConversionResult","splitToAllowedParent","_splitToAllowedParent","getSplitParts","_getSplitParts","keepEmptyElement","_keepEmptyElement","_removeEmptyElements","_registerSplitPair","cursorParent","bd","getHtml","kd","domParser","htmlWriter","toData","toView","_toDom","useFillerType","wd","upcastDispatcher","viewDocument","htmlProcessor","processor","_viewWriter","isUndoable","_checkIfRootsExists","hasContent","ignoreWhitespaces","localeCompare","main","parse","batchType","removeSelectionAttribute","toModel","addStyleProcessorRules","_d","_helpers","_downcast","_createConversionHelpers","dispatchers","isDowncast","_upcast","addAlias","yd","upcastAlso","Ad","Cd","baseVersion","batch","_validate","__className","vd","Dd","Sd","Bd","xd","Ed","Td","Id","affectedSelectable","getMovedRangeStart","getReversed","_execute","Pd","shouldReceiveAttributes","Fd","Rd","getInsertionPosition","Md","oldRange","newRange","_markers","_set","zd","Vd","oldValue","newValue","Nd","Od","oldName","newName","Ld","Hd","isAdd","createRoot","_isAttached","jd","qd","Ud","Wd","$d","Gd","Kd","Zd","useRelations","forceWeakRemove","setOriginalOperations","originalOperations","operationsA","operationsB","nextBaseVersionA","nextBaseVersionB","originalOperationsACount","originalOperationsBCount","getContext","updateRelation","padWithNoOps","Yd","Jd","_history","history","_useRelations","_forceWeakRemove","_relations","_setRelation","side","wasInLeftElement","wasStartBeforeMergedElement","wasEndBeforeMergedElement","wasInRightElement","aIsStrong","aWasUndone","_wasUndone","bWasUndone","abRelation","_getRelation","baRelation","wasUndone","isUndoneOperation","getUndoneOperation","Qd","Xd","eu","tu","ou","toPosition","fromPosition","nu","iu","isLocal","isUndo","isTyping","operations","addOperation","ru","_changesInElement","_elementsSnapshots","_elementChildrenSnapshots","_elementState","_changedMarkers","_changedRoots","_changeCount","_cachedChanges","_cachedChangesWithGraveyard","_refreshedItems","_markerCollection","bufferOperation","_isInInsertedElement","_markInsert","_markAttribute","_markRemove","_setElementState","getMarkersIntersectingRange","bufferMarkerChange","_isLoaded","_bufferRootStateChange","_bufferRootAttributeChange","newMarkerData","oldMarkerData","getChangedMarkers","hasDataChanges","includeChangesInGraveyard","lu","cu","_getDiffActionForNode","_getInsertDiff","_getRemoveDiff","_getAttributesDiff","changeCount","du","getChangedRoots","state","reset","_bufferRootLoad","count","_markChange","_removeAllNestedChanges","_makeSnapshots","_getChangesForElement","_handleChange","_statesPriority","nodesToHandle","action","before","su","au","uu","_operations","_undoPairs","_undoneOperations","_baseVersionToOperationIndex","_version","_gaps","lastOperation","operation","historyVersion","getOperations","getOperation","setOperationAsUndone","isUndoingOperation","hu","mu","pu","_hasSelectionChangedFromTheLastChangeBlock","removeMarker","getRootNames","_handleChangeBlock","_hasDocumentChangedFromTheLastChangeBlock","_getDefaultRoot","createPositionFromPath","gu","fu","bu","_attachLiveRange","managedUsingOperations","_managedUsingOperations","_destroyMarker","getMarkersGroup","_detachLiveRange","_liveRange","getStart","getEnd","ku","wu","_u","cloneElement","_assertWriterUsedCorrectly","xu","applyOperation","usingOperation","updateMarker","addMarker","insertText","appendText","appendElement","yu","Au","clearAttributes","_addOperationForAffectedMarkers","vu","merge","_merge","_mergeDetached","Cu","addRoot","detachRoot","setSelectionAttribute","_setSelectionAttribute","_removeSelectionAttribute","overrideSelectionGravity","restoreSelectionGravity","_currentWriter","Eu","doNotResetEntireContent","Tu","doNotAutoparagraph","ignoreMarkers","modifySelection","leaveUnmerged","Su","Bu","Du","Iu","Pu","Fu","_firstNode","_lastNode","_lastAutoParagraph","_filterAttributesOf","_affectedStart","_affectedEnd","_nodeToSelect","canMergeWith","_documentFragment","_documentFragmentPosition","handleNodes","_handleNode","_insertPartialFragment","_updateLastNodeFromAutoParagraph","_mergeOnRight","_setAffectedBoundaries","getSelectionRange","getAffectedRange","_checkAndSplitToAllowedPosition","_appendToFragment","_handleDisallowedNode","_mergeOnLeft","_canMergeLeft","_canMergeRight","_insertAutoParagraph","_getAllowedIn","Mu","zu","isForward","unit","treatEmojiAsSingleUnit","Ou","Nu","Vu","Lu","_pendingChanges","Gc","deleteContent","Ru","findOptimalPosition","insertContent","_runPendingChanges","Hu","insertObject","getSelectedContent","createBatch","createOperationFromJSON","ju","qu","Uu","insertChild","removeChildren","unwrapElement","Wu","$u","Gu","Ku","Zu","Ju","Yu","Qu","Xu","eh","th","oh","nh","ih","rh","sh","ah","lh","ch","dh","uh","hh","gh","mh","ph","fh","attachment","color","image","bh","vh","kh","wh","yh","Ah","xh","Ch","Eh","_h","border","Dh","Bh","crashes","_now","_crashNumberLimit","crashNumberLimit","_minimumNonErrorTimePeriod","minimumNonErrorTimePeriod","_boundErrorHandler","error","reason","_handleError","_listeners","_restart","_stopErrorHandling","_fire","_startErrorHandling","_shouldReactToError","filename","ErrorEvent","lineno","colno","date","_shouldRestart","causesRestart","_isErrorComingFromThisItem","Sh","Th","_watchdogExcluded","EventTarget","Event","Ih","Ph","Fh","_editor","_lifecyclePromise","_initUsingData","_editables","_throttledSave","_save","saveInterval","_creator","_destructor","_item","setCreator","setDestructor","_destroy","catch","rootsAttributes","isLoaded","extraPlugins","lazyRoots","_watchdogInitialData","initialData","Rh","_elementOrData","_cloneEditorConfiguration","_lastDocumentVersion","_getData","_getEditables","finally","_setExcludedProperties","_excludedProps","commentThreads","suggestions","rangeJSON","getCommentThreads","skipNotAttached","getSuggestions","getEditableElement","_restoreCollaborationData","_restoreEditorData","_createNode","hasCommentThread","threadId","getCommentThread","addCommentThread","channelId","hasSuggestion","getSuggestion","addSuggestionData","Mh","zh","_onEmptyCallbacks","_queues","_activeActions","onEmpty","enqueue","Vh","Nh","_commands","commandName","commands","Oh","Lh","Hh","jh","keystrokeInfos","addKeystrokeInfoCategory","mayRequireFn","groups","keystrokes","addKeystrokeInfoGroup","categoryId","groupId","addKeystrokeInfos","qh","_readOnlyLocks","editing","accessibility","enableReadOnlyMode","lockId","disableReadOnlyMode","Context","EditorWatchdog","ContextWatchdog","_watchdogs","_contextProps","_actionQueues","_watchdogConfig","_contextConfig","_create","_getWatchdog","getItemState","creator","destructor","itemId","rethrowRestartEventOnce","sourceElementOrData","Uh","Wh","updateSourceElement","sourceElement","$h","_actions","hasAny","Gh","Kh","_renderViewIntoCollectionParent","_parentElement","setParent","isRendered","Zh","rm","im","_isRendered","_revertData","_renderNode","intoFragment","bindings","isApplying","revertData","_revertTemplateFromNode","getViews","um","hm","Yh","eventNameOrFunction","attribute","if","Qh","valueIfTrue","cm","tag","_renderText","_renderElement","_renderAttributes","_renderElementChildren","_setUpListeners","Xh","_bindToObservable","tm","pm","gm","om","_renderStyleAttribute","am","dm","setAttributeNS","nm","mm","eventListeners","activateDomEventListener","em","activateAttributeListener","Jh","getValue","removeAttributeNS","sm","lm","km","bm","fm","_viewCollections","_unboundChildren","createCollection","bindTemplate","_bindTemplate","registerChild","deregisterChild","setTemplate","template","extendTemplate","wm","activator","contextElements","composedPath","_m","disableCssTransitions","_isCssTransitionsDisabled","enableCssTransitions","initializeCssTransitionDisablerMixin","ym","Am","keystrokeHandler","focusTracker","gridItems","numberOfColumns","vm","Cm","xm","viewBox","_updateXMLContent","_colorFillPaths","presentationalAttributeNames","fillColor","querySelectorAll","Em","Dm","Sm","Bm","Tm","_focusDelayed","labelView","_setupLabelView","iconView","keystrokeView","_createKeystrokeView","_getTooltipString","role","tabindex","click","Im","mousedown","mouseup","icon","withKeystroke","Fm","Pm","Rm","Mm","focusables","actions","keystrokeHandlerOptions","focusFirst","focusLast","zm","_getDomFocusableItem","previous","current","focusNext","focusPrevious","chain","getCurrentFocusedView","unchain","Vm","Lm","Om","Hm","_focusTracker","_focusables","focusCycler","setButtons","onExecute","onCreate","_updateFocusCyclableItems","jm","Um","qm","Wm","$m","Qm","Xm","Nm","_onDragBound","_onDrag","_onDragEndBound","_onDragEnd","_lastDraggingCoordinates","_attachListeners","_onDragStart","_attachDragListeners","_detachDragListeners","_isHandleElementPressed","MouseEvent","clientX","clientY","touches","isDragging","deltaX","deltaY","dragHandleElement","getCurrentDomRoot","getViewportOffset","wasMoved","_getCurrentDomRoot","_getViewportOffset","parts","_focusCycler","visibility","_isVisible","updatePosition","_isTransparent","headerView","setupParts","title","hasCloseButton","actionButtons","closeButtonView","_createCloseButton","ariaLabel","contentView","actionsView","_getViewportRect","_getDialogRect","_moveTo","_left","_top","_moveOffScreen","_getVisibleDomRootRect","defaultOffset","firstElementChild","tooltip","ep","tp","_initShowHideListeners","_initFocusToggler","_initMultiRootIntegration","isOpen","_show","onShow","_visibleDialogPlugin","_hide","_onHide","isModal","show","hide","onHide","np","op","ip","_checkIconHolderView","rp","hasCheckSpace","_hasCheck","isToggleable","_watchCheckIconHolderMount","_checkIconView","_createCheckIconView","isOn","_watchCheckIconMount","ap","sp","lp","withText","dp","cp","up","hp","_createCategories","_createGroup","_createGroupRow","mp","pp","fp","gp","bp","componentFactory","_createButton","_toggleDialog","_setupRootLabels","kp","bodyCollectionContainer","_bodyCollectionContainer","attachToDom","dir","detachFromDom","childElementCount","_p","wp","yp","toggleSwitchView","_createToggleView","Ap","vp","Cp","buttonView","_fileInputView","xp","open","accept","multiple","Ep","Bp","Dp","Sp","_createButtonView","hidden","_collapsibleAriaLabelUid","Tp","Black","Grey","White","Red","Orange","Yellow","Green","Aquamarine","Turquoise","Blue","Purple","Ip","Pp","hasBorder","Fp","backgroundColor","Mp","Rp","zp","colorDefinitions","columns","gridTemplateColumns","selectedColor","Np","Vp","parseFloat","Op","isNaN","R","hue","saturation","lightness","brightness","alpha","opacity","jp","qp","Hp","hexValue","Wp","Up","$p","fieldView","_createLabelView","statusView","_createStatusView","fieldWrapperChildren","Gp","readonly","_updateIsEmpty","_setDomElementValue","select","Zp","Kp","Jp","inputmode","Yp","Qp","step","eg","Xp","tg","selectstart","toLocaleLowerCase","childView","dropdownPanel","ng","og","ig","panelView","panelPosition","_getOptimalPosition","_panelPositions","closeDropdown","south","north","southEast","southWest","northEast","northWest","southMiddleEast","southMiddleWest","northMiddleEast","northMiddleWest","defaultPanelPositions","rg","sg","arrowView","_createArrowView","ag","lg","ug","dg","hg","alignLeft","bold","importExport","paragraph","plus","threeVerticalDots","pilcrow","dragIndicator","mg","itemsView","pg","shouldGroupWhenFull","isFloating","maxWidth","_behavior","fg","gg","fillFromConfig","_buildItemsFromConfig","cg","removeItems","_cleanItemsConfiguration","_createNestedToolbarDropdown","_cleanSeparatorsAndLineBreaks","findIndex","Tg","Ig","toolbarView","resizeObserver","cachedPadding","shouldUpdateGroupingOnNextResize","viewChildren","viewFocusables","viewItemsView","viewFocusTracker","viewLocale","ungroupedItems","groupedItems","groupedItemsDropdown","_createGroupedItemsDropdown","_updateGrouping","_enableGroupingOnResize","_enableGroupingOnMaxWidthChange","_areItemsOverflowing","_groupLastItem","_ungroupFirstItem","lastChild","contentRect","tooltipPosition","bg","kg","wg","Ag","isVisible","ariaLabelledBy","yg","_g","_listItemGroupToChangeListeners","_registerFocusableItemsGroup","_registerFocusableListItem","_deregisterFocusableItemsGroup","_deregisterFocusableListItem","_getOnGroupItemsChangeCallback","vg","Cg","xg","actionView","_createActionView","Dg","Eg","Sg","Pg","enableActiveItemFocusOnDropdownOpen","Mg","isCompact","isVertical","Fg","Rg","listView","zg","Bg","Vg","createLabeledInputText","ariaDescribedById","errorText","Ng","createLabeledInputNumber","inputMode","Og","createLabeledDropdown","Lg","clamp","Hg","jg","Ug","hsvaToHsla","qg","$g","Zg","equalColorObjects","Jg","Yg","Qg","dispatchEvent","CustomEvent","bubbles","detail","Xg","ef","tf","pointerMove","getMove","pageX","pageXOffset","pageY","pageYOffset","of","cloneNode","xy","dragging","handleEvent","button","setProperty","nf","rf","hsva","sf","af","lf","cf","df","uf","hf","mf","observedAttributes","colorModel","toHsva","attachShadow","mode","connectedCallback","defaultColor","attributeChangedCallback","fromAttr","fromHsva","pf","rgbaToHsva","Kg","rgbaToHex","Gg","hsvaToRgba","Wg","gf","bf","ff","kf","_hexColor","hexInputRow","_createInputRow","hideInput","_debounceColorPickerEvent","format","wf","picker","customElements","_createSlidersView","shadowRoot","slidersView","_f","_createColorInput","Af","Cf","isValid","resetValidationStatus","getParsedColor","inputView","yf","vf","hasColor","xf","colors","removeButtonLabel","documentColorsLabel","documentColorsCount","colorPickerLabel","documentColors","_removeButtonLabel","_colorPickerLabel","_documentColorsLabel","removeColorButtonView","_createRemoveColorButton","updateDocumentColors","_addColorToDocumentColors","updateSelectedColors","documentColorsGrid","staticColorsGrid","_createStaticColorsGrid","_createDocumentColorsGrid","_createColorPickerButton","_addColorSelectorElementsToFocusTracker","addColorPickerButton","colorPickerButtonView","Ef","colorPickerViewConfig","_colorPickerViewConfig","saveButtonView","cancelButtonView","_createActionButtons","actionBarView","_createActionBarView","colorPickerView","_addColorPickersElementsToFocusTracker","_stopPropagationOnArrowsKeys","_executeOnEnterPress","_executeUponColorChange","Bf","Df","Sf","colorGridsFragmentView","colorPickerFragmentView","appendUI","_appendColorGridsFragment","_appendColorPickerFragment","showColorPickerFragment","_isColorPickerFragmentVisible","_isColorGridsFragmentVisible","showColorGridsFragment","Tf","_components","originalName","If","Ff","Pf","Rf","Mf","withArrow","zf","_pinWhenIsVisibleCallback","_resizeObserver","attachTo","Nf","defaultPositions","southArrowNorth","southArrowNorthMiddleWest","southArrowNorthMiddleEast","southArrowNorthWest","southArrowNorthEast","northArrowSouth","northArrowSouthMiddleWest","northArrowSouthMiddleEast","northArrowSouthWest","northArrowSouthEast","viewportStickyNorth","pin","unpin","_startPinning","_stopPinning","checkVisibility","generatePositions","sideOffset","arrowSideOffset","heightOffset","arrowHeightOffset","stickyVerticalOffset","northWestArrowSouthWest","northWestArrowSouthMiddleWest","northWestArrowSouth","northWestArrowSouthMiddleEast","northWestArrowSouthEast","northEastArrowSouthWest","northEastArrowSouthMiddleWest","northEastArrowSouth","northEastArrowSouthMiddleEast","northEastArrowSouthEast","southWestArrowNorthWest","southWestArrowNorthMiddleWest","southWestArrowNorth","southWestArrowNorthMiddleEast","southWestArrowNorthEast","southEastArrowNorthWest","southEastArrowNorthMiddleWest","southEastArrowNorth","southEastArrowNorthMiddleEast","southEastArrowNorthEast","westArrowEast","eastArrowWest","Vf","Lf","Of","Hf","jf","_currentElementWithTooltip","_currentTooltipPosition","_editors","_instance","tooltipTextView","balloonPanelView","attributeFilter","_updateTooltipPosition","_pinTooltipDebounced","_pinTooltip","_unpinTooltipDebounced","_unpinTooltip","_onKeyDown","_onEnterOrFocus","_onLeaveOrBlur","_onScroll","getPositioningFunctions","defaultBalloonPositions","sw","Uf","Wf","cssClass","qf","closest","ckeTooltipText","ckeTooltipPosition","ckeTooltipClass","Zf","_balloonView","_lastFocusedEditableElement","_showBalloonThrottled","_showBalloon","_handleEditorReady","atob","_updateLastFocusedEditableElement","_hideBalloon","_createBalloonView","Qf","Jf","Yf","horizontalOffset","getEditableElementsNames","isColorInherited","dragstart","verticalOffset","eb","Xf","tb","POLITE","ASSERTIVE","ob","announce","nb","politeness","isUnsafeHTML","regionViews","ib","announcement","_pruneAnnouncementsInterval","_domConverter","_listElement","sb","rb","ab","mouseenter","lb","toggleMenusAndFocusItemsOnHover","isFocusBorderEnabled","menus","focusCycleMenusOnArrows","closeMenusWhenTheBarCloses","closeMenuWhenAnotherOnTheSameLevelOpens","parentMenuView","closeOnClickOutside","close","enableFocusHighlightOnInteraction","cb","openAndFocusPanelOnArrowDownKey","openOnArrowRightKey","openOnButtonClick","toggleOnButtonClick","closeOnArrowLeftKey","closeOnEscKey","closeOnParentClose","db","eastSouth","eastNorth","westSouth","westNorth","ub","menuId","hb","normalizedConfig","extraItems","mb","bb","yb","menuBarConfig","addItems","isUsingDefaultConfig","parentMenuConfig","componentName","gb","File","Edit","View","Insert","Format","Tools","Help","Text","Font","wb","_b","menu","pb","kb","addedItemConfig","fb","Ab","emptyMenuConfig","Cb","isReady","_editableElementsMap","_focusableToolbarDefinitions","_extraMenuBarElements","_lastFocusedForeignElement","tooltipManager","poweredBy","ariaLiveAnnouncer","_readViewportOffsetFromConfig","_handleScrollToTheSelection","_initFocusTracking","ckeditorInstance","setEditableElement","setUpKeystrokeHandler","removeEditableElement","addToolbar","extendMenuBar","_editableElements","editorUI","_initMenuBar","_saveLastFocusedForeignElement","_getCurrentFocusedToolbarDefinition","_getFocusableCandidateToolbarDefinitions","_focusFocusableCandidateToolbar","afterBlur","beforeFocus","vb","isContextual","Eb","xb","Db","Bb","lang","_editableElement","_hasExternalElement","_editingView","_updateIsFocusedClasses","hasExternalElement","Sb","_generateLabel","Tb","alert","showSuccess","_showNotification","namespace","showInfo","showWarning","Ib","Fb","Pb","Mb","Rb","zb","Vb","_viewToStack","_idToStack","_view","_rotatorView","_fakePanelsView","positionLimiter","_createPanelView","hasView","stackId","_numberOfStacks","_visibleStack","singleViewMode","showStack","_showView","_singleViewMode","visibleView","_showNextStack","hideView","_getStackId","_getBalloonPosition","visibleStack","_createRotatorView","_createFakePanelsView","_showPrevStack","Nb","buttonNextView","buttonPrevView","Ob","balloonClassName","showView","_balloonPanelView","_addPanels","_removePanels","numberOfPanels","Hb","Lb","jb","showResetButton","showIcon","_viewConfig","resetButtonView","qb","primaryText","secondaryText","Ub","Wb","$b","Zb","Kb","Jb","filteredView","queryView","_createSearchTextQueryView","resultsView","focusableChildren","infoView","instance","_enableDefaultInfoViewBehavior","resultsCount","totalItemsCount","Gb","query","notFound","primary","secondary","noSearchableItems","Qb","Yb","Xb","_updateResultsVisibility","resetOnBlur","_updateResultsViewWidthAndPosition","_width","defaultResultsPositions","queryMinChars","nk","ok","rk","ik","ak","sk","ck","lk","dk","hk","uk","mk","gk","pk","fk","_repositionPanelOnOpen","_attachBehaviors","_propagateArrowKeystrokeEvents","bk","kk","_setItemsCheckSpace","wk","_k","Ak","yk","Ck","vk","_setupIsOpenUpdater","_createMenu","menuDefinition","registerMenu","_createMenuItems","_createMenuItemContentFromFactory","_registerMenuTree","componentView","xk","editable","_initPlaceholder","_initToolbar","menuBarView","toolbar","Ek","shouldToolbarGroupWhenFull","Dk","Bk","Sk","_stack","_insertDescriptor","Tk","oldDescriptor","newDescriptor","_removeDescriptor","Ik","Pk","Fk","Rk","Ok","Mk","zk","Vk","Nk","Lk","$k","hasSelectionHandle","qk","Hk","jk","Uk","Wk","Gk","paddingLeft","paddingRight","Kk","buttonName","createTocViewElement","createTocDataElement","I18n","Zk","Jk","Yk","_","Qk","Xk","services","ew","tw","ow","macro_text","opEmbeddedTableQuery","createEmbeddedTableView","createEmbeddedTableDataElement","runInZone","externalQueryConfiguration","currentQuery","nw","_batch","_size","limit","_isLocked","_changeCallback","_reset","_selectionChangeCallback","isLocked","lock","unlock","iw","_buffer","resultRange","rw","aw","lw","_compositionQueue","cw","dw","uw","isComposedElement","flushComposedElements","flushDebounced","_queue","_compositionElements","selectionRanges","hw","sequence","_shouldEntireContentBeReplacedWithParagraph","_replaceEntireContentWithParagraph","_shouldReplaceFirstBlockWithParagraph","mw","pw","gw","fw","bw","deleteContentBackward","deleteWordBackward","deleteHardLineBackward","deleteSoftLineBackward","deleteContentForward","deleteWordForward","deleteHardLineForward","deleteSoftLineForward","kw","selectionToRemove","ww","_undoOnBackspace","requestUndoOnBackspace","_w","yw","Aw","testCallback","_hasMatch","_startListening","hasMatch","_evaluateTextBeforeSelection","Cw","_isNextGravityRestorationSkipped","_overrideUid","_handleForwardMovement","_handleBackwardMovement","_isGravityOverridden","Sw","_enableClickingAfterNode","_enableInsertContentSelectionAttributesFixer","_handleDeleteContentAfterNode","registerAttribute","vw","Dw","Ew","xw","Bw","Tw","Iw","Pw","Fw","Rw","copyOnEnter","Mw","enterBlock","zw","Vw","insertParagraph","isSoft","insertLineBreak","Nw","Ow","Lw","Hw","jw","qw","Ww","Uw","$w","Gw","Kw","Zw","_currentFakeCaretModelElement","_enableTypeAroundUIInjection","_enableInsertingParagraphsOnButtonClick","_enableInsertingParagraphsOnEnterKeypress","_enableInsertingParagraphsOnTypingKeystroke","_enableTypeAroundFakeCaretActivationUsingKeyboardArrows","_enableDeleteIntegration","_enableInsertContentIntegration","_enableInsertObjectIntegration","_enableDeleteContentIntegration","_insertParagraph","_listenToIfEnabled","_insertParagraphAccordingToFakeCaretPosition","importNode","_handleArrowKeyPress","_handleArrowKeyPressOnSelectedWidget","_handleArrowKeyPressWhenSelectionNextToAWidget","_handleArrowKeyPressWhenNonCollapsedSelection","_getObjectElementNextToSelection","_setSelectionOverElement","classList","Yw","Qw","e_","Xw","t_","_previouslySelected","_clearPreviouslySelectedWidgets","o_","_onMousedown","_handleSelectionChangeOnArrowKeyPress","_preventDefaultOnArrowKeyPress","Jw","_handleDelete","_selectFirstNestedEditable","_selectAncestorWidget","_selectBlockContent","n_","_toolbarDefinitions","_balloon","_updateToolbarsVisibility","getRelatedElement","toolbarId","itemsConfig","initialized","_showToolbar","_hideToolbar","_isToolbarVisible","_isToolbarInBalloon","i_","r_","s_","_referenceCoordinates","originalWidth","_originalWidth","originalHeight","_originalHeight","originalWidthPercents","_originalWidthPercents","aspectRatio","_aspectRatio","begin","activeHandlePosition","a_","proposedWidth","proposedHeight","proposedWidthPercents","widthPercents","proposedHandleHostWidth","handleHostWidth","proposedHandleHostHeight","handleHostHeight","l_","display","_bindToState","_dismiss","c_","_viewResizerWrapper","_cleanup","_state","_appendHandles","_appendSizeUI","redraw","_sizeView","_initialViewWidth","_getHandleHost","_getResizeHost","updateSize","_proposeNewSize","commit","onCommit","_domResizerWrapper","isSameNode","offsetLeft","offsetTop","containsHandle","isResizeHandle","isCentered","abs","getResizeHost","getHandleHost","u_","d_","h_","_resizers","_observer","_mouseDownListener","_mouseMoveListener","_mouseUpListener","_redrawSelectedResizerThrottled","redrawSelectedResizer","getResizerByViewElement","deselect","selectedResizer","isSelected","_getResizerByHandle","_activeResizer","m_","g_","f_","b_","afterInit","k_","w_","__","createMacroViewElement","macros","configureWorkPackageButton","macroLabel","typename","y_","A_","FileReader","_reader","onprogress","loaded","read","total","onload","result","onerror","onabort","readAsDataURL","abort","C_","loaders","_loadersMap","_pendingAction","_updatePendingAction","getLoader","createLoader","createUploadAdapter","v_","file","uploaded","uploadTotal","destroyLoader","uploadedPercent","_filePromiseWrapper","_createFilePromiseWrapper","_adapter","promise","status","upload","uploadResponse","isFulfilled","rejecter","x_","loader","resource","attachFiles","toPromise","buildResponse","reject","_links","staticDownloadLocation","E_","dropRange","method","clipboardData","caretRangeFromPoint","rangeParent","rangeOffset","D_","B_","S_","T_","I_","F_","M_","z_","R_","P_","V_","O_","N_","q_","H_","j_","U_","L_","$_","_markersToCopy","_registerMarkerToCopy","_copySelectedFragmentWithMarkers","_insertFakeMarkersIntoSelection","_removeFakeMarkersInsideElement","_pasteMarkersIntoTransformedElement","_getPasteMarkersFromRangeMap","_insertFakeMarkersElements","_pasteFragmentWithMarkers","_forceMarkersCopy","allowedActions","copyPartiallySelected","duplicateOnPaste","_isMarkerCopyable","_getMarkerClipboardConfig","_hasMarkerConfiguration","_getCopyableMarkersFromSelection","flatMap","_getUniqueMarkerName","marker","_getAllFakeMarkersFromElement","markerElement","W_","G_","_setupPasteDrop","_setupCopyCut","_fireOutputTransformationEvent","onCopyCut","K_","Z_","J_","removeDropMarkerDelayed","removeDropMarker","_updateDropMarkerThrottled","_updateDropMarker","_reconvertMarkerThrottled","_dropTargetLineView","_domEmitter","_scrollables","_setupDropMarker","updateDropMarker","Y_","getFinalDropRange","_createDropTargetPosition","_updateDropTargetLine","_getScrollableRect","overflowY","ty","X_","Q_","ey","float","oy","_isBlockDragging","_handleBlockDragStart","_handleBlockDragging","_handleBlockDragEnd","elementFromPoint","iy","ny","ry","_clearDraggableAttributesDelayed","_clearDraggableAttributes","_blockMode","_draggedRange","_draggingUid","_draggableElement","_setupDragging","_setupContentInsertionIntegration","_setupClipboardInputIntegration","_setupDraggableAttributeHandling","_finalizeDragging","_previewContainer","_prepareDraggedRange","_updatePreview","sy","ay","ly","cy","isFormatting","dy","uy","_createdBatches","clearStack","createdBatches","addBatch","ranges","_restoreSelection","my","hy","_undo","py","gy","fy","_batchRegistry","_undoCommand","_redoCommand","by","_addButtonsToFactory","ky","wy","_y","isInlineImageView","isBlockImageView","yy","Ay","Cy","vy","isImage","isInlineImage","isBlockImage","insertImage","Ey","setImageSizes","setImageNaturalSizeAttributes","Image","naturalWidth","naturalHeight","src","getClosestSelectedImageWidget","isImageWidget","getClosestSelectedImageElement","getImageWidgetFromImageView","isImageAllowed","toImageWidget","findViewImgElement","Dy","By","Ty","Sy","Py","Iy","Fy","labeledInput","_createLabeledInputView","Ry","My","_form","_showForm","_createForm","_hideForm","_isInBalloon","zy","Vy","converter","Ny","Oy","_fireEvents","Ly","Hy","cleanupImage","jy","qy","_registerSchema","_registerConverters","Uy","_modelElementName","uploadId","oldElement","newElement","$y","Wy","Gy","_setupSchema","_setupConversion","_setupLoadListener","Ky","_setupClipboardIntegration","Jy","Zy","Yy","Qy","_integrations","isImageSelected","_createToolbarComponent","_createMenuBarComponent","registerIntegration","buttonViewCreator","formViewCreator","menuBarButtonViewCreator","requiresForm","_prepareIntegrations","dropdownView","eA","Xy","tA","oA","getCaptionFromImageModelElement","getCaptionFromModelSelection","matchImageCaptionViewElement","nA","focusCaptionOnShow","_hideImageCaption","_showImageCaption","_getSavedCaption","_saveCaption","iA","_savedCaptionsMap","_setupImageTypeCommandsIntegration","_registerCaptionReconversion","rA","aA","lA","cA","fetch","blob","dA","drawImage","toBlob","sA","uA","_createToolbarButton","_createMenuBarButton","_createDropdownButton","acceptedType","allowMultipleFiles","mA","hA","gA","pA","bA","fA","kA","uploadStatusChange","wA","_A","yA","CA","AA","vA","_uploadImage","xA","_uploadImageElements","isAccessAllowed","imageElement","EA","_readAndUpload","urls","_parseAndSetSrcsetAttributeOnImage","_ckHack","srcset","DA","BA","SA","TA","IA","PA","resizeUnit","resizeOptions","FA","small","medium","large","custom","original","RA","_resizeUnit","_registerImageResizeButton","_registerImageResizeDropdown","_getOptionLabelValue","MA","zA","commandValue","_getResizeDropdownListItemDefinitions","onClick","valueWithUnits","VA","NA","OA","_setupResizerCreator","modelElement","LA","HA","jA","dom","UA","qA","WA","_validators","resetFormStatus","rawSize","parsedSize","sizeWithUnits","$A","toFixed","minWidth","lower","upper","KA","GA","ZA","_defaultStyles","imageBlock","imageInline","isDefault","modelElements","shouldConvertImageType","JA","inline","alignBlockLeft","alignCenter","alignRight","alignBlockRight","block","YA","full","center","inlineLeft","inlineRight","QA","defaultItem","XA","eC","normalizeStyles","configuredStyles","isBlockPluginLoaded","isInlinePluginLoaded","missingPlugins","getDefaultStylesConfiguration","getDefaultDropdownDefinitions","warnInvalidStyle","DEFAULT_OPTIONS","DEFAULT_ICONS","DEFAULT_DROPDOWN_DEFINITIONS","tC","oC","normalizedStyles","_setupPostFixer","iC","nC","rC","localizedDefaultStylesTitles","sC","_createDropdown","aC","dropdown","lC","_executeCommand","cC","dC","uC","hC","page","includeParent","modelAttributeToView","setPlaceholderContent","pageLabel","includeParentText","mC","configureChildPages","pC","gC","fC","bC","kC","wC","_C","yC","CC","url","_initRequest","_initListeners","_sendRequest","xhr","XMLHttpRequest","responseType","response","lengthComputable","FormData","AC","cookie","decodeURIComponent","crypto","getRandomValues","send","vC","xC","EC","DC","BC","_getValueFromFirstAllowedNode","forceValue","SC","TC","IC","PC","FC","RC","MC","VC","zC","NC","OC","LC","HC","jC","qC","UC","WC","$C","GC","KC","_getValue","_checkEnabled","ZC","YC","_applyQuote","_removeQuote","JC","QC","ev","XC","tv","ov","nv","iv","_findPositionToInsertParagraph","rv","paragraphLikeElements","sv","av","lv","cv","dv","_addDefaultH1Conversion","hv","uv","mv","Paragraph","pv","_definitions","getDispatcher","getDispatcherForLinkedImage","fv","bv","wv","_v","yv","Av","Cv","vv","xv","Ev","Dv","Bv","Sv","Tv","Pv","Iv","kv","Fv","gv","Rv","Mv","zv","Vv","Nv","Ov","Lv","Hv","jv","qv","Uv","Wv","manualDecorators","automaticDecorators","restoreManualDecoratorStates","_getDecoratorStateFromModel","$v","_updateLinkContent","_isRangeToUpdate","linkHref","Gv","Kv","defaultValue","_createPattern","Jv","Zv","Yv","Qv","Xv","allowCreatingEmptyLinks","addTargetToExternalLinks","Downloadable","_enableAutomaticDecorators","_enableManualDecorators","_enableLinkOpen","_enableSelectionAttributesFixer","_enableClipboardIntegration","rel","tx","ex","ox","urlInputView","_createUrlInput","_manualDecoratorSwitches","_createManualDecoratorSwitches","_createFormChildren","getDecoratorSwitchesState","ix","nx","rx","previewButtonView","_createPreviewButton","unlinkButtonView","editButtonView","_linkConfig","allowedProtocols","sx","ax","formView","_createToolbarLinkButton","_enableBalloonActivators","_createViews","_createActionsView","_createFormView","_enableUserBalloonInteractions","_addFormView","_hideUI","_closeFormView","_showUI","_getSelectedLinkElement","_areActionsVisible","_isUIVisible","_isUIInPanel","_addActionsView","_areActionsInPanel","_getBalloonPositionData","_isFormInPanel","_removeFormView","_hideFakeVisualSelection","_showFakeVisualSelection","_startUpdatingUI","lx","cx","dx","_enableTypingHandling","_enableEnterHandling","_enableShiftEnterHandling","_enablePasteLinking","_expandLinkRange","_selectEntireLinks","ux","_applyAutoLink","_checkAndApplyAutoLinkOnRange","_persistAutoLink","mx","hx","px","_startElement","_referenceIndent","_isForward","_includeSelf","_sameAttributes","sameAttributes","_sameIndent","sameIndent","_lowerIndent","lowerIndent","_higherIndent","higherIndent","gx","_getStartNode","kx","previousNodeInList","fx","_listHead","bx","wx","_x","yx","Ax","Cx","vx","withNested","Ix","Ex","Dx","Bx","expand","indentBy","Sx","Tx","Px","Fx","Mx","zx","_direction","Vx","_fireAfterExecute","Nx","_listWalkerOptions","multiLevel","additionalAttributes","listType","listIndent","listItemId","Ox","shouldMergeOnBlocksContentLevel","firstElement","lastElement","_getMergeSubjectElements","Lx","_getStartBlock","Hx","expandListBlocksToCompleteList","xx","isFirstBlockOfListItem","isListItemBlock","expandListBlocksToCompleteItems","isNumberedListType","Rx","jx","qx","Ux","Gx","$x","Wx","Kx","Jx","dataPipeline","Qx","scope","canInjectMarkerIntoElement","createWrapperElement","canWrapElement","attributeName","setAttributeOnDowncast","Yx","Xx","tE","eE","nE","oE","iE","rE","_downcastStrategies","conflictPlugin","copyOnReplace","_setupDeleteIntegration","_setupEnterIntegration","_setupTabIntegration","_setupAccessibilityIntegration","registerChildCommand","_setupModelPostFixing","registerDowncastStrategy","getListAttributeNames","sE","Zx","modelAttributes","listNodes","listHead","seenIds","aE","lE","cE","uE","hE","mE","pE","listStyle","typeAttribute","fE","gE","kE","bE","wE","_getSelectedItems","_E","yE","AE","CE","vE","checked","disabled","contenteditable","_handleCheckmarkChange","xE","_initAriaAnnouncements","EE","DE","SE","BE","IE","PE","FE","ME","zE","VE","NE","RE","editCodeBlock","languageClass","OE","LE","__currentlyDisabled","HE","jQuery","each","jE","qE","modelAttribute","styleName","reduceBoxSides","shouldUpcast","GE","UE","WE","$E","KE","ZE","JE","column","getCellLocation","YE","QE","eD","tD","oD","_jumpedToStartRow","_table","_startRow","row","startRow","_endRow","endRow","_startColumn","startColumn","_endColumn","endColumn","_includeAllSlots","includeAllSlots","_skipRows","_row","_rowIndex","_column","_cellIndex","_spannedCells","_nextCellAtColumn","_canJumpToStartRow","_jumpToNonSpannedRowClosestToStartRow","_isOverEndRow","_isOverEndColumn","_advanceToNextRow","_getSpanned","_shouldSkipSlot","_formatOutValue","cell","_recordSpans","skipRow","nD","_markSpannedCell","_getRowLength","cellAnchorRow","cellAnchorColumn","isAnchor","cellWidth","cellHeight","rowIndex","getPositionBefore","iD","getRows","positionOffset","additionalSlots","asWidget","rD","sD","aD","lD","headingRows","headingColumns","createTable","cD","order","getSelectionAffectedTableCells","getRowIndexes","insertRows","copyStructureFromAbove","dD","getColumnIndexes","insertColumns","uD","splitCellHorizontally","splitCellVertically","hD","bD","mD","pD","rowspan","colspan","gD","fD","kD","getColumns","removeColumns","wD","removeRows","_D","yD","firstColumn","lastColumn","lastRow","AD","firstRow","CD","isHorizontal","_getMergeableCell","getTableCellsContainingSelection","vD","xD","rows","ED","DD","_isInHeading","BD","TD","SD","ID","PD","FD","table","cellsToMove","cellsToTrim","newCellsSpan","updatedSpan","RD","createTableWalker","getSelectedTableCells","sortRanges","_getFirstLastIndexesObject","isSelectionRectangular","_areCellInTheSameTableSection","MD","_areIndexesInSameSection","zD","mergeWidth","mergeHeight","OD","VD","ND","LD","HD","qD","UD","WD","GD","KD","ZD","JD","YD","XD","QD","eB","_additionalSlots","XE","tB","jD","$D","registerAdditionalSlot","nB","oB","iB","_createGridCollection","_highlightGridBoxes","_createGridButton","rB","bindIsOn","_prepareDropdown","_prepareMergeSplitButtonDropdown","_fillDropdownWithListOptions","sB","lB","aB","cB","_handleDeleteContent","_handleInsertTextEvent","_defineSelectionConverter","_enablePluginDisabling","getSelectionAsFragment","setCellSelection","_getCellsToSelect","cells","getFocusCell","getAnchorCell","dB","_onCopyCut","_onInsertContent","getTableIfOnlyTableInContent","_replaceSelectedCells","hB","uB","_replaceSelectedCellsWithPasted","_replaceTableSlotCell","mB","pB","_onArrowKey","_handleTabOnSelectedTable","_handleTab","_handleArrowKeys","_navigateFromCellInDirection","_isSelectionAtCellEdge","gB","fB","_enableShiftClickSelection","_enableMouseDragSelection","_getModelTableCellFromDomEvent","bB","buttons","wB","_B","yB","AB","CB","kB","xB","vB","EB","_createDropdownView","_createInputTextView","_stillTyping","_setInputValue","_createColorSelector","blur","defaultColorValue","colorPickerConfig","DB","BB","SB","none","solid","dotted","dashed","double","groove","ridge","inset","outset","TB","IB","PB","FB","OB","RB","MB","_borderStyleValue","zB","icons","propertyName","nameToValue","VB","NB","colorConfig","HB","LB","jB","_role","_ariaLabelledBy","UB","qB","$B","WB","KB","GB","ZB","borderStyle","borderWidth","borderColor","padding","horizontalAlignment","verticalAlignment","borderStyleDropdown","borderWidthInput","borderColorInput","borderRowLabel","_createBorderFields","backgroundRowLabel","backgroundInput","_createBackgroundFields","widthInput","operatorLabel","heightInput","dimensionsLabel","_createDimensionFields","horizontalAlignmentToolbar","verticalAlignmentToolbar","alignmentLabel","_createAlignmentFields","paddingInput","_createPaddingField","defaultTableCellProperties","borderColors","JB","backgroundColors","justify","middle","_horizontalAlignmentLabels","_verticalAlignmentLabels","YB","QB","eS","XB","tS","oS","nS","iS","includeAlignmentProperty","alignment","includePaddingProperty","includeVerticalAlignmentProperty","includeHorizontalAlignmentProperty","isRightToLeftContent","rS","sS","_defaultTableCellProperties","_isReady","_createPropertiesView","colorPicker","_hideView","_undoStepBatch","_isViewInBalloon","_getPropertyChangeCallback","_getValidatedPropertyChangeCallback","viewField","validator","_fillViewFormFromCommandValues","_updateView","_isViewVisible","aS","_defaultValue","_getSingleValue","_getValueToSet","_getAttribute","lS","cS","dS","uS","hS","mS","pS","gS","fS","bS","kS","wS","_S","align","valign","yS","AS","CS","vS","xS","ES","DS","BS","SS","TS","IS","PS","RS","FS","MS","alignmentToolbar","defaultTableProperties","zS","_alignmentLabels","VS","NS","_defaultTableProperties","LS","OS","jS","qS","US","$S","GS","KS","indent","startIndex","ZS","isLegalStyleList","JS","YS","QS","XS","tT","HS","oT","nT","iT","hasMultiLevelListPlugin","isActive","stylesString","_parsedData","WS","marginLeft","listElement","listItemElements","eT","rT","sT","aT","lT","cT","dT","uT","mT","pT","addRule","nodeName","replacement","fence","gT","fT","bT","kT","wT","_T","tableCell","tableRow","tableSection","yT","AT","ET","CT","vT","xT","DT","getElementsByTagName","BT","ST","TT","_keep","blankRule","blankReplacement","keepReplacement","defaultRule","defaultReplacement","array","rules","IT","PT","FT","RT","lineBreak","heading","headingStyle","blockquote","list","lastElementChild","listItem","bulletListMarker","indentedCodeBlock","codeBlockStyle","fencedCodeBlock","horizontalRule","inlineLink","linkStyle","referenceLink","linkReferenceStyle","emphasis","emDelimiter","strong","strongDelimiter","code","keep","forNode","isBlank","zT","VT","MT","NT","ActiveXObject","designMode","write","OT","isVoid","isPre","getElementById","preformattedCode","LT","HT","isCode","flankingWhitespace","leadingAscii","leadingNonAscii","trailingNonAscii","trailingAscii","jT","nodeValue","qT","UT","WT","outerHTML","$T","escape","KT","ZT","GT","turndown","use","JT","YT","QT","XT","eI","tI","defaultChars","componentChars","oI","nI","iI","rI","sI","protocol","slashes","auth","hostname","port","pathname","aI","lI","cI","dI","uI","hI","mI","pI","gI","fI","bI","javascript","kI","http","https","ftp","gopher","parseHost","wI","_I","yI","AI","CI","vI","xI","EI","Uint16Array","DI","BI","SI","TI","fromCodePoint","FI","RI","MI","zI","ZERO","NINE","VI","UPPER_A","UPPER_F","LOWER_A","LOWER_F","NI","EQUALS","UPPER_Z","LOWER_Z","NUM","SEMI","LOWER_X","VALUE_LENGTH","BRANCH_LENGTH","JUMP_TABLE","EntityStart","NumericStart","NumericDecimal","NumericHex","NamedEntity","Legacy","Strict","Attribute","OI","decodeTree","emitCodePoint","errors","consumed","treeIndex","excess","decodeMode","startEntity","stateNumericStart","stateNamedEntity","stateNumericDecimal","stateNumericHex","addToNumericResult","emitNumericEntity","absenceOfDigitsInNumericCharacterReference","II","missingSemicolonAfterCharacterReference","validateNumericCharacterReference","HI","emitNotTerminatedNamedEntity","emitNamedEntityData","LI","jI","qI","UI","WI","$I","GI","KI","ZI","codePointAt","XML","HTML","UTF8","ASCII","Extensive","JI","YI","QI","XI","eP","tP","oP","nP","iP","rP","sP","aP","lP","cP","dP","uP","hP","mP","pP","gP","fP","bP","kP","wP","mdurl","ucmicro","_P","posMax","pos","skipToken","yP","str","AP","can_continue","CP","vP","code_inline","renderAttrs","code_block","info","highlight","langPrefix","renderInlineAsText","renderToken","hardbreak","xhtmlOut","softbreak","breaks","html_block","html_inline","nesting","renderInline","xP","EP","__rules__","__cache__","__find__","__compile__","enableOnly","getRules","DP","BP","markup","meta","attrSet","attrGet","attrJoin","SP","TP","env","inlineMode","IP","PP","FP","RP","MP","zP","VP","NP","OP","LP","HP","jP","qP","WP","$P","single","quotes","token","GP","linkify","pretest","normalizeLink","validateLink","normalizeLinkText","typographer","KP","State","ZP","JP","bMarks","eMarks","tShift","sCount","bsCount","blkIndent","line","lineMax","tight","ddIndent","parentType","skipEmptyLines","skipSpaces","skipSpacesBack","skipChars","skipCharsBack","getLines","YP","QP","XP","eF","tF","oF","nF","iF","rF","sF","aF","tokenize","C","helpers","parseLinkDestination","parseLinkTitle","html","lF","maxNesting","cF","dF","tokens_meta","pending","pendingLevel","delimiters","_prev_delimiters","backticks","backticksScanned","linkLevel","pushPending","scanDelims","can_open","can_close","uF","hF","mF","pF","gF","fF","postProcess","bF","kF","wF","_F","yF","AF","CF","vF","matchAtStart","parseLinkLabel","xF","EF","ruler2","DF","BF","SF","TF","IF","PF","fuzzyLink","fuzzyEmail","fuzzyIP","FF","validate","src_auth","src_host_port_strict","src_path","no_http","src_domain","src_domain_root","src_port","src_host_terminator","mailto","src_email_name","src_host_strict","RF","MF","zF","src_Any","src_Cc","src_Z","src_P","src_ZPCc","src_ZCc","src_pseudo_letter","src_ip4","src_xn","src_host","tpl_host_fuzzy","tpl_host_no_ip_fuzzy","tpl_host_fuzzy_strict","tpl_host_port_fuzzy_strict","tpl_host_port_no_ip_fuzzy_strict","tpl_host_fuzzy_test","tpl_email_fuzzy","tpl_link_fuzzy","tpl_link_no_ip_fuzzy","__opts__","__tlds__","src_tlds","onCompile","__tlds_replaced__","email_fuzzy","link_fuzzy","link_no_ip_fuzzy","host_fuzzy_test","__compiled__","__schemas__","link","schema_test","schema_search","schema_at_start","__index__","__text_cache__","VF","__last_index__","__schema__","NF","OF","testSchemaAt","tlds","LF","HF","jF","qF","UF","WF","$F","GF","KF","ZF","RangeError","JF","YF","QF","XF","eR","tR","oR","ucs2","decode","encode","toASCII","toUnicode","nR","iR","components","zero","rules2","commonmark","rR","sR","aR","lR","cR","dR","uR","renderer","utils","configure","parseInline","hR","gR","_htmlDP","pR","createNodeIterator","SHOW_TEXT","previousElementSibling","acceptNode","FILTER_ACCEPT","FILTER_REJECT","fR","bR","kR","mention","_R","_text","wR","yR","CR","AR","xR","vR","DR","ER","BR","selectFirst","selectNext","selected","selectPrevious","removeHighlight","_isItemVisibleInScrolledArea","executeSelected","SR","TR","IR","PR","FR","_mentionsView","_createMentionView","_mentionsConfigurations","_requestFeedDebounced","_requestFeed","feeds","_hideUIAndRemoveMarker","feed","dropdownLimit","NR","feedCallback","VR","itemRenderer","_setupTextWatcher","_handleFeedResponse","_renderItem","_getItemRenderer","_lastRequested","feedText","zR","minimumCharacters","MR","OR","_showOrUpdateUI","_getBalloonPanelPositionData","RR","caret_se","caret_ne","caret_sw","caret_nw","HR","LR","jR","UR","qR","WR","$R","GR","_action","waitingTime","_debouncedSave","_savePromise","_pendingActions","_makeImmediateSave","_saveCallbacks","_setPendingAction","_flush","returnValue","save","adapter","ZR","JR","YR","localStorage","KR","QR","_asyncToGenerator","eM","formattedRelativeDateTime","timestamp","XR","_this","tM","oM","nM","removeDeletedImage","iM","_addListAutoformats","_addBasicStylesAutoformats","_addHeadingAutoformats","_addBlockQuoteAutoformats","_addCodeBlockAutoformats","_addHorizontalLineAutoformats","usePreviousLanguageChoice","lookupDownloadLocationByName","log","dE","TE","toMentionAttribute","apiV3Service","segment","OpenProject","urlRoot","idNumber","_isTransformedWithPasteFromOffice","hT","sheet","cssRules","bodyString","$editable","siblings","api","v3","previewMarkup","ajax","response_type","contentType","wysiwyg","createLocalStorageKey","updatedAt","removeItem","preFix","editorClasses","elementsWithCustomClassesMap","heading1","heading2","heading3","heading4","heading5","heading6","blockQuote","figure","thead","todo","img","codeblock","caption","attributesWithCustomClassesMap","tableAlignment","numbered","bulleted","uploadStatus","alignmentValuesMap","_addCustomCSSClassesToTheEditorContainer","_addCustomCSSClassesToElements","_addCustomCSSClassesToAttributes","_manageTableUpcast","_manageElementsInsertion","_manageAttributesInsertion","_manageListItems","_wrapInFigureContentContainer","rM","aM","autosave","_ref2","setItem","addError","_x2","OPMacroEmbeddedTable","OPMacroWpButton","OPWikiIncludePage","OPCodeBlock","OPChildPages","contentToolbar","_type","principals","getJSON","uniqBy","_embedded","elements","to_s","sM","keywords","symbol","lM","openProject","removePlugins","canAddAttachments","disableAllMacros","disabledMentions","cM","dM","OPConstrainedEditor","OPClassicEditor","OPEditorWatchdog","createCustomized"],"sourceRoot":"webpack:///","x_google_ignoreList":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,697,698,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1102,1103,1104,1105,1106,1108,1109,1118,1119,1120,1121]}