UNPKG

jodit

Version:

Jodit is an awesome and useful wysiwyg editor with filebrowser

10 lines (8 loc) 549 kB
/*! * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/) * Version: v4.6.2 * Url: https://xdsoft.net/jodit/ * License(s): MIT */ ((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("{}"));else if("function"==typeof define&&define.amd)define(["{}"],e);else{var s="object"==typeof exports?e(require("{}")):e(t["{}"]);for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}})(self,(function(t){return function(){var e={140(t,e,s){"use strict";s.d(e,{V(){return C}});var i=s(31635),r=s(77753),n=s(17352),o=s(22664),a=s(66927),l=s(50025),c=s(65147),h=s(63915),u=s(58597),d=s(14961),p=s(36115),m=(s(70265),s(9979)),g=s(31859),f=s(62994),v=s(18043),_=s(80004),b=s(75889),y=s(83797),w=s(10274);let C=class t extends d.T{className(){return"FileBrowser"}get dataProvider(){return(0,y.S)(this,this.options)}onSelect(t){return()=>{if(this.state.activeElements.length){const e=[],s=[];this.state.activeElements.forEach((t=>{const i=t.fileURL;i&&(e.push(i),s.push(t.isImage||!1))})),this.close();const i={baseurl:"",files:e,isImages:s};(0,c.isFunction)(t)&&t(i),this.close()}return!1}}get _dialog(){const t=this.dlg({minWidth:Math.min(700,screen.width),minHeight:300,buttons:this.o.headerButtons??["fullsize","dialog.close"]});return["beforeClose","afterClose","beforeOpen"].forEach((e=>t.events.on(t,e,(()=>this.e.fire(e))))),t.setSize(this.o.width,this.o.height),t}get storage(){return h.wc.makeStorage(!!this.o.saveStateInStorage,this.componentName)}get isOpened(){return this._dialog.isOpened&&"none"!==this.browser.style.display}status(t,e){t&&!(0,c.isAbortError)(t)&&((0,c.isString)(t)||(t=t.message),(0,c.isString)(t)&&(0,c.trim)(t).length&&this.message.message(t,e?"success":"error",this.o.howLongShowMsg))}open(t=this.o.defaultCallback,e=!1){return this.state.onlyImages=e,this.async.promise(((e,s)=>{if(!this.o.items||!this.o.items.url)throw(0,c.error)("Need set options.filebrowser.ajax.url");let i=0;this.e.off(this.files.container,"dblclick").on(this.files.container,"dblclick",this.onSelect(t)).on(this.files.container,"touchstart",(()=>{const e=(new Date).getTime();n.EMULATE_DBLCLICK_TIMEOUT>e-i&&this.onSelect(t)(),i=e})).off("select.filebrowser").on("select.filebrowser",this.onSelect(t));const r=this.c.div();this.toolbar?.appendTo(r),this.__updateToolbarButtons(),this._dialog.open(this.browser,r),this.e.fire("sort.filebrowser",this.state.sortBy),(0,g.r)(this).then(e,s).finally((()=>{this.isInDestruct||this?.e?.fire("fileBrowserReady.filebrowser")}))})).catch((t=>{if(!(0,c.isAbortError)(t)&&!n.IS_PROD)throw t}))}__getButtons(){return(this.o.buttons??[]).filter((t=>{if(!(0,c.isString)(t))return!0;switch(t){case"filebrowser.upload":return this.dataProvider.canI("FileUpload");case"filebrowser.edit":return this.dataProvider.canI("ImageResize")||this.dataProvider.canI("ImageCrop");case"filebrowser.remove":return this.dataProvider.canI("FileRemove")}return!0}))}initUploader(t){const e=this,s=t?.options?.uploader,i=(0,c.ConfigProto)(s||{},p.T.defaultOptions.uploader),r=()=>(0,m.f)(this);e.uploader=e.getInstance("Uploader",i),e.uploader.setPath(e.state.currentPath).setSource(e.state.currentSource).bind(e.browser,r,e.errorHandler),this.state.on(["change.currentPath","change.currentSource"],(()=>{this.uploader.setPath(this.state.currentPath).setSource(this.state.currentSource)})),e.e.on("bindUploader.filebrowser",(t=>{e.uploader.bind(t,r,e.errorHandler)}))}constructor(t){super(t),this.browser=this.c.div(this.componentName),this.status_line=this.c.div(this.getFullElName("status")),this.tree=new w.V(this),this.files=new w.Q(this),this.state=(0,l.sH)({currentPath:"",currentSource:b.o,currentBaseUrl:"",activeElements:[],elements:[],sources:[],view:"tiles",sortBy:"changed-desc",filterWord:"",onlyImages:!1}),this.errorHandler=t=>{(0,c.isAbortError)(t)||this.status(t instanceof Error?this.i18n(t.message):this.dataProvider.getMessage(t))},this.close=()=>{this._dialog.close()},this.__prevButtons=[],this.attachEvents(t);const e=this;e.options=(0,c.ConfigProto)(t||{},p.T.defaultOptions.filebrowser),e.browser.component=this,e.container=e.browser,e.o.showFoldersPanel&&e.browser.appendChild(e.tree.container),e.browser.appendChild(e.files.container),e.browser.appendChild(e.status_line),v.c.call(e),f.nW.call(e),_.r.call(e),["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach((t=>{null!=this.options[t]&&(this.options[t]=(0,c.ConfigProto)(this.options[t],this.o.ajax))}));const{storeView:s,storeSortBy:i,storeLastOpenedFolder:n}=this.o.saveStateInStorage||{storeLastOpenedFolder:!1,storeView:!1,storeSortBy:!1},o=s&&this.storage.get("view");e.state.view=o&&null==this.o.view?"list"===o?"list":"tiles":"list"===e.o.view?"list":"tiles",e.files.setMod("view",e.state.view);const a=i&&e.storage.get("sortBy");if(a){const t=a.split("-");e.state.sortBy=["changed","name","size"].includes(t[0])?a:"changed-desc"}else e.state.sortBy=e.o.sortBy||"changed-desc";if(n){const t=e.storage.get("currentPath"),s=e.storage.get("currentSource");e.state.currentPath=t??"",e.state.currentSource=s??""}e.initUploader(e),e.setStatus(r.f.ready)}destruct(){this.isInDestruct||((0,o.cached)(this,"_dialog")?.destruct(),super.destruct(),this.events&&this.e.off(".filebrowser"),this.uploader&&this.uploader.destruct())}__updateToolbarButtons(){const t=this.__getButtons();((t,e)=>{if(t.length!==e.length)return!1;for(let s=0;t.length>s;s++)if(t[s]!==e[s])return!1;return!0})(this.__prevButtons,t)||(this.__prevButtons=t,this.toolbar?.build(t))}};(0,i.Cg)([o.cache],C.prototype,"dataProvider",null),(0,i.Cg)([o.cache],C.prototype,"_dialog",null),(0,i.Cg)([o.cache],C.prototype,"storage",null),(0,i.Cg)([o.autobind],C.prototype,"status",null),(0,i.Cg)([o.autobind],C.prototype,"open",null),(0,i.Cg)([(0,a.w)("dataProvider:changePermissions")],C.prototype,"__updateToolbarButtons",null),C=(0,i.Cg)([(0,o.derive)(u.z)],C)},223(t){t.exports='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M5.09668 6.99707H7.17358L4.17358 3.99707L1.17358 6.99707H3.09668V17.0031H1.15881L4.15881 20.0031L7.15881 17.0031H5.09668V6.99707Z"/> <path d="M22.8412 7H8.84119V5H22.8412V7Z"/> <path d="M22.8412 11H8.84119V9H22.8412V11Z"/> <path d="M8.84119 15H22.8412V13H8.84119V15Z"/> <path d="M22.8412 19H8.84119V17H22.8412V19Z"/> </svg>'},225(t,e,s){"use strict";var i=s(31635),r=s(17352),n=s(22664),o=s(55186),a=s(56298),l=s(71274),c=s(26150),h=s(38322),u=s(29866);s(50248);class d extends u.k{constructor(){super(...arguments),this.addNativeListeners=()=>{this.j.e.off(this.j.editor,"input.placeholder keydown.placeholder").on(this.j.editor,"input.placeholder keydown.placeholder",this.toggle)},this.addEvents=()=>{const t=this.j;t.o.useInputsPlaceholder&&t.element.hasAttribute("placeholder")&&(this.placeholderElm.innerHTML=(0,c.C)(t.element,"placeholder")||""),t.e.fire("placeholder",this.placeholderElm.innerHTML),t.e.off(".placeholder").on("changePlace.placeholder",this.addNativeListeners).on("change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder mousedown.placeholder afterSetMode.placeholder changePlace.placeholder",this.toggle).on(window,"load",this.toggle),this.addNativeListeners(),this.toggle()}}afterInit(t){t.o.showPlaceholder&&(this.placeholderElm=t.c.fromHTML(`<span data-ref="placeholder" style="display: none;" class="jodit-placeholder">${t.i18n(t.o.placeholder)}</span>`),"rtl"===t.o.direction&&(this.placeholderElm.style.right="0px",this.placeholderElm.style.direction="rtl"),t.e.on("readonly",(t=>{t?this.hide():this.toggle()})).on("changePlace",this.addEvents),this.addEvents())}show(){const t=this.j;if(t.o.readonly)return;let e=0,s=0;const i=t.s.current(),r=i&&o.J.closest(i,o.J.isBlock,t.editor)||t.editor,n=t.ew.getComputedStyle(r),a=t.ew.getComputedStyle(t.editor);t.workplace.appendChild(this.placeholderElm);const{firstChild:c}=t.editor;if(o.J.isElement(c)&&!(0,l.r)(c)){const i=t.ew.getComputedStyle(c);e=parseInt(i.getPropertyValue("margin-top"),10),s=parseInt(i.getPropertyValue("margin-left"),10),this.placeholderElm.style.fontSize=parseInt(i.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=i.getPropertyValue("line-height")}else this.placeholderElm.style.fontSize=parseInt(n.getPropertyValue("font-size"),10)+"px",this.placeholderElm.style.lineHeight=n.getPropertyValue("line-height");(0,h.A)(this.placeholderElm,{display:"block",textAlign:n.getPropertyValue("text-align"),paddingTop:parseInt(a.paddingTop,10)+"px",paddingLeft:parseInt(a.paddingLeft,10)+"px",paddingRight:parseInt(a.paddingRight,10)+"px",marginTop:Math.max(parseInt(n.getPropertyValue("margin-top"),10),e),marginLeft:Math.max(parseInt(n.getPropertyValue("margin-left"),10),s)})}hide(){o.J.safeRemove(this.placeholderElm)}toggle(){const t=this.j;t.editor&&!t.isInDestruct&&(t.getRealMode()===r.MODE_WYSIWYG&&(t=>{if(!t.firstChild)return!0;const e=t.firstChild;if(r.INSEPARABLE_TAGS.has(e.nodeName?.toLowerCase())||/^(TABLE)$/i.test(e.nodeName))return!1;const s=o.J.next(e,(t=>t&&!o.J.isEmptyTextNode(t)),t);return o.J.isText(e)&&!s?o.J.isEmptyTextNode(e):!s&&o.J.each(e,(t=>!(o.J.isLeaf(t)||o.J.isList(t))&&(o.J.isEmpty(t)||o.J.isTag(t,"br"))))})(t.editor)?this.show():this.hide())}beforeDestruct(t){this.hide(),t.e.off(".placeholder").off(window,"load",this.toggle)}}(0,i.Cg)([(0,n.debounce)((t=>t.defaultTimeout/10),!0)],d.prototype,"toggle",null),a.fg.add("placeholder",d)},449(t,e,s){"use strict";s.d(e,{N(){return r},k(){return i}});const i=t=>t.replace(/([A-Z])([A-Z])([a-z])/g,"$1-$2$3").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),r=t=>t.replace(/([A-Z])([A-Z])([a-z])/g,"$1-$2$3").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},641(t,e,s){"use strict";s.d(e,{$(){return n},l(){return r}});var i=s(55186);function r(t,e,s){let i=t.getBoundingClientRect(),r=t;const n=i.top,o=i.height;for(;r&&r!==e&&r.parentNode;){if(r=r.parentNode,i=r.getBoundingClientRect(),n>i.bottom)return!1;if(i.top>=n+o)return!1}return(s.documentElement&&s.documentElement.clientHeight||0)>=n}function n(t,e,s){i.J.isHTMLElement(t)&&!r(t,e,s)&&(e.clientHeight!==e.scrollHeight&&(e.scrollTop=t.offsetTop),r(t,e,s)||t.scrollIntoView())}},926(t,e,s){"use strict";s.d(e,{r(){return r}});var i=s(55186);function r(t,e,s,r,n,o){return i.J.isText(e)&&!e.nodeValue?(e===o&&t.s.isCollapsed()&&t.s.setCursorAfter(e),i.J.safeRemove(e),!0):s}},928(t){t.exports='<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox="0 0 1792 1792"> <path d="M621 1280h595v-595zm-45-45l595-595h-595v595zm1152 77v192q0 14-9 23t-23 9h-224v224q0 14-9 23t-23 9h-192q-14 0-23-9t-9-23v-224h-864q-14 0-23-9t-9-23v-864h-224q-14 0-23-9t-9-23v-192q0-14 9-23t23-9h224v-224q0-14 9-23t23-9h192q14 0 23 9t9 23v224h851l246-247q10-9 23-9t23 9q9 10 9 23t-9 23l-247 246v851h224q14 0 23 9t9 23z"/> </svg>'},931(t,e,s){"use strict";s.d(e,{I(){return n}}),s(17352);var i=s(65147),r=s(38322);class n{static getIcon(t){return/<svg/i.test(t)?t:n.icons[t]||n.icons[t.replace(/-/g,"_")]||n.icons[t.replace(/_/g,"-")]||n.icons[(0,i.camelCase)(t)]||n.icons[(0,i.kebabCase)(t)]||n.icons[t.toLowerCase()]}static exists(t){return void 0!==this.getIcon(t)}static get(t,e="<span></span>"){return this.getIcon(t)||e}static set(t,e){return this.icons[t.replace("_","-")]=e,this}static makeIcon(t,e){if(!e)return;let s;const{name:i,iconURL:o,fill:a}=e,l=i.replace(/[^a-zA-Z0-9]/g,"_");let c;/<svg/.test(i)||(c=t.o.getIcon?.(i,l));const h=`${i}${o}${a}${c??""}`;if(t.o.cache&&this.__cache.has(h))return this.__cache.get(h)?.cloneNode(!0);if(o)s=t.c.span(),(0,r.A)(s,"backgroundImage","url("+o.replace("{basePath}",t?.basePath||"")+")");else{const e=c||n.get(i,"")||t.o.extraIcons?.[i];e&&(s=t.c.fromHTML(e.trim()),/^<svg/i.test(i)||s.classList.add("jodit-icon_"+l))}return s&&(s.classList.add("jodit-icon"),s.style.fill=a,t.o.cache&&this.__cache.set(h,s.cloneNode(!0))),s}}n.icons={},n.__cache=new Map},1239(t,e,s){"use strict";var i=s(31635),r=s(22664),n=s(56298),o=s(71005);s(20797);class a extends o.k{constructor(){super(...arguments),this.buttons=[{name:"ul",group:"list"},{name:"ol",group:"list"}]}afterInit(t){t.registerCommand("insertUnorderedList",this.onCommand).registerCommand("insertOrderedList",this.onCommand)}onCommand(t,e,s){return this.jodit.s.commitStyle({element:"insertunorderedlist"===t?"ul":"ol",attributes:{style:{listStyleType:s??null}}}),this.jodit.synchronizeValues(),!1}beforeDestruct(t){}}(0,i.Cg)([r.autobind],a.prototype,"onCommand",null),n.fg.add("orderedList",a)},1540(t,e,s){"use strict";s.d(e,{$(){return c}});var i,r=s(31635),n=s(24767),o=s(26150),a=s(69198),l=s(84103);let c=i=class t extends a.t{className(){return"UISelect"}createContainer(t){const e=super.createContainer(t),{j:s}=this,{nativeInput:i}=this,r=()=>s.create.element("option");if(void 0!==t.placeholder){const e=r();e.value="",e.text=s.i18n(t.placeholder),i.add(e)}return t.options?.forEach((t=>{const e=r();e.value=""+t.value,e.text=s.i18n(t.text),i.add(e)})),t.size&&t.size>0&&(0,o.C)(i,"size",t.size),t.multiple&&(0,o.C)(i,"multiple",""),e}createNativeInput(){return this.j.create.element("select")}updateValidators(){super.updateValidators(),this.state.required&&(this.validators.delete(l.O.required),this.validators.add(l.U.m))}constructor(t,e){super(t,e),this.state={...i.defaultState},Object.assign(this.state,e)}};c.defaultState={...a.t.defaultState,options:[],size:1,multiple:!1},c=i=(0,r.Cg)([n.s],c)},1677(t,e,s){"use strict";var i=s(31635),r=s(17352),n=s(22664),o=s(55186),a=s(56298),l=s(65147),c=s(29866);s(63400);const h=!r.IS_ES_NEXT&&r.IS_IE;class u extends c.k{constructor(){super(...arguments),this.__isToolbarStuck=!1,this.__createDummy=t=>{this.__dummyBox=this.j.c.div(),this.__dummyBox.classList.add("jodit_sticky-dummy_toolbar"),this.j.container.insertBefore(this.__dummyBox,t)},this.addSticky=t=>{this.__isToolbarStuck||(h&&!this.__dummyBox&&this.__createDummy(t),this.j.container.classList.add("jodit_sticky"),this.__isToolbarStuck=!0),(0,l.css)(t,{top:this.j.o.toolbarStickyOffset||null,width:this.j.container.offsetWidth-2}),this.__dummyBox&&(0,l.css)(this.__dummyBox,{height:t.offsetHeight})},this.removeSticky=t=>{this.__isToolbarStuck&&((0,l.css)(t,{width:"",top:""}),this.j.container.classList.remove("jodit_sticky"),this.__isToolbarStuck=!1)}}afterInit(t){t.e.on(t.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.__onScroll).on("getStickyState.sticky",(()=>this.__isToolbarStuck))}__onScroll(){const{jodit:t}=this;if(!t.o.toolbarSticky||!t.o.toolbar)return;const e=t.ow.pageYOffset||t.od.documentElement&&t.od.documentElement.scrollTop||0,s=(0,l.offset)(t.container,t,t.od,!0),i=t.getMode()===r.MODE_WYSIWYG&&e+t.o.toolbarStickyOffset>s.top&&s.top+s.height>e+t.o.toolbarStickyOffset&&!(t.o.toolbarDisableStickyForMobile&&this.__isMobile());if(this.__isToolbarStuck===i)return;const n=t.toolbarContainer;n&&(i?this.addSticky(n):this.removeSticky(n)),t.e.fire("toggleSticky",i)}__isMobile(){const{j:t}=this;return t&&t.options&&t.container&&t.options.sizeSM>=t.container.offsetWidth}beforeDestruct(t){o.J.safeRemove(this.__dummyBox),t.e.off(t.ow,"scroll.sticky wheel.sticky mousewheel.sticky resize.sticky",this.__onScroll).off(".sticky")}}(0,i.Cg)([(0,n.throttle)()],u.prototype,"__onScroll",null),a.fg.add("sticky",u)},1916(t){t.exports='<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox="0 0 24 24"> <g transform="scale(1.2 1.2) translate(-2 -0.5)"> <path d="M 22,12.5 A 1.49995,1.49995 0 0 0 20.50006,11 H 20 V 10 A 3,3 0 0 0 17,7 H 13 V 5.7226 a 2,2 0 1 0 -2,0 V 7 H 7 a 3,3 0 0 0 -3,3 v 1 H 3.49994 a 1.5,1.5 0 0 0 0,3 H 4 v 1 A 3.00128,3.00128 0 0 0 6.20251,17.89282 1.03113,1.03113 0 0 1 7,18.86975 v 0.716 a 0.99928,0.99928 0 0 0 1.00726,1.002 0.9792,0.9792 0 0 0 0.69983,-0.29486 l 2,-2 A 1,1 0 0 1 11.41425,18 H 17 a 3,3 0 0 0 3,-3 v -1 h 0.50006 A 1.49995,1.49995 0 0 0 22,12.5 Z M 19,15 a 2.00226,2.00226 0 0 1 -2,2 H 11.41425 A 1.987,1.987 0 0 0 10,17.58575 l -2,2 v -0.716 A 2.02082,2.02082 0 0 0 6.46771,16.92865 2.00439,2.00439 0 0 1 5,15 V 10 A 2.00226,2.00226 0 0 1 7,8 h 10 a 2.00222,2.00222 0 0 1 2,2 z M 10,12.5 A 1.5,1.5 0 1 1 8.5,11 1.5,1.5 0 0 1 10,12.5 Z m 7,0 A 1.5,1.5 0 1 1 15.5,11 1.5,1.5 0 0 1 17,12.5 Z"/> </g> </svg>'},1963(t,e,s){"use strict";s.d(e,{C(){return r}});var i=s(69052);function r(...t){return e=>{const s=e.prototype;for(let e=0;t.length>e;e++){const r=t[e],n=Object.getOwnPropertyNames(r.prototype);for(let t=0;n.length>t;t++){const e=n[t],o=Object.getOwnPropertyDescriptor(r.prototype,e);null!=o&&(0,i.T)(o.value)&&!(0,i.T)(s[e])&&Object.defineProperty(s,e,{enumerable:!0,configurable:!0,writable:!0,value(...t){return o.value.call(this,...t)}})}}}}},1992(t,e,s){"use strict";s.d(e,{b(){return n}});var i=s(65147),r=s(76134);function n(t,e,s,n,o){let a;if((0,i.isFunction)(t))a=t(e);else switch(t){case"ace":if(!e.o.shadowRoot){a=new r.p(e,s,n,o);break}default:a=new r.S(e,s,n,o)}return a.init(e),a.onReadyAlways((()=>{a.setReadOnly(e.o.readonly)})),a}},2461(t,e,s){"use strict";function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}s.d(e,{E(){return i}})},2533(t,e,s){"use strict";var i=s(17352),r=s(55186),n=s(56298),o=s(65147),a=s(11648);const l=new Set([i.KEY_TAB,i.KEY_LEFT,i.KEY_RIGHT,i.KEY_UP,i.KEY_DOWN]);n.fg.add("tableKeyboardNavigation",(t=>{t.e.off(".tableKeyboardNavigation").on("keydown.tableKeyboardNavigation",(e=>{const{key:s}=e,n=((t,e)=>{if(!l.has(e))return;const s=t.s.current();if(!s)return;const n=r.J.up(s,r.J.isCell,t.editor);if(!n)return;const{range:a}=t.s;if(e!==i.KEY_TAB&&s!==n){const t=e===i.KEY_RIGHT||e===i.KEY_DOWN,l=(0,o.call)(t?r.J.next:r.J.prev,s,(t=>e===i.KEY_UP||e===i.KEY_DOWN?r.J.isTag(t,"br"):!!t),n);if(!t&&(l||e!==i.KEY_UP&&r.J.isText(s)&&0!==a.startOffset)||t&&(l||e!==i.KEY_DOWN&&r.J.isText(s)&&s.nodeValue&&a.startOffset!==s.nodeValue.length))return}return n})(t,s);if(!n)return;const c=t.getInstance(a.X,t.o),h=r.J.closest(n,"table",t.editor);let u=null;const d=s===i.KEY_LEFT||e.shiftKey,p=()=>(0,o.call)(d?r.J.prev:r.J.next,n,r.J.isCell,h);switch(s){case i.KEY_TAB:case i.KEY_LEFT:u=p(),u||(c.appendRow(h,!!d&&h.querySelector("tr"),!d),u=p());break;case i.KEY_UP:case i.KEY_DOWN:{const t=c.formalMatrix(h),[e,r]=c.formalCoordinate(h,n);s===i.KEY_UP?void 0!==t[e-1]&&(u=t[e-1][r]):void 0!==t[e+1]&&(u=t[e+1][r])}}if(u){if(t.e.fire("hidePopup hideResizer"),u.firstChild)s===i.KEY_TAB?t.s.select(u,!0):t.s.setCursorIn(u,s===i.KEY_RIGHT||s===i.KEY_DOWN);else{const e=t.createInside.element("br");u.appendChild(e),t.s.setCursorBefore(e)}return t.synchronizeValues(),!1}}))}))},2788(t,e,s){"use strict";s.d(e,{M(){return i}});class i{constructor(){this.data=new Map}set(t,e){return this.data.set(t,e),this}delete(t){return this.data.delete(t),this}get(t){return this.data.get(t)}exists(t){return this.data.has(t)}clear(){return this.data.clear(),this}}},2805(t,e,s){"use strict";s(36115).T.prototype.wrapNodes={exclude:new Set(["hr","style","br"]),emptyBlockAfterInit:!0}},3006(t,e,s){"use strict";s.d(e,{c(){return l}});var i,r=s(31635),n=s(22664),o=s(55186),a=s(69198);let l=i=class t extends a.t{className(){return"UICheckbox"}render(){return this.j.c.element("label",{className:this.componentName})}constructor(t,e){super(t,{...e,type:"checkbox"}),this.state={...i.defaultState},Object.assign(this.state,e)}onChangeChecked(){this.value=""+this.state.checked,this.nativeInput.checked=this.state.checked,this.setMod("checked",this.state.checked)}onChangeNativeCheckBox(){this.state.checked=this.nativeInput.checked}onChangeSwitch(){this.setMod("switch",this.state.switch);let t=this.getElm("switch-slider");this.state.switch?(t||(t=this.j.c.div(this.getFullElName("switch-slider"))),o.J.after(this.nativeInput,t)):o.J.safeRemove(t)}};l.defaultState={...a.t.defaultState,checked:!1,switch:!1},(0,r.Cg)([(0,n.watch)("state.checked"),(0,n.hook)("ready")],l.prototype,"onChangeChecked",null),(0,r.Cg)([(0,n.watch)("nativeInput:change")],l.prototype,"onChangeNativeCheckBox",null),(0,r.Cg)([(0,n.watch)("state.switch"),(0,n.hook)("ready")],l.prototype,"onChangeSwitch",null),l=i=(0,r.Cg)([n.component],l)},3101(t,e,s){"use strict";s.d(e,{L(){return a}});var i=s(71842),r=s(26150),n=s(61001),o=s(80394);function a(t,e,s){const a=((t,e,s)=>t.elementIsBlock?i.J.up(e,(t=>i.J.isBlock(t)&&!i.J.isTag(t,l)),s.editor)||(0,o.Y)(t,e,s):((0,r.C)(e,"size",null),e))(t,e,s);return t.elementIsList?(0,n.z)(t,a,s):i.J.replace(a,t.element,s.createInside,!0)}const l=new Set(["td","th","tr","tbody","table","li","ul","ol"])},3258(t,e,s){"use strict";s.d(e,{I(){return m}});var i=s(31635),r=s(64567),n=s(22664),o=s(71842),a=s(65147),l=s(35265),c=s(57023),h=s(931),u=s(80071),d=s(97394),p=s(8809);let m=class t extends l.lD{className(){return"ToolbarButton"}get toolbar(){return this.closest(d.Q)}update(){const{control:t,state:e}=this,s=this.closest(d.Q);if(!s)return;const i=t.value?.(s.jodit,this);void 0!==i&&(e.value=i),e.disabled=this.__calculateDisabledStatus(s),e.activated=this.__calculateActivatedStatus(s),t.update?.(s.jodit,this)}__calculateActivatedStatus(t){return!((0,a.isJoditObject)(this.j)&&!this.j.editorIsActive||!this.control.isActive?.(this.j,this)&&(!t||!t.shouldBeActive(this)))}__calculateDisabledStatus(t){return!(!this.j.o.disabled&&(!this.j.o.readonly||this.j.o.activeButtonsInReadOnly&&this.j.o.activeButtonsInReadOnly.includes(this.control.name))&&!this.control.isDisabled?.(this.j,this)&&(!t||!t.shouldBeDisabled(this)))}onChangeActivated(){(0,a.attr)(this.button,"aria-pressed",this.state.activated),super.onChangeActivated()}onChangeText(){(0,a.isFunction)(this.control.template)?this.text.innerHTML=this.control.template(this.j,this.control.name,this.j.i18n(this.state.text)):super.onChangeText(),this.setMod("text-icons",!!this.text.innerText.trim().length)}onChangeTabIndex(){(0,a.attr)(this.button,"tabindex",this.state.tabIndex)}createContainer(){const t=this.componentName,e=this.j.c.span(t),s=super.createContainer();(0,a.attr)(e,"role","listitem"),s.classList.remove(t),s.classList.add(t+"__button"),Object.defineProperty(s,"component",{value:this}),e.appendChild(s);const i=this.j.c.fromHTML(`<span role="trigger" class="${t}__trigger">${h.I.get("chevron")}</span>`);return s.appendChild(i),e}focus(){this.container.querySelector("button")?.focus()}onChangeHasTrigger(){this.state.hasTrigger?this.container.appendChild(this.trigger):o.J.safeRemove(this.trigger),this.setMod("with-trigger",this.state.hasTrigger||null)}onChangeDisabled(){const t=this.state.disabled?"disabled":null;(0,a.attr)(this.trigger,"disabled",t),(0,a.attr)(this.button,"disabled",t),(0,a.attr)(this.container,"disabled",t)}constructor(t,e,s=null){super(t),this.control=e,this.target=s,this.state={...(0,l.ue)(),theme:"toolbar",currentValue:"",hasTrigger:!1},this.openedPopup=null;const i=this.getElm("button");this.button=i,Object.defineProperty(i,"component",{value:this,configurable:!0});const n=this.getElm("trigger");this.trigger=n,n.remove(),t.e.on([this.button,this.trigger],"mousedown",(t=>t.preventDefault())),this.onAction(this.onClick),this.hookStatus(r.f.ready,(()=>{this.__initFromControl(),this.update()})),e.mods&&Object.keys(e.mods).forEach((t=>{e.mods&&this.setMod(t,e.mods[t])}))}__initFromControl(){const{control:t,state:e}=this;this.updateSize(),e.name=t.name;const{textIcons:s}=this.j.o;if(!0===s||(0,a.isFunction)(s)&&s(t.name)||t.template)e.icon=(0,l.ue)().icon,e.text=t.text||t.name;else{if(t.iconURL)e.icon.iconURL=t.iconURL;else{const s=t.icon||t.name;e.icon.name=h.I.exists(s)||this.j.o.extraIcons?.[s]?s:""}t.iconURL||e.icon.name||(e.text=t.text||t.name)}t.tooltip&&(e.tooltip=this.j.i18n((0,a.isFunction)(t.tooltip)?t.tooltip(this.j,t,this):t.tooltip)),e.hasTrigger=!!(t.list||t.popup&&t.exec)}onTriggerClick(t){if(this.openedPopup)return void this.__closePopup();const{control:e}=this;if(t.buffer={actionTrigger:this},e.list)return this.__openControlList(e);if((0,a.isFunction)(e.popup)){const s=this.openPopup();s.parentElement=this;try{if(!1!==this.j.e.fire((0,a.camelCase)(`before-${e.name}-open-popup`),this.target,e,s)){const t=this.toolbar?.getTarget(this)??this.target??null,i=e.popup(this.j,t,this.__closePopup,this);i?s.setContent((0,a.isString)(i)?this.j.c.fromHTML(i):i).open((()=>(0,a.position)(this.container)),!1,this.j.o.allowTabNavigation?this.container:void 0):this.__closePopup()}}catch(t){throw this.__closePopup(),t}this.j.e.fire((0,a.camelCase)(`after-${e.name}-open-popup`),s.container)}}__openControlList(t){const e=this.jodit.options.controls??{},s=t=>(0,c.x)(t,e),i=t.list,r=this.openPopup(),n=(0,p.$K)(this.j);r.parentElement=this,n.parentElement=r,n.mode="vertical";const o=(e,i)=>{if((0,a.isString)(i)&&s(i))return{name:""+i,...s(i)};if((0,a.isString)(e)&&s(e))return{name:""+e,...s(e),..."object"==typeof i?i:{}};(t=>(0,a.isPlainObject)(t)&&"title"in t&&"value"in t)(e)&&(i=e.value,e=e.title);const{childTemplate:r}=t,n={name:""+e,template:r&&((t,e,s)=>r(t,e,s,this)),exec:t.childExec?(e,s,i)=>t.childExec?.(e,s,{...i,parentControl:t}):t.exec,data:t.data,command:t.command,isActive:t.isChildActive,value:t.value,isDisabled:t.isChildDisabled,mode:t.mode,args:[...t.args?t.args:[],e,i]};return(0,a.isString)(i)&&(n.text=i),n};n.build((0,a.isArray)(i)?i.map(o):(0,a.keys)(i,!1).map((t=>o(t,i[t]))),this.target),r.setContent(n).open((()=>(0,a.position)(this.container)),!1,this.j.o.allowTabNavigation?this.container:void 0),this.state.activated=!0}onOutsideClick(t){this.openedPopup&&(t&&o.J.isNode(t.target)&&(o.J.isOrContains(this.container,t.target)||this.openedPopup.isOwnClick(t))||this.__closePopup())}openPopup(){return this.__closePopup(),this.openedPopup=new u.z(this.j,!1),this.j.e.on(this.ow,"mousedown touchstart",this.onOutsideClick).on("escape closeAllPopups",this.onOutsideClick),this.openedPopup}__closePopup(){this.openedPopup&&(this.j.e.off(this.ow,"mousedown touchstart",this.onOutsideClick).off("escape closeAllPopups",this.onOutsideClick),this.state.activated=!1,this.openedPopup.close(),this.openedPopup.destruct(),this.openedPopup=null)}onClick(t){const{control:e}=this;if((0,a.isFunction)(e.exec)){const s=this.toolbar?.getTarget(this)??this.target??null,i=e.exec(this.j,s,{control:e,originalEvent:t,button:this});if(!1!==i&&!0!==i&&(this.j?.e?.fire("synchro"),this.parentElement&&this.parentElement.update(),this.j?.e?.fire("closeAllPopups afterExec")),!1!==i)return}return e.list?this.__openControlList(e):(0,a.isFunction)(e.popup)?this.onTriggerClick(t):void((e.command||e.name)&&((0,a.call)((0,a.isJoditObject)(this.j)?this.j.execCommand.bind(this.j):this.j.od.execCommand.bind(this.j.od),e.command||e.name,!1,e.args&&e.args[0]),this.j.e.fire("closeAllPopups")))}destruct(){return this.__closePopup(),super.destruct()}};(0,i.Cg)([n.cacheHTML],m.prototype,"createContainer",null),(0,i.Cg)([(0,n.watch)("state.hasTrigger",{immediately:!1})],m.prototype,"onChangeHasTrigger",null),(0,i.Cg)([(0,n.watch)("trigger:click")],m.prototype,"onTriggerClick",null),(0,i.Cg)([n.autobind],m.prototype,"onOutsideClick",null),(0,i.Cg)([n.autobind],m.prototype,"__closePopup",null),m=(0,i.Cg)([n.component],m)},3392(t,e,s){"use strict";s.d(e,{i(){return r}});var i=s(55186);const r=(t,e)=>`${i.J.isCell(e)?"padding":"margin"}${"rtl"===t?"Right":"Left"}`},3459(t,e,s){"use strict";var i=s(31635),r=s(22664),n=s(71842),o=s(56298),a=s(65147),l=s(71005),c=s(53048),h=s(96369),u=s(8809);s(15776);class d extends l.k{constructor(){super(...arguments),this.type=null,this.snapRange=null,this.elmsList=(0,a.keys)(this.j.o.popup,!1).filter((t=>!this.isExcludedTarget(t)))}get popup(){return new h.z(this.jodit,!1)}get toolbar(){return(0,u.$K)(this.jodit,this.popup)}onClick(t){const e=this.elmsList,s=n.J.isTag(t,"img")?t:n.J.closest(t,e,this.j.editor);if(s&&this.canShowPopupForType(s.nodeName.toLowerCase()))return this.showPopup((()=>(0,a.position)(s,this.j)),s.nodeName.toLowerCase(),s),!1}showPopup(t,e,s){if(e=e.toLowerCase(),!this.canShowPopupForType(e))return!1;if(this.type!==e||s!==this.previousTarget){this.previousTarget=s;const t=this.j.o.popup[e];let i;i=(0,a.isFunction)(t)?t(this.j,s,this.popup.close):t,(0,a.isArray)(i)&&(this.toolbar.build(i,s),this.toolbar.buttonSize=this.j.o.toolbarButtonSize,i=this.toolbar.container),this.popup.setContent(i),this.type=e}return this.popup.open(t),!0}hidePopup(t){!this.popup.isOpened||(0,a.isString)(t)&&t!==this.type||this.popup.close()}onOutsideClick(){this.popup.close()}canShowPopupForType(t){const e=this.j.o.popup[t.toLowerCase()];return!(this.j.o.readonly||!this.j.o.toolbarInline||!e||this.isExcludedTarget(t))}isExcludedTarget(t){return(0,a.splitArray)(this.j.o.toolbarInlineDisableFor).map((t=>t.toLowerCase())).includes(t.toLowerCase())}afterInit(t){this.j.e.on("getDiffButtons.mobile",(e=>{if(this.toolbar===e){const e=this.toolbar.getButtonsNames();return(0,a.toArray)(t.registeredButtons).filter((t=>!this.j.o.toolbarInlineDisabledButtons.includes(t.name))).filter((t=>{const s=(0,a.isString)(t)?t:t.name;return s&&"|"!==s&&"\n"!==s&&!e.includes(s)}))}})).on("hidePopup",this.hidePopup).on("showInlineToolbar",this.showInlineToolbar).on("showPopup",((t,e,s)=>{this.showPopup(e,s||((0,a.isString)(t)?t:t.nodeName),(0,a.isString)(t)?void 0:t)})).on("mousedown keydown",this.onSelectionStart).on("change",(()=>{this.popup.isOpened&&this.previousTarget&&!this.previousTarget.parentNode&&(this.hidePopup(),this.previousTarget=void 0)})).on([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd),this.addListenersForElements()}onSelectionStart(){this.snapRange=this.j.s.range.cloneRange()}onSelectionEnd(t){if(t&&t.target&&c.D$.closestElement(t.target,h.z))return;const{snapRange:e}=this,{range:s}=this.j.s;e&&!s.collapsed&&s.startContainer===e.startContainer&&s.startOffset===e.startOffset&&s.endContainer===e.endContainer&&s.endOffset===e.endOffset||this.onSelectionChange()}onSelectionChange(){if(!this.j.o.toolbarInlineForSelection)return;const t="selection",e=this.j.s.sel,s=this.j.s.range;e?.isCollapsed||this.isSelectedTarget(s)?this.type===t&&this.popup.isOpened&&this.hidePopup():this.j.s.current()&&this.showPopup((()=>s.getBoundingClientRect()),t)}isSelectedTarget(t){const e=t.startContainer;return n.J.isElement(e)&&e===t.endContainer&&n.J.isTag(e.childNodes[t.startOffset],new Set((0,a.keys)(this.j.o.popup,!1)))&&t.startOffset===t.endOffset-1}beforeDestruct(t){t.e.off("showPopup").off([this.j.ew,this.j.ow],"mouseup keyup",this.onSelectionEnd),this.removeListenersForElements()}_eventsList(){const t=this.elmsList;return t.map((t=>(0,a.camelCase)("click_"+t))).concat(t.map((t=>(0,a.camelCase)("touchstart_"+t)))).join(" ")}addListenersForElements(){this.j.e.on(this._eventsList(),this.onClick)}removeListenersForElements(){this.j.e.off(this._eventsList(),this.onClick)}showInlineToolbar(t){this.showPopup((()=>{if(t)return t;const{range:e}=this.j.s;return e.getBoundingClientRect()}),"toolbar")}}d.requires=["select"],(0,i.Cg)([r.cache],d.prototype,"popup",null),(0,i.Cg)([r.cache],d.prototype,"toolbar",null),(0,i.Cg)([r.autobind],d.prototype,"onClick",null),(0,i.Cg)([(0,r.wait)((t=>!t.j.isLocked))],d.prototype,"showPopup",null),(0,i.Cg)([(0,r.watch)([":clickEditor",":beforeCommandDelete",":backSpaceAfterDelete"]),r.autobind],d.prototype,"hidePopup",null),(0,i.Cg)([(0,r.watch)(":outsideClick")],d.prototype,"onOutsideClick",null),(0,i.Cg)([r.autobind],d.prototype,"onSelectionStart",null),(0,i.Cg)([r.autobind],d.prototype,"onSelectionEnd",null),(0,i.Cg)([(0,r.debounce)((t=>t.defaultTimeout))],d.prototype,"onSelectionChange",null),(0,i.Cg)([r.autobind],d.prototype,"showInlineToolbar",null),o.fg.add("inlinePopup",d)},3593(t,e,s){"use strict";s.r(e),s.d(e,{allowAttributes(){return i.f},fillEmptyParagraph(){return r.f},removeEmptyTextNode(){return n.r},removeInvTextNodes(){return o.u},replaceOldTags(){return a.H},sanitizeAttributes(){return l.L},tryRemoveNode(){return c.k}});var i=s(5232),r=s(63443),n=s(926),o=s(67431),a=s(81199),l=s(32782),c=s(32014)},3843(t){t.exports='<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox="0 0 16 16"> <path stroke-width="0" d="M16 9v-6h-3v-1c0-0.55-0.45-1-1-1h-11c-0.55 0-1 0.45-1 1v3c0 0.55 0.45 1 1 1h11c0.55 0 1-0.45 1-1v-1h2v4h-9v2h-0.5c-0.276 0-0.5 0.224-0.5 0.5v5c0 0.276 0.224 0.5 0.5 0.5h2c0.276 0 0.5-0.224 0.5-0.5v-5c0-0.276-0.224-0.5-0.5-0.5h-0.5v-1h9zM12 3h-11v-1h11v1z"/> </svg>'},3947(t,e,s){"use strict";s.d(e,{E(){return n}});var i=s(12461),r=s(98253);function n(t){return(0,r.K)(t)&&(0,i.k)(t)&&(t=parseFloat(t)),"number"==typeof t&&Number.isFinite(t)&&!(t%1)}},4909(t,e,s){"use strict";s.d(e,{Z(){return l}});var i=s(77753),r=s(55186),n=s(69052),o=s(26150),a=s(53048);const l=(t,e,s)=>{const l=t.c.div("jodit-tabs"),c=t.c.div("jodit-tabs__wrapper"),h=t.c.div("jodit-tabs__buttons");(0,o.C)(h,{role:"tablist","aria-orientation":"horizontal"});const u={},d=[];let p="";l.appendChild(h),l.appendChild(c);const m=t=>{u[t]&&(d.forEach((t=>{t.state.activated=!1})),Object.values(u).forEach((({tab:t})=>t.classList.remove("jodit-tab_active"))),u[t].button.state.activated=!0,u[t].tab.classList.add("jodit-tab_active"))};if(e.forEach((({icon:l,name:g,content:f})=>{const v=t.c.div("jodit-tab");(0,o.C)(v,{role:"tabpanel"});const _=(0,a.$n)(t,l||g,g);_.state.role="tab",t.e.on(_.container,"pointerdown",(t=>t.preventDefault())),p||(p=g),h.appendChild(_.container),d.push(_),_.container.classList.add("jodit-tabs__button","jodit-tabs__button_columns_"+e.length),(0,n.T)(f)?v.appendChild(t.c.div("jodit-tab_empty")):v.appendChild(i.uA.isInstanceOf(f,a.D$)?f.container:f),c.appendChild(v),_.onAction((()=>(m(g),(0,n.T)(f)&&!r.J.isElement(f)&&f.call(t),s&&(s.activeTab=g),!1))),u[g]={button:_,tab:v}})),Object.values(u).forEach((({button:t})=>{t.container.style.width=(100/e.length).toFixed(10)+"%"})),m(s&&s.activeTab&&u[s.activeTab]?s.activeTab:p),s){let t=s.activeTab;Object.defineProperty(s,"activeTab",{configurable:!0,enumerable:!1,get:()=>t,set(e){t=e,m(e)}})}return l}},4960(t,e,s){"use strict";s.d(e,{G(){return r}});var i=s(17352);function r(t){const e=i.globalDocument.createElement("div");return e.textContent=t,e.innerHTML}},5232(t,e,s){"use strict";s.d(e,{f(){return r}});var i=s(55186);function r(t,e,s,r){if(r&&i.J.isElement(e)&&!0!==r[e.nodeName]){const t=e.attributes;if(t&&t.length){const i=[];for(let s=0;t.length>s;s+=1){const n=r[e.nodeName][t[s].name];(!n||!0!==n&&n!==t[s].value)&&i.push(t[s].name)}i.length&&(s=!0),i.forEach((t=>{e.removeAttribute(t)}))}}return s}},5298(t,e,s){"use strict";s.d(e,{W(){return n}});var i=s(17352),r=s(55186);function n(t,e,s){let n=r.J.findSibling(e,s),o=r.J.findSibling(e,!s);for(;r.J.isElement(n)&&!r.J.isTag(n,i.INSEPARABLE_TAGS)&&r.J.isContentEditable(n,t.editor)&&(!o||!r.J.closest(e,r.J.isElement,t.editor));)s||!n.firstChild?n.appendChild(e):r.J.before(n.firstChild,e),n=r.J.sibling(e,s),o=r.J.sibling(e,!s)}},5454(t,e,s){"use strict";s.d(e,{F(){return l}});var i,r=s(31635),n=s(22664),o=s(24767),a=s(69198);let l=i=class t extends a.t{className(){return"UITextArea"}createNativeInput(t){return this.j.create.element("textarea")}constructor(t,e){super(t,e),this.state={...i.defaultState},Object.assign(this.state,e),!1===this.state.resizable&&(this.nativeInput.style.resize="none")}onChangeStateSize(){const{size:t,resizable:e}=this.state;this.nativeInput.style.resize=e?"auto":"none",this.nativeInput.rows=t??5}};l.defaultState={...a.t.defaultState,size:5,resizable:!0},(0,r.Cg)([(0,n.watch)(["state.size","state.resizable"])],l.prototype,"onChangeStateSize",null),l=i=(0,r.Cg)([o.s],l)},5533(t,e,s){"use strict";s.d(e,{p(){return o}});var i=s(17352),r=s(65147),n=s(53380);class o extends n.F{constructor(){super(...arguments),this.className="jodit_ace_editor",this.proxyOnBlur=t=>{this.j.e.fire("blur",t)},this.proxyOnFocus=t=>{this.j.e.fire("focus",t)},this.proxyOnMouseDown=t=>{this.j.e.fire("mousedown",t)}}aceExists(){return void 0!==this.j.ow.ace}getLastColumnIndex(t){return this.instance.session.getLine(t).length}getLastColumnIndices(){const t=this.instance.session.getLength(),e=[];let s=0;for(let i=0;t>i;i++)s+=this.getLastColumnIndex(i),i>0&&(s+=1),e[i]=s;return e}getRowColumnIndices(t){const e=this.getLastColumnIndices();if(e[0]>=t)return{row:0,column:t};let s=1;for(let i=1;e.length>i;i++)t>e[i]&&(s=i+1);return{row:s,column:t-e[s-1]-1}}setSelectionRangeIndices(t,e){const s=this.getRowColumnIndices(t),i=this.getRowColumnIndices(e);this.instance.getSelection().setSelectionRange({start:s,end:i})}getIndexByRowColumn(t,e){return this.getLastColumnIndices()[t]-this.getLastColumnIndex(t)+e}init(t){const e=()=>{if(void 0!==this.instance||!this.aceExists())return;const e=this.j.c.div("jodit-source__mirror-fake");this.container.appendChild(e),this.instance=t.ow.ace.edit(e),"rtl"===t.o.direction&&(this.instance.setOption("rtlText",!0),this.instance.setOption("rtl",!0)),this.instance.setTheme(t.o.sourceEditorNativeOptions.theme),this.instance.renderer.setShowGutter(t.o.sourceEditorNativeOptions.showGutter),this.instance.getSession().setMode(t.o.sourceEditorNativeOptions.mode),this.instance.setHighlightActiveLine(t.o.sourceEditorNativeOptions.highlightActiveLine),this.instance.getSession().setUseWrapMode(!0),this.instance.setOption("indentedSoftWrap",!1),this.instance.setOption("wrap",t.o.sourceEditorNativeOptions.wrap),this.instance.getSession().setUseWorker(!1),this.instance.$blockScrolling=1/0,this.instance.on("change",this.toWYSIWYG),this.instance.on("focus",this.proxyOnFocus),this.instance.on("mousedown",this.proxyOnMouseDown),this.instance.on("blur",this.proxyOnBlur),t.getRealMode()!==i.MODE_WYSIWYG&&this.setValue(this.getValue());const s=this.j.async.throttle((()=>{if(t.isInDestruct||t.getMode()===i.MODE_WYSIWYG)return;const e=this.instance.isFocused();this.instance.setOption("maxLines","auto"!==t.o.height?t.workplace.offsetHeight/this.instance.renderer.lineHeight:1/0),this.instance.resize(),e&&this.focus()}),2*this.j.defaultTimeout);t.e.on(t,"resize",s).on("afterResize afterSetMode",s),s(),this.onReady()};t.e.on("afterSetMode",(()=>{t.getRealMode()!==i.MODE_SOURCE&&t.getMode()!==i.MODE_SPLIT||(this.fromWYSIWYG(),e())})),e(),this.aceExists()||(0,r.loadNext)(t,t.o.sourceEditorCDNUrlsJS).then((()=>{t.isInDestruct||e()})).catch((()=>null))}destruct(){this.instance.off("change",this.toWYSIWYG),this.instance.off("focus",this.proxyOnFocus),this.instance.off("mousedown",this.proxyOnMouseDown),this.instance.destroy(),this.j?.events?.off("aceInited.source")}setValue(t){if(!this.j.o.editHTMLDocumentMode&&this.j.o.beautifyHTML){const e=this.j.e.fire("beautifyHTML",t);(0,r.isString)(e)&&(t=e)}this.instance.setValue(t),this.instance.clearSelection()}getValue(){return this.instance.getValue()}setReadOnly(t){this.instance.setReadOnly(t)}get isFocused(){return this.instance.isFocused()}focus(){this.instance.container.focus(),this.instance.focus()}blur(){this.instance.blur()}getSelectionStart(){const t=this.instance.selection.getRange();return this.getIndexByRowColumn(t.start.row,t.start.column)}getSelectionEnd(){const t=this.instance.selection.getRange();return this.getIndexByRowColumn(t.end.row,t.end.column)}selectAll(){this.instance.selection.selectAll()}insertRaw(t){const e=this.instance.selection.getCursor(),s=this.instance.session.insert(e,t);this.instance.selection.setRange({start:e,end:s},!1)}setSelectionRange(t,e){this.setSelectionRangeIndices(t,e)}setPlaceHolder(t){}replaceUndoManager(){const{history:t}=this.jodit;this.instance.commands.addCommand({name:"Undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec(){t.undo()}}),this.instance.commands.addCommand({name:"Redo",bindKey:{win:"Ctrl-Shift-Z",mac:"Command-Shift-Z"},exec(){t.redo()}})}}},5549(t,e,s){"use strict";s.d(e,{U(){return l}});var i=s(26150),r=s(74260),n=s(33201),o=s(85079),a=s(17880);async function l(t,e){const{sourceImage:s,values:l}=e;return(0,r.g)(s,l),l.borderRadius=parseInt(s.style.borderRadius||"0",10)||0,l.id=(0,i.C)(s,"id")||"",l.imageTitle=(0,i.C)(s,"title")||"",l.imageAlt=(0,i.C)(s,"alt")||"",l.style=(0,i.C)(s,"style")||"",l.classes=((0,i.C)(s,"class")||"").replace(/jodit_focused_image[\s]*/,""),(0,o.E)(s,l,e),(0,n.X)(e,t,l),l.imageSrc=(0,i.C)(s,"src")||"",(0,a.P)(s,l,e)}},5832(t,e,s){"use strict";s.d(e,{IB(){return i.I},P1(){return r.P},q4(){return n.q}});var i=s(3258),r=s(49405),n=s(48053)},5854(t,e,s){"use strict";s.d(e,{F(){return l}});var i=s(55186),r=s(82317),n=s(69052),o=s(92032),a=s(58006);function l(t,e,s,l="jodit-dialog_alert"){(0,n.T)(e)&&(s=e,e=void 0);const c=this instanceof a.l?this:new a.l({closeOnClickOverlay:!0}),h=c.c.div(l),u=(0,o.$n)(c,"ok","Ok");return(0,r._)(t).forEach((t=>{h.appendChild(i.J.isNode(t)?t:c.c.fromHTML(t))})),u.onAction((()=>{s&&(0,n.T)(s)&&!1===s(c)||c.close()})),c.setFooter([u]),c.open(h,e||"&nbsp;",!0,!0),u.focus(),c}},5929(t,e,s){"use strict";var i=s(71842),r=s(56298),n=s(65147),o=s(59101),a=s(71005);class l extends a.k{afterInit(t){t.e.on("afterCommand.delete",(t=>{"delete"===t&&this.__afterDeleteCommand()})),t.registerCommand("delete",{exec:this.__onDeleteCommand.bind(this)},{stopPropagation:!1})}beforeDestruct(t){t.e.off("afterCommand.delete")}__afterDeleteCommand(){const t=this.j,e=t.s.current();if(e&&i.J.isTag(e.firstChild,"br")&&t.s.removeNode(e.firstChild),!((0,o.Bq)(t.editor.textContent||"")||t.editor.querySelector("img,table,jodit,iframe,hr")||e&&i.J.closest(e,"table",t.editor))){t.editor.innerHTML="";const e=t.s.setCursorIn(t.editor);t.s.removeNode(e)}}__onDeleteCommand(){const{jodit:t}=this;if(t.s.isCollapsed())return;t.s.expandSelection();const e=t.s.range;e.deleteContents();const s=t.createInside.fake();e.insertNode(s);const r=i.J.findSibling(s,!0),n=i.J.findSibling(s,!1);return this.__moveContentInLeftSibling(s,r,n),e.setStartBefore(s),e.collapse(!0),this.__moveCursorInEditableSibling(t,r,s,e),this.__addBrInEmptyBlock(s,n,e),i.J.safeRemove(s),t.s.selectRange(e),!1}__moveContentInLeftSibling(t,e,s){e=this.__defineRightLeftBox(e),!i.J.isList(s)&&!i.J.isTag(s,"table")&&i.J.isBlock(s)&&i.J.isBlock(e)&&(i.J.append(e,t),i.J.moveContent(s,e),i.J.safeRemove(s)),i.J.isList(s)&&i.J.isLeaf(s.firstElementChild)&&i.J.isEmpty(s.firstElementChild)&&i.J.safeRemove(s.firstElementChild)}__defineRightLeftBox(t){if(!i.J.isList(t))return t;let e=t.lastElementChild;return i.J.isLeaf(e)||(e=this.j.createInside.element("li"),i.J.append(t,e)),e}__addBrInEmptyBlock(t,e,s){const r=this.j;if(t.isConnected&&i.J.isBlock(t.parentNode)&&!t.nextSibling&&!t.previousSibling){const e=r.createInside.element("br");i.J.after(t,e),s.setStartBefore(e),s.collapse(!0)}if(i.J.isTag(e,"table")){const t=(0,n.$$)("td,th",e).shift();i.J.isCell(t)&&i.J.isEmpty(t)&&i.J.append(t,r.createInside.element("br"))}}__moveCursorInEditableSibling(t,e,s,r){if(!e||!i.J.isText(e)){const e=i.J.closest(s,i.J.isBlock,t.editor)??t.editor,n=i.J.prev(s,i.J.isText,e);n&&(r.setStartAfter(n),r.collapse(!0),i.J.safeRemove(s))}}}l.requires=["backspace"],r.fg.add("deleteCommand",l)},6110(t,e,s){"use strict";s.d(e,{l(){return o}});var i=s(17352),r=s(55186),n=s(641);function o(t,e,s){const o=!!r.J.closest(t,["pre","blockquote"],e.editor),l=!o&&r.J.closest(t,["td","th"],e.editor);if(e.o.enter.toLowerCase()===i.BR.toLowerCase()||l||s&&!o||!s&&o){if(o&&(t=>{const e=a(a(t));return!!e&&(r.J.safeRemove(a(t)),r.J.safeRemove(e),!0)})(t))return!1;const s=e.createInside.element("br");if(r.J.before(t,s),!r.J.findNotEmptySibling(s,!1)){const e=s.cloneNode();r.J.after(s,e),r.J.before(e,t)}return(0,n.$)(s,e.editor,e.ed),!0}return!1}function a(t){if(!t)return!1;const e=r.J.findSibling(t,!0);return!(!e||!r.J.isTag(e,"br"))&&e}},6295(t,e,s){"use strict";var i=s(26396);e.A=[{name:"bin",tooltip:"Delete",exec(t,e){e&&t.s.removeNode(e)}},i.M]},6455(t,e,s){"use strict";s.d(e,{U(){return h}});var i,r=s(31635),n=s(37474),o=s(22664),a=s(55186),l=s(65147),c=(s(28712),s(29780));let h=i=class t extends c.D{className(){return"UIGroup"}get allChildren(){const t=[],e=[...this.elements];for(;e.length;){const s=e.shift();(0,l.isArray)(s)?e.push(...s):n.u.isInstanceOf(s,i)?e.push(...s.elements):s&&t.push(s)}return t}update(){this.elements.forEach((t=>t.update())),this.setMod("size",this.buttonSize)}append(t,e){return(0,l.isArray)(t)?(t.forEach((t=>this.append(t,e))),this):(this.elements.push(t),t.name&&t.container.classList.add(this.getFullElName(t.name)),e?this.getElm(e).appendChild(t.container):this.appendChildToContainer(t.container),t.parentElement=this,this)}afterSetMod(t,e){this.syncMod&&this.elements.forEach((s=>s.setMod(t,e)))}appendChildToContainer(t){this.container.appendChild(t)}remove(t){const e=this.elements.indexOf(t);return-1!==e&&(this.elements.splice(e,1),a.J.safeRemove(t.container),t.parentElement=null),this}clear(){return this.elements.forEach((t=>t.destruct())),this.elements.length=0,this}constructor(t,e,s){super(t,s),this.options=s,this.syncMod=!1,this.elements=[],this.buttonSize="middle",e?.forEach((t=>t&&this.append(t))),s?.name&&(this.name=s.name)}destruct(){return this.clear(),super.destruct()}};(0,r.Cg)([(0,o.watch)("buttonSize")],h.prototype,"update",null),h=i=(0,r.Cg)([o.component],h)},6589(t,e,s){"use strict";s.d(e,{As(){return a.A},Bq(){return l.Bq},Gd(){return l.Gd},Hp(){return r.H},N(){return o.N},Ru(){return n.R},Z2(){return c.Z},gj(){return l.gj},kW(){return o.k},nv(){return n.n},xQ(){return i.x}});var i=s(83260),r=s(67975),n=s(91093),o=s(449),a=s(28616),l=s(59101),c=s(10467)},6857(t,e,s){"use strict";var i=s(31635),r=s(17352),n=s(22664),o=s(55186),a=s(56298),l=s(65147),c=s(29866);s(69505);const h="__jodit-resizer_binded";class u extends c.k{constructor(){super(...arguments),this.LOCK_KEY="resizer",this.element=null,this.isResizeMode=!1,this.isShown=!1,this.startX=0,this.startY=0,this.width=0,this.height=0,this.ratio=0,this.rect=this.j.c.fromHTML(`<div title="${this.j.i18n("Press Alt for custom resizing")}" class="jodit-resizer">\n\t\t\t\t<div class="jodit-resizer__top-left"></div>\n\t\t\t\t<div class="jodit-resizer__top-right"></div>\n\t\t\t\t<div class="jodit-resizer__bottom-right"></div>\n\t\t\t\t<div class="jodit-resizer__bottom-left"></div>\n\t\t\t\t<span>100x100</span>\n\t\t\t</div>`),this.sizeViewer=this.rect.getElementsByTagName("span")[0],this.pointerX=0,this.pointerY=0,this.isAltMode=!1,this.onClickElement=t=>{this.isResizeMode||this.element===t&&this.isShown||(this.element=t,this.show(),o.J.isTag(this.element,"img")&&!this.element.complete&&this.j.e.one(this.element,"load",this.updateSize))},this.updateSize=()=>{if(!this.isInDestruct&&this.isShown&&this.element&&this.rect){const t=this.getWorkplacePosition(),e=(0,l.offset)(this.element,this.j,this.j.ed),s=parseInt(this.rect.style.left||"0",10),i=e.top-t.top,r=e.left-t.left;parseInt(this.rect.style.top||"0",10)===i&&s===r&&this.rect.offsetWidth===this.element.offsetWidth&&this.rect.offsetHeight===this.element.offsetHeight||((0,l.css)(this.rect,{top:i,left:r,width:this.element.offsetWidth,height:this.element.offsetHeight}),this.j.events&&(this.j.e.fire(this.element,"changesize"),isNaN(s)||this.j.e.fire("resize")))}},this.hideSizeViewer=()=>{this.sizeViewer.style.opacity="0"}}afterInit(t){(0,l.$$)("div",this.rect).forEach((e=>{t.e.on(e,"mousedown.resizer touchstart.resizer",this.onStartResizing.bind(this,e))})),a.RR.on("hideHelpers",this.hide),t.e.on("readonly",(t=>{t&&this.hide()})).on("afterInit changePlace",this.addEventListeners.bind(this)).on("afterGetValueFromEditor.resizer",(t=>{const e=/<jodit[^>]+data-jodit_iframe_wrapper[^>]+>(.*?<iframe[^>]*>.*?<\/iframe>.*?)<\/jodit>/gi;e.test(t.value)&&(t.value=t.value.replace(e,"$1"))})),this.addEventListeners(),this.__onChangeEditor()}onEditorClick(t){let e=t.target;const{editor:s,options:{allowResizeTags:i}}=this.j;for(;e&&e!==s;){if(o.J.isTag(e,i))return this.__bind(e),void this.onClickElement(e);e=e.parentNode}}__afterInsertImage(t){if(this.j.o.resizer.forImageChangeAttributes)return;const e=(0,l.attr)(t,"width");e&&!(0,l.css)(t,"width",!0)&&((0,l.css)(t,"width",e),(0,l.attr)(t,"width",null))}addEventListeners(){const t=this.j;t.e.off(t.editor,".resizer").off(t.ow,".resizer").on(t.editor,"keydown.resizer",(t=>{this.isShown&&t.key===r.KEY_DELETE&&this.element&&!o.J.isTag(this.element,"table")&&this.onDelete(t)})).on(t.ow,"resize.resizer",this.updateSize).on("resize.resizer",this.updateSize).on([t.ow,t.editor],"scroll.resizer",(()=>{this.isShown&&!this.isResizeMode&&this.hide()})).on(t.ow,"keydown.resizer",this.onKeyDown).on(t.ow,"keyup.resizer",this.onKeyUp).on(t.ow,"mouseup.resizer touchend.resizer",this.onClickOutside)}onStartResizing(t,e){if(!this.element||!this.element.parentNode)return this.hide(),!1;this.handle=t,e.cancelable&&e.preventDefault(),e.stopImmediatePropagation(),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.ratio=this.width/this.height,this.isResizeMode=!0,this.startX=e.clientX,this.startY=e.clientY,this.pointerX=e.clientX,this.pointerY=e.clientY;const{j:s}=this;s.e.fire("hidePopup"),s.lock(this.LOCK_KEY),s.e.on(s.ow,"mousemove.resizer touchmove.resizer",this.onResize)}onEndResizing(){const{j:t}=this;t.unlock(),this.isResizeMode=!1,this.isAltMode=!1,t.synchronizeValues(),t.e.off(t.ow,"mousemove.resizer touchmove.resizer",this.onResize)}onResize(t){if(this.isResizeMode){if(!this.element)return;let e,s;if(this.pointerX=t.clientX,this.pointerY=t.clientY,this.j.options.iframe){const i=this.getWorkplacePosition();e=t.clientX+i.left-this.startX,s=t.clientY+i.top-this.startY}else e=this.pointerX-this.startX,s=this.pointerY-this.startY;const i=this.handle.className;let r=0,n=0;const a=this.j.o.resizer.useAspectRatio;!this.isAltMode&&(!0===a||a&&o.J.isTag(this.element,a))?(e?(r=this.width+(i.match(/left/)?-1:1)*e,n=Math.round(r/this.ratio)):(n=this.height+(i.match(/top/)?-1:1)*s,r=Math.round(n*this.ratio)),r>(0,l.innerWidth)(this.j.editor,this.j.ow)&&(r=(0,l.innerWidth)(this.j.editor,this.j.ow),n=Math.round(r/this.ratio))):(r=this.width+(i.match(/left/)?-1:1)*e,n=this.height+(i.match(/top/)?-1:1)*s),r>this.j.o.resizer.min_width&&this.applySize(this.element,"width",this.rect.p