jodit-pro
Version:
PRO Version of Jodit Editor
8 lines • 1.33 MB
JavaScript
/*!
* jodit-pro - PRO Version of Jodit Editor
* Author: Chupurnov Valerii <chupurnov@gmail.com>
* Version: v4.9.27
* Url: https://xdsoft.net/jodit/pro/
* License(s): SEE LICENSE IN LICENSE.md
*/
!function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i();else if("function"==typeof define&&define.amd)define([],i);else{var n=i();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,function(){var t={117:function(t,i,n){"use strict";n.d(i,{askInsertTypeDialog:function(){return u},getAllTypes:function(){return c},pasteInsertHtml:function(){return l}});var o=n(82758),r=n(2748),s=n(27613),a=n(10830);function l(t,i,n){var o;let a,l;if(i.isInDestruct)return;t&&"drop"===t.type&&i.s.insertCursorAtPoint(t.clientX,t.clientY);let c=i.e.fire("beforePasteInsert",n);!(0,s.isVoid)(c)&&((0,s.isString)(c)||(0,s.isNumber)(c)||r.Dom.isNode(c))&&(n=c),(0,s.isString)(n)&&(-1!==(a=(o=(o=n).replace(/<meta[^>]+?>/g,"")).search(/<!--StartFragment-->/i))&&(o=o.substring(a+20)),-1!==(l=o.search(/<!--EndFragment-->/i))&&(o=o.substring(0,l)),n=o),i.s.insertHTML(n)}function c(t){let i=t.types,n="";if((0,s.isArray)(i)||"[object DOMStringList]"===({}).toString.call(i))for(let t=0;t<i.length;t+=1)n+=i[t]+";";else n=(i||o.TEXT_PLAIN).toString()+";";return n}function u(t,i,n,o,r){if(!1===t.e.fire("beforeOpenPasteDialog",i,n,o,r))return;let s=t.confirm(`<div style="word-break: normal; white-space: normal">${t.i18n(i)}</div>`,t.i18n(n)),l=r.map(({text:i,value:n})=>(0,a.Button)(t,{text:i,name:i.toLowerCase(),tabIndex:0}).onAction(()=>{s.close(),o(n)}));s.e.one(s,"afterClose",()=>{t.s.isFocused()||t.s.focus()});let c=(0,a.Button)(t,{text:"Cancel",tabIndex:0}).onAction(()=>{s.close()});return s.setFooter([...l,c]),l[0].focus(),l[0].state.variant="primary",t.e.fire("afterOpenPasteDialog",s,i,n,o,r),s}},159:function(t,i,n){"use strict";n.d(i,{FileBrowserItem:function(){return r}});var o=n(21537);class r{static create(t){return t instanceof r?t:new r(t)}get path(){return(0,o.normalizePath)(this.data.source.path?this.data.source.path+"/":"/")}get imageURL(){let t=this.time||new Date().getTime().toString(),{thumbIsAbsolute:i,source:n,thumb:r,file:s}=this.data,a=r||s;return i&&a?a:(0,o.normalizeUrl)(n.baseurl,n.path,a||"")+"?_tmst="+encodeURIComponent(t)}get fileURL(){let{name:t}=this.data,{file:i,fileIsAbsolute:n,source:r}=this.data;return void 0!==i&&(t=i),n&&t?t:(0,o.normalizeUrl)(r.baseurl,r.path,t||"")}get time(){let{changed:t}=this.data;return t&&("number"==typeof t?new Date(t).toLocaleString():t)||""}get uniqueHashKey(){let t=this.data;return[t.sourceName,t.name,t.file,this.time,t.thumb].join("_").toLowerCase().replace(/[^0-9a-z\-.]/g,"-")}toJSON(){return this.data}constructor(t){this.data=t,Object.keys(t).forEach(i=>{this[i]=t[i]})}}},302:function(t,i,n){"use strict";n.d(i,{getKey:function(){return r}});var o=n(2748);let r=(t,i)=>`${o.Dom.isCell(i)?"padding":"margin"}${"rtl"===t?"Right":"Left"}`},384:function(t,i,n){"use strict";n.d(i,{sanitizeAttributes:function(){return s}});var o=n(2748),r=n(21537);function s(t,i,n){return!!(o.Dom.isElement(i)&&(0,r.sanitizeHTMLElement)(i,{safeJavaScriptLink:t.options.cleanHTML.safeJavaScriptLink,removeOnError:t.options.cleanHTML.removeOnError}))||n}},445:function(t,i){"use strict";i.default='<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox="0 0 1792 1792"> <path d="M1792 1344v128q0 26-19 45t-45 19h-1664q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h1664q26 0 45 19t19 45zm0-384v128q0 26-19 45t-45 19h-1280q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h1280q26 0 45 19t19 45zm0-384v128q0 26-19 45t-45 19h-1536q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h1536q26 0 45 19t19 45zm0-384v128q0 26-19 45t-45 19h-1152q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h1152q26 0 45 19t19 45z"/> </svg> '},473:function(t,i,n){"use strict";n.d(i,{handleBackToList:function(){return c},handleConversationSearch:function(){return u},handleConversationSelect:function(){return l},handleToolApproval:function(){return s},handleToolDenial:function(){return a}});var o=n(79078),r=n(82758);async function s(t,i,n,o,r){let s=n.getPendingToolCalls().find(i=>i.id===t);if(!s)return null;let a=o.grantPermission(s.name,i),l=n.getCurrentConversation();return l&&(l.permissions.push(a),await r.save(l)),n.removePendingToolCall(t),{...s,status:"approved"}}async function a(t,i,n,r){let s=n.getPendingToolCalls().find(t=>t.id===i);if(!s)return;let a=n.getCurrentConversation();if(!a)return;let l=a.messages.findIndex(t=>t.toolCalls?.find(t=>t.id===i));if(-1===l)return;let c=a.messages[l],u={...s,result:{error:"Tool call denied by user."},status:"denied"},d=(0,o.updateToolCallInMessage)(c,u),h=[...a.messages];h[l]=d,a={...a,messages:h,updated:Date.now()},n.setCurrentConversation(a),await r.save(a),t.e.fire("toolCallDenied.ai-assistant-pro",s),n.removePendingToolCall(i)}async function l(t,i,n){try{n.setLoading(!0);let o=await i.get(t);if(!o)throw Error("Conversation not found: "+t);n.setCurrentConversation({...o})}catch(t){r.IS_PROD}finally{n.setLoading(!1)}}async function c(t,i){i.setView("conversationList");try{i.setLoading(!0);let n=await t.list().catch(()=>[]);i.setConversations(n)}finally{i.setLoading(!1)}}async function u(t,i,n){n.setLoading(!0);try{let o=await i.list(t||void 0);n.setConversations(o),n.setView("conversationList")}finally{n.setLoading(!1)}}},482:function(t,i,n){"use strict";var o=n(82749),r=n(31635);n(55029),n(99413);var s=n(17298),a=n(61818),l=n(67912),c=n(92931),u=n(65805),d=n(4774),h=n(82758),p=n(65478),f=n(21537),m=n(50911),g=n(62843),b=n(78584),v=n(92762),y=n(2692);window.JoditGoogleReadyHandler=l.GoogleReadyHandler;class w extends m.Plugin{className(){return"google-maps"}afterInit(t){t.registerCommand(s.COMMAND_OPEN_DIALOG,()=>{this.openMapEditor(null,{})})}beforeDestruct(t){}onOpenOnDblClick(t){if(t.dataset.googleMaps){let i;try{i=JSON.parse(this.j.ow.atob(t.dataset.googleMaps))}catch{}return this.openMapEditor(t,i),!1}}async openMapEditor(t,i){let n=this.j,o=this.getDialog(),r=this.j.o.googleMaps.saveStateInStorage?o.storage.get(s.STORAGE_KEY):void 0,{apiUrl:a}=this.jodit.o.googleMaps;(0,l.isApiAvailable)()||(0,f.appendScriptAsync)(this.jodit,a.replace(/\${([^}]+)}/g,(t,i)=>this.get(i)??""));let p={type:this.j.o.googleMaps.map.type,layer:this.j.o.googleMaps.map.layer,size:this.j.o.googleMaps.map.size,...r,...i},m=new d.UIMap(o,p,this.j.options);m.container.classList.add(o.getFullElName("map"));let b=new u.UIComboBox(n,{icon:"search",placeholder:"Search",clearButton:!0}).setMod("in-header",!0);b.container.classList.add(o.getFullElName("search")),this.j.async.promise(t=>{if((0,l.isApiAvailable)())return void t(0);let i=()=>{(0,l.isApiAvailable)()?t(0):this.j.async.setTimeout(i,100)};i(),(0,l.googleReady)(t)}).then(()=>{m.setStatus("ready"),b.setStatus("ready")}),this.j.e.on(b,"select",(t,i)=>{i?m.map.fitBounds(i):t&&(m.state.center=[t.lat(),t.lng()])}),r||("auto"===this.j.o.googleMaps.map.center?navigator.geolocation.getCurrentPosition(t=>{m.state.center=[t.coords.latitude,t.coords.longitude]},()=>{m.state.center=this.j.o.googleMaps.map.defaultCenter}):m.state.center=this.j.o.googleMaps.map.center),o.setSize(...n.o.googleMaps.dialog.size).setHeader([b," ",(0,g.Button)(n,"eye").onAction(()=>{let t=this.jodit.createInside.element("img");t.src=(0,c.staticUrl)(m),t.dataset.googleMaps=btoa(m.json());let i={value:t.outerHTML};this.onAfterGetValueFromEditor(i),n.execCommand("preview",null,i.value)})]).setContent((0,v.TabsWidget)(n,[{name:"Map",icon:"map",content:m},{name:"Settings",content:new d.UIMapsPropsForm(n,m.state)},{name:"Controls",icon:"menu",content:new d.UIMapsControlsForm(n,m.state)}])).setFooter([(0,g.Button)(n,"cancel","Cancel","default").onAction(()=>o.close()),(0,g.Button)(n,"ok",t?"Save":"Insert","primary").onAction(()=>{m.destruct(),b.destruct(),o.e.off("beforeClose",y),o.close(),this.insertMap(t,m)})]).open();let y=()=>{if(m.state.elements.length&&JSON.stringify(m.state.elements)!==JSON.stringify(p.elements)&&!h.IS_TEST&&!confirm(this.i18n("Are you sure?")))return!1;m.destruct(),b.destruct(),o.e.off("beforeClose",y)};o.e.on("beforeClose",y)}getDialog(){if(!this.dialog){let t=new b.Dialog({language:this.j.o.language});t.container.classList.add(this.getFullElName("")),this.dialog=t}return this.dialog}insertMap(t,i){let n=t??this.jodit.createInside.element("img");n.src=(0,c.staticUrl)(i),n.dataset.googleMaps=btoa(i.json()),t||this.jodit.s.insertImage(n)}onBeforeSetNativeEditorValue(t){t.value=t.value.replace(/<script[^>]+jodit-google-maps-init[^>]+>.*?<\/script>/gs,"")}onAfterGetValueFromEditor(t,i){this.j.o.googleMaps.useStaticImage||i===h.SOURCE_CONSUMER||(t.value=t.value.replace(/(<img[^>]+)(["']?)data-google-maps\2\s*=(["'])([^"']+)\3([^>]*>)/gs,(t,i,n,o,r,s)=>{let l={};try{l=JSON.parse(this.j.ow.atob(r))}catch{}return`${i} id="${l.uid}" ${n}data-google-maps${n}=${o}${r}${o}${s}${(0,a.generateJSScript)(this.j,l)}`}))}constructor(...t){super(...t),(0,o._)(this,"buttons",[{group:"media",name:"googleMaps"}]),(0,o._)(this,"dialog",null)}}(0,o._)(w,"requires",["license","color-picker"]),(0,r.__decorate)([(0,p.watch)("?:openOnDblClick")],w.prototype,"onOpenOnDblClick",null),(0,r.__decorate)([(0,p.watch)(":beforeSetNativeEditorValue")],w.prototype,"onBeforeSetNativeEditorValue",null),(0,r.__decorate)([(0,p.watch)(":afterGetValueFromEditor")],w.prototype,"onAfterGetValueFromEditor",null),y.JoditPro.plugins.add("google-maps",w)},575:function(t,i,n){"use strict";var o=n(82758),r=n(65478),s=n(2748),a=n(580),l=n(87612),c=n(20356),u=n(35399);class d extends c.Plugin{afterInit(t){let i=t.o.enter.toLowerCase(),n=i===o.BR.toLowerCase();t.o.enterBlock||(t.o.enterBlock=n?o.PARAGRAPH:i),t.registerCommand("enter",(t,i,n={})=>this.onEnter(n))}onEnterKeyDown(t){if(t.key===o.KEY_ENTER){let i=this.j,n=i.e.fire("beforeEnter",t);return void 0!==n?n:(i.s.isCollapsed()||i.execCommand("Delete"),i.s.focus(),this.onEnter(t),i.e.fire("afterEnter",t),i.synchronizeValues(),!1)}}onEnter(t){let{jodit:i}=this,n=i.createInside.fake();try{s.Dom.safeInsertNode(i.s.range,n),(0,u.moveCursorOutFromSpecialTags)(i,n,["a"]);let o=(0,u.getBlockWrapper)(n,i),r=s.Dom.isLeaf(o);if((!r||(null==t?void 0:t.shiftKey))&&(0,u.checkBR)(n,i,null==t?void 0:t.shiftKey))return!1;if(o||(0,u.hasPreviousBlock)(n,i)||(o=(0,u.wrapText)(n,i)),!o)return(0,u.insertParagraph)(n,i,r?"li":i.o.enter),!1;if(!(0,u.checkUnsplittableBox)(n,i,o))return!1;if(r&&this.__isEmptyListLeaf(o))return(0,u.processEmptyLILeaf)(n,i,o),!1;(0,u.splitFragment)(n,i,o)}finally{n.isConnected&&i.s.setCursorBefore(n),s.Dom.safeRemove(n)}}__isEmptyListLeaf(t){let i=this.j.e.fire("enterIsEmptyListLeaf",t);return(0,l.isBoolean)(i)?i:s.Dom.isEmpty(t)}beforeDestruct(t){t.e.off("keydown.enter")}}!function(t,i,n,o){var r,s=arguments.length,a=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,n,o);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(s<3?r(a):s>3?r(i,n,a):r(i,n))||a);s>3&&a&&Object.defineProperty(i,n,a)}([(0,r.watch)(":keydown.enter")],d.prototype,"onEnterKeyDown",null),a.pluginSystem.add("enter",d)},580:function(t,i,n){"use strict";n.d(i,{eventEmitter:function(){return S},extendLang:function(){return w},getContainer:function(){return C},getPopupViewRoot:function(){return k},instances:function(){return f},modules:function(){return y},pluginSystem:function(){return v},uniqueUid:function(){return b}});var o=n(19306),r=n(70799),s=n(39955),a=n(12475),l=n(41180),c=n(80568),u=n(41876),d=n(57012),h=n(82758),p=n(22732);let f={},m=1,g=new Set;function b(){function t(){return Math.round(m+=10*(Math.random()+1)).toString(16)}let i=t();for(;g.has(i);)i=t();return g.add(i),i}let v=new u.PluginSystem({getContainer:C}),y={},w=t=>{Object.keys(t).forEach(i=>{h.lang[i]?Object.assign(h.lang[i],t[i]):h.lang[i]=t[i]})},_=new WeakMap;function C(t,i,n="div",l=!1){let u=(0,r.isString)(i)?i:i?(0,c.getClassName)(i.prototype):"jodit-utils",d=_.get(t)||{},h=u+n,f=(0,s.isViewObject)(t)?t:t.j,m=null;if(!d[h]){let i=f.c;if(m=k(f.o,f.container,t.od.body),l&&(0,o.isJoditObject)(t)&&t.od!==t.ed){i=t.createInside;let r="style"===n?t.ed.head:t.ed.body;m=(0,o.isJoditObject)(t)&&t.o.shadowRoot?t.o.shadowRoot:r}let r=i.element(n,{className:`jodit jodit-${(0,a.kebabCase)(u)}-container jodit-box`});r.classList.add("jodit_theme_"+(f.o.theme||"default")),m.appendChild(r),d[h]=r,t.hookStatus("beforeDestruct",()=>{f.events.off(r),p.Dom.safeRemove(r),delete d[h],Object.keys(d).length&&_.delete(t)}),_.set(t,d),f.events.fire("getContainer",r)}return d[h].classList.remove("jodit_theme_default","jodit_theme_dark"),d[h].classList.add("jodit_theme_"+(f.o.theme||"default")),d[h]}function k(t,i,n){var o,r,s;return null!=(s=null!=(r=null!=(o=t.popupRoot)?o:t.shadowRoot)?r:p.Dom.closest(i,t=>p.Dom.isHTMLElement(t)&&(p.Dom.isTag(t,"dialog")||["fixed","absolute"].includes((0,l.css)(t,"position"))),n))?s:n}let S=d.eventEmitter},638:function(t,i,n){"use strict";n.d(i,{Alert:function(){return o.Alert},Confirm:function(){return r.Confirm},Dialog:function(){return s.Dialog},Prompt:function(){return a.Prompt}});var o=n(71568),r=n(26866),s=n(78584),a=n(36806)},757:function(t,i,n){"use strict";var o=n(6441);o.Config.prototype.mediaFakeTag="jodit-media",o.Config.prototype.mediaInFakeBlock=!0,o.Config.prototype.mediaBlocks=["video","audio"]},767:function(t,i,n){"use strict";var o=n(82758),r=n(65478),s=n(580),a=n(50911);n(66288);var l=n(47686),c=function(t,i,n,o){var r,s=arguments.length,a=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,n,o);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(s<3?r(a):s>3?r(i,n,a):r(i,n))||a);return s>3&&a&&Object.defineProperty(i,n,a),a};class u extends a.Plugin{afterInit(t){}__onTab(t){if(t.key===o.KEY_TAB&&this.__onShift(t.shiftKey))return!1}__onCommand(t){if(("indent"===t||"outdent"===t)&&this.__onShift("outdent"===t))return!1}__onShift(t){let i=(0,l.onTabInsideLi)(this.j,t);return i&&this.j.e.fire("afterTab",t),i}beforeDestruct(t){}}c([(0,r.watch)(":keydown.tab")],u.prototype,"__onTab",null),c([(0,r.watch)(":beforeCommand.tab")],u.prototype,"__onCommand",null),s.pluginSystem.add("tab",u)},820:function(t,i){"use strict";i.default='<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox="0 0 1792 1792"> <path d="M747 1521q74 32 140 32 376 0 376-335 0-114-41-180-27-44-61.5-74t-67.5-46.5-80.5-25-84-10.5-94.5-2q-73 0-101 10 0 53-.5 159t-.5 158q0 8-1 67.5t-.5 96.5 4.5 83.5 12 66.5zm-14-746q42 7 109 7 82 0 143-13t110-44.5 74.5-89.5 25.5-142q0-70-29-122.5t-79-82-108-43.5-124-14q-50 0-130 13 0 50 4 151t4 152q0 27-.5 80t-.5 79q0 46 1 69zm-541 889l2-94q15-4 85-16t106-27q7-12 12.5-27t8.5-33.5 5.5-32.5 3-37.5.5-34v-65.5q0-982-22-1025-4-8-22-14.5t-44.5-11-49.5-7-48.5-4.5-30.5-3l-4-83q98-2 340-11.5t373-9.5q23 0 68.5.5t67.5.5q70 0 136.5 13t128.5 42 108 71 74 104.5 28 137.5q0 52-16.5 95.5t-39 72-64.5 57.5-73 45-84 40q154 35 256.5 134t102.5 248q0 100-35 179.5t-93.5 130.5-138 85.5-163.5 48.5-176 14q-44 0-132-3t-132-3q-106 0-307 11t-231 12z"/> </svg> '},1050:function(t,i,n){"use strict";var o=n(82749),r=n(31635);n(88092);var s=n(29744),a=n(65478),l=n(22732),c=n(21537),u=n(50911),d=n(62843),h=n(41409),p=n(2692);class f extends u.Plugin{afterInit(t){t.e.on("toggleIframeEditor",this.toggleEditor)}toggleEditor(t){this.__dialog||(this.__dialog=new h.Dialog({language:this.j.o.language,theme:this.j.o.theme}),this.__dialog.setHeader("Iframe Properties").setSize(470,400)),t&&!l.Dom.isTag(t,"iframe")&&(t=void 0);let i=new s.UIIframeEditor(this.__dialog,{src:t?.src??"",name:t?.name??"",title:t?.title??"",frameBorder:t?.frameBorder==="1"||t?.frameBorder==="yes",width:t?.offsetWidth??700,height:t?.offsetHeight??400});this.__dialog.setContent(i);let n=this.__dialog;n.isOpened?n.close():(n.setFooter([(0,d.Button)(n,"cancel","Cancel","default").onAction(()=>n.close()),(0,d.Button)(n,"ok",t?"Update":"Insert","primary").onAction(()=>{if(!i.srcField.value){i.srcField.validate(),i.srcField.focus();return}t||(t=this.j.createInside.element("iframe"),this.j.s.insertNode(t,!0,!1)),t.className=i.state.className||"",(0,c.attr)(t,{src:i.state.src,title:i.state.title,name:i.state.name,frameborder:i.state.frameBorder?"1":"0",width:i.state.width,height:i.state.height}),l.Dom.isTag(t.parentElement,"jodit")&&(0,c.css)(t.parentElement,{width:i.state.width,height:i.state.height}),this.jodit.e.fire("synchro"),n.close()})]).open(),this.jodit.async.requestIdleCallback(()=>{i.srcField.focus()}))}onDblClick(t){l.Dom.isTag(t.target,"iframe")&&this.toggleEditor(t.target)}beforeDestruct(t){this.__dialog?.destruct()}constructor(...t){super(...t),(0,o._)(this,"buttons",[{group:"form",name:"iframeEditor"}]),(0,o._)(this,"__dialog",void 0)}}(0,o._)(f,"requires",["license","color-picker"]),(0,r.__decorate)([a.autobind],f.prototype,"toggleEditor",null),(0,r.__decorate)([(0,a.watch)(":dblclick")],f.prototype,"onDblClick",null),p.JoditPro.plugins.add("iframe-editor",f)},1115:function(t,i,n){"use strict";n.r(i),i.default={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"Ääni","Interim Results":"Välitulokset"}},1172:function(t,i){"use strict";i.default={"copy-format":"复制格式"}},1255:function(t,i,n){"use strict";var o,r,s=n(65478),a=n(22732),l=n(580),c=n(21537),u=n(50911);n(44586);var d=function(t,i,n,o){var r,s=arguments.length,a=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,n,o);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(s<3?r(a):s>3?r(i,n,a):r(i,n))||a);return s>3&&a&&Object.defineProperty(i,n,a),a};(o=r||(r={}))[o.IDLE=0]="IDLE",o[o.WAIT_DRAGGING=1]="WAIT_DRAGGING",o[o.DRAGGING=2]="DRAGGING";class h extends u.Plugin{afterInit(){this.dragList=this.j.o.draggableTags?(0,c.splitArray)(this.j.o.draggableTags).filter(Boolean).map(t=>t.toLowerCase()):[],this.dragList.length&&this.j.e.on("mousedown dragstart",this.onDragStart)}onDragStart(t){if("dragstart"===t.type&&this.draggable)return!1;if(this.state>r.IDLE)return;let i=t.target;if(!this.dragList.length||!i)return;let n=t=>!!(t&&this.dragList.includes(t.nodeName.toLowerCase())),o=a.Dom.furthest(i,n,this.j.editor)||(n(i)?i:null);o&&(a.Dom.isTag(o.parentElement,"a")&&o.parentElement.firstChild===o&&o.parentElement.lastChild===o&&(o=o.parentElement),this.startX=t.clientX,this.startY=t.clientY,this.isCopyMode=(0,c.ctrlKey)(t),this.draggable=o.cloneNode(!0),(0,c.dataBind)(this.draggable,"target",o),this.state=r.WAIT_DRAGGING,this.addDragListeners())}onDrag(t){var i,n;if(!this.draggable||this.state===r.IDLE)return;let o=t.clientX,s=t.clientY;if(!(this.state===r.WAIT_DRAGGING&&Math.sqrt(Math.pow(o-this.startX,2)+Math.pow(s-this.startY,2))<this.diffStep)){if(this.state===r.WAIT_DRAGGING&&(this.j.lock("drag-and-drop-element"),this.state=r.DRAGGING),this.j.e.fire("hidePopup hideResizer"),!this.draggable.parentNode){let o=(0,c.dataBind)(this.draggable,"target");(0,c.css)(this.draggable,{zIndex:1e13,pointerEvents:"none",pointer:"drag",position:"fixed",opacity:.7,display:"inline-block",left:t.clientX,top:t.clientY,width:null!=(i=null==o?void 0:o.offsetWidth)?i:100,height:null!=(n=null==o?void 0:o.offsetHeight)?n:100}),(0,l.getContainer)(this.j,h).appendChild(this.draggable)}(0,c.css)(this.draggable,{left:t.clientX,top:t.clientY}),this.j.s.insertCursorAtPoint(t.clientX,t.clientY)}}onDragEnd(){!this.isInDestruct&&(this.removeDragListeners(),this.j.unlock(),this.state=r.IDLE,this.draggable&&(a.Dom.safeRemove(this.draggable),this.draggable=null))}onDrop(){if(!this.draggable||this.state<r.DRAGGING)return void this.onDragEnd();let t=(0,c.dataBind)(this.draggable,"target");this.onDragEnd(),this.isCopyMode&&(t=t.cloneNode(!0));let{parentElement:i}=t;this.j.s.insertNode(t,!0,!1),i&&a.Dom.isEmpty(i)&&!a.Dom.isCell(i)&&a.Dom.safeRemove(i),a.Dom.isTag(t,"img")&&this.j.e&&this.j.e.fire("afterInsertImage",t),this.j.e.fire("synchro")}addDragListeners(){this.j.e.on(this.j.editor,"mousemove",this.onDrag).on("mouseup",this.onDrop).on([this.j.ew,this.ow],"mouseup",this.onDragEnd)}removeDragListeners(){this.j.e.off(this.j.editor,"mousemove",this.onDrag).off("mouseup",this.onDrop).off([this.j.ew,this.ow],"mouseup",this.onDragEnd)}beforeDestruct(){this.onDragEnd(),this.j.e.off("mousedown dragstart",this.onDragStart),this.removeDragListeners()}constructor(){super(...arguments),this.dragList=[],this.draggable=null,this.isCopyMode=!1,this.diffStep=10,this.startX=0,this.startY=0,this.state=r.IDLE}}d([s.autobind],h.prototype,"onDragStart",null),d([(0,s.throttle)(t=>t.defaultTimeout/10)],h.prototype,"onDrag",null),d([s.autobind],h.prototype,"onDragEnd",null),d([s.autobind],h.prototype,"onDrop",null),l.pluginSystem.add("dragAndDropElement",h)},1322:function(t,i,n){"use strict";n.r(i),i.default={Spellcheck:"Stavekontroll"}},1475:function(t,i,n){"use strict";n.d(i,{initOrUpdateElementFromState:function(){return u}});var o=n(53454),r=n(11079),s=n(72690),a=n(580),l=n(12153),c=n(67912);function u(t,i){let n,u=this.mapElements[i];if(u){if(u.state.type===t.type)return s.updateStateAndGme.call(this,t,i);u.gme.setMap(null)}switch(t.type){case"text":n=new google.maps.Marker({position:new google.maps.LatLng(t.coordinates[0],t.coordinates[1]),draggable:!0,title:t.text,map:this.map});break;case"marker":n=new google.maps.Marker({position:new google.maps.LatLng(t.coordinates[0],t.coordinates[1]),draggable:!0,label:t.showCaption?t.title:"",title:t.title,icon:t.icon?l.Icon.get(t.icon):void 0,map:this.map});break;case"polyline":case"polygon":{let i=(0,c.arrayToPath)(t.coordinates);n=new google.maps["polygon"===t.type?"Polygon":"Polyline"]({path:i,strokeColor:t.strokeColor,fillColor:t.fillColor,strokeWeight:t.strokeWeight,editable:!0,draggable:!0,map:this.map,fillOpacity:"polygon"===t.type?t.fillOpacity:1})}break;case"circle":n=new google.maps.Circle({center:new google.maps.LatLng(t.coordinates[0],t.coordinates[1]),radius:t.radius,strokeColor:t.strokeColor,fillColor:t.fillColor,strokeWeight:t.strokeWeight,editable:!0,draggable:!0,map:this.map,fillOpacity:t.fillOpacity??1})}let d={type:t.type,uid:(0,a.uniqueUid)(),state:t,gme:n};"dragend radius_changed center_changed".split(" ").forEach(t=>n.addListener(t,()=>o.onChangeGeometries.call(this,d,i))),("polygon"===d.type||"polyline"===d.type)&&"insert_at set_at remove_at".split(" ").forEach(t=>d.gme.getPath().addListener(t,()=>o.onChangeGeometries.call(this,d,i))),n.addListener("click",()=>r.openPropsDialog.call(this,d,i)),this.mapElements[i]=d}},1580:function(t,i,n){"use strict";n.d(i,{processImage:function(){return r}});var o=n(21537);let r=(t,i)=>{if(i.rtf&&"#comment"===t.name&&t.attributes.nodeValue&&-1!==t.attributes.nodeValue.indexOf("<v:shape")){i.shapes||(i.shapes={});let n=i.jodit.create.fromHTML(t.attributes.nodeValue);return(0,o.toArray)(n.getElementsByTagName("v:shape")).forEach(t=>{i.shapes[t.id]=t.getAttribute("o:spid")}),t}if("img"!==t.name)return t;if(i.rtf&&t.attributes["v:shapes"]){let n=i.shapes?.[t.attributes["v:shapes"]];if(n){let o=i.imageMap??{};i.imageMap||(i.imageMap=o,s(i.rtf,"i","\\shppict",i.imageMap),s(i.rtf,"s","\\shp{",i.imageMap));let r=o[n.substring(7)];if(r){let i=[],n=r.hex.match(/[0-9a-f]{2}/gi);if(n){for(let t=0;t<n.length;t++){let o=parseInt(n[t],16);i.push(String.fromCharCode(o))}t.attributes.src="data:"+r.type+";base64,"+btoa(i.join(""))}}}}return t};function s(t,i,n,o){for(let r of t.split(n)){let t=r.split("shplid");if(1<t.length){let n,r=t[1],s="";for(let t=0;t<r.length&&!/[{ \r\n\\]/.test(r[t]);t++)s+=r[t];let a=r.split("bliptag");if(a&&a.length<2)continue;let l=null;if(a[0].indexOf("pngblip")?l="image/png":-1!==a[0].indexOf("jpegblip")&&(l="image/jpeg"),!l)continue;let c=a[1].split("}");if(c&&c.length<2)continue;if(2<c.length&&c[0].includes("blipuid"))n=c[1].split(" ");else{if((n=c[0].split(" "))&&n.length<2)continue;n.shift()}o[i+s]={hex:n.join(""),type:l}}}}},1808:function(t,i,n){"use strict";n.d(i,{UIMessages:function(){return l}});var o=n(87325),r=n(41180),s=n(62405),a=n(68389);let l=class t extends s.UIGroup{className(){return"UIMessages"}info(t,i){this.__message(t,"info",i)}success(t,i){this.__message(t,"success",i)}error(t,i){this.__message(t,"error",i)}message(t,i,n){this.__message(t,i,n)}__message(t,i="info",n){let o=t+":"+i;if(this.__messages.has(o))return void this.async.updateTimeout(o,n||this.options.defaultTimeout);if(!this.__box)throw Error("Container is not defined: "+o);this.__box.appendChild(this.container);let r=new a.UIMessage(this.j,{text:t,variant:i});this.append(r),this.__calcOffsets(),this.__messages.add(o);let s=this.__getRemoveCallback(r,o);this.j.e.on(r.container,"pointerdown",s),this.async.setTimeout(s,{label:o,timeout:n||this.options.defaultTimeout})}__getRemoveCallback(t,i){let n=o=>{o&&o.preventDefault(),t.isInDestruct||(this.async.clearTimeout(i),this.j.e.off(t.container,"pointerdown",n),this.__messages.delete(i),t.setMod("active",!1),this.async.setTimeout(()=>{this.remove(t),t.destruct(),this.__calcOffsets()},300))};return n}__calcOffsets(){let t=5;this.elements.forEach(i=>{(0,r.css)(i.container,"bottom",t+"px"),t+=i.container.offsetHeight+this.options.defaultOffset})}constructor(t,i,n={defaultTimeout:3e3,defaultOffset:5}){super(t),this.__box=i,this.options=n,this.__messages=new Set}};l=function(t,i,n,o){var r,s=arguments.length,a=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,n,o);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(s<3?r(a):s>3?r(i,n,a):r(i,n))||a);return s>3&&a&&Object.defineProperty(i,n,a),a}([o.component],l)},1830:function(t,i){"use strict";i.default={"Type something":"Start writing...",pencil:"Edit",Quadrate:"Square"}},1879:function(t,i,n){"use strict";n.r(i),i.default={Spellcheck:"Spellingcontrole"}},2020:function(t,i,n){"use strict";var o=n(96675),r=n(3091);i.default={...o,execute:r.execute}},2169:function(t,i,n){"use strict";var o=n(580),r=n(19306),s=n(41180);n(99823);let a=new Set;o.pluginSystem.add("fullsize",function(t){t.registerButton({name:"fullsize"});let i=!1,n=0,o=0,l=!1,c=()=>{let{container:r,events:a}=t;a&&(i?(n=(0,s.css)(r,"height",!0),o=(0,s.css)(r,"width",!0),(0,s.css)(r,{height:t.ow.innerHeight,width:t.ow.innerWidth}),l=!0):l&&(0,s.css)(r,{height:n||"auto",width:o||"auto"}))},u=n=>{var o;let{container:l,events:u}=t;if(l){if(void 0===n&&(n=!l.classList.contains("jodit_fullsize")),t.setMod("fullsize",n),t.o.fullsize=n,i=n,l.classList.toggle("jodit_fullsize",n),t.toolbar&&((0,r.isJoditObject)(t)&&(null==(o=t.toolbarContainer)||o.appendChild(t.toolbar.container)),(0,s.css)(t.toolbar.container,"width","auto")),n?a.add(l):a.delete(l),t.o.globalFullSize&&(1===a.size&&n||0===a.size&&!n)){let t=l.parentNode;for(;t&&t.nodeType!==Node.DOCUMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE;)t.classList.toggle("jodit_fullsize-box_true",n),t=t.parentNode;c()}u.fire("afterResize")}};t.o.globalFullSize&&t.e.on(t.ow,"resize",c),t.e.on("afterInit afterOpen",()=>{var i;t.toggleFullSize(null==(i=null==t?void 0:t.options)?void 0:i.fullsize)}).on("toggleFullSize",u).on("beforeDestruct",()=>{i&&u(!1)}).on("beforeDestruct",()=>{t.events&&t.e.off(t.ow,"resize",c)})})},2303:function(t,i,n){"use strict";n.d(i,{Jodit:function(){return Jodit}});var o,r=n(82758),s=n(65478),a=n(580),l=n(21537),c=n(41601),u=n(70231),d=n(6441),h=n(41409),p=function(t,i,n,o){var r,s=arguments.length,a=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,n,o);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(s<3?r(a):s>3?r(i,n,a):r(i,n))||a);return s>3&&a&&Object.defineProperty(i,n,a),a};let f="data-jodit-default-style-display",m="data-jodit-default-classes",g={contenteditable:!1},Jodit=o=class t extends h.ViewWithToolbar{className(){return"Jodit"}waitForReady(){return this.isReady?Promise.resolve(this):this.async.promise(t=>{this.hookStatus("ready",()=>t(this))})}static get ready(){return new Promise(t=>{a.eventEmitter.on("joditready",t)})}get text(){if(this.editor)return this.editor.innerText||"";let t=this.createInside.div();return t.innerHTML=this.getElementValue(),t.innerText||""}get defaultTimeout(){return(0,l.isNumber)(this.o.defaultTimeout)?this.o.defaultTimeout:d.Config.defaultOptions.defaultTimeout}static atom(t){return(0,l.markAsAtomic)(t)}static make(t,i){return new this(t,i)}static isJoditAssigned(t){return t&&(0,l.isJoditObject)(t.component)&&!t.component.isInDestruct}static get defaultOptions(){return d.Config.defaultOptions}get createInside(){return new h.Create(()=>this.ed,this.o.createAttributes)}__setPlaceField(t,i){this.currentPlace||(this.currentPlace={},this.places=[this.currentPlace]),this.currentPlace[t]=i}get element(){return this.currentPlace.element}get editor(){return this.currentPlace.editor}set editor(t){this.__setPlaceField("editor",t)}get container(){return this.currentPlace.container}set container(t){this.__setPlaceField("container",t)}get workplace(){return this.currentPlace.workplace}get message(){return this.getMessageModule(this.workplace)}get statusbar(){return this.currentPlace.statusbar}get iframe(){return this.currentPlace.iframe}set iframe(t){this.__setPlaceField("iframe",t)}get history(){return this.currentPlace.history}get editorWindow(){return this.currentPlace.editorWindow}set editorWindow(t){this.__setPlaceField("editorWindow",t)}get ew(){return this.editorWindow}get editorDocument(){return this.currentPlace.editorWindow.document}get ed(){return this.editorDocument}get options(){return this.currentPlace.options}set options(t){this.__options=t,this.__setPlaceField("options",t)}get s(){return this.selection}get uploader(){return this.getInstance("Uploader",this.o.uploader)}get filebrowser(){let t=this,i=(0,l.ConfigProto)({defaultTimeout:t.defaultTimeout,uploader:t.o.uploader,language:t.o.language,license:t.o.license,theme:t.o.theme,shadowRoot:t.o.shadowRoot,defaultCallback(i){i.files&&i.files.length&&i.files.forEach((n,o)=>{let r=i.baseurl+n;i.isImages&&i.isImages[o]?t.s.insertImage(r,null,t.o.imageDefaultWidth):t.s.insertNode(t.createInside.fromHTML(`<a href='${r}' title='${r}'>${r}</a>`))})}},this.o.filebrowser);return t.getInstance("FileBrowser",i)}get mode(){return this.__mode}set mode(t){this.setMode(t)}getNativeEditorValue(){let t=this.e.fire("beforeGetNativeEditorValue");return(0,l.isString)(t)?t:this.editor?this.editor.innerHTML:this.getElementValue()}setNativeEditorValue(t){let i={value:t};!this.e.fire("beforeSetNativeEditorValue",i)&&this.editor&&(this.editor.innerHTML=i.value)}get value(){return this.getEditorValue()}set value(t){this.setEditorValue(t),this.history.__processChanges()}synchronizeValues(){this.__imdSynchronizeValues()}__imdSynchronizeValues(){this.setEditorValue()}getEditorValue(t=!0,i){let n;if(void 0!==(n=this.e.fire("beforeGetValueFromEditor",i)))return n;n=this.getNativeEditorValue().replace(r.INVISIBLE_SPACE_REG_EXP(),""),t&&(n=n.replace(/<span[^>]+id="jodit-selection_marker_[^>]+><\/span>/g,"")),"<br>"===n&&(n="");let o={value:n};return this.e.fire("afterGetValueFromEditor",o,i),o.value}setEditorValue(t){let i=this.e.fire("beforeSetValueToEditor",t);if(!1===i)return;if((0,l.isString)(i)&&(t=i),!this.editor){void 0!==t&&this.__setElementValue(t);return}if(!(0,l.isString)(t)&&!(0,l.isVoid)(t))throw(0,l.error)("value must be string");(0,l.isVoid)(t)||this.getNativeEditorValue()===t||this.setNativeEditorValue(t),this.e.fire("postProcessSetEditorValue");let n=this.getElementValue(),o=this.getEditorValue();if(!this.__isSilentChange&&n!==o&&this.__callChangeCount<r.SAFE_COUNT_CHANGE_CALL){this.__setElementValue(o),this.__callChangeCount+=1,r.IS_PROD||this.__callChangeCount;try{this.history.__upTick(),this.e.fire("change",o,n),this.e.fire(this.history,"change",o,n)}finally{this.__callChangeCount=0}}}updateElementValue(){this.__setElementValue(this.getEditorValue())}getElementValue(){return void 0!==this.element.value?this.element.value:this.element.innerHTML}__setElementValue(t){if(!(0,l.isString)(t))throw(0,l.error)("value must be string");if(this.element!==this.container&&t!==this.getElementValue()){let i={value:t},n=this.e.fire("beforeSetElementValue",i);(0,l.callPromise)(n,()=>{void 0!==this.element.value?this.element.value=i.value:this.element.innerHTML=i.value,this.e.fire("afterSetElementValue",i)})}}registerCommand(t,i,n){let o=t.toLowerCase(),r=this.commands.get(o);if(void 0===r&&(r=[],this.commands.set(o,r)),r.push(i),!(0,l.isFunction)(i)){let r=this.o.commandToHotkeys[o]||this.o.commandToHotkeys[t]||i.hotkeys;r&&this.registerHotkeyToCommand(r,o,null==n?void 0:n.stopPropagation)}return this}registerHotkeyToCommand(t,i,n=!0){let o=(0,l.asArray)(t).map(l.normalizeKeyAliases).map(t=>t+".hotkey").join(" ");this.e.off(o).on(o,(t,o)=>(o&&(o.shouldStop=null==n||n),this.execCommand(i)))}execCommand(t,i,n,...o){let s;if(this.s.isFocused()||this.s.focus(),!this.o.readonly||this.o.allowCommandsInReadOnly.includes(t)){if(t=t.toLowerCase(),!1!==(s=this.e.fire("beforeCommand"+(0,l.ucfirst)(t),i,n,...o))&&(s=this.e.fire("beforeCommand",t,i,n,...o)),!1!==s&&(s=this.__execCustomCommands(t,i,n,...o)),!1!==s){this.s.focus();try{s=this.nativeExecCommand(t,i,n)}catch(t){if(!r.IS_PROD)throw t}}return this.e.fire("afterCommand",t,i,n),this.__imdSynchronizeValues(),s}}nativeExecCommand(t,i,n){this.__isSilentChange=!0;try{return this.ed.execCommand(t,i,n)}finally{this.__isSilentChange=!1}}__execCustomCommands(t,i,n,...o){t=t.toLowerCase();let r=this.commands.get(t);if(void 0!==r){let s;return r.forEach(r=>{let a=((0,l.isFunction)(r)?r:r.exec).call(this,t,i,n,...o);void 0!==a&&(s=a)}),s}}lock(t="any"){return!!super.lock(t)&&(this.__selectionLocked=this.s.save(),this.s.clear(),this.container.classList.add("jodit_lock"),this.e.fire("lock",!0),!0)}unlock(){return!!super.unlock()&&(this.container.classList.remove("jodit_lock"),this.__selectionLocked&&this.s.restore(),this.e.fire("lock",!1),!0)}getMode(){return this.mode}isEditorMode(){return this.getRealMode()===r.MODE_WYSIWYG}getRealMode(){if(this.getMode()!==r.MODE_SPLIT)return this.getMode();let t=this.od.activeElement;return t&&(t===this.iframe||h.Dom.isOrContains(this.editor,t)||h.Dom.isOrContains(this.toolbar.container,t))?r.MODE_WYSIWYG:r.MODE_SOURCE}setMode(t){let i=this.getMode(),n={mode:parseInt(t.toString(),10)},o=["jodit-wysiwyg_mode","jodit-source__mode","jodit_split_mode"];!1!==this.e.fire("beforeSetMode",n)&&(this.__mode=[r.MODE_SOURCE,r.MODE_WYSIWYG,r.MODE_SPLIT].includes(n.mode)?n.mode:r.MODE_WYSIWYG,this.o.saveModeInStorage&&this.storage.set("jodit_default_mode",this.mode),o.forEach(t=>{this.container.classList.remove(t)}),this.container.classList.add(o[this.mode-1]),i!==this.getMode()&&this.e.fire("afterSetMode"))}toggleMode(){let t=this.getMode();[r.MODE_SOURCE,r.MODE_WYSIWYG,this.o.useSplitMode?r.MODE_SPLIT:9].includes(t+1)?t+=1:t=r.MODE_WYSIWYG,this.setMode(t)}setDisabled(t){this.o.disabled=t;let i=this.__wasReadOnly;this.setReadOnly(t||i),this.__wasReadOnly=i,this.editor&&(this.editor.setAttribute("aria-disabled",t.toString()),this.container.classList.toggle("jodit_disabled",t),this.e.fire("disabled",t))}getDisabled(){return this.o.disabled}setReadOnly(t){this.__wasReadOnly!==t&&(this.__wasReadOnly=t,this.o.readonly=t,t?this.editor&&this.editor.removeAttribute("contenteditable"):this.editor&&this.editor.setAttribute("contenteditable","true"),this.e&&this.e.fire("readonly",t))}getReadOnly(){return this.o.readonly}focus(){this.getMode()!==r.MODE_SOURCE&&this.s.focus()}get isFocused(){return this.s.isFocused()}beforeInitHook(){}afterInitHook(){}initOptions(t){this.options=(0,l.ConfigProto)(t||{},d.Config.defaultOptions)}initOwners(){this.editorWindow=this.o.ownerWindow,this.ownerWindow=this.o.ownerWindow}addPlace(t,i){let n=(0,l.resolveElement)(t,this.o.shadowRoot||this.od);this.attachEvents(i),n.attributes&&(0,l.toArray)(n.attributes).forEach(t=>{let n=t.name,o=t.value;void 0===d.Config.defaultOptions[n]||i&&void 0!==i[n]||(-1!==["readonly","disabled"].indexOf(n)&&(o=""===o||"true"===o),/^[0-9]+(\.)?([0-9]+)?$/.test(o.toString())&&(o=Number(o)),this.options[n]=o)});let o=this.c.div("jodit-container");o.classList.add("jodit"),o.classList.add("jodit-container"),o.classList.add("jodit_theme_"+(this.o.theme||"default")),b(this.o.className,o),this.o.containerStyle&&(0,l.css)(o,this.o.containerStyle);let{styleValues:r}=this.o;Object.keys(r).forEach(t=>{let i=(0,l.kebabCase)(t);o.style.setProperty("--jd-"+i,r[t])}),o.setAttribute("contenteditable","false");let s=null;this.o.inline&&(-1===["TEXTAREA","INPUT"].indexOf(n.nodeName)&&(o=n,n.setAttribute(m,n.className.toString()),s=o.innerHTML,o.innerHTML=""),o.classList.add("jodit_inline"),o.classList.add("jodit-container")),n!==o&&(n.style.display&&n.setAttribute(f,n.style.display),n.style.display="none");let a="workplace-slot",c=this.c.div(this.getFullElName(a,"top"),g);o.appendChild(c);let u=this.c.div(this.getFullElName(a,"center"),g),p=this.c.div("jodit-workplace",g),v=this.c.div(this.getFullElName(a,"left"),g),y=this.c.div(this.getFullElName(a,"right"),g);u.appendChild(v),u.appendChild(p),u.appendChild(y),o.appendChild(u);let w=this.c.div(this.getFullElName(a,"bottom"),g);o.appendChild(w),n.parentNode&&n!==o&&n.parentNode.insertBefore(o,n),Object.defineProperty(n,"component",{enumerable:!1,configurable:!0,value:this});let _=this.c.div("jodit-wysiwyg",{contenteditable:!0,"aria-disabled":!1,tabindex:this.o.tabIndex});p.appendChild(_);let C={editor:_,element:n,container:o,workplace:p,slots:{top:c,bottom:w,center:u,left:v,right:y},statusbar:new h.StatusBar(this,o),options:this.isReady?(0,l.ConfigProto)(i||{},d.Config.defaultOptions):this.options,history:new h.History(this),editorWindow:this.ow};this.__elementToPlace.set(_,C),this.setCurrentPlace(C),this.places.push(C),this.setNativeEditorValue(this.getElementValue());let k=this.__initEditor(s),S=this.options,x=()=>{S.enableDragAndDropFileToEditor&&S.uploader&&(S.uploader.url||S.uploader.insertImageAsBase64URI)&&this.uploader.bind(this.editor),this.__elementToPlace.get(this.editor)||this.__elementToPlace.set(this.editor,C),this.e.fire("afterAddPlace",C)};return(0,l.callPromise)(k,x)}addDisclaimer(t){this.workplace.appendChild(t)}setCurrentPlace(t){this.currentPlace!==t&&(this.isEditorMode()||this.setMode(r.MODE_WYSIWYG),this.currentPlace=t,this.buildToolbar(),this.isReady&&this.e.fire("changePlace",t))}__initEditor(t){let i=this.__createEditor();return(0,l.callPromise)(i,()=>{if(this.isInDestruct)return;if(this.element!==this.container){let t=this.getElementValue();t!==this.getEditorValue()&&this.setEditorValue(t)}else null!=t&&this.setEditorValue(t);let i=this.o.defaultMode;if(this.o.saveModeInStorage){let t=this.storage.get("jodit_default_mode");"string"==typeof t&&(i=parseInt(t,10))}this.setMode(i),this.o.readonly&&(this.__wasReadOnly=!1,this.setReadOnly(!0)),this.o.disabled&&this.setDisabled(!0);try{this.ed.execCommand("defaultParagraphSeparator",!1,this.o.enter.toLowerCase())}catch(t){}})}__createEditor(){let t=this.editor,i=this.e.fire("createEditor",this);return(0,l.callPromise)(i,()=>{!this.isInDestruct&&((!1===i||(0,l.isPromise)(i))&&h.Dom.safeRemove(t),b(this.o.editorClassName,this.editor),this.o.style&&(0,l.css)(this.editor,this.o.style),this.e.on("synchro",()=>{this.setEditorValue()}).on("focus",()=>{this.editorIsActive=!0}).on("blur",()=>this.editorIsActive=!1),this.__prepareWYSIWYGEditor(),this.o.triggerChangeEvent&&this.e.on("change",this.async.debounce(()=>{this.e&&this.e.fire(this.element,"change")},this.defaultTimeout)))})}__prepareWYSIWYGEditor(){let{editor:t}=this;if(this.o.direction){let t="rtl"===this.o.direction.toLowerCase()?"rtl":"ltr";this.editor.style.direction=t,this.editor.setAttribute("dir",t),this.container.style.direction=t,this.container.setAttribute("dir",t),this.toolbar.setDirection(t)}this.e.on(t,"mousedown touchstart focus",()=>{let i=this.__elementToPlace.get(t);i&&this.setCurrentPlace(i)}).on(t,"compositionend",this.synchronizeValues).on(t,"selectionchange selectionstart keydown keyup input keypress dblclick mousedown mouseup click copy cut dragstart drop dragover paste resize touchstart touchend focus blur",t=>{if(!this.o.readonly&&!this.__isSilentChange&&(!(t instanceof this.ew.KeyboardEvent)||!t.isComposing)&&this.e&&this.e.fire){if(!1===this.e.fire(t.type,t))return!1;this.synchronizeValues()}})}fetch(t,i){let n=new c.Ajax({url:t,...i},this.o.defaultAjaxOptions),o=()=>{this.e.off("beforeDestruct",o),this.progressbar.progress(100).hide(),n.destruct()};this.e.one("beforeDestruct",o),this.progressbar.show().progress(30);let r=n.send();return r.finally(o).catch(()=>null),r}destruct(){var t,i;if(this.isInDestruct)return;this.setStatus(h.STATUSES.beforeDestruct),this.__elementToPlace.clear(),null==(t=(0,s.cached)(this,"storage"))||t.clear(),null==(i=(0,s.cached)(this,"buffer"))||i.clear(),this.commands.clear(),this.__selectionLocked=null,this.e.off(this.ow,"resize"),this.e.off(this.ow),this.e.off(this.od),this.e.off(this.od.body);let n=this.editor?this.getEditorValue():"";this.places.forEach(({container:t,workplace:i,statusbar:o,element:r,iframe:s,editor:a,history:c})=>{if(r){if(r!==t)if(r.hasAttribute(f)){let t=(0,l.attr)(r,f);t&&(r.style.display=t,r.removeAttribute(f))}else r.style.display="";else r.hasAttribute(m)&&(r.className=(0,l.attr)(r,m)||"",r.removeAttribute(m));r.hasAttribute("style")&&!(0,l.attr)(r,"style")&&r.removeAttribute("style"),o.destruct(),this.e.off(t),this.e.off(r),this.e.off(a),h.Dom.safeRemove(i),h.Dom.safeRemove(a),t!==r&&h.Dom.safeRemove(t),Object.defineProperty(r,"component",{enumerable:!1,configurable:!0,value:null}),h.Dom.safeRemove(s),t===r&&(r.innerHTML=n),c.destruct()}}),this.places.length=0,this.currentPlace={},delete a.instances[this.id],super.destruct()}constructor(t,i){super(i,!0),this.isJodit=!0,this.commands=new Map,this.__selectionLocked=null,this.__wasReadOnly=!1,this.editorIsActive=!1,this.__mode=r.MODE_WYSIWYG,this.__callChangeCount=0,this.__isSilentChange=!1,this.currentPlace={options:this.__options,container:this.__container},this.places=[],this.__elementToPlace=new Map;try{const i=(0,l.resolveElement)(t,this.options.shadowRoot||this.od);if(o.isJoditAssigned(i))return i.component}catch(t){if(!r.IS_PROD)throw t;throw this.destruct(),t}this.setStatus(h.STATUSES.beforeInit),this.id=(0,l.attr)((0,l.resolveElement)(t,this.o.shadowRoot||this.od),"id")||new Date().getTime().toString(),a.instances[this.id]=this,this.attachEvents(i),this.e.on(this.ow,"resize",()=>{this.e&&this.e.fire("resize")}),this.e.on("prepareWYSIWYGEditor",this.__prepareWYSIWYGEditor),this.selection=new h.Selection(this);const n=this.beforeInitHook();(0,l.callPromise)(n,()=>{if(this.isInDestruct)return;this.e.fire("beforeInit",this),a.pluginSystem.__init(this),this.e.fire("afterPluginSystemInit",this),this.e.on("changePlace",()=>{this.setReadOnly(this.o.readonly),this.setDisabled(this.o.disabled)}),this.places.length=0;let n=this.addPlace(t,i);a.instances[this.id]=this;let o=()=>{this.isInDestruct||(this.e&&this.e.fire("afterInit",this),(0,l.callPromise)(this.afterInitHook()),this.setStatus(h.STATUSES.ready),this.e.fire("afterConstructor",this))};(0,l.callPromise)(n,o)})}};function b(t,i){t&&t.split(/\s+/).forEach(t=>i.classList.add(t))}Jodit.fatMode=r.FAT_MODE,Jodit.plugins=a.pluginSystem,Jodit.modules=a.modules,Jodit.ns=a.modules,Jodit.decorators={},Jodit.constants=r,Jodit.instances=a.instances,Jodit.lang=r.lang,Jodit.core={Plugin:h.Plugin},p([s.cache],Jodit.prototype,"createInside",null),p([s.cache],Jodit.prototype,"message",null),p([s.cache],Jodit.prototype,"s",null),p([s.cache],Jodit.prototype,"uploader",null),p([s.cache],Jodit.prototype,"filebrowser",null),p([(0,s.throttle)()],Jodit.prototype,"synchronizeValues",null),p([(0,s.watch)(":internalChange")],Jodit.prototype,"updateElementValue",null),p([s.autobind],Jodit.prototype,"__prepareWYSIWYGEditor",null),Jodit=o=p([(0,s.derive)(u.Dlgs)],Jodit)},2525:function(t,i,n){"use strict";n.d(i,{UIBlock:function(){return o.UIBlock},UICheckbox:function(){return s.UICheckbox},UIFileInput:function(){return s.UIFileInput},UIForm:function(){return r.UIForm},UIInput:function(){return s.UIInput},UISelect:function(){return s.UISelect},UITextArea:function(){return s.UITextArea}});var o=n(19070),r=n(86327),s=n(8959)},2536:function(t,i){"use strict";i.default={"copy-format":"Copiar formato"}},2621:function(t,i,n){"use strict";n.d(i,{IndexedDBProvider:function(){return r},canUseIndexedDB:function(){return l},clearUseIndexedDBCache:function(){return a}});var o=n(82758);class r{getDB(){return this.dbPromise||(this.dbPromise=new Promise((t,i)=>{let n=indexedDB.open(this.dbName,this.DB_VERSION);n.onerror=()=>{i(n.error)},n.onsuccess=()=>{t(n.result)},n.onupgradeneeded=t=>{let i=t.target.result;i.objectStoreNames.contains(this.storeName)||i.createObjectStore(this.storeName)}})),this.dbPromise}async performTransaction(t,i){try{let n=(await this.getDB()).transaction([this.storeName],t).objectStore(this.storeName),o=i(n);return new Promise((t,i)=>{o.onsuccess=()=>{t(o.result)},o.onerror=()=>{i(o.error)}})}catch(t){return Promise.reject(t)}}async set(t,i){try{await this.performTransaction("readwrite",n=>n.put(i,t))}catch(t){o.IS_PROD}return this}async delete(t){try{await this.performTransaction("readwrite",i=>i.delete(t))}catch(t){}return this}async get(t){try{return await this.performTransaction("readonly",i=>i.get(t))}catch(t){return}}async exists(t){try{let i=await this.performTransaction("readonly",i=>i.get(t));return void 0!==i}catch(t){return!1}}async clear(){try{await this.performTransaction("readwrite",t=>t.clear())}catch(t){}return this}async close(){if(this.dbPromise){try{(await this.dbPromise).close()}catch(t){}this.dbPromise=null}}async keys(){try{let t=await this.performTransaction("readonly",t=>t.getAllKeys());return t&&"object"==typeof t&&"then"in t&&(t=await t),t.map(t=>t+"")}catch(t){return[]}}async values(){try{let t=await this.performTransaction("readonly",t=>t.getAll());return t&&"object"==typeof t&&"then"in t&&(t=await t),t}catch(t){return[]}}async entries(){try{let[t,i]=await Promise.all([this.keys(),this.values()]);return t.map((t,n)=>[t,i[n]])}catch(t){return[]}}constructor(t="JoditDB",i="keyValueStore"){this.dbName=t,this.dbPromise=null,this.DB_VERSION=1,this.storeName=i}}let s=null;function a(){s=null}async function l(){if(null!=s)return s;try{if("u"<typeof indexedDB)return s=!1,!1;let t="___Jodit___"+Math.random().toString(),i=indexedDB.open(t);return s=await new Promise(n=>{i.onerror=()=>{n(!1)},i.onsuccess=()=>{indexedDB.deleteDatabase(t),n(!0)}})}catch(t){return s=!1,!1}}},2692:function(t,i,n){"use strict";n.d(i,{JoditPro:function(){return l}});var o=n(82758),r=n(63799),s=n(41180),a=n(86019);class l extends a.Jodit{static make(t,i){return new this(t,i)}beforeInitHook(){if(o.IS_PROD&&!o.IS_TEST&&this.o.loadExternalConfig)return(0,r.appendScriptAsync)(this,this.basePath+"config.js")}afterInitHook(){(async()=>{if(await this.e.fire("checkReserve",location.host)!=="normal"){if(this.isInDestruct)return;let t=this.c.div("",'Trial version. Buy <a href="https://xdsoft.net/jodit/pro/">Jodit Pro</a>');o.IS_TEST||o.IS_PROD,(0,s.css)(t,{position:"absolute",color:"red",right:10,bottom:10}),this.addDisclaimer(t)}})().catch(()=>null),super.afterInitHook()}getVersion(){return"PRO "+o.APP_VERSION}}},2748:function(t,i,n){"use strict";n.d(i,{Dom:function(){return y}});var o=n(82758),r=n(4510),s=n(68345),a=n(23282),l=n(58487),c=n(42320),u=n(70799),d=n(86068),h=n(49055),p=n(38837),f=n(29960),m=n(41180),g=n(86583),b=n(89890),v=n(37790);class y{static detach(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}static wrapNextInline(t,i,n){let o,r=t;n.s.save();let s=!1;do s=!1,(o=r.nextSibling)&&!y.isBlock(o)&&!y.isTag(o,"br")&&(s=!0,r=o);while(s)return y.__wrapElements(i,n,t,r)}static __wrapElements(t,i,n,o){let r=(0,u.isString)(t)?i.createInside.element(t):t;n.parentNode&&n.parentNode.insertBefore(r,n);let s=n;for(;s&&(s=n.nextSibling,r.appendChild(n),n!==o&&s);)n=s;return i.s.restore(),r}static wrapInline(t,i,n){let o,r=t,s=t;n.s.save();let a=!1;do a=!1,(o=r.previousSibling)&&!y.isBlock(o)&&(a=!0,r=o);while(a)do a=!1,(o=s.nextSibling)&&!y.isBlock(o)&&(a=!0,s=o);while(a)return y.__wrapElements(i,n,r,s)}static wrap(t,i,n){let o=(0,u.isString)(i)?n.element(i):i;if(y.isNode(t)){if(!t.parentNode)throw(0,b.error)("Element should be in DOM");t.parentNode.insertBefore(o,t),o.appendChild(t)}else{let i=t.extractContents();t.insertNode(o),o.appendChild(i)}return o}static unwrap(t){let i=t.parentNode;if(i){for(;t.firstChild;)i.insertBefore(t.firstChild,t);y.safeRemove(t)}}static between(t,i,n){let o=t;for(;o&&o!==i&&!(t!==o&&n(o));){let t=o.firstChild||o.nextSibling;if(!t){for(;o&&!o.nextSibling;)o=o.parentNode;t=null==o?void 0:o.nextSibling}o=t}}static replace(t,i,n,o=!1,s=!1){let a;if((0,l.isHTML)(i)&&((0,p.assert)(n,"Need create instance for new tag"),i=n.fromHTML(i)),(0,u.isString)(i)?((0,p.assert)(n,"Need create instance for new tag"),a=n.element(i)):a=i,!s)for(;t.firstChild;)a.appendChild(t.firstChild);return o&&y.isElement(t)&&y.isElement(a)&&(0,r.toArray)(t.attributes).forEach(t=>{a.setAttribute(t.name,t.value)}),t.parentNode&&t.parentNode.replaceChild(a,t),a}static isEmptyTextNode(t){return y.isText(t)&&(!t.nodeValue||0===t.nodeValue.replace(o.INVISIBLE_SPACE_REG_EXP(),"").trim().length)}static isEmptyContent(t){return y.each(t,t=>y.isEmptyTextNode(t))}static isContentEditable(t,i){return y.isNode(t)&&!y.closest(t,t=>y.isElement(t)&&"false"===t.getAttribute("contenteditable"),i)}static isEmpty(t,i=o.NO_EMPTY_TAGS){let n;if(!t)return!0;n=(0,a.isFunction)(i)?i:t=>i.has(t.nodeName.toLowerCase());let r=t=>null==t.nodeValue||0===(0,h.trim)(t.nodeValue).length;return y.isText(t)?r(t):!(y.isElement(t)&&n(t))&&y.each(t,t=>{if(y.isText(t)&&!r(t)||y.isElement(t)&&n(t))return!1})}static isNode(t){return!!(t&&(0,u.isString)(t.node